Browse Source

Add delta_height variable in lieu of using home_offset

Thomas Moore 7 years ago
parent
commit
658e1ebe5a
5 changed files with 84 additions and 92 deletions
  1. 1
    1
      Marlin/Conditionals_post.h
  2. 2
    1
      Marlin/Marlin.h
  3. 24
    18
      Marlin/Marlin_main.cpp
  4. 56
    67
      Marlin/configuration_store.cpp
  5. 1
    5
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/Conditionals_post.h View File

1030
   // Updated G92 behavior shifts the workspace
1030
   // Updated G92 behavior shifts the workspace
1031
   #define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
1031
   #define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
1032
   // The home offset also shifts the coordinate space
1032
   // The home offset also shifts the coordinate space
1033
-  #define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DELTA))
1033
+  #define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA))
1034
   // Either offset yields extra calculations on all moves
1034
   // Either offset yields extra calculations on all moves
1035
   #define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET)
1035
   #define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET)
1036
   // M206 doesn't apply to DELTA
1036
   // M206 doesn't apply to DELTA

+ 2
- 1
Marlin/Marlin.h View File

304
 #endif
304
 #endif
305
 
305
 
306
 #if ENABLED(DELTA)
306
 #if ENABLED(DELTA)
307
-  extern float delta_endstop_adj[ABC],
307
+  extern float delta_height,
308
+               delta_endstop_adj[ABC],
308
                delta_radius,
309
                delta_radius,
309
                delta_diagonal_rod,
310
                delta_diagonal_rod,
310
                delta_calibration_radius,
311
                delta_calibration_radius,

+ 24
- 18
Marlin/Marlin_main.cpp View File

627
   float delta[ABC];
627
   float delta[ABC];
628
 
628
 
629
   // Initialized by settings.load()
629
   // Initialized by settings.load()
630
-  float delta_endstop_adj[ABC] = { 0 },
630
+  float delta_height,
631
+        delta_endstop_adj[ABC] = { 0 },
631
         delta_radius,
632
         delta_radius,
632
         delta_tower_angle_trim[ABC],
633
         delta_tower_angle_trim[ABC],
633
         delta_tower[ABC][2],
634
         delta_tower[ABC][2],
1443
           soft_endstop_max[axis] = base_max_pos(axis) + offs;
1444
           soft_endstop_max[axis] = base_max_pos(axis) + offs;
1444
         }
1445
         }
1445
       }
1446
       }
1447
+    #elif ENABLED(DELTA)
1448
+      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1449
+      soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis)) + offs;
1450
+    #else
1451
+      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1452
+      soft_endstop_max[axis] = base_max_pos(axis) + offs;
1446
     #endif
1453
     #endif
1447
 
1454
 
1448
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1455
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1568
       soft_endstop_max[axis] = base_max_pos(axis); // + (cartes[axis] - base_home_pos(axis));
1575
       soft_endstop_max[axis] = base_max_pos(axis); // + (cartes[axis] - base_home_pos(axis));
1569
     }
1576
     }
1570
     else
1577
     else
1578
+  #elif ENABLED(DELTA)
1579
+    if (axis == Z_AXIS)
1580
+      current_position[axis] = delta_height;
1581
+    else
1571
   #endif
1582
   #endif
1572
   {
1583
   {
1573
     current_position[axis] = base_home_pos(axis);
1584
     current_position[axis] = base_home_pos(axis);
2378
       }
2389
       }
2379
     #endif
2390
     #endif
2380
 
2391
 
2381
-    return current_position[Z_AXIS] + zprobe_zoffset
2382
-      #if ENABLED(DELTA)
2383
-        + home_offset[Z_AXIS] // Account for delta height adjustment
2384
-      #endif
2385
-    ;
2392
+    return current_position[Z_AXIS] + zprobe_zoffset;
2386
   }
2393
   }
2387
 
2394
 
