View Single Post
Old Apr 28, 2013, 12:02 PM
evvaldis is offline
Find More Posts by evvaldis
Registered User
evvaldis's Avatar
Joined Jan 2007
182 Posts
Originally Posted by Tom Frisch View Post
Thanks for your answers. I was hoping to build something very similar to what you are doing, so maybe I can help out.

How are you combining the gyro and accelerometer data?

Are you planning on adding support for a compass/mag sensor?
I am back

gyro/acc is combined with one simple line, something like:
roll_angle =(roll_angle + ROLL*dt) + 0.0002*(acc_roll_angle-roll_angle);
roll_angle - roll horizon in radians.
ROLL - roll gyro data
dt - program loop time (0,002s)
0.0002 - accelerometer "weight" constant
acc_roll_angle - accelerometer horizon in radians.

compass/mag would be nice, but it is not most important thing to do at this time
correctly calibrated gyro drifts few degrees/min or even less, so it is fine even with gyro.
evvaldis is offline Find More Posts by evvaldis