Parcourir la source

Merge pull request #6568 from thinkyhead/rc_bilinear_extension

Add EXTRAPOLATE_BEYOND_GRID option to bilinear leveling
Scott Lahteine il y a 7 ans
Parent
révision
58210c3a19
25 fichiers modifiés avec 118 ajouts et 4 suppressions
  1. 4
    0
      Marlin/Configuration.h
  2. 22
    4
      Marlin/Marlin_main.cpp
  3. 4
    0
      Marlin/example_configurations/Cartesio/Configuration.h
  4. 4
    0
      Marlin/example_configurations/Felix/Configuration.h
  5. 4
    0
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  6. 4
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h
  7. 4
    0
      Marlin/example_configurations/Hephestos/Configuration.h
  8. 4
    0
      Marlin/example_configurations/Hephestos_2/Configuration.h
  9. 4
    0
      Marlin/example_configurations/K8200/Configuration.h
  10. 4
    0
      Marlin/example_configurations/K8400/Configuration.h
  11. 4
    0
      Marlin/example_configurations/K8400/Dual-head/Configuration.h
  12. 4
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  13. 4
    0
      Marlin/example_configurations/RigidBot/Configuration.h
  14. 4
    0
      Marlin/example_configurations/SCARA/Configuration.h
  15. 4
    0
      Marlin/example_configurations/TAZ4/Configuration.h
  16. 4
    0
      Marlin/example_configurations/TinyBoy2/Configuration.h
  17. 4
    0
      Marlin/example_configurations/WITBOX/Configuration.h
  18. 4
    0
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  19. 4
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h
  20. 4
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  21. 4
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  22. 4
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h
  23. 4
    0
      Marlin/example_configurations/makibox/Configuration.h
  24. 4
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  25. 4
    0
      Marlin/example_configurations/wt150/Configuration.h

+ 4
- 0
Marlin/Configuration.h Voir le fichier

@@ -825,6 +825,10 @@
825 825
 
826 826
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
827 827
 
828
+    // Beyond the probed grid, continue the implied tilt?
829
+    // Default is to maintain the height of the nearest edge.
830
+    //#define EXTRAPOLATE_BEYOND_GRID
831
+
828 832
     //
829 833
     // Experimental Subdivision of the grid by Catmull-Rom method.
830 834
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 22
- 4
Marlin/Marlin_main.cpp Voir le fichier

