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

@ -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));