瀏覽代碼

Add a fade factor for mesh leveling

Scott Lahteine 8 年之前
父節點
當前提交
f6f77d34a1
共有 25 個文件被更改,包括 345 次插入11 次删除
  1. 12
    0
      Marlin/Configuration.h
  2. 34
    2
      Marlin/Marlin_main.cpp
  3. 12
    0
      Marlin/example_configurations/Cartesio/Configuration.h
  4. 12
    0
      Marlin/example_configurations/Felix/Configuration.h
  5. 12
    0
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  6. 12
    0
      Marlin/example_configurations/Hephestos/Configuration.h
  7. 12
    0
      Marlin/example_configurations/Hephestos_2/Configuration.h
  8. 12
    0
      Marlin/example_configurations/K8200/Configuration.h
  9. 12
    0
      Marlin/example_configurations/K8400/Configuration.h
  10. 12
    0
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  11. 12
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  12. 12
    0
      Marlin/example_configurations/RigidBot/Configuration.h
  13. 12
    0
      Marlin/example_configurations/SCARA/Configuration.h
  14. 12
    0
      Marlin/example_configurations/TAZ4/Configuration.h
  15. 12
    0
      Marlin/example_configurations/WITBOX/Configuration.h
  16. 12
    0
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  17. 12
    0
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  18. 12
    0
      Marlin/example_configurations/delta/generic/Configuration.h
  19. 12
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  20. 12
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  21. 12
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  22. 12
    0
      Marlin/example_configurations/makibox/Configuration.h
  23. 12
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  24. 39
    5
      Marlin/planner.cpp
  25. 8
    4
      Marlin/planner.h

+ 12
- 0
Marlin/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 34
- 2
Marlin/Marlin_main.cpp 查看文件

2270
     #endif
2270
     #endif
2271
   }
2271
   }
2272
 
2272
 
2273
+  #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
2274
+
2275
+    void set_z_fade_height(const float zfh) {
2276
+      planner.z_fade_height = zfh;
2277
+      planner.inverse_z_fade_height = RECIPROCAL(zfh);
2278
+
2279
+      if (
2280
+        #if ENABLED(MESH_BED_LEVELING)
2281
+          mbl.active()
2282
+        #else
2283
+          planner.abl_enabled
2284
+        #endif
2285
+      ) {
2286
+        set_current_from_steppers_for_axis(
2287
+          #if ABL_PLANAR
2288
+            ALL_AXES
2289
+          #else
2290
+            Z_AXIS
2291
+          #endif
2292
+        );
2293
+      }
2294
+    }
2295
+
2296
+  #endif // LEVELING_FADE_HEIGHT
2273
 
2297
 
2274
   /**
2298
   /**
2275
    * Reset calibration results to zero.
2299
    * Reset calibration results to zero.
6788
 
6812
 
6789
 #if PLANNER_LEVELING
6813
 #if PLANNER_LEVELING
6790
   /**
6814
   /**
6791
-   * M420: Enable/Disable Bed Leveling
6815
+   * M420: Enable/Disable Bed Leveling and/or set the Z fade height.
6816
+   *
6817
+   *       S[bool]   Turns leveling on or off
6818
+   *       Z[height] Sets the Z fade height (0 or none to disable)
6792
    */
6819
    */
6793
-  inline void gcode_M420() { if (code_seen('S')) set_bed_leveling_enabled(code_value_bool()); }
6820
+  inline void gcode_M420() {
6821
+    if (code_seen('S')) set_bed_leveling_enabled(code_value_bool());
6822
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
6823
+      if (code_seen('Z')) set_z_fade_height(code_value_linear_units());
6824
+    #endif
6825
+  }
6794
 #endif
6826
 #endif
6795
 
6827
 
6796
 #if ENABLED(MESH_BED_LEVELING)
6828
 #if ENABLED(MESH_BED_LEVELING)

+ 12
- 0
Marlin/example_configurations/Cartesio/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/Felix/Configuration.h 查看文件

728
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
728
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
729
   #endif  // MANUAL_BED_LEVELING
729
   #endif  // MANUAL_BED_LEVELING
730
 
730
 
731
+  // Gradually reduce leveling correction until a set height is reached,
732
+  // at which point movement will be level to the machine's XY plane.
733
+  // The height can be set with M420 Z<height>
734
+  #define ENABLE_LEVELING_FADE_HEIGHT
735
+
731
 #endif  // MESH_BED_LEVELING
