Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚸 Conditional extra clearance in do_move_after_z_homing #27593

Open
wants to merge 1 commit into
base: bugfix-2.1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,12 +1309,16 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*
void do_move_after_z_homing() {
DEBUG_SECTION(mzah, "do_move_after_z_homing", DEBUGGING(LEVELING));
#ifdef Z_POST_CLEARANCE
do_z_clearance(Z_POST_CLEARANCE, true, true);
do_z_clearance(
Z_POST_CLEARANCE,
ALL(HOMING_Z_WITH_PROBE, HAS_STOWABLE_PROBE) && TERN0(HAS_BED_PROBE, endstops.z_probe_enabled),
true
);
#elif ENABLED(USE_PROBE_FOR_Z_HOMING)
probe.move_z_after_probing();
#endif
}
#endif
#endif // HAS_Z_AXIS

#if HAS_I_AXIS
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) {
Expand Down Expand Up @@ -2681,12 +2685,10 @@ void prepare_line_to_destination() {

//
// Homing Z with a probe? Raise Z (maybe) and deploy the Z probe.
// Return early if probe deployment fails.
//
#if HOMING_Z_WITH_PROBE
if (axis == Z_AXIS && probe.deploy()) {
probe.stow();
return;
}
if (axis == Z_AXIS && probe.deploy()) { probe.stow(); return; }
#endif

// Set flags for X, Y, Z motor locking
Expand All @@ -2705,16 +2707,17 @@ void prepare_line_to_destination() {
//
#if HOMING_Z_WITH_PROBE
if (axis == Z_AXIS) {

#if ENABLED(BLTOUCH)
if (bltouch.deploy()) { // BLTouch was deployed above, but get the alarm state.
bltouch.stow();
return;
}
// BLTouch was deployed above, but get the alarm state.
// Stow and return early if there is a deploy alarm.
if (bltouch.deploy()) { bltouch.stow(); return; }
#endif
if (TERN0(PROBE_TARE, probe.tare())) {
probe.stow();
return;
}

// Tare the probe. Stow and return early if it fails
if (TERN0(PROBE_TARE, probe.tare())) { probe.stow(); return; }

// Tell the Bed Distance Sensor we're Z homing
TERN_(BD_SENSOR, bdl.config_state = BDS_HOMING_Z);
}
#endif
Expand Down Expand Up @@ -2987,7 +2990,7 @@ void prepare_line_to_destination() {
if (axis == Z_AXIS) bdl.config_state = BDS_IDLE;
#endif

// Put away the Z probe
// Put away the Z probe. Return early if it fails.
if (TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && probe.stow())) return;

#if DISABLED(DELTA) && defined(HOMING_BACKOFF_POST_MM)
Expand Down