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

(crossposted from electronics.stackexchange)

First a little warning: This answer is one big AFAIK. I have some limited experience with RC electronics and don't know anything about industrial servos, and other simillar stuff :-)

BLDC motors (just motors) don't have any kind of RPM feedback, they are just three sets of coils and a bunch of magnets. The electronics that drives them can do some magic, though.

The speed controllers that I have played with are the RC hobby ones, simillar to this one. This kind of ESC have very simple interface, only receiving PWM encoded value that they somehow turn to motor speed / torque / who knows what. The general idea is that if you put more PWM, you get more speed, but no exact relation is given. They are meant to be manually controlled to drive RC cars (or planes), so they don't provide any feedback at all.

The next step are sensored ESCs. These need special sensored BLDC. The sensor in this case are three Hall effect sensors inside the motor, and its output is used to help the ESC drive the motor more precisely (or something like that), giving you more torque (especially when starting the motor from 0rpm), but the interface from the outside world is still just one PWM value going in and no feedback. I was thinking of tapping into the signal from these sensors with my microcontroller, but never tried it.

Then there are some smarter(?) ESCs like the OpenBLDC, that receive commands over I2C or some simillar bus. I have no experience with these at all, but in principle I think it should be able to report some data about how the motor is spining (rotation counts, maybe?).

RC servos (like this one have the same PWM input as the ESC, but here the value corresponds to position and the servo will control itself to keep the position even when externally disturbed.

For my robot I'm using a sensorless BLDC with the ESC I linked + a microcontroller with an optical sensor to measure the real motor rotation. Then I use PID to get the PWM input for the ESC. It receives commands like "I want to go at 1500rpm" and returns reports like "the motor rotated 135 degrees since the last report". I'm not saying this is ideal, but it kind of works.

Also careful about the start up (and low RPM operation) of the sensorless BLDCs, it can be really jumpy and unreliable.

• +1 love your answer, thanks very much for very usefully sharing the extent of your knowledge. :) Jul 9 '14 at 2:48

For practice, model quadcopter typically uses sensorless BLDC motor with ESC which are mass produced, low cost and specifically designed for the job (high power, light weight).

Speed control via PWM (pulse width modulation) signal applied to ESC input pin. PWM frequency is fixed. Pulse width vary from a minimum to maximum value which ESC control motor varying from min to max speed.

This type of ESC creates a rotating magnetic field which the rotor magnet simply follows, ESC knows the precise speed that you can control via the PWM signal.

Sensored ESC provides better performance at low speed (precise speed control down to zero RPM) that may be useful for vehicle but not required for quadcoptor. Sensorless system has non-zero minimum speed.

For theory, a nice free-of-charge MOCC course is https://courses.edx.org/courses/TUMx/AUTONAVx/2T2014/info

There are many web and open source projects. Try wiki and follow the external link at bottom. http://en.wikipedia.org/wiki/Ardupilot

Hope this helps.