Motor control

SimpleFOC demystifies precision BLDC motor control

Brushless DC (BLDC) motors are standard in fast, low-precision RC applications. The control schemes needed to run them slowly or accurately go deep into motor theory and could put these motors out of reach for your next homebrew robot project. [Antun Skuric] and the crew aims to change that. They took the field-oriented control algorithm and encapsulated it in a compact Arduino library, added a host of examples, and created a stackable BLDC motor control shield to boot. The sum of their efforts is captured in the SimpleFOC project with the goal of bringing precision BLDC control to a large community of new hackers.

Field-oriented control is a BLDC motor control scheme that involves the use of a microprocessor to control the stator winding current so that it always applies torque to the rotor. To do this, your processor needs to measure both motor current (think shunt resistor) and rotor position (think encoder). Implementing the algorithm, however, can get a bit tricky as it touches on elements of linear algebra, motor physics, and control theory. But that’s the magic behind SimpleFOC. With the library at your fingertips, you don’t have to! And with that, the hardest part of controlling brushless motors has been simplified with an almost plug-in-and-play solution.

SimpleFOC has been implemented to span a variety of possible implementations. While you can certainly design your own control board, you can also start with the SimpleFOC Motor Shield for a single motor drawing up to 5A of current. From there you have a pretty wide range of mics to choose from, as the library has been extended to work on Arduino, Teensy, STM32 and some other families of microcontrollers. For implementation details, theory and configuration, there is a healthy set of Documentation to reference. And if you want to share your project or ask questions, you can access the Community forum for some high-fives and advice. The best of all, source code has been offered for your enjoyment under a generous MIT license.

While the project started last year, it is undergoing continuous improvements, including added support for current sensing and torque control in addition to position control. With a healthy community emerging around the project, we’ll be keeping our eyes peeled for more projects that build on this fantastic reference design.

If BLDC motor control has piqued your interest, check out our archive for other BLDC motor control projects, including motor/controller hybrids, anti-cogging control schemes, and other low-speed position controllers . And if you’re up for a real challenge, why not 3D print the engine as well?