Main loop speed

I just wondered why the main loop in the ACM code is only executed at 100Hz

NG code runs at 200Hz (which is slow for a quad)

 

if you take a look at Aeroquad and Mikrokopter code: they all run at 500Hz

 

I now that the ADC on APM runs at 400Hz, but I also know that it is capable of 2000Hz readings.

So why not speed the ADC up and let the code run at 200 (or maybe more) Hz ?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • ok thanks for your information =)
  • Developer

    Like Randy and Jason said, we are using DCM others mostly using Kalman and other methods to estimate angles. DCM is much more efficient on those. We have tested on earlier ArduCopter 100Hz and even that gave really good results. Speed up from 100 to 200Hz did not give any great change on stability.  Also most of ESCs will filter out updates that are coming faster than 150Hz. So it's rather useless to send updates faster than that to motors.

     

    NG main loop actually runs with 160Hz.

     

  • Developer
    We sample the ADC at a higher rate so we don't need to have such a high loop. If you want to, feel free to up it to the amount you'd like. It's hard coded at the main loop. Just lower the number. You can even try and assign it to a radio channel to explore different rates until you feel comfortable that you found something that works for you. I've kept it to 100 because I needed the headroom for future code execution.
  • Developer

     

        I believe this is at least partially because we use DCM which gives us a quick and accurate estimation of attitude which means we don't need to update as quickly to get stable results.  I read somewhere that once you get up to really high rates (like 2000hz) you're updating the instructions to the engines every quarter turn of the prop.  It's hard to imagine that that's really necessary... in fact, it's hard to imagine that it's useful to cycle at anything above the update frequency of the gyros and ESCs.

This reply was deleted.

Activity

DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Monday
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Saturday
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Thursday
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9
DIY Robocars via Twitter
RT @JoeSpeeds: Sat Nov 6 Virtual DonkeyCar (and other cars, too) Race. So bring any car? @diyrobocars @IndyAChallenge https://t.co/nZQTff5…
Oct 31
DIY Robocars via Twitter
RT @JoeSpeeds: @chr1sa awesomely scary to see in person as our $1M robot almost clipped the walls as it spun at 140mph. But it was also awe…
Oct 29
DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
Oct 25
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Oct 23
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Oct 23
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Oct 23
DIY Robocars via Twitter
RT @DAVGtech: Another incident: https://t.co/G1pTxQug6B
Oct 23
More…