Take A Ride Through The Development Of A Custom BLDC Motor Controller

Photograph of a BLDC motor controller circuit board

The folks over at the [Barkhausen Institut] are doing research into controlling autonomous fleets of RC cars and had been using off the shelf electronic speed controllers (ESCs) to control the car motors. Unfortunately they required more reliable feedback for closed loop control of the motors, so they created their own open source hardware brushless DC (BLDC) controller.

The motor controller they developed uses an STM32 microcontroller that talks to a TMC6140 3 phase MOSFET driver to drive 6 IRLR 2905 MOSFETs. The [Barkhausen Institut] researchers went with the SimpleFOC library as the basis to program the STM32, with installed hall effect sensors indicating motor orientation for their closed loop control.

Designing a functioning BLDC and ESC controllers can be subtle, and their post goes into details about the problems and solutions they came up with to deal with with what was ultimately improper isolation of the MOSFETs interfering with the power rail for the STM32. The source for their BLDC motor controller is available through their GitLab page. For more information on the parent project that uses the BLDC driver, be sure to check out their work on a connected convoy of RC cars.

There’s now a wealth of open source BLDC drivers and projects, many of which we’ve featured in the past, like the Moteus and haptic smart knob, and it’s nice to see other projects explore different options.

6 thoughts on “Take A Ride Through The Development Of A Custom BLDC Motor Controller

    1. A few reasons. Designing with ASIC like that Toshiba unit locks you into using that ASIC until you sink the repeated engineering hours to adapt the design to another. It also assumes that other, similar, ASICS will be available if the one you engineer for is unavailable. With the recent chipocalypse, this scheme makes people nervous.

      Now, the same holds for an MCU, but the engineering is more reliably done with dev boards, as it comes down to adapting the library used to the new MCU’s peripherals, which usually comes down to defining new addresses, divisors and clock consts (though some families treat PWM and timers significantly differently, see STM32 vs RP2040) and routing the new pinout. 95% of the validation needed for a change is done with a scope and a dev board, rather than needing to roll a new PCB design before doing significant validation, as one would with a new ASIC.

      Another reason is cost. The STM32F103 is much more expensive than it was before the chipocalypse, so it’s roughly equivalent to the ASIC you linked in price nowadays, but other MCUs with equivalent performance are available that cost <1/3 that of either the F103 or said ASIC.
      The third reason is flexibility. If you’re just doing a BLDC controller, then an MCU doesn’t buy you much over an ASIC in utility (though this depends heavily on the ASIC). However, a well-designed FOC BLDC library, such as SimpleFOC, leaves a ton of performance available that the MCU can do other tasks with. The F103 (or similar) could easily communicate with a transceiver, send a couple of other PWM signals to servos, and do some arbitrary control logic to link it all together inbetween the BLDC control’s interrupts.

    2. There’s also the matter of configurability. Once you pick that IC if there’s something you want to tune and it’s not tuneable, you’re stuck with it. Doing it in your own software gives you complete control over everything. For something you don’t care about like a fan motor an IC is a good solution, for something like a drone, bike, scooter, skateboard you want all the flexibility you can get to make it run just right.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.