From d7b948610a3fb6b2dec88bb128a187451b2263b3 Mon Sep 17 00:00:00 2001 From: akaJes Date: Sat, 5 Nov 2016 18:01:26 +0200 Subject: [PATCH] Experimental bilinear subdivision option --- Marlin/Configuration.h | 12 ++ Marlin/Marlin_main.cpp | 152 ++++++++++++++++-- .../Cartesio/Configuration.h | 12 ++ .../Felix/Configuration.h | 12 ++ .../Felix/DUAL/Configuration.h | 12 ++ .../Hephestos/Configuration.h | 12 ++ .../Hephestos_2/Configuration.h | 12 ++ .../K8200/Configuration.h | 12 ++ .../K8400/Configuration.h | 12 ++ .../K8400/Dual-head/Configuration.h | 12 ++ .../RepRapWorld/Megatronics/Configuration.h | 12 ++ .../RigidBot/Configuration.h | 12 ++ .../SCARA/Configuration.h | 12 ++ .../TAZ4/Configuration.h | 12 ++ .../WITBOX/Configuration.h | 12 ++ .../adafruit/ST7565/Configuration.h | 12 ++ .../delta/biv2.5/Configuration.h | 12 ++ .../delta/generic/Configuration.h | 12 ++ .../delta/kossel_mini/Configuration.h | 12 ++ .../delta/kossel_pro/Configuration.h | 12 ++ .../delta/kossel_xl/Configuration.h | 12 ++ .../makibox/Configuration.h | 12 ++ .../tvrrug/Round2/Configuration.h | 12 ++ 23 files changed, 399 insertions(+), 17 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5565afb3b1..8377b2fd14 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 9e6c09c681..8ca8a1ff67 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2437,6 +2437,102 @@ static void clean_up_after_endstop_or_probe_move() { SERIAL_EOL; } + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + #define ABL_GRID_POINTS_VIRT_X (ABL_GRID_POINTS_X - 1) * (BILINEAR_SUBDIVISIONS) + 1 + #define ABL_GRID_POINTS_VIRT_Y (ABL_GRID_POINTS_Y - 1) * (BILINEAR_SUBDIVISIONS) + 1 + float bed_level_grid_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y]; + float bed_level_grid_virt_temp[ABL_GRID_POINTS_X + 2][ABL_GRID_POINTS_Y + 2]; //temporary for calculation (maybe dynamical?) + int bilinear_grid_spacing_virt[2] = { 0 }; + + static void bed_level_virt_print() { + SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:"); + for (uint8_t x = 0; x < ABL_GRID_POINTS_VIRT_X; x++) { + SERIAL_PROTOCOLPGM(" "); + if (x < 10) SERIAL_PROTOCOLCHAR(' '); + SERIAL_PROTOCOL((int)x); + } + SERIAL_EOL; + for (uint8_t y = 0; y < ABL_GRID_POINTS_VIRT_Y; y++) { + if (y < 10) SERIAL_PROTOCOLCHAR(' '); + SERIAL_PROTOCOL((int)y); + for (uint8_t x = 0; x < ABL_GRID_POINTS_VIRT_X; x++) { + SERIAL_PROTOCOLCHAR(' '); + float offset = bed_level_grid_virt[x][y]; + if (offset < 999.0) { + if (offset > 0) SERIAL_CHAR('+'); + SERIAL_PROTOCOL_F(offset, 5); + } + else + SERIAL_PROTOCOLPGM(" ===="); + } + SERIAL_EOL; + } + SERIAL_EOL; + } + #define LINEAR_EXTRAPOLATION(E, I) (E * 2 - I) + static void bed_level_virt_prepare() { + for (uint8_t y = 1; y <= ABL_GRID_POINTS_Y; y++) { + + for (uint8_t x = 1; x <= ABL_GRID_POINTS_X; x++) + bed_level_grid_virt_temp[x][y] = bed_level_grid[x - 1][y - 1]; + + bed_level_grid_virt_temp[0][y] = LINEAR_EXTRAPOLATION( + bed_level_grid_virt_temp[1][y], + bed_level_grid_virt_temp[2][y] + ); + + bed_level_grid_virt_temp[(ABL_GRID_POINTS_X + 2) - 1][y] = + LINEAR_EXTRAPOLATION( + bed_level_grid_virt_temp[(ABL_GRID_POINTS_X + 2) - 2][y], + bed_level_grid_virt_temp[(ABL_GRID_POINTS_X + 2) - 3][y] + ); + } + for (uint8_t x = 0; x < ABL_GRID_POINTS_X + 2; x++) { + bed_level_grid_virt_temp[x][0] = LINEAR_EXTRAPOLATION( + bed_level_grid_virt_temp[x][1], + bed_level_grid_virt_temp[x][2] + ); + bed_level_grid_virt_temp[x][(ABL_GRID_POINTS_Y + 2) - 1] = + LINEAR_EXTRAPOLATION( + bed_level_grid_virt_temp[x][(ABL_GRID_POINTS_Y + 2) - 2], + bed_level_grid_virt_temp[x][(ABL_GRID_POINTS_Y + 2) - 3] + ); + } + } + static float bed_level_virt_cmr(const float p[4], const uint8_t i, const float t) { + return ( + p[i-1] * -t * sq(1 - t) + + p[i] * (2 - 5 * sq(t) + 3 * t * sq(t)) + + p[i+1] * t * (1 + 4 * t - 3 * sq(t)) + - p[i+2] * sq(t) * (1 - t) + ) * 0.5; + } + static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) { + float row[4], column[4]; + for (uint8_t i = 0; i < 4; i++) { + for (uint8_t j = 0; j < 4; j++) // can be memcopy or through memory access + column[j] = bed_level_grid_virt_temp[i + x - 1][j + y - 1]; + row[i] = bed_level_virt_cmr(column, 1, ty); + } + return bed_level_virt_cmr(row, 1, tx); + } + static void bed_level_virt_interpolate() { + for (uint8_t y = 0; y < ABL_GRID_POINTS_Y; y++) + for (uint8_t x = 0; x < ABL_GRID_POINTS_X; x++) + for (uint8_t ty = 0; ty < BILINEAR_SUBDIVISIONS; ty++) + for (uint8_t tx = 0; tx < BILINEAR_SUBDIVISIONS; tx++) { + if ((ty && y == ABL_GRID_POINTS_Y - 1) || (tx && x == ABL_GRID_POINTS_X - 1)) + continue; + bed_level_grid_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] = + bed_level_virt_2cmr( + x + 1, + y + 1, + (float)tx / (BILINEAR_SUBDIVISIONS), + (float)ty / (BILINEAR_SUBDIVISIONS) + ); + } + } + #endif // ABL_BILINEAR_SUBDIVISION #endif // AUTO_BED_LEVELING_BILINEAR @@ -3922,6 +4018,10 @@ inline void gcode_G28() { || front_probe_bed_position != bilinear_start[Y_AXIS] ) { reset_bed_level(); + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + bilinear_grid_spacing_virt[X_AXIS] = xGridSpacing / (BILINEAR_SUBDIVISIONS); + bilinear_grid_spacing_virt[Y_AXIS] = yGridSpacing / (BILINEAR_SUBDIVISIONS); + #endif bilinear_grid_spacing[X_AXIS] = xGridSpacing; bilinear_grid_spacing[Y_AXIS] = yGridSpacing; bilinear_start[X_AXIS] = RAW_X_POSITION(left_probe_bed_position); @@ -4092,6 +4192,12 @@ inline void gcode_G28() { if (!dryrun) extrapolate_unprobed_bed_level(); print_bed_level(); + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + bed_level_virt_prepare(); + bed_level_virt_interpolate(); + bed_level_virt_print(); + #endif + #elif ENABLED(AUTO_BED_LEVELING_LINEAR) // For LINEAR leveling calculate matrix, print reports, correct the position @@ -8631,6 +8737,18 @@ void ok_to_send() { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + #define ABL_BG_SPACING(A) bilinear_grid_spacing_virt[A] + #define ABL_BG_POINTS_X ABL_GRID_POINTS_VIRT_X + #define ABL_BG_POINTS_Y ABL_GRID_POINTS_VIRT_Y + #define ABL_BG_GRID(X,Y) bed_level_grid_virt[X][Y] + #else + #define ABL_BG_SPACING(A) bilinear_grid_spacing[A] + #define ABL_BG_POINTS_X ABL_GRID_POINTS_X + #define ABL_BG_POINTS_Y ABL_GRID_POINTS_Y + #define ABL_BG_GRID(X,Y) bed_level_grid[X][Y] + #endif + // Get the Z adjustment for non-linear bed leveling float bilinear_z_offset(float cartesian[XYZ]) { @@ -8639,14 +8757,14 @@ void ok_to_send() { y = RAW_Y_POSITION(cartesian[Y_AXIS]) - bilinear_start[Y_AXIS]; // Convert to grid box units - float ratio_x = x / bilinear_grid_spacing[X_AXIS], - ratio_y = y / bilinear_grid_spacing[Y_AXIS]; + float ratio_x = x / ABL_BG_SPACING(X_AXIS), + ratio_y = y / ABL_BG_SPACING(Y_AXIS); // Whole units for the grid line indices. Constrained within bounds. - const int gridx = constrain(floor(ratio_x), 0, ABL_GRID_POINTS_X - 1), - gridy = constrain(floor(ratio_y), 0, ABL_GRID_POINTS_Y - 1), - nextx = min(gridx + 1, ABL_GRID_POINTS_X - 1), - nexty = min(gridy + 1, ABL_GRID_POINTS_Y - 1); + const int gridx = constrain(floor(ratio_x), 0, ABL_BG_POINTS_X - 1), + gridy = constrain(floor(ratio_y), 0, ABL_BG_POINTS_Y - 1), + nextx = min(gridx + 1, ABL_BG_POINTS_X - 1), + nexty = min(gridy + 1, ABL_BG_POINTS_Y - 1); // Subtract whole to get the ratio within the grid box ratio_x -= gridx; ratio_y -= gridy; @@ -8655,10 +8773,10 @@ void ok_to_send() { NOLESS(ratio_x, 0); NOLESS(ratio_y, 0); // Z at the box corners - const float z1 = bed_level_grid[gridx][gridy], // left-front - z2 = bed_level_grid[gridx][nexty], // left-back - z3 = bed_level_grid[nextx][gridy], // right-front - z4 = bed_level_grid[nextx][nexty], // right-back + const float z1 = ABL_BG_GRID(gridx, gridy), // left-front + z2 = ABL_BG_GRID(gridx, nexty), // left-back + z3 = ABL_BG_GRID(nextx, gridy), // right-front + z4 = ABL_BG_GRID(nextx, nexty), // right-back // Bilinear interpolate L = z1 + (z2 - z1) * ratio_y, // Linear interp. LF -> LB @@ -9006,7 +9124,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) && !IS_KINEMATIC - #define CELL_INDEX(A,V) ((RAW_##A##_POSITION(V) - bilinear_start[A##_AXIS]) / bilinear_grid_spacing[A##_AXIS]) + #define CELL_INDEX(A,V) ((RAW_##A##_POSITION(V) - bilinear_start[A##_AXIS]) / ABL_BG_SPACING(A##_AXIS)) /** * Prepare a bilinear-leveled linear move on Cartesian, @@ -9017,10 +9135,10 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { cy1 = CELL_INDEX(Y, current_position[Y_AXIS]), cx2 = CELL_INDEX(X, destination[X_AXIS]), cy2 = CELL_INDEX(Y, destination[Y_AXIS]); - cx1 = constrain(cx1, 0, ABL_GRID_POINTS_X - 2); - cy1 = constrain(cy1, 0, ABL_GRID_POINTS_Y - 2); - cx2 = constrain(cx2, 0, ABL_GRID_POINTS_X - 2); - cy2 = constrain(cy2, 0, ABL_GRID_POINTS_Y - 2); + cx1 = constrain(cx1, 0, ABL_BG_POINTS_X - 2); + cy1 = constrain(cy1, 0, ABL_BG_POINTS_Y - 2); + cx2 = constrain(cx2, 0, ABL_BG_POINTS_X - 2); + cy2 = constrain(cy2, 0, ABL_BG_POINTS_Y - 2); if (cx1 == cx2 && cy1 == cy2) { // Start and end on same mesh square @@ -9037,14 +9155,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2); if (cx2 != cx1 && TEST(x_splits, gcx)) { memcpy(end, destination, sizeof(end)); - destination[X_AXIS] = LOGICAL_X_POSITION(bilinear_start[X_AXIS] + bilinear_grid_spacing[X_AXIS] * gcx); + destination[X_AXIS] = LOGICAL_X_POSITION(bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx); normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]); destination[Y_AXIS] = LINE_SEGMENT_END(Y); CBI(x_splits, gcx); } else if (cy2 != cy1 && TEST(y_splits, gcy)) { memcpy(end, destination, sizeof(end)); - destination[Y_AXIS] = LOGICAL_Y_POSITION(bilinear_start[Y_AXIS] + bilinear_grid_spacing[Y_AXIS] * gcy); + destination[Y_AXIS] = LOGICAL_Y_POSITION(bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy); normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]); destination[X_AXIS] = LINE_SEGMENT_END(X); CBI(y_splits, gcy); diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 64b7199e45..8fb5ee8d04 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 75f7a24a98..9345e63d05 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -803,10 +803,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index ebfaff5c4c..61ab691b29 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -803,10 +803,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 6d36ab0579..fb7edb6a13 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -812,10 +812,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 9b506b60f1..96a6a8b58e 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -814,10 +814,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 60b70eb341..4be8696755 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -849,10 +849,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 079b49e406..70a7a25c94 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 1390337023..6bdbf7967a 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 5ffb1848af..3d7ef9a38c 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 4371793223..3668cfe504 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -819,10 +819,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 596add3735..a87eb95b45 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -835,10 +835,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index fb8ffc8d46..2128f39628 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -841,10 +841,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index b09f8a7752..5d3012c573 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -812,10 +812,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index d6fe48735a..31d8e8b790 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -820,10 +820,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index a078b82a4c..0cd7ef30ab 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -917,10 +917,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 583f18cdfd..dcc89553d6 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -911,10 +911,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 266c202a05..0ae6155f68 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -914,10 +914,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index f223c8f8bd..1687cc514b 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -913,10 +913,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 699740cdcb..44f70fd26f 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -917,10 +917,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index f568733026..5a410d0b8d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -823,10 +823,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index efa64e7625..2c6aae0d93 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -816,10 +816,22 @@ //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT)