瀏覽代碼

Add delta_height variable in lieu of using home_offset

Thomas Moore 7 年之前
父節點
當前提交
f34c3597dc

+ 7
- 7
Marlin/src/gcode/calibrate/G33.cpp 查看文件

69
 }
69
 }
70
 
70
 
71
 static void print_G33_settings(const bool end_stops, const bool tower_angles) {
71
 static void print_G33_settings(const bool end_stops, const bool tower_angles) {
72
-  SERIAL_PROTOCOLPAIR(".Height:", DELTA_HEIGHT + home_offset[Z_AXIS]);
72
+  SERIAL_PROTOCOLPAIR(".Height:", delta_height);
73
   if (end_stops) {
73
   if (end_stops) {
74
     print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
74
     print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]);
75
     print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
75
     print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]);
317
       delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
317
       delta_endstop_adj[(axis + 1) % 3] -= 1.0 / 4.5;
318
       delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
318
       delta_endstop_adj[(axis + 2) % 3] += 1.0 / 4.5;
319
       z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
319
       z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
320
-      home_offset[Z_AXIS] -= z_temp;
320
+      delta_height -= z_temp;
321
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
321
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
322
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
322
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
323
 
323
 
337
       delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
337
       delta_endstop_adj[(axis+1) % 3] += 1.0/4.5;
338
       delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
338
       delta_endstop_adj[(axis+2) % 3] -= 1.0/4.5;
339
       z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
339
       z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
340
-      home_offset[Z_AXIS] -= z_temp;
340
+      delta_height -= z_temp;
341
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
341
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
342
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
342
       recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
343
       switch (axis) {
343
       switch (axis) {
446
           delta_endstop_adj[C_AXIS]
446
           delta_endstop_adj[C_AXIS]
447
         },
447
         },
448
         dr_old = delta_radius,
448
         dr_old = delta_radius,
449
-        zh_old = home_offset[Z_AXIS],
449
+        zh_old = delta_height,
450
         ta_old[ABC] = {
450
         ta_old[ABC] = {
451
           delta_tower_angle_trim[A_AXIS],
451
           delta_tower_angle_trim[A_AXIS],
452
           delta_tower_angle_trim[B_AXIS],
452
           delta_tower_angle_trim[B_AXIS],
525
       if (zero_std_dev < zero_std_dev_min) {
525
       if (zero_std_dev < zero_std_dev_min) {
526
         COPY(e_old, delta_endstop_adj);
526
         COPY(e_old, delta_endstop_adj);
527
         dr_old = delta_radius;
527
         dr_old = delta_radius;
528
-        zh_old = home_offset[Z_AXIS];
528
+        zh_old = delta_height;
529
         COPY(ta_old, delta_tower_angle_trim);
529
         COPY(ta_old, delta_tower_angle_trim);
530
       }
530
       }
531
 
531
 
609
     else if (zero_std_dev >= test_precision) {   // step one back
609
     else if (zero_std_dev >= test_precision) {   // step one back
610
       COPY(delta_endstop_adj, e_old);
610
       COPY(delta_endstop_adj, e_old);
611
       delta_radius = dr_old;
611
       delta_radius = dr_old;
612
-      home_offset[Z_AXIS] = zh_old;
612
+      delta_height = zh_old;
613
       COPY(delta_tower_angle_trim, ta_old);
613
       COPY(delta_tower_angle_trim, ta_old);
614
     }
614
     }
615
 
615
 
623
 
623
 
624
       // adjust delta_height and endstops by the max amount
624
       // adjust delta_height and endstops by the max amount
625
       const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
625
       const float z_temp = MAX3(delta_endstop_adj[A_AXIS], delta_endstop_adj[B_AXIS], delta_endstop_adj[C_AXIS]);
626
-      home_offset[Z_AXIS] -= z_temp;
626
+      delta_height -= z_temp;
627
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
627
       LOOP_XYZ(axis) delta_endstop_adj[axis] -= z_temp;
628
     }
628
     }
629
     recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
629
     recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);

+ 1
- 1
Marlin/src/gcode/calibrate/M665.cpp 查看文件

45
    */
45
    */
46
   void GcodeSuite::M665() {
46
   void GcodeSuite::M665() {
47
     if (parser.seen('H')) {
47
     if (parser.seen('H')) {
48
-      home_offset[Z_AXIS] = parser.value_linear_units() - DELTA_HEIGHT;
48
+      delta_height = parser.value_linear_units();
49
       update_software_endstops(Z_AXIS);
49
       update_software_endstops(Z_AXIS);
50
     }
50
     }
51
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();
51
     if (parser.seen('L')) delta_diagonal_rod             = parser.value_linear_units();

+ 1
- 1
Marlin/src/inc/Conditionals_post.h 查看文件

1082
 // Updated G92 behavior shifts the workspace
1082
 // Updated G92 behavior shifts the workspace
1083
 #define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
1083
 #define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
1084
 // The home offset also shifts the coordinate space
1084
 // The home offset also shifts the coordinate space
1085
-#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DELTA))
1085
+#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA))
1086
 // Either offset yields extra calculations on all moves
1086
 // Either offset yields extra calculations on all moves
1087
 #define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET)
1087
 #define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET)
1088
 // M206 doesn't apply to DELTA
1088
 // M206 doesn't apply to DELTA

+ 1
- 4
Marlin/src/lcd/ultralcd.cpp 查看文件

2743
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2743
     void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
2744
     void _goto_center()  { _man_probe_pt(0,0); }
2744
     void _goto_center()  { _man_probe_pt(0,0); }
2745
 
2745
 
2746
-    static float _delta_height = DELTA_HEIGHT;
2747
     void _lcd_set_delta_height() {
2746
     void _lcd_set_delta_height() {
2748
-      home_offset[Z_AXIS] = _delta_height - DELTA_HEIGHT;
2749
       update_software_endstops(Z_AXIS);
2747
       update_software_endstops(Z_AXIS);
2750
     }
2748
     }
2751
 
2749
 
2753
       START_MENU();
2751
       START_MENU();
2754
       MENU_BACK(MSG_DELTA_CALIBRATE);
2752
       MENU_BACK(MSG_DELTA_CALIBRATE);
2755
       MENU_ITEM_EDIT(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, DELTA_DIAGONAL_ROD - 5.0, DELTA_DIAGONAL_ROD + 5.0);
2753
       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);
2754
+      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);
2755
       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);
2756
       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);
2757
       MENU_ITEM_EDIT(float43, "Ez", &delta_endstop_adj[C_AXIS], -5.0, 5.0);

+ 56
- 67
Marlin/src/module/configuration_store.cpp 查看文件

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    endstops.x_endstop_adj           (float)
106
  *  352  M666 X    endstops.x_endstop_adj           (float)
107
  *  360  M666 Z    endstops.z_endstop_adj           (float)
108
  *  360  M666 Z    endstops.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
  * ========================================================================
325
     #if !HAS_HOME_OFFSET
326
     #if !HAS_HOME_OFFSET
326
       const float home_offset[XYZ] = { 0 };
327
       const float home_offset[XYZ] = { 0 };
327
     #endif
328
     #endif
328
-    #if ENABLED(DELTA)
329
-      dummy = 0.0;
330
-      EEPROM_WRITE(dummy);
331
-      EEPROM_WRITE(dummy);
332
-      dummy = DELTA_HEIGHT + home_offset[Z_AXIS];
333
-      EEPROM_WRITE(dummy);
334
-    #else
335
-      EEPROM_WRITE(home_offset);
336
-    #endif
329
+    EEPROM_WRITE(home_offset);
337
 
330
 
338
     #if HOTENDS > 1
331
     #if HOTENDS > 1
339
       // Skip hotend 0 which must be 0
332
       // Skip hotend 0 which must be 0
436
 
429
 
437
     // 10 floats for DELTA / [XYZ]_DUAL_ENDSTOPS
430
     // 10 floats for DELTA / [XYZ]_DUAL_ENDSTOPS
