Browse Source

Merge pull request #8345 from tcm0116/1.1.x-delta_height

[1.1.x] Add delta_height variable in lieu of using home_offset
Scott Lahteine 7 years ago
parent
commit
b6b4bf0959
No account linked to committer's email address
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);
2377
       }
2388
       }
2378
     #endif
2389
     #endif
2379
 
2390
 
2380
-    return current_position[Z_AXIS] + zprobe_zoffset
2381
-      #if ENABLED(DELTA)
2382
-        + home_offset[Z_AXIS] // Account for delta height adjustment
2383
-      #endif
2384
-    ;
2391
+    return current_position[Z_AXIS] + zprobe_zoffset;
2385
   }
2392
   }
2386
 
2393
 
2387
   /**
2394
   /**
3930
     sync_plan_position();
3937
     sync_plan_position();
3931
 
3938
 
3932
     // Move all carriages together linearly until an endstop is hit.
3939
     // Move all carriages together linearly until an endstop is hit.
3933
-    current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (DELTA_HEIGHT + home_offset[Z_AXIS] + 10);
3940
+    current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10);
3934
     feedrate_mm_s = homing_feedrate(X_AXIS);
3941
     feedrate_mm_s = homing_feedrate(X_AXIS);
3935
     buffer_line_to_current_position();
3942
     buffer_line_to_current_position();
3936
     stepper.synchronize();
3943
     stepper.synchronize();
3937
 
3944
 
3938
     // If an endstop was not hit, then damage can occur if homing is continued.
3945
     // If an endstop was not hit, then damage can occur if homing is continued.
3939
-    // This can occur if the delta height (DELTA_HEIGHT + home_offset[Z_AXIS]) is
3940
-    // not set correctly.
3946
+    // This can occur if the delta height not set correctly.
3941
     if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
3947
     if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
3942
       LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
3948
       LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
3943
       SERIAL_ERROR_START();
3949
       SERIAL_ERROR_START();
5475
   }
5481
   }
5476
 
5482
 
5477
   static void print_G33_settings(const bool end_stops, const bool tower_angles) {
5483
   static void print_G33_settings(const bool end_stops, const bool tower_angles) {
5478
-    SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
5484
+    SERIAL_PROTOCOLPAIR(".Height:", delta_height);
5479
     if (end_stops) {
5485
     if (end_stops) {
5480
       print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
5486
       print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
5481
       print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
5487
       print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
5723
         delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
5729
         delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
5724
         delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
5730
         delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
5725
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5731
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5726
-        home_offset[Z_AXIS] -= z_temp;
5732
+        delta_height -= z_temp;
5727
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5733
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5728
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5734
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5729
 
5735
 
5743
         delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
5749
         delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
5744
         delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
5750
         delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
5745
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5751
         z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
5746
-        home_offset[Z_AXIS] -= z_temp;
5752
+        delta_height -= z_temp;
5747
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5753
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
5748
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5754
         recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
5749
         switch (axis) {
5755
         switch (axis) {
5852
             delta_endstop_adj[C_AXIS]
5858
             delta_endstop_adj[C_AXIS]
5853
           },
5859
           },
5854
           dr_old = delta_radius,
5860
           dr_old = delta_radius,
5855
-          zh_old = home_offset[Z_AXIS],
5861
+          zh_old = delta_height,
5856
           ta_old[ABC] = {
5862
           ta_old[ABC] = {
5857
             delta_tower_angle_trim[A_AXIS],
5863
             delta_tower_angle_trim[A_AXIS],
5858
             delta_tower_angle_trim[B_AXIS],
5864
             delta_tower_angle_trim[B_AXIS],
5931
         if (zero_std_dev < zero_std_dev_min) {
5937
         if (zero_std_dev < zero_std_dev_min) {
5932
           COPY(e_old, delta_endstop_adj);
5938
           COPY(e_old, delta_endstop_adj);
5933
           dr_old = delta_radius;
5939
           dr_old = delta_radius;
5934
-          zh_old = home_offset[Z_AXIS];
5940
+          zh_old = delta_height;
5935
           COPY(ta_old, delta_tower_angle_trim);
5941
           COPY(ta_old, delta_tower_angle_trim);
5936
         }
5942
         }
5937
 
5943
 
6015
       else if (zero_std_dev >= test_precision) {   // step one back
6021
       else if (zero_std_dev >= test_precision) {   // step one back
6016
         COPY(delta_endstop_adj, e_old);
6022
         COPY(delta_endstop_adj, e_old);
6017
         delta_radius = dr_old;
6023
         delta_radius = dr_old;
6018
-        home_offset[Z_AXIS] = zh_old;
6024
+        delta_height = zh_old;
6019
         COPY(delta_tower_angle_trim, ta_old);
6025
         COPY(delta_tower_angle_trim, ta_old);
6020
       }
6026
       }
6021
 
6027
 
6029
 
6035
 
6030
         // adjust delta_height and endstops by the max amount
6036
         // adjust delta_height and endstops by the max amount
6031
         const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
6037
         const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
6032
-        home_offset[Z_AXIS] -= z_temp;
6038
+        delta_height -= z_temp;
6033
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
6039
         LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
6034
       }
6040
       }
6035
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
6041
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
8981
    */
8987
    */
8982
   inline void gcode_M665() {
8988
   inline void gcode_M665() {
8983
     if (parser.seen('H')) {
8989
     if (parser.seen('H')) {
8984
-      home_offset[Z_AXIS] = parser.value_linear_units() - DELTA_HEIGHT;
8990
+      delta_height = parser.value_linear_units();
8985
       update_software_endstops(Z_AXIS);
8991
       update_software_endstops(Z_AXIS);
8986
     }
8992
     }
8987
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();
8993
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();
10089
       #endif
10095
       #endif
10090
 
10096
 
10091
       #if ENABLED(DELTA) // correct the delta_height
10097
       #if ENABLED(DELTA) // correct the delta_height
10092
-        home_offset[Z_AXIS] -= diff;
10098
+        delta_height -= diff;
10093
       #endif
10099
       #endif
10094
     }
10100
     }
10095
 
10101
 

+ 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