Browse Source

Merge pull request #6568 from thinkyhead/rc_bilinear_extension

Add EXTRAPOLATE_BEYOND_GRID option to bilinear leveling
Scott Lahteine 8 years ago
parent
commit
58210c3a19
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
 
825
 
826
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
833
     // Experimental Subdivision of the grid by Catmull-Rom method.
830
     // Synthesizes intermediate points to produce a more detailed mesh.
834
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 22
- 4
Marlin/Marlin_main.cpp View File

10585
     const float x = RAW_X_POSITION(logical[X_AXIS]) - bilinear_start[X_AXIS],
10585
     const float x = RAW_X_POSITION(logical[X_AXIS]) - bilinear_start[X_AXIS],
10586
                 y = RAW_Y_POSITION(logical[Y_AXIS]) - bilinear_start[Y_AXIS];
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
     if (last_x != x) {
10596
     if (last_x != x) {
10589
       last_x = x;
10597
       last_x = x;
10590
       ratio_x = x * ABL_BG_FACTOR(X_AXIS);
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
       ratio_x -= gx;      // Subtract whole to get the ratio within the grid box
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
       gridx = gx;
10607
       gridx = gx;
10595
       nextx = min(gridx + 1, ABL_BG_POINTS_X - 1);
10608
       nextx = min(gridx + 1, ABL_BG_POINTS_X - 1);
10596
     }
10609
     }
10600
       if (last_y != y) {
10613
       if (last_y != y) {
10601
         last_y = y;
10614
         last_y = y;
10602
         ratio_y = y * ABL_BG_FACTOR(Y_AXIS);
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
         ratio_y -= gy;
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
         gridy = gy;
10624
         gridy = gy;
10607
         nexty = min(gridy + 1, ABL_BG_POINTS_Y - 1);
10625
         nexty = min(gridy + 1, ABL_BG_POINTS_Y - 1);
10608
       }
10626
       }

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

823
 
823
 
824
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
831
     // Experimental Subdivision of the grid by Catmull-Rom method.
828
     // Synthesizes intermediate points to produce a more detailed mesh.
832
     // Synthesizes intermediate points to produce a more detailed mesh.

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

807
 
807
 
808
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
815
     // Experimental Subdivision of the grid by Catmull-Rom method.
812
     // Synthesizes intermediate points to produce a more detailed mesh.
816
     // Synthesizes intermediate points to produce a more detailed mesh.

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

807
 
807
 
808
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
815
     // Experimental Subdivision of the grid by Catmull-Rom method.
812
     // Synthesizes intermediate points to produce a more detailed mesh.
816
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration.h View File

827
 
827
 
828
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
835
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Synthesizes intermediate points to produce a more detailed mesh.
836
     // Synthesizes intermediate points to produce a more detailed mesh.

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

815
 
815
 
816
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
823
     // Experimental Subdivision of the grid by Catmull-Rom method.
820
     // Synthesizes intermediate points to produce a more detailed mesh.
824
     // Synthesizes intermediate points to produce a more detailed mesh.

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

818
 
818
 
819
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
826
     // Experimental Subdivision of the grid by Catmull-Rom method.
823
     // Synthesizes intermediate points to produce a more detailed mesh.
827
     // Synthesizes intermediate points to produce a more detailed mesh.

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

853
 
853
 
854
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
861
     // Experimental Subdivision of the grid by Catmull-Rom method.
858
     // Synthesizes intermediate points to produce a more detailed mesh.
862
     // Synthesizes intermediate points to produce a more detailed mesh.

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

824
 
824
 
825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829
     // Synthesizes intermediate points to produce a more detailed mesh.
833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/K8400/Dual-head/Configuration.h View File

824
 
824
 
825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829
     // Synthesizes intermediate points to produce a more detailed mesh.
833
     // Synthesizes intermediate points to produce a more detailed mesh.

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

824
 
824
 
825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829
     // Synthesizes intermediate points to produce a more detailed mesh.
833
     // Synthesizes intermediate points to produce a more detailed mesh.

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

823
 
823
 
824
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
831
     // Experimental Subdivision of the grid by Catmull-Rom method.
828
     // Synthesizes intermediate points to produce a more detailed mesh.
832
     // Synthesizes intermediate points to produce a more detailed mesh.

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

839
 
839
 
840
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
847
     // Experimental Subdivision of the grid by Catmull-Rom method.
844
     // Synthesizes intermediate points to produce a more detailed mesh.
848
     // Synthesizes intermediate points to produce a more detailed mesh.

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

844
 
844
 
845
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
852
     // Experimental Subdivision of the grid by Catmull-Rom method.
849
     // Synthesizes intermediate points to produce a more detailed mesh.
853
     // Synthesizes intermediate points to produce a more detailed mesh.

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

880
 
880
 
881
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
888
     // Experimental Subdivision of the grid by Catmull-Rom method.
885
     // Synthesizes intermediate points to produce a more detailed mesh.
889
     // Synthesizes intermediate points to produce a more detailed mesh.

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

815
 
815
 
816
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
823
     // Experimental Subdivision of the grid by Catmull-Rom method.
820
     // Synthesizes intermediate points to produce a more detailed mesh.
824
     // Synthesizes intermediate points to produce a more detailed mesh.

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

824
 
824
 
825
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Experimental Subdivision of the grid by Catmull-Rom method.
829
     // Synthesizes intermediate points to produce a more detailed mesh.
833
     // Synthesizes intermediate points to produce a more detailed mesh.

+ 4
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h View File

943
 
943
 
944
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
951
     // Experimental Subdivision of the grid by Catmull-Rom method.
948
     // Synthesizes intermediate points to produce a more detailed mesh.
952
     // Synthesizes intermediate points to produce a more detailed mesh.

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

935
 
935
 
936
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
943
     // Experimental Subdivision of the grid by Catmull-Rom method.
940
     // Synthesizes intermediate points to produce a more detailed mesh.
944
     // Synthesizes intermediate points to produce a more detailed mesh.

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

941
 
941
 
942
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
949
     // Experimental Subdivision of the grid by Catmull-Rom method.
946
     // Synthesizes intermediate points to produce a more detailed mesh.
950
     // Synthesizes intermediate points to produce a more detailed mesh.

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

809
 
809
 
810
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
817
     // Experimental Subdivision of the grid by Catmull-Rom method.
814
     // Synthesizes intermediate points to produce a more detailed mesh.
818
     // Synthesizes intermediate points to produce a more detailed mesh.

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

827
 
827
 
828
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
835
     // Experimental Subdivision of the grid by Catmull-Rom method.
832
     // Synthesizes intermediate points to produce a more detailed mesh.
836
     // Synthesizes intermediate points to produce a more detailed mesh.

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

820
 
820
 
821
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
828
     // Experimental Subdivision of the grid by Catmull-Rom method.
825
     // Synthesizes intermediate points to produce a more detailed mesh.
829
     // Synthesizes intermediate points to produce a more detailed mesh.

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

829
 
829
 
830
   #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
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
     // Experimental Subdivision of the grid by Catmull-Rom method.
837
     // Experimental Subdivision of the grid by Catmull-Rom method.
834
     // Synthesizes intermediate points to produce a more detailed mesh.
838
     // Synthesizes intermediate points to produce a more detailed mesh.

Loading…
Cancel
Save