Add PROBE_Y_FIRST option for probe order

This commit is contained in:
Scott Lahteine 2016-09-29 01:19:59 -05:00
parent c8c57e59fc
commit 2d2c9bdf92
23 changed files with 97 additions and 13 deletions

View file

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

View file

@ -3771,30 +3771,48 @@ inline void gcode_G28() {
#endif // AUTO_BED_LEVELING_LINEAR #endif // AUTO_BED_LEVELING_LINEAR
bool zig = abl_grid_points_y & 1; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION] #if ENABLED(PROBE_Y_FIRST)
#define PR_OUTER_VAR xCount
#define PR_OUTER_END abl_grid_points_x
#define PR_INNER_VAR yCount
#define PR_INNER_END abl_grid_points_y
#else
#define PR_OUTER_VAR yCount
#define PR_OUTER_END abl_grid_points_y
#define PR_INNER_VAR xCount
#define PR_INNER_END abl_grid_points_x
#endif
for (uint8_t yCount = 0; yCount < abl_grid_points_y; yCount++) { #if ENABLED(MAKERARM_SCARA)
float yBase = front_probe_bed_position + yGridSpacing * yCount; bool zig = true;
yProbe = floor(yBase + (yBase < 0 ? 0 : 0.5)); #else
bool zig = PR_OUTER_END & 1; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
#endif
int8_t xStart, xStop, xInc; for (uint8_t PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_END; PR_OUTER_VAR++) {
int8_t inStart, inStop, inInc;
if (zig) { if (zig) {
xStart = 0; inStart = 0;
xStop = abl_grid_points_x; inStop = PR_INNER_END;
xInc = 1; inInc = 1;
} }
else { else {
xStart = abl_grid_points_x - 1; inStart = PR_INNER_END - 1;
xStop = -1; inStop = -1;
xInc = -1; inInc = -1;
} }
zig = !zig; zig = !zig;
for (int8_t xCount = xStart; xCount != xStop; xCount += xInc) { for (int8_t PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; PR_INNER_VAR += inInc) {
float xBase = left_probe_bed_position + xGridSpacing * xCount;
float xBase = left_probe_bed_position + xGridSpacing * xCount,
yBase = front_probe_bed_position + yGridSpacing * yCount;
xProbe = floor(xBase + (xBase < 0 ? 0 : 0.5)); xProbe = floor(xBase + (xBase < 0 ? 0 : 0.5));
yProbe = floor(yBase + (yBase < 0 ? 0 : 0.5));
#if ENABLED(AUTO_BED_LEVELING_LINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR)
indexIntoAB[xCount][yCount] = ++probePointCounter; indexIntoAB[xCount][yCount] = ++probePointCounter;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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