New Motor Controller

This is a Dev kit from ST that is a complete Motor Controller in ESC format with 3 current sensors, 3 BEMF, 3 discrete Gate Drivers, Hall sensors, temperature sensors and 28V@120A Solution. The MOSFETS are rated at 120A with 480A pulse, but heat dissipation causes them to be limited to max 40A with hard fan cooling. The kit cost around 20.- USD so I bought 2 of them for testing.

Using ST’s Motor Profiler I got motor data that I imported into their motor workbench, generated a project for STM32CubeIDE, Compiled it and was running the large drone motor in an evening. The generated code include a serial protocol that match their Motor Pilot application and voila – the motor span up.

The Motor Pilot application is shown above running. In this case I have only connected the USB that act as a serial port and I have not switched on the driver power, so the motor driver report and undervoltage alarm as it should.

You receive 90% of the source code. The remaining 10% is in a library that ST preffer to avoid sending out since it contains patented algorithmes, but questioning ST I got an answer that they could send me the code if I signed a NDA with them – so all code is available free of charge.

What impressed me was that I had the large 1,2KW drone motor spinning and controlled without writing a single line of code and still had all required code I needed to work on it myself. I have friends that have tried and not been successfuly in using this kit, and I had problems myself as well. As mentioned before – you need to be willing to try & fail a bit with source code from ST as they have an improving, but far from perfect SW quality. ST is however improving a lot. I have had far less issues with STM32CubeIDE and drivers lately than earlier.

The autogenerated settings worked, but I did not like the ramp-up logic. I managed to tune it so the motor started ok, but I suspect they use a Trapzoidal algorithm to spin the motor up in speed and then take over with FOC as current readings are safe. As they switch the motor over compensated and span forth and back before speed regulation was correct. I managed to fix that without any coding by changing their PID regulator.

The MCU on the kit is STM32G431CB that runs at 170Mhz, 128Kb Flash and 32Kb SRAM. I only use ca 40Kb Flash in the code, so plenty left to play with. G431 have analogue components on-board that makes current sensing easy and fast. Programmable Op Amps allow you to adapt analogue signals to the motor you use etc.

I mentioned this was an ESC, but it also comes with 5Mbps CAN-FD Tranceiver and the total size of the kit is 17 x 41mm – half a finger in size. It has a ST-Link 2.1 attached that you can break off. ST-Link 2.1 have also comes with an UART crossed into the driver and connected to the USB, so by default ST-Link enable a UART as a Virtual Com port that is great for debugging. Another great feature is that I can connect and work on SW without powering the MOSFET drivers – using USB only.

And best of all – I have all schematics, so it is easy to adapt this kit to a more sensible form factor. The dev kit is to small for my usage – I want to change DC/DC to 60V so I can run with 48V + I also want to attach more heatsinks to get more currents out. The small PCB I got have 8 layers and is very dence. Small is not always good in this case.

The picture above show the Wotkbench that basically is a diagram over the SW logic. You click on different parts to get a screen allowing you to edit parameters and then press a button to generate a Cobe project with code.

All in all – if you wanna work on motor controllers this kit is a must in my opinion – it will get you started with full schematics and all source code in a matter of hours. Well done ST!

Leave a Reply