-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Add command to initialize a bilinear ABL mesh #28048
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
Open
vehystrix
wants to merge
7
commits into
MarlinFirmware:bugfix-2.1.x
Choose a base branch
from
vehystrix:G29_ABL_BILINEAR_INIT0
base: bugfix-2.1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add command to initialize a bilinear ABL mesh #28048
vehystrix
wants to merge
7
commits into
MarlinFirmware:bugfix-2.1.x
from
vehystrix:G29_ABL_BILINEAR_INIT0
+102
−72
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…) or fixed value data (G29 P<val>)
Don't run EVENT_GCODE_AFTER_G29 when running with G29 P
502376b to
bd1eeac
Compare
bd1eeac to
0369ceb
Compare
Contributor
Author
|
So I took a look at the changes you made here, and I don't think it'll work properly (I may have missed something and didn't actually built and tested it yet)
I guess replacing line 274 with the following would fix it, but this also kind of smells const float x_min = probe.min_x(), x_max = probe.max_x(),
y_min = probe.min_y(), y_max = probe.max_y();
if (parser.seen('H')) {
const int16_t size = (int16_t)parser.value_linear_units();
abl.probe_position_lf.set(_MAX((X_CENTER) - size / 2, x_min), _MAX((Y_CENTER) - size / 2, y_min));
abl.probe_position_rb.set(_MIN(abl.probe_position_lf.x + size, x_max), _MIN(abl.probe_position_lf.y + size, y_max));
}
else {
abl.probe_position_lf.set(parser.linearval('L', x_min), parser.linearval('F', y_min));
abl.probe_position_rb.set(parser.linearval('R', x_max), parser.linearval('B', y_max));
}
if (!probe.good_bounds(abl.probe_position_lf, abl.probe_position_rb)) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
}
SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (L,R,F,B) out of bounds."));
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));
bedlevel.fill(init_val);
bedlevel.set_grid(abl.gridSpacing, abl.probe_position_lf);
G29_RETURN(false, false); |
52532da to
06c6c47
Compare
|
|
||
| void LevelingBilinear::set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start) { | ||
| grid_spacing = _grid_spacing; | ||
| grid_start = _grid_start; |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use
grid_start.x = MESH_MIN_X;
grid_start.y = MESH_MIN_Y;
grid_spacing.x = MESH_X_DIST;
grid_spacing.y = MESH_Y_DIST; if that helps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When flashing new firmware, the bed leveling mesh is lost in most cases. When you have the mesh saved somewhere (eg from the output of
M503) in the form of a bunch ofG29 Wcommands, it is not possible to directly restore the mesh. First you need to home XYZ and then you need to do a fullG29run.With this PR, I added the new option
G29 P<value>to allow you to initialize the mesh to the specified value, after which you can useG29 Wcommands to fill the mesh.I also removed the requirement to home XYZ before using
G29 WJust like with
G29 W, any values outside the -10 to 10 range are rejectedOld way to restore the mesh:
New way to restore the mesh
Requirements
AUTO_BED_LEVELING_BILINEARExample
Example