Converting the E3D Tool Changer to Duet 3 with Hemera Tools (Part 2)

Configuring the Duet 3

The Duet 3 configuration and other system files I use are based on the ones that I published for Duet WiFi/Ethernet running RepRapFirmware 3. They are configured so that X0 Y0 is the centre of the bed. The changes I made for Duet 3 are:

  • Changed all the pin names to the appropriate ones on Duet 3
  • Changed the M569 and M584 commands to swap the X and Z motors over, and to move the coupler to driver 5
  • Added M140 H0 to enable the bed heater
  • Commented out everything to do with tool 2 and 3 and the associated fans, heaters, sensors and extruder motors
  • Changed the X and Y motor stall sensitivity from 3 to 1

I commissioning the system running the Duet 3 in standalone mode. Initially I left the two hot end heaters unplugged. After connecting via Ethernet and loading Duet Web Control, I updated first the firmware to the latest version (which was 3.01-RC3, but stable release 3.1.1 is now preferred) and then the config.g file.

You can find my configuration files at

Test voltages, temperature readings, motors

First check that the two hot ends and the bed are reading room temperature. The Vin voltage displayed by DWC should be close to 24V and the MCU temperature should be only a little above room temperature. If you run M122, the 12V rail voltage reading in the report should be close to 12V.

Now check for correct motor movement:

  • X motor: with the tool pickup near bed centre, set G91 followed by G1 H2 X50. This should move the tool pickup in the +X and +Y direction. Sending G91 G1 H2 X-50 should move it in the opposite direction.
  • Y motor: sending G91 G1 H2 Y50 should move the pickup in the +X -Y direction, and G91 G1 H2 Y-50 should move it in the -X +Y direction.
  • Z motor (check the position of the Z axis first!): G91 G1 H2 Z50 should move the bed down 50mm, and G91 G1 H2 Z-50 should move it back up 50mm
  • Coupler: G91 G1 H2 C50 should move the coupler anticlockwise (looking into the pickup i.e. from the back of the machine), and G91 G1 H2 C-50 should move it clockwise.

Now test homing: Y first, then X, then Z. If they are all working, try a home all. Start with the bed well down, and be ready to turn power off if it isn’t behaving as intended!

If homing is working, try tool pickups.

Test heaters and fans

Make sure no tool is loaded, power the machine down, reconnect the tool heaters, power up, and test heating each hot end and the bed. Make sure that the thermostatic hot end fans turn on at the configured temperature.

Finally, test both print cooling fans.

Fitting the Hemera tools

HemerTCDockRemove and refit the tool 2 and 3 docks with the printed TCHemeraDock parts underneath. This image shows the tool 2 dock.

Tool CAN cable

The CAN cable comprises two unshielded twisted pairs terminated in 4-pin JST ZH connectors. One pair takes the CAN bus out the the tool, the other brings it back to the distribution board. As the cable length between the Hemera tool and the distribution board is reasonably short, it may well be possible to use a single twisted pair, although in that case a small ferrite bead should be placed on each wire, to help suppress reflections. I opted to use two twisted pairs until I have done measurements using a single twisted pair.

2020-03-03 17.52.10

JST ZH connectors are difficult to crimp on account of their small size, so I recommend you use the JST ZH tails supplied with the connector pack and solder the ends to the  main cable. You could make up your own twisted pair cable, but I found it easier to buy some twisted pair ribbon cable on eBay and extract two pairs from it. You could also take a 1m Ethernet patch cable, cut the ends off, remove the sheath, and use 2 of the 4 twisted pairs in in for each tool.

2020-03-03 17.57.23At the tool end I cut the ZH tails down to 60mm so that the cable joins would fit within top of the tool. To save the hassle of soldering and sleeving each joint individually, I used white heat shrink solder sleeves to make the joints. I twisted the pairs of the tails together up to the joint. After making the connections I put a piece of 6mm heatshrink over the joints to hold them all together. I did the same at the distribution board end of the cable, except this time I didn’t cut the tails short. I used 800mm long twisted pairs plus the tails.

