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
Saturday
DIY Drones via Twitter
RT @chr1sa: After more than a year of only virtual races, @DIYRobocars returns to the newly renovated @circuitlaunch on May 22 for the resu…
Apr 11
DIY Robocars via Twitter
RT @DAVGtech: And now available with LiDAR 🔥 https://twitter.com/Heavy02011/status/1381137016381964293
Apr 11
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #9 - #ParkingLotNerds #thunderhillracetrack, CA Join us for the next race April 24th,…
Apr 11
DIY Robocars via Twitter
RT @DWalmroth: Weather's finally cooperating, looking forward to racing 1:10 scale autonomous cars outdoors again! @diyrobocars, @NVIDIAEm…
Apr 7
DIY Robocars via Twitter
RT @AIDRI_: I finally succeeded in optimizing the trajectory and speed of a car on a #racetrack. Next step: implement a 2d controller and…
Apr 7
DIY Robocars via Twitter
@jetdillo @circuitlaunch Actually the second *in person* event in a year. We do virtual races every month
Apr 2
DIY Robocars via Twitter
Update: we're moving it back one day to Sunday (the 4th) at 11:00am instead
Apr 2
DIY Robocars via Twitter
@GrantEMoe @circuitlaunch Update: we're doing it on Sunday (4th) at 11:00am instead
Apr 2
Laurie J. Troy liked Jasper Kueppers's profile
Apr 1
DIY Robocars via Twitter
RT @chr1sa: Maybe we should have a mini @DIYRobocars race in our lower school's playground https://t.co/xLFeua1R6X
Mar 29
DIY Robocars via Twitter
If anybody wants to join us for an informal outdoors hack/race we're going to be meeting at the @CircuitLaunch park… https://twitter.com/i/web/status/1375907409223249923
Mar 27
DIY Robocars via Twitter
RT @SmallpixelCar: Ready to reopen, innovation has to continue. Inside/outside, LiDAR/GPS, race/delivery https://t.co/jpmvttoHEd
Mar 26
DIY Drones via Twitter
RT @DAVGtech: By far best race yet! Congratulations to the winner @Heavy02011 🥇🏆🍾👏👏👏 @diyrobocars @donkey_car @NVIDIAEmbedded https://t.co/…
Mar 20
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #8 - #ParkingLotNerds ⁦@DAVGtech⁩ ⁦@DWalmroth⁩ ⁦@OttawaAVGroup⁩ - join us tomorrow h…
Mar 20
DIY Drones via Twitter
RT @mrpollo: 11 years ago, the pxIMU was announced to the world on @DIYDrones, and it changed the life of many (mine included). The followi…
Mar 18
More…