From cbdc01ef1aa52bb3b30cf38dbb8ea773e99522b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 29 May 2023 19:23:21 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Prevent=20Z=20drop=20with=20G28?= =?UTF-8?q?=20X/Y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G28.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 839e29ecc4..a9f378adfc 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -424,20 +424,10 @@ void GcodeSuite::G28() { if (seenR && z_homing_height == 0) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("R0 = No Z raise"); } - else { - bool with_probe = ENABLED(HOMING_Z_WITH_PROBE); - // Raise above the current Z (which should be synced in the planner) - // The "height" for Z is a coordinate. But if Z is not trusted/homed make it relative. - if (seenR || !TERN(HOME_AFTER_DEACTIVATE, axis_is_trusted, axis_was_homed)(Z_AXIS)) { - z_homing_height += current_position.z; - with_probe = false; - } - - if (may_skate) { - // Apply Z clearance before doing any lateral motion - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z before homing:"); - do_z_clearance(z_homing_height, with_probe); - } + else if (z_homing_height && may_skate) { + // Raise Z before homing any other axes and z is not already high enough (never lower z) + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Raise Z before homing:"); + do_z_clearance(z_homing_height); } // Init BLTouch ahead of any lateral motion, even if not homing with the probe