736
 #endif  // MESH_BED_LEVELING
732
 
737
 
733
 //===========================================================================
738
 //===========================================================================
785
   // Probe along the Y axis, advancing X after each column
790
   // Probe along the Y axis, advancing X after each column
786
   //#define PROBE_Y_FIRST
791
   //#define PROBE_Y_FIRST
787
 
792
 
793
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
794
+    // Gradually reduce leveling correction until a set height is reached,
795
+    // at which point movement will be level to the machine's XY plane.
796
+    // The height can be set with M420 Z<height>
797
+    #define ENABLE_LEVELING_FADE_HEIGHT
798
+  #endif
799
+
788
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
800
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
789
 
801
 
790
   // 3 arbitrary points to probe.
802
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h 查看文件

728
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
728
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
729
   #endif  // MANUAL_BED_LEVELING
729
   #endif  // MANUAL_BED_LEVELING
730
 
730
 
731
+  // Gradually reduce leveling correction until a set height is reached,
732
+  // at which point movement will be level to the machine's XY plane.
733
+  // The height can be set with M420 Z<height>
734
+  #define ENABLE_LEVELING_FADE_HEIGHT
735
+
731
 #endif  // MESH_BED_LEVELING
736
 #endif  // MESH_BED_LEVELING
732
 
737
 
733
 //===========================================================================
738
 //===========================================================================
785
   // Probe along the Y axis, advancing X after each column
790
   // Probe along the Y axis, advancing X after each column
786
   //#define PROBE_Y_FIRST
791
   //#define PROBE_Y_FIRST
787
 
792
 
793
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
794
+    // Gradually reduce leveling correction until a set height is reached,
795
+    // at which point movement will be level to the machine's XY plane.
796
+    // The height can be set with M420 Z<height>
797
+    #define ENABLE_LEVELING_FADE_HEIGHT
798
+  #endif
799
+
788
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
800
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
789
 
801
 
790
   // 3 arbitrary points to probe.
802
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/Hephestos/Configuration.h 查看文件

737
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
737
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
738
   #endif  // MANUAL_BED_LEVELING
738
   #endif  // MANUAL_BED_LEVELING
739
 
739
 
740
+  // Gradually reduce leveling correction until a set height is reached,
741
+  // at which point movement will be level to the machine's XY plane.
742
+  // The height can be set with M420 Z<height>
743
+  #define ENABLE_LEVELING_FADE_HEIGHT
744
+
740
 #endif  // MESH_BED_LEVELING
745
 #endif  // MESH_BED_LEVELING
741
 
746
 
742
 //===========================================================================
747
 //===========================================================================
794
   // Probe along the Y axis, advancing X after each column
799
   // Probe along the Y axis, advancing X after each column
795
   //#define PROBE_Y_FIRST
800
   //#define PROBE_Y_FIRST
796
 
801
 
802
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
803
+    // Gradually reduce leveling correction until a set height is reached,
804
+    // at which point movement will be level to the machine's XY plane.
805
+    // The height can be set with M420 Z<height>
806
+    #define ENABLE_LEVELING_FADE_HEIGHT
807
+  #endif
808
+
797
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
809
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
798
 
810
 
799
   // 3 arbitrary points to probe.
811
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h 查看文件

739
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
739
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
740
   #endif  // MANUAL_BED_LEVELING
740
   #endif  // MANUAL_BED_LEVELING
741
 
741
 
742
+  // Gradually reduce leveling correction until a set height is reached,
743
+  // at which point movement will be level to the machine's XY plane.
744
+  // The height can be set with M420 Z<height>
745
+  #define ENABLE_LEVELING_FADE_HEIGHT
746
+
742
 #endif  // MESH_BED_LEVELING
747
 #endif  // MESH_BED_LEVELING
743
 
748
 
744
 //===========================================================================
749
 //===========================================================================
796
   // Probe along the Y axis, advancing X after each column
801
   // Probe along the Y axis, advancing X after each column
797
   //#define PROBE_Y_FIRST
802
   //#define PROBE_Y_FIRST
798
 
803
 
804
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
805
+    // Gradually reduce leveling correction until a set height is reached,
806
+    // at which point movement will be level to the machine's XY plane.
807
+    // The height can be set with M420 Z<height>
808
+    #define ENABLE_LEVELING_FADE_HEIGHT
809
+  #endif
810
+
799
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
811
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
800
 
