These pages have been written to help customers use the version 0.5 prototype and version 0.6 first production Duet 3 main boards.
Minimum configuration with Raspberry Pi
- Duet 3 main board
- Raspberry Pi. Initially this has to be Model 3B or 4 but we may support some other models in the future.
- Ribbon cable to connect the Raspberry Pi to the Duet. If using the version 0.5 Duet 3 main board, this must be 40-pin. If using a version 0.6 and later Duet main board, use 26-pin to 40-pin. Recommended length is 100 to 150mm. Longer cables will degrade the SPI signal between the Raspberry Pi and the Duet.
- Power supply (min. 12V. max 32V, recommended 24V) and cables
- Stepper motors, heaters, thermistors, endstop switches etc. as required
- Duet 3 expansion board(s) and/or tool boards
- RJ11 twisted pair cables to connect the expansion board(s). When connecting a version 0.5 Duet 3 main board to an expansion board, the wires must be crossed. When connecting a version 0.6 or later Duet 3 main board to an expansion board, or connecting two expansion boards together, the cable wiring must be straight-through. Only a single twisted pair is required, connected to pins 3 and 4 (the middle 2 pins) of the connector. Pins 2 and 6 on the version 0.6 Duet 3 main board are the connections for the secondary CAN bus, but the firmware does not use this yet.
- 2-core red/black cable to daisy chain power to the expansion board(s)
Connecting it up
Here is a photo showing a bench setup comprising a version 0.5 Duet 3 main board, Raspberry Pi 3B+, and one early prototype Duet 3 expansion board. Caution! Note the orientation of the 40-pin ribbon cable. The connector on the Raspberry Pi is not keyed, so be very careful to connect the ribbon cable the right way round and in the correct position. Caution! Note the order of the VIN + and - terminals on the Duet 3 main board (the red wire is +ve), which is not the same as on Duet 2!
The position of the ribbon cable may appear awkward. However, our intention is that the Raspberry Pi be mounted below or above the Duet, so that the USB and Ethernet connectors on the Raspberry Pi line up with the right hand edge of the Duet. It's also possible to position the Pi on the opposite side of the Duet and run the ribbon cable underneath the Duet, but this requires a 200mm long cable.
On the version 0.5 board, the Raspberry Pi is always powered from the 5V regulator on the Duet. This is satisfactory as long as you do not power high current devices from the Raspberry Pi. On the version 0.6 board, jumpers are provided to allow you to select whether the Duet powers the Pi, the Pi powers the Duet, or neither.
If you connect one or more expansion boards via CAN as shown in the photo, you must install the two CAN termination jumpers on the last board in the chain, but not on any additional boards in the middle of the chain.
Running in standalone mode
Version 0.6 main boards have the ability to run without the Raspberry Pi, by inserting a micro SDHC card in the socket on the Duet and using the local Ethernet port to connect to your router. We do not supply this SD card. The SD card must be populated with configuration files, homing files and web server files exactly as for a Duet 2 running RepRapFirmware 3. The board will run in standalone mode if the SD card is present and contains a sys/config.g file; otherwise it will wait to be contacted by the Raspberry Pi or other single board computer.
A PanelDue can be connected to connector IO_0 using a 4-core cable wired like this.
Updating Duet 3 main board firmware
There are three ways of updating the main board firmware:
- If using an attached RPi, you can update the firmware in Duet Web Control as usual
- If running standalone using the Ethernet port on the Duet to provide the network interface, you can update the firmware in Duet Web Control as usual
- Via USB
To update via USB:
- You will need to install Bossa 1.9.1 from https://github.com/shumatech/BOSSA/relea... on your PC.
- Place a jumper across the ERASE pins on the Duet 3 and power it up to erase the firmware. The Bossa port should appear on your PC (if it doesn't, try pressing the Reset button).
- Remove the ERASE jumper, load Bossa and select the correct COM port. It should identify the device as ATSAM70x20.
- Check the Erase All, Boot to Flash and Lock boxes
- Browse to the firmware binary, and select Write.
- When that completes, select Verify.
- When that completes successfully, press the Reset button on the Duet 3 to restart the Duet in normal mode.
Updating Duet 3 expansion board firmware
Unless the bootloader has been corrupted, the expansion board firmware can be updated over CAN.
- Ensure that the correct expansion board firmware binary (for example, Duet3Firmware-EXP3HC.bin for the 3-driver high current expansion board) is present in the /sys folder (on the RPi if using it, or on the SD card if running standalone)
- If the expansion board is already communicating with the main board, send M997 B# where # is the address of the expansion board. The expansion board will commence a firmware update and the DIAG LED will go out for a while. When the update is complete, it will flash and re-sync with the main board.
- Alternatively, set the expansion board address to zero (switches all off) and press the Reset button on the expansion board to commence the firmware update (or power down, change the switches, and power up again). When re-syncing is complete, change the switches back to the correct board address and press Reset again (or power down, change the switches, and power up again).
- You can check the firmware version installed on an expansion board by sending M115 B# where has is the board number.
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.
The bootloader flashes the following error codes on the DIAG LED on the expansion board:
- 2 flashes: invalid firmware
- 3 flashes: bad firmware CRC
- 4 flashes: the bootloader requested a firmware data block from the main board, but the main board didn't respond in time
- 5 flashes: the main board reported that it didn't have the correct firmware file in its /sys folder
- 6 flashes: the main board reported that the file offset requested by the bootloader was beyond the length of the file
- 7 flashes: the main board encountered some other error in trying to fetch and return a block of firmware data
- 8 flashes: bootloader internal error (no buffer available)
- 9 flashes: bootloader was unable to initialise the flash memory controller
- 10 flashes: bootloader was unable to unlock flash memory
- 11 flashes: bootloader was unable to erase flash memory
- 12 flashes: bootloader was unable to write flash memory
- 13 flashes: bootloader was unable to lock flash memory
If the bootloader becomes corrupted
The bootloader can be reprogrammed using the SWD connector. If using an Atmel ICE to do the programming:
- Connect the following 5 wires from the SAM output cable to the corresponding pins on the expansion board SWD connector: Reset, Gnd, VccRef, SWCLK, SWDIO
- Provide VIN power to the expansion board
- Load Atmel Studio (requires Windows)
- Select Tools -> Device Programming, and select the Atmel ICE from the list of connected tools
- Set the processor type to ATSAME51N19A, the interface to SWD, and click Apply.
- Click on the Read button next to Device Signature to verify connection with the target MCU.
- Under Memories, browse to the Duet3Bootloader_EXP3HC.bin file. You must use the .bin file not the .elf file, because if you use the .elf file then you will get verify errors.
- Check that the Erase Flash and Verify Flash boxes are checked, then click program.
- Immediately after programming, the Diag LED on the expansion board should resume blinking to indicate that the firmware is running.
Duet 3 Mainboard v0.5 wiring diagram
Click on the image for a larger size version
Duet 3 provides the following connectors:
6-way barrier strip: two pins for main VIN and GND; two pins for the VIN and GND supply for the OUT_0 terminals; and positive and negative OUT_0 terminals. OUT_0 is intended to drive a bed heater. The ground side of OUT_0 is switched by the mosfet and the positive side is protected by a 15A fuse.
2-pin green terminal blocks OUT_1 thru OUT_3: these are intended for extruder heaters or fans. Maximum recommended current 6A each. If you connect inductive loads to these outputs, you must use external flyback diodes.
4-pin KK connectors with offset spigot OUT_4 thru OUT_6: these are intended for PWM-controllable fans. The connector fits a standard PC-type 4-pin PWM fan. Alternatively, a 2-pin fan may be connected between the V_OULCn pin (+ve) and the OUT_n_NEG pin (-ve). The positive supply to these connectors is the centre pin of the 3-pin jumper block labeled OUT4-OUT6_Select. A jumper in the top position will power them from the fused VIN supply. Alternatively you can connect a 3-terminal buck regulator to the 3-pin jumper block to supply the required voltage to the centre pin.
Caution! On v0.5 boards the GND and V_FUSED legends on the underside of the board are the wrong way round! The ones in the wiring diagram above are correct. This is the same for the jumper block OUT7 - OUT9 that provides power to these connectors respectively (see below).
2-pin KK connectors labelled OUT7 thru OUT9: these are intended for fans. Maximum recommended current 2.5A each. Flyback diodes are built-in to these outputs.
5-pin KK connectors labelled IO_0 thru IO_8: these are for endstop switches, Z probes, filament monitors and other low-voltage I/O functions. Each connector provides both 3.3V and 5V power. The inputs will tolerate up to 30V. The outputs are 3.3V signals levels with 470R series resistors.
Caution! On v0.5 boards, do not connect anything to the OUT pin of the IO_5 connector, because on the prototype boards this pin is used to signal to the Raspberry Pi. The IO_5_OUT pin will be available on later version boards.
Caution! The pinout of the 5-pin connectors is not the same as on the 5-pin Z-probe connector fo the Duet Maestro! It has been changed to reduce the risk of shorting +5V to +3.3V.
3-pin KK connector labelled SERVO: this provides a 5V servo-compatible control signal and 5V power.
2 pin KK connected labelled RESET_EXT: for an external normally-open reset switch.
3-pin KK labeled PS_ON: open drain mosfet output for controlling an ATX-style power supply or a SSR. The +5V pin can also be used to provide external 5V power. A small amount of 5V power can be drawn from this pin (through an internal 220 ohm resistor), so that the control terminals of an SSR can be connected directly between the +5V and PS_ON pins. Note: on the v0.5 board this connector is rotated 180 degrees compared to the intended orientation on later version boards.
2-pin KK labelled GND and V+: This is for powering an always-on fan or similar. Caution! On v0.5 boards the GND and V_FUSED legends on the underside of the board are the wrong way round! The ones on the top are correct. Note: on the v0.5 board this connector is rotated 180 degrees compared to the intended orientation on later version boards.
2-pin KK labelled TEMP_0 thru TEMP_3: connections for thermistor or PT1000 sensors.
2x5 header: This is for connecting PT100 and thermocouple interface boards (the same boards that the Duet 2 series uses).
4-pin DotStar connector: This is to connect and power DotStar LED strips. Caution! The total current draw of the Raspberry Pi (including any attached USB devices), DotStar LEDs and other devices powered from the 5V and 3.3V rails on the Duet must not exceed 3.5A.
6-pin SWD connector: This is for firmware debugging and also provides a backup mechanism to program expansion boards.
Diagnostic LED: this blinks continuously when the main board is running normally, about half a second on and half a second off. The expansion board also has a diagnostic LED. When the expansion board starts up this LED will blank rapidly. If the expansion board is connected to a main board running compatible firmware, the LED on the expansion board will switch to blinking synchronously with the main board LED once time sync has been established across the CAN bus.
Duet 3 Expansion board, 3-channel
Duet 3 RepRapFirmware notes
Duet 3 runs RepRapFirmware 3, which supports flexible pin allocations so that any output pin can be used to drive a heater, fan or other device. No temperature sensors, heaters, fans, endstop switches or Z probes are defined by default; so you must define the ones you want using appropriate commands in config.g. See RepRapFirmware 3 overview.
Duet Software Framework on Raspberry Pi
Duet Software Framework is the bundle of software programs running on the Raspberry Pi that connects to and controls the Duet 3.
DuetPi is the official Debian image based on Raspbian that is customised for the Duet 3. If you are not very familiar with the Raspberry Pi, it is strongly recommended to use it instead of the stock Raspbian image.
There are two versions of DuetPi available, one with and another one without GUI:
These versions are targeted at ARMv7 processors like the Raspberry Pi 3 or 4.
Once downloaded, use a flashing application like Win32DiskImager or baleanaEtcher. You can follow the official Raspberry Pi instructions for further details.
When the image of your choice has been flashed, the Duet 3 can be connected to via the hostname "duet3". It comes preconfigured with mDNS enabled (via avahi), SSH activated and the standard credentials "pi" and "raspberry". To set up WiFi, you can edit "wpa_supplicant.conf" on the SD card (first partition).
As soon as your Raspberry Pi has established an internet connection, it is recommended to install the latest updates. To do so, connect via SSH (e.g. via PuTTY) to your Raspberry Pi or open a terminal and run
sudo apt-get update sudo apt-get upgrade
This will install the latest software components and the latest RepRapFirmware version on your Duet 3.
Raspbian Setup Guide
If you have the latest Raspbian image installed on your Raspberry Pi, follow these instructions to get started with DSF. These steps are obsolete if you are using DuetPi.
To provide a controller base for the Duet, the first SPI port on the Linux controller board is used. If Raspbian operating system is used, the SPI driver can be enabled by doing the following steps:
2. Navigate to 5 Interface options
3. Go to P4 SPI
4. Confirm to enable the SPI interface
This will ensure the SPI driver is loaded and Duet Software Framework can use it for communication to the Duet board.
Once done, run
and verify that /dev/spidev0.0 has been created. This device node is required for DuetControlServer. If you wish to use another SPI device, adjust the SPI values in /opt/dsf/conf/config.json before starting DuetControlServer.
Please note that DCS uses SPI buffer sizes of 8KiB whereas the default Raspbian buffer size is limited to 4KiB. In order to change it, you can adjust the boot arguments by creating a new file /etc/modprobe.d/spidev.conf:
echo "options spidev bufsiz=8192" | sudo tee /etc/modprobe.d/spidev.conf
After that, restart your system to apply the new buffer size.
To obtain the required software packages on a Debian-based distribution running an ARMv7 processor (RaspPi 3 or newer) execute the following commands:
wget -q https://pkg.duet3d.com/duet3d.gpg wget -q https://pkg.duet3d.com/duet3d.list sudo mv duet3d.gpg /etc/apt/trusted.gpg.d/ sudo mv duet3d.list /etc/apt/sources.list.d/duet3d.list sudo chown root:root /etc/apt/trusted.gpg.d/duet3d.gpg sudo chown root:root /etc/apt/sources.list.d/duet3d.list
If you wish to use the latest unstable DSF components, you can run the following commands instead:
wget -q https://pkg.duet3d.com/duet3d.gpg wget -q https://pkg.duet3d.com/duet3d-unstable.list sudo mv duet3d.gpg /etc/apt/trusted.gpg.d/ sudo mv duet3d-unstable.list /etc/apt/sources.list.d/duet3d-unstable.list sudo chown root:root /etc/apt/trusted.gpg.d/duet3d.gpg sudo chown root:root /etc/apt/sources.list.d/duet3d-unstable.list
Please be aware that the unstable repository is meant for beta testers and that it can contain experimental code. For production use, the stable repository is strongly recommended.
In case you are coming from chrishamm's package feed, make sure to remove it:
sudo rm /etc/apt/sources.list.d/chrishamm.list
Once there, you can install HTTPS support for APT, update the package feeds, and install the DSF bundle:
sudo apt-get install apt-transport-https sudo apt-get update apt-get install duetsoftwareframework
Duet Control Server
Now you have installed Duet Software Framework, but none of the services has been started yet. As a first step, it is important to start the main application of DSF called Duet Control Server. To do this, make sure you have the Duet 3 connected to your Linux board via the ribbon cable and run
sudo systemctl start duetcontrolserver
This should complete without an error. If it fails, check why it did so by running
sudo journalctl -u duetcontrolserver
To make it start automatically on boot, run
sudo systemctl enable duetcontrolserver
If you wish to change parameters of the DCS configuration, edit /opt/dsf/conf/config.json. To revert to factory defaults, you may delete this file as well and restart DCS. In this case, DCS will restore it automatically.
Duet Web Server
Once DCS has been started, you can start the web server which provides the web interface. This can be achieved by running
sudo systemctl start duetwebserver
If that fails for some reason, run
sudo journalctl -u duetwebserver
to figure out why. Once it has been started, you can make it start on boot as well by running
sudo systemctl enable duetwebserver
If you wish to change parameters of the DWS configuration, edit /opt/dsf/conf/http.json.
Duet Web Control
For your convenience, Duet Web Server serves the user interface, Duet Web Control, from the /www folder of the virtual SD card directory (see below). This effectively mimics the old behaviour of previous Duet controllers. Once DWS has been started, open a browser of your choice and go to http://127.0.0.1. If you do not wish to connect manually every time you do this, you can specify the hostname of your Linux board instead of 127.0.0.1 as well (e.g. rasperrypi on Raspbian).
Virtual SD card
The first SD card (0:/) is emulated by DCS and its default directory is /opt/dsf/sd. It may changed by editing the BaseDirectory value in /etc/dsf/config.json.
Firmware update on recent versions (DCS >= 22.214.171.124)
Before you can update DSF, it is important to install the latest RepRapFirmware version first. If you are using recent DCS (>= 126.96.36.199) and RRF versions, you can put the updated Duet3Firmware.bin file in the /sys directory and run "M997". This will trigger a firmware update. For convenience, you can simply upload Duet3Firmware.bin on the System page of DWC2 and confirm the update.
The latest firmware file can be obtained here: https://github.com/dc42/RepRapFirmware/r...
Firmware update on older versions and fallback method
If you are upgrading from older DSF/RRF versions, you have to put the Duet 3 into flashing mode before you can proceed. To do this, run "M999 PERASE" (without quotes) either from the web interface or from localhost (you may use /opt/dsf/bin/CodeConsole for this). That will put the Duet 3 into flashing mode.
If you already updated DSF and DCS cannot connect to RepRapFirmware any more, you can use a serial terminal (e.g. minicom on the RaspPi -> /dev/ttyACM0) to send "M999 PERASE". This step presumes the Duet 3 is connected to a USB port on the RaspPi. Alternatively, you can use your computer to perform the same step.
To install the latest firmware version, execute the following commands:
rm -f ./Duet3Firmware.bin wget https://chrishamm.io/Duet3Firmware.bin /opt/dsf/bin/bossac -u /opt/dsf/bin/bossac -e -w -v -b ./Duet3Firmware.bin -R
Since DSF is provided as a standard Debian package feed, the update is quite trivial. To update it, run a standard system update on the attached SBC:
sudo apt-get update sudo apt-get upgrade
This will automatically install the latest DSF components.
If you start DuetControlServer and DuetWebServer in terminals then the debug output is available for monitoring. Run these two commands in separate terminals:
sudo /opt/dsf/bin/DuetControlServer sudo /opt/dsf/bin/DuetWebServer
In case you get a message saying DCS is already started, make sure to stop it first as well as the web server:
sudo systemctl stop duetwebserver sudo systemctl stop duetcontrolserver
In case you encounter problems (crashes, bugs) with DSF, please feel free to check out the official GitHub issues page. In any case, please make sure to update your DSF/RRF before you report any bugs.
The GitHub issues page can be found here: https://github.com/chrishamm/DuetSoftwar...