From 8953e3e9840a852b29e2ef5010b59093c627938c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 27 Jul 2016 04:30:39 -0700 Subject: [PATCH] Allow Z_SAFE_HOMING without a probe --- Marlin/Conditionals_post.h | 16 +++++++--------- Marlin/Configuration.h | 2 +- Marlin/Marlin_main.cpp | 5 ++--- Marlin/SanityCheck.cpp | 14 ++++++++++---- .../Cartesio/Configuration.h | 2 +- .../example_configurations/Felix/Configuration.h | 2 +- .../Felix/DUAL/Configuration.h | 2 +- .../Hephestos/Configuration.h | 2 +- .../Hephestos_2/Configuration.h | 2 +- .../example_configurations/K8200/Configuration.h | 2 +- .../example_configurations/K8400/Configuration.h | 2 +- .../K8400/Dual-head/Configuration.h | 2 +- .../RepRapWorld/Megatronics/Configuration.h | 2 +- .../RigidBot/Configuration.h | 2 +- .../example_configurations/SCARA/Configuration.h | 2 +- .../example_configurations/TAZ4/Configuration.h | 2 +- .../WITBOX/Configuration.h | 2 +- .../adafruit/ST7565/Configuration.h | 2 +- .../delta/biv2.5/Configuration.h | 2 +- .../delta/generic/Configuration.h | 2 +- .../delta/kossel_mini/Configuration.h | 2 +- .../delta/kossel_pro/Configuration.h | 2 +- .../delta/kossel_xl/Configuration.h | 2 +- .../makibox/Configuration.h | 2 +- .../tvrrug/Round2/Configuration.h | 2 +- 25 files changed, 41 insertions(+), 38 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 3ff131de2..f610e0df8 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -566,15 +566,6 @@ * Bed Probe dependencies */ #if HAS_BED_PROBE - #ifndef X_PROBE_OFFSET_FROM_EXTRUDER - #define X_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Y_PROBE_OFFSET_FROM_EXTRUDER - #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif - #ifndef Z_PROBE_OFFSET_FROM_EXTRUDER - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 - #endif #ifndef Z_PROBE_OFFSET_RANGE_MIN #define Z_PROBE_OFFSET_RANGE_MIN -20 #endif @@ -593,6 +584,13 @@ #else #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW #endif + #else + #undef X_PROBE_OFFSET_FROM_EXTRUDER + #undef Y_PROBE_OFFSET_FROM_EXTRUDER + #undef Z_PROBE_OFFSET_FROM_EXTRUDER + #define X_PROBE_OFFSET_FROM_EXTRUDER 0 + #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 #endif /** diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8b5e3394c..53ff21143 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -735,7 +735,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c7dddd6a..1a3830ac8 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3049,12 +3049,11 @@ inline void gcode_G28() { SYNC_PLAN_POSITION_KINEMATIC(); /** - * Set the Z probe (or just the nozzle) destination to the safe - * homing point + * Move the Z probe (or just the nozzle) to the safe homing point */ destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER)); destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - (Y_PROBE_OFFSET_FROM_EXTRUDER)); - destination[Z_AXIS] = current_position[Z_AXIS]; //z is already at the right height + destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { diff --git a/Marlin/SanityCheck.cpp b/Marlin/SanityCheck.cpp index 269c59ea8..6bacb29d4 100644 --- a/Marlin/SanityCheck.cpp +++ b/Marlin/SanityCheck.cpp @@ -353,8 +353,6 @@ #error "AUTO_BED_LEVELING_FEATURE requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #elif ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe! Define a Z Servo, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." - #elif ENABLED(Z_SAFE_HOMING) - #error "Z_SAFE_HOMING currently requires a probe." #endif #endif @@ -364,9 +362,17 @@ */ #if ENABLED(Z_SAFE_HOMING) #if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X - #error "The given Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_X_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle." + #endif #elif Z_SAFE_HOMING_Y_POINT < MIN_PROBE_Y || Z_SAFE_HOMING_Y_POINT > MAX_PROBE_Y - #error "The given Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #if HAS_BED_PROBE + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the Z probe." + #else + #error "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle." + #endif #endif #endif // Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 2ac06d1e8..751417eda 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7bd240eda..ac526d97e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -718,7 +718,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 09a97f1e1..9729be616 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -716,7 +716,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 47b72e461..6883b4f7d 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -728,7 +728,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index a4eb3a30d..23d71364d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -729,7 +729,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. #define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 933b229d4..a9d9a1e02 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -753,7 +753,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 4cbf03c11..a51cf5e03 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 390b07e2d..51d932c8a 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 7fe8a6a5f..c4b535051 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index ac2411b67..b3465378c 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -733,7 +733,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 52a56937c..5fe162019 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -744,7 +744,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index b3ac58545..bf990ac1b 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -757,7 +757,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index ad08e0e02..9a90ad9e5 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -727,7 +727,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index b733bd6af..a1fd9aac0 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -736,7 +736,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 673e167ff..6db0f4057 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -828,7 +828,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index f321eafeb..fabcba89c 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -822,7 +822,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 50e42936d..c5fda7d47 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -825,7 +825,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2726e9a2c..7509fd634 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -819,7 +819,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. #define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 7a0ff37ba..9e25b029a 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -820,7 +820,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 79907874f..d77fe645e 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -739,7 +739,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 36f6d3c5f..3c1f39937 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -725,7 +725,7 @@ // // - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - If stepper drivers time out, it will need X and Y homing again before Z homing. -// - Position the Z probe in a defined XY point before Z Homing when homing all axes (G28). +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Prevent Z homing when the Z probe is outside bed area. //#define Z_SAFE_HOMING