The Klipper, Marlin & Duet Tuning Cheat Sheet (Every Command, Side by Side)
Share
The Klipper, Marlin & Duet Tuning Cheat Sheet (Every Command, Side by Side)
Last updated: September 2026 · By Advanced 3D Printing
Three firmwares, one tuning problem each — and a wiki-brain's worth of command names to juggle. This page is the wall poster we wanted: every tuning function, the exact command on all three firmwares, and the units traps that quietly ruin calibrations. Every entry was verified against the official Klipper, Marlin, and Duet3D docs. Use your browser's Print → Save as PDF (this page has print styling built in) and tape it to the printer.
First: the order. Every firmware doc agrees.
Commands in the wrong order produce numbers that expire. All three official doc sets state the same sequence — mechanical truth → geometry → temperature → motion shaping → pressure advance → flow → retraction — because each step changes the physics the previous one compensates for:
- Mechanical prep — frame, belts (~110 Hz over a 150 mm span as a starting target — belt width and bracket material shift it; X/Y symmetry matters more than the absolute number), rails, config checks (Klipper's Bed Level doc literally opens with "run the config checks first").
- E-steps / rotation_distance — every downstream number is meaningless if 100 mm of command isn't 100 mm of filament.
- Heater PID — stable temperature before anything touches flow.
- Z offset / probe / bed flatness — target Z accuracy ≈0.025 mm.
- Input shaping — with PA/LA disabled. Shapers change the accelerations the machine actually executes, so they change your ideal PA. (Marlin's own doc: sweep patterns print "with Linear Advance disabled — you may need to recalibrate the K-factor after tuning Input Shaping." RRF's PA doc: "tune Input Shaping, then Pressure Advance, then Retraction.")
- Pressure advance — then extrusion multiplier / flow (PA redistributes material in time; EM changes how much there is — PA first, always).
- Retraction LAST — PA already pulls filament at move ends; all three docs say retraction can drop afterward, Marlin says "may even be as low as 0."
One community disagreement worth knowing: One widely-read guide lists PA before the shaper topics in its main sequence, but its own saving page says retune PA after input shaping. Same net rule from every direction: PA is always the last thing tuned before retraction, and always re-checked after a shaper change.
The command map
| Function | Klipper | Marlin | RepRapFirmware / Duet |
|---|---|---|---|
| Extruder calibration |
[extruder] rotation_distancelive: SET_EXTRUDER_ROTATION_DISTANCE (no steps/mm at all) |
M92 E<new> (new = old × 100 ÷ actual) |
M92 E<new> (same formula) |
| Save settings |
SAVE_CONFIG (appends to printer.cfg) |
M500 → EEPROM( M501 load · M502 factory · M503 report) |
edit config.g, or M500 → config-override.g (M502 resets to defaults — don't) |
| Heater PID tune |
PID_CALIBRATE HEATER=extruder TARGET=215then SAVE_CONFIG
|
M303 E0 C8 S210 (bed: M303 E-1 C8 S60), U1 to apply, M500
|
M303 H1 P1 S240 → prints an M307 line to paste into config.g (bed default is bang-bang B1) |
| Probe repeatability | PROBE_ACCURACY |
M48 (needs Z_MIN_PROBE_REPEATABILITY_TEST) |
repeat G30 S-1 and eyeball the spread |
| Probe Z offset / trigger |
PROBE_CALIBRATE + TESTZ/ACCEPT/SAVE_CONFIG (or Z_ENDSTOP_CALIBRATE) |
probe wizard or negate the M114 reading → M851 Z-5.2 + M500
|
M561; M564 S0; G92 Z0 at paper drag → G30 S-1 → put printed Z into G31 Z… (check at several XY) |
| Bed mesh |
BED_MESH_CALIBRATE, BED_MESH_PROFILE SAVE=
|
G29 (5 flavors: MBL/linear/bilinear/UBL/mesh) + M420 S1 — G28 disables leveling by default, re-enable after homing; G26 validates UBL |
M557 grid + G29 → /sys/heightmap.csv; G29 S1 reload, S2 off |
| Multi-Z tilt / screws |
Z_TILT_ADJUST or SCREWS_TILT_CALCULATE
|
G29 variants; backlash via G425/M425
|
G32 runs bed.g (leadscrew leveling / delta cal / manual assistant) |
| Delta calibration | DELTA_CALIBRATE |
G33 P2 (height+endstops+radius), P3 adds tower angles |
G32 delta cal wizard (M665-driven) |
| Skew correction |
[printer] skew_xy (+ skew_profile) |
M852 (SKILL note: verify your build exposes it) |
M556 S100 X0.7 Y-0.2 Z0.6 |
| Input shaping (per-axis!) |
[input_shaper] + SET_INPUT_SHAPER; measure: SHAPER_CALIBRATE / TEST_RESONANCES (ADXL345 SPI, LIS3DH…); try MZV before EI |
M593 X F31 ZV-only (2.1.2+, saves with M500) or M493 FT_MOTION shapers (2.1.3+); tune via frequency sweep: break-point distance ÷ 2 = Hz. Print sweeps with LA off |
M593 P"zvd" F40.5 — deliberately ONE frequency for both axes (per-axis would bend diagonals off the slicer path); DWC plugin fits LIS3DH data (3.3+) |
| Pressure advance (units!) |
SET_PRESSURE_ADVANCE ADVANCE=0.065 — seconds; save in [extruder]; smooth_time stays 0.040 |
M900 K0.18 — mm per (mm/s), a different scale; K0 disables; LA 1.0 (≤1.1.8) values do NOT transfer to 1.5 |
M572 D0 S0.1 — seconds, matches Klipper; RRF auto-caps extruder accel at M566 E(mm/s) ÷ S |
| PA tower / bands |
TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.005 (bowden .020) |
marlinfw.org k-factor generator (line-pairs, M900 per line) |
M572 per band via slicer layer macros ({if layer_num==…}) |
| Max accel / speed |
SET_VELOCITY_LIMIT ACCEL= / [printer] max_accel — mm/s throughout |
M204 P print accel (+M201 caps, M205 jerk, mm/s) |
M201 X/Y accel mm/s² but M203/M566 speeds in mm/min
|
| Firmware retraction | none by design — retract lives in the slicer (~0.75 mm + wipe is enough with PA on) |
M207/M208/M209 (FWRETRACT) — official advice: dial last, 4-parameter balance |
slicer-side; PA doc: "consider reducing retraction when you enable pressure advance" |
Four units traps that quietly ruin calibrations
-
RRF speaks mm/min.
M203andM566are mm/min; accel is mm/s²;M205(when used) is mm/s. Klipper is mm/s everywhere. A "3000" jerk means wildly different machines on each firmware. - Marlin K and Klipper/Duet PA are not the same number system. K is mm of filament per mm/s of rate change; PA is seconds. The same machine is ~0.05 s on Klipper and a few times larger as a Marlin K — and there is no conversion formula. Tune each family from zero with its own pattern.
-
G28turns off bed leveling on Marlin by default. UnlessENABLE_LEVELING_AFTER_G28is compiled in, follow homing withM420 S1. First-layer failures that "come back after homing" are usually this. -
M502means opposite things by outcome. On Marlin it restores factory settings; on RRF it reloads config.g defaults — either way, if you were relying onM500-saved values, know whatM502will do before you type it.
When to retune what
| You changed… | Re-do |
|---|---|
| Any belt, rail, toolhead, bed, or "anything that jiggles should jiggle less" | Resonance measurement / input shaping — it's a property of the machine today |
| Filament (brand or colour), nozzle diameter, ±10 °C temp, hotend/extruder/bowden length | Pressure advance — per spool; pigments change viscosity |
| Input shaper on/off or retune | Pressure advance again (all three docs agree) |
| Pressure advance | Retraction (lower it), then a Benchy to confirm in real geometry |
| Enclosure, season, or room | Z offset on thermally-expansive machines; heat-soak and re-mesh before judging first layers |
The long versions of these rows
- Getting Started: the tuning order that works — the long version of the order section above, including the documented disagreements between guides.
- Pressure Advance, Finally Explained (Klipper · Marlin · Duet) — why the units differ, the two test patterns, and how to read them.
- Print Troubleshooting: Identify Any Defect by Its Shape — the artifact gallery this sheet's fixes feed into.
-
Pressure Advance Calibrator v2 — writes the per-line
SET_PRESSURE_ADVANCE/M900/M572pattern for your firmware, bed size, and units. - Flow rate calculator — the ceiling that fakes a "PA too low" read.
One tool this sheet genuinely can't replace: calipers — half the triage steps above end in "measure it." We use a 150 mm digital caliper daily; any quality one resolves 0.01 mm. (Disclosure: this is an affiliate link — if you buy through it we earn a small commission at no extra cost to you, which keeps these guides and generators free.) Browse calipers on Amazon
Sources
- Klipper: Config Reference, G-Codes, Pressure Advance, Resonance Compensation, Bed Level, Rotation Distance
- Marlin: Linear Advance, Input Shaping, M900, M593, M493, K-factor tool
- Duet3D: Pressure Advance, Input Shaping, Gcode dictionary (single page — per-command URLs redirect), Heaters Tuning, Z Probe/Bed Compensation pages
- Ellis' Print Tuning Guide (sequence reconciliation & belt Hz targets): Print Tuning Guide
Verified against official docs September 2026. Firmware moves: Marlin M593 requires ≥2.1.2, M493/FT_MOTION ≥2.1.3; RRF M593 parameter set documented for 3.6+ (algorithm changed in 3.6.0); Klipper's TEST_RESONANCES syntax dropped the old SHIM parameter. When your build's version differs, trust your docs over this sheet.
