🩹 Wrap SENSORLESS_STALLGUARD_DELAY

This commit is contained in:
Scott Lahteine 2022-06-03 20:55:15 -05:00
parent 2c0b8b52d8
commit 3522d5376c
5 changed files with 22 additions and 12 deletions

View file

@ -321,7 +321,9 @@ void GcodeSuite::G28() {
stepperW.rms_current(W_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_W), tmc_save_current_W, W_CURRENT_HOME);
#endif
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif
#if ENABLED(IMPROVE_HOMING_RELIABILITY)
@ -577,7 +579,9 @@ void GcodeSuite::G28() {
#if HAS_CURRENT_HOME(W)
stepperW.rms_current(tmc_save_current_W);
#endif
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif // HAS_HOMING_CURRENT
ui.refresh();

View file

@ -1048,8 +1048,3 @@
#if ANY(DISABLE_INACTIVE_X, DISABLE_INACTIVE_Y, DISABLE_INACTIVE_Z, DISABLE_INACTIVE_I, DISABLE_INACTIVE_J, DISABLE_INACTIVE_K, DISABLE_INACTIVE_U, DISABLE_INACTIVE_V, DISABLE_INACTIVE_W, DISABLE_INACTIVE_E)
#define HAS_DISABLE_INACTIVE_AXIS 1
#endif
// Delay Sensorless Homing/Probing
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) && !defined(SENSORLESS_STALLGUARD_DELAY)
#define SENSORLESS_STALLGUARD_DELAY 0
#endif

View file

@ -240,7 +240,9 @@ void home_delta() {
TERN_(U_SENSORLESS, sensorless_t stealth_states_u = start_sensorless_homing_per_axis(U_AXIS));
TERN_(V_SENSORLESS, sensorless_t stealth_states_v = start_sensorless_homing_per_axis(V_AXIS));
TERN_(W_SENSORLESS, sensorless_t stealth_states_w = start_sensorless_homing_per_axis(W_AXIS));
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif
// Move all carriages together linearly until an endstop is hit.
@ -260,7 +262,9 @@ void home_delta() {
TERN_(U_SENSORLESS, end_sensorless_homing_per_axis(U_AXIS, stealth_states_u));
TERN_(V_SENSORLESS, end_sensorless_homing_per_axis(V_AXIS, stealth_states_v));
TERN_(W_SENSORLESS, end_sensorless_homing_per_axis(W_AXIS, stealth_states_w));
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif
endstops.validate_homing_move();

View file

@ -1679,7 +1679,10 @@ void Endstops::update() {
}
TERN_(IMPROVE_HOMING_RELIABILITY, planner.enable_stall_prevention(onoff));
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif // XYZ
}

View file

@ -1665,7 +1665,9 @@ void prepare_line_to_destination() {
// Disable stealthChop if used. Enable diag1 pin on driver.
#if ENABLED(SENSORLESS_HOMING)
stealth_states = start_sensorless_homing_per_axis(axis);
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif
}
@ -1704,7 +1706,9 @@ void prepare_line_to_destination() {
// Re-enable stealthChop if used. Disable diag1 pin on driver.
#if ENABLED(SENSORLESS_HOMING)
end_sensorless_homing_per_axis(axis, stealth_states);
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#if SENSORLESS_STALLGUARD_DELAY
safe_delay(SENSORLESS_STALLGUARD_DELAY); // Short delay needed to settle
#endif
#endif
}
}