@dc42
I think I have found the issue. The values in G31 are being cleared if M558 is run again. This is also what is causing the issue I'm experiencing with the mesh probing grid.
In my original post, you'll find the z probe parameters in config.g.
In bed.g, I have the following command to increase the dive height in case the bed was extremely out of level. This often happens when the power is turned off, one of the two lead screws has a little less resistance and the bed lowers on that side.
M558 P9 H5 F120 T24000
But this instance of M558 didn't clear G31.
In bed.g, after the initial tramming run, the following was ran to lower the dive height and additional tramming is done, similar to your example conditional delta leveling script.
M558 P9 C"^zprobe.in" H2 F120 T24000
This instance used to lower the dive height resets G31. Please see the screenshot below.
Screen Shot 2020-03-08 at 6.16.22 PM.jpg
Rerunning M558 on RRF2 to increase the dive height did not do this. I have since moved the following commands to a new macro bltouch_config.g located in the /sys folder. This macro is run in config.g at powerup and if the dive height needs to be reset.
M558 P9 C"^zprobe.in" H2 F120 T24000
;
; G31 - +Z Nozzle closer to bed, -Z Nozzle further from bed
;
G31 X0 Y-28.58 Z2.75 P500
M557 X23:303 Y11:301 P10
After making this change G29 is now properly probing the mesh grid with the z probe offset and taking into account with the BLTouch pin is 28mm in front of the nozzle.