2388
   /**
2395
   /**
3931
     sync_plan_position();
3938
     sync_plan_position();
3932
 
3939
 
3933
     // Move all carriages together linearly until an endstop is hit.
3940
     // Move all carriages together linearly until an endstop is hit.
3934
-    current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (DELTA_HEIGHT + home_offset[Z_AXIS] + 10);
3941
+    current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10);
3935
     feedrate_mm_s = homing_feedrate(X_AXIS);
3942
     feedrate_mm_s = homing_feedrate(X_AXIS);
3936
     line_to_current_position();
3943
     line_to_current_position();
3937
     stepper.synchronize();
3944
     stepper.synchronize();
3938
 
3945
 
3939
     // If an endstop was not hit, then damage can occur if homing is continued.
3946
     // If an endstop was not hit, then damage can occur if homing is continued.
3940
-    // This can occur if the delta height (DELTA_HEIGHT + home_offset[Z_AXIS]) is
3941
-    // not set correctly.
3947
+    // This can occur if the delta height not set correctly.
3942
     if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
3948
     if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
3943
       LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
3949
       LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
3944
       SERIAL_ERROR_START();
3950
       SERIAL_ERROR_START();
5483
   }
5489
   }
5484
 
5490
 
5485
   static void print_G33_settings(const bool end_stops, const bool tower_angles) {
5491
   static void print_G33_settings(const bool end_stops, const bool tower_angles) {
5486
-    SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5492
+    SERIAL_PROTOCOLPAIR(".Height:", delta_height);
5487
     if (end_stops) {
5493
     if (end_stops) {
5488
       print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
5494
       print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
5489
       print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
5495
       print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
5731
         delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
5737
         delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
5732
         delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
5738
         delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
5733
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5739
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5734
-        home_offset[Z_AXIS] -= z_temp;
5740
+        delta_height -= z_temp;
5735
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5741
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5736
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5742
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5737
 
5743
 
5751
         delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
5757
         delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
5752
         delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
5758
         delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
5753
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5759
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5754
-        home_offset[Z_AXIS] -= z_temp;
5760
+        delta_height -= z_temp;
5755
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5761
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5756
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5762
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5757
         switch (axis) {
5763
         switch (axis) {
5860
             delta_endstop_adj[C_AXIS]
5866
             delta_endstop_adj[C_AXIS]
5861
           },
5867
           },
5862
           dr_old = delta_radius,
5868
           dr_old = delta_radius,
5863
-          zh_old = home_offset[Z_AXIS],
5869
+          zh_old = delta_height,
5864
           ta_old[ABC] = {
5870
           ta_old[ABC] = {
5865
             delta_tower_angle_trim[A_AXIS],
5871
             delta_tower_angle_trim[A_AXIS],
5866
             delta_tower_angle_trim[B_AXIS],
5872
             delta_tower_angle_trim[B_AXIS],
5939
         if (zero_std_dev < zero_std_dev_min) {
5945
         if (zero_std_dev < zero_std_dev_min) {
5940
           COPY(e_old, delta_endstop_adj);
5946
           COPY(e_old, delta_endstop_adj);
5941
           dr_old = delta_radius;
5947
           dr_old = delta_radius;
5942
-          zh_old = home_offset[Z_AXIS];
5948
+          zh_old = delta_height;
5943
           COPY(ta_old, delta_tower_angle_trim);
5949
           COPY(ta_old, delta_tower_angle_trim);
5944
         }
5950
         }
5945
 
5951
 
6023
       else if (zero_std_dev >= test_precision) {   // step one back
6029
       else if (zero_std_dev >= test_precision) {   // step one back
6024
         COPY(delta_endstop_adj, e_old);
6030
         COPY(delta_endstop_adj, e_old);
6025
         delta_radius = dr_old;
6031
         delta_radius = dr_old;
6026
-        home_offset[Z_AXIS] = zh_old;
6032
+        delta_height = zh_old;
6027
         COPY(delta_tower_angle_trim, ta_old);
6033
         COPY(delta_tower_angle_trim, ta_old);
6028
       }
6034
       }
6029
 
6035
 
6037
 
6043
 
6038
         // adjust delta_height and endstops by the max amount
6044
         // adjust delta_height and endstops by the max amount
6039
         const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
6045
         const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
6040
-        home_offset[Z_AXIS] -= z_temp;
6046
+        delta_height -= z_temp;
6041
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
6047
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
6042
       }
6048
       }
6043
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
6049
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
8993
    */
8999
    */
