Skip to content

Commit

Permalink
Fix Z position after ABL bilinear G29 with fade (#17174)
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-pivo committed Oct 27, 2020
1 parent 353d1b2 commit 44570a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5572,7 +5572,12 @@ void home_all_axes() { gcode_G28(true); }

// Unapply the offset because it is going to be immediately applied
// 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 (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]);
Expand Down

0 comments on commit 44570a9

Please sign in to comment.