3-Phase BLDC Motor Controller will Run you $20 in Parts

If you’re an active shopper on RC websites, you’ll find tiny motors spec’ed at hundreds of watts while weighing just a few grams, like this one. Sadly, their complementary motor controllers are designed to drive them at a high speed, which means we can only hit that “520-watt” power spec by operating in a max-speed-minimum-torque configuration. Sure, that configuration is just fine for rc plane and multicopter enthusiasts, but for roboticists looking to drive these bldc motors in a low-speed-high-torque configuration, the searches come up blank.

The days in the dust are coming to an end though! [Cameron] has been hard at work at a low cost, closed-loop controller for the robotics community that will take a conventional BLDC airplane motor and transform it into a high end servo motor. Best of all, the entire package will only run you about $20 in parts–including the position sensor!

“Another BLDC motor controller?” you might think. “Surely, I’ve seen this before“. Fear not, faithful readers; [Cameron’s] solution will get even the grumpiest of engineers to crack a smile. For starters, he’s closing the loop with a Melexis MLX90363 hall effect sensor to locate the rotor position. Simply glue a small magnet to the shaft, calibrate the magnetic field with one revolution, and–poof–a wild 14-bit encoder has appeared! Best of all, this solution costs a mere $5 to $10 in parts.

Next off, [Cameron] uncovered a little-known secret of the ATMEGA32u4, better known as the chip inside the Arduino Leonardo. It turns out that this chip’s TIMER4 peripheral contains a feature designed exclusively for 3-phase brushless motor control. Complementary PWM outputs are built into 3 pairs of pins with configurable dead time built into the chip hardware. Finally, [Cameron] is pulsing the FETs at a clean 32-Khz — well beyond the audible range, which means we won’t hear that piercing 8-Khz whine that’s so characteristic of cheap BLDC motor controllers.

Curious? Check out [Cameron’s] firmware and driver design on the Githubs.

Of course, there are caveats. [Cameron’s] magnetic encoder solution has a few milliseconds of lag that needs to be characterized. We also need to glue a magnet to the shaft of our motor, which won’t fly in all of our projects that have major space constraints. Finally, there’s just plain old physics. In the real world, motor torque is directly proportional to current, so stalling an off-the-shelf bldc motor at max torque will burn them out since no propeller is pushing air through them to cool them off. Nevertheless, [Cameron’s] closed loop controller, at long last, can give the homebrew robotics community the chance to explore these limits.

Build Your Own Brushless Motor

Building an electric motor from a coil of wire, some magnets, and some paper clips is a rite of passage for many budding science buffs. These motors are simple brushed motors. That is, the electromagnet spins towards a permanent magnet and the spinning breaks the circuit, allowing the electromagnet to continue spinning from inertia. Eventually, the connection completes again and the cycle starts over. Real brushed motors commutate the DC supply current so that the electromagnet changes polarity midway through the turn. Either way, the basic design is permanent magnets on the outside (the stationary part) and electromagnets on the inside (the rotating part).

Brushless motors flip this inside out. The rotating part (the rotor) has a permanent magnet. The stationary part (the stator) has multiple electromagnets. By controlling the electromagnets, the rotor spins. With no brushes, these motors are often more efficient, they don’t generate as much electrical noise, and there is no danger of brushes wearing out. In addition, the electromagnets staying put make the motor easier to wire and, if needed, easier to cool the electromagnets. The principle of operation is similar to a stepper motor. Steppers are usually optimized for small precise steps. Brushless motors are optimized for spinning, not stepping.

[Axbm] built a clever brushless motor out of little more than PVC pipe, some magnets, wire, and iron rods. The plan is simple: construct a PVC frame, build a rotor out of PVC and magnets, and mount electromagnets on the frame. An Arduino and some FETs drive the coils, although you could drive the motors using any number of methods. You can see the whole thing work in the video below.

Continue reading “Build Your Own Brushless Motor”

Adding Position Control To An Open Source Brushless Motor Driver

Brushless motors are everywhere now. From RC planes to CNC machines, if you need a lot of power to spin something really fast, you’re probably going to use a brushless motor. A brushless motor requires a motor controller, and for most of us, this means cheap Electronic Speed Controllers (ESC) from a warehouse in China. [Ben] had a better idea: build his own ESC. He’s been working on this project for a while, and he’s polishing the design to implement a very cool feature – position control.

We’ve seen [Ben]’s work on his custom, homebrew ESC before. It is, by any measure, a work of art. It’s capable of driving brushless and brushed motors with a powerful STM32F4 microcontroller running ChibiOS that’s able to communicate with other microcontrollers through I2C, UART, and CAN bus. If you want to build anything with a motor – from a CNC machine to an RC helicopter to an electric long board – this is the motor controller for you.

