I'm actually using some of my original code, perhaps your code, and code I just generated through the RepRap configuration tool.
I've not made any firmware changes as I've done some testing and gotten much better results...
I ran 10 separate tests, 9 probes within each test, using the same firmware (2.05.1), on a cold printer bed, and measured standard deviations per group, assuming STDEV.P Excel function is the right function, which resulted in 0.005, 0.044, 0.014, 0.008, 0.006, 0.006, 0.009, 0.004, 0.020, 0.004 as seen in the image.
Two of the groups with the largest variations exhibit the effect I mentioned where the numbers continue to get lower and lower from the first probe value. Any thoughts why this would be?
There was a small amount of binding on the Z axis near the bottom and top, which I assume could cause some missed steps, especially if the voltage is turned down, so I decided to resolve it. I removed the lead screw and the gantry was able to move up and down without any binding. I then loosened and re-tightened the inside wheels on both sides of the gantry to allow for the least resistance while still keeping the triangular units (Ender 3 Pro) from being sloppy. I then hand fed the lead screw down towards the motor lead screw mount and noticed it wasn't perfectly aligned with the mounting hole so I shimmed the motor until I could hand twist the lead screw down into the motor mount hole without any resistance and for perfect fit. The gantry now moves up and down without any hint of binding except near the absolute top where I'd printed a custom lead screw mount.
With these changes to the Z axis, I've repeated these tests and have even better results with only the first test being not so good. These tests resulted in standard deviations per group of 0.030, 0.003, 0.005, 0.003, 0.005, 0.004, 0.004, 0.004, 0.003, and 0.002 as seen in the image. The test which was the worst exhibited the same downward trending as the first group.
homez.g homey.g homex.g homeall.g config-override.g config.g 0_Auto Probe Trigger Height Assist.g