Note: this original spoke of the sensor rate being 666. However, this was a mistake and the sensor rates were 500 Hz and 1000 Hz.
There has been a lot of talk about OneShot125 mode for ESCs and how much better you can tune your quadcopter with it. Briefly, this is a mode that uses a pulse width of 125-250 µs instead of the typical 1000-2000 µs. This shorter pulse width allows a higher update rate (up to 2khz). In addition, the recommendation is to update the output as soon as you calculate a new value. This improves the latency of sensor to ESCs in two ways: the synchronous update reduces the latency due to two independent loops and the shorter pulse duration saves another 1.5ms waiting for the falling edge of the pulse. With an update rate of 400 Hz on the PWM outputs that latency has a worse case of 2.5 ms so ultimately you are talking about 4ms latency reduction.
It sounds somewhat unlikely that such a small time delay would make a difference, but at the same time the ESC latency is the ultimate performance bottle neck for quadcopters. With ESC response times getting into the 10-20s of ms, this communication latency can become an appreciable component.
Back in December ernieieft wrote Tau Labs support for it and with autotuning got higher PIDs and felt like it was quite locked in. Here you can see the outputs from the four channels as well as the interrupt from the MPU9250 on Sparky2. This shows that each time there is a sensor update, shortly after it there is a pulse on the output channels (synchronous updates).
Zooming in, we can see what the latency is from the MPU9250 indicating a sample is ready to actually completing the pulse, and it is about 300 µs. Much better than the worst case 4 ms described above. This is with a short output pulse so in reality the time could go as high as 450 µs.
However, I wanted to quantitatively compare how much specifically OneShot125 mode really makes a difference. Luckily, we have our autotuning algorithm which actually allows monitoring the time constant of the delay from a change in the output to a change in the gyros.
After three repeats, this is what I got:
And the multiple comparison shows that both OneShot tests were significantly different than traditional mode.
There has been a lot of talk about OneShot125 mode for ESCs and how much better you can tune your quadcopter with it. Briefly, this is a mode that uses a pulse width of 125-250 µs instead of the typical 1000-2000 µs. This shorter pulse width allows a higher update rate (up to 2khz). In addition, the recommendation is to update the output as soon as you calculate a new value. This improves the latency of sensor to ESCs in two ways: the synchronous update reduces the latency due to two independent loops and the shorter pulse duration saves another 1.5ms waiting for the falling edge of the pulse. With an update rate of 400 Hz on the PWM outputs that latency has a worse case of 2.5 ms so ultimately you are talking about 4ms latency reduction.
It sounds somewhat unlikely that such a small time delay would make a difference, but at the same time the ESC latency is the ultimate performance bottle neck for quadcopters. With ESC response times getting into the 10-20s of ms, this communication latency can become an appreciable component.
Back in December ernieieft wrote Tau Labs support for it and with autotuning got higher PIDs and felt like it was quite locked in. Here you can see the outputs from the four channels as well as the interrupt from the MPU9250 on Sparky2. This shows that each time there is a sensor update, shortly after it there is a pulse on the output channels (synchronous updates).
Zooming in, we can see what the latency is from the MPU9250 indicating a sample is ready to actually completing the pulse, and it is about 300 µs. Much better than the worst case 4 ms described above. This is with a short output pulse so in reality the time could go as high as 450 µs.
However, I wanted to quantitatively compare how much specifically OneShot125 mode really makes a difference. Luckily, we have our autotuning algorithm which actually allows monitoring the time constant of the delay from a change in the output to a change in the gyros.
Normal PWM mode
So first I ran autotuning with Seeing Spark and Sparky2 using KISS ESCs in traditional mode. This is with the sensor running at the default rate for Sparky2 (500 Hz).OneShot125
Then I cracked SeeingSpark open and soldered the JP1 bridge to enable OneShot mode.
Note: per request I have put the files to make this power distro board on OSHPark. I'll try and make a BOM and assembly guidelines and upload that soon.
Then popped in a fresh battery, and did a few more sessions of autotuning.
OneShot125 - 1000 Hz sensor rate
I also wanted to see if increasing the sensor rate to further reduce the latency would cause more improvement, so I set it to 1 Khz.
and ran another three rounds of autotuning.
and ran another three rounds of autotuning.
Statistics
So of course the punchline. Is there a significant difference between traditional PWM and OneShot mode as measured by the time constant of the response? Yes. Anova shows p < 0.01 for an effect of output type:
Anova results |
And the multiple comparison shows that both OneShot tests were significantly different than traditional mode.
Conclusion
Using OneShot mode on this quad results in about a 20% reduction in ESC latency. Even before OneShot, these KISS ESCs were pretty damn fast so it already flew really well. I'm not sure I'll be able to tell the difference in rate mode, but I do believe a better acro pilot than me could. I also didn't run these parameters through the system models to start seeing what the difference in effective control bandwidth will be for the outer loops (e.g. attitude).
It also remains to be seen if there are similar benefits with BLHeli and I believe SimonK has support coming soon for OneShot. I'll probably repeat these tests once I have the right hardware.
It also remains to be seen if there are similar benefits with BLHeli and I believe SimonK has support coming soon for OneShot. I'll probably repeat these tests once I have the right hardware.
Vey nice writeup! Now we should do a blind test to see wether a pilot can tell the difference between the modes ;).
ReplyDeletePS: There is a typo, you wrote 1000-2000ms instead of 1000-2000us.
Great stuff. Feedforward leaving, OneShot entering the scene...
ReplyDeleteDid you have a chance to test out the bearhugs yet? Would love to see the results
ReplyDeleteNot yet. Having some weird results with them so far :(
DeleteOnline Assignment Expert is a milestone-setting assignment help providing company classifying under academics writing of different types. Our trait to make sure that we offer best Online assignment help without any mistakes. The same has one hearts and minds of over a million students around the globe. Our nursing assignment help experts say that this is what you aim for in your studies. We are no different. We have ensured this motto is followed by each of our accounting assignment writing experts, who are also research scholars. Our experts are certified and experienced professionals in the assignment help Australia discipline.
ReplyDeleteThanks for all the tips mentioned in this article! it’s always good to read things you have heard before and are implementing, but from a different perspective, always pick up some extra bits of information. Visit@
ReplyDeletemcafee.com/activate
mcafee.com/activate
norton.com/setup
You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your fantastic post. Also, I have shared your web site in my social networks!
ReplyDeleteNorton.com/setup
Thank you so much for spending time to write this blog article, i must say you are a excellent and talented blogger, I Found This Article To Be Very Informative and Helpful, please keep sharing such amazing blogs I am a Accountant from United States of America, Washington Dc, and I Love to read and Write Blog.
ReplyDeleteSome Of My Web Blogs Awesome Blog Post Please Feel Free to Check Out My Blog you will find the process of Norton software installation with step by step instructions and much more.
Keep Sharing will come back to read more,
Click to Process
norton.com/setup download and install
norton.com/setup enter product key
www.norton.com/setup
login.norton.com
my.norton.com
norton.com/setup
norton.com/setup activate
norton.com/setup install
norton.com/setup help
norton.com/setup renewals
norton.com/enroll product key
Much obliged for the post and effort! You should keep sharing even more such information.
ReplyDeleteAol Mail Login
Best method to create your primevideo mytv account through the activation process by primevideo.com/mytv. You need to follow the instructions to activate www.amazon.com loin mytv. If you are viewing Amazon Prime Video on your device go toamazon.com enter code.
ReplyDeleteWishing you the most awesome aspect karma for all your publishing content to a blog efforts.This is my first chance to talk this site. I discovered some fascinating things and I will apply to the improvement of my blog.
ReplyDeleteyoutube video downloader
download youtube video
youtube video download
LG's brand new bargain with Tubi to get ad-supported articles on its own smart apparatus arrives just months following the firm revived its business Cope with Xumo -- a Tubi competition recently obtained by Comcast -- to Keep on serving as the motor to get LG Channels, the ad-supported Video-streaming agency on LG clever TVs
ReplyDeletetubi.tv/activate | tubi.tv/activate enter code | tubi.tv/activate