Introduction to ESC Programming for RC Planes

All you need to know for your electric RC aircraft

We need to start with some basics about what the ESC is doing.

Click above to watch this content with explanations on YouTube

What is an ESC?

It’s an “Electronic Speed Control.”  This device is powered by a battery and sends pulses of current to the motor based on the throttle signal sent to it from the plane’s receiver.  Because it is powering a brushless DC motor (BLDC), it needs to send a type of three phase current to the motor.  Those are pulses of electricity going through three separate wires, one after the other, and overlapping each other.

The timing of those pulses is based on the speed that the motor is actually turning.  Every time a pole in the motor passes a magnet in the motor, a small pulse of electricity is generated that returns through the power wires.  The ESC detects those, telling it the precise position of the rotor, so it knows when to send each pulse of electricity.

Partial throttle will break up each of the three pulses into a series of individual short bursts.  The voltage being sent at the top of the pulse is still the full voltage that the battery can deliver, it’s just that it doesn’t need that for the full length of the pulse to deliver the amount of power needed for the partial throttle setting.  That’s what controls motor speed.  The percentage of time that the power is on is referred to as the duty cycle.  So, full throttle is a 100% duty cycle, and 1/3 throttle is a 33% duty cycle.

For the sake of our discussion, we will refer to the full set of bars as shown above as the “pulse”, corresponding to the solid line in the diagram.  The individual smaller bursts of electricity that make up the “pulse” will be referred to as “bars.”

Keep in mind that no burst of electricity is going to form a perfect rectangle, looking at current over a period of time.  The reason why the main pulse ramps up on an angle is due to the fact that there is impedance or resistance to the flow, and it has to gradually accelerate to get going.  Each of those rectangular bars will do the same thing – it’s just hard for me to draw it that way!  In the corresponding video to this document, I do a better job of showing what is actually happening.

The number of bars per pulse is going to depend on the PWM (Pulse Width Modulation) frequency set in the ESC.  A very high PWM frequency will give several bars per pulse at full RPM.  However, the PWM frequency is often set to be just a tiny bit faster than what the pulses need to be at full throttle.  So that might allow for two of them to fit into a pulse at half throttle.  The problem comes when the rate of pulses that the motor needs is faster than the PWM frequency.  That might cause a complete pulse to get missed, and that will cause the motor to be noisy and not run well.

Every time the ESC turns off the power at the end of one of those bars, heat is generated as the power flowing through the circuit needs to get dumped through an electronic component that has resistance.  That both consumes power and creates heat.  Because of that, the ESC is going to perform the best with the minimum rate for the PWM frequency.  But, narrow, quick pulses will more closely approximate the desired curve that will make the motor perform the best.

So, there will be a trade-off between the two.  Most flyers will simply accept the default PWM frequency, as long as the motor runs smoothly.  In tests that I have seen, there’s only a 2% increase in power between the minimum and maximum frequencies.  So, generally we stick to the low end of the range, as long as the motor runs smoothly, for the sake of the ESC.  If it’s noisy, increase the frequency to see if that stops the noise.

Note that the PWM frequency will remain constant no matter what the motor RPM is.  But the rate at which the pulses are delivered at low RPMs is much lower than what it is at full throttle.  Because of that there are many more bars per pulse at low RPMs, helping the motor to run smoothly when slow.  So, a characteristic of a motor with too low of a PWM frequency would be one that may run smoothly when slow, but at some higher RPM it gets noisy, and that gets worse the higher the throttle goes from there.

Another observation is that apart from the BEC (battery elimination circuit), which is used to power the receiver, the ESC is not a voltage regulator.  Whatever voltage is coming in from the battery is going to get delivered to the motor.  As the motor has a given “KV” value, RPM per volt, and the battery voltage is going to decrease during your flight, the full throttle RPM will be higher at the start of the flight than at the end.  The ESC is just switching on and off that voltage to get the desired amount of power out of the motor.  It reminds me of some WWI aircraft, such as the Sopwith Pup, which didn’t have a throttle, per se.  They just switched the magneto on and off while landing, taxiing or other times that they wanted partial power!

What can be adjusted on an ESC?

Throttle range calibration

One thing that everyone needs to do when setting up a new ESC, even if it’s in a purchased BNF plane (Bind And Fly – ready to go, just add a receiver and a battery), is to calibrate the throttle.  Sometimes, the way it comes from the factory, it’s not actually giving you full throttle when the stick is at 100%.

Brake

Your ESC has the capability to use the current generated from simply having the air spin the prop to be used to try to run the motor in reverse, acting as a brake.  That’s really good in a car.  It also may be beneficial if you have a glider with a folding prop.  Furthermore, I’m told that it’s less likely that you will break a prop with a belly landing if the prop isn’t spinning.  So, it might be a good idea to set the brake if you have a hand launch plane without landing gear.  Apart from that, a free spinning prop is going to help a motor be more responsive to hitting the throttle after having it cut, such as in some aerobatic manoeuvres.  The ESC is able to keep track of the motor position as long as it’s spinning.  So, it’s immediately able to start the pulses where needed without delay.  If the motor has stopped spinning, then the ESC needs to do a bit of investigation to work out which coils to fire before it can get going full on.  One last factor is that a free spinning prop actually causes more drag than a fix prop that is not spinning.  If you have a ‘dead stick’ situation far from the field, that might be good, but my experience is that generally is good to be able to slow down the plane coming in for a landing.  We have trees on each end of our field, and if you don’t have flaps, it can be a challenge to get some planes stopped in time!

