M851 - XYZ Probe Offset

none Set the Z probe XYZ offset from nozzle HAS_BED_PROBE


Set the XYZ distance from the nozzle to the probe trigger-point. These offsets are required for the firmware to know how to probe the bed and where probed points are in relation to the nozzle, and vice-versa.

The easiest way to get the Z offset value (assuming your homed Z = 0.0) is to:

  • Home the Z axis.
  • Raise Z and deploy the probe.
  • Move Z down slowly until the probe triggers.
  • Take the current Z position (as reported by M119) and negate it. (5.2 => -5.2)
  • Set with M851 Z-5.2 and save it with M500.
  • Configure with #define Z_PROBE_OFFSET_FROM_EXTRUDER -5.2.

For the X and Y offsets you have to measure the distance with a ruler or caliper.

For LCDs that support MarlinUI you can enable PROBE_OFFSET_WIZARD and follow a guided process to set the probe Z offset.


The default (factory) values are set by

  • (version 1.x)

    Where the X and Y offsets must be integers.

  • (version 2.x)

X and Y offset: Use a caliper or ruler to measure the distance from the tip of the Nozzle to the center-point of the Probe in the X and Y axes.

Z offset:

  • For the Z offset use your best known value and adjust at runtime.
  • Common probes trigger below the nozzle and have negative values for Z offset.
  • Probes triggering above the nozzle height are uncommon but do exist. When using probes such as this, carefully set Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES to avoid collisions during probing.

Assuming the typical work area orientation:

  • Probe to RIGHT of the Nozzle has a Positive X offset
  • Probe to LEFT of the Nozzle has a Negative X offset
  • Probe in BACK of the Nozzle has a Positive Y offset
  • Probe in FRONT of the Nozzle has a Negative Y offset

Some examples:

  • #define NOZZLE_TO_PROBE_OFFSET { 10, 10, -1 } // Example "1"
  • #define NOZZLE_TO_PROBE_OFFSET {-10, 5, -1 } // Example "2"
  • #define NOZZLE_TO_PROBE_OFFSET { 5, -5, -1 } // Example "3"
  • #define NOZZLE_TO_PROBE_OFFSET {-15,-10, -1 } // Example "4"
   +-- BACK ---+
   |    [+]    |
 L |        1  | R <-- Example "1" (right+,  back+)
 E |  2        | I <-- Example "2" ( left-,  back+)
 F |[-]  N  [+]| G <-- Nozzle
 T |       3   | H <-- Example "3" (right+, front-)
   | 4         | T <-- Example "4" ( left-, front-)
   |    [-]    |
   O-- FRONT --+


M851 [X<linear>] [Y<linear>] [Z<linear>]



Z probe X offset


    Z probe Y offset


      Z probe Z offset


        Set a reasonable offset for an inductive probe

        M851 Z-2.0

        A probe that is triggered by the nozzle itself

        M851 Z1.2

        Set the XY distance (probe left front of nozzle)

        M851 X-1.70 Y-1.30

        Set the XY distance (probe right back of nozzle)

        M851 X0.20 Y.40