Back to the Gcode Dictionary
M851: Set Z-Probe Offset (Marlin Compatibility)
RepRapFirmware 2.02 and later
M851 Znn is implemented for backwards compatibility with other firmware. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.
G31 should be used in preference to M851.