Browse Source

Adjustments to blocking moves

Scott Lahteine 6 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
     if (DEBUGGING(LEVELING)) print_xyz(PSTR(">>> do_blocking_move_to"), NULL, LOGICAL_X_POSITION(rx), LOGICAL_Y_POSITION(ry), LOGICAL_Z_POSITION(rz));
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
   #endif
1698
   #endif
1699
 
1699
 
1700
+  const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS);
1701
+
1700
   #if ENABLED(DELTA)
1702
   #if ENABLED(DELTA)
1701
 
1703
 
1702
     if (!position_is_reachable(rx, ry)) return;
1704
     if (!position_is_reachable(rx, ry)) return;
1721
         #endif
1723
         #endif
1722
         return;
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
     if (rz > current_position[Z_AXIS]) {    // raising?
1733
     if (rz > current_position[Z_AXIS]) {    // raising?
1734
       destination[Z_AXIS] = rz;
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
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1736
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1737
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
1737
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
1738
       #endif
1738
       #endif
1747
 
1747
 
1748
     if (rz < current_position[Z_AXIS]) {    // lowering?
1748
     if (rz < current_position[Z_AXIS]) {    // lowering?
1749
       destination[Z_AXIS] = rz;
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
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1751
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1752
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
1752
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
1753
       #endif
1753
       #endif
1762
     // If Z needs to raise, do it before moving XY
1762
     // If Z needs to raise, do it before moving XY
1763
     if (destination[Z_AXIS] < rz) {
1763
     if (destination[Z_AXIS] < rz) {
1764
       destination[Z_AXIS] = rz;
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
     destination[X_AXIS] = rx;
1768
     destination[X_AXIS] = rx;
1772
     // If Z needs to lower, do it after moving XY
1772
     // If Z needs to lower, do it after moving XY
1773
     if (destination[Z_AXIS] > rz) {
1773
     if (destination[Z_AXIS] > rz) {
1774
       destination[Z_AXIS] = rz;
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
   #else
1778
   #else
1779
 
1779
 
1780
     // If Z needs to raise, do it before moving XY
1780
     // If Z needs to raise, do it before moving XY
1781
     if (current_position[Z_AXIS] < rz) {
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
       current_position[Z_AXIS] = rz;
1783
       current_position[Z_AXIS] = rz;
1784
       buffer_line_to_current_position();
1784
       buffer_line_to_current_position();
1785
     }
1785
     }
1791
 
1791
 
1792
     // If Z needs to lower, do it after moving XY
1792
     // If Z needs to lower, do it after moving XY
1793
     if (current_position[Z_AXIS] > rz) {
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
       current_position[Z_AXIS] = rz;
1795
       current_position[Z_AXIS] = rz;
1796
       buffer_line_to_current_position();
1796
       buffer_line_to_current_position();
1797
     }
1797
     }
4268
 
4268
 
4269
     #if MANUAL_PROBE_HEIGHT > 0
4269
     #if MANUAL_PROBE_HEIGHT > 0
4270
       const float prev_z = current_position[Z_AXIS];
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
     #endif
4275
     #endif
4279
 
4276
 
4280
     current_position[X_AXIS] = rx;
4277
     current_position[X_AXIS] = rx;

Loading…
Cancel
Save