Procházet zdrojové kódy

Add USE_PROBE_FOR_Z_HOMING option (#17359)

djessup před 5 roky
rodič
revize
360e07c90f
No account linked to committer's email address

+ 6
- 4
Marlin/Configuration.h Zobrazit soubor

824
 //
824
 //
825
 
825
 
826
 /**
826
 /**
827
- * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
828
- *
829
- * Enable this option for a probe connected to the Z Min endstop pin.
827
+ * Enable this option for a probe connected to the Z-MIN pin.
828
+ * The probe replaces the Z-MIN endstop and is used for Z homing.
829
+ * (Automatically enables USE_PROBE_FOR_Z_HOMING.)
830
  */
830
  */
831
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
831
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
832
 
832
 
833
+// Force the use of the probe for Z-axis homing
834
+//#define USE_PROBE_FOR_Z_HOMING
835
+
833
 /**
836
 /**
834
  * Z_MIN_PROBE_PIN
837
  * Z_MIN_PROBE_PIN
835
  *
838
  *
1335
  */
1338
  */
1336
 //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
1339
 //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
1337
 
1340
 
1338
-
1339
 // @section homing
1341
 // @section homing
1340
 
1342
 
1341
 // The center of the bed is at (X=0, Y=0)
1343
 // The center of the bed is at (X=0, Y=0)

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Zobrazit soubor

583
   #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
583
   #if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
584
     #define HAS_CUSTOM_PROBE_PIN 1
584
     #define HAS_CUSTOM_PROBE_PIN 1
585
   #endif
585
   #endif
586
-  #if Z_HOME_DIR < 0 && !HAS_CUSTOM_PROBE_PIN
586
+  #if Z_HOME_DIR < 0 && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
587
     #define HOMING_Z_WITH_PROBE 1
587
     #define HOMING_Z_WITH_PROBE 1
588
   #endif
588
   #endif
589
   #ifndef Z_PROBE_LOW_POINT
589
   #ifndef Z_PROBE_LOW_POINT

+ 9
- 3
Marlin/src/inc/SanityCheck.h Zobrazit soubor

1815
  * Endstop Tests
1815
  * Endstop Tests
1816
  */
1816
  */
1817
 
1817
 
1818
-#define _PLUG_UNUSED_TEST(AXIS,PLUG) (DISABLED(USE_##PLUG##MIN_PLUG, USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_)))
1819
-#define _AXIS_PLUG_UNUSED_TEST(AXIS) (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
1818
+#define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
1819
+  && !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
1820
+  && !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
1821
+#define _AXIS_PLUG_UNUSED_TEST(A) (_PLUG_UNUSED_TEST(A,X) && _PLUG_UNUSED_TEST(A,Y) && _PLUG_UNUSED_TEST(A,Z))
1820
 
1822
 
1821
 // At least 3 endstop plugs must be used
1823
 // At least 3 endstop plugs must be used
1822
 #if _AXIS_PLUG_UNUSED_TEST(X)
1824
 #if _AXIS_PLUG_UNUSED_TEST(X)
1841
     #error "Enable USE_YMAX_PLUG when homing Y to MAX."
1843
     #error "Enable USE_YMAX_PLUG when homing Y to MAX."
1842
   #endif
1844
   #endif
1843
 #endif
1845
 #endif
1844
-#if Z_HOME_DIR < 0 && DISABLED(USE_ZMIN_PLUG)
1846
+
1847
+// Z homing direction and plug usage flags
1848
+#if Z_HOME_DIR < 0 && NONE(USE_ZMIN_PLUG, HOMING_Z_WITH_PROBE)
1845
   #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
1849
   #error "Enable USE_ZMIN_PLUG when homing Z to MIN."
1850
+#elif Z_HOME_DIR > 0 && ENABLED(USE_PROBE_FOR_Z_HOMING)
1851
+  #error "Z_HOME_DIR must be -1 when homing Z with the probe."
1846
 #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
1852
 #elif Z_HOME_DIR > 0 && DISABLED(USE_ZMAX_PLUG)
1847
   #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
1853
   #error "Enable USE_ZMAX_PLUG when homing Z to MAX."
1848
 #endif
1854
 #endif

Loading…
Zrušit
Uložit