Skip to main content

Site Navigation

Your Account

Choose Language

RepRapFirmware 3 overview

This page describes the differences between RRF2 and RRF3 and the changes needed to configuration and other system files when upgrading to RRF3.

Note: the information given here is provisional and subject to change.

Overview

RepRapFirmware 3 is the next generation version of RepRapFirmware for Duet 2 WiFi/Ethernet/Maestro, Duet 3, and some other 32-bit motion control electronics. There are significant configuration differences from version 2, so upgrading from RRF 2.x to RRF 3.x is not plug-and-play.

The primary benefits of RRF 3 are:

  • RRF 3 uses pin names instead of logical pin numbers.
  • With RRF 3 you can choose how devices are mapped to I/O pins. For example, you can connect fans to heater ports and heaters to fan ports.
  • RRF 3 supports multiple endstop switches on axes (one per motor) natively. You no longer need to split axes during homing.
  • RRF 3 allows any fan to have an associated tacho input.
  • RRF 3 supports multiple tool probes. As well as a standard Z probe, you can define additional probes for use with the M585 command.
  • RRF 3 supports the large amount of expansion available with Duet 3 boards

The primary configuration differences compared to RRF 2 are:

  • Logical pin numbers are no longer used in M42 and M280. GPIO pin numbers replace them. Before using M42 or M280, the GPIO pin must have been assigned using M950.
  • Endstop numbers are no longer used in M591. Pin names replace them.
  • M585 now uses either an axis endstop or a probe
  • The frequency and pin inversion status of fans and heaters can no longer be set in M106 or M307. These functions are moved to M950.
  • On Duet 2 boards, only 3 fans, 3 heaters, 3 endstop inputs and 2 extruder drives are configured by default. Any additional devices (for examples, heaters and fans connected to a DueX expansion board) must be configured explicitly using M950 and/or M574.
  • On Duet 3 boards there are no pre-configured heater ports, fan ports, or endstop inputs. You must assign the heater, fan and endstop switch ports you require using M950 and M574.

Summary of what you need to do to convert your configuration and other files

  • If you are using a BLTouch (or use use M280 and/or M42 for any other reason), you must create a GPIO port for it using M950 and change your M280 commands in deployprobe.g and retractprobe.g to address that port
  • If you are using a DueX expansion board, you must use M950 to configure any fans, heaters and endstop switches that are connected to the DueX
  • If you are using a Z probe connected to an endstop input instead of to the IN pin on the ZPROBE connector, you must declare that input pin in your M558 command
  • If you create additional axes, you must declare the endstop pins for those axes. If you are only creating additional axes in order to using multiple endstop switches on a single axis, one per motor, you are recommended to use the built-in support for homing the motors individually instead.

TODO: eventually, temperature sensors and other devices connected to analog ports will use pin names too, but this is not implemented yet.

Changes to existing G- and M-commands

G31

  • The T parameter is removed.
  • New parameter K selects the Z probe number. If there is no K parameter then the current Z probe number is used. The current Z probe number is 0 at startup.

If you have only one Z probe then you should not need to change your G31 commands.

M42

  • Before you can use M42 you must create a GPIO port using M950. Then in the M42 command, the P parameter is the GPIO port number, not the logical pin number. Duet 2 supports up to 10 GPIO ports, numbered 0 to 9. No GPIO ports are allocated by default.
  • The F and I parameters are no longer supported in M42. Instead, use the F and I parameters in M950 when you create the GPIO port.

Example - old code:

M42 P3 I1 S0.5 F500  ; set Heater 3 pin to 50% PWM at 500Hz

New code:

M950 P0 C"exp.heater3" Q500  ; allocate GPIO port 0 to heater3 on expansion connector, 500Hz
...
M42 P0 S0.5  ; set 50% PWM on GPIO port 0

M106

  • The A, F and I parameters are no longer supported. Instead, specify the corresponding parameters in the M950 command when you create the fan.
  • If you were using the PB6 tacho input, you must declare this in a M950 command for the fan concerned.

Example - old code:

M106 P2 I1 F25000  ; fan 2 is a 4-wire PWM fan so invert it and use high PWM frequency

New code:

M950 F2 C"!Fan2+exp.pb6" Q25000  ; fan 2 is a 4-wire PWM fan so invert it, use high PWM, tacho connected to PB6 on expansion connector

M280

  • Before you can use M280 you must create a GPIO port using M950. Then in the M280 command, the P parameter is the GPIO port number, not the logical pin number. Duet 2 supports up to 10 GPIO ports, numbers 0 to 9. No GPIO ports are allocated by default.
  • The I parameter is no longer supported in M280. Instead, specify an inverted pin name in M950 when you create the GPIO port.

