3D printer G-code · Marlin

G34: Z stepper auto-align (Marlin)

Z stepper auto-align — On printers with two or more independent Z motors, G34 probes under each motor and turns them until the gantry is level with the bed. Needs Z_STEPPER_AUTO_ALIGN. (Some…

By cnccode · Updated
On this page
  1. What does G34 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More bed levelling commands
  7. Frequently asked questions
PropertyValue
CommandG34
FunctionZ stepper auto-align
FirmwareMarlin
GroupBed levelling
SyntaxG34 [I<iterations>] [T<accuracy>]

What does G34 do?

On printers with two or more independent Z motors, G34 probes under each motor and turns them until the gantry is level with the bed. Needs Z_STEPPER_AUTO_ALIGN. (Some builds use G34 for mechanical gantry calibration against the top instead.) Klipper has Z_TILT_ADJUST for the same task.

Parameters

ParameterMeaning
INumber of rounds
TTarget accuracy in mm

Example

G-code
G28
G34
G28 Z

Tips from practice

  • Home Z again after G34, because the probe point changes.

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.

More bed levelling commands

CommandFunctionFirmware
G29Bed levelling (probe the mesh)Marlin
M420Bed levelling stateMarlin
M851Probe offset (Z offset)Marlin
M48Probe repeatability testMarlin
G26Mesh validation patternMarlin
BED_MESH_CALIBRATEProbe the bed mesh (Klipper)Klipper
BED_MESH_PROFILESave and load mesh profilesKlipper
Z_TILT_ADJUSTLevel the gantry (two or three Z motors)Klipper
QUAD_GANTRY_LEVELQuad gantry levelKlipper
PROBE_CALIBRATEFind the probe Z offsetKlipper
SET_GCODE_OFFSETLive Z (babystep)Klipper
SCREWS_TILT_CALCULATEBed screw turnsKlipper

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

Frequently asked questions

What does G34 do on a 3D printer?
G34 is z stepper auto-align. On printers with two or more independent Z motors, G34 probes under each motor and turns them until the gantry is level with the bed. Needs Z_STEPPER_AUTO_ALIGN. (Some builds use G34 for mechanical gantry calibration against the top…
Does G34 work in Klipper and Marlin?
G34 is a Marlin command. Klipper uses its own commands and printer.cfg settings for this task.
Was this page helpful?