Browse Source

Add EXTRAPOLATE_BEYOND_GRID option to bilinear leveling

Scott Lahteine 7 years ago
parent
commit
da08e11acd
25 changed files with 118 additions and 4 deletions
  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 View File

@@ -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 View File

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

+ 4
- 0
Marlin/example_configurations/Cartesio/Configuration.h View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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.

Loading…
Cancel
Save