|
@@ -1684,6 +1684,197 @@ static void setup_for_endstop_move() {
|
1684
|
1684
|
|
1685
|
1685
|
#endif
|
1686
|
1686
|
|
|
1687
|
+#if HAS_BED_PROBE
|
|
1688
|
+
|
|
1689
|
+ static void deploy_z_probe() {
|
|
1690
|
+
|
|
1691
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
1692
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position);
|
|
1693
|
+ #endif
|
|
1694
|
+
|
|
1695
|
+ if (endstops.z_probe_enabled) return;
|
|
1696
|
+
|
|
1697
|
+ #if HAS_Z_SERVO_ENDSTOP
|
|
1698
|
+
|
|
1699
|
+ // Make room for Z Servo
|
|
1700
|
+ raise_z_for_servo(Z_RAISE_BEFORE_PROBING);
|
|
1701
|
+
|
|
1702
|
+ // Engage Z Servo endstop if enabled
|
|
1703
|
+ DEPLOY_Z_SERVO();
|
|
1704
|
+
|
|
1705
|
+ #elif ENABLED(Z_PROBE_ALLEN_KEY)
|
|
1706
|
+ float old_feedrate = feedrate;
|
|
1707
|
+
|
|
1708
|
+ feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
|
|
1709
|
+
|
|
1710
|
+ // If endstop is already false, the Z probe is deployed
|
|
1711
|
+ #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
1712
|
+ bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
|
1713
|
+ if (z_probe_endstop)
|
|
1714
|
+ #else
|
|
1715
|
+ bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
|
1716
|
+ if (z_min_endstop)
|
|
1717
|
+ #endif
|
|
1718
|
+ {
|
|
1719
|
+ // Move to the start position to initiate deployment
|
|
1720
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
|
|
1721
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
|
|
1722
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
|
|
1723
|
+ prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
1724
|
+
|
|
1725
|
+ // Move to engage deployment
|
|
1726
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)
|
|
1727
|
+ feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
|
|
1728
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X)
|
|
1729
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
|
|
1730
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y)
|
|
1731
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
|
|
1732
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
|
|
1733
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
|
|
1734
|
+ prepare_move_to_destination_raw();
|
|
1735
|
+
|
|
1736
|
+ #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
|
|
1737
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
|
|
1738
|
+ feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
|
|
1739
|
+
|
|
1740
|
+ // Move to trigger deployment
|
|
1741
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
|
|
1742
|
+ feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
|
|
1743
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X)
|
|
1744
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
|
|
1745
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y)
|
|
1746
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
|
|
1747
|
+ if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
|
|
1748
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
|
|
1749
|
+
|
|
1750
|
+ prepare_move_to_destination_raw();
|
|
1751
|
+ #endif
|
|
1752
|
+ }
|
|
1753
|
+
|
|
1754
|
+ // Partially Home X,Y for safety
|
|
1755
|
+ destination[X_AXIS] *= 0.75;
|
|
1756
|
+ destination[Y_AXIS] *= 0.75;
|
|
1757
|
+ prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
1758
|
+
|
|
1759
|
+ feedrate = old_feedrate;
|
|
1760
|
+
|
|
1761
|
+ stepper.synchronize();
|
|
1762
|
+
|
|
1763
|
+ #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
1764
|
+ z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
|
1765
|
+ if (z_probe_endstop)
|
|
1766
|
+ #else
|
|
1767
|
+ z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
|
1768
|
+ if (z_min_endstop)
|
|
1769
|
+ #endif
|
|
1770
|
+ {
|
|
1771
|
+ if (IsRunning()) {
|
|
1772
|
+ SERIAL_ERROR_START;
|
|
1773
|
+ SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
|
|
1774
|
+ LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1775
|
+ }
|
|
1776
|
+ stop();
|
|
1777
|
+ }
|
|
1778
|
+
|
|
1779
|
+ #elif ENABLED(FIX_MOUNTED_PROBE)
|
|
1780
|
+
|
|
1781
|
+ // Nothing to be done. Just enable_z_probe below...
|
|
1782
|
+
|
|
1783
|
+ #endif
|
|
1784
|
+
|
|
1785
|
+ endstops.enable_z_probe();
|
|
1786
|
+ }
|
|
1787
|
+
|
|
1788
|
+ static void stow_z_probe() {
|
|
1789
|
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
1790
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position);
|
|
1791
|
+ #endif
|
|
1792
|
+
|
|
1793
|
+ if (!endstops.z_probe_enabled) return;
|
|
1794
|
+
|
|
1795
|
+ #if HAS_Z_SERVO_ENDSTOP
|
|
1796
|
+
|
|
1797
|
+ // Make room for the servo
|
|
1798
|
+ raise_z_for_servo(Z_RAISE_AFTER_PROBING);
|
|
1799
|
+
|
|
1800
|
+ // Change the Z servo angle
|
|
1801
|
+ STOW_Z_SERVO();
|
|
1802
|
+
|
|
1803
|
+ #elif ENABLED(Z_PROBE_ALLEN_KEY)
|
|
1804
|
+
|
|
1805
|
+ float old_feedrate = feedrate;
|
|
1806
|
+
|
|
1807
|
+ // Move up for safety
|
|
1808
|
+ feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
|
|
1809
|
+
|
|
1810
|
+ #if Z_RAISE_AFTER_PROBING > 0
|
|
1811
|
+ destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
|
|
1812
|
+ prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
1813
|
+ #endif
|
|
1814
|
+
|
|
1815
|
+ // Move to the start position to initiate retraction
|
|
1816
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
|
|
1817
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
|
|
1818
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
|
|
1819
|
+ prepare_move_to_destination_raw();
|
|
1820
|
+
|
|
1821
|
+ // Move the nozzle down to push the Z probe into retracted position
|
|
1822
|
+ if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
|
|
1823
|
+ feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
|
|
1824
|
+ if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
|
|
1825
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
|
|
1826
|
+ if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
|
|
1827
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
|
|
1828
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
|
|
1829
|
+ prepare_move_to_destination_raw();
|
|
1830
|
+
|
|
1831
|
+ // Move up for safety
|
|
1832
|
+ if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)
|
|
1833
|
+ feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
|
|
1834
|
+ if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X)
|
|
1835
|
+ destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
|
|
1836
|
+ if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y)
|
|
1837
|
+ destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
|
|
1838
|
+ destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
|
|
1839
|
+ prepare_move_to_destination_raw();
|
|
1840
|
+
|
|
1841
|
+ // Home XY for safety
|
|
1842
|
+ feedrate = homing_feedrate[X_AXIS] / 2;
|
|
1843
|
+ destination[X_AXIS] = 0;
|
|
1844
|
+ destination[Y_AXIS] = 0;
|
|
1845
|
+ prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
|
1846
|
+
|
|
1847
|
+ feedrate = old_feedrate;
|
|
1848
|
+
|
|
1849
|
+ stepper.synchronize();
|
|
1850
|
+
|
|
1851
|
+ #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
1852
|
+ bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
|
1853
|
+ if (!z_probe_endstop)
|
|
1854
|
+ #else
|
|
1855
|
+ bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
|
1856
|
+ if (!z_min_endstop)
|
|
1857
|
+ #endif
|
|
1858
|
+ {
|
|
1859
|
+ if (IsRunning()) {
|
|
1860
|
+ SERIAL_ERROR_START;
|
|
1861
|
+ SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
|
|
1862
|
+ LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
|
1863
|
+ }
|
|
1864
|
+ stop();
|
|
1865
|
+ }
|
|
1866
|
+
|
|
1867
|
+ #elif ENABLED(FIX_MOUNTED_PROBE)
|
|
1868
|
+
|
|
1869
|
+ // Nothing to do here. Just clear endstops.z_probe_enabled
|
|
1870
|
+
|
|
1871
|
+ #endif
|
|
1872
|
+
|
|
1873
|
+ endstops.enable_z_probe(false);
|
|
1874
|
+ }
|
|
1875
|
+
|
|
1876
|
+#endif // HAS_BED_PROBE
|
|
1877
|
+
|
1687
|
1878
|
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
1688
|
1879
|
|
1689
|
1880
|
#if ENABLED(AUTO_BED_LEVELING_GRID)
|
|
@@ -1872,194 +2063,6 @@ static void setup_for_endstop_move() {
|
1872
|
2063
|
refresh_cmd_timeout();
|
1873
|
2064
|
}
|
1874
|
2065
|
|
1875
|
|
- #if HAS_BED_PROBE
|
1876
|
|
-
|
1877
|
|
- static void deploy_z_probe() {
|
1878
|
|
-
|
1879
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
1880
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("deploy_z_probe", current_position);
|
1881
|
|
- #endif
|
1882
|
|
-
|
1883
|
|
- if (endstops.z_probe_enabled) return;
|
1884
|
|
-
|
1885
|
|
- #if HAS_Z_SERVO_ENDSTOP
|
1886
|
|
-
|
1887
|
|
- // Make room for Z Servo
|
1888
|
|
- raise_z_for_servo(Z_RAISE_BEFORE_PROBING);
|
1889
|
|
-
|
1890
|
|
- // Engage Z Servo endstop if enabled
|
1891
|
|
- DEPLOY_Z_SERVO();
|
1892
|
|
-
|
1893
|
|
- #elif ENABLED(Z_PROBE_ALLEN_KEY)
|
1894
|
|
- float old_feedrate = feedrate;
|
1895
|
|
-
|
1896
|
|
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
|
1897
|
|
-
|
1898
|
|
- // If endstop is already false, the Z probe is deployed
|
1899
|
|
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
1900
|
|
- bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
1901
|
|
- if (z_probe_endstop)
|
1902
|
|
- #else
|
1903
|
|
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
1904
|
|
- if (z_min_endstop)
|
1905
|
|
- #endif
|
1906
|
|
- {
|
1907
|
|
- // Move to the start position to initiate deployment
|
1908
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_X;
|
1909
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Y;
|
1910
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_1_Z;
|
1911
|
|
- prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
1912
|
|
-
|
1913
|
|
- // Move to engage deployment
|
1914
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)
|
1915
|
|
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE;
|
1916
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_X != Z_PROBE_ALLEN_KEY_DEPLOY_1_X)
|
1917
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_X;
|
1918
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Y != Z_PROBE_ALLEN_KEY_DEPLOY_1_Y)
|
1919
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Y;
|
1920
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_2_Z != Z_PROBE_ALLEN_KEY_DEPLOY_1_Z)
|
1921
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_2_Z;
|
1922
|
|
- prepare_move_to_destination_raw();
|
1923
|
|
-
|
1924
|
|
- #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3_X
|
1925
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
|
1926
|
|
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
|
1927
|
|
-
|
1928
|
|
- // Move to trigger deployment
|
1929
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE != Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)
|
1930
|
|
- feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE;
|
1931
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_X != Z_PROBE_ALLEN_KEY_DEPLOY_2_X)
|
1932
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_X;
|
1933
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Y != Z_PROBE_ALLEN_KEY_DEPLOY_2_Y)
|
1934
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Y;
|
1935
|
|
- if (Z_PROBE_ALLEN_KEY_DEPLOY_3_Z != Z_PROBE_ALLEN_KEY_DEPLOY_2_Z)
|
1936
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_DEPLOY_3_Z;
|
1937
|
|
-
|
1938
|
|
- prepare_move_to_destination_raw();
|
1939
|
|
- #endif
|
1940
|
|
- }
|
1941
|
|
-
|
1942
|
|
- // Partially Home X,Y for safety
|
1943
|
|
- destination[X_AXIS] *= 0.75;
|
1944
|
|
- destination[Y_AXIS] *= 0.75;
|
1945
|
|
- prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
1946
|
|
-
|
1947
|
|
- feedrate = old_feedrate;
|
1948
|
|
-
|
1949
|
|
- stepper.synchronize();
|
1950
|
|
-
|
1951
|
|
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
1952
|
|
- z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
1953
|
|
- if (z_probe_endstop)
|
1954
|
|
- #else
|
1955
|
|
- z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
1956
|
|
- if (z_min_endstop)
|
1957
|
|
- #endif
|
1958
|
|
- {
|
1959
|
|
- if (IsRunning()) {
|
1960
|
|
- SERIAL_ERROR_START;
|
1961
|
|
- SERIAL_ERRORLNPGM("Z-Probe failed to engage!");
|
1962
|
|
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
1963
|
|
- }
|
1964
|
|
- stop();
|
1965
|
|
- }
|
1966
|
|
-
|
1967
|
|
- #endif // Z_PROBE_ALLEN_KEY
|
1968
|
|
-
|
1969
|
|
- #if ENABLED(FIX_MOUNTED_PROBE)
|
1970
|
|
- // Nothing to be done. Just enable_z_probe below...
|
1971
|
|
- #endif
|
1972
|
|
-
|
1973
|
|
- endstops.enable_z_probe();
|
1974
|
|
-
|
1975
|
|
- }
|
1976
|
|
-
|
1977
|
|
- static void stow_z_probe() {
|
1978
|
|
- #if ENABLED(DEBUG_LEVELING_FEATURE)
|
1979
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("stow_z_probe", current_position);
|
1980
|
|
- #endif
|
1981
|
|
-
|
1982
|
|
- if (!endstops.z_probe_enabled) return;
|
1983
|
|
-
|
1984
|
|
- #if HAS_Z_SERVO_ENDSTOP
|
1985
|
|
-
|
1986
|
|
- // Make room for the servo
|
1987
|
|
- raise_z_for_servo(Z_RAISE_AFTER_PROBING);
|
1988
|
|
-
|
1989
|
|
- // Change the Z servo angle
|
1990
|
|
- STOW_Z_SERVO();
|
1991
|
|
-
|
1992
|
|
- #elif ENABLED(Z_PROBE_ALLEN_KEY)
|
1993
|
|
-
|
1994
|
|
- float old_feedrate = feedrate;
|
1995
|
|
-
|
1996
|
|
- // Move up for safety
|
1997
|
|
- feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
|
1998
|
|
-
|
1999
|
|
- #if Z_RAISE_AFTER_PROBING > 0
|
2000
|
|
- destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
|
2001
|
|
- prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
2002
|
|
- #endif
|
2003
|
|
-
|
2004
|
|
- // Move to the start position to initiate retraction
|
2005
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
|
2006
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Y;
|
2007
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_Z;
|
2008
|
|
- prepare_move_to_destination_raw();
|
2009
|
|
-
|
2010
|
|
- // Move the nozzle down to push the Z probe into retracted position
|
2011
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)
|
2012
|
|
- feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
|
2013
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_2_X != Z_PROBE_ALLEN_KEY_STOW_1_X)
|
2014
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_X;
|
2015
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_2_Y != Z_PROBE_ALLEN_KEY_STOW_1_Y)
|
2016
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Y;
|
2017
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_2_Z;
|
2018
|
|
- prepare_move_to_destination_raw();
|
2019
|
|
-
|
2020
|
|
- // Move up for safety
|
2021
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE != Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)
|
2022
|
|
- feedrate = Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE;
|
2023
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_3_X != Z_PROBE_ALLEN_KEY_STOW_2_X)
|
2024
|
|
- destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_X;
|
2025
|
|
- if (Z_PROBE_ALLEN_KEY_STOW_3_Y != Z_PROBE_ALLEN_KEY_STOW_2_Y)
|
2026
|
|
- destination[Y_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Y;
|
2027
|
|
- destination[Z_AXIS] = Z_PROBE_ALLEN_KEY_STOW_3_Z;
|
2028
|
|
- prepare_move_to_destination_raw();
|
2029
|
|
-
|
2030
|
|
- // Home XY for safety
|
2031
|
|
- feedrate = homing_feedrate[X_AXIS] / 2;
|
2032
|
|
- destination[X_AXIS] = 0;
|
2033
|
|
- destination[Y_AXIS] = 0;
|
2034
|
|
- prepare_move_to_destination_raw(); // this will also set_current_to_destination
|
2035
|
|
-
|
2036
|
|
- feedrate = old_feedrate;
|
2037
|
|
-
|
2038
|
|
- stepper.synchronize();
|
2039
|
|
-
|
2040
|
|
- #if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
2041
|
|
- bool z_probe_endstop = (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
|
2042
|
|
- if (!z_probe_endstop)
|
2043
|
|
- #else
|
2044
|
|
- bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
|
2045
|
|
- if (!z_min_endstop)
|
2046
|
|
- #endif
|
2047
|
|
- {
|
2048
|
|
- if (IsRunning()) {
|
2049
|
|
- SERIAL_ERROR_START;
|
2050
|
|
- SERIAL_ERRORLNPGM("Z-Probe failed to retract!");
|
2051
|
|
- LCD_ALERTMESSAGEPGM("Err: ZPROBE");
|
2052
|
|
- }
|
2053
|
|
- stop();
|
2054
|
|
- }
|
2055
|
|
- #elif ENABLED(FIX_MOUNTED_PROBE)
|
2056
|
|
- // Nothing to do here. Just clear endstops.z_probe_enabled
|
2057
|
|
- #endif
|
2058
|
|
-
|
2059
|
|
- endstops.enable_z_probe(false);
|
2060
|
|
- }
|
2061
|
|
- #endif // HAS_BED_PROBE
|
2062
|
|
-
|
2063
|
2066
|
enum ProbeAction {
|
2064
|
2067
|
ProbeStay = 0,
|
2065
|
2068
|
ProbeDeploy = _BV(0),
|
|
@@ -2306,7 +2309,7 @@ static void homeaxis(AxisEnum axis) {
|
2306
|
2309
|
#if ENABLED(Z_PROBE_SLED)
|
2307
|
2310
|
#define _Z_DEPLOY (dock_sled(false))
|
2308
|
2311
|
#define _Z_STOW (dock_sled(true))
|
2309
|
|
- #elif ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(FIX_MOUNTED_PROBE))
|
|
2312
|
+ #elif (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) || ENABLED(FIX_MOUNTED_PROBE)
|
2310
|
2313
|
#define _Z_DEPLOY (deploy_z_probe())
|
2311
|
2314
|
#define _Z_STOW (stow_z_probe())
|
2312
|
2315
|
#elif HAS_Z_SERVO_ENDSTOP
|