From a9a21db39f288be7b8c10edb0b21f023a13e32de Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 22 Sep 2016 06:23:46 -0500 Subject: [PATCH] No homing bump if bump distance is 0 (or less) --- Marlin/Marlin_main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3288190fff..1429cc6ba9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2273,6 +2273,9 @@ static void homeaxis(AxisEnum axis) { if (axis == Z_AXIS) stepper.set_homing_flag(true); #endif + // Fast move towards endstop until triggered + do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir); + // When homing Z with probe respect probe clearance const float bump = axis_home_dir * ( #if HOMING_Z_WITH_PROBE @@ -2281,12 +2284,13 @@ static void homeaxis(AxisEnum axis) { home_bump_mm(axis) ); - // 1. Fast move towards endstop until triggered - // 2. Move away from the endstop by the axis HOME_BUMP_MM - // 3. Slow move towards endstop until triggered - do_homing_move(axis, 1.5 * max_length(axis) * axis_home_dir); - do_homing_move(axis, -bump); - do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); + // If a second homing move is configured... + if (bump) { + // Move away from the endstop by the axis HOME_BUMP_MM + do_homing_move(axis, -bump); + // Slow move towards endstop until triggered + do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis)); + } #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) {