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.

28 thoughts on “Arduino Electronic Speed Control explained

  1. 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.

  2. “you’ll probably come to the conclusion that this is an impractical way to use a brushless motor”

    Why do you think that? You don’t have to use an external controller IC, you can even remove the discrete transistors and use some uln2003 to manage all at once.

    Regarding the program, it should really be written using timers and interruptions, to reduce the cpu usage to the minimum

  3. 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.

  4. This is such perfect timing.

    I have a shitload of these transistors lying around but haven’t been able to afford any ESCs to test out my new outrunner brushless motors.

    I had a few dual H-bridges lying around from sparkfun I was going to try and program to do this, but I didn’t really have the energy to get around to it.

    This is super simple, easy, and cheap.

    A+++ thanks for the inspiration!

  5. What about adding transitional steps where only one coil is active ?

    for example :

    the rotation should be more precise, smoother and stronger. And maybe it can fix the buggy behavior at high speed.
    What do you think about that ?

  6. 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.

  7. 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.)

  8. @Chris
    That would work for a unipolar stepper, but this is a 3 lead brushless. If you only turn on one of the transistors, no current will flow through the motor.

  9. Very cool project indeed, good sirs. I was in deep need for exactly that thing for my epic project. May the queen be with you.

  10. 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…

  11. @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)

  12. @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.

  13. @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.

  14. 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.

  15. 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 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…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s