XY_COUNTERPART_BACKOFF_MM

This commit is contained in:
studiodyne 2022-08-28 00:43:32 +02:00 committed by Scott Lahteine
parent 3d03f96205
commit 1f72c8341f
2 changed files with 12 additions and 0 deletions

View File

@ -874,6 +874,7 @@
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing
//#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa
//#define QUICK_HOME // If G28 contains XY do a diagonal move first
//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X

View File

@ -1994,6 +1994,17 @@ void prepare_line_to_destination() {
}
#endif
//
// Back away to prevent opposite endstop damage
//
#if !defined(SENSORLESS_BACKOFF_MM) && XY_COUNTERPART_BACKOFF_MM
if (!(axis_was_homed(X_AXIS) || axis_was_homed(Y_AXIS)) && (axis == X_AXIS || axis == Y_AXIS)) {
const AxisEnum opposite_axis = axis == X_AXIS ? Y_AXIS : X_AXIS;
const float backoff_length = -ABS(XY_COUNTERPART_BACKOFF_MM) * home_dir(opposite_axis);
do_homing_move(opposite_axis, backoff_length, homing_feedrate(opposite_axis));
}
#endif
// Determine if a homing bump will be done and the bumps distance
// When homing Z with probe respect probe clearance
const bool use_probe_bump = TERN0(HOMING_Z_WITH_PROBE, axis == Z_AXIS && home_bump_mm(axis));