Browse Source

Merge pull request #4207 from AnHardt/AllenKey2

Clean up, simplify and generalize the Allen-key-probe code.
Scott Lahteine 8 years ago
parent
commit
cb17871a48

+ 4
- 0
Marlin/Conditionals.h View File

@@ -753,6 +753,10 @@
753 753
 
754 754
   #define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED)
755 755
 
756
+  #if ENABLED(Z_PROBE_ALLEN_KEY)
757
+    #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST
758
+  #endif
759
+
756 760
   /**
757 761
    * Bed Probe dependencies
758 762
    */

+ 231
- 211
Marlin/Marlin_main.cpp View File

@@ -1651,7 +1651,7 @@ static void clean_up_after_endstop_or_probe_move() {
1651 1651
    *  Plan a move to (X, Y, Z) and set the current_position
1652 1652
    *  The final current_position may not be the one that was requested
1653 1653
    */
1654
-  static void do_blocking_move_to(float x, float y, float z) {
1654
+  static void do_blocking_move_to(float x, float y, float z, float feed_rate = 0.0) {
1655 1655
     float old_feedrate = feedrate;
1656 1656
 
1657 1657
     #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -1660,7 +1660,7 @@ static void clean_up_after_endstop_or_probe_move() {
1660 1660
 
1661 1661
     #if ENABLED(DELTA)
1662 1662
 
1663
-      feedrate = XY_PROBE_FEEDRATE;
1663
+      feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
1664 1664
 
1665 1665
       destination[X_AXIS] = x;
1666 1666
       destination[Y_AXIS] = y;
@@ -1675,19 +1675,19 @@ static void clean_up_after_endstop_or_probe_move() {
1675 1675
 
1676 1676
       // If Z needs to raise, do it before moving XY
1677 1677
       if (current_position[Z_AXIS] < z) {
1678
-        feedrate = homing_feedrate[Z_AXIS];
1678
+        feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
1679 1679
         current_position[Z_AXIS] = z;
1680 1680
         line_to_current_position();
1681 1681
       }
1682 1682
 
1683
-      feedrate = XY_PROBE_FEEDRATE;
1683
+      feedrate = (feed_rate != 0.0) ? feed_rate : XY_PROBE_FEEDRATE;
1684 1684
       current_position[X_AXIS] = x;
1685 1685
       current_position[Y_AXIS] = y;
1686 1686
       line_to_current_position();
1687 1687
 
1688 1688
       // If Z needs to lower, do it after moving XY
1689 1689
       if (current_position[Z_AXIS] > z) {
1690
-        feedrate = homing_feedrate[Z_AXIS];
1690
+        feedrate = (feed_rate != 0.0) ? feed_rate : homing_feedrate[Z_AXIS];
1691 1691
         current_position[Z_AXIS] = z;
1692 1692
         line_to_current_position();
1693 1693
       }
@@ -1699,12 +1699,12 @@ static void clean_up_after_endstop_or_probe_move() {
1699 1699
     feedrate = old_feedrate;
1700 1700
   }
1701 1701
 
1702
-  inline void do_blocking_move_to_x(float x) {
1703
-    do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS]);
1702
+  inline void do_blocking_move_to_x(float x, float feed_rate = 0.0) {
1703
+    do_blocking_move_to(x, current_position[Y_AXIS], current_position[Z_AXIS], feed_rate);
1704 1704
   }
1705 1705
 
1706
-  inline void do_blocking_move_to_z(float z) {
1707
-    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z);
1706
+  inline void do_blocking_move_to_z(float z, float feed_rate = 0.0) {
1707
+    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z, feed_rate);
1708 1708
   }
1709 1709
 
1710 1710
   /**
@@ -1735,7 +1735,7 @@ static void clean_up_after_endstop_or_probe_move() {
1735 1735
 
1736 1736
 #endif //HAS_BED_PROBE
1737 1737
 
1738
-#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE
1738
+#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || HAS_PROBING_PROCEDURE
1739 1739
   static bool axis_unhomed_error(const bool x, const bool y, const bool z) {
1740 1740
     const bool xx = x && !axis_homed[X_AXIS],
1741 1741
                yy = y && !axis_homed[Y_AXIS],
@@ -1783,215 +1783,244 @@ static void clean_up_after_endstop_or_probe_move() {
1783 1783
       }
1784 1784
     #endif
1785 1785
 
1786
-    if (axis_unhomed_error(true, false, false)) return;
1787
-
1788
-    float oldXpos = current_position[X_AXIS]; // save x position
1789
-
1790 1786
     // Dock sled a bit closer to ensure proper capturing
1791 1787
     do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0));
1792 1788
     digitalWrite(SLED_PIN, !stow); // switch solenoid
1793 1789
 
1794
-    do_blocking_move_to_x(oldXpos); // return to position before docking
1795
-
1796 1790
   }
1797 1791
 
1798 1792
 #endif // Z_PROBE_SLED
1793
+#if ENABLED(Z_PROBE_ALLEN_KEY)
1794
+  void run_deploy_moves_script() {
1795
+    #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
1796
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X
1797
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS]
1798
+      #endif
1799
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y
1800
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS]
1801
+      #endif
1802
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
1803
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS]
1804
+      #endif
1805
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE
1806
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0
1807
+      #endif
1808
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z, Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE);
1809
+    #endif
1810
+    #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
1811
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X
1812
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS]
1813
+      #endif
1814
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y
1815
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS]
1816
+      #endif
1817
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
1818
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS]
1819
+      #endif
1820
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE
1821
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0
1822
+      #endif
1823
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z, Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE);
1824
+    #endif
1825
+    #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z)
1826
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
1827
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS]
1828
+      #endif
1829
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y
1830
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS]
1831
+      #endif
1832
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z
1833
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS]
1834
+      #endif
1835
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE
1836
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0
1837
+      #endif
1838
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z, Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE);
1839
+    #endif
1840
+    #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z)
1841
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X
1842
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS]
1843
+      #endif
1844
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y
1845
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS]
1846
+      #endif
1847
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z
1848
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS]
1849
+      #endif
1850
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE
1851
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0
1852
+      #endif
1853
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z, Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE);
1854
+    #endif
1855
+    #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z)
1856
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X
1857
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS]
1858
+      #endif
1859
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y
1860
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS]
1861
+      #endif
1862
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z
1863
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS]
1864
+      #endif
1865
+      #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE
1866
+        #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0
1867
+      #endif
1868
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z, Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE);
1869
+    #endif
1870
+  }
1871
+  void run_stow_moves_script() {
1872
+    #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z)
1873
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X
1874
+        #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS]
1875
+      #endif
1876
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y
1877
+        #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS]
1878
+      #endif
1879
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z
1880
+        #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS]
1881
+      #endif
1882
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE
1883
+        #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0
1884
+      #endif
1885
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z, Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE);
1886
+    #endif
1887
+    #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z)
1888
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X
1889
+        #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS]
1890
+      #endif
1891
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y
1892
+        #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS]
1893
+      #endif
1894
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z
1895
+        #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS]
1896
+      #endif
1897
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE
1898
+        #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0
1899
+      #endif
1900
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z, Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE);
1901
+    #endif
1902
+    #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z)
1903
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X
1904
+        #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS]
1905
+      #endif
1906
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y
1907
+        #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS]
1908
+      #endif
1909
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z
1910
+        #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS]
1911
+      #endif
1912
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE
1913
+        #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0
1914
+      #endif
1915
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z, Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE);
1916
+    #endif
1917
+    #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z)
1918
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X
1919
+        #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS]
1920
+      #endif
1921
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y
1922
+        #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS]
1923
+      #endif
1924
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z
1925
+        #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS]
1926
+      #endif
1927
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE
1928
+        #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0
1929
+      #endif
1930
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z, Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE);
1931
+    #endif
1932
+    #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z)
1933
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X
1934
+        #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS]
1935
+      #endif
1936
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y
1937
+        #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS]
1938
+      #endif
1939
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z
1940
+        #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS]
1941
+      #endif
1942
+      #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE
1943
+        #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0
1944
+      #endif
1945
+      do_blocking_move_to(Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z, Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE);
1946
+    #endif
1947
+  }
1948
+#endif
1799 1949
 
1800 1950
 #if HAS_BED_PROBE
1801 1951
 
1802
-  static void deploy_z_probe() {
1952
+ // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed.
1953
+  #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST)
1954
+    #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1955
+      #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING)
1956
+    #else
1957
+      #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)
1958
+    #endif
1959
+  #endif
1960
+
1961
+  #define DEPLOY_PROBE() set_probe_deployed( true )
1962
+  #define STOW_PROBE() set_probe_deployed( false )
1963
+
1964
+  // returns false for ok and true for failure
1965
+  static bool set_probe_deployed(bool deploy) {
1803 1966
 
1804 1967
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1805
-      if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position);
1968
+      if (DEBUGGING(LEVELING)) {
1969
+        DEBUG_POS("set_probe_deployed", current_position);
1970
+        SERIAL_ECHOPAIR("deploy: ", deploy);
1971
+      }
1806 1972
     #endif
1807 1973
 
1808
-    if (endstops.z_probe_enabled) return;
1974
+    if (endstops.z_probe_enabled == deploy) return false;
1809 1975
 
1810 1976
     // Make room for probe
1811 1977
     do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW);
1812 1978
 
1813 1979
     #if ENABLED(Z_PROBE_SLED)
1814
-
1815
-      dock_sled(false);
1816
-
1817
-    #elif HAS_Z_SERVO_ENDSTOP
1818
-
1819
-      // Engage Z Servo endstop if enabled
1820
-      DEPLOY_Z_SERVO();
1821
-
1980
+      if (axis_unhomed_error(true, false, false)) { stop(); return true; }
1822 1981
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
1823
-      float old_feedrate = feedrate;
1824
-
1825
-      feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
1826
-
1827
-      // If endstop is already false, the Z probe is deployed
1828
-      #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1829
-        bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
1830
-        if (z_probe_endstop)
1831
-      #else
1832
-        bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1833
-        if (z_min_endstop)
1834
-      #endif
1835
-        {
1836
-          // Move to the start position to initiate deployment
1837
-          destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
1838
-          destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
1839
-          destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
1840
-          prepare_move_to_destination(); // this will also set_current_to_destination
1841
-
1842
-          // Move to engage deployment
1843
-          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)
1844
-            feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
1845
-          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X)
1846
-            destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
1847
-          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y)
1848
-            destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
1849
-          if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
1850
-            destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
1851
-          prepare_move_to_destination();
1852
-
1853
-          #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
1854
-            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
1855
-              feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
1856
-
1857
-            // Move to trigger deployment
1858
-            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
1859
-              feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
1860
-            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X)
1861
-              destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
1862
-            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y)
1863
-              destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
1864
-            if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
1865
-              destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
1866
-
1867
-            prepare_move_to_destination();
1868
-          #endif
1869
-        }
1870
-
1871
-      // Partially Home X,Y for safety
1872
-      destination[X_AXIS] *= 0.75;
1873
-      destination[Y_AXIS] *= 0.75;
1874
-      prepare_move_to_destination(); // this will also set_current_to_destination
1875
-
1876
-      feedrate = old_feedrate;
1877
-
1878
-      stepper.synchronize();
1879
-
1880
-      #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1881
-        z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
1882
-        if (z_probe_endstop)
1883
-      #else
1884
-        z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1885
-        if (z_min_endstop)
1886
-      #endif
1887
-        {
1888
-          if (IsRunning()) {
1889
-            SERIAL_ERROR_START;
1890
-            SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
1891
-            LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1892
-          }
1893
-          stop();
1894
-        }
1895
-
1896
-    #else
1897
-
1898
-      // Nothing to be done. Just enable_z_probe below...
1899
-
1982
+      if (axis_unhomed_error(true, true,  true )) { stop(); return true; }
1900 1983
     #endif
1901 1984
 
1902
-    endstops.enable_z_probe();
1903
-  }
1985
+    float oldXpos = current_position[X_AXIS]; // save x position
1986
+    float oldYpos = current_position[Y_AXIS]; // save y position
1904 1987
 
1905
-  static void stow_z_probe() {
1906
-    #if ENABLED(DEBUG_LEVELING_FEATURE)
1907
-      if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position);
1988
+    #ifdef _TRIGGERED_WHEN_STOWED_TEST
1989
+      // If endstop is already false, the Z probe is deployed
1990
+      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions.
1991
+                                                   // Would a goto be less ugly?
1992
+      //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity
1993
+      // for a triggered when stowed manual probe.
1908 1994
     #endif
1909 1995
 
1910
-    if (!endstops.z_probe_enabled) return;
1911
-
1912
-    // Make more room for the servo
1913
-    do_probe_raise(_Z_RAISE_PROBE_DEPLOY_STOW);
1914
-
1915 1996
     #if ENABLED(Z_PROBE_SLED)
1916
-
1917
-      dock_sled(true);
1918
-
1997
+      dock_sled(!deploy);
1919 1998
     #elif HAS_Z_SERVO_ENDSTOP
1920
-
1921
-      // Change the Z servo angle
1922
-      STOW_Z_SERVO();
1923
-
1999
+      servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]);
1924 2000
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
2001
+      if (!deploy) run_stow_moves_script();
2002
+      else run_deploy_moves_script();
2003
+     #else
2004
+      // Nothing to be done. Just enable_z_probe below...
2005
+    #endif
1925 2006
 
1926
-      float old_feedrate = feedrate;
1927
-
1928
-      // Move up for safety
1929
-      feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1930
-
1931
-      #if _Z_RAISE_PROBE_DEPLOY_STOW > 0
1932
-        destination[Z_AXIS] = current_position[Z_AXIS] + _Z_RAISE_PROBE_DEPLOY_STOW;
1933
-        prepare_move_to_destination_raw(); // this will also set_current_to_destination
1934
-      #endif
1935
-
1936
-      // Move to the start position to initiate retraction
1937
-      destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
1938
-      destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
1939
-      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
1940
-      prepare_move_to_destination();
1941
-
1942
-      // Move the nozzle down to push the Z probe into retracted position
1943
-      if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
1944
-        feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
1945
-      if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
1946
-        destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
1947
-      if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
1948
-        destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
1949
-      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
1950
-      prepare_move_to_destination();
1951
-
1952
-      // Move up for safety
1953
-      if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)
1954
-        feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
1955
-      if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X)
1956
-        destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
1957
-      if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y)
1958
-        destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
1959
-      destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
1960
-      prepare_move_to_destination();
1961
-
1962
-      // Home XY for safety
1963
-      feedrate = homing_feedrate[X_AXIS] / 2;
1964
-      destination[X_AXIS] = 0;
1965
-      destination[Y_AXIS] = 0;
1966
-      prepare_move_to_destination(); // this will also set_current_to_destination
1967
-
1968
-      feedrate = old_feedrate;
1969
-
1970
-      stepper.synchronize();
2007
+    #ifdef _TRIGGERED_WHEN_STOWED_TEST
2008
+      }; // opened before the probe specific actions
1971 2009
 
1972
-      #if ENABLED(Z_MIN_PROBE_ENDSTOP)
1973
-        bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
1974
-        if (!z_probe_endstop)
1975
-      #else
1976
-        bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
1977
-        if (!z_min_endstop)
1978
-      #endif
1979
-        {
1980
-          if (IsRunning()) {
1981
-            SERIAL_ERROR_START;
1982
-            SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
1983
-            LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1984
-          }
1985
-          stop();
2010
+      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {
2011
+        if (IsRunning()) {
2012
+          SERIAL_ERROR_START;
2013
+          SERIAL_ERRORLNPGM("Z-Probe failed");
2014
+          LCD_ALERTMESSAGEPGM("Err: ZPROBE");
1986 2015
         }
1987
-
1988
-    #else
1989
-
1990
-      // Nothing to do here. Just clear endstops.z_probe_enabled
1991
-
2016
+        stop();
2017
+        return true;
2018
+      }
1992 2019
     #endif
1993 2020
 
1994
-    endstops.enable_z_probe(false);
2021
+    do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy
2022
+    endstops.enable_z_probe( deploy );
2023
+    return false;
1995 2024
   }
1996 2025
 
1997 2026
   // Do a single Z probe and return with current_position[Z_AXIS]
@@ -2081,8 +2110,8 @@ static void clean_up_after_endstop_or_probe_move() {
2081 2110
     return current_position[Z_AXIS];
2082 2111
   }
2083 2112
 
2084
-  inline void do_blocking_move_to_xy(float x, float y) {
2085
-    do_blocking_move_to(x, y, current_position[Z_AXIS]);
2113
+  inline void do_blocking_move_to_xy(float x, float y, float feed_rate = 0.0) {
2114
+    do_blocking_move_to(x, y, current_position[Z_AXIS], feed_rate);
2086 2115
   }
2087 2116
 
2088 2117
   //
@@ -2124,7 +2153,7 @@ static void clean_up_after_endstop_or_probe_move() {
2124 2153
     #if ENABLED(DEBUG_LEVELING_FEATURE)
2125 2154
       if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2126 2155
     #endif
2127
-    deploy_z_probe();
2156
+    if (DEPLOY_PROBE()) return NAN;
2128 2157
 
2129 2158
     float measured_z = run_z_probe();
2130 2159
 
@@ -2132,7 +2161,7 @@ static void clean_up_after_endstop_or_probe_move() {
2132 2161
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2133 2162
         if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2134 2163
       #endif
2135
-      stow_z_probe();
2164
+      if (STOW_PROBE()) return NAN;
2136 2165
     }
2137 2166
     else {
2138 2167
       #if ENABLED(DEBUG_LEVELING_FEATURE)
@@ -2340,7 +2369,7 @@ static void homeaxis(AxisEnum axis) {
2340 2369
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2341 2370
           if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2342 2371
         #endif
2343
-        deploy_z_probe();
2372
+        if (DEPLOY_PROBE()) return;
2344 2373
       }
2345 2374
     #endif
2346 2375
 
@@ -2467,7 +2496,7 @@ static void homeaxis(AxisEnum axis) {
2467 2496
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2468 2497
           if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> ");
2469 2498
         #endif
2470
-        stow_z_probe();
2499
+        if (STOW_PROBE()) return;
2471 2500
       }
2472 2501
     #endif
2473 2502
 
@@ -3381,12 +3410,7 @@ inline void gcode_G28() {
3381 3410
     }
3382 3411
 
3383 3412
     bool dryrun = code_seen('D');
3384
-
3385
-    #if ENABLED(Z_PROBE_ALLEN_KEY)
3386
-      const bool stow_probe_after_each = false;
3387
-    #else
3388
-      bool stow_probe_after_each = code_seen('E');
3389
-    #endif
3413
+    bool stow_probe_after_each = code_seen('E');
3390 3414
 
3391 3415
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3392 3416
 
@@ -3485,8 +3509,8 @@ inline void gcode_G28() {
3485 3509
 
3486 3510
     setup_for_endstop_or_probe_move();
3487 3511
 
3488
-    // Deploy the probe. Servo will raise if needed.
3489
-    deploy_z_probe();
3512
+    // Deploy the probe. Probe will raise if needed.
3513
+    if (DEPLOY_PROBE()) return;
3490 3514
 
3491 3515
     bed_leveling_in_progress = true;
3492 3516
 
@@ -3591,7 +3615,7 @@ inline void gcode_G28() {
3591 3615
     #endif // !AUTO_BED_LEVELING_GRID
3592 3616
 
3593 3617
     // Raise to _Z_RAISE_PROBE_DEPLOY_STOW. Stow the probe.
3594
-    stow_z_probe();
3618
+    if (STOW_PROBE()) return;
3595 3619
 
3596 3620
     // Restore state after probing
3597 3621
     clean_up_after_endstop_or_probe_move();
@@ -3798,12 +3822,12 @@ inline void gcode_G28() {
3798 3822
     /**
3799 3823
      * G31: Deploy the Z probe
3800 3824
      */
3801
-    inline void gcode_G31() { deploy_z_probe(); }
3825
+    inline void gcode_G31() { DEPLOY_PROBE(); }
3802 3826
 
3803 3827
     /**
3804 3828
      * G32: Stow the Z probe
3805 3829
      */
3806
-    inline void gcode_G32() { stow_z_probe(); }
3830
+    inline void gcode_G32() { STOW_PROBE(); }
3807 3831
 
3808 3832
   #endif // Z_PROBE_SLED
3809 3833
 
@@ -4144,11 +4168,7 @@ inline void gcode_M42() {
4144 4168
     float  X_current = current_position[X_AXIS],
4145 4169
            Y_current = current_position[Y_AXIS];
4146 4170
 
4147
-    #if ENABLED(Z_PROBE_ALLEN_KEY)
4148
-      const bool stow_probe_after_each = false;
4149
-    #else
4150
-      bool stow_probe_after_each = code_seen('E');
4151
-    #endif
4171
+    bool stow_probe_after_each = code_seen('E');
4152 4172
 
4153 4173
     float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
4154 4174
     #if DISABLED(DELTA)
@@ -4315,7 +4335,7 @@ inline void gcode_M42() {
4315 4335
 
4316 4336
     } // End of probe loop
4317 4337
 
4318
-    stow_z_probe();
4338
+    if (STOW_PROBE()) return;
4319 4339
 
4320 4340
     if (verbose_level > 0) {
4321 4341
       SERIAL_PROTOCOLPGM("Mean: ");
@@ -5891,12 +5911,12 @@ inline void gcode_M400() { stepper.synchronize(); }
5891 5911
   /**
5892 5912
    * M401: Engage Z Servo endstop if available
5893 5913
    */
5894
-  inline void gcode_M401() { deploy_z_probe(); }
5914
+  inline void gcode_M401() { DEPLOY_PROBE(); }
5895 5915
 
5896 5916
   /**
5897 5917
    * M402: Retract Z Servo endstop if enabled
5898 5918
    */
5899
-  inline void gcode_M402() { stow_z_probe(); }
5919
+  inline void gcode_M402() { STOW_PROBE(); }
5900 5920
 
5901 5921
 #endif // HAS_BED_PROBE
5902 5922
 

+ 4
- 7
Marlin/SanityCheck.h View File

@@ -425,14 +425,11 @@
425 425
 #endif
426 426
 
427 427
 /**
428
- * Allen Key Z probe requires Delta and Auto Bed Leveling grid
428
+ * Allen Key
429
+ * Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
429 430
  */
430
-#if ENABLED(Z_PROBE_ALLEN_KEY)
431
-  #if !ENABLED(DELTA)
432
-    #error "Z_PROBE_ALLEN_KEY is only usable with DELTA."
433
-  #elif ENABLED(MESH_BED_LEVELING) || (ENABLED(AUTO_BED_LEVELING_FEATURE) && !ENABLED(AUTO_BED_LEVELING_GRID))
434
-    #error "Z_PROBE_ALLEN_KEY can only use AUTO_BED_LEVELING_GRID leveling."
435
-  #endif
431
+#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
432
+  #error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
436 433
 #endif
437 434
 
438 435
 /**

+ 10
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
518 518
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
519 519
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED
520 520
 
521
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
522
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
523
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
524
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
525
+
521 526
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
522 527
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
523 528
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z 100.0
@@ -538,6 +543,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
538 543
   #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
539 544
   #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
540 545
 
546
+  #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
547
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
548
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
549
+  #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
550
+
541 551
 #endif // Z_PROBE_ALLEN_KEY
542 552
 
543 553
 // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.

+ 10
- 0
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -517,6 +517,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
517 517
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
518 518
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10
519 519
 
520
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
521
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
522
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
523
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
524
+
520 525
   #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
521 526
   #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
522 527
   #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
@@ -532,6 +537,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
532 537
   #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
533 538
   #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
534 539
 
540
+  #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
541
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
542
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
543
+  #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
544
+
535 545
 #endif // Z_PROBE_ALLEN_KEY
536 546
 
537 547
 // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.

+ 10
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -518,6 +518,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
518 518
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
519 519
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10)
520 520
 
521
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
522
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
523
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
524
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
525
+
521 526
   #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
522 527
   // Move the probe into position
523 528
   #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0
@@ -535,6 +540,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
535 540
   #define Z_PROBE_ALLEN_KEY_STOW_3_Z  (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH)
536 541
   #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2)
537 542
 
543
+  #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
544
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
545
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
546
+  #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
547
+
538 548
 #endif // Z_PROBE_ALLEN_KEY
539 549
 
540 550
 // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.

+ 10
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -509,6 +509,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
509 509
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z
510 510
   #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED
511 511
 
512
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
513
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
514
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
515
+  #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
516
+
512 517
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X 45.00 // Move right to trigger deploy pin
513 518
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y -125.00
514 519
   #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
@@ -529,6 +534,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
529 534
   #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0
530 535
   #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
531 536
 
537
+  #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
538
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
539
+  #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
540
+  #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
541
+
532 542
 #endif // Z_PROBE_ALLEN_KEY
533 543
 
534 544
 // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.

+ 10
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -515,6 +515,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
515 515
   //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0
516 516
   //#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10
517 517
 
518
+  //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75
519
+  //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75
520
+  //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z
521
+  //#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED
522
+
518 523
   //#define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position
519 524
   //#define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0
520 525
   //#define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0
@@ -530,6 +535,11 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
530 535
   //#define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0
531 536
   //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED
532 537
 
538
+  //#define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0
539
+  //#define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0
540
+  //#define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z
541
+  //#define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED
542
+
533 543
 #endif // Z_PROBE_ALLEN_KEY
534 544
 
535 545
 // Enable Z_MIN_PROBE_ENDSTOP to use _both_ a Z Probe and a Z-min-endstop on the same machine.

Loading…
Cancel
Save