812
 
801
   // 3 arbitrary points to probe.
813
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/K8200/Configuration.h 查看文件

774
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
774
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
775
   #endif  // MANUAL_BED_LEVELING
775
   #endif  // MANUAL_BED_LEVELING
776
 
776
 
777
+  // Gradually reduce leveling correction until a set height is reached,
778
+  // at which point movement will be level to the machine's XY plane.
779
+  // The height can be set with M420 Z<height>
780
+  #define ENABLE_LEVELING_FADE_HEIGHT
781
+
777
 #endif  // MESH_BED_LEVELING
782
 #endif  // MESH_BED_LEVELING
778
 
783
 
779
 //===========================================================================
784
 //===========================================================================
831
   // Probe along the Y axis, advancing X after each column
836
   // Probe along the Y axis, advancing X after each column
832
   //#define PROBE_Y_FIRST
837
   //#define PROBE_Y_FIRST
833
 
838
 
839
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
840
+    // Gradually reduce leveling correction until a set height is reached,
841
+    // at which point movement will be level to the machine's XY plane.
842
+    // The height can be set with M420 Z<height>
843
+    #define ENABLE_LEVELING_FADE_HEIGHT
844
+  #endif
845
+
834
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
846
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
835
 
847
 
836
   // 3 arbitrary points to probe.
848
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/K8400/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/RigidBot/Configuration.h 查看文件

743
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
743
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
744
   #endif  // MANUAL_BED_LEVELING
744
   #endif  // MANUAL_BED_LEVELING
745
 
745
 
746
+  // Gradually reduce leveling correction until a set height is reached,
747
+  // at which point movement will be level to the machine's XY plane.
748
+  // The height can be set with M420 Z<height>
749
+  #define ENABLE_LEVELING_FADE_HEIGHT
750
+
746
 #endif  // MESH_BED_LEVELING
751
 #endif  // MESH_BED_LEVELING
747
 
752
 
748
 //===========================================================================
753
 //===========================================================================
800
   // Probe along the Y axis, advancing X after each column
805
   // Probe along the Y axis, advancing X after each column
801
   //#define PROBE_Y_FIRST
806
   //#define PROBE_Y_FIRST
802
 
807
 
808
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
809
+    // Gradually reduce leveling correction until a set height is reached,
810
+    // at which point movement will be level to the machine's XY plane.
811
+    // The height can be set with M420 Z<height>
812
+    #define ENABLE_LEVELING_FADE_HEIGHT
813
+  #endif
814
+
803
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
815
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
804
 
816
 
805
   // 3 arbitrary points to probe.
817
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/SCARA/Configuration.h 查看文件

760
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
760
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
761
   #endif  // MANUAL_BED_LEVELING
761
   #endif  // MANUAL_BED_LEVELING
762
 
762
 
763
+  // Gradually reduce leveling correction until a set height is reached,
764
+  // at which point movement will be level to the machine's XY plane.
765
+  // The height can be set with M420 Z<height>
766
+  #define ENABLE_LEVELING_FADE_HEIGHT
767
+
763
 #endif  // MESH_BED_LEVELING
768
 #endif  // MESH_BED_LEVELING
764
 
769
 
765
 //===========================================================================
770
 //===========================================================================
817
   // Probe along the Y axis, advancing X after each column
822
   // Probe along the Y axis, advancing X after each column
818
   //#define PROBE_Y_FIRST
823
   //#define PROBE_Y_FIRST
819
 
824
 
825
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
826
+    // Gradually reduce leveling correction until a set height is reached,
827
+    // at which point movement will be level to the machine's XY plane.
828
+    // The height can be set with M420 Z<height>
829
+    #define ENABLE_LEVELING_FADE_HEIGHT
830
+  #endif
831
+
820
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
832
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
821
 
833
 
822
   // 3 arbitrary points to probe.
834
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/TAZ4/Configuration.h 查看文件

766
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
766
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
767
   #endif  // MANUAL_BED_LEVELING
767
   #endif  // MANUAL_BED_LEVELING
768
 
768
 
