TMC2209 design thermal tests

I did some simple thermal tests on the TMC2209 board. In theory these driver chips can supply up to 2A RMS current to the motors. Silent StepSticks with the same drivers are rated around 1.2 to 1.4A depending on the manufacturer.

The test setup

I used all passive cooling. Ambient temperature was 25C. I used a small 9x9x12mm heatsink on top of the driver chip. These are commonly used on the TMC2209 StepStick boards from China (FYSETC or BIGTREETECH). These are not great, but that is what I could fit in the space. I’ll try to move some of the capacitors to make space for a larger heatsink.

On the bottom I used a 20x14x6 heatsink. Not ideal, but that is what I had laying around. There is enough space for a much larger one (25x25x8 for example).

I used a Seek thermal camera “mounted” on a small microscope stand and connected to my old Nexus 5X phone.

The results

First I tested it at 1A RMS current. I use several very slow speed motion commands (G1 Y250 F50 followed by G1 Y0). I found that slow speed motion is much more challenging to the driver heat  wise.

After about 20 minutes it board heated to about 47C on the top:

The heatsink was barely warm to the touch. In my experiments the top of the drivers always heats up more than the bottom, probably because of the relatively large thermal mass of the PCB itself.

Next I ran the board at 1.4A RMS. This was more challenging test for the heat dissipation. It took a while for the temperature to stop rising. It stabilized at around 64C on the top:

And around 55C on the bottom:

In the picture the heatsink looks “cool” because the camera can not compensate for the different emissivity of the bare aluminum.

Both top and bottom heatsinks were considerably hot to the touch. Not “burn your fingers” hot, but “I cant keep my fingers longer that 5 seconds” type of hot.

In both cases I did not get any over-temperature warnings from Marlin. I would say 1.4A is the limit on convection heat dissipation of this board in this configuration.

The Seek camera has around +/ – 5C accuracy.

I did one last test at 1.8A RMS. This was on the extreme side of the capabilities of the board. The temperature of the driver kept climbing slowly. Once it reached around 75C on the top I got an overheat alarm in Marlin, so I turned the power off.

I’m confident with some active cooling the driver would be able to run at this setting, because it took quite some time to get to the alarm.


Marlin ported to the TMC2209 board

I just got Marlin to boot and move the motors. Had to make some tweaks to the serial port configuration, because I have unique setup (X, Y and Z share one serial port) and the two extruders share another. I also use proper hardware serial ports, not the SoftwareSerial library. At the moment the code requires special patches to the STM32Duino core and the Trinamic library so it can properly support serial half-duplex communication.

On separate topic, I got a prototype of an LCD i/o board for the Nucleo-F407. I tested it with the REPRAP_DISCOUNT_SMART_CONTROLLER and was working flawlessly.

Here it is connected to my soldering machine:

The very first prototype had a bug, hence the little red wire. This adds support for the traditional EXT1 and EXT2 connectors that are popular with other boards. Graphics panels would require a little work, to convince marlin to use the second SPI hardware block.

Some early experiments with the TMC2209 board

Good news first: I managed to get one motor moving with a simple Arduino sketch.

I’m starting to hate QFN packages with a passion. I spent a whole afternoon trying to re-work two pesky drivers. The chips would not communicate via the UART port, no matter what I tried. Finally traced the issue to a bad solder joint on the QFN package and boy these are hard to spot. Simply re-heating the drivers and re-positioning was not enough, I had to remove the chip, add more solder paste, melt it, then re-insert the chip, wipe the excess solder with a soldering iron and finally re-flow the chip one more time. Complete and total PITA.

To top it off this destroys any near by plastic connectors, so now I have the drivers in-place but have to re-solder the connectors back. This would be an endeavor for the next week.

Now all 5 steppers are communicating with the MCU reliably. I had to add support for half-duplex mode to the stm32duino core. The proposed changes are still pending, but I verified that the TMCStepper library is able to communicate with the drivers.

First prototype of the TMC2209 design

This took me whole day. Working with QFN drivers is plain PITA. It does look good though. I just hope it works.

I finally figured out how to wash most of the flux from the board. It is still not perfect, but looks really good.

I have another revision with 3 fuses. I figured that one fuse for both motors and extruder heaters may be too taxing. In my latest design I have one 15A fuse for the heated bed; one 10A fuse for the extruder heaters and one more 10A fuse for the rest of the electronics.

Added some useful features to my Marlin fork

