3D printer G-code · Marlin
M851: Probe offset (Z offset) (Marlin)
Probe offset (Z offset) — Sets the distance from the nozzle to the probe. The Z value is the famous "Z offset": more negative brings the nozzle closer to the bed. Live adjustment while printing…
On this page
| Property | Value |
|---|---|
| Command | M851 |
| Function | Probe offset (Z offset) |
| Firmware | Marlin |
| Group | Bed levelling |
| Syntax | M851 [X] [Y] [Z] |
What does M851 do?
Sets the distance from the nozzle to the probe. The Z value is the famous "Z offset": more negative brings the nozzle closer to the bed. Live adjustment while printing is done with babystepping (M290) or on the display.
Parameters
| Parameter | Meaning |
|---|---|
X Y | Probe position relative to the nozzle |
Z | Trigger height of the probe relative to the nozzle tip |
Example
M851 Z-1.85
M500Tips from practice
- Change it in steps of 0.02–0.05 mm while the first layer prints.
- In Klipper this is z_offset in [probe] or [bltouch], set with PROBE_CALIBRATE.
Marlin. Many Marlin commands only exist when the feature is enabled in the firmware build. If the printer answers "Unknown command", the feature is missing. Klipper does not understand most of these settings codes; it uses printer.cfg instead.
Related commands
- M500 — Save settings to EEPROM
- PROBE_CALIBRATE — Find the probe Z offset
- SET_GCODE_OFFSET — Live Z (babystep)
More bed levelling commands
| Command | Function | Firmware |
|---|---|---|
G29 | Bed levelling (probe the mesh) | Marlin |
M420 | Bed levelling state | Marlin |
M48 | Probe repeatability test | Marlin |
G34 | Z stepper auto-align | Marlin |
G26 | Mesh validation pattern | Marlin |
BED_MESH_CALIBRATE | Probe the bed mesh (Klipper) | Klipper |
BED_MESH_PROFILE | Save and load mesh profiles | Klipper |
Z_TILT_ADJUST | Level the gantry (two or three Z motors) | Klipper |
QUAD_GANTRY_LEVEL | Quad gantry level | Klipper |
PROBE_CALIBRATE | Find the probe Z offset | Klipper |
SET_GCODE_OFFSET | Live Z (babystep) | Klipper |
SCREWS_TILT_CALCULATE | Bed screw turns | Klipper |
Test it before you print
Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.
Open the simulator