|
@@ -1624,86 +1624,86 @@ static void clean_up_after_endstop_or_probe_move() {
|
1624
|
1624
|
refresh_cmd_timeout();
|
1625
|
1625
|
}
|
1626
|
1626
|
|
1627
|
|
-#if HAS_BED_PROBE
|
1628
|
|
- #if ENABLED(DELTA)
|
1629
|
|
- /**
|
1630
|
|
- * Calculate delta, start a line, and set current_position to destination
|
1631
|
|
- */
|
1632
|
|
- void prepare_move_to_destination_raw() {
|
1633
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
1634
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination);
|
1635
|
|
- #endif
|
1636
|
|
- refresh_cmd_timeout();
|
1637
|
|
- calculate_delta(destination);
|
1638
|
|
- planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
|
1639
|
|
- set_current_to_destination();
|
1640
|
|
- }
|
1641
|
|
- #endif
|
1642
|
|
-
|
|
1627
|
+#if ENABLED(DELTA)
|
1643
|
1628
|
/**
|
1644
|
|
- * Plan a move to (X, Y, Z) and set the current_position
|
1645
|
|
- * The final current_position may not be the one that was requested
|
|
1629
|
+ * Calculate delta, start a line, and set current_position to destination
|
1646
|
1630
|
*/
|
1647
|
|
- static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
|
1648
|
|
- float old_feedrate = feedrate;
|
1649
|
|
-
|
|
1631
|
+ void prepare_move_to_destination_raw() {
|
1650
|
1632
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1651
|
|
- if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
|
|
1633
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_move_to_destination_raw", destination);
|
1652
|
1634
|
#endif
|
|
1635
|
+ refresh_cmd_timeout();
|
|
1636
|
+ calculate_delta(destination);
|
|
1637
|
+ planner.buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], destination[E_AXIS], (feedrate / 60) * (feedrate_multiplier / 100.0), active_extruder);
|
|
1638
|
+ set_current_to_destination();
|
|
1639
|
+ }
|
|
1640
|
+#endif
|
1653
|
1641
|
|
1654
|
|
- #if ENABLED(DELTA)
|
|
1642
|
+/**
|
|
1643
|
+ * Plan a move to (X, Y, Z) and set the current_position
|
|
1644
|
+ * The final current_position may not be the one that was requested
|
|
1645
|
+ */
|
|
1646
|
+static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
|
|
1647
|
+ float old_feedrate = feedrate;
|
1655
|
1648
|
|
1656
|
|
- feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
1649
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
1650
|
+ if (DEBUGGING(LEVELING)) print_xyz(PSTR("do_blocking_move_to"), "", x, y, z);
|
|
1651
|
+ #endif
|
1657
|
1652
|
|
1658
|
|
- destination[X_AXIS] = x;
|
1659
|
|
- destination[Y_AXIS] = y;
|
1660
|
|
- destination[Z_AXIS] = z;
|
|
1653
|
+ #if ENABLED(DELTA)
|
1661
|
1654
|
|
1662
|
|
- if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
|
1663
|
|
- prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
1664
|
|
- else
|
1665
|
|
- prepare_move_to_destination(); // this will also set_current_to_destination
|
|
1655
|
+ feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
1666
|
1656
|
|
1667
|
|
- #else
|
|
1657
|
+ destination[X_AXIS] = x;
|
|
1658
|
+ destination[Y_AXIS] = y;
|
|
1659
|
+ destination[Z_AXIS] = z;
|
1668
|
1660
|
|
1669
|
|
- // If Z needs to raise, do it before moving XY
|
1670
|
|
- if (current_position[Z_AXIS] < z) {
|
1671
|
|
- feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
1672
|
|
- current_position[Z_AXIS] = z;
|
1673
|
|
- line_to_current_position();
|
1674
|
|
- }
|
|
1661
|
+ if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
|
|
1662
|
+ prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
1663
|
+ else
|
|
1664
|
+ prepare_move_to_destination(); // this will also set_current_to_destination
|
1675
|
1665
|
|
1676
|
|
- feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
1677
|
|
- current_position[X_AXIS] = x;
|
1678
|
|
- current_position[Y_AXIS] = y;
|
|
1666
|
+ #else
|
|
1667
|
+
|
|
1668
|
+ // If Z needs to raise, do it before moving XY
|
|
1669
|
+ if (current_position[Z_AXIS] < z) {
|
|
1670
|
+ feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
1671
|
+ current_position[Z_AXIS] = z;
|
1679
|
1672
|
line_to_current_position();
|
|
1673
|
+ }
|
1680
|
1674
|
|
1681
|
|
- // If Z needs to lower, do it after moving XY
|
1682
|
|
- if (current_position[Z_AXIS] > z) {
|
1683
|
|
- feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
1684
|
|
- current_position[Z_AXIS] = z;
|
1685
|
|
- line_to_current_position();
|
1686
|
|
- }
|
|
1675
|
+ feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
|
|
1676
|
+ current_position[X_AXIS] = x;
|
|
1677
|
+ current_position[Y_AXIS] = y;
|
|
1678
|
+ line_to_current_position();
|
1687
|
1679
|
|
1688
|
|
- #endif
|
|
1680
|
+ // If Z needs to lower, do it after moving XY
|
|
1681
|
+ if (current_position[Z_AXIS] > z) {
|
|
1682
|
+ feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
|
|
1683
|
+ current_position[Z_AXIS] = z;
|
|
1684
|
+ line_to_current_position();
|
|
1685
|
+ }
|
1689
|
1686
|
|
1690
|
|
- stepper.synchronize();
|
|
1687
|
+ #endif
|
1691
|
1688
|
|
1692
|
|
- feedrate = old_feedrate;
|
1693
|
|
- }
|
|
1689
|
+ stepper.synchronize();
|
1694
|
1690
|
|
1695
|
|
- inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
|
1696
|
|
- do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
|
1697
|
|
- }
|
|
1691
|
+ feedrate = old_feedrate;
|
|
1692
|
+}
|
1698
|
1693
|
|
1699
|
|
- inline void do_blocking_move_to_y(float y) {
|
1700
|
|
- do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]);
|
1701
|
|
- }
|
|
1694
|
+inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
|
|
1695
|
+ do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
|
|
1696
|
+}
|
1702
|
1697
|
|
1703
|
|
- inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
|
1704
|
|
- do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
|
1705
|
|
- }
|
|
1698
|
+inline void do_blocking_move_to_y(float y) {
|
|
1699
|
+ do_blocking_move_to(current_position[X_AXIS], y, current_position[Z_AXIS]);
|
|
1700
|
+}
|
1706
|
1701
|
|
|
1702
|
+inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
|
|
1703
|
+ do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
|
|
1704
|
+}
|
|
1705
|
+
|
|
1706
|
+#if HAS_BED_PROBE
|
1707
|
1707
|
/**
|
1708
|
1708
|
* Raise Z to a minimum height to make room for a probe to move
|
1709
|
1709
|
*/
|