Browse Source

Merge pull request #5984 from thinkyhead/rc_delta_angles

Add delta_tower_angle_trim
Scott Lahteine 7 years ago
parent
commit
deb9d0dabd
4 changed files with 128 additions and 123 deletions
  1. 10
    1
      Marlin/Conditionals_post.h
  2. 2
    3
      Marlin/Marlin.h
  3. 40
    47
      Marlin/Marlin_main.cpp
  4. 76
    72
      Marlin/configuration_store.cpp

+ 10
- 1
Marlin/Conditionals_post.h View File

@@ -630,7 +630,7 @@
630 630
   #endif
631 631
 
632 632
   /**
633
-   * Delta radius/rod trimmers
633
+   * Delta radius/rod trimmers/angle trimmers
634 634
    */
635 635
   #if ENABLED(DELTA)
636 636
     #ifndef DELTA_RADIUS_TRIM_TOWER_1
@@ -651,6 +651,15 @@
651 651
     #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3
652 652
       #define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
653 653
     #endif
654
+    #ifndef DELTA_TOWER_ANGLE_TRIM_1
655
+      #define DELTA_TOWER_ANGLE_TRIM_1 0.0
656
+    #endif
657
+    #ifndef DELTA_TOWER_ANGLE_TRIM_2
658
+      #define DELTA_TOWER_ANGLE_TRIM_2 0.0
659
+    #endif
660
+    #ifndef DELTA_TOWER_ANGLE_TRIM_3
661
+      #define DELTA_TOWER_ANGLE_TRIM_3 0.0
662
+    #endif
654 663
   #endif
655 664
 
656 665
   /**

+ 2
- 3
Marlin/Marlin.h View File

@@ -332,9 +332,8 @@ float code_value_temp_diff();
332 332
                delta_radius,
333 333
                delta_diagonal_rod,
334 334
                delta_segments_per_second,
335
-               delta_diagonal_rod_trim_tower_1,
336
-               delta_diagonal_rod_trim_tower_2,
337
-               delta_diagonal_rod_trim_tower_3,
335
+               delta_diagonal_rod_trim[ABC],
336
+               delta_tower_angle_trim[ABC],
338 337
                delta_clip_start_height;
339 338
   void recalc_delta_settings(float radius, float diagonal_rod);
340 339
 #elif IS_SCARA

+ 40
- 47
Marlin/Marlin_main.cpp View File

@@ -185,7 +185,7 @@
185 185
  * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
186 186
  * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
187 187
  * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires FILAMENT_CHANGE_FEATURE)
188
- * M665 - Set delta configurations: "M665 L<diagonal rod> R<delta radius> S<segments/s>" (Requires DELTA)
188
+ * M665 - Set delta configurations: "M665 L<diagonal rod> R<delta radius> S<segments/s> A<rod A trim mm> B<rod B trim mm> C<rod C trim mm> I<tower A trim angle> J<tower B trim angle> K<tower C trim angle>" (Requires DELTA)
189 189
  * M666 - Set delta endstop adjustment. (Requires DELTA)
190 190
  * M605 - Set dual x-carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
191 191
  * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)
@@ -556,28 +556,18 @@ static uint8_t target_extruder;
556 556
 
557 557
 #if ENABLED(DELTA)
558 558
 
559
-  #define SIN_60 0.8660254037844386
560
-  #define COS_60 0.5
561
-
562 559
   float delta[ABC],
563 560
         endstop_adj[ABC] = { 0 };
564 561
 
565
-  // these are the default values, can be overriden with M665
566
-  float delta_radius = DELTA_RADIUS,
567
-        delta_tower1_x = -SIN_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), // front left tower
568
-        delta_tower1_y = -COS_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1),
569
-        delta_tower2_x =  SIN_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), // front right tower
570
-        delta_tower2_y = -COS_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2),
571
-        delta_tower3_x = 0,                                                    // back middle tower
572
-        delta_tower3_y = (delta_radius + DELTA_RADIUS_TRIM_TOWER_3),
573
-        delta_diagonal_rod = DELTA_DIAGONAL_ROD,
574
-        delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1,
575
-        delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2,
576
-        delta_diagonal_rod_trim_tower_3 = DELTA_DIAGONAL_ROD_TRIM_TOWER_3,
577
-        delta_diagonal_rod_2_tower_1 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_1),
578
-        delta_diagonal_rod_2_tower_2 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_2),
579
-        delta_diagonal_rod_2_tower_3 = sq(delta_diagonal_rod + delta_diagonal_rod_trim_tower_3),
580
-        delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND,
562
+  // These values are loaded or reset at boot time when setup() calls
563
+  // Config_RetrieveSettings(), which calls recalc_delta_settings().
564
+  float delta_radius,
565
+        delta_tower_angle_trim[ABC],
566
+        delta_tower[ABC][2],
567
+        delta_diagonal_rod,
568
+        delta_diagonal_rod_trim[ABC],
569
+        delta_diagonal_rod_2_tower[ABC],
570
+        delta_segments_per_second,
581 571
         delta_clip_start_height = Z_MAX_POS;
582 572
 
583 573
   float delta_safe_distance_from_top();
@@ -6334,9 +6324,12 @@ inline void gcode_M205() {
6334 6324
     if (code_seen('L')) delta_diagonal_rod = code_value_linear_units();
6335 6325
     if (code_seen('R')) delta_radius = code_value_linear_units();
6336 6326
     if (code_seen('S')) delta_segments_per_second = code_value_float();
6337
-    if (code_seen('A')) delta_diagonal_rod_trim_tower_1 = code_value_linear_units();
6338
-    if (code_seen('B')) delta_diagonal_rod_trim_tower_2 = code_value_linear_units();
6339
-    if (code_seen('C')) delta_diagonal_rod_trim_tower_3 = code_value_linear_units();
6327
+    if (code_seen('A')) delta_diagonal_rod_trim[A_AXIS] = code_value_linear_units();
6328
+    if (code_seen('B')) delta_diagonal_rod_trim[B_AXIS] = code_value_linear_units();
6329
+    if (code_seen('C')) delta_diagonal_rod_trim[C_AXIS] = code_value_linear_units();
6330
+    if (code_seen('I')) delta_tower_angle_trim[A_AXIS] = code_value_linear_units();
6331
+    if (code_seen('J')) delta_tower_angle_trim[B_AXIS] = code_value_linear_units();
6332
+    if (code_seen('K')) delta_tower_angle_trim[C_AXIS] = code_value_linear_units();
6340 6333
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
6341 6334
   }
6342 6335
   /**
@@ -9140,15 +9133,15 @@ void ok_to_send() {
9140 9133
    * settings have been changed (e.g., by M665).
9141 9134
    */