I maintain a separate fork of Marlin with some tweak that enabled features specifically for the PRNTRBoard. The code is located in .

Last weekend I spent some time adding some minor, but useful updates. First I finally got to enable support for the sd-card reader on the Nucleo-F407 board. It took a while because typically Marlin uses SPI to communicate with the sd-card. However the STM32 has much better hardware module (SDIO) which allows excellent transfer speed.

So it took some time to research what is the simplest way to add SDIO support to the Marlin firmware. There was already support for the STM32F1 series CPU, but it was written using a deprecated library (libmaple). Long story short it is working fine now. The code is in the f407 branch.

The second feature I wanted to enable is the ability to store the printer settings. Usually this is accomplished using I2C or SPI EEPROM chip. Alas I did not add one to the Nucleo-F407 board. I added an SPI flash instead.

The difference is small but significant. EEPROM chips are small, but can sustain millions of data re-writes. In contrast SPI flash chips are relatively large (the one I use is 2MB), but can only support around 100k re-write cycles.

There were two possible approaches, one use the sd-card as storage. This was already supported in the Marlin firmware, so I simply ported to code. The disadvantage is that it depends on the presence of an sd-card in the slot.

The second approach is called wear leveling – using the fact that I have relatively large storage and spread the writing operations across many locations in the chip. This way if I spread the write operation evenly across 100 separate locations I’ll achieve 10 million re-write cycles.

The error leveling code is relatively simple. For the curious you can find the changes here.

Next I finally decider to make a converter board for RAMPS style LCD controller modules. The files are checked in the main PRNTRBoard github repository. I placed and order for a few prototypes – they should be arriving in a week or so.

PRNTRboard update

The TMC2130 version of the PRNTRboard is working very well. I’ve been using it for over 6 months on my soldering robot project. It is very stable and reliable.

I didn’t have time polishing the Marlin firm ware for it. I wanted to make the SD-card work on the F407 Nucleo-64 replacement board. Alas every time I look at the Marlin code, I loose all hope and start doing something else.

A few months ago I started working again on the TMC2660 version. This was the first variant I routed successfully, but I ran into trouble with controlling the drivers over SPI and switched my effort to the TMC2130 version. Long story short, when the TMC2130 was in a good shape I started looking back at the TMC2660 version. It is on rev 5 now and I’m really happy with the layout. In my opinion it looks much better than the TMC2130.

I managed to produce a working Marlin firmware for the TMC2660 board and tested a few motors. So far it works like a charm.

My only gripe is that while the mate black finish looks awesome, it is absolute PITA to clean the solder residue from it. I washed this board 3 times and you can still see some spots on it.

As a kick all thru-hole pins on the Nucleo-F407 board underneath are soldered using my soldering robot. On the TMC2660 I soldered the two headers with the robot.

Last but not least I started working on a version with TMC2209 drivers – these are quite capable and low cost compared to other Trinamic offerings.

Extruder thermal control board

For a while now I had this idea – create a small board which controls the extruder heaters and fans.

Why – you ask? Well hear my theory. I have this old printer – the RigidBot. It has dual extruder – all direct drive. However I noticed that when it starts to work my temperature readings become very noisy.

Initially I was puzzled, why the noise. After some investigation I noticed that the noise is present only after the printer motors are on. If I switch the motors off (via G-code command) the temperature line in OctoPrint becomes smooth again. It turns out the motor current is creating EMF interference with the thermisor wire.

So I was thinking instead of routing all these wires back and forth, I can build a small board with a cheap CPU that controls the temperature. I can also outsource the control of the cooling fans and even add local display etc.

All the wires needed would be power and some way to communicate between the main board and the extruder daughter board. Audio cables are relatively cheap and well shielded – I can use one for I2C or Serial communication.

In a dual extruder setup one can save quite a bit of wires: two pairs of power wires for the heaters, two pairs for the thermistors, another two pairs for the extruder fans and one or two pairs for parts cooling fans. All these could be replaced with one pair for power and an audio cable for communication – the rest of the wires are all local to the board. Well one has to mount the board somewhere close to the hotends.

Long story short, the first version of the board was not a grand success. The power supply was very noisy and the temperature readings from the ADC were so unreliable, that it was throwing the PID into a weird loop.

Here is the second installment of the board. The power is now dual stage – a buck converter to 5V and then LDO to 3.3V for the micro controller. The LDO filters the noise from the buck converter.

