Browse Source

Adjustments to blocking moves

Scott Lahteine 7 years ago
parent
commit
26a40373fc
1 changed files with 17 additions and 20 deletions
  1. 17
    20
      Marlin/Marlin_main.cpp

+ 17
- 20
Marlin/Marlin_main.cpp View File

@@ -1697,6 +1697,8 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1697 1697
     if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, LOGICAL_X_POSITION(rx), LOGICAL_Y_POSITION(ry), LOGICAL_Z_POSITION(rz));
1698 1698
   #endif
1699 1699
 
1700
+  const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1701
+
1700 1702
   #if ENABLED(DELTA)
1701 1703
 
1702 1704
     if (!position_is_reachable(rx, ry)) return;
@@ -1721,18 +1723,16 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1721 1723
         #endif
1722 1724
         return;
1723 1725
       }
1724
-      else {
1725
-        destination[Z_AXIS] = delta_clip_start_height;
1726
-        prepare_uninterpolated_move_to_destination(); // set_current_from_destination
1727
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
1728
-          if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
1729
-        #endif
1730
-      }
1726
+      destination[Z_AXIS] = delta_clip_start_height;
1727
+      prepare_uninterpolated_move_to_destination(); // set_current_from_destination
1728
+      #if ENABLED(DEBUG_LEVELING_FEATURE)
1729
+        if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
1730
+      #endif
1731 1731
     }
1732 1732
 
1733 1733
     if (rz > current_position[Z_AXIS]) {    // raising?
1734 1734
       destination[Z_AXIS] = rz;
1735
-      prepare_uninterpolated_move_to_destination();   // set_current_from_destination
1735
+      prepare_uninterpolated_move_to_destination(z_feedrate);   // set_current_from_destination
1736 1736
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1737 1737
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
1738 1738
       #endif
@@ -1747,7 +1747,7 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1747 1747
 
1748 1748
     if (rz < current_position[Z_AXIS]) {    // lowering?
1749 1749
       destination[Z_AXIS] = rz;
1750
-      prepare_uninterpolated_move_to_destination();   // set_current_from_destination
1750
+      prepare_uninterpolated_move_to_destination(z_feedrate);   // set_current_from_destination
1751 1751
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1752 1752
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
1753 1753
       #endif
@@ -1762,7 +1762,7 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1762 1762
     // If Z needs to raise, do it before moving XY
1763 1763
     if (destination[Z_AXIS] < rz) {
1764 1764
       destination[Z_AXIS] = rz;
1765
-      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS));
1765
+      prepare_uninterpolated_move_to_destination(z_feedrate);
1766 1766
     }
1767 1767
 
1768 1768
     destination[X_AXIS] = rx;
@@ -1772,14 +1772,14 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1772 1772
     // If Z needs to lower, do it after moving XY
1773 1773
     if (destination[Z_AXIS] > rz) {
1774 1774
       destination[Z_AXIS] = rz;
1775
-      prepare_uninterpolated_move_to_destination(fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS));
1775
+      prepare_uninterpolated_move_to_destination(z_feedrate);
1776 1776
     }
1777 1777
 
1778 1778
   #else
1779 1779
 
1780 1780
     // If Z needs to raise, do it before moving XY
1781 1781
     if (current_position[Z_AXIS] < rz) {
1782
-      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1782
+      feedrate_mm_s = z_feedrate;
1783 1783
       current_position[Z_AXIS] = rz;
1784 1784
       buffer_line_to_current_position();
1785 1785
     }
@@ -1791,7 +1791,7 @@ void do_blocking_move_to(const float &rx, const float &ry, const float &rz, cons
1791 1791
 
1792 1792
     // If Z needs to lower, do it after moving XY
1793 1793
     if (current_position[Z_AXIS] > rz) {
1794
-      feedrate_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1794
+      feedrate_mm_s = z_feedrate;
1795 1795
       current_position[Z_AXIS] = rz;
1796 1796
       buffer_line_to_current_position();
1797 1797
     }
@@ -4268,13 +4268,10 @@ void home_all_axes() { gcode_G28(true); }
4268 4268
 
4269 4269
     #if MANUAL_PROBE_HEIGHT > 0
4270 4270
       const float prev_z = current_position[Z_AXIS];
4271
-      do_blocking_move_to_z(MANUAL_PROBE_HEIGHT, homing_feedrate(Z_AXIS));
4272
-    #endif
4273
-
4274
-    do_blocking_move_to_xy(rx, ry, MMM_TO_MMS(XY_PROBE_SPEED));
4275
-
4276
-    #if MANUAL_PROBE_HEIGHT > 0
4277
-      do_blocking_move_to_z(prev_z, homing_feedrate(Z_AXIS));
4271
+      do_blocking_move_to(rx, ry, MANUAL_PROBE_HEIGHT);
4272
+      do_blocking_move_to_z(prev_z);
4273
+    #else
4274
+      do_blocking_move_to_xy(rx, ry);
4278 4275
     #endif
4279 4276
 
4280 4277
     current_position[X_AXIS] = rx;

Loading…
Cancel
Save