Use same config name for all mesh dimensions

master
Scott Lahteine 8 years ago committed by Bob-the-Kuhn
parent c961dd084d
commit d13991ae18

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -293,22 +293,22 @@
end_angle = 90.0; end_angle = 90.0;
if (yi == 0) // it is an edge, check for the two left corners if (yi == 0) // it is an edge, check for the two left corners
start_angle = 0.0; start_angle = 0.0;
else if (yi == UBL_MESH_NUM_Y_POINTS - 1) else if (yi == GRID_MAX_POINTS_Y - 1)
end_angle = 0.0; end_angle = 0.0;
} }
else if (xi == UBL_MESH_NUM_X_POINTS - 1) { // Check for top edge else if (xi == GRID_MAX_POINTS_X - 1) { // Check for top edge
start_angle = 90.0; start_angle = 90.0;
end_angle = 270.0; end_angle = 270.0;
if (yi == 0) // it is an edge, check for the two right corners if (yi == 0) // it is an edge, check for the two right corners
end_angle = 180.0; end_angle = 180.0;
else if (yi == UBL_MESH_NUM_Y_POINTS - 1) else if (yi == GRID_MAX_POINTS_Y - 1)
start_angle = 180.0; start_angle = 180.0;
} }
else if (yi == 0) { else if (yi == 0) {
start_angle = 0.0; // only do the top side of the cirlce start_angle = 0.0; // only do the top side of the cirlce
end_angle = 180.0; end_angle = 180.0;
} }
else if (yi == UBL_MESH_NUM_Y_POINTS - 1) { else if (yi == GRID_MAX_POINTS_Y - 1) {
start_angle = 180.0; // only do the bottom side of the cirlce start_angle = 180.0; // only do the bottom side of the cirlce
end_angle = 360.0; end_angle = 360.0;
} }
@ -397,8 +397,8 @@
return_val.x_index = return_val.y_index = -1; return_val.x_index = return_val.y_index = -1;
for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
if (!is_bit_set(circle_flags, i, j)) { if (!is_bit_set(circle_flags, i, j)) {
const float mx = ubl.mesh_index_to_xpos[i], // We found a circle that needs to be printed const float mx = ubl.mesh_index_to_xpos[i], // We found a circle that needs to be printed
my = ubl.mesh_index_to_ypos[j]; my = ubl.mesh_index_to_ypos[j];
@ -432,10 +432,10 @@
void look_for_lines_to_connect() { void look_for_lines_to_connect() {
float sx, sy, ex, ey; float sx, sy, ex, ey;
for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
if (i < UBL_MESH_NUM_X_POINTS) { // We can't connect to anything to the right than UBL_MESH_NUM_X_POINTS. if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X.
// This is already a half circle because we are at the edge of the bed. // This is already a half circle because we are at the edge of the bed.
if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i + 1, j)) { // check if we can do a line to the left if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i + 1, j)) { // check if we can do a line to the left
@ -467,7 +467,7 @@
} }
} }
if (j < UBL_MESH_NUM_Y_POINTS) { // We can't connect to anything further back than UBL_MESH_NUM_Y_POINTS. if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y.
// This is already a half circle because we are at the edge of the bed. // This is already a half circle because we are at the edge of the bed.
if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i, j + 1)) { // check if we can do a line straight down if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i, j + 1)) { // check if we can do a line straight down

@ -283,7 +283,7 @@ float code_value_temp_diff();
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
extern int bilinear_grid_spacing[2], bilinear_start[2]; extern int bilinear_grid_spacing[2], bilinear_start[2];
extern float bed_level_grid[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; extern float bed_level_grid[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
float bilinear_z_offset(float logical[XYZ]); float bilinear_z_offset(float logical[XYZ]);
void set_bed_leveling_enabled(bool enable=true); void set_bed_leveling_enabled(bool enable=true);
#endif #endif

@ -589,7 +589,7 @@ static uint8_t target_extruder;
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
int bilinear_grid_spacing[2], bilinear_start[2]; int bilinear_grid_spacing[2], bilinear_start[2];
float bed_level_grid[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; float bed_level_grid[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
#endif #endif
#if IS_SCARA #if IS_SCARA
@ -2341,8 +2341,8 @@ static void clean_up_after_endstop_or_probe_move() {
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] =
bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0;
for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
bed_level_grid[x][y] = NAN; bed_level_grid[x][y] = NAN;
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
ubl.reset(); ubl.reset();
@ -2473,9 +2473,9 @@ static void clean_up_after_endstop_or_probe_move() {
//#define EXTRAPOLATE_FROM_EDGE //#define EXTRAPOLATE_FROM_EDGE
#if ENABLED(EXTRAPOLATE_FROM_EDGE) #if ENABLED(EXTRAPOLATE_FROM_EDGE)
#if ABL_GRID_MAX_POINTS_X < ABL_GRID_MAX_POINTS_Y #if GRID_MAX_POINTS_X < GRID_MAX_POINTS_Y
#define HALF_IN_X #define HALF_IN_X
#elif ABL_GRID_MAX_POINTS_Y < ABL_GRID_MAX_POINTS_X #elif GRID_MAX_POINTS_Y < GRID_MAX_POINTS_X
#define HALF_IN_Y #define HALF_IN_Y
#endif #endif
#endif #endif
@ -2486,18 +2486,18 @@ static void clean_up_after_endstop_or_probe_move() {
*/ */
static void extrapolate_unprobed_bed_level() { static void extrapolate_unprobed_bed_level() {
#ifdef HALF_IN_X #ifdef HALF_IN_X
const uint8_t ctrx2 = 0, xlen = ABL_GRID_MAX_POINTS_X - 1; const uint8_t ctrx2 = 0, xlen = GRID_MAX_POINTS_X - 1;
#else #else
const uint8_t ctrx1 = (ABL_GRID_MAX_POINTS_X - 1) / 2, // left-of-center const uint8_t ctrx1 = (GRID_MAX_POINTS_X - 1) / 2, // left-of-center
ctrx2 = ABL_GRID_MAX_POINTS_X / 2, // right-of-center ctrx2 = GRID_MAX_POINTS_X / 2, // right-of-center
xlen = ctrx1; xlen = ctrx1;
#endif #endif
#ifdef HALF_IN_Y #ifdef HALF_IN_Y
const uint8_t ctry2 = 0, ylen = ABL_GRID_MAX_POINTS_Y - 1; const uint8_t ctry2 = 0, ylen = GRID_MAX_POINTS_Y - 1;
#else #else
const uint8_t ctry1 = (ABL_GRID_MAX_POINTS_Y - 1) / 2, // top-of-center const uint8_t ctry1 = (GRID_MAX_POINTS_Y - 1) / 2, // top-of-center
ctry2 = ABL_GRID_MAX_POINTS_Y / 2, // bottom-of-center ctry2 = GRID_MAX_POINTS_Y / 2, // bottom-of-center
ylen = ctry1; ylen = ctry1;
#endif #endif
@ -2524,17 +2524,17 @@ static void clean_up_after_endstop_or_probe_move() {
static void print_bilinear_leveling_grid() { static void print_bilinear_leveling_grid() {
SERIAL_ECHOLNPGM("Bilinear Leveling Grid:"); SERIAL_ECHOLNPGM("Bilinear Leveling Grid:");
print_2d_array(ABL_GRID_MAX_POINTS_X, ABL_GRID_MAX_POINTS_Y, 3, print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3,
[](const uint8_t ix, const uint8_t iy) { return bed_level_grid[ix][iy]; } [](const uint8_t ix, const uint8_t iy) { return bed_level_grid[ix][iy]; }
); );
} }
#if ENABLED(ABL_BILINEAR_SUBDIVISION) #if ENABLED(ABL_BILINEAR_SUBDIVISION)
#define ABL_GRID_POINTS_VIRT_X (ABL_GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 #define ABL_GRID_POINTS_VIRT_X (GRID_MAX_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1
#define ABL_GRID_POINTS_VIRT_Y (ABL_GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 #define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1
#define ABL_TEMP_POINTS_X (ABL_GRID_MAX_POINTS_X + 2) #define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2)
#define ABL_TEMP_POINTS_Y (ABL_GRID_MAX_POINTS_Y + 2) #define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2)
float bed_level_grid_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; float bed_level_grid_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y];
int bilinear_grid_spacing_virt[2] = { 0 }; int bilinear_grid_spacing_virt[2] = { 0 };
@ -2550,8 +2550,8 @@ static void clean_up_after_endstop_or_probe_move() {
uint8_t ep = 0, ip = 1; uint8_t ep = 0, ip = 1;
if (!x || x == ABL_TEMP_POINTS_X - 1) { if (!x || x == ABL_TEMP_POINTS_X - 1) {
if (x) { if (x) {
ep = ABL_GRID_MAX_POINTS_X - 1; ep = GRID_MAX_POINTS_X - 1;
ip = ABL_GRID_MAX_POINTS_X - 2; ip = GRID_MAX_POINTS_X - 2;
} }
if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2)) if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2))
return LINEAR_EXTRAPOLATION( return LINEAR_EXTRAPOLATION(
@ -2566,8 +2566,8 @@ static void clean_up_after_endstop_or_probe_move() {
} }
if (!y || y == ABL_TEMP_POINTS_Y - 1) { if (!y || y == ABL_TEMP_POINTS_Y - 1) {
if (y) { if (y) {
ep = ABL_GRID_MAX_POINTS_Y - 1; ep = GRID_MAX_POINTS_Y - 1;
ip = ABL_GRID_MAX_POINTS_Y - 2; ip = GRID_MAX_POINTS_Y - 2;
} }
if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2)) if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2))
return LINEAR_EXTRAPOLATION( return LINEAR_EXTRAPOLATION(
@ -2604,11 +2604,11 @@ static void clean_up_after_endstop_or_probe_move() {
} }
void bed_level_virt_interpolate() { void bed_level_virt_interpolate() {
for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++)
for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) {
if ((ty && y == ABL_GRID_MAX_POINTS_Y - 1) || (tx && x == ABL_GRID_MAX_POINTS_X - 1)) if ((ty && y == GRID_MAX_POINTS_Y - 1) || (tx && x == GRID_MAX_POINTS_X - 1))
continue; continue;
bed_level_grid_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = bed_level_grid_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] =
bed_level_virt_2cmr( bed_level_virt_2cmr(
@ -3752,10 +3752,10 @@ inline void gcode_G28() {
void say_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); } void say_not_entered() { SERIAL_PROTOCOLLNPGM(" not entered."); }
void mbl_mesh_report() { void mbl_mesh_report() {
SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y));
SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5); SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
SERIAL_PROTOCOLLNPGM("\nMeasured points:"); SERIAL_PROTOCOLLNPGM("\nMeasured points:");
print_2d_array(MESH_NUM_X_POINTS, MESH_NUM_Y_POINTS, 5, print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
[](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; } [](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; }
); );
} }
@ -3832,7 +3832,7 @@ inline void gcode_G28() {
#endif #endif
} }
// If there's another point to sample, move there with optional lift. // If there's another point to sample, move there with optional lift.
if (mbl_probe_index < (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) { if (mbl_probe_index < (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) {
mbl.zigzag(mbl_probe_index, px, py); mbl.zigzag(mbl_probe_index, px, py);
_manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
@ -3864,8 +3864,8 @@ inline void gcode_G28() {
case MeshSet: case MeshSet:
if (code_seen('X')) { if (code_seen('X')) {
px = code_value_int() - 1; px = code_value_int() - 1;
if (!WITHIN(px, 0, MESH_NUM_X_POINTS - 1)) { if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) {
SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ")."); SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(GRID_MAX_POINTS_X) ").");
return; return;
} }
} }
@ -3876,8 +3876,8 @@ inline void gcode_G28() {
if (code_seen('Y')) { if (code_seen('Y')) {
py = code_value_int() - 1; py = code_value_int() - 1;
if (!WITHIN(py, 0, MESH_NUM_Y_POINTS - 1)) { if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ")."); SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(GRID_MAX_POINTS_Y) ").");
return; return;
} }
} }
@ -4034,16 +4034,16 @@ inline void gcode_G28() {
ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position; ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position;
ABL_VAR float xGridSpacing, yGridSpacing; ABL_VAR float xGridSpacing, yGridSpacing;
#define ABL_GRID_MAX (ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) #define ABL_GRID_MAX (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)
#if ABL_PLANAR #if ABL_PLANAR
ABL_VAR uint8_t abl_grid_points_x = ABL_GRID_MAX_POINTS_X, ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X,
abl_grid_points_y = ABL_GRID_MAX_POINTS_Y; abl_grid_points_y = GRID_MAX_POINTS_Y;
ABL_VAR int abl2; ABL_VAR int abl2;
ABL_VAR bool do_topography_map; ABL_VAR bool do_topography_map;
#else // 3-point #else // 3-point
uint8_t constexpr abl_grid_points_x = ABL_GRID_MAX_POINTS_X, uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X,
abl_grid_points_y = ABL_GRID_MAX_POINTS_Y; abl_grid_points_y = GRID_MAX_POINTS_Y;
int constexpr abl2 = ABL_GRID_MAX; int constexpr abl2 = ABL_GRID_MAX;
#endif #endif
@ -4054,7 +4054,7 @@ inline void gcode_G28() {
#elif ENABLED(AUTO_BED_LEVELING_LINEAR) #elif ENABLED(AUTO_BED_LEVELING_LINEAR)
ABL_VAR int indexIntoAB[ABL_GRID_MAX_POINTS_X][ABL_GRID_MAX_POINTS_Y]; ABL_VAR int indexIntoAB[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
ABL_VAR float eqnAMatrix[ABL_GRID_MAX * 3], // "A" matrix of the linear system of equations ABL_VAR float eqnAMatrix[ABL_GRID_MAX * 3], // "A" matrix of the linear system of equations
eqnBVector[ABL_GRID_MAX], // "B" vector of Z points eqnBVector[ABL_GRID_MAX], // "B" vector of Z points
@ -4105,10 +4105,10 @@ inline void gcode_G28() {
// Get nearest i / j from x / y // Get nearest i / j from x / y
i = (x - LOGICAL_X_POSITION(bilinear_start[X_AXIS]) + 0.5 * xGridSpacing) / xGridSpacing; i = (x - LOGICAL_X_POSITION(bilinear_start[X_AXIS]) + 0.5 * xGridSpacing) / xGridSpacing;
j = (y - LOGICAL_Y_POSITION(bilinear_start[Y_AXIS]) + 0.5 * yGridSpacing) / yGridSpacing; j = (y - LOGICAL_Y_POSITION(bilinear_start[Y_AXIS]) + 0.5 * yGridSpacing) / yGridSpacing;
i = constrain(i, 0, ABL_GRID_MAX_POINTS_X - 1); i = constrain(i, 0, GRID_MAX_POINTS_X - 1);
j = constrain(j, 0, ABL_GRID_MAX_POINTS_Y - 1); j = constrain(j, 0, GRID_MAX_POINTS_Y - 1);
} }
if (WITHIN(i, 0, ABL_GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, ABL_GRID_MAX_POINTS_Y)) { if (WITHIN(i, 0, GRID_MAX_POINTS_X - 1) && WITHIN(j, 0, GRID_MAX_POINTS_Y)) {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
bed_level_grid[i][j] = z; bed_level_grid[i][j] = z;
#if ENABLED(ABL_BILINEAR_SUBDIVISION) #if ENABLED(ABL_BILINEAR_SUBDIVISION)
@ -4145,8 +4145,8 @@ inline void gcode_G28() {
// X and Y specify points in each direction, overriding the default // X and Y specify points in each direction, overriding the default
// These values may be saved with the completed mesh // These values may be saved with the completed mesh
abl_grid_points_x = code_seen('X') ? code_value_int() : ABL_GRID_MAX_POINTS_X; abl_grid_points_x = code_seen('X') ? code_value_int() : GRID_MAX_POINTS_X;
abl_grid_points_y = code_seen('Y') ? code_value_int() : ABL_GRID_MAX_POINTS_Y; abl_grid_points_y = code_seen('Y') ? code_value_int() : GRID_MAX_POINTS_Y;
if (code_seen('P')) abl_grid_points_x = abl_grid_points_y = code_value_int(); if (code_seen('P')) abl_grid_points_x = abl_grid_points_y = code_value_int();
if (abl_grid_points_x < 2 || abl_grid_points_y < 2) { if (abl_grid_points_x < 2 || abl_grid_points_y < 2) {
@ -7627,7 +7627,7 @@ void quickstop_stepper() {
} }
} }
else if (hasI && hasJ && hasZ) { else if (hasI && hasJ && hasZ) {
if (WITHIN(px, 0, MESH_NUM_X_POINTS - 1) && WITHIN(py, 0, MESH_NUM_Y_POINTS - 1)) if (WITHIN(px, 0, GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, GRID_MAX_POINTS_Y - 1))
mbl.set_z(px, py, z); mbl.set_z(px, py, z);
else { else {
SERIAL_ERROR_START; SERIAL_ERROR_START;
@ -7656,7 +7656,7 @@ void quickstop_stepper() {
if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS); if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
if (hasI && hasJ && hasZ) { if (hasI && hasJ && hasZ) {
if (WITHIN(px, 0, ABL_GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, ABL_GRID_MAX_POINTS_X - 1)) { if (WITHIN(px, 0, GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, GRID_MAX_POINTS_X - 1)) {
bed_level_grid[px][py] = z; bed_level_grid[px][py] = z;
#if ENABLED(ABL_BILINEAR_SUBDIVISION) #if ENABLED(ABL_BILINEAR_SUBDIVISION)
bed_level_virt_interpolate(); bed_level_virt_interpolate();
@ -7687,7 +7687,7 @@ void quickstop_stepper() {
if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS); if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
if (hasI && hasJ && hasZ) { if (hasI && hasJ && hasZ) {
if (WITHIN(px, 0, UBL_MESH_NUM_Y_POINTS - 1) && WITHIN(py, 0, UBL_MESH_NUM_Y_POINTS - 1)) { if (WITHIN(px, 0, GRID_MAX_POINTS_Y - 1) && WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) {
ubl.z_values[px][py] = z; ubl.z_values[px][py] = z;
} }
else { else {
@ -7801,8 +7801,8 @@ inline void gcode_M503() {
// Correct bilinear grid for new probe offset // Correct bilinear grid for new probe offset
const float diff = value - zprobe_zoffset; const float diff = value - zprobe_zoffset;
if (diff) { if (diff) {
for (uint8_t x = 0; x < ABL_GRID_MAX_POINTS_X; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < ABL_GRID_MAX_POINTS_Y; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
bed_level_grid[x][y] += diff; bed_level_grid[x][y] += diff;
} }
#if ENABLED(ABL_BILINEAR_SUBDIVISION) #if ENABLED(ABL_BILINEAR_SUBDIVISION)
@ -9661,8 +9661,8 @@ void ok_to_send() {
#define ABL_BG_GRID(X,Y) bed_level_grid_virt[X][Y] #define ABL_BG_GRID(X,Y) bed_level_grid_virt[X][Y]
#else #else
#define ABL_BG_SPACING(A) bilinear_grid_spacing[A] #define ABL_BG_SPACING(A) bilinear_grid_spacing[A]
#define ABL_BG_POINTS_X ABL_GRID_MAX_POINTS_X #define ABL_BG_POINTS_X GRID_MAX_POINTS_X
#define ABL_BG_POINTS_Y ABL_GRID_MAX_POINTS_Y #define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y
#define ABL_BG_GRID(X,Y) bed_level_grid[X][Y] #define ABL_BG_GRID(X,Y) bed_level_grid[X][Y]
#endif #endif
@ -9989,10 +9989,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)),
cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])), cx2 = mbl.cell_index_x(RAW_X_POSITION(destination[X_AXIS])),
cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS])); cy2 = mbl.cell_index_y(RAW_Y_POSITION(destination[Y_AXIS]));
NOMORE(cx1, MESH_NUM_X_POINTS - 2); NOMORE(cx1, GRID_MAX_POINTS_X - 2);
NOMORE(cy1, MESH_NUM_Y_POINTS - 2); NOMORE(cy1, GRID_MAX_POINTS_Y - 2);
NOMORE(cx2, MESH_NUM_X_POINTS - 2); NOMORE(cx2, GRID_MAX_POINTS_X - 2);
NOMORE(cy2, MESH_NUM_Y_POINTS - 2); NOMORE(cy2, GRID_MAX_POINTS_Y - 2);
if (cx1 == cx2 && cy1 == cy2) { if (cx1 == cx2 && cy1 == cy2) {
// Start and end on same mesh square // Start and end on same mesh square

@ -147,9 +147,15 @@
#elif defined(AUTO_BED_LEVELING_FEATURE) #elif defined(AUTO_BED_LEVELING_FEATURE)
#error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT." #error "AUTO_BED_LEVELING_FEATURE is deprecated. Specify AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_3POINT."
#elif defined(ABL_GRID_POINTS) #elif defined(ABL_GRID_POINTS)
#error "ABL_GRID_POINTS is now ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y. Please update your configuration." #error "ABL_GRID_POINTS is now GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y. Please update your configuration."
#elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y) #elif defined(ABL_GRID_POINTS_X) || defined(ABL_GRID_POINTS_Y)
#error "ABL_GRID_POINTS_[XY] is now ABL_GRID_MAX_POINTS_[XY]. Please update your configuration." #error "ABL_GRID_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
#elif defined(ABL_GRID_MAX_POINTS_X) || defined(ABL_GRID_MAX_POINTS_Y)
#error "ABL_GRID_MAX_POINTS_[XY] is now GRID_MAX_POINTS_[XY]. Please update your configuration."
#elif defined(MESH_NUM_X_POINTS) || defined(MESH_NUM_Y_POINTS)
#error "MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
#elif defined(UBL_MESH_NUM_X_POINTS) || defined(UBL_MESH_NUM_Y_POINTS)
#error "UBL_MESH_NUM_[XY]_POINTS is now GRID_MAX_POINTS_[XY]. Please update your configuration."
#elif defined(UBL_MESH_EDIT_ENABLED) #elif defined(UBL_MESH_EDIT_ENABLED)
#error "UBL_MESH_EDIT_ENABLED is now UBL_G26_MESH_EDITING. Please update your configuration." #error "UBL_MESH_EDIT_ENABLED is now UBL_G26_MESH_EDITING. Please update your configuration."
#elif defined(BEEPER) #elif defined(BEEPER)
@ -242,10 +248,10 @@
#error "DELTA is incompatible with ENABLE_LEVELING_FADE_HEIGHT. Please disable it." #error "DELTA is incompatible with ENABLE_LEVELING_FADE_HEIGHT. Please disable it."
#endif #endif
#if ABL_GRID #if ABL_GRID
#if (ABL_GRID_MAX_POINTS_X & 1) == 0 || (ABL_GRID_MAX_POINTS_Y & 1) == 0 #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0
#error "DELTA requires ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y to be odd numbers." #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be odd numbers."
#elif ABL_GRID_MAX_POINTS_X < 3 #elif GRID_MAX_POINTS_X < 3
#error "DELTA requires ABL_GRID_MAX_POINTS_X and ABL_GRID_MAX_POINTS_Y to be 3 or higher." #error "DELTA requires GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y to be 3 or higher."
#endif #endif
#endif #endif
#endif #endif
@ -411,8 +417,8 @@ static_assert(1 >= 0
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
#if ENABLED(DELTA) #if ENABLED(DELTA)
#error "MESH_BED_LEVELING does not yet support DELTA printers." #error "MESH_BED_LEVELING does not yet support DELTA printers."
#elif MESH_NUM_X_POINTS > 9 || MESH_NUM_Y_POINTS > 9 #elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
#error "MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS must be less than 10." #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
#endif #endif
#endif #endif
@ -424,8 +430,6 @@ static_assert(1 >= 0
#error "AUTO_BED_LEVELING_UBL does not yet support DELTA printers." #error "AUTO_BED_LEVELING_UBL does not yet support DELTA printers."
#elif DISABLED(NEWPANEL) #elif DISABLED(NEWPANEL)
#error "AUTO_BED_LEVELING_UBL requires an LCD controller." #error "AUTO_BED_LEVELING_UBL requires an LCD controller."
#elif UBL_MESH_NUM_X_POINTS > 15 || UBL_MESH_NUM_Y_POINTS > 15
#error "UBL_MESH_NUM_X_POINTS and UBL_MESH_NUM_Y_POINTS must be less than 16."
#endif #endif
#endif #endif
@ -602,8 +606,8 @@ static_assert(1 >= 0
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
#if DISABLED(EEPROM_SETTINGS) #if DISABLED(EEPROM_SETTINGS)
#error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration." #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS. Please update your configuration."
#elif !WITHIN(UBL_MESH_NUM_X_POINTS, 3, 15) || !WITHIN(UBL_MESH_NUM_Y_POINTS, 3, 15) #elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
#error "UBL_MESH_NUM_[XY]_POINTS must be a whole number between 3 and 15." #error "GRID_MAX_POINTS_[XY] must be a whole number between 3 and 15."
#elif !WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X) #elif !WITHIN(UBL_PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X)
#error "The given UBL_PROBE_PT_1_X can't be reached by the Z probe." #error "The given UBL_PROBE_PT_1_X can't be reached by the Z probe."
#elif !WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X) #elif !WITHIN(UBL_PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X)

@ -78,15 +78,15 @@
enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 }; enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_ACTIVE_BIT = 1 };
#define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(UBL_MESH_NUM_X_POINTS - 1)) #define MESH_X_DIST (float(UBL_MESH_MAX_X - (UBL_MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1))
#define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(UBL_MESH_NUM_Y_POINTS - 1)) #define MESH_Y_DIST (float(UBL_MESH_MAX_Y - (UBL_MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1))
typedef struct { typedef struct {
bool active = false; bool active = false;
float z_offset = 0.0; float z_offset = 0.0;
int8_t eeprom_storage_slot = -1, int8_t eeprom_storage_slot = -1,
n_x = UBL_MESH_NUM_X_POINTS, n_x = GRID_MAX_POINTS_X,
n_y = UBL_MESH_NUM_Y_POINTS; n_y = GRID_MAX_POINTS_Y;
float mesh_x_min = UBL_MESH_MIN_X, float mesh_x_min = UBL_MESH_MIN_X,
mesh_y_min = UBL_MESH_MIN_Y, mesh_y_min = UBL_MESH_MIN_Y,
@ -122,9 +122,9 @@
static ubl_state state, pre_initialized; static ubl_state state, pre_initialized;
static float z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS], static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y],
mesh_index_to_xpos[UBL_MESH_NUM_X_POINTS + 1], // +1 safety margin for now, until determinism prevails mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails
mesh_index_to_ypos[UBL_MESH_NUM_Y_POINTS + 1]; mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1];
static bool g26_debug_flag, static bool g26_debug_flag,
has_control_of_lcd_panel; has_control_of_lcd_panel;
@ -151,14 +151,14 @@
static int8_t get_cell_index_x(const float &x) { static int8_t get_cell_index_x(const float &x) {
const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST));
return constrain(cx, 0, (UBL_MESH_NUM_X_POINTS) - 1); // -1 is appropriate if we want all movement to the X_MAX return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX
} // position. But with this defined this way, it is possible } // position. But with this defined this way, it is possible
// to extrapolate off of this point even further out. Probably // to extrapolate off of this point even further out. Probably
// that is OK because something else should be keeping that from // that is OK because something else should be keeping that from
// happening and should not be worried about at this level. // happening and should not be worried about at this level.
static int8_t get_cell_index_y(const float &y) { static int8_t get_cell_index_y(const float &y) {
const int8_t cy = (y - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); const int8_t cy = (y - (UBL_MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST));
return constrain(cy, 0, (UBL_MESH_NUM_Y_POINTS) - 1); // -1 is appropriate if we want all movement to the Y_MAX return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX
} // position. But with this defined this way, it is possible } // position. But with this defined this way, it is possible
// to extrapolate off of this point even further out. Probably // to extrapolate off of this point even further out. Probably
// that is OK because something else should be keeping that from // that is OK because something else should be keeping that from
@ -166,12 +166,12 @@
static int8_t find_closest_x_index(const float &x) { static int8_t find_closest_x_index(const float &x) {
const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST)); const int8_t px = (x - (UBL_MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0 / (MESH_X_DIST));
return WITHIN(px, 0, UBL_MESH_NUM_X_POINTS - 1) ? px : -1; return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
} }
static int8_t find_closest_y_index(const float &y) { static int8_t find_closest_y_index(const float &y) {
const int8_t py = (y - (UBL_MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST)); const int8_t py = (y - (UBL_MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0 / (MESH_Y_DIST));
return WITHIN(py, 0, UBL_MESH_NUM_Y_POINTS - 1) ? py : -1; return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1;
} }
/** /**
@ -198,7 +198,7 @@
* the rare occasion when a point lies exactly on a Mesh line (denoted by index yi). * the rare occasion when a point lies exactly on a Mesh line (denoted by index yi).
*/ */
static inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) { static inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) {
if (!WITHIN(x1_i, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(yi, 0, UBL_MESH_NUM_Y_POINTS - 1)) { if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0); SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0);
SERIAL_ECHOPAIR(",x1_i=", x1_i); SERIAL_ECHOPAIR(",x1_i=", x1_i);
SERIAL_ECHOPAIR(",yi=", yi); SERIAL_ECHOPAIR(",yi=", yi);
@ -217,7 +217,7 @@
// See comments above for z_correction_for_x_on_horizontal_mesh_line // See comments above for z_correction_for_x_on_horizontal_mesh_line
// //
static inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) { static inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) {
if (!WITHIN(xi, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(y1_i, 0, UBL_MESH_NUM_Y_POINTS - 1)) { if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0); SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0);
SERIAL_ECHOPAIR(", x1_i=", xi); SERIAL_ECHOPAIR(", x1_i=", xi);
SERIAL_ECHOPAIR(", yi=", y1_i); SERIAL_ECHOPAIR(", yi=", y1_i);
@ -242,7 +242,7 @@
const int8_t cx = get_cell_index_x(RAW_X_POSITION(lx0)), const int8_t cx = get_cell_index_x(RAW_X_POSITION(lx0)),
cy = get_cell_index_y(RAW_Y_POSITION(ly0)); cy = get_cell_index_y(RAW_Y_POSITION(ly0));
if (!WITHIN(cx, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(cy, 0, UBL_MESH_NUM_Y_POINTS - 1)) { if (!WITHIN(cx, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cy, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_ECHOPAIR("? in get_z_correction(lx0=", lx0); SERIAL_ECHOPAIR("? in get_z_correction(lx0=", lx0);
SERIAL_ECHOPAIR(", ly0=", ly0); SERIAL_ECHOPAIR(", ly0=", ly0);

@ -48,7 +48,7 @@
} }
static void serial_echo_10x_spaces() { static void serial_echo_10x_spaces() {
for (uint8_t i = UBL_MESH_NUM_X_POINTS - 1; --i;) { for (uint8_t i = GRID_MAX_POINTS_X - 1; --i;) {
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
#if TX_BUFFER_SIZE > 0 #if TX_BUFFER_SIZE > 0
MYSERIAL.flushTX(); MYSERIAL.flushTX();
@ -59,10 +59,10 @@
ubl_state unified_bed_leveling::state, unified_bed_leveling::pre_initialized; ubl_state unified_bed_leveling::state, unified_bed_leveling::pre_initialized;
float unified_bed_leveling::z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS], float unified_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y],
unified_bed_leveling::last_specified_z, unified_bed_leveling::last_specified_z,
unified_bed_leveling::mesh_index_to_xpos[UBL_MESH_NUM_X_POINTS + 1], // +1 safety margin for now, until determinism prevails unified_bed_leveling::mesh_index_to_xpos[GRID_MAX_POINTS_X + 1], // +1 safety margin for now, until determinism prevails
unified_bed_leveling::mesh_index_to_ypos[UBL_MESH_NUM_Y_POINTS + 1]; unified_bed_leveling::mesh_index_to_ypos[GRID_MAX_POINTS_Y + 1];
bool unified_bed_leveling::g26_debug_flag = false, bool unified_bed_leveling::g26_debug_flag = false,
unified_bed_leveling::has_control_of_lcd_panel = false; unified_bed_leveling::has_control_of_lcd_panel = false;
@ -165,8 +165,8 @@
void unified_bed_leveling::invalidate() { void unified_bed_leveling::invalidate() {
state.active = false; state.active = false;
state.z_offset = 0; state.z_offset = 0;
for (int x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (int x = 0; x < GRID_MAX_POINTS_X; x++)
for (int y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (int y = 0; y < GRID_MAX_POINTS_Y; y++)
z_values[x][y] = NAN; z_values[x][y] = NAN;
} }
@ -176,13 +176,13 @@
if (map0) { if (map0) {
SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n"); SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n");
serial_echo_xy(0, UBL_MESH_NUM_Y_POINTS - 1); serial_echo_xy(0, GRID_MAX_POINTS_Y - 1);
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
} }
if (map0) { if (map0) {
serial_echo_10x_spaces(); serial_echo_10x_spaces();
serial_echo_xy(UBL_MESH_NUM_X_POINTS - 1, UBL_MESH_NUM_Y_POINTS - 1); serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1);
SERIAL_EOL; SERIAL_EOL;
serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y); serial_echo_xy(UBL_MESH_MIN_X, UBL_MESH_MIN_Y);
serial_echo_10x_spaces(); serial_echo_10x_spaces();
@ -193,8 +193,8 @@
const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
for (int8_t j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) { for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
const bool is_current = i == current_xi && j == current_yi; const bool is_current = i == current_xi && j == current_yi;
// is the nozzle here? then mark the number // is the nozzle here? then mark the number
@ -210,7 +210,7 @@
SERIAL_PROTOCOL_F(f, 3); SERIAL_PROTOCOL_F(f, 3);
idle(); idle();
} }
if (!map0 && i < UBL_MESH_NUM_X_POINTS - 1) SERIAL_CHAR(','); if (!map0 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');
#if TX_BUFFER_SIZE > 0 #if TX_BUFFER_SIZE > 0
MYSERIAL.flushTX(); MYSERIAL.flushTX();
@ -237,7 +237,7 @@
serial_echo_xy(0, 0); serial_echo_xy(0, 0);
SERIAL_ECHOPGM(" "); SERIAL_ECHOPGM(" ");
serial_echo_10x_spaces(); serial_echo_10x_spaces();
serial_echo_xy(UBL_MESH_NUM_X_POINTS - 1, 0); serial_echo_xy(GRID_MAX_POINTS_X - 1, 0);
SERIAL_EOL; SERIAL_EOL;
} }
} }
@ -245,12 +245,12 @@
bool unified_bed_leveling::sanity_check() { bool unified_bed_leveling::sanity_check() {
uint8_t error_flag = 0; uint8_t error_flag = 0;
if (state.n_x != UBL_MESH_NUM_X_POINTS) { if (state.n_x != GRID_MAX_POINTS_X) {
SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_X_POINTS set wrong\n"); SERIAL_PROTOCOLLNPGM("?GRID_MAX_POINTS_X set wrong\n");
error_flag++; error_flag++;
} }
if (state.n_y != UBL_MESH_NUM_Y_POINTS) { if (state.n_y != GRID_MAX_POINTS_Y) {
SERIAL_PROTOCOLLNPGM("?UBL_MESH_NUM_Y_POINTS set wrong\n"); SERIAL_PROTOCOLLNPGM("?GRID_MAX_POINTS_Y set wrong\n");
error_flag++; error_flag++;
} }
if (state.mesh_x_min != UBL_MESH_MIN_X) { if (state.mesh_x_min != UBL_MESH_MIN_X) {

@ -354,24 +354,24 @@
SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n"); SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n");
switch (test_pattern) { switch (test_pattern) {
case 0: case 0:
for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) { // Create a bowl shape - similar to for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to
for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) { // a poorly calibrated Delta. for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta.
const float p1 = 0.5 * (UBL_MESH_NUM_X_POINTS) - x, const float p1 = 0.5 * (GRID_MAX_POINTS_X) - x,
p2 = 0.5 * (UBL_MESH_NUM_Y_POINTS) - y; p2 = 0.5 * (GRID_MAX_POINTS_Y) - y;
ubl.z_values[x][y] += 2.0 * HYPOT(p1, p2); ubl.z_values[x][y] += 2.0 * HYPOT(p1, p2);
} }
} }
break; break;
case 1: case 1:
for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) { // Create a diagonal line several Mesh cells thick that is raised for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised
ubl.z_values[x][x] += 9.999; ubl.z_values[x][x] += 9.999;
ubl.z_values[x][x + (x < UBL_MESH_NUM_Y_POINTS - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick ubl.z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999; // We want the altered line several mesh points thick
} }
break; break;
case 2: case 2:
// Allow the user to specify the height because 10mm is a little extreme in some cases. // Allow the user to specify the height because 10mm is a little extreme in some cases.
for (uint8_t x = (UBL_MESH_NUM_X_POINTS) / 3; x < 2 * (UBL_MESH_NUM_X_POINTS) / 3; x++) // Create a rectangular raised area in for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in
for (uint8_t y = (UBL_MESH_NUM_Y_POINTS) / 3; y < 2 * (UBL_MESH_NUM_Y_POINTS) / 3; y++) // the center of the bed for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed
ubl.z_values[x][y] += code_seen('C') ? ubl_constant : 9.99; ubl.z_values[x][y] += code_seen('C') ? ubl_constant : 9.99;
break; break;
} }
@ -592,8 +592,8 @@
if (storage_slot == -1) { // Special case, we are going to 'Export' the mesh to the if (storage_slot == -1) { // Special case, we are going to 'Export' the mesh to the
SERIAL_ECHOLNPGM("G29 I 999"); // host in a form it can be reconstructed on a different machine SERIAL_ECHOLNPGM("G29 I 999"); // host in a form it can be reconstructed on a different machine
for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(ubl.z_values[x][y])) { if (!isnan(ubl.z_values[x][y])) {
SERIAL_ECHOPAIR("M421 I ", x); SERIAL_ECHOPAIR("M421 I ", x);
SERIAL_ECHOPAIR(" J ", y); SERIAL_ECHOPAIR(" J ", y);
@ -694,8 +694,8 @@
sum = sum_of_diff_squared = 0.0; sum = sum_of_diff_squared = 0.0;
n = 0; n = 0;
for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (x = 0; x < GRID_MAX_POINTS_X; x++)
for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(ubl.z_values[x][y])) { if (!isnan(ubl.z_values[x][y])) {
sum += ubl.z_values[x][y]; sum += ubl.z_values[x][y];
n++; n++;
@ -706,8 +706,8 @@
// //
// Now do the sumation of the squares of difference from mean // Now do the sumation of the squares of difference from mean
// //
for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (x = 0; x < GRID_MAX_POINTS_X; x++)
for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(ubl.z_values[x][y])) { if (!isnan(ubl.z_values[x][y])) {
difference = (ubl.z_values[x][y] - mean); difference = (ubl.z_values[x][y] - mean);
sum_of_diff_squared += difference * difference; sum_of_diff_squared += difference * difference;
@ -724,15 +724,15 @@
SERIAL_EOL; SERIAL_EOL;
if (c_flag) if (c_flag)
for (x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (x = 0; x < GRID_MAX_POINTS_X; x++)
for (y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(ubl.z_values[x][y])) if (!isnan(ubl.z_values[x][y]))
ubl.z_values[x][y] -= mean + ubl_constant; ubl.z_values[x][y] -= mean + ubl_constant;
} }
void shift_mesh_height() { void shift_mesh_height() {
for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
if (!isnan(ubl.z_values[x][y])) if (!isnan(ubl.z_values[x][y]))
ubl.z_values[x][y] += ubl_constant; ubl.z_values[x][y] += ubl_constant;
} }
@ -848,8 +848,8 @@
SERIAL_ECHO_F(c, 6); SERIAL_ECHO_F(c, 6);
SERIAL_EOL; SERIAL_EOL;
for (i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (i = 0; i < GRID_MAX_POINTS_X; i++) {
for (j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { for (j = 0; j < GRID_MAX_POINTS_Y; j++) {
c = -((normal.x * (UBL_MESH_MIN_X + i * (MESH_X_DIST)) + normal.y * (UBL_MESH_MIN_Y + j * (MESH_Y_DIST))) - d); c = -((normal.x * (UBL_MESH_MIN_X + i * (MESH_X_DIST)) + normal.y * (UBL_MESH_MIN_Y + j * (MESH_Y_DIST))) - d);
ubl.z_values[i][j] += c; ubl.z_values[i][j] += c;
} }
@ -1148,7 +1148,7 @@
safe_delay(50); safe_delay(50);
SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: ");
for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos[i]), 1); SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos[i]), 1);
SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOLPGM(" ");
safe_delay(50); safe_delay(50);
@ -1156,7 +1156,7 @@
SERIAL_EOL; SERIAL_EOL;
SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: "); SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: ");
for (uint8_t i = 0; i < UBL_MESH_NUM_Y_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) {
SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos[i]), 1); SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos[i]), 1);
SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOLPGM(" ");
safe_delay(50); safe_delay(50);
@ -1195,8 +1195,8 @@
SERIAL_PROTOCOLPAIR("sizeof(ubl.state) : ", (int)sizeof(ubl.state)); SERIAL_PROTOCOLPAIR("sizeof(ubl.state) : ", (int)sizeof(ubl.state));
SERIAL_PROTOCOLPAIR("\nUBL_MESH_NUM_X_POINTS ", UBL_MESH_NUM_X_POINTS); SERIAL_PROTOCOLPAIR("\nGRID_MAX_POINTS_X ", GRID_MAX_POINTS_X);
SERIAL_PROTOCOLPAIR("\nUBL_MESH_NUM_Y_POINTS ", UBL_MESH_NUM_Y_POINTS); SERIAL_PROTOCOLPAIR("\nGRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y);
safe_delay(50); safe_delay(50);
SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_X ", UBL_MESH_MIN_X); SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_X ", UBL_MESH_MIN_X);
SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_Y ", UBL_MESH_MIN_Y); SERIAL_PROTOCOLPAIR("\nUBL_MESH_MIN_Y ", UBL_MESH_MIN_Y);
@ -1245,7 +1245,7 @@
* use cases for the users. So we can wait and see what to do with it. * use cases for the users. So we can wait and see what to do with it.
*/ */
void g29_compare_current_mesh_to_stored_mesh() { void g29_compare_current_mesh_to_stored_mesh() {
float tmp_z_values[UBL_MESH_NUM_X_POINTS][UBL_MESH_NUM_Y_POINTS]; float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
if (!code_has_value()) { if (!code_has_value()) {
SERIAL_PROTOCOLLNPGM("?Mesh # required.\n"); SERIAL_PROTOCOLLNPGM("?Mesh # required.\n");
@ -1267,8 +1267,8 @@
SERIAL_PROTOCOLLNPAIR(" loaded from EEPROM address 0x", hex_word(j)); // Soon, we can remove the extra clutter of printing SERIAL_PROTOCOLLNPAIR(" loaded from EEPROM address 0x", hex_word(j)); // Soon, we can remove the extra clutter of printing
// the address in the EEPROM where the Mesh is stored. // the address in the EEPROM where the Mesh is stored.
for (uint8_t x = 0; x < UBL_MESH_NUM_X_POINTS; x++) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
for (uint8_t y = 0; y < UBL_MESH_NUM_Y_POINTS; y++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
ubl.z_values[x][y] -= tmp_z_values[x][y]; ubl.z_values[x][y] -= tmp_z_values[x][y];
} }
@ -1285,8 +1285,8 @@
const float px = lx - (probe_as_reference ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), const float px = lx - (probe_as_reference ? X_PROBE_OFFSET_FROM_EXTRUDER : 0),
py = ly - (probe_as_reference ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); py = ly - (probe_as_reference ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0);
for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
for (uint8_t j = 0; j < UBL_MESH_NUM_Y_POINTS; j++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
if ( (type == INVALID && isnan(ubl.z_values[i][j])) // Check to see if this location holds the right thing if ( (type == INVALID && isnan(ubl.z_values[i][j])) // Check to see if this location holds the right thing
|| (type == REAL && !isnan(ubl.z_values[i][j])) || (type == REAL && !isnan(ubl.z_values[i][j]))
@ -1314,8 +1314,8 @@
distance = HYPOT(px - mx, py - my) + HYPOT(current_x - mx, current_y - my) * 0.1; distance = HYPOT(px - mx, py - my) + HYPOT(current_x - mx, current_y - my) * 0.1;
if (far_flag) { // If doing the far_flag action, we want to be as far as possible if (far_flag) { // If doing the far_flag action, we want to be as far as possible
for (uint8_t k = 0; k < UBL_MESH_NUM_X_POINTS; k++) { // from the starting point and from any other probed points. We for (uint8_t k = 0; k < GRID_MAX_POINTS_X; k++) { // from the starting point and from any other probed points. We
for (uint8_t l = 0; l < UBL_MESH_NUM_Y_POINTS; l++) { // want the next point spread out and filling in any blank spaces for (uint8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { // want the next point spread out and filling in any blank spaces
if (!isnan(ubl.z_values[k][l])) { // in the mesh. So we add in some of the distance to every probed if (!isnan(ubl.z_values[k][l])) { // in the mesh. So we add in some of the distance to every probed
distance += sq(i - k) * (MESH_X_DIST) * .05 // point we can find. distance += sq(i - k) * (MESH_X_DIST) * .05 // point we can find.
+ sq(j - l) * (MESH_Y_DIST) * .05; + sq(j - l) * (MESH_Y_DIST) * .05;

@ -135,7 +135,7 @@
* But we detect it and isolate it. For now, we just pass along the request. * But we detect it and isolate it. For now, we just pass along the request.
*/ */
if (!WITHIN(cell_dest_xi, 0, UBL_MESH_NUM_X_POINTS - 1) || !WITHIN(cell_dest_yi, 0, UBL_MESH_NUM_Y_POINTS - 1)) { if (!WITHIN(cell_dest_xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(cell_dest_yi, 0, GRID_MAX_POINTS_Y - 1)) {
// Note: There is no Z Correction in this case. We are off the grid and don't know what // Note: There is no Z Correction in this case. We are off the grid and don't know what
// a reasonable correction would be. // a reasonable correction would be.

@ -67,8 +67,8 @@
* Mesh bed leveling: * Mesh bed leveling:
* 219 M420 S from mbl.status (bool) * 219 M420 S from mbl.status (bool)
* 220 mbl.z_offset (float) * 220 mbl.z_offset (float)
* 224 MESH_NUM_X_POINTS (uint8 as set in firmware) * 224 GRID_MAX_POINTS_X (uint8 as set in firmware)
* 225 MESH_NUM_Y_POINTS (uint8 as set in firmware) * 225 GRID_MAX_POINTS_Y (uint8 as set in firmware)
* 226 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) +288 * 226 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) +288
* *
* AUTO BED LEVELING * AUTO BED LEVELING
@ -78,8 +78,8 @@
* 266 planner.bed_level_matrix (matrix_3x3 = float x9) * 266 planner.bed_level_matrix (matrix_3x3 = float x9)
* *
* AUTO_BED_LEVELING_BILINEAR (or placeholder): 47 bytes * AUTO_BED_LEVELING_BILINEAR (or placeholder): 47 bytes
* 302 ABL_GRID_MAX_POINTS_X (uint8_t) * 302 GRID_MAX_POINTS_X (uint8_t)
* 303 ABL_GRID_MAX_POINTS_Y (uint8_t) * 303 GRID_MAX_POINTS_Y (uint8_t)
* 304 bilinear_grid_spacing (int x2) from G29: (B-F)/X, (R-L)/Y * 304 bilinear_grid_spacing (int x2) from G29: (B-F)/X, (R-L)/Y
* 308 G29 L F bilinear_start (int x2) * 308 G29 L F bilinear_start (int x2)
* 312 bed_level_grid[][] (float x9, up to float x256) +988 * 312 bed_level_grid[][] (float x9, up to float x256) +988
@ -294,9 +294,9 @@ void Config_Postprocess() {
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
// Compile time test that sizeof(mbl.z_values) is as expected // Compile time test that sizeof(mbl.z_values) is as expected
typedef char c_assert[(sizeof(mbl.z_values) == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) * sizeof(dummy)) ? 1 : -1]; typedef char c_assert[(sizeof(mbl.z_values) == (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1];
const bool leveling_is_on = TEST(mbl.status, MBL_STATUS_HAS_MESH_BIT); const bool leveling_is_on = TEST(mbl.status, MBL_STATUS_HAS_MESH_BIT);
const uint8_t mesh_num_x = MESH_NUM_X_POINTS, mesh_num_y = MESH_NUM_Y_POINTS; const uint8_t mesh_num_x = GRID_MAX_POINTS_X, mesh_num_y = GRID_MAX_POINTS_Y;
EEPROM_WRITE(leveling_is_on); EEPROM_WRITE(leveling_is_on);
EEPROM_WRITE(mbl.z_offset); EEPROM_WRITE(mbl.z_offset);
EEPROM_WRITE(mesh_num_x); EEPROM_WRITE(mesh_num_x);
@ -336,8 +336,8 @@ void Config_Postprocess() {
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Compile time test that sizeof(bed_level_grid) is as expected // Compile time test that sizeof(bed_level_grid) is as expected
typedef char c_assert[(sizeof(bed_level_grid) == (ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1]; typedef char c_assert[(sizeof(bed_level_grid) == (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y) * sizeof(dummy)) ? 1 : -1];
const uint8_t grid_max_x = ABL_GRID_MAX_POINTS_X, grid_max_y = ABL_GRID_MAX_POINTS_Y; const uint8_t grid_max_x = GRID_MAX_POINTS_X, grid_max_y = GRID_MAX_POINTS_Y;
EEPROM_WRITE(grid_max_x); // 1 byte EEPROM_WRITE(grid_max_x); // 1 byte
EEPROM_WRITE(grid_max_y); // 1 byte EEPROM_WRITE(grid_max_y); // 1 byte
EEPROM_WRITE(bilinear_grid_spacing); // 2 ints EEPROM_WRITE(bilinear_grid_spacing); // 2 ints
@ -631,7 +631,7 @@ void Config_Postprocess() {
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
mbl.status = leveling_is_on ? _BV(MBL_STATUS_HAS_MESH_BIT) : 0; mbl.status = leveling_is_on ? _BV(MBL_STATUS_HAS_MESH_BIT) : 0;
mbl.z_offset = dummy; mbl.z_offset = dummy;
if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) { if (mesh_num_x == GRID_MAX_POINTS_X && mesh_num_y == GRID_MAX_POINTS_Y) {
// EEPROM data fits the current mesh // EEPROM data fits the current mesh
EEPROM_READ(mbl.z_values); EEPROM_READ(mbl.z_values);
} }
@ -668,7 +668,7 @@ void Config_Postprocess() {
EEPROM_READ(grid_max_x); // 1 byte EEPROM_READ(grid_max_x); // 1 byte
EEPROM_READ(grid_max_y); // 1 byte EEPROM_READ(grid_max_y); // 1 byte
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
if (grid_max_x == ABL_GRID_MAX_POINTS_X && grid_max_y == ABL_GRID_MAX_POINTS_Y) { if (grid_max_x == GRID_MAX_POINTS_X && grid_max_y == GRID_MAX_POINTS_Y) {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
EEPROM_READ(bilinear_grid_spacing); // 2 ints EEPROM_READ(bilinear_grid_spacing); // 2 ints
EEPROM_READ(bilinear_start); // 2 ints EEPROM_READ(bilinear_start); // 2 ints
@ -1203,8 +1203,8 @@ void Config_ResetDefault() {
CONFIG_ECHO_START; CONFIG_ECHO_START;
} }
SERIAL_ECHOLNPAIR(" M420 S", mbl.has_mesh() ? 1 : 0); SERIAL_ECHOLNPAIR(" M420 S", mbl.has_mesh() ? 1 : 0);
for (uint8_t py = 1; py <= MESH_NUM_Y_POINTS; py++) { for (uint8_t py = 1; py <= GRID_MAX_POINTS_Y; py++) {
for (uint8_t px = 1; px <= MESH_NUM_X_POINTS; px++) { for (uint8_t px = 1; px <= GRID_MAX_POINTS_X; px++) {
CONFIG_ECHO_START; CONFIG_ECHO_START;
SERIAL_ECHOPAIR(" G29 S3 X", (int)px); SERIAL_ECHOPAIR(" G29 S3 X", (int)px);
SERIAL_ECHOPAIR(" Y", (int)py); SERIAL_ECHOPAIR(" Y", (int)py);
@ -1235,8 +1235,8 @@ void Config_ResetDefault() {
SERIAL_ECHOPAIR("EEPROM can hold ", (int)((UBL_LAST_EEPROM_INDEX - ubl.eeprom_start) / sizeof(ubl.z_values))); SERIAL_ECHOPAIR("EEPROM can hold ", (int)((UBL_LAST_EEPROM_INDEX - ubl.eeprom_start) / sizeof(ubl.z_values)));
SERIAL_ECHOLNPGM(" meshes.\n"); SERIAL_ECHOLNPGM(" meshes.\n");
SERIAL_ECHOLNPGM("UBL_MESH_NUM_X_POINTS " STRINGIFY(UBL_MESH_NUM_X_POINTS)); SERIAL_ECHOLNPGM("GRID_MAX_POINTS_X " STRINGIFY(GRID_MAX_POINTS_X));
SERIAL_ECHOLNPGM("UBL_MESH_NUM_Y_POINTS " STRINGIFY(UBL_MESH_NUM_Y_POINTS)); SERIAL_ECHOLNPGM("GRID_MAX_POINTS_Y " STRINGIFY(GRID_MAX_POINTS_Y));
SERIAL_ECHOLNPGM("UBL_MESH_MIN_X " STRINGIFY(UBL_MESH_MIN_X)); SERIAL_ECHOLNPGM("UBL_MESH_MIN_X " STRINGIFY(UBL_MESH_MIN_X));
SERIAL_ECHOLNPGM("UBL_MESH_MIN_Y " STRINGIFY(UBL_MESH_MIN_Y)); SERIAL_ECHOLNPGM("UBL_MESH_MIN_Y " STRINGIFY(UBL_MESH_MIN_Y));

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -796,8 +796,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -843,8 +843,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -796,8 +796,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -843,8 +843,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -805,8 +805,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -852,8 +852,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -869,8 +869,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -807,8 +807,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER #define LEFT_PROBE_BED_POSITION X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER
@ -854,8 +854,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -871,8 +871,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -842,8 +842,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -889,8 +889,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -906,8 +906,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -812,8 +812,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -859,8 +859,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -876,8 +876,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -828,8 +828,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -875,8 +875,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -892,8 +892,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -834,8 +834,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -881,8 +881,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -898,8 +898,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -864,8 +864,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -911,8 +911,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -928,8 +928,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -805,8 +805,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -852,8 +852,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -869,8 +869,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -813,8 +813,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -860,8 +860,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -877,8 +877,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -919,8 +919,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_X 9
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 15) #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 15)
@ -966,8 +966,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -983,8 +983,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -904,8 +904,8 @@
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
// Works best with 5 or more points in each dimension. // Works best with 5 or more points in each dimension.
#define ABL_GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_X 9
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@ -951,8 +951,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -968,8 +968,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -907,8 +907,8 @@
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
// Works best with 5 or more points in each dimension. // Works best with 5 or more points in each dimension.
#define ABL_GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_X 9
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@ -955,8 +955,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -972,8 +972,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -906,8 +906,8 @@
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
// Works best with 5 or more points in each dimension. // Works best with 5 or more points in each dimension.
#define ABL_GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_X 7
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 25) #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 25)
@ -954,8 +954,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -971,8 +971,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -917,8 +917,8 @@
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
// Works best with 5 or more points in each dimension. // Works best with 5 or more points in each dimension.
#define ABL_GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_X 5
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10) #define DELTA_PROBEABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
@ -964,8 +964,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -981,8 +981,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -816,8 +816,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -863,8 +863,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -880,8 +880,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -809,8 +809,8 @@
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define ABL_GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 3
#define ABL_GRID_MAX_POINTS_Y ABL_GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Set the boundaries for probing (where the probe can reach). // Set the boundaries for probing (where the probe can reach).
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 15
@ -856,8 +856,8 @@
//=========================================================================== //===========================================================================
#define UBL_MESH_INSET 1 // Mesh inset margin on print area #define UBL_MESH_INSET 1 // Mesh inset margin on print area
#define UBL_MESH_NUM_X_POINTS 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited.
#define UBL_MESH_NUM_Y_POINTS 10 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
#define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling #define UBL_PROBE_PT_1_X 39 // These set the probe locations for when UBL does a 3-Point leveling
#define UBL_PROBE_PT_1_Y 180 // of the mesh. #define UBL_PROBE_PT_1_Y 180 // of the mesh.
#define UBL_PROBE_PT_2_X 39 #define UBL_PROBE_PT_2_X 39
@ -873,8 +873,8 @@
//=========================================================================== //===========================================================================
#define MESH_INSET 10 // Mesh inset margin on print area #define MESH_INSET 10 // Mesh inset margin on print area
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define MESH_NUM_Y_POINTS 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS

@ -29,14 +29,14 @@
uint8_t mesh_bed_leveling::status; uint8_t mesh_bed_leveling::status;
float mesh_bed_leveling::z_offset, float mesh_bed_leveling::z_offset,
mesh_bed_leveling::z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS], mesh_bed_leveling::z_values[GRID_MAX_POINTS_Y][GRID_MAX_POINTS_X],
mesh_bed_leveling::index_to_xpos[MESH_NUM_X_POINTS], mesh_bed_leveling::index_to_xpos[GRID_MAX_POINTS_X],
mesh_bed_leveling::index_to_ypos[MESH_NUM_Y_POINTS]; mesh_bed_leveling::index_to_ypos[GRID_MAX_POINTS_Y];
mesh_bed_leveling::mesh_bed_leveling() { mesh_bed_leveling::mesh_bed_leveling() {
for (uint8_t i = 0; i < MESH_NUM_X_POINTS; ++i) for (uint8_t i = 0; i < GRID_MAX_POINTS_X; ++i)
index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST); index_to_xpos[i] = MESH_MIN_X + i * (MESH_X_DIST);
for (uint8_t i = 0; i < MESH_NUM_Y_POINTS; ++i) for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; ++i)
index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST); index_to_ypos[i] = MESH_MIN_Y + i * (MESH_Y_DIST);
reset(); reset();
} }

@ -40,16 +40,16 @@
MBL_STATUS_REACTIVATE_BIT = 2 MBL_STATUS_REACTIVATE_BIT = 2
}; };
#define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (MESH_NUM_X_POINTS - 1)) #define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1))
#define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (MESH_NUM_Y_POINTS - 1)) #define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_POINTS_Y - 1))
class mesh_bed_leveling { class mesh_bed_leveling {
public: public:
static uint8_t status; // Has Mesh and Is Active bits static uint8_t status; // Has Mesh and Is Active bits
static float z_offset, static float z_offset,
z_values[MESH_NUM_Y_POINTS][MESH_NUM_X_POINTS], z_values[GRID_MAX_POINTS_Y][GRID_MAX_POINTS_X],
index_to_xpos[MESH_NUM_X_POINTS], index_to_xpos[GRID_MAX_POINTS_X],
index_to_ypos[MESH_NUM_Y_POINTS]; index_to_ypos[GRID_MAX_POINTS_Y];
mesh_bed_leveling(); mesh_bed_leveling();
@ -65,9 +65,9 @@
static void set_reactivate(const bool onOff) { onOff ? SBI(status, MBL_STATUS_REACTIVATE_BIT) : CBI(status, MBL_STATUS_REACTIVATE_BIT); } static void set_reactivate(const bool onOff) { onOff ? SBI(status, MBL_STATUS_REACTIVATE_BIT) : CBI(status, MBL_STATUS_REACTIVATE_BIT); }
static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) {
px = index % (MESH_NUM_X_POINTS); px = index % (GRID_MAX_POINTS_X);
py = index / (MESH_NUM_X_POINTS); py = index / (GRID_MAX_POINTS_X);
if (py & 1) px = (MESH_NUM_X_POINTS - 1) - px; // Zig zag if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag
} }
static void set_zigzag_z(const int8_t index, const float &z) { static void set_zigzag_z(const int8_t index, const float &z) {
@ -78,22 +78,22 @@
static int8_t cell_index_x(const float &x) { static int8_t cell_index_x(const float &x) {
int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST)); int8_t cx = (x - (MESH_MIN_X)) * (1.0 / (MESH_X_DIST));
return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2);
} }
static int8_t cell_index_y(const float &y) { static int8_t cell_index_y(const float &y) {
int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST)); int8_t cy = (y - (MESH_MIN_Y)) * (1.0 / (MESH_Y_DIST));
return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2);
} }
static int8_t probe_index_x(const float &x) { static int8_t probe_index_x(const float &x) {
int8_t px = (x - (MESH_MIN_X) + 0.5 * (MESH_X_DIST)) * (1.0 / (MESH_X_DIST)); int8_t px = (x - (MESH_MIN_X) + 0.5 * (MESH_X_DIST)) * (1.0 / (MESH_X_DIST));
return WITHIN(px, 0, MESH_NUM_X_POINTS - 1) ? px : -1; return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
} }
static int8_t probe_index_y(const float &y) { static int8_t probe_index_y(const float &y) {
int8_t py = (y - (MESH_MIN_Y) + 0.5 * (MESH_Y_DIST)) * (1.0 / (MESH_Y_DIST)); int8_t py = (y - (MESH_MIN_Y) + 0.5 * (MESH_Y_DIST)) * (1.0 / (MESH_Y_DIST));
return WITHIN(py, 0, MESH_NUM_Y_POINTS - 1) ? py : -1; return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1;
} }
static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) { static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) {

@ -1335,13 +1335,13 @@ void kill_screen(const char* lcd_msg) {
// LCD probed points are from defaults // LCD probed points are from defaults
constexpr uint8_t total_probe_points = constexpr uint8_t total_probe_points =
#if ABL_GRID #if ABL_GRID
(ABL_GRID_MAX_POINTS_X) * (ABL_GRID_MAX_POINTS_Y) (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)
#elif ENABLED(AUTO_BED_LEVELING_3POINT) #elif ENABLED(AUTO_BED_LEVELING_3POINT)
int(3) int(3)
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
(UBL_MESH_NUM_X_POINTS) * (UBL_MESH_NUM_Y_POINTS) (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)
#elif ENABLED(MESH_BED_LEVELING) #elif ENABLED(MESH_BED_LEVELING)
(MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS) (GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)
#endif #endif
; ;

Loading…
Cancel
Save