Google Coral TPU dev board power up

I decided that the new machine learning fad is worth exploring. So far I’ve learned very little about it, but I acquired some cool dev kits I wanted to show off.

I got the cool Google TPU dev kit – it is branded Coral. You can read the specs here. The really cool part is that it has the new TPU ML accelerator chip. Not the first such thing to hit the market. But being from Google one would expect some very good integration with TensorFlow.

Here is how my attempt to get it to work went down: You need not one, not two, but THREE USB cables to get the beast to work.

That was rather annoying. You need a micro USB cable for serial console – fair enough and nice of them to include the USB <–> serial adapter on the board. Then you need USB-C adapter for power. Hmm maybe power the thing from the serial console cable – just a though. Ok, I understand that one may need separate cable just for power. These boards suck 2-3 amps on full load. Still could have been nice option. Then you need a third USB-C cable to flash the OS image to the board and for general data communication.

Well I was out of cables :-(. A quick search on Amazon.com revealed this item – 5 pack USB to USB-C cables. Not the most economical solution, but can’t beat the one day shipping.

Here I was today all cable connected following trough the “Get Started” guide step by step.  The setup is mostly uneventful. I won’t bore you with repeating the steps in details – they are well documented:

      • boot in the serial console and enter fastboot mode
      • download the OS image – there are two: the mendel-chef seems to be newer version
      • flash the image using the provided shell script
      • “connect to the internet” part was not needed if you have Ethernet cable. The provided steps are to enable the onboard wifi.
      • the “install Mendel Dev Tool” step was confusing – this is something you have to do on your PC/Mac not on the dev kit itself. It was not obvious to me. Then you’ll have to add the pip local folder to the path or you won’t be able to find the mystery mdt command. The path is in the little blue note in the instructions. Ultimately I skipped that step and enabled SSH instead.
      • run the ML example

I won’t lie, the example is very impressive. You run a command on the dev kit then connect to the dev kit with a browser and it simulates image recognition on a running video stream. You can type “n” in the dev kit terminal to switch between CPU and TPU and marvel at the 10x speed improvement.

A few observations: The board has a 30mm fan which is vary loud, when it runs. The fan runs when you flash the board, then when the OS boots the fan stops. There appears to be some sort of thermal management running.

To me the heatsink gets really hot. According to it’s own temperature report it gets to 60C at idle. To read the temperature from the sensor run:

cat /sys/devices/virtual/thermal/thermal_zone0/temp

It would report a number, divide by 1000 to get the temperature in Celsius. The default threshold for the fan to turn on is 65C. If you want to change it run:

echo 57000 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp

You’ll need to run the above command as root. This example would turn the fan on when the sensor temperature reached 57C. There is a hysteresis of 10C by default, so the fan would turn off, when the temperature reaches 47C.

The OS itself is some offspring of Debian, called Mendel Linux. Not many details are available on it.

I would recommend changing the default password. Then enabling SSH login by editing the /etc/ssh/sshd_config file. Change PubkeyAuthentication to “yes”; uncomment the AuthorizedKeysFile line and switch PasswordAuthentication to ‘yes’. Do the PasswordAuthentication change only after you have changed the default password or you risk strangers logging in your dev kit and compromising it. You can follow this guide how to enable logging in the dev kit without requiring a password. After that you can revert the PasswordAuthentication back to ‘no’ to improve security.

You can now reduce the cable clutter, by first disconnecting the serial console and then the USB-data cable. In my case I use USB-C for power and Ethernet cable. If you want really minimalistic setup, use the onboard WiFi.

The USB-data cable is used to enable Ethernet emulation over USB. You can use it in an environment where you don’t have Ethernet or wireless network.

Google has a mystery tool called Mendel Development Tool – seems it is some sort of wrapper over ssh to allow you to log in the dev kit and copy files. I personally prefer ssh, because I’m familiar with it. The MDT tool works only over the USB-data connection.

Here is a size comparison between the Coral TPU dev board an the small NVIDIA Jetson Nano:

I don’t know much about ML to give you a reasonable comparison which is better. I would suspect both have some strengths and it really depends on the particular use case.

One small observation is that NVIDIA has established community for the Jetson products line and one can easily find answers to all sorts of questions online. By contrast the community for the Coral dev kit is not there yet.

 

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.

Soldering machine improvements

I was very confident in my soldering machine from the tests I conducted the previous week. I decided to program a whole board and try it out.

Alas the confidence was premature and multiple failures ensued. Here is an example

I tried many things, but the soldering wire was hitting the pin and was not melting. I tried re-aligning the needle to point to the solder iron tip instead of the pin. This did not produce improvements at all. I had to aim fairly high to avoid hitting the pin and now the solder was not flowing down and bulging.

I was getting frustrated and decided to look at a few videos of commercial soldering machines for inspiration.

After a few hours I devised a new mount for the soldering needle. The previous mount was allowing adjustments only in the angle of the soldering iron as well as the needle. This configuration seems quite limited. Applying maximum effort here is the new plan:

Now the syringe is mounted on this dual clamp. The clamp allows for both items to rotate. The other end of the clamp is connected to a 3mm steel rod, which adds another degree of rotation. Finally the rod is connected to the mount plate with a plank which allows both: XY movement as well as rotation.

Here is the final assembly after a few dozen failed 3D printing jobs

The new mounting system adds quite a bit of flexibility to the position of the needle that guides the solder wire. Hopefully I’ll be able to find a location which works in most cases.

 

Soldering machine tests

I’ve been running the soldering machine for about 2 weeks. I added a very ugly, but effective fume extractor to the machine head.

It has 40mm fan and a square piece of carbon-activated filter to absorb the fumes. The design is not my best work and is held together with hot glue. However it does work.

Some early failures of the soldering were quite comical:

But some tweaks of the G-Code and it is mostly working now

At this stage it is completely manual programming. No computer vision at all. I’m recording all soldering sessions so they can be used for training ML models later.

My test board is fairly straight forward, so programming the G-Code is not hard. I use a simple C++ program to send the commands to the 3D printer controller. This allows me to add the necessary delay and in the future integrate some processing of the camera image.

I also managed to find an M12 camera lens with much less distortion, to the point that the image no longer needs corrections.