3D printer G-code · Marlin
G29: Bed levelling (probe the mesh) (Marlin)
Bed levelling (probe the mesh) — Probes the bed in a grid and builds a mesh that the firmware uses to follow the bed while printing. Marlin has several types: bilinear (most common), linear, 3-point…
On this page
| Property | Value |
|---|---|
| Command | G29 |
| Function | Bed levelling (probe the mesh) |
| Firmware | Marlin |
| Group | Bed levelling |
| Syntax | G29 [options depend on the levelling type] |
What does G29 do?
Probes the bed in a grid and builds a mesh that the firmware uses to follow the bed while printing. Marlin has several types: bilinear (most common), linear, 3-point, UBL (unified bed levelling) and manual mesh. The options of G29 differ between them.
Parameters
| Parameter | Meaning |
|---|---|
(bilinear) | No options needed; G29 probes the full grid |
UBL P1 / P3 | Probe the mesh / fill missing points |
UBL T | Print the mesh as a table |
Example
G28
G29 ; probe the bed
M420 S1 Z10 ; enable mesh, fade out by 10 mm
M500 ; save meshTips from practice
- Run it with the bed at print temperature.
- Saving the mesh with M500 and loading it with M420 S1 saves minutes per print; probe again when you change the plate.
- Paste the output into the bed mesh visualizer to see it in 3D.
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
- G28 — Home axes
- M420 — Bed levelling state
- M851 — Probe offset (Z offset)
- BED_MESH_CALIBRATE — Probe the bed mesh (Klipper)
More bed levelling commands
| Command | Function | Firmware |
|---|---|---|
M420 | Bed levelling state | Marlin |
M851 | Probe offset (Z offset) | 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