Duet 3 uses a CAN-FD bus to connect expansion and toolboards to the Duet 3 mainboard (currently Duet 3 Mainboard 6HC, Duet 3 Mainboard 6XD and Duet 3 Mini 5+). You can also use a Duet 3 mainboard as an expansion board; see 'Mainboard as expansion board' section below.
We chose CAN-FD because it is highly tolerant of noise (in particular, the ground noise generated by stepper motors), well-supported by modern microcontrollers, and the FD variant has enough bandwidth to support the high movement command rates needed in 3D printing and some other motion control applications.
The CAN-FD bus is a two-wire bus with 120 ohm nominal impedance. The bus should be terminated by 120 ohm resistors at each end.
The Duet 3 Mainboard 6HC has a RJ11 CAN connector and permanent termination resistor, so it must be at one end of the CAN bus. Most Duet 3 expansion boards have two RJ11 connectors and two jumpers which can be fitted to provide termination. If the board is used at the other end of the CAN bus, only one of the RJ11 connectors will be used and the termination jumpers should be fitted. if the board is used at an intermediate position then both RJ11 connectors will be used and the termination jumpers should not be fitted. Although the two RJ11 connectors are labelled CAN_IN and CAN_OUT, they are connected in parallel and it doesn't matter if the cables to them are swapped.
The Duet 3 Tool Board is an exception, because it is too small to accommodate RJ11 connectors. Instead it has a single 4-pin JST ZH connector which is intended to be used for CAN_IN and CAN_OUT functionality. The Tool Distribution Board provides four similar JST ZH connectors. Preferably, connect each Tool Board to the Tool Distribution Board using two twisted pair cables, and remove the two jumpers on the Tool Distribution Board that are provided to bypass that connector. However, unless the cables are very long, you may get away with using a single twisted pair between the Tool Board and the Tool Distribution Board and leaving the jumpers in place.
If a Tool Distribution Board is at the end of the CAN bus, then leave the CAN_OUT RJ11 connector not connected, and fit the termination jumper. On the Tool Distribution Board, CAN_IN and CAN_OUT are not interchangeable.
The Duet 3 Mini 5+ has a 2-pin Molex connector instead of the RJ11 connector, and built-in termination.
The polarity of the connections between boards matters. In all cases, connect CAN_H on one board to CAN_H on the next board, and similarly connect CAN_L to CAN_L.
All connected CAN boards must share a common ground connection. Typically they will all be powered from the same power supply, so this will automatically be the case. However, if you use (for example) one power supply for the main board and a different power supply for an expansion board, you must connect the negative output terminals of the two power supplies together.
Unshielded twisted pair cable is normally used; however over the short cable lengths typical of desktop 3D printers and CNC machines, the cable type is not critical. On very large printers, twisted pair cable must be used.
Twisted pair cables terminated in RJ11 connectors are sold in some countries as "High Speed ADSL cables". One supplier of such cables is Kenable.
You can also make up your own cables. Kits of RJ11 (usually 6P4W) connectors and the corresponding assembly tool are readily available. For the cable, you can buy unshielded twisted pair cable (e.g. Lapp 0035101 has two twisted pairs, so suitable for connecting a Tool Board to a Tool Distribution Board); or buy a length of twisted pair ribbon cable and separate it into individual pairs; or for short distances, use telephone cable.
This image shows a cable made to connect a Duet 3 Mini to a Tool Distribution Board.
The colours of the wires going to the pins on the right is hard to see because they are white with a stripe, as is usual for twisted pairs; but the order of colours is the same at both ends.
Having just the middle 2 pins wired is OK, but they are crossed so this cable is no good for CAN (it's a cable that was supplied with an ADSL or DSL modem). This is common for cables made from non-twisted-pair cable that is either flat with a seam on one side, or half-round.
In Duet 3 systems, each board has a CAN address, which is a number in the range 0 to 126. Each board must have a unique CAN address. The address of the main board is always 0. You can choose the addresses of the expansion and tool boards as you wish, however we suggest the following:
Some boards have default addresses in the range 120 to 126. Therefore we advise against using addresses in this range. However, if you have just one board of a particular type (e.g. just one tool board) then you may leave it at the default address if you wish.
The Tool Distribution Board is purely passive and does not have a CAN address.
The Duet 3 Expansion 3HC board has a 4-bank DIP switch to set the address. The CAN address is set by the switches as follows:
|off||off||off||off||126 (board requests firmware on startup)|
These boards all have a default address as shipped, and revert to that address when the factory reset procedure is used. The default addresses are:
If you have just one of these boards (or at most one of each type) in your system, you can leave the address set to the default. Otherwise you should change the addresses of every board. To do this:
M952 B121 A20
It is possible to run a Duet 3 mainboard as an expansion board. This allows greater flexibility in machine design, with mainboards able to provide more stepper drivers and I/O. To do this:
The first mainboard (6HC, 6XD or Mini 5+) is set up as normal.
Additional 6HC, 6XD or Mini 5+ boards to be used as expansion boards have just a single command in the config.g files on their SD cards, which is M954. You use this with the A parameter to specify the CAN address for that board to use. Give each board a unique CAN address.
To allow for firmware updates via DWC you need to put a special IAP file in the /firmware folder of each mainboard-as-expansion-board SD card:
Duet 3 Mainboard 6HC - Duet3_CANiap32_MB6HC.bin
Duet 3 Mainboard 6XD - Duet3_CANiap32_MB6XD.bin
Duet 3 Mini 5+ - Duet3_CANiap32_Mini5plus.bin
Once you have that IAP installed, firmware updates to all boards can be done by the normal zip file method in DWC on the first mainboard.
Note that mainboards have only a single CAN connector, so the mainboard-as-expansion-board is best made the last board in the CAN chain. If you have any additional expansion boards, they should go between the two mainboards.
The CAN addresses for each board do not need to be in sequential order along the CAN bus.
If you want to daisy chain multiple mainboards, as each board has only a single CAN connector and termination resistors, it is unlikely that you can go beyond 2 or 3 boards in the daisy chain before CAN voltage levels get too low. To overcome this, desolder and remove the CAN termination resistors of the intermediate boards. Newer boards will come with cuttable traces. For wiring, loop-on CAN wires from the one CAN connector.
The Duet 3 series uses the pin name format "expansion-board-address.pin-name" to identify pins on expansion boards, where expansion-board-address is the numeric CAN address of the board. 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 mainboard.
To configure stepper motor drivers, heaters, fans, input/output etc on an expansion board, the CAN address is used as part of the pin name in the Gcode command. Generally, Gcode commands that have a 'pin name' or 'driver number' parameter can reference a CAN address. Prefix the pin name or driver number with the CAN address, for example:
M569 P121.0 S1 ; configure driver 0 at CAN address 121 to go forwards M308 S5 Y"thermistor" P"121.temp0" ; configure sensor 5 to use the temp0 pin at CAN address 121
If there is no CAN address used, the firmware assumes the connector/pin you are configuring is on the mainboard. The mainboard is always configured as CAN address 0.
Some examples of use:
The following example has X and Y motors connected to the mainboard (CAN address 0), 3x Z motors on a Duet 3 Expansion 3HC, and extruder motor on a Duet 3 Toolboard 1LC
; Drives M569 P0.0 S1 ; physical drive 0.0 goes forwards M569 P0.1 S1 ; physical drive 0.1 goes forwards M569 P1.0 S1 ; physical drive 1.0 goes forwards M569 P1.1 S1 ; physical drive 1.0 goes forwards M569 P1.2 S1 ; physical drive 1.0 goes forwards M569 P121.0 S1 ; physical drive 121.0 goes forwards M584 X0.0 Y0.1 Z1.0:1.1:1.2 E121.0 ; set drive mapping
Endstops configured with X and Y endstops at the low end connected to the mainboard, and 3 Z endstops at the high end connected to a Duet 3 Expansion 3HC at CAN address 1.
; Endstops M574 X1 S1 P"io1.in" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin io1.in M574 Y1 S1 P"io2.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin io2.in M574 Z2 S1 P"1.io1.in+1.io2.in+1.io3.in" ; configure 3x switch-type (e.g. microswitch) endstops for high end on Z via CAN address 1
Example of a BLTouch connected to a Duet 3 Toolboard 1LC at CAN address 121.
; Z-Probe M950 S0 C"121.io0.out" ; create servo pin 0 for BLTouch M558 P9 C"121.io0.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds
Sensor 0 (S0, thermistor temperature sensor) and Heater 0 are connected to the mainboard, while Sensor 1 (S1, PT1000 temperature sensor) and Heater 1 are connected to a Duet 3 Toolboard 1LC at CAN address 121.
; Heaters M308 S0 P"temp0" Y"thermistor" T100000 B4138 ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out0" T0 ; create bed heater output on out0 and map it to sensor 0 ... M308 S1 P"121.temp0" Y"pt1000" ; configure sensor 1 as PT1000 on pin 121.temp0 M950 H1 C"121.out0" T1 ; create nozzle heater output on 121.out0 and map it to sensor 1
NOTE: When using M950 to create a heater, RRF 3.4 allows multiple port names to be provided, separated by the '+' sign. The maximum number of ports that may be used depends on the board. Any CAN address at the start of the port name string applies to all the port names. For example, if you were using the 2 heater outputs of a Duet 3 Expansion 3HC as one heater:
M950 H0 C"1.out0+out1" T0 ; create bed heater output on 1.out0 and 1.out1, and map it to sensor 0
There is a limit on the number of ports a heater can use. See the Configuration limits here.
Here the part cooling fan (F0) and hot end cooling fan (F1) are both connected to a Duet 3 Toolboard 1LC at CAN address 121.
NOTE: When using M950 to create a fan, the port name string may be either a single port, or two ports separated by the '+' sign. The second port is used to read the fan tacho. Any CAN address at the start of the port name string applies to both port names.
; Fans M950 F0 C"121.out1+out1.tach" Q500 ; create fan 0 on pin 121.out1 with tacho input on 121.out1.tach and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off M950 F1 C"121.out2" Q500 ; create fan 1 on pin 121.out2 and set its frequency M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on
Unless the bootloader has been corrupted, the expansion board firmware can be updated over CAN. Below are general instructions for updating expansion board firmware; see individual board hardware pages for specific instructions for each board.
Note: after updating expansion board firmware, you must restart the main board or at least re-run config.g in order to create any sensors, heaters, fans etc. that you have configured on that board in config.g.
All Duet 3 main boards, expansion and tool boards have a red LED. Some also have a green LED. On more recent boards, the red LED is labelled STATUS and the green one is labelled ACT (for Activity). On older boards the red LED is labelled DIAG.
The red LED behaviour is:
|Number of flashes||Meaning|
|3||Bad firmware CRC|
|4||The bootloader requested a firmware data block from the main board, but the main board didn't respond in time. Check that the main board is powered and flashing its STATUS LED once per second, then check the CAN connection between the main board and the expansion board.|
|5||The bootloader requested firmware but the main board reported that it didn't have the correct firmware file|
|6||The bootloader requested firmware but the main board reported that the file offset requested by the bootloader was beyond the length of the file|
|7||The bootloader requested firmware but the main board encountered some other error in trying to fetch and return a block of firmware data|
|8||Bootloader internal error (no buffer available)|
|9||Bootloader was unable to initialise the flash memory controller|
|10||Bootloader was unable to unlock flash memory|
|11||Bootloader was unable to erase flash memory|
|12||Bootloader was unable to write flash memory|
|13||Bootloader was unable to lock flash memory|
|14||The VIN voltage was too low to to be considered safe to flash the bootloader|
Note: continuous rapid flashing indicated that the CAN connection is lost.
The green ACT LED behaviour is as follows:
Duet 3 Mainboard with one fitted (6XD, Mini 5+, 6HC v1.02 or later): flashes when sending messages other than time sync messages, and when receiving messages other than regular status messages.
Duet 3 expansion board: flashes when it receives any message, other than a time sync message or a broadcast status message.
If you need to factory reset a board:
The board will reset its address and CAN bus speed to default and request firmware from the main board.
Follow the process for Updating the bootloader on Duet 3 expansion and tool boards.