diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3df9a4f410..09e559f163 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1425,8 +1425,11 @@ static void setup_for_endstop_move() { // Move up for safety feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE; - destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; - prepare_move_raw(); // this will also set_current_to_destination + + #if Z_RAISE_AFTER_PROBING > 0 + destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING; + prepare_move_raw(); // this will also set_current_to_destination + #endif // Move to the start position to initiate retraction destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X; @@ -1610,7 +1613,9 @@ static void setup_for_endstop_move() { float oldXpos = current_position[X_AXIS]; // save x position if (dock) { - do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z + #if Z_RAISE_AFTER_PROBING > 0 + do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z + #endif do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); // Dock sled a bit closer to ensure proper capturing digitalWrite(SLED_PIN, LOW); // turn off magnet } else { @@ -2766,7 +2771,11 @@ inline void gcode_G28() { // adjust for inaccurate endstops, not for reasonably accurate probes. If it were // added here, it could be seen as a compensating factor for the Z probe. // - current_position[Z_AXIS] = -zprobe_zoffset + Z_RAISE_AFTER_PROBING + (z_tmp - real_z); + current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) + #if ENABLED(SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + + Z_RAISE_AFTER_PROBING + #endif + ; // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The probe determines Z=0, not "Z home" sync_plan_position(); }