← Open Viewer
GCodexG-Code Guide › G29 Command
G29

G29 — Auto Bed Leveling

Category: Bed Leveling  ·  Applies to: 3D Printer, Marlin, Klipper  ·  Updated: May 2026

What is G29?

G29 triggers the automatic bed leveling (ABL) routine. The printer probes multiple points across the bed surface, builds a mesh of height variations, and applies real-time Z compensation during printing to correct for bed warp and tilt.

Syntax

G29 [S] [L] [V]

Parameters

ParameterDescription
(no args)Run full probe sequence and build mesh
S0Disable bed leveling compensation
S1Enable bed leveling compensation (without re-probing)
L1Load mesh from EEPROM slot 1 (UBL mode)
V2Verbose output — print mesh values to serial

Examples

G28
G29
↑ Standard sequence — home first, then probe (always in this order)
G28
G29
M500
↑ Probe and save mesh to EEPROM for future use
G28
G29 L1
G29 S1
↑ Load saved UBL mesh and activate compensation

Important Notes

  • Always run G28 before G29 — the printer must be homed before probing.
  • G29 in bilinear mode probes a grid (default 3×3 or 5×5) and interpolates between points.
  • UBL (Unified Bed Leveling) is the most powerful mode — supports 10×10 grids and manual mesh editing.
  • Save the mesh with M500 after G29 to avoid re-probing every print.
  • Baby step Z offset (M290) fine-tunes the first layer height without re-running G29.

Common Mistakes

  • Skipping G28 before G29 — undefined position causes incorrect or dangerous probe moves.
  • Not saving with M500 after probing — mesh is lost on power cycle.
  • Running G29 after the bed has warmed up to a different temperature than when it was probed — mesh becomes inaccurate.

Frequently Asked Questions

Q: How many points does G29 probe?
In bilinear mode, the default is a 3×3 grid (9 points). You can increase this to 5×5 or higher in Marlin's Configuration.h (GRID_MAX_POINTS_X/Y). More points give a more accurate mesh but take longer.
Q: What is the difference between bilinear ABL and UBL?
Bilinear ABL probes a fixed grid and uses bilinear interpolation for compensation. UBL (Unified Bed Leveling) supports larger grids, allows manual point editing, stores multiple mesh slots in EEPROM, and uses a more accurate nearest-point algorithm. UBL is recommended for large beds or severe warp.
Q: Why is my first layer still uneven after G29?
The Z probe offset (M851) may be incorrectly set. The offset is the distance between the probe trigger point and the nozzle tip. Use baby stepping (M290) during the first layer of a real print to fine-tune. Also ensure the bed temperature matches what it was during calibration.