These commands change values that Marlin keeps while it runs: how far a step moves,
how fast and how sharply the axes may go, offsets, retraction, vibration control and
the geometry of the machine. Most of them are lost at power-off unless saved with
M500. Most report the current value when sent without a new one, and
M503 reports them all. Lengths and speeds are in current units.
M500 to M504: saving and loading
| Command | Parameters | Meaning |
|---|---|---|
M500 | None | With EEPROM_SETTINGS: save all configurable settings. Since Marlin 1.1.0 only changed bytes are written on AVR, Teensy and wired EEPROM chips; flash emulation and SD card storage rewrite the whole block |
M501 | None | With EEPROM_SETTINGS: load the saved settings. If the stored data fails the version, size or CRC check, the defaults are loaded instead; without EEPROM_SETTINGS it also loads the defaults |
M502 | None | Reset all configurable settings to the factory defaults, in memory only; follow with M500 to store them. Works without EEPROM_SETTINGS |
M503 | S: detailed output flag, taken as true if omitted; C: since 2.0.9.3, with CONFIGURATION_EMBEDDING, save the embedded configuration ZIP file to the SD card or flash drive | Report the settings in use, which may differ from those stored. DISABLE_M503 removes the command |
M504 | None | With EEPROM_SETTINGS: check the stored contents. Prints EEPROM OK, or the error, and on a MarlinUI display offers to reset or ignore |
M92: steps per unit
| Parameter | Meaning |
|---|---|
X, Y, Z, E steps | Steps per unit of that axis |
A, B, C steps | Since 2.0.9: fourth to sixth axis, where configured with those names |
U, V, W steps | Since 2.1: seventh to ninth axis, where configured |
T index | With DISTINCT_E_FACTORS: the extruder meant |
Units are steps per millimetre, or per inch in inch mode
(INCH_MODE_SUPPORT). The A and B axes of a SCARA, and any axis set up
as rotating (AXISn_ROTATES), take steps per degree. Without
parameters M92 reports the values; older versions need
M503.
M92 E688.4 ; new extruder
M201 to M205: limits, acceleration and jerk
On Core, Delta, SCARA and Polar machines the limits of M201,
M203 and the X, Y and Z jerk of M205 apply to each motor
(belt, tower carriage or joint), not to the nozzle; on a Delta, X, Y and Z are the
towers A, B and C and should be equal. The accelerations of M204
apply to the path of the nozzle, and are then reduced so that no motor exceeds its
M201 limit.
| Command | Parameters | Meaning |
|---|---|---|
M201 | X, Y, Z, E accel: highest acceleration, units/s²; T index: extruder (DISTINCT_E_FACTORS); with XY_FREQUENCY_LIMIT, F Hz: highest rate of X and Y direction changes, and S percent: the lowest speed it may reduce to | Maximum accelerations. The extruder limit applies to printing moves only when another axis also moves; retraction alone uses M204 R |
M203 | X, Y, Z, E speed: units/s; T index: extruder (DISTINCT_E_FACTORS) | Maximum feed rates |
M204 | P accel: printing moves (those that extrude); R accel: retract and recover moves; T accel: travel moves; S accel: old form setting printing and travel together, deprecated | Starting accelerations by kind of move, units/s² |
M205 | X, Y, Z jerk: with CLASSIC_JERK, units/s; E jerk; B µs: minimum segment time; S speed: minimum feed rate of printing moves; T speed: minimum feed rate of travel moves; J mm: junction deviation, 0.01 to 0.3 (JUNCTION_DEVIATION_MM) | Advanced motion settings. Junction deviation is not available on Delta, SCARA, TPARA, Polar or Polargraph machines, which need classic jerk |
M201 F60 S47 ; frequency limit: slow by up to 53% above 60 Hz
M204 P2400 ; printing acceleration
M205 J0.02 ; junction deviation
M500
M206, M428, M218: offsets
| Command | Parameters | Meaning |
|---|---|---|
M206 | X, Y, Z offset; A, B, C (since 2.0.9) and U, V, W (since 2.1) for further axes; with MORGAN_SCARA, P offset: Psi and T offset: Theta | Home offsets: a persistent shift of the coordinate space in the negative direction, applied to the current position at once. Not on delta machines, which use M665 H; removed by NO_WORKSPACE_OFFSETS. Saved levelling data stays valid |
M428 | None | Set the home offsets so that the current position becomes the native home position, and clear any G92 shift. The position must be within 2 cm of zero or of an endstop. On delta machines only Z can change |
M218 | T index: hot end, by default the active one; X, Y offset; Z offset (DUAL_X_CARRIAGE or SWITCHING_NOZZLE) | With two or more hot ends: offset of a hot end from the first. On a SCARA the offsets turn with the forearm, X across it and Y along it towards the tip, measured with the forearm pointing along +Y |
M290 | X, Y distance (with BABYSTEP_XY); Z distance, with S as its alias; P0: with BABYSTEP_ZPROBE_OFFSET, leave the probe offset alone | Since 1.1.7, with BABYSTEPPING: move by small amounts without changing the coordinates. With BABYSTEP_ZPROBE_OFFSET it also changes the probe Z offset, which takes effect at the next probing |
M206 Z-0.2 ; raise the first layer a little
M290 Z0.25 ; move up 0.25 mm now
M210 and M211: homing speed and software endstops
| Command | Parameters | Meaning |
|---|---|---|
M210 | X, Y, Z and, where configured, A, B, C, U, V, W feedrate | Since 2.1.3, with EDITABLE_HOMING_FEEDRATE: homing feed rates used by G28; the example in the documentation is in mm/min |
M211 | S0: disable; S1: enable | Switch the software endstops, if S is given, and report their state. Enabled, moves are clipped to [XYZ]_MIN_POS and [XYZ]_MAX_POS; a SCARA moves an unreachable target to the nearest reachable point inside the limits, and refuses it when they are off |
M220 and M221: speed and flow percentage
| Command | Parameters | Meaning |
|---|---|---|
M220 | S percent; B: back up the current factor; R: restore the saved one | Factor on the feed rate of all moves from G-code, on every axis; alone, report it |
M221 | S percent, listed as required; T index: extruder, by default the active one | Flow factor applied to extruder moves as they are planned |
M220 B S80 ; remember the factor, then run at 80%
M221 S150 ; extrude half as much again
M207 to M209: firmware retraction
With FWRETRACT these set what G10 and G11
do. Feed rates are in units per minute.
| Command | Parameters | Meaning |
|---|---|---|
M207 | S length: retract length; W length: swap retract length for several extruders; F feedrate; Z length: Z lift | Retraction settings |
M208 | S length: extra recover length, negative to recover less; W length: the same after a swap retract; F feedrate: recover feed rate; R feedrate: swap recover feed rate | Recovery settings; the lengths are added to those of M207 |
M209 | S 0/1 | With FWRETRACT_AUTORETRACT: automatic retraction, for files without G10. Moves of the extruder alone between MIN_AUTORETRACT and MAX_AUTORETRACT are converted when their direction fits the retract state. Without S, report |
M207 S2.0 ; retract 2 mm
M208 S0.5 F600 ; recover 2.5 mm at 10 mm/s
M200: volumetric extrusion
| Parameter | Meaning |
|---|---|
D diameter | Filament diameter; D0, or D without a value, switches volumetric mode off |
S 0/1 | Volumetric extrusion off or on |
L rate | With VOLUMETRIC_EXTRUDER_LIMIT: highest flow in mm³/s; L0 for no limit |
T index | Extruder, by default the active one |
In volumetric mode the E values of moves are cubic millimetres, and
the firmware works out the length of filament from the diameter.
NO_VOLUMETRIC leaves the feature out.
M200 S1 D1.75
M900 and M592: linear advance and nonlinear extrusion
| Command | Parameters | Meaning |
|---|---|---|
M900 | K factor: K factor, 0 disables; with EXTRA_LIN_ADVANCE_K (since 2.0.0): L factor: value of a second slot; S 0/1: select the first or second slot and apply it; T index: extruder | With LIN_ADVANCE or, since 2.1.3, FT_MOTION: set or report linear advance. A value stored in the slot not selected waits until that slot is selected |
M592 | A coefficient: quadratic, default 0; B: linear, default 0; C: constant, default 1; S: enable or disable | Since 2.1.3, with NONLINEAR_EXTRUSION: extrusion length is multiplied by max(C, A·v² + B·v + C), where v is the extruder speed in mm/s. Applies only to forward extrusion while another axis moves |
M900 T2 K0.22 L0.4 ; both slots of the third extruder
M592 A0.3 B0.2
M593: input shaping
Since 2.1.2, with INPUT_SHAPING_X, _Y or
_Z.
| Parameter | Meaning |
|---|---|
F Hz | Damping frequency; F0 disables shaping |
D zeta | Damping factor |
X, Y, Z | Axes to set (Z since 2.1.3); all of them if none is named |
Without parameters it reports the settings.
M593 X F31 D0.35
M493 and M494: fixed-time motion
Fixed-time motion (FT_MOTION, since 2.1.3) is a second planner with
its own input shapers, which can be switched on while the machine runs. It
supports Cartesian and Core machines and shares no settings with
M593. Its linear advance factor is the one set by
M900.
M493 parameter | Meaning |
|---|---|
S 0/1 | Fixed-time motion off or on |
X, Y, Z, E | Axes to which A, C, F, I and Q apply; X and Y if none is given |
C mode | Shaper: 0 none, 1 ZV, 2 ZVD, 3 ZVDD, 4 ZVDDD, 5 EI, 6 2HEI, 7 3HEI, 8 MZV. X and Y must both be set |
A Hz | Base frequency of the shaper |
I zeta | Zeta, 0.01 to 1.0 |
Q value | Vibration tolerance, 0.0 to 1.0 |
D mode | Dynamic frequency: 0 off, 1 based on Z, 2 based on mass; offered when there is a Z axis or extruder to follow |
F scale | Frequency scaling factor, under the same condition |
H 0/1 | Axis synchronisation off or on |
M494 parameter | Meaning |
|---|---|
T type | Trajectory generator: 0 trapezoidal; 1 fifth-order polynomial and 2 sixth-order polynomial (both need FTM_POLYS); 3 constant jolt, a seven-phase S-curve (FTM_CONSTANT_JOLT) |
O value | Acceleration overshoot for type 2, 1.25 to 1.875 |
X, Y, Z, E seconds | Smoothing time of each axis |
M493 S1 XY C2 A37 D0 ; on, ZVD at 37 Hz on X and Y
M494 T2 O1.3 X0.005 E0.004
M495 and M496: resonance test
Since 2.1.3, with RESONANCE_TEST, which needs input shaping or a
fixed-time shaper and EMERGENCY_PARSER. M495 shakes one
axis while the frequency rises; M496 stops the test and resets all
its settings. Starting a test homes all axes and moves to the middle of the bed.
The command returns at once and the sweep runs on. Nothing is stored in
EEPROM.
M495 parameter | Meaning |
|---|---|
X, Y or Z | The axis to test; exactly one |
S | Start the test |
F Hz | Start frequency, at least 5; default 5 |
T Hz | End frequency, above the start and at most 200; default 100 |
O seconds | Time for the frequency to double, 20 to 60; default 40 |
A value | Acceleration per hertz; default 60, at most 15 for Z |
C factor | Amplitude correction, 1 to 8; default 5 |
G seconds | Report the frequency reached at that time into the test, 0 to 100 |
The sweep lasts O × log2(T ÷ F) seconds, about 173 with the defaults.
Alone, M495 reports the settings.
M495 Y F20 T80 O20 S ; a 40-second sweep of Y
M495 G52 ; strongest at 52 s: which frequency?
M425: backlash compensation
With BACKLASH_COMPENSATION and BACKLASH_GCODE. Extra
steps are added when a motor reverses.
| Parameter | Meaning |
|---|---|
F fraction | Amount of correction, 0.0 (none) to 1.0 (all of it) |
S distance | Distance over which the correction is spread; 0 adds it at once |
X, Y, Z mm | Backlash of the axis; 0 disables it |
Z | Without a value, with MEASURE_BACKLASH_WHEN_PROBING: take the Z backlash measured by G29 |
Alone it reports the configuration. G425 loads the backlash it
measures but does not switch compensation on.
M425 F1 S3 X0.1 Y0.2 Z0.3
M665 and M666: delta, SCARA and dual endstops
Both numbers have two meanings, chosen by the machine the firmware is built for.
| Command | Parameters | Meaning |
|---|---|---|
M665 (DELTA) | H: delta height; L: diagonal rod length; R: delta radius; S: segments per second; X, Y, Z: angle trim of towers 1 to 3; A, B, C: rod length trim of towers 1 to 3 | Delta geometry |
M665 (SCARA or AXEL_TPARA) | S: segments per second; D: SCARA only, elbow direction, 1 anticlockwise (right-handed) or -1 clockwise; P, with aliases A and X: offset added to the shoulder angle; T, with aliases B and Y: offset added to the elbow angle | SCARA geometry; alone, report it. Changing D moves the arm out straight and back to the same point on the other bend, and is refused at the shoulder or where the angle limits forbid it. D is not saved; G28 sets it from the sign of SCARA_HOME_PSI |
M666 (DELTA) | X, Y, Z adjustment | Endstop adjustment of each tower |
M666 (X, Y or Z_DUAL_ENDSTOPS) | X, Y, Z offset | Set or report the offsets between the endstops of a doubled axis |
Sources
- MarlinDocumentation – Marlin’s own documentation source, files M092, M200, M201, M203 to M211, M218, M220, M221, M290, M425, M428, M493 to M496, M500 to M504, M592, M593, M665, M666 and M900 in
docs/gcode/, as of 3 December 2026