-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Leveling fixes #24188
Merged
thinkyhead
merged 12 commits into
MarlinFirmware:bugfix-2.0.x
from
tombrazier:levelingfixes
May 19, 2022
Merged
Leveling fixes #24188
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eabf4c2
Consistency between apply_leveling() and unapply_leveling()
tombrazier 06511a3
G29 D (dryrun) should not change leveling state
tombrazier 9817ff4
Re-enable leveling using the proper mechanisms for BILINEAR - leave P…
tombrazier 2376a78
Enable/disable leveling in the correct positon within the modifier stack
tombrazier b665b6e
Correctly apply leveling, using the unleveled height as opposed to th…
tombrazier 547494a
Merge branch 'bugfix-2.0.x' into pr/24188
thinkyhead 2cbf0a0
cleanup
thinkyhead 769ddba
Common name for bedlevel objects
thinkyhead 3cf4540
mesh_index_to_xpos => get_mesh_x
thinkyhead d5f724a
Use common accessors
thinkyhead 59459ed
Merge branch 'bugfix-2.0.x' into pr/24188
thinkyhead 90d82d1
cleanup
thinkyhead File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
The reason this line exists is to prevent re-enabling leveling when you have a broken (incomplete) mesh.
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.
Yes, but you don't have a broken mesh at this point because the changes are held in local variable
abl
.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.
That's new behaviour in #23868. I should have included this change then.
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.
No, there is no temporary mesh being stored in the
abl
variable. The bed mesh is altered directly as it is probed.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.
Not any more since #23868. Line 733:
and then later on line 808
This was so that
G29 D
would not alter the mesh, as documented.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 see, then technically it's alright in its current form.
I didn't realize the new code was adding so much extra SRAM cost to
PROBE_MANUALLY
, which is meant to be the cheaper option. It would be helpful to provide a switch to use the old in-place modification – for the benefit of tiny boards that really need to squeeze out extra SRAM space.In general, whenever making any change that will impact SRAM usage more than a little, it's good practice to make the extra cost optional, rather than impose it. That way we can still move forward and add new intelligence using large buffers on more powerful boards, but also keep old configurations' build sizes from continually increasing in size.
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.
That makes sense to me, especially as I started this 3D printing lark with a 128k Sanguino and even now am still using an ATmega2560 based board (the AVR architecture is quite dear to my heart).
How about making the dry run functionality optional? I can't think of a way of offering dry run that actually works but does not end up temporarily holding two copies of the mesh.
Edit: Oh, I see, not temporarily but permanently in the case of PROBE_MANUALLY.
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.
Whilst we're at it, I don't think we actually need to store abl.eqnAMatrix. It just stores (x, y, 1) for each probe point and later uses the x and y to build a vector (x, y, 0). So the 1 is redundant. And the x and y can be calculated when abl.eqnAMatrix is used to print the topography map. That would save 3 * GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y * sizeof(float) bytes if PROBE_MANUALLY is used with AUTO_BED_LEVELING_LINEAR).
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.
@thinkyhead I'll attack these if you would like me to.