Skip to content

Commit

Permalink
Fix Z after ABL Bilinear G29 with fade
Browse files Browse the repository at this point in the history
Co-Authored-By: Alan T <interstellarmisfit@users.noreply.github.com>
  • Loading branch information
2 people authored and GeminiServer committed Mar 16, 2020
1 parent b3f05e3 commit 4cca68d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,12 @@ G29_TYPE GcodeSuite::G29() {

// Unapply the offset because it is going to be immediately applied
// and cause compensation movement in Z
current_position.z -= 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);
#else
constexpr float fade_scaling_factor = 1.0f;
#endif
current_position.z -= fade_scaling_factor * bilinear_z_offset(current_position);

if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position.z);
}
Expand Down

0 comments on commit 4cca68d

Please sign in to comment.