Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
User Guide: OneShot125
What is OneShot125?
Oneshot125 consists of two distinct features: SyncPWM and FastPWM/8xPWM. SyncPWM synchronises PWM commands to the ESCs with the flight control loop. This reduces latency as the ESCs receive commands immediately after the flight control loop refreshes. FastPWM reduces the PWM pulse width from the standard RC pulse range of 1000-2000 us down to 125-250 us. This increases the maximum refresh rate from <500 Hz up to <4 kHz.
Peabody124 has posted a more detailed explanation along with quantative testing results on his blog showing that while the difference this can provide may sound small the result can be significantly improved ESC latency (he was able to show about a 20% improvement in his tests) .
What is needed to use OneShot125?
You will need ESC's that support OneShot125 and you will need to enable it in your Flight Controller. Tau Labs official releases fully support Oneshot125.
Which ESC's support OneShot125
OneShot125 originated with the release of the KISS ESC's and they were originally the only ESC's to support this mode. To use OneShot125 with KISS ESC's the JP1 Solder jumper must be bridged.
BLHeli v13 and above
The BLHeli firmware was next to add support for oneshot mode and it is supported on all ESC's once upgraded to firmware v13 or above. BLHeli autodetects the OneShot125 signal so no configuration or jumper changes are necessary.
SimonK commit 6dbc056a71 and above
SimonK has just added support for OneShot125 as of commit 6dbc056a71 in their git however no official release with this support has been released at the time of this writing. In the commit note it is suggested that rather than referring to this as simple "OneShot125" it should really be considered two separate options on the flight controller side separating the synced PWM updates (referred to as "SyncPWM" by SimonK) from the shorter pulse lengths (referred to as "8xpwm".) Like BlHeli SimonK also autodetects the shorter pulse lengths and no configuration or jumper change are required.
Note on all Atmel based ESC's
On most supported Atmel based ESC's there is often a slight "chirping" from the motors due to the incoming PWM signal being processed in software resulting in jitter that is worst at lower values, this can be alleviated by slightly raising the low output value (detailed below.) An exception to this is ESC's such as the Afro and TBS branded versions which use the ICP1 pin for PWM input as they are able to detect the rising edge through hardware avoiding the jitter.
Enabling OneShot125 support in TauLabs
Oneshot125 can be enabled by selecting
OneShot in the output signal configuration screen of the setup wizard. Alternately it can be set manually in the Configuration - Output tab of GCS. To do this set
Update rate to
SyncPWM (this is the SyncPWM part), and resolution to
12 MHz (this is the FastPWM part). Min, max and neutral values should be set in real units (us), e.g. Min: 125 us, Neutral: 132 us, Max: 250 us.
Special Note for CC3D
The CC3D shares a timer between the receiver port PPM pin and the PWM outputs to the motor. Unfortunately this configuration is not compatible with Oneshot/SyncPWM when Outputs 1-3 are used. If you are using a PPM receiver, please ensure RcvrPort (on the Configuration - Hardware tab in GCS) is set to
PPM on pin 8 (this is now the default option). Connect the receiver to pin 8.
Due to the various flight targets supported by TauLabs the implementation is slightly different than how it has been done on other controllers so far. ernieft who implemented oneshot on TauLabs describes the difference in implementation better than I can:
OneShot in TauLabs uses 12MHz instead of 1Mhz as frequency base. So all output values are x/12µs then. In order to get the desired 125..250µs range, you have to multiply all by 12. This gives a higher resolution with factor 1.5. Now we have 1500 integer steps and everthing is nice and smooth.
A short overview of other solutions: All other implementations insist on the 1000..2000 range without units and use a fictional factor. MWII and CF use 8MHz base. That's all. This works on F1-targets but not on F4@168MHz. You can't adjust the prescaler to get 8.0MHz on all PWM channels here. Some will work at 8.4MHz. OP decided to go on 2MHz and divide the 1000..2000 range by 4 (250 integer steps effective, hmm...).
Gyro Rate - With oneshot enabled on Tau the gyro rate now controls how quickly updates are sent to the ESC's raising the gyro rate will increase the speed at which updates are sent to the ESC's. The maximum rate achievable depends on the gyro and what the ESC can handle. Rates up to 2khz should be safe on most oneshot capable ESC's. The Gyro rate can be changed in the GCS on the hardware tab.