Skip to content

Commit

Permalink
🚸 Enabled probe clearance in do_move_after_z_homing
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 16, 2024
1 parent c4ef2d6 commit 848ed5e
Showing 1 changed file with 18 additions and 15 deletions.
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

0 comments on commit 848ed5e

Please sign in to comment.