Browse Source

Add PROBE_Y_FIRST option for probe order

Scott Lahteine 9 years ago
parent
commit
2d2c9bdf92

+ 3
- 0
Marlin/Configuration.h View File

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

+ 31
- 13
Marlin/Marlin_main.cpp View File

@@ -3771,30 +3771,48 @@ inline void gcode_G28() {
3771 3771
 
3772 3772
       #endif // AUTO_BED_LEVELING_LINEAR
3773 3773
 
3774
-      bool zig = abl_grid_points_y & 1; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
3774
+      #if ENABLED(PROBE_Y_FIRST)
3775
+        #define PR_OUTER_VAR xCount
3776
+        #define PR_OUTER_END abl_grid_points_x
3777
+        #define PR_INNER_VAR yCount
3778
+        #define PR_INNER_END abl_grid_points_y
3779
+      #else
3780
+        #define PR_OUTER_VAR yCount
3781
+        #define PR_OUTER_END abl_grid_points_y
3782
+        #define PR_INNER_VAR xCount
3783
+        #define PR_INNER_END abl_grid_points_x
3784
+      #endif
3775 3785
 
3776
-      for (uint8_t yCount = 0; yCount < abl_grid_points_y; yCount++) {
3777
-        float yBase = front_probe_bed_position + yGridSpacing * yCount;
3778
-        yProbe = floor(yBase + (yBase < 0 ? 0 : 0.5));
3786
+      #if ENABLED(MAKERARM_SCARA)
3787
+        bool zig = true;
3788
+      #else
3789
+        bool zig = PR_OUTER_END & 1; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
3790
+      #endif
3779 3791
 
3780
-        int8_t xStart, xStop, xInc;
3792
+      for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END; PR_OUTER_VAR++) {
3793
+
3794
+        int8_t inStart, inStop, inInc;
3781 3795
 
3782 3796
         if (zig) {
3783
-          xStart = 0;
3784
-          xStop = abl_grid_points_x;
3785
-          xInc = 1;
3797
+          inStart = 0;
3798
+          inStop = PR_INNER_END;
3799
+          inInc = 1;
3786 3800
         }
3787 3801
         else {
3788
-          xStart = abl_grid_points_x - 1;
3789
-          xStop = -1;
3790
-          xInc = -1;
3802
+          inStart = PR_INNER_END - 1;
3803
+          inStop = -1;
3804
+          inInc = -1;
3791 3805
         }
3792 3806
 
3793 3807
         zig = !zig;
3794 3808
 
3795
-        for (int8_t xCount = xStart; xCount != xStop; xCount += xInc) {
3796
-          float xBase = left_probe_bed_position + xGridSpacing * xCount;
3809
+        for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) {
3810
+
3811
+          float xBase = left_probe_bed_position + xGridSpacing * xCount,
3812
+                yBase = front_probe_bed_position + yGridSpacing * yCount;
3813
+
3797 3814
           xProbe = floor(xBase + (xBase < 0 ? 0 : 0.5));
3815
+          yProbe = floor(yBase + (yBase < 0 ? 0 : 0.5));
3798 3816
 
3799 3817
           #if ENABLED(AUTO_BED_LEVELING_LINEAR)
3800 3818
             indexIntoAB[xCount][yCount] = ++probePointCounter;

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

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

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

@@ -772,6 +772,9 @@
772 772
   // The Z probe minimum outer margin (to validate G29 parameters).
773 773
   #define MIN_PROBE_EDGE 10
774 774
 
775
+  // Probe along the Y axis, advancing X after each column
776
+  //#define PROBE_Y_FIRST
777
+
775 778
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
776 779
 
777 780
   // 3 arbitrary points to probe.

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

@@ -770,6 +770,9 @@
770 770
   // The Z probe minimum outer margin (to validate G29 parameters).
771 771
   #define MIN_PROBE_EDGE 10
772 772
 
773
+  // Probe along the Y axis, advancing X after each column
774
+  //#define PROBE_Y_FIRST
775
+
773 776
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
774 777
 
775 778
   // 3 arbitrary points to probe.

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

@@ -781,6 +781,9 @@
781 781
   // The Z probe minimum outer margin (to validate G29 parameters).
782 782
   #define MIN_PROBE_EDGE 10
783 783
 
784
+  // Probe along the Y axis, advancing X after each column
785
+  //#define PROBE_Y_FIRST
786
+
784 787
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
785 788
 
786 789
   // 3 arbitrary points to probe.

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

@@ -783,6 +783,9 @@
783 783
   // The Z probe minimum outer margin (to validate G29 parameters).
784 784
   #define MIN_PROBE_EDGE 10
785 785
 
786
+  // Probe along the Y axis, advancing X after each column
787
+  //#define PROBE_Y_FIRST
788
+
786 789
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
787 790
 
788 791
   // 3 arbitrary points to probe.

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

@@ -806,6 +806,9 @@
806 806
   // The Z probe minimum outer margin (to validate G29 parameters).
807 807
   #define MIN_PROBE_EDGE 10
808 808
 
809
+  // Probe along the Y axis, advancing X after each column
810
+  //#define PROBE_Y_FIRST
811
+
809 812
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
810 813
 
811 814
   // 3 arbitrary points to probe.

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

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

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

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

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

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

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

@@ -787,6 +787,9 @@
787 787
   // The Z probe minimum outer margin (to validate G29 parameters).
788 788
   #define MIN_PROBE_EDGE 10
789 789
 
790
+  // Probe along the Y axis, advancing X after each column
791
+  //#define PROBE_Y_FIRST
792
+
790 793
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
791 794
 
792 795
   // 3 arbitrary points to probe.

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

@@ -804,6 +804,9 @@
804 804
   // The Z probe minimum outer margin (to validate G29 parameters).
805 805
   #define MIN_PROBE_EDGE 10
806 806
 
807
+  // Probe along the Y axis, advancing X after each column
808
+  //#define PROBE_Y_FIRST
809
+
807 810
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
808 811
 
809 812
   // 3 arbitrary points to probe.

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

@@ -810,6 +810,9 @@
810 810
   // The Z probe minimum outer margin (to validate G29 parameters).
811 811
   #define MIN_PROBE_EDGE 10
812 812
 
813
+  // Probe along the Y axis, advancing X after each column
814
+  //#define PROBE_Y_FIRST
815
+
813 816
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
814 817
 
815 818
   // 3 arbitrary points to probe.

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

@@ -781,6 +781,9 @@
781 781
   // The Z probe minimum outer margin (to validate G29 parameters).
782 782
   #define MIN_PROBE_EDGE 10
783 783
 
784
+  // Probe along the Y axis, advancing X after each column
785
+  //#define PROBE_Y_FIRST
786
+
784 787
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
785 788
 
786 789
   // 3 arbitrary points to probe.

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

@@ -789,6 +789,9 @@
789 789
   // The Z probe minimum outer margin (to validate G29 parameters).
790 790
   #define MIN_PROBE_EDGE 10
791 791
 
792
+  // Probe along the Y axis, advancing X after each column
793
+  //#define PROBE_Y_FIRST
794
+
792 795
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
793 796
 
794 797
   // 3 arbitrary points to probe.

+ 3
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h View File

@@ -881,6 +881,9 @@
881 881
   // The Z probe minimum outer margin (to validate G29 parameters).
882 882
   #define MIN_PROBE_EDGE 10
883 883
 
884
+  // Probe along the Y axis, advancing X after each column
885
+  //#define PROBE_Y_FIRST
886
+
884 887
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
885 888
 
886 889
   // 3 arbitrary points to probe.

+ 3
- 0
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -875,6 +875,9 @@
875 875
   // The Z probe minimum outer margin (to validate G29 parameters).
876 876
   #define MIN_PROBE_EDGE 10
877 877
 
878
+  // Probe along the Y axis, advancing X after each column
879
+  //#define PROBE_Y_FIRST
880
+
878 881
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
879 882
 
880 883
   // 3 arbitrary points to probe.

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

@@ -878,6 +878,9 @@
878 878
   // The Z probe minimum outer margin (to validate G29 parameters).
879 879
   #define MIN_PROBE_EDGE 10
880 880
 
881
+  // Probe along the Y axis, advancing X after each column
882
+  //#define PROBE_Y_FIRST
883
+
881 884
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
882 885
 
883 886
   // 3 arbitrary points to probe.

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

@@ -879,6 +879,9 @@
879 879
   // The Z probe minimum outer margin (to validate G29 parameters).
880 880
   #define MIN_PROBE_EDGE 10
881 881
 
882
+  // Probe along the Y axis, advancing X after each column
883
+  //#define PROBE_Y_FIRST
884
+
882 885
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
883 886
 
884 887
   // 3 arbitrary points to probe.

+ 3
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -881,6 +881,9 @@
881 881
   // The Z probe minimum outer margin (to validate G29 parameters).
882 882
   #define MIN_PROBE_EDGE 10
883 883
 
884
+  // Probe along the Y axis, advancing X after each column
885
+  //#define PROBE_Y_FIRST
886
+
884 887
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
885 888
 
886 889
   // 3 arbitrary points to probe.

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

@@ -792,6 +792,9 @@
792 792
   // The Z probe minimum outer margin (to validate G29 parameters).
793 793
   #define MIN_PROBE_EDGE 10
794 794
 
795
+  // Probe along the Y axis, advancing X after each column
796
+  //#define PROBE_Y_FIRST
797
+
795 798
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
796 799
 
797 800
   // 3 arbitrary points to probe.

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

@@ -785,6 +785,9 @@
785 785
   // The Z probe minimum outer margin (to validate G29 parameters).
786 786
   #define MIN_PROBE_EDGE 10
787 787
 
788
+  // Probe along the Y axis, advancing X after each column
789
+  //#define PROBE_Y_FIRST
790
+
788 791
 #elif ENABLED(AUTO_BED_LEVELING_3POINT)
789 792
 
790 793
   // 3 arbitrary points to probe.

Loading…
Cancel
Save