mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
Merge pull request #10249 from thinkyhead/bf1_homing_move_adjustments
[1.1.x] Improvements to general and delta homing
This commit is contained in:
commit
360166f626
@ -2891,19 +2891,29 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
|
// Only do some things when moving towards an endstop
|
||||||
const bool deploy_bltouch = (axis == Z_AXIS && distance < 0);
|
const int8_t axis_home_dir =
|
||||||
if (deploy_bltouch) set_bltouch_deployed(true);
|
#if ENABLED(DUAL_X_CARRIAGE)
|
||||||
#endif
|
(axis == X_AXIS) ? x_home_dir(active_extruder) :
|
||||||
|
#endif
|
||||||
|
home_dir(axis);
|
||||||
|
const bool is_home_dir = (axis_home_dir > 0) == (distance > 0);
|
||||||
|
|
||||||
#if QUIET_PROBING
|
if (is_home_dir) {
|
||||||
if (axis == Z_AXIS) probing_pause(true);
|
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
|
||||||
#endif
|
const bool deploy_bltouch = (axis == Z_AXIS && is_home_dir);
|
||||||
|
if (deploy_bltouch) set_bltouch_deployed(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Disable stealthChop if used. Enable diag1 pin on driver.
|
#if QUIET_PROBING
|
||||||
#if ENABLED(SENSORLESS_HOMING)
|
if (axis == Z_AXIS) probing_pause(true);
|
||||||
sensorless_homing_per_axis(axis);
|
#endif
|
||||||
#endif
|
|
||||||
|
// Disable stealthChop if used. Enable diag1 pin on driver.
|
||||||
|
#if ENABLED(SENSORLESS_HOMING)
|
||||||
|
sensorless_homing_per_axis(axis);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Tell the planner the axis is at 0
|
// Tell the planner the axis is at 0
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
@ -2921,20 +2931,22 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
|||||||
|
|
||||||
stepper.synchronize();
|
stepper.synchronize();
|
||||||
|
|
||||||
#if QUIET_PROBING
|
if (is_home_dir) {
|
||||||
if (axis == Z_AXIS) probing_pause(false);
|
#if QUIET_PROBING
|
||||||
#endif
|
if (axis == Z_AXIS) probing_pause(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
|
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
|
||||||
if (deploy_bltouch) set_bltouch_deployed(false);
|
if (deploy_bltouch) set_bltouch_deployed(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
endstops.hit_on_purpose();
|
endstops.hit_on_purpose();
|
||||||
|
|
||||||
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
||||||
#if ENABLED(SENSORLESS_HOMING)
|
#if ENABLED(SENSORLESS_HOMING)
|
||||||
sensorless_homing_per_axis(axis, false);
|
sensorless_homing_per_axis(axis, false);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||||
if (DEBUGGING(LEVELING)) {
|
if (DEBUGGING(LEVELING)) {
|
||||||
@ -3820,15 +3832,17 @@ 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)
|
||||||
|
delta_sensorless_homing(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3840,11 +3854,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user