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 have 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 patter 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 github.com .

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.

~V

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.

PrntrBoard first 3D print

I got this cute little 3D printer from the local MicroCenter two days ago. I know, I know, not everyone has MicroCenter around.

Anyhow, the printer is Wanhao Duplicator I3 Mini, it is OEM made for MicroCenter as “PowerSpec” brand. It is not the pinnacle of engineering, but it is quite amazing when it comes to cost cutting. Very minimal design – just the basics, but quite usable.

It has this cute front panel with graphic LCD:

I believe Monoprice sells a version of this printer with better features. It’s a good choice if you are looking to get into the hobby and don’t want to break the bank. The Monoprice version is $50 more expensive, but has way better features like heated bed and wifi support.

Here is a “torture test” I printed with the printer in it’s stock configuration with the sample filament that came with it. It is not bad at all.

The main reason I got this printer was to test my 3D printer controller board (open source designs on github.com here). I wanted something small that would fit on my desk and this printer was an excellent choice. Naturally I butchered it to connect my controller:

After a day of tweaking the Marlin firmware, I managed to get it to work:

I printed for about 3 hour yesterday, constantly checking the motor drivers for overheating, but they were not even breaking a sweat.

The motors are very quiet, unlike my screeching power supply on the video. Next, I’ll have to design a box for the controller, it is quite unsightly sitting like that with all cables.

Making PrntrBoard TMC2130 rev1

New revision (rev1) of my 3D printer controller board arrived a few weeks ago from the board manufacturer (http://jlcpcb.com). I did assemble a prototype with one driver for “smoke test”. Well it did “smoke” only a bit, because I accidentally put one chip in reverse. Lucky for me it was not the Trinamic driver – that one survived.

Anyhow today I made another board – this time with all components populated. Here is how it went up.

Mounted the PCB in an improvised jig to keep it secure on my table. The “jig” is made from 4 small PCBs from a different project. I secured them with blue tape, so they hold the main PCB in place.

Next was aligning the kapton stencil on top of the PCB. The stencil is made by http://oshstencil.com It is not aligned yet.

Here it is aligned on top of the board and secured with another piece of blue tape:

Getting ready to apply solder paste. I use “credit card” squeegee from OshStencil.

Paste away. I usually put too much, but it is easier to have some left over, than scraping the last bit of paste over and over again.

Here it is – paste applied. You can see that my footprint for TR3 needs to be fixed – the paste opening is way too big. Oh well – rev2 I guess.

By the way because my stencil application jig is not particularly sturdy you can see the solder paste is smudged over the fine point IC pads. It is not the end of the world. It makes a few solder bridges, but easily fixable. It is better, when I use solder paste printer, but I don’t have a framed stencil for this board they are $$$.

And it goes in the CHMT48VB pick-and-placer.

And the machine goes – here is a short video clip of the beginning of the job. Note that the board is split in two jobs. The second job is with different set of nozzles. I don’t have the nozzle change in the video – sorry.

The board after all components are placed by the machine. I use the machine only for tedious parts. I place other components by hand.

After manually placing the rest of the SMD parts, the board is ready for solder re-flow. I use hot air gun. I have a T962 oven, but it always seems like too much effort to use it. Here is the result of my hot air application. You can see quite a few bridges on the drivers. Click on the picture for full resolution image.

All cleaned up

Now to solder all true-hole connectors. This is the most tedious and time consuming part. Here it is all done. Front:

And back

I did a quick check and there are no shorts on any power supply lanes. On to testing the firmware.