Browse Source

Fix Z after ABL Bilinear G29 with fade

Co-Authored-By: Alan T <interstellarmisfit@users.noreply.github.com>
Scott Lahteine 4 years ago
parent
commit
c39873759f
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      Marlin/src/gcode/bedlevel/abl/G29.cpp

+ 6
- 1
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

@@ -934,7 +934,12 @@ G29_TYPE GcodeSuite::G29() {
934 934
 
935 935
         // Unapply the offset because it is going to be immediately applied
936 936
         // and cause compensation movement in Z
937
-        current_position.z -= bilinear_z_offset(current_position);
937
+        #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
938
+          const float fade_scaling_factor = planner.fade_scaling_factor_for_z(current_position.z);
939
+        #else
940
+          constexpr float fade_scaling_factor = 1.0f;
941
+        #endif
942
+        current_position.z -= fade_scaling_factor * bilinear_z_offset(current_position);
938 943
 
939 944
         if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(" corrected Z:", current_position.z);
940 945
       }

Loading…
Cancel
Save