1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 07:17:59 +00:00

Extra Z Servo Probe options (#21427)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Kurt Haenen 2023-03-09 07:20:30 +01:00 committed by GitHub
parent 0b473eecbc
commit db5ff20b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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();