On ESC Protocols Part I

This is the first post of a two post series that aims to provide a concise but comprehensive overview of current protocols for interfacing Electronic Speed Controllers (ESCs), with a focus on protocols for hobbyist UAVs and especially multirotors. As ESCs for brushless controllers are in wide use in UAVs, many of the ESC protocols to be outlined originate in the UAV hobbyist community. Some, on the other hand, are more generic and in use in a wider range of applications.

What is an ESC Protocol anyway?

The task of an ESC is to control the rotation of a motor based on a desired throttle value sent by a controller. The controller can be a simple remote control receiver, or a more sophisticated flight controller as is common in multirotors nowadays. To communicate the throttle value, the controller and ESC need to be able to understand each other. Thus the need to agree on a common protocol. Most ESCs nowadays can to recognize several different protocols, in an attempt to increase their versatility for use with different flight controllers. The same goes for flight controllers as well.

The most common physical connection between a flight controller and an ESC is a single signal wire. Communication through this wire is unidirectional: The flight controller sends data that contain the desired throttle values, and the ESC decodes the data and controls the motor accordingly. Save for advanced and specialized protocols, there is no data coming from the ESC to the flight controller. Communication is uni-directional.

In the beginning there was PWM

PWM stands for Pulse Width Modulation and it is a method for encoding a value into the length of an electrical pulse. Such pulses are continuous and have a defined period. In the canonical PWM, the duty cycle of the signal encodes the value. The duty cycle can be simply explained as the percentage that the signal is high. Duty cycle, along with frequency, are the two most important parameters of a PWM signal. Common uses of PWM are industrial and control applications, such as motor and lighting control. For instance, we can control the brightness of a LED by varying the duty cycle of a high-frequency PWM signal.

Controlling a LED using PWM. Source: Pyroelectro.com
Controlling a LED using PWM. Source: Pyroelectro.com

PWM signals are popular in the control of RC vehicles. In early RC applications, the PWM signal min and max values were always between 1 and 2ms, and the frequency was 50Hz (period of 20ms). a pulse of 1ms corresponds to zero throttle, and a pulse of 2ms to maximum throttle. For servos, 1ms would correspond to the lowest end, and a 2ms pulse to the highest end. Most of the cheap analog servos that you find today still use this 1/2ms, 50Hz signal. We will call this type of signal RC-PWM in this article (keep in mind this is not a recognized acronym).

Why the choice of 1 and 2ms? For one it guarantees that no matter what the throttle value is, a pulse is still transmitted. This provides a good failsafe should anything happen, such as disconnect of the signal source, which the ESC can detect immediately due to the absence of pulses.

Now, the max pulse is 2ms, which is just a fraction of the 20ms that is the period of the RC-PWM signal. This allows plenty of space to add more pulses in one cycle, and therefore transfer more than a single value. Although there is no value in this scheme in the context of ESC communication, it has been used for instance in receiver-flight controller communication in the PPM protocol.

Read also:  Wanhao Duplicator i3 Mini 3D Printer: First Impressions

The age of flight control

Originally RC systems were exactly that – a remote control receiver connected directly to actuators – ESCs, servos etc. But then multirotors made their appearance and brought a big change along. In a multirotor the RC receiver would no longer talk directly to actuators. Rather, it would talk to the flight controller, which would in turn control all of the ESCs on board. The flight controller is essential to ensure stability for multi-rotors, as aerodynamically they are inherently unstable.

Flight controllers run their stabilization algorithms hundreds if not thousand times per second. It thus makes sense that the communication between flight controller and ESC happens as fast as possible. This ensures that the motors are driven at the most recent throttle value calculated by the flight controller. Needless to say, at this point the traditional 50Hz RC-PWM protocol becomes inadequate.

One improvement over the traditional RC-PWM was realized by means of increasing the update frequency. Remember that the maximum PWM pulse length is 2ms? that makes is possible to have up to 500Hz update rate – much better than the meager 50Hz. In fact, to maintain separation between pulses, the upper limit to the update rate is practically around 490Hz so the period id 2040µs. This is the scheme that the High-Speed PWM protocol uses. The vast majority of modern ESCs support High-Speed PWM, and some support up to 600Hz refresh rate. In addition, some high-speed digital servos also support high speed modulation.

Staying in sync

Remember that the period in High-Speed PWM is around 2ms. This means that in the best case there will always be a 2ms delay from the time a computation outputs a value in the flight controller and the time the ESC receives the value.

Delay due to PWM pulse
Delay due to PWM pulse

The control loop period of a flight controller is in many cases different than the PWM frequency. Even if the set values are the same, slight variations add up to bring them out of sync. This can have degrading effects to latency. Such sync issues can introduce a delay of up to two times the PWM period.

Delay of unsynced ESC protocols can reach 2x PWM cycle time!
Delay of unsynced ESC protocols can reach 2x PWM period!

The SyncPWM protocol attempts to amend this situation. SyncPWM, as the name implies, syncs PWM pulses to the main flight controller control loop. This ensures that the only delay introduced is due to the pulse length, and no additional delay due to synchronization issues occurs.

Delay of synced ESC protocols is limited to one PWM cycle
Delay of synced ESC protocols is limited to one PWM cycle

Combining SyncPWM with FastPWM brings solid FC-ESC communication with acceptable levels of latency and refresh. In the next post we are going to look at how modern ESC protocols help to push these figures even further.

Part I Conclusion

Part I of this post series provided an brief overview of some theory behind ESC protocols and went over a few protocols, starting from the most basic ones. In the next post we will be taking a detailed look at more modern ESC protocols, and also specialized and cutting edge protocols that are yet to become mainstream.

Continue reading the second part here

Which protocol do you use in your setup? Share your experience in the comments below!

For more exciting experiments and tutorials, subscribe to our email:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.