769
+  // Gradually reduce leveling correction until a set height is reached,
770
+  // at which point movement will be level to the machine's XY plane.
771
+  // The height can be set with M420 Z<height>
772
+  #define ENABLE_LEVELING_FADE_HEIGHT
773
+
769
 #endif  // MESH_BED_LEVELING
774
 #endif  // MESH_BED_LEVELING
770
 
775
 
771
 //===========================================================================
776
 //===========================================================================
823
   // Probe along the Y axis, advancing X after each column
828
   // Probe along the Y axis, advancing X after each column
824
   //#define PROBE_Y_FIRST
829
   //#define PROBE_Y_FIRST
825
 
830
 
831
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
832
+    // Gradually reduce leveling correction until a set height is reached,
833
+    // at which point movement will be level to the machine's XY plane.
834
+    // The height can be set with M420 Z<height>
835
+    #define ENABLE_LEVELING_FADE_HEIGHT
836
+  #endif
837
+
826
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
838
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
827
 
839
 
828
   // 3 arbitrary points to probe.
840
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/WITBOX/Configuration.h 查看文件

737
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
737
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
738
   #endif  // MANUAL_BED_LEVELING
738
   #endif  // MANUAL_BED_LEVELING
739
 
739
 
740
+  // Gradually reduce leveling correction until a set height is reached,
741
+  // at which point movement will be level to the machine's XY plane.
742
+  // The height can be set with M420 Z<height>
743
+  #define ENABLE_LEVELING_FADE_HEIGHT
744
+
740
 #endif  // MESH_BED_LEVELING
745
 #endif  // MESH_BED_LEVELING
741
 
746
 
742
 //===========================================================================
747
 //===========================================================================
794
   // Probe along the Y axis, advancing X after each column
799
   // Probe along the Y axis, advancing X after each column
795
   //#define PROBE_Y_FIRST
800
   //#define PROBE_Y_FIRST
796
 
801
 
802
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
803
+    // Gradually reduce leveling correction until a set height is reached,
804
+    // at which point movement will be level to the machine's XY plane.
805
+    // The height can be set with M420 Z<height>
806
+    #define ENABLE_LEVELING_FADE_HEIGHT
807
+  #endif
808
+
797
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
809
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
798
 
810
 
799
   // 3 arbitrary points to probe.
811
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h 查看文件

745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
745
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
746
   #endif  // MANUAL_BED_LEVELING
746
   #endif  // MANUAL_BED_LEVELING
747
 
747
 
748
+  // Gradually reduce leveling correction until a set height is reached,
749
+  // at which point movement will be level to the machine's XY plane.
750
+  // The height can be set with M420 Z<height>
751
+  #define ENABLE_LEVELING_FADE_HEIGHT
752
+
748
 #endif  // MESH_BED_LEVELING
753
 #endif  // MESH_BED_LEVELING
749
 
754
 
750
 //===========================================================================
755
 //===========================================================================
802
   // Probe along the Y axis, advancing X after each column
807
   // Probe along the Y axis, advancing X after each column
803
   //#define PROBE_Y_FIRST
808
   //#define PROBE_Y_FIRST
804
 
809
 
810
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811
+    // Gradually reduce leveling correction until a set height is reached,
812
+    // at which point movement will be level to the machine's XY plane.
813
+    // The height can be set with M420 Z<height>
814
+    #define ENABLE_LEVELING_FADE_HEIGHT
815
+  #endif
816
+
805
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
817
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
806
 
818
 
807
   // 3 arbitrary points to probe.
819
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h 查看文件

840
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
840
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
841
   #endif  // MANUAL_BED_LEVELING
841
   #endif  // MANUAL_BED_LEVELING
842
 
842
 
843
+  // Gradually reduce leveling correction until a set height is reached,
844
+  // at which point movement will be level to the machine's XY plane.
845
+  // The height can be set with M420 Z<height>
846
+  #define ENABLE_LEVELING_FADE_HEIGHT
847
+
843
 #endif  // MESH_BED_LEVELING
848
 #endif  // MESH_BED_LEVELING
844
 
849
 
845
 //===========================================================================
850
 //===========================================================================
899
   // Probe along the Y axis, advancing X after each column
904
   // Probe along the Y axis, advancing X after each column
900
   //#define PROBE_Y_FIRST
905
   //#define PROBE_Y_FIRST
901
 
906
 
