Add UNKNOWN_Z_NO_RAISE option
With this option enabled, Z won't ever be raised until after `G28` has been completed, and it won't raise if Z becomes unknown. This is good for machines whose beds fall when Z is powered off.
This commit is contained in:
@ -221,9 +221,15 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
|
||||
#endif
|
||||
|
||||
if (home_all || homeX || homeY) {
|
||||
#if ENABLED(UNKNOWN_Z_NO_RAISE)
|
||||
const float z_homing_height = axis_known_position[Z_AXIS] ? Z_HOMING_HEIGHT : 0;
|
||||
#else
|
||||
constexpr float z_homing_height = Z_HOMING_HEIGHT;
|
||||
#endif
|
||||
|
||||
if (z_homing_height && (home_all || homeX || homeY)) {
|
||||
// Raise Z before homing any other axes and z is not already high enough (never lower z)
|
||||
destination[Z_AXIS] = Z_HOMING_HEIGHT;
|
||||
destination[Z_AXIS] = z_homing_height;
|
||||
if (destination[Z_AXIS] > current_position[Z_AXIS]) {
|
||||
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
|
Reference in New Issue
Block a user