438
     #if ENABLED(DELTA)
431
     #if ENABLED(DELTA)
432
+      EEPROM_WRITE(delta_height);              // 1 float
439
       EEPROM_WRITE(delta_endstop_adj);         // 3 floats
433
       EEPROM_WRITE(delta_endstop_adj);         // 3 floats
440
       EEPROM_WRITE(delta_radius);              // 1 float
434
       EEPROM_WRITE(delta_radius);              // 1 float
441
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
435
       EEPROM_WRITE(delta_diagonal_rod);        // 1 float
756
       #endif
750
       #endif
757
       EEPROM_READ(home_offset);
751
       EEPROM_READ(home_offset);
758
 
752
 
759
-      #if ENABLED(DELTA)
760
-        home_offset[X_AXIS] = 0.0;
761
-        home_offset[Y_AXIS] = 0.0;
762
-        home_offset[Z_AXIS] -= DELTA_HEIGHT;
763
-      #endif
764
-
765
       //
753
       //
766
       // Hotend Offsets, if any
754
       // Hotend Offsets, if any
767
       //
755
       //
867
       //
855
       //
868
 
856
 
869
       #if ENABLED(DELTA)
857
       #if ENABLED(DELTA)
858
+        EEPROM_READ(delta_height);              // 1 float
870
         EEPROM_READ(delta_endstop_adj);         // 3 floats
859
         EEPROM_READ(delta_endstop_adj);         // 3 floats
871
         EEPROM_READ(delta_radius);              // 1 float
860
         EEPROM_READ(delta_radius);              // 1 float
872
         EEPROM_READ(delta_diagonal_rod);        // 1 float
861
         EEPROM_READ(delta_diagonal_rod);        // 1 float
1333
   #if ENABLED(DELTA)
1322
   #if ENABLED(DELTA)
1334
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1323
     const float adj[ABC] = DELTA_ENDSTOP_ADJ,
1335
                 dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
1324
                 dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
1325
+    delta_height = DELTA_HEIGHT;
1336
     COPY(delta_endstop_adj, adj);
1326
     COPY(delta_endstop_adj, adj);
1337
     delta_radius = DELTA_RADIUS;
1327
     delta_radius = DELTA_RADIUS;
1338
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1328
     delta_diagonal_rod = DELTA_DIAGONAL_ROD;
1339
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1329
     delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND;
1340
     delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
1330
     delta_calibration_radius = DELTA_CALIBRATION_RADIUS;
1341
     COPY(delta_tower_angle_trim, dta);
1331
     COPY(delta_tower_angle_trim, dta);
1342
-    home_offset[Z_AXIS] = 0;
1343
 
1332
 
1344
   #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1333
   #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1345
 
1334
 
1763
       CONFIG_ECHO_START;
1752
       CONFIG_ECHO_START;
1764
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1753
       SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1765
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1754
       SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1766
-      SERIAL_ECHOPAIR(" H", LINEAR_UNIT(DELTA_HEIGHT + home_offset[Z_AXIS]));
1755
+      SERIAL_ECHOPAIR(" H", LINEAR_UNIT(delta_height));
1767
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1756
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1768
       SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius));
1757
       SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_calibration_radius));
1769
       SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));
1758
       SERIAL_ECHOPAIR(" X", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));

+ 4
- 4
Marlin/src/module/delta.cpp 查看文件

38
 #include "../Marlin.h"
38
 #include "../Marlin.h"
39
 
39
 
40
 // Initialized by settings.load()
40
 // Initialized by settings.load()
41
-float delta_endstop_adj[ABC] = { 0 },
41
+float delta_height,
42
+      delta_endstop_adj[ABC] = { 0 },
42
       delta_radius,
43
       delta_radius,
43
       delta_diagonal_rod,
44
       delta_diagonal_rod,
44
       delta_segments_per_second,
45
       delta_segments_per_second,
224
   sync_plan_position();
225
   sync_plan_position();
225
 
226
 
226
   // Move all carriages together linearly until an endstop is hit.
