Browse Source

Fix HOMING_BACKOFF_MM for DELTA (#16657)

Jason Smith 5 years ago
parent
commit
44d400db83
2 changed files with 11 additions and 9 deletions
  1. 9
    1
      Marlin/src/module/delta.cpp
  2. 2
    8
      Marlin/src/module/motion.cpp

+ 9
- 1
Marlin/src/module/delta.cpp View File

254
       - probe_offset.z
254
       - probe_offset.z
255
     #endif
255
     #endif
256
   );
256
   );
257
-  line_to_current_position(homing_feedrate(X_AXIS));
257
+  line_to_current_position(homing_feedrate(Z_AXIS));
258
   planner.synchronize();
258
   planner.synchronize();
259
 
259
 
260
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
260
   // Re-enable stealthChop if used. Disable diag1 pin on driver.
280
 
280
 
281
   sync_plan_position();
281
   sync_plan_position();
282
 
282
 
283
+  #if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_MM)
284
+    constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
285
+    if (endstop_backoff.z) {
286
+      current_position.z -= ABS(endstop_backoff.z) * Z_HOME_DIR;
287
+      line_to_current_position(homing_feedrate(Z_AXIS));
288
+    }
289
+  #endif
290
+
283
   if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position);
291
   if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position);
284
 }
292
 }
285
 
293
 

+ 2
- 8
Marlin/src/module/motion.cpp View File

1748
     if (axis == Z_AXIS && STOW_PROBE()) return;
1748
     if (axis == Z_AXIS && STOW_PROBE()) return;
1749
   #endif
1749
   #endif
1750
 
1750
 
1751
-  #ifdef HOMING_BACKOFF_MM
1751
+  #if DISABLED(DELTA) && defined(HOMING_BACKOFF_MM)
1752
     constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
1752
     constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
1753
-    const float backoff_mm = endstop_backoff[
1754
-      #if ENABLED(DELTA)
1755
-        Z_AXIS
1756
-      #else
1757
-        axis
1758
-      #endif
1759
-    ];
1753
+    const float backoff_mm = endstop_backoff[axis];
1760
     if (backoff_mm) {
1754
     if (backoff_mm) {
1761
       current_position[axis] -= ABS(backoff_mm) * axis_home_dir;
1755
       current_position[axis] -= ABS(backoff_mm) * axis_home_dir;
1762
       line_to_current_position(
1756
       line_to_current_position(

Loading…
Cancel
Save