Skip to content

Commit 376a572

Browse files
committed
DELTA do_blocking_move_to() more like the Chartesian one
1 parent 824c685 commit 376a572

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

Marlin/Marlin_main.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,14 +1679,36 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
16791679

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

1682+
// when in the danger zone
1683+
if (current_position[Z_AXIS] > delta_clip_start_height) {
1684+
if (delta_clip_start_height < z) { // staying in the danger zone
1685+
destination[X_AXIS] = x; // move directly
1686+
destination[Y_AXIS] = y;
1687+
destination[Z_AXIS] = z;
1688+
prepare_move_to_destination_raw(); // this will also set_current_to_destination
1689+
return;
1690+
} else { // leave the danger zone
1691+
destination[X_AXIS] = current_position[X_AXIS];
1692+
destination[Y_AXIS] = current_position[Y_AXIS];
1693+
destination[Z_AXIS] = delta_clip_start_height;
1694+
prepare_move_to_destination_raw(); // this will also set_current_to_destination
1695+
}
1696+
}
1697+
if (current_position[Z_AXIS] < z) { // raise
1698+
destination[X_AXIS] = current_position[X_AXIS];
1699+
destination[Y_AXIS] = current_position[Y_AXIS];
1700+
destination[Z_AXIS] = z;
1701+
prepare_move_to_destination_raw(); // this will also set_current_to_destination
1702+
}
16821703
destination[X_AXIS] = x;
16831704
destination[Y_AXIS] = y;
1684-
destination[Z_AXIS] = z;
1705+
destination[Z_AXIS] = current_position[Z_AXIS];
1706+
prepare_move_to_destination(); // this will also set_current_to_destination
16851707

1686-
if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
1708+
if (current_position[Z_AXIS] > z) { // lower
1709+
destination[Z_AXIS] = z;
16871710
prepare_move_to_destination_raw(); // this will also set_current_to_destination
1688-
else
1689-
prepare_move_to_destination(); // this will also set_current_to_destination
1711+
}
16901712

16911713
#else
16921714

0 commit comments

Comments
 (0)