8994
   inline void gcode_M665() {
9000
   inline void gcode_M665() {
8995
     if (parser.seen('H')) {
9001
     if (parser.seen('H')) {
8996
-      home_offset[Z_AXIS] = parser.value_linear_units() - DELTA_HEIGHT;
9002
+      delta_height = parser.value_linear_units();
8997
       update_software_endstops(Z_AXIS);
9003
       update_software_endstops(Z_AXIS);
8998
     }
9004
     }
8999
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();
9005
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();
10101
       #endif
10107
       #endif
10102
 
10108
 
10103
       #if ENABLED(DELTA) // correct the delta_height
10109
       #if ENABLED(DELTA) // correct the delta_height
10104
-        home_offset[Z_AXIS] -= diff;
10110
+        delta_height -= diff;
10105
       #endif
10111
       #endif
10106
     }
10112
     }
10107
 
10113
 

+ 56
- 67
Marlin/configuration_store.cpp View File

36
  *
36
  *
37
  */
37
  */
38
 
38
 
39
-#define EEPROM_VERSION "V44"
39
+#define EEPROM_VERSION "V45"
40
 
40
 
41
 // Change EEPROM version if these are changed:
41
 // Change EEPROM version if these are changed:
42
 #define EEPROM_OFFSET 100
42
 #define EEPROM_OFFSET 100
91
  *  324  G29 A     planner.leveling_active          (bool)
91
  *  324  G29 A     planner.leveling_active          (bool)
92
  *  325  G29 S     ubl.storage_slot                 (int8_t)
92
  *  325  G29 S     ubl.storage_slot                 (int8_t)
93
  *
93
  *
94
- * DELTA:                                           40 bytes
95
- *  352  M666 XYZ  delta_endstop_adj                (float x3)
96
- *  364  M665 R    delta_radius                     (float)
97
- *  368  M665 L    delta_diagonal_rod               (float)
98
- *  372  M665 S    delta_segments_per_second        (float)
99
- *  376  M665 B    delta_calibration_radius         (float)
100
- *  380  M665 X    delta_tower_angle_trim[A]        (float)
101
- *  384  M665 Y    delta_tower_angle_trim[B]        (float)
102
- *  388  M665 Z    delta_tower_angle_trim[C]        (float)
94
+ * DELTA:                                           44 bytes
95
+ *  352  M666 H    delta_height                     (float)
96
+ *  364  M666 XYZ  delta_endstop_adj                (float x3)
97
+ *  368  M665 R    delta_radius                     (float)
98
+ *  372  M665 L    delta_diagonal_rod               (float)
99
+ *  376  M665 S    delta_segments_per_second        (float)
100
+ *  380  M665 B    delta_calibration_radius         (float)
101
+ *  384  M665 X    delta_tower_angle_trim[A]        (float)
102
+ *  388  M665 Y    delta_tower_angle_trim[B]        (float)
103
+ *  392  M665 Z    delta_tower_angle_trim[C]        (float)
103
  *
104
  *
104
  * [XYZ]_DUAL_ENDSTOPS:                             12 bytes
105
  * [XYZ]_DUAL_ENDSTOPS:                             12 bytes
105
  *  352  M666 X    x_endstop_adj                    (float)
106
  *  352  M666 X    x_endstop_adj                    (float)
107
  *  360  M666 Z    z_endstop_adj                    (float)
108
  *  360  M666 Z    z_endstop_adj                    (float)
108
  *
109
  *
109
  * ULTIPANEL:                                       6 bytes
110
  * ULTIPANEL:                                       6 bytes
110
- *  392  M145 S0 H lcd_preheat_hotend_temp          (int x2)
111
- *  396  M145 S0 B lcd_preheat_bed_temp             (int x2)
112
- *  400  M145 S0 F lcd_preheat_fan_speed            (int x2)
111
+ *  396  M145 S0 H lcd_preheat_hotend_temp          (int x2)
112
+ *  400  M145 S0 B lcd_preheat_bed_temp             (int x2)
113
+ *  404  M145 S0 F lcd_preheat_fan_speed            (int x2)
113
  *
114
  *
114
  * PIDTEMP:                                         82 bytes
115
  * PIDTEMP:                                         82 bytes
115
- *  404  M301 E0 PIDC  Kp[0], Ki[0], Kd[0], Kc[0]   (float x4)
116
- *  420  M301 E1 PIDC  Kp[1], Ki[1], Kd[1], Kc[1]   (float x4)
117
- *  436  M301 E2 PIDC  Kp[2], Ki[2], Kd[2], Kc[2]   (float x4)
118
- *  452  M301 E3 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]   (float x4)
119
- *  468  M301 E4 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]   (float x4)
120
- *  484  M301 L        lpq_len                      (int)
116
+ *  408  M301 E0 PIDC  Kp[0], Ki[0], Kd[0], Kc[0]   (float x4)
117
+ *  428  M301 E1 PIDC  Kp[1], Ki[1], Kd[1], Kc[1]   (float x4)
118
+ *  440  M301 E2 PIDC  Kp[2], Ki[2], Kd[2], Kc[2]   (float x4)
119
+ *  456  M301 E3 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]   (float x4)
120
+ *  472  M301 E4 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]   (float x4)
121
+ *  488  M301 L        lpq_len                      (int)
121
  *
122
  *
122
  * PIDTEMPBED:                                      12 bytes
123
  * PIDTEMPBED:                                      12 bytes
123
- *  486  M304 PID  thermalManager.bedKp, .bedKi, .bedKd (float x3)
124
+ *  490  M304 PID  thermalManager.bedKp, .bedKi, .bedKd (float x3)
124
  *
125
  *
125
  * DOGLCD:                                          2 bytes
126
  * DOGLCD:                                          2 bytes
126
- *  498  M250 C    lcd_contrast                     (uint16_t)
127
+ *  502  M250 C    lcd_contrast                     (uint16_t)
127
  *
128
  *
128
  * FWRETRACT:                                       33 bytes
129
  * FWRETRACT:                                       33 bytes
129
- *  500  M209 S    autoretract_enabled              (bool)
130
- *  501  M207 S    retract_length                   (float)
131
- *  505  M207 F    retract_feedrate_mm_s            (float)
132
- *  509  M207 Z    retract_zlift                    (float)
133
- *  513  M208 S    retract_recover_length           (float)
134
- *  517  M208 F    retract_recover_feedrate_mm_s    (float)
135
- *  521  M207 W    swap_retract_length              (float)
136
- *  525  M208 W    swap_retract_recover_length      (float)
137
- *  529  M208 R    swap_retract_recover_feedrate_mm_s (float)
130
+ *  504  M209 S    autoretract_enabled              (bool)
131
+ *  505  M207 S    retract_length                   (float)
132
+ *  509  M207 F    retract_feedrate_mm_s            (float)
133
+ *  513  M207 Z    retract_zlift                    (float)
134
+ *  517  M208 S    retract_recover_length           (float)
135
+ *  521  M208 F    retract_recover_feedrate_mm_s    (float)
136
+ *  525  M207 W    swap_retract_length              (float)
137
+ *  529  M208 W    swap_retract_recover_length      (float)
138
+ *  533  M208 R    swap_retract_recover_feedrate_mm_s (float)
138
  *
139
  *
139
  * Volumetric Extrusion:                            21 bytes
140
  * Volumetric Extrusion:                            21 bytes
140
- *  533  M200 D    volumetric_enabled               (bool)
141
- *  534  M200 T D  filament_size                    (float x5) (T0..3)
141
+ *  537  M200 D    volumetric_enabled               (bool)
142
+ *  538  M200 T D  filament_size                    (float x5) (T0..3)
142
  *
143
  *
143
  * HAVE_TMC2130:                                    22 bytes
144
  * HAVE_TMC2130:                                    22 bytes
