PWM, OneShot and OneShot125 ESCs¶
Most ArduPilot vehicles use brushless motors controlled by brushless motor ESCs. The most common protocols used by these ESCs are PWM, OneShot, OneShot125, and DShot. This page describes the first three (PWM, OneShot and OneShot125).
Be sure your ESC can support the configuration you select for it. Damage can occur otherwise. This includes frame rates discussed below. Also be careful when switching between protocols without rebooting or re-calibrating ESCs as this can lead to uncommanded motor output.
These are the most common ESCs for non-copter applications and were historically the first brushless ESCs.
PWM ESCs use a periodic input pulse of width typically between 1000uS and 2000uS for zero to full power, respectively.
- Set MOT_PWM_TYPE to 0/Normal (the default) and reboot the autopilot
- MOT_PWM_MIN and MOT_PWM_MAX specify the PWM range sent to motors (e.g. where SERVOx_FUNCTION = “Motor1”, “Motor2”, etc). See ESC Calibration for info on aligning the autopilot’s output range with the ESC’s input range.
The frame rate of these pulses is usually between 50Hz to 490Hz. The faster frame rates allow quicker control reactions to be sent to the motor, if the ESC has capability for those frame rates.
- Set RC_SPEED to change the frame rate (default is 490Hz)
be sure of the capabilities of your ESC before selecting a higher frame rate to avoid damage to the ESC.
OneShot (not to be confused with “OneShot125”) is an older protocol that uses the same pulse widths as Normal PWM but has a fixed frame rate equal to the autopilot main loop rate. There is little advantage for using this protocol over regular PWM.
- Set MOT_PWM_TYPE to 1 (OneShot) and reboot the autopilot
The OneShot125 (sometimes confusingly shortened to just OneShot) protocol is similar to regular PWM except that the pulse widths are divided by a factor of 8 which allows faster communication from the autopilot to the ESC. Individual pulses are sent more quickly and the overall frame rate can be increased up to 490Hz.
- Set MOT_PWM_TYPE to 2 (OneShot125) and reboot the autopilot
If using an autopilot with an IOMCU (e.g. Pixhawk, CubeOrange) the ESCs should be connected to the AUX outputs and the corresponding SERVOx_FUNCTION values should be set to “Motor1”, etc. This can be most easily done using Mission Planner’s “Servo Output” page
Reboot the autopilot and check the “RC banner” to confirm the output channels are setup as expected (this banner appears whenever parameters are downloaded)
Mixing ESC Protocols¶
While all the servo/motor outputs of an ArduPilot autopilot are capable of Normal PWM operation at 50Hz frame rates, not all are capable of other ESC protocols. And, usually, these configurations must apply to pre-designated groups of outputs, even if they are not all driving an ESC. So the following cautions apply:
- The 8 “MAIN” outputs of autopilots using an IOMCU (like PixHawk and Cube), cannot be used for protocols other than Normal PWM and OneShot. On these autopilots, only the additional “AUX” outputs can properly support OneShot125. If you attempt to set a “MAIN” output to OneShot125, then normal PWM output will occur, even though it has been set to a OneShot125 protocol.
- For Pixracer and other boards without a separate IOMCU coprocessor, all servo/motor outputs can be used.
- Groups of outputs sharing a common timer, MUST have the same advanced configuration. Usually, these are specified in the autopilot’s hardware description linked from the Autopilot Hardware Options page. For example, if an output is configured for OneShot125 in a group, then you cannot use another output in that group for Normal PWM ESC or normal PWM servo operation.
Everytime the autopilot initializes, it sends the “RC Banner” to the ground control station, showing which outputs are PWM, OneShot, OneShot125 or DShot. The remaining higher numbered outputs are assigned as GPIOs.