Go Down

Topic: $50 bounty: report pitch and roll minus any acceleration effects (Read 1 time) previous topic - next topic

Rob Cameron


Then don't try and just use an accelerometer to establish orientation because it doesn't work.


I know, I want to integrate the gyro to make it more accurate, that's what they bounty is for! I want someone to write that code to make it awesome. :)

Rob Cameron


JimEli


Rob Cameron



No takers? C'mon guys! Why is this so hardddddd


Two words: kalman filter


Hey Jim,

I looked into the Kalman filter and what I found (or at least, the way it was being used in this instance) was to take a large percentage of the read from the gyroscope and add that to a small reading from the accelerometer (plus a certain percentage of the final result from the last read) and use that to determine an object's position. But it required that the object be constantly moving/rotating, like in a self-righting robot. It's always about to tip over so the gyro constantly has changing input. This solution won't do me any good if a vehicle is on a slope, but isn't rotating in any way. 95% of the 0° reading from the gyro plus 5% of the 5° reading from the accelerometer is going to read as almost 0°. (I posted a link of an example of someone using the Kalman filter for his self-righting robot in my first post on the thread.)

To be fair, I don't 100% understand the calculations going on in the Kalman filter, but this is how the Complementary filter works and several sources listed it as a "good enough" replacement for a Kalman filter. So while Kalman may be more accurate, the basic function at the end of the day should be the same as the Complementary.

(I'm actually using a Complementary filter when I display altitude from the barometer to get a smooth reading instead of the raw jumps of +/- 3 feet when sitting at rest.)

Unless my interpretation is completely wrong, in which case please point that out and tell me the secret of how I can get this to work for my project. :)

jremington

There are several open source AHRS (Attitude and Heading Reference System) projects around for you to use as a guide. They are intended for navigation, but the "Attitude" part does what you want.

Here is David Grayson's, intended for the Pololu Mini-IMU and the Raspberry Pi: https://github.com/DavidEGrayson/minimu9-ahrs

There is this link on Sebastian Madgwick's page: http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

One on Google Code: http://code.google.com/p/openahrs/wiki/openAHRS

Finally you can buy self contained modules with code very cheaply these days: http://www.chrobotics.com/

Rob Cameron


There are several open source AHRS (Attitude and Heading Reference System) projects around for you to use as a guide. They are intended for navigation, but the "Attitude" part does what you want.

Here is David Grayson's, intended for the Pololu Mini-IMU and the Raspberry Pi: https://github.com/DavidEGrayson/minimu9-ahrs

There is this link on Sebastian Madgwick's page: http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

One on Google Code: http://code.google.com/p/openahrs/wiki/openAHRS

Finally you can buy self contained modules with code very cheaply these days: http://www.chrobotics.com/


Thanks for the links! I'll look into them in the next day or so...if they contain the answer you shall be the winrar!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy