Trinamic: Split stealthChop, improve driver monitoring, etc. (#12582)
This commit is contained in:
committed by
Scott Lahteine
parent
055cb2b956
commit
50b2fbd031
@@ -206,14 +206,6 @@ void forward_kinematics_DELTA(const float &z1, const float &z2, const float &z3)
|
||||
cartes[Z_AXIS] = z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
|
||||
}
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
inline void delta_sensorless_homing(const bool on=true) {
|
||||
sensorless_homing_per_axis(A_AXIS, on);
|
||||
sensorless_homing_per_axis(B_AXIS, on);
|
||||
sensorless_homing_per_axis(C_AXIS, on);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A delta can only safely home all axes at the same time
|
||||
* This is like quick_home_xy() but for 3 towers.
|
||||
@@ -229,7 +221,10 @@ void home_delta() {
|
||||
|
||||
// Disable stealthChop if used. Enable diag1 pin on driver.
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
delta_sensorless_homing();
|
||||
sensorless_t stealth_states { false, false, false };
|
||||
stealth_states.x = tmc_enable_stallguard(stepperX);
|
||||
stealth_states.y = tmc_enable_stallguard(stepperY);
|
||||
stealth_states.z = tmc_enable_stallguard(stepperZ);
|
||||
#endif
|
||||
|
||||
// Move all carriages together linearly until an endstop is hit.
|
||||
@@ -239,7 +234,9 @@ void home_delta() {
|
||||
|
||||
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
delta_sensorless_homing(false);
|
||||
tmc_disable_stallguard(stepperX, stealth_states.x);
|
||||
tmc_disable_stallguard(stepperY, stealth_states.y);
|
||||
tmc_disable_stallguard(stepperZ, stealth_states.z);
|
||||
#endif
|
||||
|
||||
endstops.validate_homing_move();
|
||||
|
Reference in New Issue
Block a user