Merge pull request #10032 from thinkyhead/bf2_unknown_z_no_raise

[2.0.x] Add UNKNOWN_Z_NO_RAISE to prevent Z grinding
This commit is contained in:
Scott Lahteine
2018-03-10 00:57:30 -06:00
committed by GitHub
64 changed files with 168 additions and 28 deletions

View File

@ -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)