Merge pull request #4426 from thinkyhead/rc_probeless_safe_homing

Allow Z_SAFE_HOMING without a probe
This commit is contained in:
Scott Lahteine 2016-07-27 05:12:33 -07:00 committed by GitHub
commit dc3d2b50cd
25 changed files with 43 additions and 40 deletions

View file

@ -566,15 +566,6 @@
* Bed Probe dependencies * Bed Probe dependencies
*/ */
#if HAS_BED_PROBE #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 #ifndef Z_PROBE_OFFSET_RANGE_MIN
#define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MIN -20
#endif #endif
@ -593,6 +584,13 @@
#else #else
#define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW #define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW
#endif #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 #endif
/** /**

View file

@ -735,7 +735,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -3049,12 +3049,11 @@ inline void gcode_G28() {
SYNC_PLAN_POSITION_KINEMATIC(); SYNC_PLAN_POSITION_KINEMATIC();
/** /**
* Set the Z probe (or just the nozzle) destination to the safe * Move the Z probe (or just the nozzle) to the safe homing point
* homing point
*/ */
destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - (X_PROBE_OFFSET_FROM_EXTRUDER)); 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[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 ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {

View file

@ -340,8 +340,8 @@
#error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration." #error "You must set Z_RAISE_BETWEEN_PROBINGS in your configuration."
#elif Z_RAISE_PROBE_DEPLOY_STOW < 0 #elif Z_RAISE_PROBE_DEPLOY_STOW < 0
#error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0." #error "Probes need Z_RAISE_PROBE_DEPLOY_STOW >= 0."
#elif Z_RAISE_BETWEEN_PROBINGS < 1 #elif Z_RAISE_BETWEEN_PROBINGS < 0
#error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 1." #error "Probes need Z_RAISE_BETWEEN_PROBINGS >= 0."
#endif #endif
#else #else
@ -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." #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) #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." #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
#endif #endif
@ -364,9 +362,17 @@
*/ */
#if ENABLED(Z_SAFE_HOMING) #if ENABLED(Z_SAFE_HOMING)
#if Z_SAFE_HOMING_X_POINT < MIN_PROBE_X || Z_SAFE_HOMING_X_POINT > MAX_PROBE_X #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 #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
#endif // Z_SAFE_HOMING #endif // Z_SAFE_HOMING

View file

@ -736,7 +736,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -718,7 +718,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -716,7 +716,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -728,7 +728,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -729,7 +729,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
#define Z_SAFE_HOMING #define Z_SAFE_HOMING

View file

@ -753,7 +753,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -736,7 +736,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -736,7 +736,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -736,7 +736,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -733,7 +733,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -744,7 +744,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -757,7 +757,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -727,7 +727,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -736,7 +736,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -828,7 +828,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -822,7 +822,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -825,7 +825,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -819,7 +819,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
#define Z_SAFE_HOMING #define Z_SAFE_HOMING

View file

@ -820,7 +820,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -739,7 +739,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING

View file

@ -725,7 +725,7 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - 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. // - 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. // - Prevent Z homing when the Z probe is outside bed area.
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING