This page gives RepRapFirmware’s codes that describe the machine’s motors and
geometry: which stepper driver moves which axis, how each driver is set up, closed
loop operation, and the kinematics, from the Duet3D G-code dictionary as read on
3 December 2026. Motion limits are on
RepRapFirmware motion settings.
RRF means RepRapFirmware, and version numbers are its versions. In every
M569 code P names a driver, with a CAN board address in
front where needed, as in P40.0.
M584: drive mapping
| Parameter | Meaning |
|---|---|
X Y Z E | Driver numbers for those motors, colon-separated for several |
U V W A B C D a to f | Further axes and their drivers; g to z as well on the Duet 3 MB6HC and MB6XD. Older firmware offered fewer: UVW from 1.16, UVWABC in 1.19 and 2, UVWABCD in 3.0 to 3.2, up to l in 3.4 |
R (3.2) | Axes created here are linear (0) or rotational (1); otherwise UVW are linear and ABCD rotational |
S (3.2) | Treat them as linear (0) or rotational (1) in feed rate calculations, as in section 2.1.2.5 of the NIST standard; default follows R |
P | Number of visible axes, extruders excluded; default all. Hidden axes, counted from the last created, get no homing or jog controls |
- From 3.3,
X,YandZstart on drivers 0, 1 and 2 and no extruder exists until declared; up to 3.2.2 driver 3 was an extruder by default. M584comes beforeM350andM906inconfig.g, and, when it creates axes, beforeM92,M201,M203,M208,M566,M574,M667andM669.- Axes created in one command are made in the order
UVWABCDabcdefghijklwhatever order they are written in. Before 1.20 they had to be created in the orderUVWABC. - A lower case axis is written with a leading quote:
M584 'A1.2,G1 'A10. - Every assigned driver needs a current from
M906; until then it gets roughly 1/32 of its maximum. Motors sharing an axis share one set of settings. On a Duet 2 WiFi or Ethernet they must all be on-board or expansion TMC2660 drivers, or none of them. - Mapping does not assign endstops; in RRF 2 they were allocated automatically in axis creation order. In 3.4 and earlier, moving one drive onto a driver that is already used leaves two drives on it, so define all drives explicitly.
- To reassign, first disable with
M18, then set current and microstepping again. From 3.6, reassigned drives return to step and direction mode untilM970is repeated.
M584 X0 Y1 Z2:3 E4:5:6
M584 X0 Y1 Z2 E3:4:1.0:1.1
M569: driver direction, enable, mode and timing
| Parameter | Meaning |
|---|---|
P | Driver number |
S | Direction: 0 backwards, 1 forwards (default) |
R | Enable polarity: 0 active low (default), 1 active high, −1 driver always disabled and unmonitored |
T (1.14); Ta:b:c:d (1.21) | Minimum step pulse width and interval in µs; the long form gives width, interval, direction setup and hold, for external drivers on Duet 2, Mini 5+, MB6XD and 1XD |
D (2.0) | Mode on smart drivers: 0 constant off time, 1 random off time (TMC2660), 2 spreadCycle, 3 stealthChop (TMC22xx, 2160, 5160), 4 closed loop, 5 assisted open loop (4 and 5 on Duet 3 closed loop hardware). Default spreadCycle from 3.4; stealthChop2 on TMC22xx up to 3.3 |
F (2.02) | Chopper off-time, 1 to 15 |
C (2.0) | Low 17 bits of the chopper control register; some drivers use only TOFF, HSTRT, HEND, TBL, and from 3.7.0 TPFD, FD3, DISFDCC can be set on TMC2160, 5160, 2240 |
B (2.02) | Blanking time field tbl, 0 to 3 |
H (2.02) | thigh on drivers that have it |
Ya:b[:c] (2.02) | Raw hysteresis start, end and decrement fields (5 and 0 mean start +6, end −3) |
V (2.02) | tpwmthrs: clocks between 1/256 microsteps below which stealthChop hands over to spreadCycle; typically 100 (fast) to 4000 (slow) |
U (3.6.0) | On TMC5160/2160, the iRun current scaler ceiling, 0 to 31, −1 default; below 16 warns. The firmware may then set run and hold scalers differently from requested to reach the current |
M569 Pn alone reports, including what H and
V mean in mm/s. The highest T values given anywhere apply
to every driver given a non-zero T, rounded up to what the firmware
supports, so lowering them means changing all such drivers, board by board, and
except on the MB6XD restarting. Without T the timing suits only the
on-board drivers; the defaults are 2.7 µs for all four on the 1XD and 2.5 µs on
the MB6XD. Before 1.14 some versions also mapped axes here, now
M584’s job. From 3.7.0 direction and mode appear in
boards[].drivers[].config.
M569 P0 S0
M569 P5 R1 T2.5:2.5:5:0
M569.1: closed loop configuration
For the Duet 3 1HCL expansion, Motor 23CL and INDX toolboard. Configure first,
then select mode with M569 D4.
| Parameter | Meaning |
|---|---|
P | Driver |
T | Encoder: 0 none (default), 1 linear quadrature with Duet3D magnetic shaft encoder (3.5), 2 quadrature shaft encoder, 3 Duet3D magnetic encoder (3.5) |
C | 3.4: counts per full step for T2. 3.5 and later: pulses per revolution for T1 and T2 |
Ewarn:error | Position error thresholds in full steps for warning and error events; default 2.0:4.0, but 0:0 (nothing reported) in 3.4. From 3.7.0 the first is also the trigger point of an M574 S5 encoder endstop |
S (3.5) | Motor full steps per revolution, default 200 |
R I D | Proportional, integral and derivative constants |
V A (3.5) | Velocity and acceleration feed-forward constants |
B (3.7) | Deadband in full steps for errors at standstill; default one encoder count, 0 off, negative restores automatic |
H (3.5 and earlier) | Minimum holding current, percent |
Q (3.5) | Motor torque in N·m per amp of peak current, needed for torque mode |
Y"type" (3.6.2) | Magnetic encoder chip for T1 or T3, default as5047d |
M569.2: driver registers and waveform correction
From 3.3 on main boards and 3.4.0 on CAN boards, for TMC22xx and TMC51xx drivers
(1HCL register reading fixed in 3.5.1). P driver, R
register 0 to 127, V value to write; without V the
register is read. Writing registers can damage drivers.
From 3.7.0, on MB6HC drivers and CAN drivers with TMC5160, 2160 or SPI-connected
2240, S corrects a harmonic of the microstep sine table (4, 8, 12 or
16), J is the correction in degrees (0 to 90, 0 removes it) and
O its phase, 0 (default) or 180. Motion stops while the table is
written, up to four harmonics are held per driver, and they are lost on reset.
P alone lists them.
M569.2 P1 R0
M569.2 P0.0 S4 J1.28 O180
M569.3, M569.4 and M569.8: encoders, torque and force
| Command | Parameters and effect |
|---|---|
M569.3 | ODrives on the second CAN bus of an MB6HC or MB6XD with Hangprinter kinematics. P drivers, colon-separated, at most four reachable since boot: report encoder positions in degrees. S sets the reference point, arbitrary until then |
M569.4 | Torque mode, on 1HCL and 23CL in closed loop (3.5) or those ODrives (3.4). P drivers; T torque in N·m, sign relative to the M569 direction, 0 returns to position mode; V speed limit in full steps/s (zero or negative none; not on ODrive). Missing P or T does nothing. A move of that motor also ends torque mode. Up to 3.7.0 the machine position is not updated meanwhile |
M569.8 P | Read motor force; ODrive and Hangprinter only |
M569.3 P50.0:51.0:52.0:53.0 S
M569.4 P50.0 T0.001
M569.5 and M569.6: closed loop data and tuning moves
M569.5 records a CSV file in /sys/closed-loop:
| Parameter | Meaning |
|---|---|
P | Driver, which must be in closed loop mode |
F"file" | File name; default built from driver address and time |
A | 0 record now, 1 from the next change of target position |
R | Samples per second; 0 as fast as possible |
S | Number of samples; the reply states the limit if exceeded |
D | Sum of the variable numbers below |
V | Manoeuvre during recording: 0 none, 1 polarity detection and zeroing, 2 encoder calibration, 64 step of 4 full steps |
D value | Variable |
|---|---|
| 1, 2, 4, 8 | Raw encoder reading; measured motor steps; target motor steps; current error |
| 16, 32, 64, 128 | PID control signal (−255 to 255); P, I and D terms |
| 256, 512, 1024 | Measured step phase (0 to 4095); desired step phase; phase shift between them |
| 2048, 4096 | Coil A and coil B current (−255 to 255) |
| 8192, 16384, 32768 | PID V term; A term; motor current fraction |
M569.6 Pdriver Vmove runs a tuning
move, such as V1 polarity detection and zeroing or V2
magnetic encoder calibration; the rest are listed in Duet3D’s tuning guide. Only
one driver is tuned at a time, so on an axis with several motors protect it
against the others standing still.
M569.6 P50.0 V1
M569.5 P50.0 S500 A0 R0 D6 V64
M569.7 and M569.9: brake ports and sense resistors
| Command | Parameters and effect |
|---|---|
M569.7 | P driver; C"port" output on the same board as the driver, on while the driver is enabled (idle current counts as enabled), so give it before the motor is first enabled; S (3.5) ms between engaging the brake and disabling the driver on M18 or M84, default 100, at most 999 on main board drivers; V (3.5, 48 V capable 1HCL and 23CL) brake voltage, held by PWM, so only on a PWM-capable port |
M569.9 | STM32 port of RRF only (3.4.2_102): P driver, R sense resistor in ohms, S maximum current in amps |
A brake drawing under 2 A and rated for the supply voltage can hang on an output or fan pin with a flyback diode; above that a heater output serves, with a diode added across the solenoid.
M569.7 P0.2 C"out9" S20
M569.9 P0.1 R0.075 S4.4
M665 and M666: delta geometry and endstops
| Command | Parameters and effect |
|---|---|
M665 | L diagonal rod length, or from 2.03 one per tower such as L260.1:260.2:260.0 (more than three, up to six, adds towers, placed with M669); R delta radius; B safe printing radius; H nozzle height above the bed when homed, after endstop corrections; X Y Z tower angle corrections in degrees, anticlockwise from above. With L it selects linear delta if not already selected |
M666 | X Y Z (U V W for towers four to six) endstop adjustments in mm, positive bringing the head nearer the bed by that tower; A B (1.16) X and Y bed tilt in percent. Rotary delta uses only X Y Z |
M500 saves these calibration values to config-override.g
for linear delta, rotary delta and Hangprinter.
M665 L250 R160 B80 H240 X0 Y0 Z0
M666 X-0.1 Y+0.2 Z0
M667: CoreXY modes (deprecated)
Deprecated in 2.03 and removed in 3.5; use M669. S0 is
Cartesian (the power-up state), S1 CoreXY, S2 CoreXZ.
Since 1.19 forward Y motor movement in CoreXY moves +X and −Y, and forward Z motor
movement in CoreXZ moves −X and +Z. Before 2.03, X Y Z scaled the
motor movement, as in M667 S2 Z3. It had to precede
M671.
M669: kinematics
M669 K selects a kinematics; the same command without
K adjusts the current one, and alone it reports. Not every build has
every kinematics, Duet 2 builds up to 3.6 only a few, and 3.7 does not support
Duet 2. M669 must precede M671.
3.7: K"name" | Up to 3.6: Kn |
|---|---|
cartesian, coreXY, coreXZ | 0, 1, 2 |
linearDelta, scara, coreXYU | 3, 4 (serial SCARA), 5 |
hangprinter, polar, coreXYUV | 6, 7, 8 |
fiveBarScara, rotaryDelta, markForged | 9, 10, 11 |
3.7 still accepts the numbers, deprecated, and also names added by custom builds.
For all of the following, S is segments per second and T
the minimum segment length in mm.
Matrix kinematics: Cartesian, CoreXY, CoreXZ, CoreXYU, CoreXYUV, Markforged
From 2.03 these are one linear kinematics with different default matrices.
X, Y, Z, U, V…
each give a row: the motor coefficients that move that axis, colon-separated. A
row given replaces the default, so write the whole matrix when changing it. The
CoreXZ default assumes 3:1 reduction on Z; without it use
Z1:0:-1. S and T (3.3) are optional and
segmentation is otherwise off; it makes pause, and in 3.7 M221
changes, act sooner (S10 is about 100 ms). With mesh levelling keep
T under half the M557 spacing. Because RRF allows for
direction on CoreXY, M201 and M203 can be set higher
than in some other firmware.
M669 K1 X1:1:0:0 Y1:-1:0:-1 Z0:0:1:0 U0:0:0:1
Linear delta
X and Y lists give the positions, relative to the
centre, of towers beyond the third (one value each per extra M665 L
value), used to carry a flying extruder on a fourth tower. From 3.6.0 delta moves
are segmented by default (at most 100 per second, at least 0.2 mm); earlier 3.x
segments only if S or T is given.
Serial SCARA
| Parameter | Meaning |
|---|---|
P D | Proximal and distal arm lengths in mm, default 100 |
Amin:max | Proximal joint angles, degrees anticlockwise from the X axis; default −90:90 |
Bmin:max | Distal joint angles relative to the arms in line; default −135:135 |
Ca:b:c | Crosstalk: proximal into distal, proximal into Z, distal into Z motor steps; default zero |
X Y | Bed origin offset from the proximal joint, default zero |
R (2.03) | Minimum printing radius; calculated if omitted |
S T | Segmentation, firmware default |
The angle limits are also the angles assumed when the homing switches trigger; a range over 360° means a continuously rotating joint.
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S100 X300 Y0
Polar
| Parameter | Meaning |
|---|---|
Rmin:max | Reachable turntable radius |
H | Nozzle radius when the radius homing switch triggers |
A F | Greatest turntable acceleration (°/s²) and speed (°/s); not applied to G1 H2 moves |
S T | Segmentation |
X Y | Bed origin offset from the turntable centre, not implemented; the arm cannot be offset sideways either |
Five-bar parallel SCARA
| Parameter | Meaning |
|---|---|
X Y | Left and right actuator coordinates, two values each |
P | Left and right proximal arm lengths |
D | Left and right distal lengths, optionally two cantilever lengths (default 0); 3.6.3 and earlier need all four |
L | Working mode 1 (default), 2 or 4 |
B | Actuator angles at the homing switches; default 20:10, 110:20 or 110:100 for modes 1, 2, 4 |
A | Six values: angle limits between the distal arms, left proximal to distal, right proximal to distal; default 15:165:0:360:0:360 |
C | Four values: left then right actuator limits; default 10:170:10:170 |
Z | Printable rectangle: x and y of two opposite corners |
S T | Segmentation |
If any geometry parameter is given, X, Y,
P and D must all be, and omitted others return to
default. Up to 3.6.3 they are needed every time, so M669 alone is an
error.
Rotary delta
| Parameter | Meaning (three values may be one, used for all) |
|---|---|
U | Arm lengths, inner bearing to outer joint midpoint; default 100 |
L | Rod pair lengths; default 200 |
H | Upper bearing heights above the effector joints at Z=0; default 250 |
Amin:max | Arm angles above horizontal, default −45:45; the maximum is where homing triggers |
R B | Delta radius (default 50) and printable radius (default 80) |
X Y Z | Angle corrections from the standard −150, −30 and 90°; default 0 |
S T | Segmentation, on by default at 100 per second and 0.2 mm |
The dictionary names the Hangprinter kinematics here without giving its
M669 parameters.
Sources
- G-code dictionary – Duet3D’s documentation of RepRapFirmware’s commands, published under a Creative Commons attribution share-alike licence; this page is written in our own words