Note that some ESCs may refer to the brake as a “slow decay mode.”  Also, some ESCs give you more than an on/off choice.  You can have it slowly come to a stop.

Direction of Rotation

While you can always swap any two wires going from the ESC to the motor to reverse the direction of rotation, there is also an option in the ESC to do that.  What you don’t want to do, is what I did during one very serious brain fade moment. 

I brought a newly set-up plane to the field, thinking that I had gone through and verified everything several days earlier at home.  In fact, I believe I had done that, but then afterwards, I must have opened things up to do something and reversed two of the leads going to the motor.  At the field I went through all the control surface movements with the transmitter, did the range check, and all was good.  But I didn’t run the motor on the bench. Thinking that all was ready to go, I carried the plane out to the flight line, checked the control surfaces again, then gave the motor a blip, and it pushed the plane backwards.  I then thought, “I know how to reverse controls on the transmitter,” so I quickly got into the servo menu and reversed the throttle.  With the stick down, it then gave me full throttle in reverse!  Not a pleasant moment in front of all my mates at the club!  Not to mention, dangerous as well!  So, that was a great moment in developing my character.  It will make a great chapter topic for a book one day: “Humility and How I Achieved It”!  Just avoid those sorts of brain fades and we will all be happy!

PWM Frequency

Typically, there will be multiple choices that you can choose from.  A typical range might be from 8 kHz to 32 kHz.  If you want to calculate what value to use, the common formula is:

KV x Vnom x Poles divided by 20, where:

KV = the kv value of the motor (rpm per volt)

Vnom = nominal voltage of the battery (LiPo: 3.7 V x number of cells, if wired in series)

Poles = the number of magnetic poles in the motor  (not coils)

This gives you the value in Hz.  To get kHz, divide that by 1,000.  You then select a PWM frequency that’s the next option higher than the value you calculate.

I might mention that the above calculation is what I have seen in several places on the internet, but there are still a few things that I’m trying to get my head around.  Why use the nominal voltage, when the motor is going to spin faster when the battery is fully charged, requiring a higher frequency?  Typically, I’m finishing a flight when I get down near the nominal voltage.  I’m targeting 3.8V for that. 

Secondly, the formula assumes that there will be three electrical cycles per magnetic pole for each rotation of the motor.  But there are lots of poles, and lots of coils, some of them operating at the same time, and others at different times.  It seems to me that may be a much more complex situation than the simple calculation above. 

So, for the moment, figure that if the default setting works fine, leave it.  If it gets noisy at high RPMs, increase it until it runs smoothly.  Then for you guys who are like me, one day I’ll fully understand it, and produce a more in-depth video on what’s happening!

Slow Start

For geared or high load applications, a slow start is needed to avoid ripping apart the drivetrain or cooking the electronics.  But, for most airplanes we want a quick response to the throttle.  Most ESCs will at least have two choices, quick and slow.  Some have another option in between those.

Heli/Governor Mode

Some ESCs can be used for helicopters.  Naturally they will need the slow start mode.  But there is also another option on some ESCs.  What that does is to have the throttle select a target RPM.  So, when you move the stick to a given position, it will do it’s best to keep the RPM constant at that level, no matter what the load is.  Dial in more collective, and the ESC will add power as needed to keep the rotor spinning at the same speed.  I was told that a YEP ESC that I cooked recently with a prop striking the ground at the beginning of a take-off run was likely due to it having come to me with it in that Heli mode.  As the prop was digging into the ground at a high throttle setting, the ESC was doing its best to keep it spinning at a high RPM, and the 80 amp ESC went up in smoke!

Battery Type

Some ESCs will give you a choice, such as a nickel-based battery vs. automatic detection.  The main thing that is doing is setting up what the minimum voltage should be, as that is a different percent of the maximum voltage for lithium batteries.

Timing

Don’t confuse this with PWM frequency.  Timing is similar to ignition timing on a car engine.  Firing the pulse a bit early is needed at high RPMs to give the current time enough to generate the necessary magnetic field when it is needed to pull or push a magnetic pole.  Where you have the option of changing this, you will likely have a bunch of choices.  But, most likely you will have an automatic option.  Essentially, motors with high numbers of poles, such as large outrunners, need a higher number of degrees for the timing.  However, it is rare to need to change this.

Low degrees of timing advance will tend to be more efficient, with the motor running cooler.  Higher amounts of timing advance may be needed to achieve top RPM in some motors.

Other Options

Each manufacturer’s ESC will be a bit different from others. Some will have more options than others, and it’s not unusual to find it very confusing when you are reading the instructions as to exactly what some of the options are! So, along the way we will be producing some videos going through specific ESCs, how to program them with the throttle stick, how to do it with a programming card, and along the way, seeing what each option actually does. So, subscribe to YouTube.com/@RCJim and you will be able to work out what it’s all about!