Oneshot support is in master

oneshot and oneshot125 support is now in master. It works for both FMU outputs and PX4IO outputs. Test reports are welcome.
To enable oneshot set MOT_PWM_TYPE to 1 or 2. It defaults to zero which gives the old behaviour.
With MOT_PWM_TYPE=1 the PWM pulses are synchronised with the main loop. This reduces latency and should give a bit more phase margin.
With MOT_PWM_TYPE=2 the PWM outputs are also divided by 8, giving a range of PWM values of 125usec to 250usec. This is commonly called “OneShot125”. That reduces latency even further. Your ESC must have specific support for this output mode, and you will need to recalibrate your ESCs.


Works with my PixFalcon, confirmed as my Afro 20A Race Spec OPTO ESCs were reflashed with BLHeli 14.6 with PWM disabled (OneShot125 exclusive), plus Dampened Light and Brake Together with the other changes (EKF2 and GPS apparently) I am able to remove the increased ACCEL/GYRO filters I had to add before to get a stable flight. Now it hovers wonderfully with the standard 20Hz filters (also followed the PixRacer thread to increase other filters from 5Hz to 20Hz). Will do a hard flight test soon after the weather is better, but looking good.

Only issue I found is ESC calibration doesn’t work in OneShot mode. It initializes the ESCs correctly but then the ESCs can’t see the PWM value go down to zero (perhaps the code is still sending classic PWM not OneShot125?). But I don’t need that anyway because I always set my range manually to 1000<-1500->2000 which is nicely within the FrSky 982-2006 PWM range. And I never saw a mini-quad motor (that was not already broken) which didn’t start at the same PWM value as an identical motor/ESC model (guess that is was for older/bigger motors then).

Hope to see an official beta soon to reduce risk of having to use the latest build :slight_smile: Keep up the good work!

Wow it’s absolutely fantastic! Thanks very much to everyone who worked on this. I don’t know (or care really) if the improvements are because on OneShot technically or not, but it seems for racing drones (at least mine) with ESCs which are now commonly optimized for OneShot it’s a perfect match and the sync/filter issues seem to have disappeared.

I haven’t even re-tuned the PIDs yet, so this could get even better. I did notice the GPS still needs work but is much better (first arm delay greatly reduced and re-arm delay gone). RTL went in completely the wrong direction though (even though I had a 3D fix) so I really look forward to a version with OneShot which has gone through the full pre-beta tests.

Thanks Tony, really great to see it working so well!