Skip to content

User Guide: OneShot125

Jason Hitesman edited this page Mar 15, 2015 · 4 revisions

What is OneShot125?

OneShot125 is a modification to how communication between the flight controller and ESC's is accomplished. The traditional method is a PWM signal with a pulse width ranging between 1000µs and 2000µs sent at a fixed update rate as high as 400hz with current ESC's. OneShot125 makes two changes to that. First it uses a 125µs-250µs pulse width allowing for a higher update frequency of up to 2khz. Secondly the update frequency is no longer fixed but instead updates are sent as soon as new data from the sensors has been processed.

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, at the time of this writing oneshot support is available in Tau Labs next builds but has not yet made it into an official release.

What ESC's support OneShot125

KISS

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

OneShot is currently available in the next branch of TauLabs and is likely to be included in the next release. 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...).

Because of this slightly different implementation when inputting the output min/max values in GCS you must multiply the desired value by 12. So for the standard 125µs-250µs range you would input 1500 for min and 3000 for max ( Since 125 x 12 = 1500 and 250 x 12 = 3000)

At this time there is no option to enable oneshot through the GUI and it must be enabled through the uavobjects broswer. Specifically under Settings -> ActuatorSettings -> ChannelType you will need to change the setting from "PWM" to "OneShot" for all output channels you are using.

As noted above you will also have to change the output min/max values to 1500/3000 respectively a value of approximately 1575 should result in the motors spinning and is a good starting point for neutral.

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.

Potential Issues

Currently not all flight targets are supported. At this time F3 and F4 based targets are supported but using OneShot with PWM inputs may not work due to the available timers. CC3D now supports OneShot as well but due to the limited timers not all inputs will work with OneShot:

Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4
------+-----------+-----------+-----------+----------
TIM1 | Servo 4 | ------- | ------- |
TIM2 | RC In 5 | RC In 6 | Servo 6 |
TIM3 | Servo 5 | RC In 2 | RC In 3 | RC In 4
TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
------+-----------+-----------+-----------+----------

You can still use PPM on RC In1 and use Servo1..3 as normal PWM. All other Outputs can be set up to OneShot. If you use a serial protocol receiver (DSM/HoTT/SBUS) you can use OneShot on all Channels. I tested with channel 1..6 with Saleae, a KISS 18A on output 1 and SUMH on Main and Flexi Port.

[Original post about CC3D support] (http://forum.taulabs.org/viewtopic.php?f=17&t=451&start=30#p4519)

Clone this wiki locally