227
   // Move all carriages together linearly until an endstop is hit.
227
-  current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (DELTA_HEIGHT + home_offset[Z_AXIS] + 10);
228
+  current_position[X_AXIS] = current_position[Y_AXIS] = current_position[Z_AXIS] = (delta_height + 10);
228
   feedrate_mm_s = homing_feedrate(X_AXIS);
229
   feedrate_mm_s = homing_feedrate(X_AXIS);
229
   line_to_current_position();
230
   line_to_current_position();
230
   stepper.synchronize();
231
   stepper.synchronize();
231
 
232
 
232
   // If an endstop was not hit, then damage can occur if homing is continued.
233
   // If an endstop was not hit, then damage can occur if homing is continued.
233
-  // This can occur if the delta height (DELTA_HEIGHT + home_offset[Z_AXIS]) is
234
-  // not set correctly.
234
+  // This can occur if the delta height not set correctly.
235
   if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
235
   if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
236
     LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
236
     LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
237
     SERIAL_ERROR_START();
237
     SERIAL_ERROR_START();

+ 2
- 1
Marlin/src/module/delta.h 查看文件

27
 #ifndef __DELTA_H__
27
 #ifndef __DELTA_H__
28
 #define __DELTA_H__
28
 #define __DELTA_H__
29
 
29
 
30
-extern float delta_endstop_adj[ABC],
30
+extern float delta_height,
31
+             delta_endstop_adj[ABC],
31
              delta_radius,
32
              delta_radius,
32
              delta_diagonal_rod,
33
              delta_diagonal_rod,
33
              delta_segments_per_second,
34
              delta_segments_per_second,

+ 4
- 2
Marlin/src/module/motion.cpp 查看文件

970
 
970
 
971
   #if ENABLED(MORGAN_SCARA)
971
   #if ENABLED(MORGAN_SCARA)
972
     scara_set_axis_is_at_home(axis);
972
     scara_set_axis_is_at_home(axis);
973
+  #elif ENABLED(DELTA)
974
+    current_position[axis] = (axis == Z_AXIS ? delta_height : base_home_pos(axis));
973
   #else
975
   #else
974
     current_position[axis] = base_home_pos(axis);
976
     current_position[axis] = base_home_pos(axis);
975
   #endif
977
   #endif
1251
         }
1253
         }
1252
       }
1254
       }
1253
     #elif ENABLED(DELTA)
1255
     #elif ENABLED(DELTA)
1254
-      soft_endstop_min[axis] = base_min_pos(axis) + (axis == Z_AXIS ? 0 : offs);
1255
-      soft_endstop_max[axis] = base_max_pos(axis) + offs;
1256
+      soft_endstop_min[axis] = base_min_pos(axis) + offs;
1257
+      soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis)) + offs;
1256
     #else
1258
     #else
1257
       soft_endstop_min[axis] = base_min_pos(axis) + offs;
1259
       soft_endstop_min[axis] = base_min_pos(axis) + offs;
1258
       soft_endstop_max[axis] = base_max_pos(axis) + offs;
1260
       soft_endstop_max[axis] = base_max_pos(axis) + offs;

+ 2
- 6
Marlin/src/module/probe.cpp 查看文件

564
     }
564
     }
565
   #endif
565
   #endif
566
 
566
 
567
-  return current_position[Z_AXIS] + zprobe_zoffset
568
-    #if ENABLED(DELTA)
569
-      + home_offset[Z_AXIS] // Account for delta height adjustment
570
-    #endif
571
-  ;
567
+  return current_position[Z_AXIS] + zprobe_zoffset;
572
 }
568
 }
573
 
569
 
574
 /**
570
 /**
686
     #endif
682
     #endif
687
 
683
 
688
     #if ENABLED(DELTA) // correct the delta_height
684
     #if ENABLED(DELTA) // correct the delta_height
689
-      home_offset[Z_AXIS] -= diff;
685
+      delta_height -= diff;
690
     #endif
686
     #endif
691
   }
687
   }
692
 
688
 

Loading…
取消
儲存