Example - old code:

M208 P3 I1 S80  ; set Heater 3 pin to 80deg servo position, inverted

New code:

M950 S0 C"exp.heater3"  ; assign GPIO port 0 to heater3 on expansion connector, servo mode
...
M208 P0 S80  ; set 80deg servo position on GPIO port 0

M307

  • The F parameter is no longer supported. Use M950 to change the frequency instead.
  • The I2 parameter is no longer supported, and I3 does the same as I1. You can use M950 to invert the output.
  • You can no longer disable a heater using M307 A-1 C-1 D-1. To use the pin for something else, don't create a heater on that pin; or if there is a default heater on that pin then remove the assignment using M950 with pin name "nil".

Example - old code:

M307 H0 F100  ; change heater 0 PWM frequency to 100Hz
M307 H2 A-1 C-1 D-1 ; disable heater 2 so we can use its pin to drive a fan

New code:

M950 H0 Q100 ; change heater 0 PWM frequency to 100Hz
M950 H2 C"nil" ; disable heater 2 so we can use its pin to drive a fan

M452

  • The P and I parameters are removed. Use the C parameter to select the laser control pin instead.

Example - old code:

M452 P3 I1 F100  ; laser uses heater3 pin, PWM frequency 100Hz

New code:

M452 C"exp.heater3" Q100 ; laser uses heater3 pin,  PWM frequency 100Hz

M453

  • The P and I parameters are removed. Use the C parameter to select the spindle control pins instead.

Example - old code:

M453 P3:4 I1 F100  ; spindle forward/reverse on heater 3&4 pins, PWM frequency 100Hz

New code:

M453 C"exp.heater3+exp.heater4" F100 ; spindle forward/reverse on heater 3&4 pins, PWM frequency 100Hz

M558

  • New optional parameter K selects the Z probe number. If there is no K parameter then the current Z probe number is used. The current Z probe number is 0 at startup. You can ignore this parameter if you have only one Z probe.
  • New parameter C specifies the input pin and the optional modulation pin. The default pins are those on the Z probe connector. If your Z probe is connected to an endstop switch instead then you will need to specify which one.
  • Z probe types 4 (switch connected to E0 endstop input), 6 (switch connected to E1 endstop input) and 7 (switch connected to Z endstop input) are no longer supported. Instead, use type 5 (filtered digital) or 8 (unfiltered digital) and use the C parameter to specify the input. Note, if your Z probe is connected to the Z endstop input, on Duet 2 boards that input is by default pre-assigned to be used by the Z endstop, so you must free it up first.
  • The MOD pin on the Z probe connector is by default assigned to the Z probe, so it is not free for other purposes unless you free it up. In particular, if you are using a BLTouch on the Duet Maestro, you need to free up the MOD pin to make it available for use as the BLTouch control wire.

Example 1 - old code:

M558 P4 H5 F120 T3000  ; Z probe connected to E0 endstop input

New code:

M558 P5 C"e0stop" H5 F120 T3000  ; Z probe connected to E0 endstop input

Example 2 - old code:

M558 P7 H5 F120 T3000  ; Z probe connected to Z endstop input

New code:

M574 Z0 C"nil" ; no Z endstop switch, free up Z endstop input
M558 P5 C"zstop" H5 F120 T3000  ; Z probe connected to Z endstop input

Example 3 (BLTouch on Duet Maestro) - old code:

M558 P9 H5 F120 T3000  ; BLTouch connected to Z probe IN pin
...
M280 P64 S10 ; send control signal to BLTouch through Z probe MOD pin

New code:

M558 P9 C"zprobe.in" H5 F120 T3000  ; BLTouch connected to Z probe IN pin, free up MOD pin
M950 S0 C"zprobe.mod" ; servo/gpio 0 is Z probe MOD pin
...
M280 P0 S10 ; send control signal to BLTouch through servo/gpio 0

M574

  • For backwards compatibility, old-style M574 commands will still work on Duet 2 if they refer only to the X, Y and Z axes and use the standard endstop inputs
  • If you have additional axes, or multiple endstop switches on one axis, or you are not using the default endstop inputs, then you must use a separate M574 command for each axis.
  • New parameter P gives the pin name(s) for the endstop(s) for the specified axis. If the number of pins matches the number of motors assigned to that axis, motors will be stopped individually when their endstop switches trigger.
  • New endstop type S4 means use motor stall detection (like S3) but if there are multiple motors, stop each one individually as it stalls. S3 means use motor stall detection but as in RRF 2 stop all relevant motors when the first one stalls.

Example - old code:

M574 X1 Y1 Z1 U2 S1  ; active high endstop switches, XYZ at min, U at max

New code:

M574 X1 S1 P"xstop"   ; X min active high endstop switch
M574 Y1 S1 P"ystop"   ; Y min active high endstop switch
M574 Z1 S1 P"zstop"   ; Z min active high endstop switch
M574 U2 S1 P"e0stop"  ; U max active high endstop switch

M577

  • Instead of using XYZE parameters to specify which endstops to monitor, use the P parameter to specify one or more pin names. The pin(s) do not need to be exclusively used by M577; for example, it is permitted to specify the name of a pin that has already been declared as used by an endstop switch in a M574 command.
  • The S parameter is removed. The command waits for a high input level. To wait for a low input level, invert the pin name.

Example - old code:

M577 X E0 S0 ; wait until the X and E0 endstop inputs are both low

New code:

M577 P"!xstop+!e0stop" ; wait until the X and E0 endstop inputs are both low

M581

  • Instead of using XYZE parameters to specify which endstops to monitor, use the P parameter to specify one or more pin names. The pin(s) do not need to be exclusively used by M581; for example, it is permitted to specify the name of a pin that has already been declared as used by an endstop switch in a M574 command.
  • The S parameter is removed. The command waits for a low-to-high input transition. To wait for a high-to-low transition, invert the pin name.

Example - old code:

M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card

New code:

M581 P"e0stop+e1stop" T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card

M585

  • You can use M585 to probe until a regular axis endstop is triggered as before.
  • The E and L parameters are removed, instead there is a new P parameter that specifies a probe number. If you want to probe until a custom input is triggered, use M558 to configure an additional probe that uses that pin, then refer to that probe in your M585 command.

Example - old code:

M585 X100 F600 E3 L1 S0 ; probe X until E0_stop goes low

New code:

M558 K1 P4 C"!e0_stop" ; create probe #1 for use with M585, active low
...
M585 X100 F600 P1 S0 ; probe X until probe #1 is triggered

M591

  • The C parameter is now the pin name, not the endstop number.

Example - old code:

M591 P3 C3 S1  ; filament monitor connected to E0_stop

New code:

M591 P3 C"e0_stop" S1  ; filament monitor connected to E0_stop

M670

  • The P parameter is removed. Use the new C parameter to specify the pin names to be used.

Example - old code:

M670 T5 P220:221:222

New code:

M670 T5 C"sx1509b.0+sx1509b.1+sx1509b.2"

New commands

M950

M950 is used to assign pins to heaters, fans and GPIO ports. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P and S parameters.

If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency will be configured accordingly. Otherwise, the current configuration will be reported.

Parameters to M950:

  • Hnn Heater number
  • Fnn Fan number
  • Pnn or Snn GPIO or Servo number (the only difference is the default PWM frequency)
  • C"name" Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. If you use both '!' and '^' then they can go either way round.
  • Qnnn PWM frequency in Hz (optional)

Examples:

M950 H2 C"nil" ; disable heater 2
M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2, PWM at 100Hz
M950 P0 C"exp.heater3" ; create GPIO pin 0 attached to heater 3 on expansion connector
M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled

Pin names

Pin name format

A pin name is a string of characters enclosed in double quotation marks. It is not case sensitive. All instances of _ and - characters are stripped from pin names before comparing them.

Example:

"BED_HEAT"
"bedheat"

These two names refer to the same pin because of the comparison rules.

Some pin names have the form "connector.pin" or "board.pin" where connector or board identifies the connector on the Duet or the expansion board, and pin identifies the pin within that connector or on that expansion board. Sometimes a pin has multiple names.

Example:

