Fix bilinear ABL grid_start probe/nozzle coordinate mixup#28380
Fix bilinear ABL grid_start probe/nozzle coordinate mixup#28380PenguinAkiko wants to merge 1 commit into
Conversation
The variable abl.probe_position_lf is in probe-space, but bedlevel.grid_start is consumed as a nozzle-space origin for mesh interpolation. This caused the entire bilinear mesh to be shifted by the probe offset on machines with a non-zero XY offset. Convert the bilinear lower-left grid origin before comparing or storing the mesh, and apply the same conversion in M420 S2. Add Probe::convert_to_nozzle_xy() to centralize the conversion.
|
In my recent experiments with probing, I set up the probe as a dedicated tool (dummy extruder) with hotend offsets for the probe being equal to The trouble I had in getting probing to work indicates that the proposed changes are indeed needed. Or maybe we just need to improve documentation on how to set up a probe for G30, G38 and G29. |
|
Hi. I have a pull request I think yours might be connected to. My issue involves using a separate Z stop and probe #28418. I have extensively tested and regularly printed graphic representations of the bed map and still have tiny discrepancies in the mesh values I haven't identified. My machine now probes at the XY home position before commencing with G29. The probe trigger height is then taken off the probe readings for the rest of the mesh readings (probe Z offset). That should mean that when the probe measures the bed at the XY home position (bed center) during the mesh scan it should read 0 but it never does. I can see that an area roughly corresponding to the XY probe offset is very close to 0 now I have reviewed my maps. Is that what you would expect to see? The difficulty here is that the differences in the mesh values is now so small, because of all the major improvements I've made, they are almost lost in the noise caused by thermal expansion and repeatability accuracy of the probe. The first image shows a Bed map control taken a few days ago compared to one just done. with the Bed cold. Legend Red is above 0, Yellow is below 0, Blue is 0 This image below shows the surface topology after the bed has heated and soaked for 15 minutes (The bed was trammed Hot nearly a week ago) The Mesh visualizer is a spread sheet I created to display the data provided from the printer with M503. |
|
This is a comparison of the cold control from a couple of weeks ago and one done today 28/04/2026 with your fix applied to my local firmware build. note the square just above the center square which is the XY home coordinate is 0.008 and is the closest of any point on the mesh to the expected 0. I Since checked my Y offset to find it was a bit out which would account for this so I will rerun the test. Bed Mesh cold comparison with #28380 applied
I still have an issue where all the values in the mesh seam to slowly increase if I don't reset the Eprom quite often, so there is still an accumulative error getting in to the calculations somewhere. Any thoughts? |




Description
This PR fixes a critical coordinate-space mixup for the
bedlevel.grid_startposition when using Bilinear Auto Bed Leveling (AUTO_BED_LEVELING_BILINEAR).The Problem:
The bilinear ABL probing process builds its mesh in probe-space, where
abl.probe_position_lfrepresents the coordinate directly under the probe. However, the resultingbedlevel.grid_startvalue is later consumed by other systems (likebedlevel.get_z_correction()) as a motion/nozzle-space origin.On machines with a non-zero
NOZZLE_TO_PROBE_OFFSETin the XY plane, this discrepancy caused the entire leveling mesh to be incorrectly shifted by the probe's XY offset, leading to inaccurate bed compensation.The Solution:
To resolve this, this PR introduces a centralized utility function,
Probe::convert_to_nozzle_xy(), to handle the conversion from probe-space to nozzle-space. This function is now used in two key locations:G29: The bilinear grid origin is now converted to nozzle-space before it is compared with a stored mesh or saved withbedlevel.set_grid().M420 S2: The test pattern generator is also updated to use the same conversion, ensuring that all methods of generating a bilinear mesh use consistent, nozzle-space coordinates for the grid origin.This change has no functional effect on setups where the XY probe offset is zero or when using
NOZZLE_AS_PROBE.Requirements
Any 3D printer configured with
AUTO_BED_LEVELING_BILINEAR.Benefits
Fixes a bug that incorrectly shifted the entire Bilinear ABL mesh by the probe's XY offset.
Configurations
No configuration files are attached as the change is hardware-independent.
To test this PR, any configuration with the following enabled will reproduce the issue and verify the fix:
Related Issues
Fixes a bug that does not appear to have a corresponding open issue.