3-4-phase – Motor Controllers

I have a load of motor controllers that I want to continue on, but to focus on the more advanced ones.


This is an early draft of rev 1.1 of the MC4X controller. Notice the heavy wiring at right to support 50A + all components top-side so I can add heat-sink on the PCB. All transistors have pad’s and being cooled at bottom. Two temp sensors added between MOSFET’s.. INA194 as Current Sensors, CAP’s on the PCB etc.

The results from the previous 1.0 version was actually so promissing that I am looking forward to this one. But, it is still work in progress.


This has been in the pipe a few weeks. It is a dedicated 3-phase controller. It is 15mm more narrow than MC4X60V50 and uses DRV8301. I want to do an upgrade before I ship for this – some of the small capacitors are 0603 and need to support 60V – that will not work + I need a better place to mount the main capacitor.

Comparing MC3P and MC4X I must admit that I get a lot of functionality for those 15mm extra. MC3P is a bit smaller, but MC4X can do the same and more. I still want to do MC3P because I want to play with DRV8301. ANother change is that I consider putting wires on top so I can use a 100x25mm heat-sink on PCB-bottom.

Another concern is that I on this planned thick PCB lanes on power – simply creating a thick solder path. I am considering upgrading that to wires like I did on MC4X.


This is the smaller of the 60V design. First test failed at 35V, but I have been advised to make a change on the DC/DC that I want to try out.


This is the smallest based in DRV10983. It works, but I am not impressed over DRV10983 speed regulation. I will find more time to play with the I2C interface on this, but I need to see a better controller if I am to continue with it.

CAN Interface

I finally got revision 1.1 of these boards yesterday, so I can get on with this adapter. The main error on 1.1 was lack of crystal and I realized I needed the crystal for USB as I tested.

I like CubeMX, but I fail to undestand “designers” that want to create a “HAL” and only do low level, MCU specific interface. In this example I would have liked a function to select bitrate, but are left with setting up loads of timing details.

Even more annoying was that the generated project for STM32F105RB do not want to compile due to lack of files. This is where auto-generation and I usually separate.


CubeMX FreeRTOS Config

The config system in CubeMX allows you to configure and generate code for all components you have included, including FreeRTOS and libraries. This page show the config for FreeRTOS and it allows you to create a list of Tasks as well as message queues.

The folders on top are

  • Config Parameters
  • Include Parameters
  • User Constants
  • Task & Queues (shown here)
  • Timers and Semaphores
  • FreeRTOS Heap Usage

The reason why I like this is because I don’t know FreeRTOS and within a few clicks I am using it and on my way into functionality. FreeRTOS is also included in ESP32 IDE supporting multiple cores and have been around for years.


This shows the STM32CubeMX for my 3 x RS-X PLC Module. I find this tool to be quite usefully as it allow you to set up the clock, configure each function and wire the MCU. It also generate a nice PDF document with all details as well as a starting project with all init code as well as FreeRTOS should you want it.

The generated code opens in System Workbench for STM32 and the only complain is that they only support C. But, you should be able to get C++ with a bit of manual work.

It all works well with a low cost ST-Link, so you are on your way blinking a status led within minutes.

System Workbench for STM32 is far behind CoIDE and CooCox, but I still use CoIDE 1.7.8 and as CooCox seems to be down (?) I need to move on. My main concern is lack of C++ support which sadly is very common in many embedded IDE’s. Returning to STM32CumeMX, this tools is free from ST and a big time saver. It download latest drivers and give you working examples on how to initialize the MCU. It also warns you about wiring conflicts and does the job of setting up the complex clock.

PLC Assembled – 1st test

Been a lot of motor controllers lately so I finally decided to assemble part of my PLC system. What you see here is the motherboard with a simple RS-X module connected. Not all components are assembled yet, but processor is alive. This board have 3 x fully galvanic isolated RS485 circuits and a 2 x 10Mbps backbone. It was selected because it’s a good, simple starting point for SW development.

The STM32F405RG is excellent for Plain. With it’s 1Mb Flash and 196Kb SRAM it is an excellent test bench. I need to make a similar module for CAN, but that can wait.

I must admit it is a bit of nostalgia to work with something that looks like one of the computers I assembled in the 80ts.

I only ordered one module because I want to play with the mechanical design a bit before I start adding modules. I notice far more issues with a physical module than with a 3D module.

The MCU is currently ticking on 8Mhz using the internal RC, so it will be interesting to see if I got this right and are able to tick the MCU at 168Mhz with 3 x 180Mhz DC/DC converters on the same module.

60V Limitation

Investigating the issue one option is that what snapped the TSP54060’s is that my PCB tracks are to close for 60V. You need close to 3000V per cm to create an arch and that is 30V per 0.1mm. I can’t see a weak point, but those pins are 0.2mm apart. A bit of extra solder tin on them is all that is needed and 35V is suddenly dangerous. Again I can’t really see anything, but I realized that a MSOP might be to small to actually support 60V safely.

I will try a different circuit, but I will also knock up a few test circuits with different DC/DC designs to see if I can find a stable 60V design. In the meanwhile I will test on 24 and 12 V because I also want to test he actual motor driver. I also realize that as DRV8313 also have 0.2 mm between pins and I actually limited that to 0.15mm as I widened the tracks – I might have a second 60V issue here. Now 60V was never a main objective on this small controller and I am not sure this is the problem, but standards indicate that I need more distance.