144
- *  554  M906 X    Stepper X current                (uint16_t)
145
- *  556  M906 Y    Stepper Y current                (uint16_t)
146
- *  558  M906 Z    Stepper Z current                (uint16_t)
147
- *  560  M906 X2   Stepper X2 current               (uint16_t)
148
- *  562  M906 Y2   Stepper Y2 current               (uint16_t)
149
- *  564  M906 Z2   Stepper Z2 current               (uint16_t)
150
- *  566  M906 E0   Stepper E0 current               (uint16_t)
151
- *  568  M906 E1   Stepper E1 current               (uint16_t)
152
- *  570  M906 E2   Stepper E2 current               (uint16_t)
153
- *  572  M906 E3   Stepper E3 current               (uint16_t)
154
- *  574  M906 E4   Stepper E4 current               (uint16_t)
145
+ *  558  M906 X    Stepper X current                (uint16_t)
146
+ *  560  M906 Y    Stepper Y current                (uint16_t)
147
+ *  562  M906 Z    Stepper Z current                (uint16_t)
148
+ *  564  M906 X2   Stepper X2 current               (uint16_t)
149
+ *  566  M906 Y2   Stepper Y2 current               (uint16_t)
150
+ *  568  M906 Z2   Stepper Z2 current               (uint16_t)
151
+ *  570  M906 E0   Stepper E0 current               (uint16_t)
152
+ *  572  M906 E1   Stepper E1 current               (uint16_t)
153
+ *  574  M906 E2   Stepper E2 current               (uint16_t)
154
+ *  576  M906 E3   Stepper E3 current               (uint16_t)
155
+ *  578  M906 E4   Stepper E4 current               (uint16_t)
155
  *
156
  *
156
  * LIN_ADVANCE:                                     8 bytes
157
  * LIN_ADVANCE:                                     8 bytes
157
- *  576  M900 K    extruder_advance_k               (float)
158
- *  580  M900 WHD  advance_ed_ratio                 (float)
158
+ *  580  M900 K    extruder_advance_k               (float)
159
+ *  584  M900 WHD  advance_ed_ratio                 (float)
159
  *
160
  *
160
  * HAS_MOTOR_CURRENT_PWM:
161
  * HAS_MOTOR_CURRENT_PWM:
161
- *  584  M907 X    Stepper XY current               (uint32_t)
162
- *  588  M907 Z    Stepper Z current                (uint32_t)
163
- *  592  M907 E    Stepper E current                (uint32_t)
162
+ *  588  M907 X    Stepper XY current               (uint32_t)
163
+ *  592  M907 Z    Stepper Z current                (uint32_t)
164
+ *  596  M907 E    Stepper E current                (uint32_t)
164
  *
165
  *
165
  * CNC_COORDINATE_SYSTEMS                           108 bytes
166
  * CNC_COORDINATE_SYSTEMS                           108 bytes
166
- *  596  G54-G59.3 coordinate_system                (float x 27)
167
+ *  600  G54-G59.3 coordinate_system                (float x 27)
167
  *
168
  *
168
- *  704                                Minimum end-point
169
+ *  708                                Minimum end-point
169
  * 2025 (704 + 36 + 9 + 288 + 988)     Maximum end-point
170
  * 2025 (704 + 36 + 9 + 288 + 988)     Maximum end-point
170
  *
171
  *
171
  * ========================================================================
172
  * ========================================================================
354
     #if !HAS_HOME_OFFSET
355
     #if !HAS_HOME_OFFSET
355
       const float home_offset[XYZ] = { 0 };
356
       const float home_offset[XYZ] = { 0 };
356
     #endif
357
     #endif
357
-    #if ENABLED(DELTA)
358
-      dummy = 0.0;
359
-      EEPROM_WRITE(dummy);
360
-      EEPROM_WRITE(dummy);
361
-      dummy = DELTA_HEIGHT + home_offset[Z_AXIS];
362
-      EEPROM_WRITE(dummy);
363
-    #else
364
-      EEPROM_WRITE(home_offset);
365
-    #endif
358
+    EEPROM_WRITE(home_offset);
366
 
359
 
367
     #if HOTENDS > 1
360
     #if HOTENDS > 1
368
       // Skip hotend 0 which must be 0
361
       // Skip hotend 0 which must be 0
465
 
458
 
466
     // 10 floats for DELTA / [XYZ]_DUAL_ENDSTOPS
459
     // 10 floats for DELTA / [XYZ]_DUAL_ENDSTOPS
467
     #if ENABLED(DELTA)
460
     #if ENABLED(DELTA)
461
+      EEPROM_WRITE(delta_height);              // 1 float
468
       EEPROM_WRITE(delta_endstop_adj);         // 3 floats
462
       EEPROM_WRITE(delta_endstop_adj);         // 3 floats
469
       EEPROM_WRITE(delta_radius);              // 1 float
