3D printer G-code · Marlin
M420: Bed levelling state (Marlin)
Bed levelling state — Turns mesh compensation on or off, sets the fade height and prints the stored mesh. Because G28 turns levelling off in many builds, start codes use G28 followed by M420…
On this page
| Property | Value |
|---|---|
| Command | M420 |
| Function | Bed levelling state |
| Firmware | Marlin |
| Group | Bed levelling |
| Syntax | M420 [S<0|1>] [Z<fade>] [V] |
What does M420 do?
Turns mesh compensation on or off, sets the fade height and prints the stored mesh. Because G28 turns levelling off in many builds, start codes use G28 followed by M420 S1.
Parameters
| Parameter | Meaning |
|---|---|
S | 1 on, 0 off |
Z | Fade height: compensation fades out up to this height |
V | Print the mesh |
Example
G28
M420 S1 Z10Tips from practice
- Fade height 5–10 mm stops a warped bed from showing in the top of the part.
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
More bed levelling commands
| Command | Function | Firmware |
|---|---|---|
G29 | Bed levelling (probe the mesh) | 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