907
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
908
+    // Gradually reduce leveling correction until a set height is reached,
909
+    // at which point movement will be level to the machine's XY plane.
910
+    // The height can be set with M420 Z<height>
911
+    #define ENABLE_LEVELING_FADE_HEIGHT
912
+  #endif
913
+
902
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
914
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
903
 
915
 
904
   // 3 arbitrary points to probe.
916
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/delta/generic/Configuration.h 查看文件

834
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
834
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
835
   #endif  // MANUAL_BED_LEVELING
835
   #endif  // MANUAL_BED_LEVELING
836
 
836
 
837
+  // Gradually reduce leveling correction until a set height is reached,
838
+  // at which point movement will be level to the machine's XY plane.
839
+  // The height can be set with M420 Z<height>
840
+  #define ENABLE_LEVELING_FADE_HEIGHT
841
+
837
 #endif  // MESH_BED_LEVELING
842
 #endif  // MESH_BED_LEVELING
838
 
843
 
839
 //===========================================================================
844
 //===========================================================================
893
   // Probe along the Y axis, advancing X after each column
898
   // Probe along the Y axis, advancing X after each column
894
   //#define PROBE_Y_FIRST
899
   //#define PROBE_Y_FIRST
895
 
900
 
901
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
902
+    // Gradually reduce leveling correction until a set height is reached,
903
+    // at which point movement will be level to the machine's XY plane.
904
+    // The height can be set with M420 Z<height>
905
+    #define ENABLE_LEVELING_FADE_HEIGHT
906
+  #endif
907
+
896
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
908
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
897
 
909
 
898
   // 3 arbitrary points to probe.
910
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h 查看文件

837
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
837
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
838
   #endif  // MANUAL_BED_LEVELING
838
   #endif  // MANUAL_BED_LEVELING
839
 
839
 
840
+  // Gradually reduce leveling correction until a set height is reached,
841
+  // at which point movement will be level to the machine's XY plane.
842
+  // The height can be set with M420 Z<height>
843
+  #define ENABLE_LEVELING_FADE_HEIGHT
844
+
840
 #endif  // MESH_BED_LEVELING
845
 #endif  // MESH_BED_LEVELING
841
 
846
 
842
 //===========================================================================
847
 //===========================================================================
896
   // Probe along the Y axis, advancing X after each column
901
   // Probe along the Y axis, advancing X after each column
897
   //#define PROBE_Y_FIRST
902
   //#define PROBE_Y_FIRST
898
 
903
 
904
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
905
+    // Gradually reduce leveling correction until a set height is reached,
906
+    // at which point movement will be level to the machine's XY plane.
907
+    // The height can be set with M420 Z<height>
908
+    #define ENABLE_LEVELING_FADE_HEIGHT
909
+  #endif
910
+
899
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
911
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
900
 
912
 
901
   // 3 arbitrary points to probe.
913
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h 查看文件

836
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
836
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
837
   #endif  // MANUAL_BED_LEVELING
837
   #endif  // MANUAL_BED_LEVELING
838
 
838
 
839
+  // Gradually reduce leveling correction until a set height is reached,
840
+  // at which point movement will be level to the machine's XY plane.
841
+  // The height can be set with M420 Z<height>
842
+  #define ENABLE_LEVELING_FADE_HEIGHT
843
+
839
 #endif  // MESH_BED_LEVELING
844
 #endif  // MESH_BED_LEVELING
840
 
845
 
841
 //===========================================================================
846
 //===========================================================================
895
   // Probe along the Y axis, advancing X after each column
900
   // Probe along the Y axis, advancing X after each column
896
   //#define PROBE_Y_FIRST
901
   //#define PROBE_Y_FIRST
897
 
902
 
903
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
904
+    // Gradually reduce leveling correction until a set height is reached,
905
+    // at which point movement will be level to the machine's XY plane.
906
+    // The height can be set with M420 Z<height>
907
+    #define ENABLE_LEVELING_FADE_HEIGHT
908
+  #endif
909
+
898
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
910
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
899
 
911
 
900
   // 3 arbitrary points to probe.
912
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h 查看文件

840
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
840
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
841
   #endif  // MANUAL_BED_LEVELING
841
   #endif  // MANUAL_BED_LEVELING
842
 
842
 
843
+  // Gradually reduce leveling correction until a set height is reached,
844
+  // at which point movement will be level to the machine's XY plane.
845
+  // The height can be set with M420 Z<height>
846
+  #define ENABLE_LEVELING_FADE_HEIGHT
847
+
843
 #endif  // MESH_BED_LEVELING
