ACM gyro calibration code - some improvements ideas

Hi,

Two days ago I uploaded an improved gyro/accelerometer calibration code to the Pirates's thread (http://www.rcgroups.com/forums/showpost.php?p=17455791&postcount=4992).  This code makes sure the platform is stable while measuring the gyros' rest point.  It also makes sure that the gyro and accelerometer readings are within reasonable range, so you don't try to fly with faulty h/w.  The code, by the way, is based on my own CaspiQuad project where I have successfully used this algorithm.

I now looked at how it's done for the ArduCopterMega, and I see that the code there (though implemented differently than the Pirates' code) does not have the functionality I mentioned above.  I therefore suggest that it will be added.

Why is this important?  Because calibration happens after power up.  I, for example, connect the battery with the quad positioned upside-down, so the calibration took place at the same time I flipped it to put it on its legs - no a good idea at all!

By the way, I suggest moving the calibration to the main loop, immediately before enabling the motors.  That is a much better time to do it.

Dror

 

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

Join diydrones

Email me when people reply –

Replies

  • Developer
    Actually it is not calibrated immediately after you power up your electronics. System will wait fair time for all movement to stop before calibration has been taken. But as Chris said, we are now looking this implementation on our ArduCopter team.
  • 3D Robotics
    Thanks, I'll pass this on to Jason (ACM's developer)
  • hmm,

    that would explain a few 'side-effects' i noticed.

    i always try have the copter on the ground before powering up.

    not that the initialisation sequence goes 'through' when the quad is moving.

     

    despite this procedure i can produce erroneous startup behaviour - aka the quad is instable.

    the quad can also 'break' away.

    to re-produce this just try to start 'fast' after arming the motors - and this as soon as possible.

    initially i thought this was a sideeffects of having the accel values not correctly calibrated.

    then i thought about having faulty boards - but two boards show the same behaviour.

    but that is not the whole story.

     

    i will give your idea a try.

     

    thanks for the code and time you spend ;-)

    robert

This reply was deleted.

Activity