@@ -1678,14 +1678,28 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
1678
1678
1679
1679
feedrate_mm_m = (fr_mm_m != 0.0 ) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
1680
1680
1681
+ // when in the danger zone and target is below the danger zone firs move out
1682
+ if ((current_position[Z_AXIS] > delta_clip_start_height) && (delta_clip_start_height < z)) {
1683
+ destination[X_AXIS] = current_position[X_AXIS];
1684
+ destination[Y_AXIS] = current_position[Y_AXIS];
1685
+ destination[Z_AXIS] = delta_clip_start_height;
1686
+ prepare_move_to_destination (); // this will also set_current_to_destination
1687
+ }
1688
+ if (current_position[Z_AXIS] < z) { // raise
1689
+ destination[X_AXIS] = current_position[X_AXIS];
1690
+ destination[Y_AXIS] = current_position[Y_AXIS];
1691
+ destination[Z_AXIS] = z;
1692
+ prepare_move_to_destination (); // this will also set_current_to_destination
1693
+ }
1681
1694
destination[X_AXIS] = x;
1682
1695
destination[Y_AXIS] = y;
1683
- destination[Z_AXIS] = z;
1696
+ destination[Z_AXIS] = current_position[Z_AXIS];
1697
+ prepare_move_to_destination_raw (); // this will also set_current_to_destination
1684
1698
1685
- if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
1686
- prepare_move_to_destination_raw (); // this will also set_current_to_destination
1687
- else
1699
+ if (current_position[Z_AXIS] > z) { // lower
1700
+ destination[Z_AXIS] = z;
1688
1701
prepare_move_to_destination (); // this will also set_current_to_destination
1702
+ }
1689
1703
1690
1704
#else
1691
1705
@@ -2079,7 +2093,7 @@ static void clean_up_after_endstop_or_probe_move() {
2079
2093
endstops.hit_on_purpose (); // clear endstop hit flags
2080
2094
// Get the current stepper position after bumping an endstop
2081
2095
current_position[Z_AXIS] = stepper.get_axis_position_mm (Z_AXIS);
2082
- SYNC_PLAN_POSITION_KINEMATIC (); // tell the planner where we are feedrate_mm_m = homing_feedrate_mm_m[Z_AXIS];
2096
+ SYNC_PLAN_POSITION_KINEMATIC (); // tell the planner where we are
2083
2097
2084
2098
// move up the retract distance
2085
2099
current_position[Z_AXIS] += home_bump_mm (Z_AXIS);
0 commit comments