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.

[youtube=http://www.youtube.com/watch?v=ZL0YqvxwTKc&w=470]

[youtube=http://www.youtube.com/watch?v=LRZXTG6SEEM&w=470]

29 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 :
    100000
    110000
    010000
    011000
    001000

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

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

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

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

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

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

Leave a Reply to MikeCancel 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.