TMC2660 success at last

I was very frustrated with my failure to get the TMC2660 board variation running. I checked and double checked the connections, alas the steppers would not move at all.

I purchased one TMC2660-BOB kit from digikey and started experimenting with it, instead of my board. At first, I had the same failure – the stepper would not move at all. The software was a very simple Arduino sketch – what would be that wrong. Since the kit was designed by Trinamic, the hardware should be proper. Alas, no luck. I declared the TMC2660 chip cursed and moved to my soldering machine project.

Yesterday I decided to give the test jig one more try. After a few failed attempts. I spotted an error in the Arduino code – I was passing the incorrect CS pin in the driver setup. DUH!!! After a quick fix it was working.

Then I moved back to my original goal to test the thermal dissipation ability of my TMC2660 PrntrBoard design. I connected my board and started to torture test the motor driver. Unfortunately I was not able to run the driver past 1.5A RMS, which is a shame. I’ll try using a different motor with higher coli resistance. Anyhow here is an image from my thermal camera of the top of the ship:

The chip has no heat-sink and runs at 54C. This is not bad at all. much cooler than the TMC2130 version. The board seems to be dissipating quite a bit of the energy.

Here is a picture of the bottom of the board:

The bottom is at 45C in the center, which I think is quite good thermal conductivity of the board layers.

I feel good about the board thermal capabilities. If I add heat-sinks on the top and the bottom it should be able to run at 2A RMS and above with active cooling.

Computer vision mishaps

I was planning to add a Raspberry Pi camera on my soldering machine. I used a camera board from China which has the M12 lens mount. There is a variety of M12 lenses and one can play with the focus.

This is the camera board mounted on the soldering head

I finally got everything set up. I discovered this very nice camera streaming web interface package here is a picture of the web interface

The UI is simplistic, but allows control of the camera settings and while streaming is consumes only 3-5% CPU. Well done to the Raspberry Pi foundation and the RPi Cam Web Interface team.

Here is an image I captured with the camera

The focus looks good and the image resolution is very nice. However the vertical blue edge of the plastic mount is supposed to be straight. Not so much on the image. The 3.6mm M12 lens I used on the camera adds quite a bit of distortion around the edged. My other lenses are more on the telephoto side: 6mm, 8mm, 12mm and 16mm. I tired the 6mm lens and the distortion was better, but the field of view was too narrow and wan not capturing the soldering head. I ordered some more lenses which claim “low distortion”. We’ll see it they produce better result.

My initial goal was to capture a series of images and then “stitch” them together with OpenCV. Initial experiments failed miserably. First the lens distortion was confusing the stitching algorithm. I know that OpenCV has camera calibration option which can correct lens distortion, but I’ll try better lens first.

The other issue with the stitching was inconsistent lighting. I tried using my LED photo light, which helped initially. Still the lighting on some spots was low and some spots were too bright and getting lots of reflection from the PCB board surface.

I constructed this new camera head, which allowed me to mount a small ring of LEDs close to the camera.

I seemed like a good idea at the time, however it makes terrible reflections onto the PCB. So back to square one. I’ll make some combination of external photo light as well as some white LED strips. The goals is to have uniform light with minimal reflection and not to obstruct the movement of the machine.

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

The TMC2660 board was a bust

I dusted off my trusty pick and place and made one of the newly received TMC2660 driver boards.

Since it’s the first time I test this setup I populated only one of the driver chips – the X axis.

Alas it was all in vain. After fighting with it for several days, the motor would not spin properly. Either my stepper driver configuration so completely busted (although I double and triple checked) or the driver chip is fried. One of the phases works, but the other sends no current to the stepper motor.

Also I was trying to fit some automotive fuses on the board – you know for protection. Alas the fuse holders I ordered are very flimsy and don’t fit the fuses at all. Ordered a different set, but have to wait.

Bummer 🙁

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:

 

Enclosure for the PRNTR board in OnShape

I finally got annoyed enough by the mess of cables and decided to finish an enclosure for the PRNTR board. I finished designing the bottom half.

This is what it looks like in the OnShape assembly:

View from another angle:

Closeup of the final assembly – the outer fan duct:

A look over the whole board:

And finally this is what it looks like, when powered up:

All 3D component designs are available in OhShape here.

More progress on the Smoothieware for STM32

After a few unsuccessful attempts, I got Smoothie to move my stepper motors on the PrntrBoard controller.

At first the smoothie had a bug in the SPI dirver and was unable to talk to the TMC2130 chips. Fixed that, then the steppers still would not move.

I can see the drivers were sending current, because my power supply would start the fans up, but zero steps. I spend the day trying to diff the configuration between Marlin and Smoothie, but nothing was wrong. Finally caught a bug in the Stepper timers and lo and behold movement.

I’ll make a video of my Rigidbot running Smoothie on STM32 next week.

Smoothieware on the PRNTRboard

Thanks to the huge work by Matt Baker, I now have Smoothieware V1 booting on the Prntrboard. Matt did an excellent job with the initial port of Smoothie to the STM32 series of CPUs. I did some tweaks and added a target for the NUCLEO-64 board I’m using. After a few weeks of work it does boot and I can verify the temperature controller works.

It does not have all features of the original Smoothie board (no SD-card and no Network) but I do have better drivers – TMC2130.

Here is a picture of me testing the hot end heater control:

The heater was set to a “safe” 55 degree Celsius. I would say the PWM control for the heater is much “smoother” on the Smoothieware.

My port of Smoothieware V1 is on github. My working branch is stm32f4. I also have stm32f4-tmc2130 with the TMC patches.

https://github.com/ghent360/Smoothieware-STM32F4

Here is a picture of the heater setup: