Update G29.cpp - #28418
Open
Maker-Paul wants to merge 5 commits into
Open
Conversation
Author
thinkyhead
pushed a commit
to MarlinFirmware/Configurations
that referenced
this pull request
Jun 7, 2026
This was referenced Jul 10, 2026
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
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
Simple update to G29.cpp (ABL) only. Adds automatic probe trigger height determination to set the Probe Z offset. avoids the probe trigger height above Z stop (Z=0) being incorrectly stored in all the bed level mesh values.
Only on machines that do not use the probe for homing when using ABL bed leveling. The probe offset will usually be larger than the home offset in these setups (it doesn't matter if its lower). When the G29 routine starts it sets the Z = 0 or home position using the homing device. But goes on to measure the bed level mesh points relative to the Z = 0 this causes all the mesh points to appear high or low by the difference between the home trigger height and the probe trigger height. This pull request simply reads the probe trigger height (which is the difference between Z home and probe trigger height) and adjusts the Z offset to account for that difference at the start of G29.
Another way of thinking about this is, if the printer has a seperate Z stop, this pull request will allow automatic determination of the probe Z offset from the Z stop. The probe to Z stop offset value is added to any user set home Z offset. The total being the bed to probe Z offset. So G29 maps Z values relative to the bed (Z=0) accurately.
Requirements
No special requirements does not affect machines with only Z stops or machines that use the probe for Z homing.
Benefits
Machines with separate methods for homing and creating the bed level mesh will not include probe Z offset in the mesh values just the bed topology.
Provides highly acurate mapping with all types of probe including proximity types. The user can still set the Z home offset as normal but doesn't have to worry about probe Z offset.
Configurations
definitions required in configuration.h
Related Issues
yes
will fix #27680 a simple way.
#28393
may fix other
Also #28380 identifies an issue where the mesh is incorrectly shifted by the X and Y probe offsets. it is easy to see in the bed level maps I have posted on the #28380 pull request. So should also be merged please.
Please note G29 UBL calculates the mean from the mapped bed Z values and uses that as the Z probe offset. So does not require changeing. However this method means the XY home position may not correspond with Z=0.