TPS54060 breaks at 35V

I received the MC3X60 Motor controller PCB’s yesterday and as always it is awesome to see how small my designs are. As this is the first time I use TSP54x60 I instantly assembled this to test and was pleased to see 3.4V out.

This circuit worked well giving 3.4V out with input from 12 to 30V, but TPS54060 snaps as I try 35V input.

I received MC3X60V yesterday and was very pleased to see the DC/DC actually working. I had to adapt values to E24/E48 series – R7 became 240K, R6 became 75K, R4 became 33K, but it gave 3.4V out which is fine. I can adjust it back with a E48 combination of R4/R5 later, but the requirement is actually 3-3.6V. As I turned up the Lab PSU Input it works perfect up to 30V input, but snaps as I try 35V. Exact same behavior on two different TSP54060 chips so far. 

This was a bit disappointing because it should not have snapped before I reach 65V, but I will test with TPS54160 and TPS54260 as well. I will also solder up a 2nd circuit. I also detected that the circuit behaved strange if I did not have a 1000uF capacitor over the 60 attached. I have double checked the circuit and components – it is only the TPS54060 that snaps.

My first thought is that I have gone wrong by leaving pin 3 and pin 6 floating. Pin 6 can be left floating it states, while pin6 is an output signal.

Regardless – I also have TSP54160 and TPS54260 chips to test + I only planned to develop with 12V anyway, so I can continue on two paths here (1) testing 60V PSU and (2) testing the rest of the motor Controller.

Don’t worry, I will get to the bottom of it. But, as usual I am my own enemy and don’t make breakout boards I can test new circuits With easily. It is straight on a dense, small design. I am a bit spoiled as I get things working most of the times 🙁

X-Mas Tree Decorations – Part 1

Every year around christmas I tell myself that next year I will have electronic christmas decorations, and as next year arrive it’s forgotten until it’s to late. A combination of STM32F030 and ULN2003 is excellent for a very small x-mas tree PCB with blinking LEDS and home made tree lights. In fact I have done this circuit before as a PWM driver with a single ULN2003, so what I will do is to make multiple PCB’s with LED strings connected through a RS-X (12V + RS485). These can then be wired in the x-mas tree and controlled by RS485 connection and 12V LED driver.

STM32F030F4 is excellent for this purpose, it cost 0.4 USD from AliExpress and all I need are sufficient to cover 20-40 of these. A 5A LED Driver should be more than sufficient. We make a harness with connectors up the tree where each decoration connect to this is a star network.

Application can be constant or random patterns as a start to make it simple. In fact I could make a small ESP32 control system with RS485 at bottom so I get the entire c-mas tree on Wifi or bluetooth. This could be a lot of fun.

The cost of this will be 2-4.- USD per PCB, around 10.- for the control system and a bit for the wiring. I probably end up spending around 100.- USD for a very attractive x-mas tree light system.

I can probably use up to 200mA per ULN2003 and a quick calc is that a single LED uses around 5mA, so in short – I will run out of space and LED’s before I run out of power. But, we should limit each decoration to ca 250mA max – I will probably need far less.

MC4X60V goes 50A

I decided to remove some of the PCB lanes and replace them with high current wires to support 50A currents. I had to extend the board ca 1.5mm at right, but to compensate I also remove the connectors because I need high current support all the way. I like having connectors for <10A solutions and playing in the lab, so will see what I can do. This will also free up 2-3mm that I desperately need at left.

At the end it simply made no sense to continue with 15A limit as I realized I would be using the same components and same space for a 50A design. And yes – this is a 50A design. The power wires are 3mm in diameter that actually is something like 64A while the 2mm wire for each channel is ca 41A. But, in addition to this you also have heat-sink at bottom as I connect the PCB itself to the heat-sink. I am confident that I will get sufficient out of this board.

New MC4X60A – First Glance

Always funny to share 3D models. This shows the right side of the new 60V Universal Motor Controller. I have spaced out the MOSFET channels and moved all components top-side as well as added 2 temperature sensors, a new 60V DC/DC, capacitors on board and enabled JST channel connectors. I have routed 1 channel, but need to route the 3 remaining (copy) and then comes the big question.

To support more than 15A I need to lay down solder tin on the paths up from the power connector and I also need a wire from the between MOSFET’s to right side of the shunt. I will in reality need 2x3mm holes for that wire and I need to find those 6 mm. If I push those capacitors further to left I will have no room for MCU or I will need to exceed 100mm. One alternative is to push the right power lane to bottom that is ground plane anyway.

I am very happy with MC4X as is, so I am looking forward to this modified board that deal with the remaining issues. It will still be work in progress for a week or so, but I think we might be assembling this during x-mas.

So will this be a 1KW, a 3KW or even a 6KW design? As Is we talk about 60A @ 15A per channel – that is 3600 Watt limited only by power lanes. If I increase to 50A we would be talking 12KW – again the real limiter here is not each channel but those lanes feeding each channel. 12KW would require support for 200A – so no – it is not impossible, but it would require some more space – lol. It is just funny to think that it now should be lanes and wires that limit this design. This amount of energy from a 100x40mm board is insane!