[Ben]’s latest update considers position encoders. Knowing how fast a motor is turning is very important to knowing how fast a wheel is turning, how much torque the motor is generating, and an awesome step in building the finest motor controller ever made.

Like the last update, [Ben] demonstrates the great control program written for this ESC. This GUI programs the microcontroller on the controller, with protection from high and low voltages and currents, high RPMs, duty cycle changes, and support for regenerative braking.

Thanks [Dudelbert] for sending this one in.

Continue reading “Adding Position Control To An Open Source Brushless Motor Driver”

BLDC Controller With The Teensy 3.1

[Will] is on the electric vehicle team at Duke, and this year they’re trying to finally beat a high school team. This year they’re going all out with a monocoque carbon fiber body, and since [Will] is on the electronics team, he’s trying his best by building a new brushless DC motor controller.

Last year, a rule change required the Duke team to build a custom controller, and this time around they’re refining their earlier controller by making it smaller and putting a more beginner-friendly microcontroller on board. Last years used an STM32, but this time around they’re using a Teensy 3.1. The driver itself is a TI DRV8301, a somewhat magical 3 phase 2A gate driver.

The most efficient strategy of driving a motor is to pulse the throttle a little bit and coast the rest of the time. It’s the strategy most of the other teams in the competition use, but this driver is over-engineered by a large margin. [Will] put up a video of the motor controller in action, you can check that out below.

Continue reading “BLDC Controller With The Teensy 3.1”

Brushless Motor Controller Shield for Arduino

Brushless motors are ubiquitous in RC applications and robotics, but are usually driven with low-cost motor controllers that have to be controlled with RC-style PWM signals and don’t allow for much customization. While there are a couple of open-source brushless drivers already available, [neuromancer2701] created his own brushless motor controller on an Arduino shield.

[neuromancer2701]’s shield is a sensorless design, which means it uses the back-EMF of the motor for feedback rather than hall effect sensors mounted on the motor. It may seem strange to leave those sensors unused but this allows for less expensive sensorless motors to work with the system. It also uses discrete FETs instead of integrated driver ICs, similar to other designs we have covered. Although he is still working on the back-EMF sensing in his firmware, the shield successfully drives a motor in open-loop mode.

The motor controller is commanded over the Arduino’s serial interface, and will support a serial interface to ROS (Robot Operating System) in the future. This shield could be a good alternative to hobby RC controllers for robots that need a customizable open-source motor controller. The PCB design and source code are available on GitHub.

Continue reading “Brushless Motor Controller Shield for Arduino”

A 3D Printed Brushless Motor

brushlessBuilding electronics with 3D printers is something we see hitting the tip line from time to time, but usually these are printed circuits, not electromechanical parts like motors, solenoids, and relays. [pitrack] thought he could do better than printing out a few blinking LED circuits and designed and built a brushless motor, the same kind you would find on electric model planes and quadcopters.

In every brushless DC motor, there are a few common parts: the rotor has a few powerful magnets embedded in it, a stators with coils of wire, and the an enclosure to keep everything together. [pitrack] printed all these parts off on his Makerbot, winding each of the three coils with about 400 turns of 26 AWG magnet wire. Also embedded in the stator are a trio of hall effect sensors to make the control via an Arduino and an L6234 motor driver easy.

For his next trick, [pitrack] is going to test the efficiency of the motor and attempt to optimize it. In the long term, it should be possible to parameterize the design of one of these printed motors, effectively allowing anyone to type in the torque and Kv rating of a desired motor, plug that into an equation, and have a motor design come out the other end.
Continue reading “A 3D Printed Brushless Motor”

Fail of the Week: Flaming Brushless Motor Controller


Yep, smoke and flames are usually a sign that your electronics aren’t functioning as expected. This is actually the second failure encountered while learning about brushless motor controllers.

[Michael Kohn] purchase the motor while working on a different project and it went unused for quite some time. When he came across it again he decided he should learn the not-so-dark art of BLDC control.

The first hurdle was to figure out how to drive the three-wire motor when he had been expecting only two. The answer required him to come up with switching mechanism that allows three states for each wire: positive, negative, and not connected. His solution was to use MOSFETs. It’s a good idea, but unfortunately during the first iteration they were under-spec’d and he scared the crap out of himself when one of them blew up during testing (clip #1 below). After sourcing a more robust set of MOSFETs [Micheal] went back to testing which is when this little fire broke out. The 22 gauge wires connecting the Lithium battery to the driver just couldn’t cut it. See for yourself in the second clip.

It’s been awhile since we’ve said it: Please remember the Fail of the Week is not about ridiculing the hacker who was gracious enough to document his or her failure. It’s about learning from the mistake and discussing alternatives that can help others in the future. For instance, in this case some advice in determining MOSFET specs and wire gauge for any type of motor would be quite helpful. Have at it in the comments.

Continue reading “Fail of the Week: Flaming Brushless Motor Controller”