Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable number of G29 grid points (UBL, Bilinear) #26084

Open
wants to merge 56 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c8db766
Basic implementation
lukasradek Jul 15, 2023
aaf1e19
Extends G29 gcode parameters
lukasradek Jul 16, 2023
dd6f8d2
make optional, start on leveling changes
thinkyhead Jul 16, 2023
1f57ecc
'static' needed
thinkyhead Jul 16, 2023
e3f2100
extraneous parens
thinkyhead Jul 16, 2023
48fc2f6
GRID_MAX_CELLS…
thinkyhead Jul 16, 2023
d0610d1
oops, ANY
thinkyhead Jul 16, 2023
1d423b3
fix my typos
thinkyhead Jul 16, 2023
98ab0fa
just one more
thinkyhead Jul 16, 2023
e89a1fd
Unifies LINEAR and BILINEAR logic, Implements EEPROM
lukasradek Jul 16, 2023
3f50636
Determine GRID_MAX_POINTS based on spacing
lukasradek Jul 16, 2023
93db6d7
Fix constexpr and conditional compilations
lukasradek Jul 16, 2023
7cd5801
Fix issue with printing array
lukasradek Jul 16, 2023
2e35e87
Set unused bedlevel z values to NAN
lukasradek Jul 16, 2023
1adb186
ABL_SUBDIVISION - optimize and fix
lukasradek Jul 16, 2023
0c97c3b
Enable in tests
lukasradek Jul 16, 2023
600f835
Fix G29 W, add ToDo
lukasradek Jul 17, 2023
16396d1
G26, G42 supports VARIABLE_GRID_POINTS
lukasradek Jul 19, 2023
87e7a2c
M421 supports VARIABLE_GRID_POINTS
lukasradek Jul 19, 2023
e5e9672
M420 supports VARIABLE_GRID_POINTS
lukasradek Jul 19, 2023
31bc6be
Level Menu supports VARIABLE_GRID_POINTS + small enhancement
lukasradek Jul 19, 2023
c447115
Revert accidental platformio.ini change
lukasradek Jul 19, 2023
99e1613
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into G29-Variabl…
lukasradek Jul 19, 2023
1c41d3f
Refactor
lukasradek Jul 19, 2023
862cbef
AUTO_BED_LEVELING_LINEAR uses VARIABLE_GRID_POINTS macro
lukasradek Aug 6, 2023
1aee9c1
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into G29-Variabl…
lukasradek Aug 6, 2023
338184d
Merge 'bugfix-2.1.x' into pr/26084
thinkyhead Oct 3, 2023
20f296d
cleanup
thinkyhead Oct 3, 2023
abf2f80
No printf("%f") allowed
thinkyhead Oct 3, 2023
3ebf838
DISABLED
thinkyhead Oct 3, 2023
26a5034
misc.
thinkyhead Oct 3, 2023
d345f1f
unused strings
thinkyhead Oct 3, 2023
281e7f0
clarify index
thinkyhead Oct 3, 2023
387a7cd
use xy_uint8_t
thinkyhead Oct 3, 2023
8776070
ws
thinkyhead Oct 4, 2023
ce5a863
Ubl variable grid points
ThomasToka Nov 8, 2023
9db3f17
Pass CI checks update
ThomasToka Nov 8, 2023
6702dc4
fix to one MESH_Y_DIST conversion
ThomasToka Nov 9, 2023
8353715
Pre-calculate grid distance
thinkyhead Nov 10, 2023
c27fe42
Merge branch 'bugfix-2.1.x' into pr/26403
thinkyhead Nov 10, 2023
19a5214
tweaks
thinkyhead Nov 10, 2023
fa6623d
etc
thinkyhead Nov 10, 2023
72f8dc7
Init, load, store
thinkyhead Nov 10, 2023
ef389d8
fixes
thinkyhead Nov 10, 2023
d119e83
etc
thinkyhead Nov 10, 2023
68868b7
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x-ubl-grid…
ThomasToka Nov 10, 2023
d2812d4
set_grid_points
thinkyhead Nov 10, 2023
275659b
serial tweaks
thinkyhead Nov 10, 2023
036edd5
more serial tweaks
thinkyhead Nov 10, 2023
aff29c5
move to work branch
thinkyhead Nov 11, 2023
5e2d6e2
Merge branch 'bugfix-2.1.x' into pr/26084
thinkyhead Nov 14, 2023
a4800ff
Merge branch 'bugfix-2.1.x' into pr/26403
thinkyhead Nov 14, 2023
1493529
Merge branch 'pr/26403' into pr/26084
thinkyhead Nov 14, 2023
966b59d
merge followup
thinkyhead Nov 14, 2023
2ae625b
use var instead
thinkyhead Nov 14, 2023
da65a46
Merge branch 'bugfix-2.1.x' into pr/26084
thinkyhead Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,13 @@
#define GRID_MAX_POINTS_X 3
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
//#define VARIABLE_GRID_POINTS // Variable grid points at the cost of SRAM and more per-segment computation
#endif
#if ANY(AUTO_BED_LEVELING_LINEAR, VARIABLE_GRID_POINTS)
#define GRID_MIN_SPACING 25 // Prevent the probed area / probed points producing tiny cells
#endif

