![]() |
Gyro math filters
I've been working on a couple of different filters for our gyro (without the robot, so I can't verify anything I'm writing), and I've run into a problem. I'm trying to incorporate the gyro and the accelerometer in a complimentary filter, but it just occurred to me that I'm measuring the wrong axis with the accelerometer. I'm measuring pitch/roll when I need to be measuring yaw. All of the filters I've been working on rely on the following flawed code.
Code:
#include <WPILib.h> |
Re: Gyro math filters
Do you want to do a full 6 degree of freedom system or do you want to assume that you stay on flat ground?
|
Re: Gyro math filters
It isn't possible to use an accelerometer for measuring yaw rotation. A magnetometer should be used instead since it's essentially a compass. I'm not sure where you could get one that's easy to set up or use. My team got one from SparkFun, but it requires a 3.3V source; we haven't spent enough time figuring out how to power it yet.
|
Re: Gyro math filters
Quote:
Quote:
Quote:
|
Re: Gyro math filters
Quote:
The key advantage of the complementary filter is that it's far simpler than approaches like the Kalman filter if you make certain assumptions about the signals. So in the case of an aerial vehicle we can assume that total accelerometer values near 1g represent a stable orientation. If you have wheel encoders on a wheeled robot you can make similar assumptions about rotation based on the left-right count difference. |
Re: Gyro math filters
Quote:
-Kevin |
Re: Gyro math filters
Quote:
|
Re: Gyro math filters
You might be interested in the Nav6 open source IMU. https://code.google.com/p/nav6
It's got 3 axis gyro, 3 axis accelerometer, 3 axis magnetometer. It's also got a dedicated chip running fusion algorithms and auto calibration algorithms. Also has open firmware source that converts all that to yaw/pitch/roll/linear acceleration values. It's very accurate. There are also CRio libraries for c++, java and Labview, and sample robot code too. But if you want to learn the fusion algorithms and do it yourself, I recommend reading the wiki at the link above. Under Advanced Topics section, see the References page. - scott |
Re: Gyro math filters
I've had good experience with the IMU Sensor Fusion Algorithm from Sebastian Madgwick: http://www.x-io.co.uk/open-source-im...rs-algorithms/
|
| All times are GMT -5. The time now is 02:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi