Browse Source

Merge pull request #4080 from thinkyhead/rc_probe_feedrates

Save / restore feedrate in probing functions
Scott Lahteine 9 years ago
parent
commit
da526f6ba9
1 changed files with 20 additions and 11 deletions
  1. 20
    11
      Marlin/Marlin_main.cpp

+ 20
- 11
Marlin/Marlin_main.cpp View File

1667
 
1667
 
1668
   static void run_z_probe() {
1668
   static void run_z_probe() {
1669
 
1669
 
1670
+    float old_feedrate = feedrate;
1671
+
1670
     /**
1672
     /**
1671
      * To prevent stepper_inactive_time from running out and
1673
      * To prevent stepper_inactive_time from running out and
1672
      * EXTRUDER_RUNOUT_PREVENT from extruding
1674
      * EXTRUDER_RUNOUT_PREVENT from extruding
1743
       #endif
1745
       #endif
1744
 
1746
 
1745
     #endif // !DELTA
1747
     #endif // !DELTA
1748
+
1749
+    feedrate = old_feedrate;
1746
   }
1750
   }
1747
 
1751
 
1748
   /**
1752
   /**
1750
    *  The final current_position may not be the one that was requested
1754
    *  The final current_position may not be the one that was requested
1751
    */
1755
    */
1752
   static void do_blocking_move_to(float x, float y, float z) {
1756
   static void do_blocking_move_to(float x, float y, float z) {
1753
-    float oldFeedRate = feedrate;
1757
+    float old_feedrate = feedrate;
1754
 
1758
 
1755
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1759
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1756
       if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
1760
       if (DEBUGGING(LEVELING)) print_xyz("do_blocking_move_to", x, y, z);
1758
 
1762
 
1759
     #if ENABLED(DELTA)
1763
     #if ENABLED(DELTA)
1760
 
1764
 
1761
-      feedrate = XY_TRAVEL_SPEED;
1765
+      feedrate = xy_travel_speed;
1762
 
1766
 
1763
       destination[X_AXIS] = x;
1767
       destination[X_AXIS] = x;
1764
       destination[Y_AXIS] = y;
1768
       destination[Y_AXIS] = y;
1769
       else
1773
       else
1770
         prepare_move_to_destination();     // this will also set_current_to_destination
1774
         prepare_move_to_destination();     // this will also set_current_to_destination
1771
 
1775
 
1772
-      stepper.synchronize();
1773
-
1774
     #else
1776
     #else
1775
 
1777
 
1776
       feedrate = homing_feedrate[Z_AXIS];
1778
       feedrate = homing_feedrate[Z_AXIS];
1784
       current_position[X_AXIS] = x;
1786
       current_position[X_AXIS] = x;
1785
       current_position[Y_AXIS] = y;
1787
       current_position[Y_AXIS] = y;
1786
       line_to_current_position();
1788
       line_to_current_position();
1787
-      stepper.synchronize();
1788
 
1789
 
1789
     #endif
1790
     #endif
1790
 
1791
 
1791
-    feedrate = oldFeedRate;
1792
+    stepper.synchronize();
1793
+
1794
+    feedrate = old_feedrate;
1792
   }
1795
   }
1793
 
1796
 
1794
   inline void do_blocking_move_to_xy(float x, float y) {
1797
   inline void do_blocking_move_to_xy(float x, float y) {
1838
       DEPLOY_Z_SERVO();
1841
       DEPLOY_Z_SERVO();
1839
 
1842
 
1840
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
1843
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
1844
+      float old_feedrate = feedrate;
1845
+
1841
       feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1846
       feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1842
 
1847
 
1843
       // If endstop is already false, the Z probe is deployed
1848
       // If endstop is already false, the Z probe is deployed
1849
         if (z_min_endstop)
1854
         if (z_min_endstop)
1850
       #endif
1855
       #endif
1851
         {
1856
         {
1852
-
1853
           // Move to the start position to initiate deployment
1857
           // Move to the start position to initiate deployment
1854
           destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
1858
           destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
1855
           destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
1859
           destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
1886
         }
1890
         }
1887
 
1891
 
1888
       // Partially Home X,Y for safety
1892
       // Partially Home X,Y for safety
1889
-      destination[X_AXIS] = destination[X_AXIS] * 0.75;
1890
-      destination[Y_AXIS] = destination[Y_AXIS] * 0.75;
1893
+      destination[X_AXIS] *= 0.75;
1894
+      destination[Y_AXIS] *= 0.75;
1891
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
1895
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
1892
 
1896
 
1897
+      feedrate = old_feedrate;
1898
+
1893
       stepper.synchronize();
1899
       stepper.synchronize();
1894
 
1900
 
1895
       #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1901
       #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1943
 
1949
 
1944
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
1950
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
1945
 
1951
 
1952
+      float old_feedrate = feedrate;
1953
+
1946
       // Move up for safety
1954
       // Move up for safety
1947
       feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1955
       feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1948
 
1956
 
1983
       destination[Y_AXIS] = 0;
1991
       destination[Y_AXIS] = 0;
1984
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
1992
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
1985
 
1993
 
1994
+      feedrate = old_feedrate;
1995
+
1986
       stepper.synchronize();
1996
       stepper.synchronize();
1987
 
1997
 
1988
       #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1998
       #if ENABLED(Z_MIN_PROBE_ENDSTOP)
3829
       // TODO: clear the leveling matrix or the planner will be set incorrectly
3839
       // TODO: clear the leveling matrix or the planner will be set incorrectly
3830
       setup_for_endstop_move(); // Too late. Must be done before deploying.
3840
       setup_for_endstop_move(); // Too late. Must be done before deploying.
3831
 
3841
 
3832
-      feedrate = homing_feedrate[Z_AXIS];
3833
-
3834
       run_z_probe();
3842
       run_z_probe();
3843
+
3835
       SERIAL_PROTOCOLPGM("Bed X: ");
3844
       SERIAL_PROTOCOLPGM("Bed X: ");
3836
       SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
3845
       SERIAL_PROTOCOL(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER + 0.0001);
3837
       SERIAL_PROTOCOLPGM(" Y: ");
3846
       SERIAL_PROTOCOLPGM(" Y: ");

Loading…
Cancel
Save