Defer "quiet probing" till the last Z bump (#20610)

2.0.x
FanDjango 4 years ago committed by Scott Lahteine
parent efe2859227
commit ed7698efaa

@ -1289,7 +1289,7 @@ feedRate_t get_homing_bump_feedrate(const AxisEnum axis) {
/** /**
* Home an individual linear axis * Home an individual linear axis
*/ */
void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0) { void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0, const bool final_approach=true) {
DEBUG_SECTION(log_move, "do_homing_move", DEBUGGING(LEVELING)); DEBUG_SECTION(log_move, "do_homing_move", DEBUGGING(LEVELING));
const feedRate_t home_fr_mm_s = fr_mm_s ?: homing_feedrate(axis); const feedRate_t home_fr_mm_s = fr_mm_s ?: homing_feedrate(axis);
@ -1320,7 +1320,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t
thermalManager.wait_for_bed_heating(); thermalManager.wait_for_bed_heating();
#endif #endif
TERN_(HAS_QUIET_PROBING, probe.set_probing_paused(true)); TERN_(HAS_QUIET_PROBING, if (final_approach) probe.set_probing_paused(true));
} }
// Disable stealthChop if used. Enable diag1 pin on driver. // Disable stealthChop if used. Enable diag1 pin on driver.
@ -1359,7 +1359,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t
if (is_home_dir) { if (is_home_dir) {
#if HOMING_Z_WITH_PROBE && HAS_QUIET_PROBING #if HOMING_Z_WITH_PROBE && HAS_QUIET_PROBING
if (axis == Z_AXIS) probe.set_probing_paused(false); if (axis == Z_AXIS && final_approach) probe.set_probing_paused(false);
#endif #endif
endstops.validate_homing_move(); endstops.validate_homing_move();
@ -1608,32 +1608,29 @@ void homeaxis(const AxisEnum axis) {
} }
#endif #endif
// // Determine if a homing bump will be done and the bumps distance
// Fast move towards endstop until triggered
//
const float move_length = 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Home Fast: ", move_length, "mm");
do_homing_move(axis, move_length);
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
#endif
// When homing Z with probe respect probe clearance // When homing Z with probe respect probe clearance
const bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(Z_AXIS)); const bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(Z_AXIS));
const float bump = axis_home_dir * ( const float bump = axis_home_dir * (
use_probe_bump ? _MAX(TERN0(HOMING_Z_WITH_PROBE, Z_CLEARANCE_BETWEEN_PROBES), home_bump_mm(Z_AXIS)) : home_bump_mm(axis) use_probe_bump ? _MAX(TERN0(HOMING_Z_WITH_PROBE, Z_CLEARANCE_BETWEEN_PROBES), home_bump_mm(Z_AXIS)) : home_bump_mm(axis)
); );
//
// Fast move towards endstop until triggered
//
const float move_length = 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Home Fast: ", move_length, "mm");
do_homing_move(axis, move_length, 0.0, !use_probe_bump);
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH_SLOW_MODE)
if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
#endif
// If a second homing move is configured... // If a second homing move is configured...
if (bump) { if (bump) {
// Move away from the endstop by the axis HOMING_BUMP_MM // Move away from the endstop by the axis HOMING_BUMP_MM
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Move Away: ", -bump, "mm"); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Move Away: ", -bump, "mm");
do_homing_move(axis, -bump do_homing_move(axis, -bump, TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0, false);
#if HOMING_Z_WITH_PROBE
, MMM_TO_MMS(axis == Z_AXIS ? Z_PROBE_SPEED_FAST : 0)
#endif
);
#if ENABLED(DETECT_BROKEN_ENDSTOP) #if ENABLED(DETECT_BROKEN_ENDSTOP)
// Check for a broken endstop // Check for a broken endstop
@ -1657,7 +1654,7 @@ void homeaxis(const AxisEnum axis) {
// Slow move towards endstop until triggered // Slow move towards endstop until triggered
const float rebump = bump * 2; const float rebump = bump * 2;
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Re-bump: ", rebump, "mm"); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Re-bump: ", rebump, "mm");
do_homing_move(axis, rebump, get_homing_bump_feedrate(axis)); do_homing_move(axis, rebump, get_homing_bump_feedrate(axis), true);
#if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH) #if BOTH(HOMING_Z_WITH_PROBE, BLTOUCH)
if (axis == Z_AXIS) bltouch.stow(); // The final STOW if (axis == Z_AXIS) bltouch.stow(); // The final STOW

@ -712,7 +712,7 @@ class Planner {
private: private:
// Allow do_homing_move to access internal functions, such as buffer_segment. // Allow do_homing_move to access internal functions, such as buffer_segment.
friend void do_homing_move(const AxisEnum, const float, const feedRate_t); friend void do_homing_move(const AxisEnum, const float, const feedRate_t, const bool);
#endif #endif
/** /**

Loading…
Cancel
Save