9142 9135
   void recalc_delta_settings(float radius, float diagonal_rod) {
9143
-    delta_tower1_x = -SIN_60 * (radius + DELTA_RADIUS_TRIM_TOWER_1);  // front left tower
9144
-    delta_tower1_y = -COS_60 * (radius + DELTA_RADIUS_TRIM_TOWER_1);
9145
-    delta_tower2_x =  SIN_60 * (radius + DELTA_RADIUS_TRIM_TOWER_2);  // front right tower
9146
-    delta_tower2_y = -COS_60 * (radius + DELTA_RADIUS_TRIM_TOWER_2);
9147
-    delta_tower3_x = 0.0;                                             // back middle tower
9148
-    delta_tower3_y = (radius + DELTA_RADIUS_TRIM_TOWER_3);
9149
-    delta_diagonal_rod_2_tower_1 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_1);
9150
-    delta_diagonal_rod_2_tower_2 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_2);
9151
-    delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3);
9136
+    delta_tower[A_AXIS][X_AXIS] = -sin(RADIANS(60 - delta_tower_angle_trim[A_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1), // front left tower
9137
+    delta_tower[A_AXIS][Y_AXIS] = -cos(RADIANS(60 - delta_tower_angle_trim[A_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1),
9138
+    delta_tower[B_AXIS][X_AXIS] =  sin(RADIANS(60 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2), // front right tower
9139
+    delta_tower[B_AXIS][Y_AXIS] = -cos(RADIANS(60 + delta_tower_angle_trim[B_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_2),
9140
+    delta_tower[C_AXIS][X_AXIS] = -sin(RADIANS(     delta_tower_angle_trim[C_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_3), // back middle tower
9141
+    delta_tower[C_AXIS][Y_AXIS] =  cos(RADIANS(     delta_tower_angle_trim[C_AXIS])) * (delta_radius + DELTA_RADIUS_TRIM_TOWER_3),
9142
+    delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[A_AXIS]);
9143
+    delta_diagonal_rod_2_tower[B_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[B_AXIS]);
9144
+    delta_diagonal_rod_2_tower[C_AXIS] = sq(diagonal_rod + delta_diagonal_rod_trim[C_AXIS]);
9152 9145
   }
9153 9146
 
9154 9147
   #if ENABLED(DELTA_FAST_SQRT)
@@ -9198,17 +9191,17 @@ void ok_to_send() {
9198 9191
    */
9199 9192
 
9200 9193
   // Macro to obtain the Z position of an individual tower
9201
-  #define DELTA_Z(T) raw[Z_AXIS] + _SQRT(    \
9202
-    delta_diagonal_rod_2_tower_##T - HYPOT2( \
9203
-        delta_tower##T##_x - raw[X_AXIS],    \
9204
-        delta_tower##T##_y - raw[Y_AXIS]     \
9205
-      )                                      \
9194
+  #define DELTA_Z(T) raw[Z_AXIS] + _SQRT(     \
9195
+    delta_diagonal_rod_2_tower[T] - HYPOT2(   \
9196
+        delta_tower[T][X_AXIS] - raw[X_AXIS], \
9197
+        delta_tower[T][Y_AXIS] - raw[Y_AXIS]  \
9198
+      )                                       \
9206 9199
     )
9207 9200
 
9208 9201
   #define DELTA_RAW_IK() do {   \
9209
-    delta[A_AXIS] = DELTA_Z(1); \
9210
-    delta[B_AXIS] = DELTA_Z(2); \
9211
-    delta[C_AXIS] = DELTA_Z(3); \
9202
+    delta[A_AXIS] = DELTA_Z(A_AXIS); \
9203
+    delta[B_AXIS] = DELTA_Z(B_AXIS); \
9204
+    delta[C_AXIS] = DELTA_Z(C_AXIS); \
9212 9205
   } while(0)
9213 9206
 
9214 9207
   #define DELTA_LOGICAL_IK() do {      \
@@ -9278,7 +9271,7 @@ void ok_to_send() {
9278 9271
    */
9279 9272
   void forward_kinematics_DELTA(float z1, float z2, float z3) {
9280 9273
     // Create a vector in old coordinates along x axis of new coordinate
9281
-    float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 };
9274
+    float p12[3] = { delta_tower[B_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[B_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z2 - z1 };
9282 9275
 
9283 9276
     // Get the Magnitude of vector.
9284 9277
     float d = sqrt( sq(p12[0]) + sq(p12[1]) + sq(p12[2]) );
@@ -9287,7 +9280,7 @@ void ok_to_send() {
9287 9280
     float ex[3] = { p12[0] / d, p12[1] / d, p12[2] / d };
9288 9281
 
9289 9282
     // Get the vector from the origin of the new system to the third point.
9290
-    float p13[3] = { delta_tower3_x - delta_tower1_x, delta_tower3_y - delta_tower1_y, z3 - z1 };
9283
+    float p13[3] = { delta_tower[C_AXIS][X_AXIS] - delta_tower[A_AXIS][X_AXIS], delta_tower[C_AXIS][Y_AXIS] - delta_tower[A_AXIS][Y_AXIS], z3 - z1 };
9291 9284
 
9292 9285
     // Use the dot product to find the component of this vector on the X axis.
9293 9286
     float i = ex[0] * p13[0] + ex[1] * p13[1] + ex[2] * p13[2];
@@ -9315,15 +9308,15 @@ void ok_to_send() {
9315 9308
 
9316 9309
     // We now have the d, i and j values defined in Wikipedia.
9317 9310
     // Plug them into the equations defined in Wikipedia for Xnew, Ynew and Znew
9318
-    float Xnew = (delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_2 + sq(d)) / (d * 2),
9319
-          Ynew = ((delta_diagonal_rod_2_tower_1 - delta_diagonal_rod_2_tower_3 + HYPOT2(i, j)) / 2 - i * Xnew) / j,
9320
-          Znew = sqrt(delta_diagonal_rod_2_tower_1 - HYPOT2(Xnew, Ynew));
9311
+    float Xnew = (delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[B_AXIS] + sq(d)) / (d * 2),
9312
+          Ynew = ((delta_diagonal_rod_2_tower[A_AXIS] - delta_diagonal_rod_2_tower[C_AXIS] + HYPOT2(i, j)) / 2 - i * Xnew) / j,
9313
+          Znew = sqrt(delta_diagonal_rod_2_tower[A_AXIS] - HYPOT2(Xnew, Ynew));
9321 9314
 
9322 9315
     // Start from the origin of the old coordinates and add vectors in the
9323 9316
     // old coords that represent the Xnew, Ynew and Znew to find the point
9324 9317
     // in the old system.
9325
-    cartes[X_AXIS] = delta_tower1_x + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew;
9326
-    cartes[Y_AXIS] = delta_tower1_y + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew;
9318
+    cartes[X_AXIS] = delta_tower[A_AXIS][X_AXIS] + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew;
9319
+    cartes[Y_AXIS] = delta_tower[A_AXIS][Y_AXIS] + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew;
9327 9320
     cartes[Z_AXIS] =             z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
9328 9321
   }
9329 9322
 

+ 76
- 72
Marlin/configuration_store.cpp View File

@@ -36,13 +36,13 @@
36 36
  *
37 37
  */
38 38
 
39
-#define EEPROM_VERSION "V30"
39
+#define EEPROM_VERSION "V31"
40 40
 
41 41
 // Change EEPROM version if these are changed:
42 42
 #define EEPROM_OFFSET 100
43 43
 
44 44
 /**
45
- * V30 EEPROM Layout:
45
+ * V31 EEPROM Layout:
46 46
  *
47 47
  *  100  Version                                   (char x4)
48 48
  *  104  EEPROM Checksum                           (uint16_t)
@@ -84,64 +84,68 @@
84 84
  *  308  G29 L F   bilinear_start                  (int x2)
85 85
  *  312            bed_level_grid[][]              (float x9, up to float x256) +988
86 86
  *
87
- * DELTA (if deltabot):                            36 bytes
88
- *  348  M666 XYZ  endstop_adj                     (float x3)
89
- *  360  M665 R    delta_radius                    (float)
90
- *  364  M665 L    delta_diagonal_rod              (float)
91
- *  368  M665 S    delta_segments_per_second       (float)
92
- *  372  M665 A    delta_diagonal_rod_trim_tower_1 (float)
93
- *  376  M665 B    delta_diagonal_rod_trim_tower_2 (float)
94
- *  380  M665 C    delta_diagonal_rod_trim_tower_3 (float)
87
+ * DELTA (if deltabot):                             48 bytes
88
+ *  348  M666 XYZ  endstop_adj                      (float x3)
89
+ *  360  M665 R    delta_radius                     (float)
90
+ *  364  M665 L    delta_diagonal_rod               (float)
91
+ *  368  M665 S    delta_segments_per_second        (float)
92
+ *  372  M665 A    delta_diagonal_rod_trim[A]       (float)
93
+ *  376  M665 B    delta_diagonal_rod_trim[B]       (float)
94
+ *  380  M665 C    delta_diagonal_rod_trim[C]       (float)
95
+ *  384  M665 I    delta_tower_angle_trim[A]        (float)
96
+ *  388  M665 J    delta_tower_angle_trim[B]        (float)
97
+ *  392  M665 K    delta_tower_angle_trim[C]        (float)
95 98
  *
96
- * Z_DUAL_ENDSTOPS:                                4 bytes
97
- *  384  M666 Z    z_endstop_adj                   (float)
99
+ * Z_DUAL_ENDSTOPS (if not deltabot):              48 bytes
100
+ *  348  M666 Z    z_endstop_adj                   (float)
101
+ *  ---            dummy data                      (float x11)
98 102
  *
99 103
  * ULTIPANEL:                                      6 bytes
100
- *  388  M145 S0 H lcd_preheat_hotend_temp         (int x2)
101
- *  392  M145 S0 B lcd_preheat_bed_temp            (int x2)
102
- *  396  M145 S0 F lcd_preheat_fan_speed           (int x2)
104
+ *  396  M145 S0 H lcd_preheat_hotend_temp         (int x2)
105
+ *  400  M145 S0 B lcd_preheat_bed_temp            (int x2)
106
+ *  404  M145 S0 F lcd_preheat_fan_speed           (int x2)
103 107
  *
104 108
  * PIDTEMP:                                        66 bytes
105
- *  400  M301 E0 PIDC  Kp[0], Ki[0], Kd[0], Kc[0]  (float x4)
106
- *  416  M301 E1 PIDC  Kp[1], Ki[1], Kd[1], Kc[1]  (float x4)
107
- *  432  M301 E2 PIDC  Kp[2], Ki[2], Kd[2], Kc[2]  (float x4)
108
- *  448  M301 E3 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]  (float x4)
109
- *  464  M301 L        lpq_len                     (int)
109
+ *  408  M301 E0 PIDC  Kp[0], Ki[0], Kd[0], Kc[0]  (float x4)
110
+ *  424  M301 E1 PIDC  Kp[1], Ki[1], Kd[1], Kc[1]  (float x4)
111
+ *  440  M301 E2 PIDC  Kp[2], Ki[2], Kd[2], Kc[2]  (float x4)
112
+ *  456  M301 E3 PIDC  Kp[3], Ki[3], Kd[3], Kc[3]  (float x4)
113
+ *  472  M301 L        lpq_len                     (int)
110 114
  *
111
- * PIDTEMPBED:
112
- *  466  M304 PID  thermalManager.bedKp, thermalManager.bedKi, thermalManager.bedKd (float x3)
115
+ * PIDTEMPBED:                                      12 bytes
116
+ *  474  M304 PID  thermalManager.bedKp, .bedKi, .bedKd (float x3)
113 117
  *
114 118
  * DOGLCD:                                          2 bytes
115
- *  478  M250 C    lcd_contrast                     (int)
119
+ *  486  M250 C    lcd_contrast                     (int)
116 120
  *
117 121
  * FWRETRACT:                                       29 bytes
118
- *  480  M209 S    autoretract_enabled              (bool)
119
- *  481  M207 S    retract_length                   (float)
120
- *  485  M207 W    retract_length_swap              (float)
121
- *  489  M207 F    retract_feedrate_mm_s            (float)
122
- *  493  M207 Z    retract_zlift                    (float)
123
- *  497  M208 S    retract_recover_length           (float)
124
- *  501  M208 W    retract_recover_length_swap      (float)
125
- *  505  M208 F    retract_recover_feedrate_mm_s    (float)
122
+ *  488  M209 S    autoretract_enabled              (bool)
123
+ *  489  M207 S    retract_length                   (float)
124
+ *  493  M207 W    retract_length_swap              (float)
125
+ *  497  M207 F    retract_feedrate_mm_s            (float)
126
+ *  501  M207 Z    retract_zlift                    (float)
127
+ *  505  M208 S    retract_recover_length           (float)
128
+ *  509  M208 W    retract_recover_length_swap      (float)
129
+ *  513  M208 F    retract_recover_feedrate_mm_s    (float)
126 130
  *
127 131
  * Volumetric Extrusion:                            17 bytes
128
- *  509  M200 D    volumetric_enabled               (bool)
129
- *  510  M200 T D  filament_size                    (float x4) (T0..3)
132
+ *  517  M200 D    volumetric_enabled               (bool)
133
+ *  518  M200 T D  filament_size                    (float x4) (T0..3)
130 134
  *
131
- * TMC2130:                                         20 bytes
132
- *  526  M906 X    TMC2130  X-stepper current       (uint16_t)
133
- *  528  M906 Y    TMC2130  Y-stepper current       (uint16_t)
134
- *  530  M906 Z    TMC2130  Z-stepper current       (uint16_t)
135
- *  532  M906 X2   TMC2130 X2-stepper current       (uint16_t)
136
- *  534  M906 Y2   TMC2130 Y2-stepper current       (uint16_t)
137
- *  536  M906 Z2   TMC2130 Z2-stepper current       (uint16_t)
138
- *  538  M906 E0   TMC2130 E0-stepper current       (uint16_t)
139
- *  540  M906 E1   TMC2130 E1-stepper current       (uint16_t)
140
- *  542  M906 E2   TMC2130 E2-stepper current       (uint16_t)
141
- *  544  M906 E3   TMC2130 E3-stepper current       (uint16_t)
135
+ * TMC2130 Stepper Current:                         20 bytes
136
+ *  534  M906 X    stepperX current                 (uint16_t)
137
+ *  536  M906 Y    stepperY current                 (uint16_t)
138
+ *  538  M906 Z    stepperZ current                 (uint16_t)
139
+ *  540  M906 X2   stepperX2 current                (uint16_t)
140
+ *  542  M906 Y2   stepperY2 current                (uint16_t)
141
+ *  544  M906 Z2   stepperZ2 current                (uint16_t)
142
+ *  546  M906 E0   stepperE0 current                (uint16_t)
143
+ *  548  M906 E1   stepperE1 current                (uint16_t)
144
+ *  550  M906 E2   stepperE2 current                (uint16_t)
145
+ *  552  M906 E3   stepperE3 current                (uint16_t)
142 146
  *
143
- *  546                                Minimum end-point
144
- * 1867 (546 + 36 + 9 + 288 + 988)     Maximum end-point
147
+ *  554                                Minimum end-point
148
+ * 1875 (554 + 36 + 9 + 288 + 988)     Maximum end-point
145 149
  *
146 150
  */
147 151
 #include "Marlin.h"
@@ -353,16 +357,15 @@ void Config_Postprocess() {
353 357
       EEPROM_WRITE(delta_radius);              // 1 float
354 358
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
355 359
       EEPROM_WRITE(delta_segments_per_second); // 1 float
356
-      EEPROM_WRITE(delta_diagonal_rod_trim_tower_1);  // 1 float
357
-      EEPROM_WRITE(delta_diagonal_rod_trim_tower_2);  // 1 float
358
-      EEPROM_WRITE(delta_diagonal_rod_trim_tower_3);  // 1 float
360
+      EEPROM_WRITE(delta_diagonal_rod_trim);   // 3 floats
361
+      EEPROM_WRITE(delta_tower_angle_trim);    // 3 floats
359 362
     #elif ENABLED(Z_DUAL_ENDSTOPS)
360
-      EEPROM_WRITE(z_endstop_adj);            // 1 float
363
+      EEPROM_WRITE(z_endstop_adj);             // 1 float
361 364
       dummy = 0.0f;
362
-      for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy);
365
+      for (uint8_t q = 11; q--;) EEPROM_WRITE(dummy);
363 366
     #else
364 367
       dummy = 0.0f;
365
-      for (uint8_t q = 9; q--;) EEPROM_WRITE(dummy);
368
+      for (uint8_t q = 12; q--;) EEPROM_WRITE(dummy);
366 369
     #endif
367 370
 
368 371
     #if DISABLED(ULTIPANEL)
@@ -674,20 +677,19 @@ void Config_Postprocess() {
674 677
         }
675 678
 
676 679
       #if ENABLED(DELTA)
677
-        EEPROM_READ(endstop_adj);                // 3 floats
678
-        EEPROM_READ(delta_radius);               // 1 float
679
-        EEPROM_READ(delta_diagonal_rod);         // 1 float
680
-        EEPROM_READ(delta_segments_per_second);  // 1 float
681
-        EEPROM_READ(delta_diagonal_rod_trim_tower_1);  // 1 float
682
-        EEPROM_READ(delta_diagonal_rod_trim_tower_2);  // 1 float
683
-        EEPROM_READ(delta_diagonal_rod_trim_tower_3);  // 1 float
680
+        EEPROM_READ(endstop_adj);               // 3 floats
681
+        EEPROM_READ(delta_radius);              // 1 float
682
+        EEPROM_READ(delta_diagonal_rod);        // 1 float
683
+        EEPROM_READ(delta_segments_per_second); // 1 float
684
+        EEPROM_READ(delta_diagonal_rod_trim);   // 3 floats
685
+        EEPROM_READ(delta_tower_angle_trim);    // 3 floats
684 686
       #elif ENABLED(Z_DUAL_ENDSTOPS)
685 687
         EEPROM_READ(z_endstop_adj);
686 688
         dummy = 0.0f;
687
-        for (uint8_t q=8; q--;) EEPROM_READ(dummy);
689
+        for (uint8_t q=11; q--;) EEPROM_READ(dummy);
688 690
       #else
689 691
         dummy = 0.0f;
690
-        for (uint8_t q=9; q--;) EEPROM_READ(dummy);
692
+        for (uint8_t q=12; q--;) EEPROM_READ(dummy);
691 693
       #endif
692 694
 
693 695
       #if DISABLED(ULTIPANEL)
@@ -899,16 +901,15 @@ void Config_ResetDefault() {
899 901
   #endif
900 902
 
901 903
   #if ENABLED(DELTA)
902
-    const float adj[ABC] = DELTA_ENDSTOP_ADJ;
903
-    endstop_adj[A_AXIS] = adj[A_AXIS];
904
-    endstop_adj[B_AXIS] = adj[B_AXIS];
905
-    endstop_adj[C_AXIS] = adj[C_AXIS];
904
+    const float adj[ABC] = DELTA_ENDSTOP_ADJ,
905
+                drt[ABC] = { DELTA_DIAGONAL_ROD_TRIM_TOWER_1, DELTA_DIAGONAL_ROD_TRIM_TOWER_2, DELTA_DIAGONAL_ROD_TRIM_TOWER_3 },
906
+                dta[ABC] = { DELTA_TOWER_ANGLE_TRIM_1, DELTA_TOWER_ANGLE_TRIM_2, DELTA_TOWER_ANGLE_TRIM_3 };
907
+    COPY(endstop_adj, adj);
906 908
     delta_radius = DELTA_RADIUS;
907 909
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
908 910
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
909
-    delta_diagonal_rod_trim_tower_1 = DELTA_DIAGONAL_ROD_TRIM_TOWER_1;
910
-    delta_diagonal_rod_trim_tower_2 = DELTA_DIAGONAL_ROD_TRIM_TOWER_2;
911
-    delta_diagonal_rod_trim_tower_3 = DELTA_DIAGONAL_ROD_TRIM_TOWER_3;
911
+    COPY(delta_diagonal_rod_trim, drt);
912
+    COPY(delta_tower_angle_trim, dta);
912 913
   #elif ENABLED(Z_DUAL_ENDSTOPS)
913 914
     z_endstop_adj = 0;
914 915
   #endif
@@ -1179,15 +1180,18 @@ void Config_ResetDefault() {
1179 1180
       SERIAL_EOL;
1180 1181
       CONFIG_ECHO_START;
1181 1182
       if (!forReplay) {
1182
-        SERIAL_ECHOLNPGM("Delta settings: L=diagonal_rod, R=radius, S=segments_per_second, ABC=diagonal_rod_trim_tower_[123]");
1183
+        SERIAL_ECHOLNPGM("Delta settings: L=diagonal rod, R=radius, S=segments-per-second, ABC=diagonal rod trim, IJK=tower angle trim");
1183 1184
         CONFIG_ECHO_START;
1184 1185
       }
1185 1186
       SERIAL_ECHOPAIR("  M665 L", delta_diagonal_rod);
1186 1187
       SERIAL_ECHOPAIR(" R", delta_radius);
1187 1188
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1188
-      SERIAL_ECHOPAIR(" A", delta_diagonal_rod_trim_tower_1);
1189
-      SERIAL_ECHOPAIR(" B", delta_diagonal_rod_trim_tower_2);
1190
-      SERIAL_ECHOPAIR(" C", delta_diagonal_rod_trim_tower_3);
1189
+      SERIAL_ECHOPAIR(" A", delta_diagonal_rod_trim[A_AXIS]);
1190
+      SERIAL_ECHOPAIR(" B", delta_diagonal_rod_trim[B_AXIS]);
1191
+      SERIAL_ECHOPAIR(" C", delta_diagonal_rod_trim[C_AXIS]);
1192
+      SERIAL_ECHOPAIR(" I", delta_tower_angle_trim[A_AXIS]);
1193
+      SERIAL_ECHOPAIR(" J", delta_tower_angle_trim[B_AXIS]);
1194
+      SERIAL_ECHOPAIR(" K", delta_tower_angle_trim[C_AXIS]);
1191 1195
       SERIAL_EOL;
1192 1196
     #elif ENABLED(Z_DUAL_ENDSTOPS)
1193 1197
       CONFIG_ECHO_START;

Loading…
Cancel
Save