Hemera tool wiringThe cable must be wired straight through (i.e. pin 1 to pin 1 and so on), so make sure you connect the same colours at each end. Also check that the coloured tail wires go into the plug in the same order at both ends – I have in the past received ZH tails with the colours not always in the same order.

After that I sleeved the twisted pairs along with the power cable, used heatshrink over the and of the sleeving, and zip tied them to the tool top and the dock – just as for the original Bowden tools.

Distribution board

At the distribution board, the CAN and power wires plug into one of the four positions. Unused positions must have two jumpers fitted to bypass the missing tool. Positions that have tools connected must have no jumpers fitted, unless you are using a single twisted pair to carry the CAN bus.

Filament management

For Hemera tools fitted in docks 0 and 3 you will need about 1.65m of 2mm ID x 4mm OD PTFE tubing per tool to feed the filament from near the spool all the way to the Hemera filament inlet. Tools fitted in docks 1 and 2 need a little less. When I fed the tubing along the obvious route through the hole in the printed part on top of the dock, I found that it fouled the wiring on the Hemera tool, preventing the tool from docking securely. It might be possible to change the printed part to move the tubing closer to the back, right against the acrylic, and sideways a little to avoid the wiring. However, I found it simpler to pass the tubing through the large hole vacated by the Titan and feed it up through the cutout in the top plate along with the wiring, with a zip tie to hold it in place so that it doesn’t touch the belt.

Extending the docks for the Bowden tools

After installing one tool in dock 3, I set about commissioning it. However, it soon became apparent that the additional 25mm depth of the Hemera tools compared to the Bowden tools prevented the pickup head from picking up the Bowden tools. To remedy this, the docks for the Bowden tools need to be moved forward by at least 12mm.

Bowden Tool dock extender

Ideally, new machined aluminium docks would be used. Lacking CNC facilities, I decided to print parts to shift the existing docks forwards. The 2-part design I used is included with my other parts at

You will need to update the Y coordinates in the tool pickup commands in the tpre files for the Bowden tools, and the in the tool dropoff commands in the tfree files, by subtracting 14.8mm from them.

Safeguarding against dropped tools

Hemera tools are heavy, and if dropped during the pickup or drop-off operation they are liable to be damaged when they hit the base of the printer. So I recommend placing a soft landing surface at the bottom, for example foam or layers of corrugated cardboard, covered by thermal insulation, then a sheet of silicone or other heat-resistant material.

Configuration and commissioning the Hemera tool

Connect and configure just one Hemera tool at a time, otherwise you will encounter problems because all the tool boards use the same default CAN address.

Establishing communication and setting the CAN address

First, check the wiring carefully, in particular the polarity of the power connectors at both ends of the power cable between the tool distribution board and the tool, and the polarity of the power wires between the power supply and the tool distribution board.

Next, power up the printer. The blue VIN and red 5V LEDs on the Tool Board should illuminate. If you have the CAN wiring correct, the other red LED will blink slowly, in time with the one on the main board to indicate that the clocks are synchronised. If instead it blinks rapidly, switch off and check the CAN wiring.

Next, establish communication with the Tool Board. By default, tool boards use CAN address 121; except that early shipments of tool boards had the address changed to 10 during testing. So send M115 B121 and you should get the version number returned. You can also send M122 B121 to get diagnostics from the board. If B121 doesn’t work in those commands, try B10.

If the red LEDs flash in sync but you get a timeout response to the M115 B121 command and also to M115 B10, perhaps the tool board is using a different CAN address. If you send M409 K”boards” then you will get a JSON-format report of all boards that have announced themselves to the main board, from which you can identify the CAN address. Alternatively, you can power up the machine while holding button 1 down on the tool board, which will reset it to factory settings (address 121).

You now need to ensure that the firmware version on the tool board is compatible with the  main board firmware you are using. The minimum recommended firmware version is 3.1.1 on the main board and 3.1.0 on the tool boards. So update the firmware if it is older than the recommended versions. To update the firmware on a tool board at address 121:

  • Download the required Duet3Firmware_TOOL1LC.bin firmware file from github to your PC
  • Upload it to /sys on the SD card using Duet Web Control
  • Send command M997 B121