848
 #endif  // MESH_BED_LEVELING
844
 
849
 
845
 //===========================================================================
850
 //===========================================================================
899
   // Probe along the Y axis, advancing X after each column
904
   // Probe along the Y axis, advancing X after each column
900
   //#define PROBE_Y_FIRST
905
   //#define PROBE_Y_FIRST
901
 
906
 
907
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
908
+    // Gradually reduce leveling correction until a set height is reached,
909
+    // at which point movement will be level to the machine's XY plane.
910
+    // The height can be set with M420 Z<height>
911
+    #define ENABLE_LEVELING_FADE_HEIGHT
912
+  #endif
913
+
902
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
914
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
903
 
915
 
904
   // 3 arbitrary points to probe.
916
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/makibox/Configuration.h 查看文件

748
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
748
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
749
   #endif  // MANUAL_BED_LEVELING
749
   #endif  // MANUAL_BED_LEVELING
750
 
750
 
751
+  // Gradually reduce leveling correction until a set height is reached,
752
+  // at which point movement will be level to the machine's XY plane.
753
+  // The height can be set with M420 Z<height>
754
+  #define ENABLE_LEVELING_FADE_HEIGHT
755
+
751
 #endif  // MESH_BED_LEVELING
756
 #endif  // MESH_BED_LEVELING
752
 
757
 
753
 //===========================================================================
758
 //===========================================================================
805
   // Probe along the Y axis, advancing X after each column
810
   // Probe along the Y axis, advancing X after each column
806
   //#define PROBE_Y_FIRST
811
   //#define PROBE_Y_FIRST
807
 
812
 
813
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
814
+    // Gradually reduce leveling correction until a set height is reached,
815
+    // at which point movement will be level to the machine's XY plane.
816
+    // The height can be set with M420 Z<height>
817
+    #define ENABLE_LEVELING_FADE_HEIGHT
818
+  #endif
819
+
808
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
820
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
809
 
821
 
810
   // 3 arbitrary points to probe.
822
   // 3 arbitrary points to probe.

+ 12
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h 查看文件

741
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
741
     #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis.
742
   #endif  // MANUAL_BED_LEVELING
742
   #endif  // MANUAL_BED_LEVELING
743
 
743
 
744
+  // Gradually reduce leveling correction until a set height is reached,
745
+  // at which point movement will be level to the machine's XY plane.
746
+  // The height can be set with M420 Z<height>
747
+  #define ENABLE_LEVELING_FADE_HEIGHT
748
+
744
 #endif  // MESH_BED_LEVELING
749
 #endif  // MESH_BED_LEVELING
745
 
750
 
746
 //===========================================================================
751
 //===========================================================================
798
   // Probe along the Y axis, advancing X after each column
803
   // Probe along the Y axis, advancing X after each column
799
   //#define PROBE_Y_FIRST
804
   //#define PROBE_Y_FIRST
800
 
805
 
806
+  #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
807
+    // Gradually reduce leveling correction until a set height is reached,
808
+    // at which point movement will be level to the machine's XY plane.
809
+    // The height can be set with M420 Z<height>
810
+    #define ENABLE_LEVELING_FADE_HEIGHT
811
+  #endif
812
+
801
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
813
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
802
 
814
 
803
   // 3 arbitrary points to probe.
815
   // 3 arbitrary points to probe.

+ 39
- 5
Marlin/planner.cpp 查看文件

104
   matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
104
   matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
105
 #endif
105
 #endif
106
 
106
 
107
+#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
108
+  float Planner::z_fade_height = 0.0,
109
+        Planner::inverse_z_fade_height = 0.0;
110
+#endif
111
+
107
 #if ENABLED(AUTOTEMP)
112
 #if ENABLED(AUTOTEMP)
108
   float Planner::autotemp_max = 250,
113
   float Planner::autotemp_max = 250,
109
         Planner::autotemp_min = 210,
114
         Planner::autotemp_min = 210,
531
       if (!abl_enabled) return;
536
       if (!abl_enabled) return;
532
     #endif
537
     #endif
533
 
538
 
