diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 54a895712d..77f1908901 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1388,8 +1388,10 @@ /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ -//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. -//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles +//#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy. +//#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points. /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 4769bd79c0..114fa55520 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -491,7 +491,7 @@ G29_TYPE GcodeSuite::G29() { if (!no_action) set_bed_leveling_enabled(false); // Deploy certain probes before starting probing - #if ENABLED(BLTOUCH) + #if ENABLED(BLTOUCH) || BOTH(HAS_Z_SERVO_PROBE, Z_SERVO_INTERMEDIATE_STOW) do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); #elif HAS_BED_PROBE if (probe.deploy()) { // (returns true on deploy failure) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index f0a3c8584b..7daafd1139 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -405,6 +405,11 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); + #ifdef Z_SERVO_MEASURE_ANGLE + // After deploy move back to the measure angle... + if (deploy) MOVE_SERVO(Z_PROBE_SERVO_NR, Z_SERVO_MEASURE_ANGLE); + #endif + #elif ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE) deploy ? run_deploy_moves() : run_stow_moves(); @@ -582,11 +587,16 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { #if BOTH(HAS_TEMP_HOTEND, WAIT_FOR_HOTEND) thermalManager.wait_for_hotend_heating(active_extruder); #endif + #if ENABLED(BLTOUCH) if (!bltouch.high_speed_mode && bltouch.deploy()) return true; // Deploy in LOW SPEED MODE on every probe action #endif + #if HAS_Z_SERVO_PROBE && (ENABLED(Z_SERVO_INTERMEDIATE_STOW) || defined(Z_SERVO_MEASURE_ANGLE)) + probe_specific_action(true); // Always re-deploy in this case + #endif + // Disable stealthChop if used. Enable diag1 pin on driver. #if ENABLED(SENSORLESS_PROBING) sensorless_t stealth_states { false }; @@ -636,6 +646,10 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { return true; // Stow in LOW SPEED MODE on every trigger #endif + #if BOTH(HAS_Z_SERVO_PROBE, Z_SERVO_INTERMEDIATE_STOW) + probe_specific_action(false); // Always stow + #endif + // Clear endstop flags endstops.hit_on_purpose();