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:
1 parent
3b4c89e4b5
commit
419d12ca1b
3 files changed
+25
-9
No files matched your search
@@ -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