The brain is STM32F030 micro controller. There are 3 fan connectors with tachometer inputs, so in theory the board can alarm if the fan stops working, just like the Prusa MK3. There are 2 thermistor inputs, 2 heater MOSFETS as well as 2 thermocouple controller inputs – for MAX31855 or MAX31865 or similar.

In the next version the voltage the fans would be select-able to whatever the input is (12V or 24V) or 5V. There is a bunch of unpopulated extension pins and an LCD connector for extra fanciness.

I was testing the PID in Arduino code and it works quite well this time.

Just for fun I decided to try my thermal camera to see if there are any hot spots. The picture is with the heater 1 working.

No surprises, the heater MOSFET is a bit warm. The hottest spot is on the buck converter – 37C. Don’t be alarmed by the bright colors 37C is barely warm to the touch.

I’m still trying to figure out what should I use as software platform. Arduino is simple, but somewhat limiting. The STM32 CumeMX is another option. There is MBed and FreeRTOS options if I want to try multi tasking. Oh decisions, decisions.


Completed redesign of the TMC2660 branch

I spent a lot of time getting the PrntrBoard tmc2130 version to work. I’m at the point where I’m quite happy with it and don’t see major further changes. The tmc2660 branch did not get a lot of attention in the mean time.

So I spent a weekend completely re-designing the tmc2660 board. I ported all changes from the tmc2130 version. There is now a dedicated ground plane layer and routing it much easier.

I opted to put all drivers on one side of the board. Unfortunately limiting the size to 10x10cm (or 3.9×3.9 inches), I could not fit all drivers in one row.¬† Hopefully cooling would not be major PITA as it was on the tmc2130 version.

Here is a screenshot of the 3D rendering of the redesigned board:

Please excuse my mistake, the top row of power connectors is facing backwards. Fortunately these are symmetrical and I can simply solder them the other way.

Here is a view from the top:

I used very aggressive layout for the connectors and I ended with some spare space in the middle of the board. I was thinking to add two automotive type fuse holders for extra protection. I haven’t quite settled on what fuse holder to use. Here are two renderings with the footprints in KiCAD:

And view from the top:

All changes have been pushed to my GitHub design repository page. The version with the fuses is in the tmc2660-fuse branch.

Tested LCD interface

I had one RAMPS discount full graphics controller laying around from my RigidBot. I did use it with the original controller and decided to test it with the PrntrBoard.

In Rev1 and Rev2 of the board I did not have enough pins on the LCD connector to be able to use all buttons on the panel. In the Rev3 I used every last pin of the tiny 64-pin package and I just got enough (or so I thought).

I learned the SPI used by the LCD panel is not very standard and had to fight with Marlin to make the TMC drivers and the LCD co-exist on the same SPI bus.

Finally I was able to use the panel:

One of the pins I used for the button input did not quite cooperate, so I have only one button + the rotary controller for the UI. Lucky for me both Marlin and Smoothieware were functioning with that configuration.

I had to disable the TMC diver monitoring, because the LCD controller was getting confused by the SPI communication with the TMC drivers. I think I can create a small breakout board with a few AND gates to alleviate this interference.

Here is a video of the panel working in Smoothieware:


PrntrBoard TMC2130 redesign is complete

When I was working on the new layout for the TMC2660 branch of the board, I used a dedicated ground plane and turned out this was awesome. It simplified lots of the routing as well as added good heat dissipation capabilities to the board.

I wanted to try and redo the layout of the TMC2130 branch with this technique. In addition I wanted to swap the location of the E1 motor driver and the 5V input connector, before the E1 driver was crammed in the corner and it was challenging to get good routing of the power pins. By swapping the position with the 5V power connector there is a bit more space.

The third thing I wanted to try was to reverse the position of the STM32 NUCLEO board – in the previous design it was sticking out in an unsightly manner.

So here it is new layout all complete. DRC checks pass.

In a slightly different perspective:

You can see the NUCLEO does not block the mounting hole on the lower left corner anymore (MK4).

Here is a look from the bottom:

The motor driver have large area on the bottom for heat dissipation. You can also see the large rectangle area on the bed heater control MOSFET on the top.

I also added a few extra power connectors – two for Vin and two to the 5V rail, to hook cooling fans for the case. You can see two of them on the low left corner in the last picture.

Note: while the last picture shows the STM32F411 CPU, the board actually required the STM32F446 version. The only 3D model I found for the NUCLEO STM32 dev kit was with the STM32F441 part, so that is why it is on the images.