# Electronic Speed Control Concepts

I am a programmer who has never worked with electronics before. I am learning the concepts and hoping to build a quadcopter, with the control software entirely written by me. Motor control seems to be the most important part.

Is it true that the typical brushless DC motor and ESC (Electronic Speed Control) can only approximately control the speed? That's because the ESC seems to have only a very approximate idea how fast the motor is revolving. This still works for a PID (Proportional Integral Derivative) controller because it gets indirect feedback from say a gyroscope whether the motor is going fast enough and so it can tell the ESC to make it revolve "even faster" or "even slower", and that's good enough.

Is my understanding in the above paragraph correct?

If so, I wonder whether a servo motor that can inform about its current rate of rotation could help do away with the ESC entirely? I feel that if the microcontroller can receive an input about motor speeds and send an output requesting a certain speed, it would not need the ESC. But I am not sure how servo motors work -- what happens immediately after you request 100rpm when say they were at 80rpm?

Since they cannot adjust the immediately, should the microcontroller immediately adjust other motors to account for the fact that not all motors are at 100rpm yet? Does that imply that the microcontroller should only request very small deltas from the currently measured speed, so that the period of deviation from desired state is negligible?

In the latter model, of requesting only very small deltas from currently measured speed, the algorithm seems like it would not really be PID since there is no way to control the acceleration? But may be requesting the servo to go from 80rpm to 100rpm causes it to reach 81rpm much faster than requesting it to go from 80rpm to 81rpm?

I feel I know so little I cannot put my finger on it more precisely, but I hope this gives an idea of the concepts I am struggling to absorb.

To summarize, the questions are:

• can a servo (brushless dc) motor allow doing away with ESC?
• does a servo motor accept control inputs such as "revolve at 100rpm"?
• does a servo motor offer an output saying "i am at 80rpm now"?
• does a servo motor at 80rpm go to 81rpm faster if it is requested to revolve at 100rpm versus at 81rpm?
• the less precise questions implicit in the text above.
• If you do away with an ESC, and use a microcontroller, some discreet power devices driven from the microcontroller to power the motor, some sort of feedback mechanism from the motor to inform the microcontroller about its speed, and then write some nifty software to bring it all together, you've basically built yourself an ESC :-)
– RJR
Jul 8 '14 at 5:23
• @RJR Thanks for confirming what I learned since posting the question. Specifically per the oldest answer below, I learned that the servo notion is moot, that all brushless motors offer a position/speed output, that what an ESC does run a nifty program, which also is what a motor controller does. Jul 8 '14 at 6:23
• @necromancer - A ESC is a motor-controller. Most RC motor controllers don't offer much in the way of access to their internal state, but they do have that state. Jul 8 '14 at 6:52
• @ConnorWolf yes, they should say that in big blinking letters somewhere. i am tempted to program a motor controller as a more satisfying first project than programming a quadcopter without interfacing with the motor first-hand. Jul 8 '14 at 9:27
• @necromancer - Doing a serious motor-controller can be quite challenging, because the electronic design involved in properly switching the current needed to drive a motor (brushless or otherwise) is non-trivial. It might be better to work on reverse-engineering a pre-built ESC, and just write your own firmware for it. Either way, expect to blow up a lot of power devices along the way. Jul 9 '14 at 8:51

First, there are several definitional errors in your assumptions:

1. No, there is no way to do away with a ESC entirely, since the majority of what the ESC is doing is taking the small signal from the receiver, and converting that into a much larger signal capable of actually powering the coils in the motor. Most motors require far more power then the micro controller can supply.
2. Even brushed motors actually require ESCs. A ESC is, at it's most basic, a specialized type of amplifier (brushless models require more local complexity). Maybe take a look at the wikipedia page on ESCs for more clarity.
3. Brushless ESCs actually know the rotor position and speed to quite a high degree of precision. The issue is that with typical "hobby" level ESCs, there is no way to access this information. Howerver, to properly commutate a brushless motor, the controller has to know "where" in the rotation the motor's rotor is, so it can determine which coil to energize.
4. When you say "Servo Motor", what exactly do you mean? Do you mean the little encapsulated "RC Model" servos? Those are not servo motors, but actually little self-contained servo systems. See the wikipedia definition of a servo-motor for more clarity.

So, in summary:

• can a servo (brushless dc) motor allow doing away with ESC?
First, there is no such thing as a "brushless DC" motor. Motors are fundamentally AC devices. "DC" motors actually convert the DC power to AC internally, via the brushes. A brushless motor just replaces the internal brushes with solid-state electronics.
• does a servo motor accept control inputs such as "revolve at 100rpm"?
No. A servo system can accept such control inputs, but it would do so with a motor, a ESC/motor-driver of some sort, a mechanism for reading motor speed back, and a microcontroller/circuit to control the input to the motor driver in response to readings from the tachometer/speed-measurement-interface.
• does a servo motor offer an output saying "i am at 80rpm now"?
Again, no, but a servo system could offer such a interface.
• does a servo motor at 80rpm go to 81rpm faster if it is requested to revolve at 100rpm versus at 81rpm?
This is somewhat dependent on the servo system's configuration, but most of the time, probably. A proper closed loop system has to account for the time it will take to stop changing velocity, which is within the time for the 80-81 rpm velocity, and not within the time for the 80-100 rpm velocity change.
Think about it like a physical movement. If you run 10 feet and stop, would it take longer then running to 10 feet and continuing at full running speed? Yes, because you have to begin stopping before you arrive at the destination, as infinite acceleration and deceleration are physically impossible.
• the less precise questions implicit in the text above.