Caution! Initial production tool boards (version 0.6) turn the heater and fans on while doing a firmware upgrade. [There is a hardware fix for this which involves adding a 10K resistor.] If the firmware upgrade succeeds then this shouldn’t be a problem, however if the firmware update fails then the heater could be left turned on. Therefore, either disconnect the heater when doing a firmware upgrade, or watch the LED on the tool board carefully and be ready to turn the power off if it doesn’t go back to flashing in sync with the main board within a few seconds.

When the firmware has updated, change the CAN address. If you have only one tool board then you could leave it at address 121; but if you plan to use multiple tool boards then each one must have a different address. At Duet3D we’ve adopted the convention that tool boards start at address 20, leaving addresses 1 to 15 free for EXP3HC boards (which have address switches allowing any of these addresses to be selected). So I chose to use address 22 for tool 2 and 23 for tool 3 (leaving 20 and 21 free for possible Hemera tools in docks 0 and 1). To change the address of tool 121 to 23, use this command:

M952 B121 A23

Before the address change will take effect you need to reset the tool board, which you can do either by powering down and up again, or by sending M999 B121. After that, send M115 B23 to confirm that the board is responding at address 23.

Configuring extruder drives, heaters, fans and tools

The standard configuration for the Tool Board is heater connected to OUT0, print cooling fan to OUT1 (the 4-way terminal block), hot end fan connected to OUT2 (3-way terminal block), and thermistor or PT1000 sensor to TEMP0. So the configuration commands needed in config.g if you have 2 Hemera tools are along these lines:

; Hemera motors
M569 P22.0 S0                 ; set tool 2 extruder direction
M569 P23.0 S0                 ; set tool 3 extruder direction
M584 E3:4:22.0:23.0           ; set extruder drives

; Hemera sensors and heaters
M308 S3 P"22.temp0" Y"thermistor" B4725 C7.06e-8
M950 H3 C"22.out0" T3
M308 S4 P"23.temp0" Y"thermistor" B4725 C7.06e-8
M950 H4 C"23.out0" T4

; Hemera fans
M950 F5 C"22.out2+out2.tach"  ; Tool 2 hot end fan with tacho
M950 F6 C"22.out1"            ; Tool 2 print cooling fan, no tacho
M950 F7 C"23.out2+out2.tach"  ; Tool 3 hot end fan with tacho
M950 F8 C"23.out1"            ; Tool 3 print cooling fan, no tacho
M106 P5 S255 H3 T50           ; Tool 2 hot end 
M106 P6 S0                    ; Tool 2 PCF
M106 P7 S255 H4 T50           ; Tool 3 hot end
M106 P8 S0                    ; Tool 3 PCF

If like me you start with just one Hemera tool in dock 3, then omit all references to devices on board 22. If you don’t then startup will be prolonged while the main board tries to establish communication with the missing board at address 22. You will also need to configure tool 3 to use extruder drive 2 instead of 3.

To check that all the commands are valid, it’s a good idea to run M98 P”config.g” and watch for error messages.

Now you can check that your new tool gives a sensible room temperature reading, heat it to 60C and check that the hot end fan turns on (at 50C if you are using my configuration).

Setting the Hemera tool heater parameters

As at version 3.1.1, RepRapFirmware does not yet support tuning heaters that are attached to Duet 3 expansion or tool boards. So you will need to use manual tuning. Here’s how to do it:

  • Heat the hot end to a temperature in the middle of the ranger you commonly use, for example 225C. Wait for it to stabilise. If the temperature oscillates, send M307 H# (where # is the heater number) to see what the dead time is set to, then send M307 H# Dnnn where nnn is double that value.
  • When the temperature is stable, send M573 P# where # is the heater number. Do this at intervals a few times to check that you get a reading that fluctuates by only a few percent. Also note the VIN voltage reported by Duet Web Control (it should be close to 24V).
  • Calculate the gain (A) like this: A = (T – Tr)/P where T is the hot end temperature, Tr is room temperature (which you can get from the other temperature sensor readings), and P is the PWM reported by M573. In my case this gave A = 452.
  • Now click on the heater in DWC to turn it off, and make a note of the time (or start a stopwatch). You are waiting for the temperature to drop by 63% of the temperature rise. In my case (hot end temperature 225C and room temperature 21C) the rise was 204C, so 37% of that is 75.5C, plus 21C is 96.5C. In my case it took 3 min 55sec, which is 235 seconds. This is the cooling time constant.
  • To measure the dead time, measure how quickly the heater responds to commands to start or stop heating.
  • Construct a M307 command from those parameters. In my case this was:
    M307 H4 A452 C235 D5.5 V24

    If your tool is identical to mine (aluminium heater block with silicone sock, and standard brass nozzle) then the gain may be a little different (depending on the exact heater power) but the C and D parameters should be much the same.

  • Send this M307 command, heat the hot end to 225C again, and check that the temperature is stable. There should be no undershoot and only a very small overshoot (if any). If the temperature oscillates, try increasing the D parameter by 30% or so.
  • When you are happy with the M307 parameters, copy them into config.g, and delete any existing M307 commands for the same heater in config.g (and config-override.g if you are using it).

Now it’s time to add filament and test extrusion.

Setting up the tool offset and docking position

Before you can attempt to pick up the new tool, you must find the correct XYZ coordinates for successful docking and modify the tpre file for that tool accordingly. So home the printer, then jog the tool pickup until the coupler is in the right position to lock into the tool. Read off the XYZ coordinates and use them to adjust the coordinates of the G1 commands in the tpre and tfree commands for that tool. This is what I ended up with for tool 3.

; tpre3.g
; called before tool 3 is selected

M98 P"/macros/Coupler - Unlock" ; unlock Coupler

M564 S0				; allow movement outside the normal limits
G1 X156.2 Y50 F50000		; move to location
G1 Y104 F50000			; move in
G1 Y119.0 F2500			; collect

M98 P"/macros/Coupler - Lock"   ; close Coupler

;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool!
G1 Z10 F1000

G1 Y50 F4000                    ; move out

M208 Y49			; set Y max for this tool (+90 after offset)
M564 S1                         ; apply the normal limits again
; tfree3.g
; called when tool 3 is freed

G1 Z4 F1000                     ; drop the bed

M564 S0				; allow movement outside the normal limits
;M98 P"purge.g"                 ; purge nozzle

G53 G1 X156.2 Y50 F50000        ; move to location
G53 G1 Y104 F50000              ; move in
G53 G1 Y119.0 F2500

M98 P"/macros/Coupler - Unlock" ; open Coupler

M106 P8 S0                      ; fan off

G53 G1 Y104 F2500               ; move Out
G53 G1 Y50 F50000

M564 S1				; apply the normal limits again

You must also update the G10 tool offsets in config.g. I measured the Z offset to be -5.4mm, and the X and Y offsets to be very roughly +23 and +41mm respectively. So I used this G10 command:

G10 P3 X23 Y41 Z-5.4 ; Set tool 3 axis offsets

The X and Y offsets will be need to be set more precisely when you do multi-tool prints; but for single tool printing only the Z offset is critical.

I also found the pause position to be unsuitable using the new tool. My new pause.g file is this:

G91                        ; use relative positioning
G1 H2 Z5 F5000             ; lift Z 5mm
G90                        ; back to absolute positioning
G53 G1 X-175 Y-148 F50000  ; move out the way

Due to the depth of the Hemera tool, the maximum available Y position for the nozzle is about +90mm, 10mm inside the edge of the bed. So I set this less the 41mm tool Y offset as the upper Y limit in M208, use M564 S0 at the start of each tool change file to allow movement outside this limit, and M564 S1 at the end. The Bowden tool change files are similar, except that the Y limit is set to +66 (which is the +105mm reachable by the nozzle less the nozzle Y offset of 39mm).

You can find my complete configuration files at

I subsequently made some improvements to the Hemera tools, described in Part 3.

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Converting the E3D Tool Changer to Duet 3 with Hemera Tools (Part 2)

  1. John says:

    David, this is awesome. I’m in the process of building an e3d tool changer right now with a Duet 3 and this will help tremendously!

  2. Hi David,

    Thanks for writing this! I think I’m going to give it a try. I have been working on converting T2 & T3 to Hermera’s using Greg’s designs, but I have struggling to get reliable results. Hopefully this will help with that.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s