This page gives RepRapFirmware’s codes for filament changes and materials, a few special-purpose extensions, the clock, motor currents, power loss, stall detection and directly connected displays, from the Duet3D G-code dictionary as read on 3 December 2026. RRF means RepRapFirmware, DSF the Duet Software Framework used with an attached single-board computer (SBC), and version numbers are theirs.
M600 and M606: filament change pause and reader fork
M600 (2.02) pauses like M226, but runs
/sys/filament-change.g instead of pause.g if that file
exists.
M606 S1 forks the input of a job, or of a macro it calls, so that
each motion system reads and runs the file independently: one with a full queue,
or waiting for a tool change, does not hold up the others. S must
be 1; without it the command reports whether the job’s input is forked. It needs
firmware with two or more asynchronous motion systems (in 3.7, Duet 3 MB6HC and
MB6XD). Local variables, and from inside a macro the return stack, are copied to
the forks. A second fork from a job file is ignored; from another input channel
S1 draws a warning. M596 selects a motion system and
M598 synchronises them.
M650, M651, M655 and M670: special hardware
M650 (set peel move parameters) and M651 (peel) are
sent by the resin printing software nanoDLP. With RRF 2.03 or later, put an
empty M650.g in /sys so that it is ignored, and the
peel moves in M651.g.
M655 (3.6) sends a request to a custom CAN-connected expansion
board, for features that M950 and M42 cannot express,
and expects a standard reply.
| M655 parameter | Meaning |
|---|---|
B | CAN address of the board |
C"text" | Reduced string, such as address and port name. Without B it must start with the address and a full stop; the prefix, underscores and hyphens are removed and the rest made lower case |
A"text" | Ordinary string |
P | Unsigned integer up to 65535 |
R, S | Signed integers |
E, F | Floating point values |
M655 B10 C"hello world" P1 R-4 E0.123
M655 C"10.pump" P0 S22 F42.1
At least one of B and C is required, and B
wins. Parameters other than B may take at most 60 bytes: a string
its UTF-8 length plus 1, P 2, the others 4 each.
M670 maps the bits of the G1 P parameter to output
ports, for inkjets and the like. P lists up to 16 ports for bits 0
upwards: logical port numbers in 2.x, GpOut numbers made with
M950 from 3.6. Versions 3.0 to 3.5 use C with pin
names instead. T switches the ports that many milliseconds before
the move. In RRF 3 the ports must be on the main board (on Duet 2 also on a
DueX or SX1509B expander).
M670 T5 P220:221:222
M670 T5 C"sx1509b.0+sx1509b.1+sx1509b.2"
M670 T5 P2:3:8
M701, M702 and M703: filaments
(1.19) The filament feature keeps a directory per material under
/filaments and records which one a tool holds.
| Command | Parameters and effect |
|---|---|
M701 S"name" | Load into the active tool: runs /filaments/name/load.g and records the name. P0 (3.6) records without the macro, P1 (default) with it. Without parameters, reports the loaded filament. Only for tools with exactly one extruder |
M702 (2.02) | Unload from the selected tool: runs that filament’s unload.g and clears the name; P0 (3.6) clears without the macro, P1 default |
M703 | Run the loaded filament’s config.g (temperatures, extrusion factor, retraction); silent when nothing is loaded. Best placed in tpostn.g |
M701 S"PLA"
M702
M703
M750 to M756: 3D scanner extension
Not supported in 3.5 and later. These drive a scanner board attached over USB; if the connection is lost the extension is disabled and the usual communication settings return.
| Command | Effect and parameters |
|---|---|
M750 | Enable the extension (off at start) |
M751 | Register the scanner on USB |
M752 | Scan into the scans directory of the card: S length or degrees, R resolution (2.0, default 100), N 0 linear (default) or 1 rotary (2.0), P file name. Runs scan_pre.g and scan_post.g, which must both exist to avoid errors |
M753 | Cancel the current action (uploads cannot be cancelled) |
M754 | Calibrate, with N as above; runs calibrate_pre.g and calibrate_post.g |
M755 | Alignment: P above 0 on, otherwise or absent off; runs align_on.g or align_off.g first. Some devices light a laser |
M756 | Shut the scanner down |
M752 S300 Pmyscan
M755 P1
M905: date and time
| Parameter | Meaning |
|---|---|
P | Date, YYYY-MM-DD |
S | Time, HH:MM:SS, 24-hour clock |
T | Time zone such as Europe/Berlin (SBC mode, DSF 3.3) |
A | Set the clock automatically by NTP (DSF 3.5.3) |
M905 P2016-10-26 S00:23:12
M905 P"2016-10-26" S"00:23:12" T"Europe/Berlin"
Without parameters it reports the date and time (1.16).
M906: motor currents
| Parameter | Meaning |
|---|---|
X Y Z E… | Peak current in mA; E350:350 gives one per extruder. Peak divided by 1.414 is the RMS figure other firmware uses |
I | Idle current, percent of normal, default 30 and never below 100 mA; one value for all motors. From 2.02, 0 disables the motors after the time-out, as M18 would, and their axes lose homing |
T (3.6) | Idle time-out in seconds, formerly set with M84. T0 is invalid; to keep full current use I100 |
M906 X300 Y500 Z200 E350:350
- It must follow
M584inconfig.g. - Set every assigned driver: one left unset gets a low current (about 1/32 of
its maximum) although
M906reports 0. 60 to 85 percent of the motor’s rating is suggested. - An axis with several motors takes one value, the first given; use identical motors. External drivers set their own current.
- A request above the driver’s maximum is capped; from 3.7, for drivers on a Duet 3 main board, with an error naming the driver.
| Board | Current step |
|---|---|
| Duet 3 MB6HC, 3HC, 1HCL, Motor 23CL | 25.4 mA, to nearest |
| Duet 3 Mini 5+, Expansion Mini 2+ | 74 mA, rounded down |
| Duet 3 Toolboard 1LC | 49.3 mA, rounded down |
| Duet 3 Roto Toolboard | 50 mA, rounded down |
| INDX Toolboard | 3.9 mA, to nearest |
| Duet 2 WiFi and Ethernet | 100 mA, rounded down |
M913 and M917: reduced currents
M913 with X Y Z E values runs motors at that
percentage of their M906 current, for gentle homing or filament
loading; 100 restores it. It waits for motion to stop, except inside the power
fail commands of M911, and takes one value per axis.
M917 (3.01, Duet 3) sets the percentage used while a motor stands
still or moves very slowly, but is not idle: default 71, or 75 on the Mini 5+
and tool boards. When M906 is at 71 percent or more of the driver’s
maximum, the standstill current is capped at 71 percent of that maximum, to
protect the output transistors. It is not supported with TMC2660 drivers on
Duet 2 or with external drivers. In phase stepping mode it sets the minimum
current. From 3.7 it also applies to MB6HC and Mini 5+ boards in expansion mode.
Axes other than X, Y and Z must have been made by M584 first.
M913 X50 Y50 Z50
M913 E30:30
M917 X70 Y70 Z80 E70:70
M911 and M916: power loss and resuming
M911 saves resume data when the supply voltage drops (1.19
standalone; SBC mode from DSF 3.4).
| Parameter (1.20 and later) | Meaning |
|---|---|
S | Save threshold in volts, greater than zero, typically 1 to 2 V under the loaded supply voltage; below 10 disables |
R | Resume threshold, above S; set high to prevent automatic resuming |
P"commands" | G-code to run when the print is stopped |
M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"
When the voltage falls during a print from card, heaters go off, motion stops
at once, the position is saved and the commands run; they typically cut motor
current, retract and lift. With an SBC, give it a solid external 5 V supply so
that resurrect.g gets written. Without parameters the state and
thresholds are reported. RRF 1.19 instead took
Soff:pause:resume,
three rising positive voltages: it paused below the middle one, shut down
heaters and motors below the first, and resumed above the third.
M916 (1.20), without parameters, restores temperatures, tool,
position, mix ratio, height map and so on, and resumes a paused or interrupted
print. /sys/resurrect-prologue.g must exist; it runs after the
temperatures are set and before they are reached, and should home as far as is
safe for the part (use M116 first to wait for heat). In 1.19 use
M98 P"/sys/resurrect.g".
M912 and M914: electronics adjustments
M912 P0 S10.5 adds S degrees to the reading of
temperature monitor P (default 0, at present only the processor’s
own sensor). M914 S3 or S5 sets the expansion signal
voltage, and M914 reports it, in the Alligator board build
only.
M915: stall detection
| Parameter | Meaning |
|---|---|
P, axis letters or E | Drivers to configure: by driver number, by the axes they drive, or by extruder number |
S | Threshold, −64 to 63 (TMC2209: −128 to 127); lower is more sensitive, below −10 not advised, 3 a good start |
F | 1 filtered, one reading per 4 full steps; 0 (default) one per full step |
H | Lowest full steps per second at which detection is trusted, default 200 |
T | CoolStep register, 16 bits; wrong values can starve motors and shift layers. Handled wrongly on TMC2160, 5160 and 2240 before 3.5 |
R | On a stall: 0 (default) nothing, 1 log. From 3.4, 2 or 3 raise an event; up to 3.3, 2 pauses and 3 pauses, runs /sys/rehome.g and resumes |
M915 P0:2:3 S10 F1 R0
M915 X Y S5 R2
- Omitted settings keep their values; with only the drivers named, they are
reported. Added axes need
M584first. - The stall event runs
driver-stall.gwith the driver number inparam.Dand board address inparam.B, or else reports it. 3.4.0 to 3.4.5 raise it only while printing from card. - From 3.6, homing on stall endstops is refused with an error when the settings or speed make detection impossible.
- It does not apply to encoder endstops, nor to drivers in closed loop or assisted open loop mode.
M918: directly connected display
| Parameter | Meaning |
|---|---|
P | 0 none, 1 128×64 ST7920, 2 128×64 ST7567 (3.02), 3 480×320 ILI9488 touch TFT (3.5, not on Duet builds) |
E | Encoder pulses per detent, default 1, typically 2 or 4; negative reverses it |
F (2.03) | SPI clock in Hz, default 2000000; with short cables about 4 MHz at most for 12864 and 15 MHz for TFT displays |
C (3.2) | Contrast 0 to 100, ST7567 only |
R (3.2) | Resistor ratio 1 to 7, ST7567 only, default 6; some displays need 3 |
M918 P1 E2
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