463
       EEPROM_WRITE(delta_radius);              // 1 float
470
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
464
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
786
       #endif
780
       #endif
787
       EEPROM_READ(home_offset);
781
       EEPROM_READ(home_offset);
788
 
782
 
789
-      #if ENABLED(DELTA)
790
-        home_offset[X_AXIS] = 0.0;
791
-        home_offset[Y_AXIS] = 0.0;
792
-        home_offset[Z_AXIS] -= DELTA_HEIGHT;
793
-      #endif
794
-
795
       //
783
       //
796
       // Hotend Offsets, if any
784
       // Hotend Offsets, if any
797
       //
785
       //
897
       //
885
       //
898
 
886
 
899
       #if ENABLED(DELTA)
887
       #if ENABLED(DELTA)
888
+        EEPROM_READ(delta_height);              // 1 float
900
         EEPROM_READ(delta_endstop_adj);         // 3 floats
889
         EEPROM_READ(delta_endstop_adj);         // 3 floats
901
         EEPROM_READ(delta_radius);              // 1 float
890
         EEPROM_READ(delta_radius);              // 1 float
902
         EEPROM_READ(delta_diagonal_rod);        // 1 float
891
         EEPROM_READ(delta_diagonal_rod);        // 1 float
1347
   #if ENABLED(DELTA)
1336
   #if ENABLED(DELTA)
1348
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1337
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1349
                 dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
1338
                 dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
1339
+    delta_height = DELTA_HEIGHT;
1350
     COPY(delta_endstop_adj, adj);
1340
     COPY(delta_endstop_adj, adj);
1351
     delta_radius = DELTA_RADIUS;
1341
     delta_radius = DELTA_RADIUS;
1352
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1342
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1353
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1343
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1354
     delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
1344
     delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
1355
     COPY(delta_tower_angle_trim, dta);
1345
     COPY(delta_tower_angle_trim, dta);
1356
-    home_offset[Z_AXIS] = 0;
1357
 
1346
 
1358
   #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1347
   #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1359
 
1348
 
1790
       CONFIG_ECHO_START;
1779
       CONFIG_ECHO_START;
1791
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1780
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1792
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1781
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1793
-      SERIAL_ECHOPAIR(" H", LINEAR_UNIT(DELTA_HEIGHT + home_offset[Z_AXIS]));
1782
+      SERIAL_ECHOPAIR(" H", LINEAR_UNIT(delta_height));
1794
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1783
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1795
       SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius));
1784
       SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius));
1796
       SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));
1785
       SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));

+ 1
- 5
Marlin/ultralcd.cpp View File

2742
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2742
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2743
     void _goto_center()  { _man_probe_pt(0,0); }
2743
     void _goto_center()  { _man_probe_pt(0,0); }
2744
 
2744
 
2745
-    static float _delta_height = DELTA_HEIGHT;
2746
     void _lcd_set_delta_height() {
2745
     void _lcd_set_delta_height() {
2747
-      home_offset[Z_AXIS] = _delta_height - DELTA_HEIGHT;
2748
       update_software_endstops(Z_AXIS);
2746
       update_software_endstops(Z_AXIS);
2749
     }
2747
     }
2750
 
2748
 
2751
     void lcd_delta_settings() {
2749
     void lcd_delta_settings() {
2752
       START_MENU();
2750
       START_MENU();
2753
       MENU_BACK(MSG_DELTA_CALIBRATE);
2751
       MENU_BACK(MSG_DELTA_CALIBRATE);
2754
-      float Tz = 0.00;
2755
       MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
2752
       MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
2756
-      _delta_height = DELTA_HEIGHT + home_offset[Z_AXIS];
2757
-      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &_delta_height, _delta_height - 10.0, _delta_height + 10.0, _lcd_set_delta_height);
2753
+      MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, _lcd_set_delta_height);
2758
       MENU_ITEM_EDIT(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0);
2754
       MENU_ITEM_EDIT(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0);
2759
       MENU_ITEM_EDIT(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0);
2755
       MENU_ITEM_EDIT(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0);
2760
       MENU_ITEM_EDIT(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0);
2756
       MENU_ITEM_EDIT(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0);

Loading…
Cancel
Save