Browse Source

Merge pull request #4875 from thinkyhead/rc_bltouch_update

Use probe clearance for bump when homing Z with probe
Scott Lahteine 8 years ago
parent
commit
1370d9a52b
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      Marlin/Marlin_main.cpp

+ 10
- 2
Marlin/Marlin_main.cpp View File

2256
     if (axis == Z_AXIS) stepper.set_homing_flag(true);
2256
     if (axis == Z_AXIS) stepper.set_homing_flag(true);
2257
   #endif
2257
   #endif
2258
 
2258
 
2259
+  // When homing Z with probe respect probe clearance
2260
+  const float bump = axis_home_dir * (
2261
+    #if HOMING_Z_WITH_PROBE
2262
+      (axis == Z_AXIS) ? max(Z_CLEARANCE_BETWEEN_PROBES, home_bump_mm(Z_AXIS)) :
2263
+    #endif
2264
+    home_bump_mm(axis)
2265
+  );
2266
+
2259
   // 1. Fast move towards endstop until triggered
2267
   // 1. Fast move towards endstop until triggered
2260
   // 2. Move away from the endstop by the axis HOME_BUMP_MM
2268
   // 2. Move away from the endstop by the axis HOME_BUMP_MM
2261
   // 3. Slow move towards endstop until triggered
2269
   // 3. Slow move towards endstop until triggered
2262
   do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir);
2270
   do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir);
2263
-  do_homing_move(axis, -home_bump_mm(axis) * axis_home_dir);
2264
-  do_homing_move(axis, 2 * home_bump_mm(axis) * axis_home_dir, get_homing_bump_feedrate(axis));
2271
+  do_homing_move(axis, -bump);
2272
+  do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
2265
 
2273
 
2266
   #if ENABLED(Z_DUAL_ENDSTOPS)
2274
   #if ENABLED(Z_DUAL_ENDSTOPS)
2267
     if (axis == Z_AXIS) {
2275
     if (axis == Z_AXIS) {

Loading…
Cancel
Save