"exp.heater3"
"exp.8"
"duex.e2_heat"
"duex.pwm1"
These four all refer to the heater3 pin, either on the expansion connector (where it is pin #8 of 50) or on the heater output terminal block of a DueX2 or DueX5. However, there is a difference. The DueX boards buffer and invert the signal. Therefore, when you use one of the forms prefixed with duex the firmware knows it has to invert the signal, but it doesn't invert it if you use one of the other forms. In contrast, when you referred to logical pin 3 in previous versions of RRF, the firmware always inverted the signal - so if you were driving a servo or BLTouch from this pin you would have needed to use the I1 parameter in your M280 command.

You may occasionally need to invert sense of a pin - for example, if you use a fan output to control the PWM input of a 4-wire fan instead of using it to switch the ground supply. You can indicate inversion by prefixing the pin name with exclamation mark.

Example:

"!fan2"

This means the pin labelled FAN2 on the Duet, but with the drive signal inverted. It is necessary to invert fan outputs when they are used to drive the PWM control wire of a 4-wire fan

When declaring an input pin (e.g. in the M574 command), a '^' character before the name indicates that the pullup resistor should be enabled. Otherwise it is not enabled. Example:

"!^e1stop"

Some GCode commands accept more than one pin name. For example, the M453 command allows you to specify both forward and reverse spindle ports, the M574 command allows you to specify multiple endstop switches per axis, and the M558 command allows you to specify both input and output pins for the Z probe. You can use the + character to indicate multiple pins.

Example:

"z_stop+e0_stop+e1_stop"

Note, if you provide more pin names than the command accepts, the extra ones are likely to be ignored.

Pin names for Duet 2 WiFi/Ethernet

Multiple names on a line are aliases for a single pin. An exclamation mark before the pin name means that there is inversion between the processor and the corresponding output, and that RRF3 will automatically allow for this inversion.

// Duet 2 and DueX heater outputs

!bedheat
!e0heat
!e1heat
exp.heater3, exp.8, !duex.e2heat, !duex.pwm1
exp.heater4, exp.13, !duex.e3heat, !duex.pwm2
exp.heater5, exp.18, !duex.e4heat, !duex.pwm3
exp.heater6, exp.23, !duex.e5heat, !duex.pwm4
exp.heater7, exp.31, !duex.e6heat, !duex.pwm5

// Duet 2 and DueX fan outputs
fan0
fan1
fan2
duex.fan3
duex.fan4
duex.fan5
duex.fan6
duex.fan7
duex.fan8

// Endstop inputs
xstop
ystop
zstop
e0stop
e1stop
exp.e2stop, exp.4
exp.e3stop, exp.9, duex.cs6
exp.e4stop, exp.14, duex.cs7
exp.e5stop, exp.19, duex.cs8
exp.e6stop, exp.24
duex.e2stop
duex.e3stop
duex.e4stop
duex.e5stop
duex.e6stop

// Misc
zprobe.in
zprobe.mod
duex.cs5
connlcd.encb, connlcd.3
connlcd.enca, connlcd.4
connsd.encsw, connsd.7
exp.pb6, exp.29, duex.pb6
duex.gp1
duex.gp2
duex.gp3
duex.gp4

// Pins on additional SX1509B expander
sx1509b.0
sx1509b.1
sx1509b.2
sx1509b.3
sx1509b.4
sx1509b.5
sx1509b.6
sx1509b.7
sx1509b.8
sx1509b.9
sx1509b.10
sx1509b.11
sx1509b.12
sx1509b.13
sx1509b.14
sx1509b.15

Pin names for Duet 2 Maestro

!bedheat
!e0heat
!e1heat
fan0
fan1
fan2
xstop
ystop
zstop
e0stop
e1stop
zprobe.in
zprobe.mod, servo
pson
exp.pa21
exp.pa22
exp.pa3
exp.pa4

Pin names for Duet 3

Duet 3 uses pin name format "expansion-board-address.pin-name" to identify pins on expansion board, where expansion-board-address is the numeric address of the board as set on the address switches. A pin name that does not start with a sequence of decimal digits followed by a period, or that starts with "0." refers to a pin on the Duet 3 main board.

The Duet 3 main board pin names are:

out0, bedheat
out1
out2
out3
out4
out5
out6
out7
out8
out9
out4.tach
out5.tach
out6.tach
io0.in
io1.in
io2.in
io3.in
io4.in
io5.in
io6.in
io7.in
io8.in
io0.out
io1.out
io2.out
io3.out
io4.out
io5.out
io6.out
io7.out
io8.out
servo, out10
pson
spi.cs0
spi.cs1
spi.cs2
spi.cs3

Pin names on the 3-stepper/heater expansion board are:

out0
out1
out2
out3
out4
out5
out3.tach
out4.tach
out5.tach
io0.in
io1.in
io2.in
io3.in
io4.in
io5.in
io0.out
io1.out
io2.out
io3.out
io4.out
io5.out
spi.cs0
spi.cs1
spi.cs2
spi.cs3

Default pin assignments

Duet 2 WiFi/Ethernet and Duet 2 Maestro

bedheat -> Heater 0

e0heat -> Heater 1

e1heat -> Heater 2

fan0 -> Fan 0

fan1 -> Fan 1

fan2 -> Fan 2

xstop -> X endstop switch, low end, active high

ystop -> Y endstop switch, low end, active high

zstop -> Z endstop switch, low end, active high

zprobe.in+zprobe.mod -> Z probe 0

Duet 3

No pins have predefined assignments on Duet 3.

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 4

Past 7 Days: 57

Past 30 Days: 280

All Time: 814