Skip to content

Commit

Permalink
🩹 Prevent Z drop with G28 X/Y
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 30, 2023
1 parent 2dffa39 commit cbdc01e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbdc01e

Please sign in to comment.