// Probe along the Y axis, advancing X after each column
//#define PROBE_Y_FIRST

Expand Down
59 changes: 31 additions & 28 deletions Marlin/src/feature/bedlevel/abl/bbl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@

LevelingBilinear bedlevel;

#if ENABLED(VARIABLE_GRID_POINTS)
xy_uint8_t LevelingBilinear::nr_grid_points;
#endif
xy_pos_t LevelingBilinear::grid_spacing,
LevelingBilinear::grid_start;
xy_float_t LevelingBilinear::grid_factor;
Expand Down Expand Up @@ -100,16 +103,18 @@ void LevelingBilinear::extrapolate_one_point(const uint8_t x, const uint8_t y, c
void LevelingBilinear::reset() {
grid_start.reset();
grid_spacing.reset();
TERN_(VARIABLE_GRID_POINTS, nr_grid_points.set(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y));
GRID_LOOP(x, y) {
z_values[x][y] = NAN;
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0));
}
}

void LevelingBilinear::set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start) {
void LevelingBilinear::set_grid(const xy_pos_t &_grid_spacing, const xy_pos_t &_grid_start OPTARG(VARIABLE_GRID_POINTS, const xy_uint8_t &_nr_grid_points)) {
grid_spacing = _grid_spacing;
grid_start = _grid_start;
grid_factor = grid_spacing.reciprocal();
TERN_(VARIABLE_GRID_POINTS, nr_grid_points = _nr_grid_points);
}

/**
Expand All @@ -118,18 +123,18 @@ void LevelingBilinear::set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _
*/
void LevelingBilinear::extrapolate_unprobed_bed_level() {
#ifdef HALF_IN_X
constexpr uint8_t ctrx2 = 0, xend = GRID_MAX_POINTS_X - 1;
constexpr uint8_t ctrx2 = 0, xend = nr_grid_points.x - 1;
#else
constexpr uint8_t ctrx1 = (GRID_MAX_CELLS_X) / 2, // left-of-center
ctrx2 = (GRID_MAX_POINTS_X) / 2, // right-of-center
constexpr uint8_t ctrx1 = (nr_grid_points.x - 1) / 2, // left-of-center
ctrx2 = nr_grid_points.x / 2, // right-of-center
xend = ctrx1;
#endif

#ifdef HALF_IN_Y
constexpr uint8_t ctry2 = 0, yend = GRID_MAX_POINTS_Y - 1;
constexpr uint8_t ctry2 = 0, yend = nr_grid_points.y - 1;
#else
constexpr uint8_t ctry1 = (GRID_MAX_CELLS_Y) / 2, // top-of-center
ctry2 = (GRID_MAX_POINTS_Y) / 2, // bottom-of-center
constexpr uint8_t ctry1 = (nr_grid_points.y - 1) / 2, // top-of-center
ctry2 = nr_grid_points.y / 2, // bottom-of-center
yend = ctry1;
#endif

Expand All @@ -156,41 +161,39 @@ void LevelingBilinear::extrapolate_unprobed_bed_level() {
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr*/) {
// print internal grid(s) or just the one passed as a parameter
SERIAL_ECHOLNPGM("Bilinear Leveling Grid:");
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]);
print_2d_array(nr_grid_points.x, nr_grid_points.y, 3, _z_values ? *_z_values[0] : z_values[0]);

#if ENABLED(ABL_BILINEAR_SUBDIVISION)
if (!_z_values) {
SERIAL_ECHOLNPGM("Subdivided with CATMULL ROM Leveling Grid:");
print_2d_array(ABL_GRID_POINTS_VIRT_X, ABL_GRID_POINTS_VIRT_Y, 5, z_values_virt[0]);
print_2d_array(subpoints().x, subpoints().y, 5, z_values_virt[0]);
}
#endif
}

#if ENABLED(ABL_BILINEAR_SUBDIVISION)

#define ABL_TEMP_POINTS_X (GRID_MAX_POINTS_X + 2)
#define ABL_TEMP_POINTS_Y (GRID_MAX_POINTS_Y + 2)
float LevelingBilinear::z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y];
float LevelingBilinear::z_values_virt[ABL_MAX_POINTS_VIRT_X][ABL_MAX_POINTS_VIRT_Y];
xy_pos_t LevelingBilinear::grid_spacing_virt;
xy_float_t LevelingBilinear::grid_factor_virt;

#define LINEAR_EXTRAPOLATION(E, I) ((E) * 2 - (I))
float LevelingBilinear::virt_coord(const uint8_t x, const uint8_t y) {
uint8_t ep = 0, ip = 1;
if (x > (GRID_MAX_POINTS_X) + 1 || y > (GRID_MAX_POINTS_Y) + 1) {
if (x > nr_grid_points.x + 1 || y > nr_grid_points.y + 1) {
// The requested point requires extrapolating two points beyond the mesh.
// These values are only requested for the edges of the mesh, which are always an actual mesh point,
// and do not require interpolation. When interpolation is not needed, this "Mesh + 2" point is
// cancelled out in virt_cmr and does not impact the result. Return 0.0 rather than
// making this function more complex by extrapolating two points.
return 0.0;
}
if (!x || x == ABL_TEMP_POINTS_X - 1) {
if (!x || x == (nr_grid_points.x + 2) - 1) {
if (x) {
ep = (GRID_MAX_POINTS_X) - 1;
ip = GRID_MAX_CELLS_X - 1;
ep = nr_grid_points.x - 1;
ip = (nr_grid_points.x - 1) - 1;
}
if (WITHIN(y, 1, ABL_TEMP_POINTS_Y - 2))
if (WITHIN(y, 1, (nr_grid_points.y + 2) - 2))
return LINEAR_EXTRAPOLATION(
z_values[ep][y - 1],
z_values[ip][y - 1]
Expand All @@ -201,12 +204,12 @@ void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr
virt_coord(ip + 1, y)
);
}
if (!y || y == ABL_TEMP_POINTS_Y - 1) {
if (!y || y == (nr_grid_points.y + 2) - 1) {
if (y) {
ep = (GRID_MAX_POINTS_Y) - 1;
ip = GRID_MAX_CELLS_Y - 1;
ep = nr_grid_points.y - 1;
ip = (nr_grid_points.y - 1) - 1;
}
if (WITHIN(x, 1, ABL_TEMP_POINTS_X - 2))
if (WITHIN(x, 1, (nr_grid_points.x + 2) - 2))
return LINEAR_EXTRAPOLATION(
z_values[x - 1][ep],
z_values[x - 1][ip]
Expand Down Expand Up @@ -243,11 +246,11 @@ void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr
void LevelingBilinear::subdivide_mesh() {
grid_spacing_virt = grid_spacing / (BILINEAR_SUBDIVISIONS);
grid_factor_virt = grid_spacing_virt.reciprocal();
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; ++y)
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; ++x)
for (uint8_t y = 0; y < nr_grid_points.y; ++y)
for (uint8_t x = 0; x < nr_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 == (GRID_MAX_POINTS_Y) - 1) || (tx && x == (GRID_MAX_POINTS_X) - 1))
if ((ty && y == nr_grid_points.y - 1) || (tx && x == nr_grid_points.x - 1))
continue;
z_values_virt[x * (BILINEAR_SUBDIVISIONS) + tx][y * (BILINEAR_SUBDIVISIONS) + ty] =
virt_2cmr(x + 1, y + 1, (float)tx / (BILINEAR_SUBDIVISIONS), (float)ty / (BILINEAR_SUBDIVISIONS));
Expand All @@ -266,14 +269,14 @@ void LevelingBilinear::refresh_bed_level() {
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
#define ABL_BG_SPACING(A) grid_spacing_virt.A
#define ABL_BG_FACTOR(A) grid_factor_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_POINTS_X subpoints().x
#define ABL_BG_POINTS_Y subpoints().y
#define ABL_BG_GRID(X,Y) z_values_virt[X][Y]
#else
#define ABL_BG_SPACING(A) grid_spacing.A
#define ABL_BG_FACTOR(A) grid_factor.A
#define ABL_BG_POINTS_X GRID_MAX_POINTS_X
#define ABL_BG_POINTS_Y GRID_MAX_POINTS_Y
#define ABL_BG_POINTS_X nr_grid_points.x
#define ABL_BG_POINTS_Y nr_grid_points.y
#define ABL_BG_GRID(X,Y) z_values[X][Y]
#endif

Expand Down
22 changes: 18 additions & 4 deletions Marlin/src/feature/bedlevel/abl/bbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,21 @@

#include "../../../inc/MarlinConfigPre.h"

#ifndef GRID_MIN_SPACING
#define GRID_MIN_SPACING 25
#endif

class LevelingBilinear {
public:
static bed_mesh_t z_values;
static xy_pos_t grid_spacing, grid_start;

#if ENABLED(VARIABLE_GRID_POINTS)
static xy_uint8_t nr_grid_points;
#else
static constexpr xy_uint8_t nr_grid_points { GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y };
#endif

private:
static xy_float_t grid_factor;
static xy_pos_t cached_rel;
Expand All @@ -36,13 +46,17 @@ class LevelingBilinear {
static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);

#if ENABLED(ABL_BILINEAR_SUBDIVISION)
#define ABL_GRID_POINTS_VIRT_X (GRID_MAX_CELLS_X * (BILINEAR_SUBDIVISIONS) + 1)
#define ABL_GRID_POINTS_VIRT_Y (GRID_MAX_CELLS_Y * (BILINEAR_SUBDIVISIONS) + 1)
#define ABL_MAX_POINTS_VIRT_X (GRID_MAX_CELLS_X * (BILINEAR_SUBDIVISIONS) + 1)
#define ABL_MAX_POINTS_VIRT_Y (GRID_MAX_CELLS_Y * (BILINEAR_SUBDIVISIONS) + 1)

static float z_values_virt[ABL_GRID_POINTS_VIRT_X][ABL_GRID_POINTS_VIRT_Y];
static float z_values_virt[ABL_MAX_POINTS_VIRT_X][ABL_MAX_POINTS_VIRT_Y];
static xy_pos_t grid_spacing_virt;
static xy_float_t grid_factor_virt;

static xy_uint8_t subpoints() {
return { nr_grid_points.x * (BILINEAR_SUBDIVISIONS) + 1, nr_grid_points.y * (BILINEAR_SUBDIVISIONS) + 1 };
}

static float virt_coord(const uint8_t x, const uint8_t y);
static float virt_cmr(const float p[4], const uint8_t i, const float t);
static float virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty);
Expand All @@ -51,7 +65,7 @@ class LevelingBilinear {

public:
static void reset();
static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start);
static void set_grid(const xy_pos_t &_grid_spacing, const xy_pos_t &_grid_start OPTARG(VARIABLE_GRID_POINTS, const xy_uint8_t &_nr_grid_points = { GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y }));
static void extrapolate_unprobed_bed_level();
static void print_leveling_grid(const bed_mesh_t *_z_values=nullptr);
static void refresh_bed_level();
Expand Down
64 changes: 49 additions & 15 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@
#include "../../../module/tool_change.h"
#endif

#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#define DEBUG_OUT 1
#include "../../../core/debug_out.h"

#if ABL_USES_GRID
#if ENABLED(PROBE_Y_FIRST)
#define PR_OUTER_VAR abl.meshCount.x
#define PR_OUTER_SIZE abl.grid_points.x
#define PR_INNER_VAR abl.meshCount.y
#define PR_OUTER_SIZE abl.grid_points.x
#define PR_INNER_SIZE abl.grid_points.y
#else
#define PR_OUTER_VAR abl.meshCount.y
#define PR_OUTER_SIZE abl.grid_points.y
#define PR_INNER_VAR abl.meshCount.x
#define PR_OUTER_SIZE abl.grid_points.y
#define PR_INNER_SIZE abl.grid_points.x
#endif
#endif
Expand Down Expand Up @@ -109,6 +109,10 @@ class G29_State {
#elif ENABLED(AUTO_BED_LEVELING_3POINT)
static constexpr grid_count_t abl_points = 3;
#elif ABL_USES_GRID
/**
* in case of AUTO_BED_LEVELING_BILINEAR, this has the meaning of abl_max_points, the actual number, that is currently being probed can be lower
* If PROBE_MANUALLY is mutually exclusive with BILINEAR, abl_points is not needed when BILINEAR is active
*/
static constexpr grid_count_t abl_points = GRID_MAX_POINTS;
#endif
lukasradek marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -123,8 +127,12 @@ class G29_State {

#if ENABLED(AUTO_BED_LEVELING_LINEAR)
bool topography_map;
xy_uint8_t grid_points;
#else // Bilinear
#endif

// Grid points can be specified for Linear and (optionally) Bilinear
#if ANY(AUTO_BED_LEVELING_LINEAR, VARIABLE_GRID_POINTS)
xy_uint8_t grid_points;
#else
static constexpr xy_uint8_t grid_points = { GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y };
#endif

Expand All @@ -142,9 +150,13 @@ class G29_State {
#endif
};

#if ABL_USES_GRID && ANY(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR)
constexpr xy_uint8_t G29_State::grid_points;
constexpr grid_count_t G29_State::abl_points;
#if ABL_USES_GRID
#if ANY(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_BILINEAR)
constexpr grid_count_t G29_State::abl_points;
#endif
#if NONE(AUTO_BED_LEVELING_LINEAR, VARIABLE_GRID_POINTS)
constexpr xy_uint8_t G29_State::grid_points;
#endif
#endif

/**
Expand All @@ -163,7 +175,7 @@ class G29_State {
*
* V Set the verbose level (0-4). Example: "G29 V3"
*
* Parameters With LINEAR leveling only:
* With LINEAR or BILINEAR+VARIABLE_GRID_POINTS only:
*
* P Set the size of the grid that will be probed (P x P points).
* Example: "G29 P4"
Expand All @@ -173,6 +185,8 @@ class G29_State {
*
* Y Set the Y size of the grid that will be probed (X x Y points).
*
* With LINEAR leveling:
*
* T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report.
* This is useful for manual bed leveling and finding flaws in the bed (to
* assist with part placement).
Expand Down Expand Up @@ -230,6 +244,8 @@ G29_TYPE GcodeSuite::G29() {
// Leveling state is persistent when done manually with multiple G29 commands
TERN_(PROBE_MANUALLY, static) G29_State abl;

#if ENABLED(AUTO_BED_LEVELING_LINEAR)

// Keep powered steppers from timing out
reset_stepper_timeout();

Expand Down Expand Up @@ -387,6 +403,8 @@ G29_TYPE GcodeSuite::G29() {

#if ABL_USES_GRID

// Probe at the points of a lattice grid

xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_FEEDRATE));

const float x_min = probe.min_x(), x_max = probe.max_x(),
Expand All @@ -411,9 +429,25 @@ G29_TYPE GcodeSuite::G29() {
G29_RETURN(false, false);
}

// Probe at the points of a lattice grid
abl.gridSpacing.set((abl.probe_position_rb.x - abl.probe_position_lf.x) / (abl.grid_points.x - 1),
(abl.probe_position_rb.y - abl.probe_position_lf.y) / (abl.grid_points.y - 1));
// Size of the probing area
const xy_float_t size { abl.probe_position_rb.x - abl.probe_position_lf.x, abl.probe_position_rb.y - abl.probe_position_lf.y };
// Spacing between grid lines
float xy_float_t spacing { size.x / (abl.grid_points.x - 1), size.y / (abl.grid_points.y - 1) };

// Reduce the number of points if cells are too small
#if ENABLED(VARIABLE_GRID_POINTS)
if (spacing.x < (GRID_MIN_SPACING)) {
abl.grid_points.x = (CEIL(size.x / (GRID_MIN_SPACING))) + 1;
spacing.x = size.x / (abl.grid_points.x - 1);
}

if (spacing.y < (GRID_MIN_SPACING)) {
abl.grid_points.y = (CEIL(size.y / (GRID_MIN_SPACING))) + 1;
spacing.y = size.y / (abl.grid_points.y - 1);
}
#endif

abl.gridSpacing = spacing;

#endif // ABL_USES_GRID

Expand Down Expand Up @@ -693,8 +727,8 @@ G29_TYPE GcodeSuite::G29() {
// Avoid probing outside the round or hexagonal area
if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;

if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.grid_points.x * abl.grid_points.y, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.grid_points.x * abl.grid_points.y)));
lukasradek marked this conversation as resolved.
Show resolved Hide resolved

#if ENABLED(BD_SENSOR_PROBE_NO_STOP)
if (PR_INNER_VAR == inStart) {
Expand Down Expand Up @@ -849,7 +883,7 @@ G29_TYPE GcodeSuite::G29() {
if (abl.dryrun)
bedlevel.print_leveling_grid(&abl.z_values);
else {
bedlevel.set_grid(abl.gridSpacing, abl.probe_position_lf);
bedlevel.set_grid(abl.gridSpacing, abl.probe_position_lf OPTARG(VARIABLE_GRID_POINTS, abl.grid_points));
COPY(bedlevel.z_values, abl.z_values);
TERN_(IS_KINEMATIC, bedlevel.extrapolate_unprobed_bed_level());
bedlevel.refresh_bed_level();
Expand Down
Loading