0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-22 17:52:57 +00:00

Fix Z position after ABL bilinear G29 with fade (#17174)

This commit is contained in:
Alan T 2020-03-15 17:11:43 -06:00 committed by Scott Lahteine
parent 430adce327
commit 10b332f944

View file

@ -5755,7 +5755,12 @@ void home_all_axes() { gcode_G28(true); }
// Unapply the offset because it is going to be immediately applied // Unapply the offset because it is going to be immediately applied
// and cause compensation movement in Z // and cause compensation movement in Z
current_position[Z_AXIS] -= bilinear_z_offset(current_position); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
const float fade_scaling_factor = planner.fade_scaling_factor_for_z(current_position[Z_AXIS]);
#else
constexpr float fade_scaling_factor = 1.0f;
#endif
current_position[Z_AXIS] -= fade_scaling_factor * bilinear_z_offset(current_position);
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]); if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]);