539
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
540
+      static float z_fade_factor = 1.0, last_raw_lz = -999.0;
541
+      if (z_fade_height) {
542
+        const float raw_lz = RAW_Z_POSITION(lz);
543
+        if (raw_lz >= z_fade_height) return;
544
+        if (last_raw_lz != raw_lz) {
545
+          last_raw_lz = raw_lz;
546
+          z_fade_factor = 1.0 - raw_lz * inverse_z_fade_height;
547
+        }
548
+      }
549
+      else
550
+        z_fade_factor = 1.0;
551
+    #endif
552
+
534
     #if ENABLED(MESH_BED_LEVELING)
553
     #if ENABLED(MESH_BED_LEVELING)
535
 
554
 
536
       if (mbl.active())
555
       if (mbl.active())
537
-        lz += mbl.get_z(RAW_X_POSITION(lx), RAW_Y_POSITION(ly));
556
+        lz += mbl.get_z(RAW_X_POSITION(lx), RAW_Y_POSITION(ly)) * z_fade_factor;
538
 
557
 
539
     #elif ABL_PLANAR
558
     #elif ABL_PLANAR
540
 
559
 
551
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
570
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
552
 
571
 
553
       float tmp[XYZ] = { lx, ly, 0 };
572
       float tmp[XYZ] = { lx, ly, 0 };
554
-      lz += bilinear_z_offset(tmp);
573
+      lz += bilinear_z_offset(tmp) * z_fade_factor;
555
 
574
 
556
     #endif
575
     #endif
557
   }
576
   }
562
       if (!abl_enabled) return;
581
       if (!abl_enabled) return;
563
     #endif
582
     #endif
564
 
583
 
584
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
585
+      if (z_fade_height && RAW_Z_POSITION(logical[Z_AXIS]) >= z_fade_height) return;
586
+    #endif
587
+
565
     #if ENABLED(MESH_BED_LEVELING)
588
     #if ENABLED(MESH_BED_LEVELING)
566
 
589
 
567
-      if (mbl.active())
568
-        logical[Z_AXIS] -= mbl.get_z(RAW_X_POSITION(logical[X_AXIS]), RAW_Y_POSITION(logical[Y_AXIS]));
590
+      if (mbl.active()) {
591
+        #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
592
+          const float c = mbl.get_z(RAW_X_POSITION(logical[X_AXIS]), RAW_Y_POSITION(logical[Y_AXIS]));
593
+          logical[Z_AXIS] = (z_fade_height * (RAW_Z_POSITION(logical[Z_AXIS]) - c)) / (z_fade_height - c);
594
+        #else
595
+          logical[Z_AXIS] -= mbl.get_z(RAW_X_POSITION(logical[X_AXIS]), RAW_Y_POSITION(logical[Y_AXIS]));
596
+        #endif
597
+      }
569
 
598
 
570
     #elif ABL_PLANAR
599
     #elif ABL_PLANAR
571
 
600
 
583
 
612
 
584
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
613
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
585
 
614
 
586
-      logical[Z_AXIS] -= bilinear_z_offset(logical);
615
+      #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
616
+        const float c = bilinear_z_offset(logical);
617
+        logical[Z_AXIS] = (z_fade_height * (RAW_Z_POSITION(logical[Z_AXIS]) - c)) / (z_fade_height - c);
618
+      #else
619
+        logical[Z_AXIS] -= bilinear_z_offset(logical);
620
+      #endif
587
 
621
 
588
     #endif
622
     #endif
589
   }
623
   }

+ 8
- 4
Marlin/planner.h 查看文件

162
       static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
162
       static matrix_3x3 bed_level_matrix; // Transform to compensate for bed level
163
     #endif
163
     #endif
164
 
164
 
165
+    #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
166
+      static float z_fade_height, inverse_z_fade_height;
167
+    #endif
168
+
165
   private:
169
   private:
166
 
170
 
167
     /**
171
     /**
180
      */
184
      */
181
     static float previous_nominal_speed;
185
     static float previous_nominal_speed;
182
 	
186
 	
183
-	/**
184
- 	 * Limit where 64bit math is necessary for acceleration calculation
185
- 	 */
186
- 	static uint32_t cutoff_long;
187
+    /**
188
+     * Limit where 64bit math is necessary for acceleration calculation
189
+     */
190
+    static uint32_t cutoff_long;
187
 
191
 
188
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER)
192
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER)
189
       /**
193
       /**

Loading…
取消
儲存