Arduino Electronic Speed Control explained

You can salvage some nice motors out of optical drives but they can be tricky to control. That’s because brushless DC motors require carefully timed signals used in a process called Electronic Speed Control (ESC). [Fileark] built and ESC using an Arduino and has a couple of posts explaining the concept and demonstrating how it works. His test circuit uses six 2N2222 transistors to protect the Arduino from excessive current. You can see six red LEDs above which are inline with the base of teach transistor. This gives visual feedback when a transistor is switched, a big help for troubleshooting your circuit.

Once you’ve seen the videos after the break you’ll probably come to the conclusion that this is an impractical way to use a brushless motor. But it is a wonderful way to learn about, and experiment with the concept of ESC. Chances are you can get your hands on an old optical drive for free, making this an inexpensive weekend project.

Post navigation

29 thoughts on “Arduino Electronic Speed Control explained”

Very cool project. I was shocked because actually I was doing something quite similar this week. My idea was to build a small platform to teach control theory and what I do is to control a three wire computer fan from an arduino using transistors scavenged from a broken PC power supply to drive the motor and to buffer the pulse encoder signal from the fan. I should write something about this one of these days because I want to document it for the workshop. I’ll tell you as soon as I do.

As best as I can tell, the reason why he is having so much trouble getting the motor up to higher speeds is because there’s no system for detecting the position of the rotor so he can power the next coils at just the right moment. Usually people do this by sensing the back emf generated by the coils not in use, then making the switch.

I designed a shield for exactly this purpose. You can find the open source hardware and the (crude at this time) software at:https://code.google.com/p/threephase/
I use this as a platform for developing motor control algorithms.

It’s a bit of a cheat I suppose but the optical drive the motor came from will also have the driver chip that does the back EMF measurement. Spec sheets are often available. Have your micro interface to that device instead.

This is exactly the sort of “experimental” study that I’d like to see more of. Though not without flaws, it demonstrates the sort of results you can get without going to extreme efforts…

I’m a little surprised that the high-side drivers (+V – 2n2222 – motor) work well enough to get the motor to turn at all. Usually you use PNPs in that spot (with opposite drive voltages…)

The microcontroller used in many commercial RC ESC units is apparently an ATmega8; a processor very similar in capabilities to an Arduino (in fact, the mega8 was used in some of the earlier arduino boards.)

The schematic is rather flawed. He should have used a different kind of drivers, PNP transistors for the high side would have been better, but they are not enough. The motor from the CD drive is actually powered form 12V in order to achieve such speeds. Feedback is also given through the hall effect sensors in the motor that are not used here, but are necessary in order to use the motor at higher speeds.
There are also no protection diodes used.
The best chance of making the motor spin correctly with minimum work would be to use the actual driver from the cdrom and control it with a micro controller.
I is a proof of concept, but it has errors. Errors which beginners will just propagate…

@bogdan: i don’t think, there are any hall sensors in a CD drive. Just like there aren’t any in an HDD (i took some SCSI-HDDs apart). They are controlled via the back-EMF which you can measure on the third rail (read: the one that is not switched to ground or VCC)

@Nomad
All the cd-rom drives that i opened had hall sensors inside the motor. I suspect this has one as well and you may see that in the rather wide ribbon cable connecting to the motor(you need just 4 wires for the motor itself).
It is true you can do things with back emf, but maybe back when cd drives were made that was too complicated.
You are also forgetting that hard drives have the advantage of having to run at a single speed and the motor has a constant load.

@Roberto
That’s right. It woks like this too, that is not a problem. But not correctly, the motor is powered from the 5V supply which is only good for low speed/load.
Also, this trick will not work when powering from 12V.

I did this 1-2 years ago. Sadly, we need some kind of feedback (back-emf or hall sensors) to trigger the coils. It’s have been discussed in arduino forums.
Without it the motor just drives crazy at certain speeds, I and some others tried it on several motors.

Since we’re talking BLDC motors from CD drives, they are designed for much lower voltages than 12V mentioned above. I did some poking around an open DVD drive some time ago and I believe the motors are only energised from the 1.9V rail in the drive – there’s virtually no load once the disk starts spinning. Also, I believe they respond much better when PWM is involved else they are prone to skipping steps, especially without feedback. There’s a video illustrating the effect here http://elabz.com/bldc-motor-with-arduino-circuit-and-software/ with a very simple schematic and the Arduino code with PWM.

I was actually hoping to use one of those CD spindle motors as a sort of a 36-steps per revolution stepper. Not having much luck with that as yet tho…