BLTOUCH tweaks, new v3.1 command (#14015)

This commit is contained in:
FanDjango
2019-05-18 02:10:18 +02:00
committed by Scott Lahteine
parent 62ef54cb81
commit 85fb33a060
11 changed files with 184 additions and 139 deletions

View File

@ -465,8 +465,7 @@ void _O2 Endstops::M119() {
#endif
#endif
#if ENABLED(BLTOUCH)
bltouch._reset();
if (enabled_globally) bltouch._stow();
bltouch._reset_SW_mode();
#endif
} // Endstops::M119

View File

@ -1422,8 +1422,7 @@ void homeaxis(const AxisEnum axis) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 1 Fast:");
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to be deployed every time
if (axis == Z_AXIS && bltouch.deploy()) return;
if (axis == Z_AXIS && bltouch.deploy()) return; // The initial DEPLOY
#endif
do_homing_move(axis, 1.5f * max_length(
@ -1435,9 +1434,8 @@ void homeaxis(const AxisEnum axis) {
) * axis_home_dir
);
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to be stowed after trigger to rearm itself
if (axis == Z_AXIS) bltouch.stow();
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)
if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
#endif
// When homing Z with probe respect probe clearance
@ -1461,16 +1459,14 @@ void homeaxis(const AxisEnum axis) {
// Slow move towards endstop until triggered
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Home 2 Slow:");
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to be deployed every time
if (axis == Z_AXIS && bltouch.deploy()) return;
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)
if (axis == Z_AXIS && bltouch.deploy()) return; // Intermediate DEPLOY (in LOW SPEED MODE)
#endif
do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
// BLTOUCH needs to be stowed after trigger to rearm itself
if (axis == Z_AXIS) bltouch.stow();
if (axis == Z_AXIS) bltouch.stow(); // The final STOW
#endif
}

View File

@ -356,9 +356,15 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
dock_sled(!deploy);
#elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH)
#elif HAS_Z_SERVO_PROBE
MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);
#if DISABLED(BLTOUCH)
MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);
#elif ENABLED(BLTOUCH_HS_MODE)
// In HIGH SPEED MODE, use the normal retractable probe logic in this code
// i.e. no intermediate STOWs and DEPLOYs in between individual probe actions
if (deploy) bltouch.deploy(); else bltouch.stow();
#endif
#elif ENABLED(Z_PROBE_ALLEN_KEY)
@ -492,9 +498,8 @@ static bool do_probe_move(const float z, const float fr_mm_s) {
}
#endif
// Deploy BLTouch at the start of any probe
#if ENABLED(BLTOUCH)
if (bltouch.deploy()) return true;
#if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)
if (bltouch.deploy()) return true; // DEPLOY in LOW SPEED MODE on every probe action
#endif
// Disable stealthChop if used. Enable diag1 pin on driver.
@ -544,9 +549,8 @@ static bool do_probe_move(const float z, const float fr_mm_s) {
tmc_disable_stallguard(stepperZ, stealth_states.z);
#endif
// Retract BLTouch immediately after a probe if it was triggered
#if ENABLED(BLTOUCH)
if (probe_triggered && bltouch.stow()) return true;
#if ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)
if (probe_triggered && bltouch.stow()) return true; // STOW in LOW SPEED MODE on trigger on every probe action
#endif
// Clear endstop flags