@@ -10585,12 +10585,25 @@ void ok_to_send() {
10585 10585
     const float x = RAW_X_POSITION(logical[X_AXIS]) - bilinear_start[X_AXIS],
10586 10586
                 y = RAW_Y_POSITION(logical[Y_AXIS]) - bilinear_start[Y_AXIS];
10587 10587
 
10588
+    #if ENABLED(EXTRAPOLATE_BEYOND_GRID)
10589
+      // Keep using the last grid box
10590
+      #define FAR_EDGE_OR_BOX 2
10591
+    #else
10592
+      // Just use the grid far edge
10593
+      #define FAR_EDGE_OR_BOX 1
10594
+    #endif
10595
+
10588 10596
     if (last_x != x) {
10589 10597
       last_x = x;
10590 10598
       ratio_x = x * ABL_BG_FACTOR(X_AXIS);
10591
-      const float gx = constrain(floor(ratio_x), 0, ABL_BG_POINTS_X - 1);
10599
+      const float gx = constrain(floor(ratio_x), 0, ABL_BG_POINTS_X - FAR_EDGE_OR_BOX);
10592 10600
       ratio_x -= gx;      // Subtract whole to get the ratio within the grid box
10593
-      NOLESS(ratio_x, 0); // Never < 0.0. (> 1.0 is ok when nextx==gridx.)
10601
+
10602
+      #if DISABLED(EXTRAPOLATE_BEYOND_GRID)
10603
+        // Beyond the grid maintain height at grid edges
10604
+        NOLESS(ratio_x, 0); // Never < 0.0. (> 1.0 is ok when nextx==gridx.)
10605
+      #endif
10606
+
10594 10607
       gridx = gx;
10595 10608
       nextx = min(gridx + 1, ABL_BG_POINTS_X - 1);
10596 10609
     }
@@ -10600,9 +10613,14 @@ void ok_to_send() {
10600 10613
       if (last_y != y) {
10601 10614
         last_y = y;
10602 10615
         ratio_y = y * ABL_BG_FACTOR(Y_AXIS);
10603
-        const float gy = constrain(floor(ratio_y), 0, ABL_BG_POINTS_Y - 1);
10616
+        const float gy = constrain(floor(ratio_y), 0, ABL_BG_POINTS_Y - FAR_EDGE_OR_BOX);
10604 10617
         ratio_y -= gy;
10605
-        NOLESS(ratio_y, 0);
10618
+
10619
+        #if DISABLED(EXTRAPOLATE_BEYOND_GRID)
10620
+          // Beyond the grid maintain height at grid edges
10621
+          NOLESS(ratio_y, 0); // Never < 0.0. (> 1.0 is ok when nexty==gridy.)
10622
+        #endif
10623
+
10606 10624
         gridy = gy;
10607 10625
         nexty = min(gridy + 1, ABL_BG_POINTS_Y - 1);
10608 10626
       }

+ 4
- 0
Marlin/example_configurations/Cartesio/Configuration.h Voir le fichier

@@ -823,6 +823,10 @@
823 823
 
824 824
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
825 825
 
826
+    // Beyond the probed grid, continue the implied tilt?
827
+    // Default is to maintain the height of the nearest edge.
828
+    //#define EXTRAPOLATE_BEYOND_GRID
829
+
826 830
     //
827 831
     // Experimental Subdivision of the grid by Catmull-Rom method.
828 832
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/Felix/Configuration.h Voir le fichier

@@ -807,6 +807,10 @@
807 807
 
808 808
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
809 809
 
810
+    // Beyond the probed grid, continue the implied tilt?
811
+    // Default is to maintain the height of the nearest edge.
812
+    //#define EXTRAPOLATE_BEYOND_GRID
813
+
810 814
     //
811 815
     // Experimental Subdivision of the grid by Catmull-Rom method.
812 816
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/Felix/DUAL/Configuration.h Voir le fichier

@@ -807,6 +807,10 @@
807 807
 
808 808
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
809 809
 
810
+    // Beyond the probed grid, continue the implied tilt?
811
+    // Default is to maintain the height of the nearest edge.
812
+    //#define EXTRAPOLATE_BEYOND_GRID
813
+
810 814
     //
811 815
     // Experimental Subdivision of the grid by Catmull-Rom method.
812 816
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h Voir le fichier

@@ -827,6 +827,10 @@
827 827
 
828 828
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
829 829
 
830
+    // Beyond the probed grid, continue the implied tilt?
831
+    // Default is to maintain the height of the nearest edge.
832
+    //#define EXTRAPOLATE_BEYOND_GRID
833
+
830 834
     //
831 835
     // Experimental Subdivision of the grid by Catmull-Rom method.
832 836
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/Hephestos/Configuration.h Voir le fichier

@@ -815,6 +815,10 @@
815 815
 
816 816
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
817 817
 
818
+    // Beyond the probed grid, continue the implied tilt?
819
+    // Default is to maintain the height of the nearest edge.
820
+    //#define EXTRAPOLATE_BEYOND_GRID
821
+
818 822
     //
819 823
     // Experimental Subdivision of the grid by Catmull-Rom method.
820 824
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h Voir le fichier

@@ -818,6 +818,10 @@
818 818
 
819 819
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
820 820
 
821
+    // Beyond the probed grid, continue the implied tilt?
822
+    // Default is to maintain the height of the nearest edge.
823
+    //#define EXTRAPOLATE_BEYOND_GRID
824
+
821 825
     //
822 826
     // Experimental Subdivision of the grid by Catmull-Rom method.
823 827
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/K8200/Configuration.h Voir le fichier

@@ -853,6 +853,10 @@
853 853
 
854 854
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
855 855
 
856
+    // Beyond the probed grid, continue the implied tilt?
857
+    // Default is to maintain the height of the nearest edge.
858
+    //#define EXTRAPOLATE_BEYOND_GRID
859
+
856 860
     //
857 861
     // Experimental Subdivision of the grid by Catmull-Rom method.
858 862
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/K8400/Configuration.h Voir le fichier

@@ -824,6 +824,10 @@
824 824
 
825 825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
826 826
 
827
+    // Beyond the probed grid, continue the implied tilt?
828
+    // Default is to maintain the height of the nearest edge.
829
+    //#define EXTRAPOLATE_BEYOND_GRID
830
+
827 831
     //
828 832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829 833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h Voir le fichier

@@ -824,6 +824,10 @@
824 824
 
825 825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
826 826
 
827
+    // Beyond the probed grid, continue the implied tilt?
828
+    // Default is to maintain the height of the nearest edge.
829
+    //#define EXTRAPOLATE_BEYOND_GRID
830
+
827 831
     //
828 832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829 833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Voir le fichier

@@ -824,6 +824,10 @@
824 824
 
825 825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
826 826
 
827
+    // Beyond the probed grid, continue the implied tilt?
828
+    // Default is to maintain the height of the nearest edge.
829
+    //#define EXTRAPOLATE_BEYOND_GRID
830
+
827 831
     //
828 832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829 833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/RigidBot/Configuration.h Voir le fichier

@@ -823,6 +823,10 @@
823 823
 
824 824
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
825 825
 
826
+    // Beyond the probed grid, continue the implied tilt?
827
+    // Default is to maintain the height of the nearest edge.
828
+    //#define EXTRAPOLATE_BEYOND_GRID
829
+
826 830
     //
827 831
     // Experimental Subdivision of the grid by Catmull-Rom method.
828 832
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/SCARA/Configuration.h Voir le fichier

@@ -839,6 +839,10 @@
839 839
 
840 840
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
841 841
 
842
+    // Beyond the probed grid, continue the implied tilt?
843
+    // Default is to maintain the height of the nearest edge.
844
+    //#define EXTRAPOLATE_BEYOND_GRID
845
+
842 846
     //
843 847
     // Experimental Subdivision of the grid by Catmull-Rom method.
844 848
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/TAZ4/Configuration.h Voir le fichier

@@ -844,6 +844,10 @@
844 844
 
845 845
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
846 846
 
847
+    // Beyond the probed grid, continue the implied tilt?
848
+    // Default is to maintain the height of the nearest edge.
849
+    //#define EXTRAPOLATE_BEYOND_GRID
850
+
847 851
     //
848 852
     // Experimental Subdivision of the grid by Catmull-Rom method.
849 853
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/TinyBoy2/Configuration.h Voir le fichier

@@ -880,6 +880,10 @@
880 880
 
881 881
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
882 882
 
883
+    // Beyond the probed grid, continue the implied tilt?
884
+    // Default is to maintain the height of the nearest edge.
885
+    //#define EXTRAPOLATE_BEYOND_GRID
886
+
883 887
     //
884 888
     // Experimental Subdivision of the grid by Catmull-Rom method.
885 889
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/WITBOX/Configuration.h Voir le fichier

@@ -815,6 +815,10 @@
815 815
 
816 816
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
817 817
 
818
+    // Beyond the probed grid, continue the implied tilt?
819
+    // Default is to maintain the height of the nearest edge.
820
+    //#define EXTRAPOLATE_BEYOND_GRID
821
+
818 822
     //
819 823
     // Experimental Subdivision of the grid by Catmull-Rom method.
820 824
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h Voir le fichier

@@ -824,6 +824,10 @@
824 824
 
825 825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
826 826
 
827
+    // Beyond the probed grid, continue the implied tilt?
828
+    // Default is to maintain the height of the nearest edge.
829
+    //#define EXTRAPOLATE_BEYOND_GRID
830
+
827 831
     //
828 832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829 833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h Voir le fichier

@@ -943,6 +943,10 @@
943 943
 
944 944
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
945 945
 
946
+    // Beyond the probed grid, continue the implied tilt?
947
+    // Default is to maintain the height of the nearest edge.
948
+    //#define EXTRAPOLATE_BEYOND_GRID
949
+
946 950
     //
947 951
     // Experimental Subdivision of the grid by Catmull-Rom method.
948 952
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h Voir le fichier

@@ -935,6 +935,10 @@
935 935
 
936 936
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
937 937
 
938
+    // Beyond the probed grid, continue the implied tilt?
939
+    // Default is to maintain the height of the nearest edge.
940
+    //#define EXTRAPOLATE_BEYOND_GRID
941
+
938 942
     //
939 943
     // Experimental Subdivision of the grid by Catmull-Rom method.
940 944
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h Voir le fichier

@@ -941,6 +941,10 @@
941 941
 
942 942
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
943 943
 
944
+    // Beyond the probed grid, continue the implied tilt?
945
+    // Default is to maintain the height of the nearest edge.
946
+    //#define EXTRAPOLATE_BEYOND_GRID
947
+
944 948
     //
945 949
     // Experimental Subdivision of the grid by Catmull-Rom method.
946 950
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration.h Voir le fichier

@@ -809,6 +809,10 @@
809 809
 
810 810
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
811 811
 
812
+    // Beyond the probed grid, continue the implied tilt?
813
+    // Default is to maintain the height of the nearest edge.
814
+    //#define EXTRAPOLATE_BEYOND_GRID
815
+
812 816
     //
813 817
     // Experimental Subdivision of the grid by Catmull-Rom method.
814 818
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/makibox/Configuration.h Voir le fichier

@@ -827,6 +827,10 @@
827 827
 
828 828
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
829 829
 
830
+    // Beyond the probed grid, continue the implied tilt?
831
+    // Default is to maintain the height of the nearest edge.
832
+    //#define EXTRAPOLATE_BEYOND_GRID
833
+
830 834
     //
831 835
     // Experimental Subdivision of the grid by Catmull-Rom method.
832 836
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h Voir le fichier

@@ -820,6 +820,10 @@
820 820
 
821 821
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
822 822
 
823
+    // Beyond the probed grid, continue the implied tilt?
824
+    // Default is to maintain the height of the nearest edge.
825
+    //#define EXTRAPOLATE_BEYOND_GRID
826
+
823 827
     //
824 828
     // Experimental Subdivision of the grid by Catmull-Rom method.
825 829
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/wt150/Configuration.h Voir le fichier

@@ -829,6 +829,10 @@
829 829
 
830 830
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
831 831
 
832
+    // Beyond the probed grid, continue the implied tilt?
833
+    // Default is to maintain the height of the nearest edge.
834
+    //#define EXTRAPOLATE_BEYOND_GRID
835
+
832 836
     //
833 837
     // Experimental Subdivision of the grid by Catmull-Rom method.
834 838
     // Synthesizes intermediate points to produce a more detailed mesh.

Chargement…
Annuler
Enregistrer