Realistically, there are numerous limiting factors in the precision of a control system (like a PID-based control loop). Even if you have direct feedback of the rotation speed of a motor, the ability of the control loop to correct for errors in velocity is limited by the available torque, the rotor inertia, the bandwidth of the control electronics, and the precision of the measurement interface.

• +1 thank you for your excellent answer. i am slowly digesting it and reading the links you have given. Jul 8 '14 at 9:23
• @necromancer - One of the major issues here is that the radio-controlled model community has taken existing terminology for control systems, and kind of polluted them by using them in incorrect/different contexts, leading to lots of confusion. Jul 9 '14 at 8:54

Is it true that the typical brushless DC motor and ESC (Electronic Speed Control) can only approximately control the speed?

No. Brushless DC (BLDC) motors are a type of synchronous motor (more specifically, they are permanent magnet synchronous motors (PMSM)) and synchronous motors require the magnetic field of the stator and the magnetic field of the rotor to be "in synch." Practically what this means is that the current flowing through the coils is going to be dependent what position the rotor is in. The picture below shows the current waveforms for phases A, B, and C for a BLDC motor. You'll notice that only 2 phases are on at any given time. When any particular phase turns on or off is triggered by the position of the rotor. The better rotor position sensing you have, the better your motor will run (more efficient, more torque, etc.).

In hobby motors, it is pretty common to use sensorless rotor position detection. This generally works by looking at the phase that isn't on and using the waveform on that phase to determine rotor position. Other motors have Hall effect sensors or encoders on them that determine rotor position. Sensorless position detection is often good enough when all you are trying to do is velocity control. If you need to have position control (often called "servo"), then you need to look at using an encoder.

If so, I wonder whether a servo motor that can inform about its current rate of rotation could help do away with the ESC entirely?

Note that the most basic function of an ESC or brushless control is to provide current to the coils in the right sequence at the right time. In other words, the most basic function is to commutate the motor. This is the very minimum that is required for a BLDC motor to function correctly. So, no, you can't do away with an ESC entirely.

... what happens immediately after you request 100rpm when say they were at 80rpm?

It depends. A very simple open looped system might just be calibrated so that 12 V = X RPM, 6 V = X/2 RPM, etc. In this case, commanding 100 RPM is equivalent to increasing the voltage to some voltage Y that is already known to give you 100 RPM. A closed loop system might use the rotor position to look at the change in rotor position over time to determine velocity and then adjust the voltage until the new velocity is 100 RPM. Either way, the voltage will have to increase.

does a servo motor at 80rpm go to 81rpm faster if it is requested to revolve at 100rpm versus at 81rpm?

This is impossible to say unless you have a specific control in mind. For a given load, what determines how quickly the shaft accelerates is the torque. The more torque your motor can provide, the more quickly it will accelerate. In BLDC motors, torque is proportional to current. So assuming the same load and assuming you provide the same amount of current, they should reach 81 RPM in the same time.

does a servo motor accept control inputs such as "revolve at 100rpm"?

As I mentioned above, "servo motor" often refers to motor/controls that are used for position control. The command "revolve at 100 RPM" would be more likely to be seen in a motor/control system that is used for velocity control. Many servo motor/control systems can do velocity control but not all are set up to do so.

I will say one last thing about terminology because of something Connor Wolf mentioned. There is no industry standard for terminology for brushless motors. I've seen no less than the following acronyms/terms for brushless motors: BLDC (brushless DC), BLAC (brushless AC), PMSM (permanent magnet synchronous motor or permanent magnet servo motor), BPM (brushless permanent magnet), SMPMSM (surface mount permanent magnet synchronous motor), IPM (interior permanent magnet motor), etc. BLDC, BLAC, and PMSM are the most common, in my experience.

BLDC most often refers to motors that are designed to have a trapezoidal back-emf and meant to be run with a 6-step (trapezoidal) control (this is the type of control mentioned in my answer above). BLAC most often refers to motors that are designed to have a sinusoidal back-emf and meant to be run with a sinusoidal control (that is, the control provides sinusoidal current to the motor rather than the waveforms in the picture above). "Servo" motors are often BLAC motors. In my opinion, there is little difference between a BLDC and BLAC motor and they should be considered the same type of motor. Motors with trapezoidal back-emf's can be run with sinusoidal controls and vice versa. It all depends on what you are trying to do with them. My preferred terminology to cover both these types of motors is PMSM (permanent magnet synchronous motor). But, again, there is no industry standard here so my preference is just that, a preference.