Skip to content

Commit eeece78

Browse files
committed
DELTA do_blocking_move_to() more like the Chartesian one
1 parent 194d952 commit eeece78

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Marlin/Marlin_main.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,14 +1678,28 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
16781678

16791679
feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
16801680

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+
}
16811694
destination[X_AXIS] = x;
16821695
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
16841698

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;
16881701
prepare_move_to_destination(); // this will also set_current_to_destination
1702+
}
16891703

16901704
#else
16911705

@@ -2079,7 +2093,7 @@ static void clean_up_after_endstop_or_probe_move() {
20792093
endstops.hit_on_purpose(); // clear endstop hit flags
20802094
// Get the current stepper position after bumping an endstop
20812095
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
20832097

20842098
// move up the retract distance
20852099
current_position[Z_AXIS] += home_bump_mm(Z_AXIS);

0 commit comments

Comments
 (0)