Fix home_delta for SENSORLESS_HOMING (#10144)
This commit is contained in:
@@ -3776,6 +3776,14 @@ inline void gcode_G4() {
|
|||||||
|
|
||||||
#if ENABLED(DELTA)
|
#if ENABLED(DELTA)
|
||||||
|
|
||||||
|
#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
|
* A delta can only safely home all axes at the same time
|
||||||
* This is like quick_home_xy() but for 3 towers.
|
* This is like quick_home_xy() but for 3 towers.
|
||||||
@@ -3790,9 +3798,7 @@ inline void gcode_G4() {
|
|||||||
|
|
||||||
// Disable stealthChop if used. Enable diag1 pin on driver.
|
// Disable stealthChop if used. Enable diag1 pin on driver.
|
||||||
#if ENABLED(SENSORLESS_HOMING)
|
#if ENABLED(SENSORLESS_HOMING)
|
||||||
sensorless_homing_per_axis(A_AXIS);
|
delta_sensorless_homing();
|
||||||
sensorless_homing_per_axis(B_AXIS);
|
|
||||||
sensorless_homing_per_axis(C_AXIS);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Move all carriages together linearly until an endstop is hit.
|
// Move all carriages together linearly until an endstop is hit.
|
||||||
@@ -3801,19 +3807,15 @@ inline void gcode_G4() {
|
|||||||
buffer_line_to_current_position();
|
buffer_line_to_current_position();
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
|
||||||
#if ENABLED(SENSORLESS_HOMING)
|
|
||||||
sensorless_homing_per_axis(A_AXIS, false);
|
|
||||||
sensorless_homing_per_axis(B_AXIS, false);
|
|
||||||
sensorless_homing_per_axis(C_AXIS, false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// If an endstop was not hit, then damage can occur if homing is continued.
|
// If an endstop was not hit, then damage can occur if homing is continued.
|
||||||
// This can occur if the delta height not set correctly.
|
// This can occur if the delta height not set correctly.
|
||||||
if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
|
if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
|
||||||
LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
|
LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
|
||||||
SERIAL_ERROR_START();
|
SERIAL_ERROR_START();
|
||||||
SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED);
|
SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED);
|
||||||
|
#if ENABLED(SENSORLESS_HOMING)
|
||||||
|
delta_sensorless_homing(false);
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3825,6 +3827,11 @@ inline void gcode_G4() {
|
|||||||
HOMEAXIS(B);
|
HOMEAXIS(B);
|
||||||
HOMEAXIS(C);
|
HOMEAXIS(C);
|
||||||
|
|
||||||
|
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
||||||
|
#if ENABLED(SENSORLESS_HOMING)
|
||||||
|
delta_sensorless_homing(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Set all carriages to their home positions
|
// Set all carriages to their home positions
|
||||||
// Do this here all at once for Delta, because
|
// Do this here all at once for Delta, because
|
||||||
// XYZ isn't ABC. Applying this per-tower would
|
// XYZ isn't ABC. Applying this per-tower would
|
||||||
|
Reference in New Issue
Block a user