🩹 Prevent Z drop with G28 X/Y

This commit is contained in:
Scott Lahteine
2023-05-29 19:23:21 -05:00
parent 2dffa3994d
commit cbdc01ef1a

View File

@@ -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