SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Otatiaro
#115687
Hello,

I'm playing with gyroscopes (ITG-3200) and looking for adequate filters.

The problem is, it seems everyone want at least 6DOF, 9DOF, 89DOF ... I just need 3DOF and only have a 3 axis gyroscope.
I cannot find information on an adequate filter for gyros only that doesn't make use of accelerometers or magnetometers ...

I've tried kalman filtering (3 independant axis ... so reduced to a digital low pass filter), extended kalman filtering (cannot extract suitable equations for the model ... Euler seems the good way of doing it, but then enters quaternions and angles. I'd like an Euler equations based only on w and dw/dt, am I missing something ?), interlaced kalman filters (if inertial is the same of the 3 axis, then it is reduced to a simple kalman filter ...).

Another weird thing ... Kalman is supposed to be an adaptative filter, and from the equations I found (on many places ...) the gain calculation depends on R and Q (covariances matrix) which are supposed fixed, and doesn't depends on, say, the difference found between estimate and measurement. Then in fact independantly of the measurements, the gain K lean toward a fixed value (the positive solution of a 2nd order polynomial equation, depending on R and Q) ... and then the Kalman filter is a kind of low pass digital filter with a fixed gain (x(n+1) = (1-K)*x(n)+K*z(n), x being the estimate and z the measurement).

Either I'm missing something huge, either the kalman filter is not so "magical" to me.

I have pretty good mathematical and statistical background, but I'm not a filtering expert at all. I need help on this one.

Regards,
Thomas.
By Otatiaro
#115695
Hi,

I posted exactly the same topic at DIY Drones and someone, I think, gave me the answer ...

http://www.diydrones.com/forum/topics/f ... _com_forum

I was expecting the kalman filter to reduce noise on the gyro signal ... but since the 3 gyro output are not correlated by any means, Kalman cannot do anything for me.
In fact no ... I think I will still use the "kalman filter" which will be, in my case, a digital low pass filter.

I may add some sort of automatic gain adjustment, maybe by calculating the variance of the signal input (have to test).
I may also look at other filtering methods (FIR, etc...).

Regards,
Thomas.
By UhClem
#115696
Otatiaro wrote: I was expecting the kalman filter to reduce noise on the gyro signal ... but since the 3 gyro output are not correlated by any means, Kalman cannot do anything for me.
This is not true. I used a Kalman filter to good effect on only one measurement: pressure altitude. Combined with a model of the system that included velocity and acceleration states this produced results better than could be achieved with a simple low pass filter.

The Kalman filter is a model based filter. Its purpose is to provide an optimal estimate of the system states given a system model and some measurements. If you start with a bad model, you will get bad results and I suspect that you used a system model with just three states (x,y,z angular rates) which isn't a system model at all. This model says that the rates are constant. So long as that is true it will provide good results but I suspect that you are interested in a system that doesn't have constant rates. So in order to provide better performance when the rates change you increase the model noise which reduces the Kalman gains. Now it tracks changes better but at the cost of higher noise.

If you work up a model which more accurately represents the system being measured then it will do better. But you have to have a good system model first.
By Otatiaro
#115697
Hello,

Thanks for the input.

But ... I cannot find any suitable model for only 3 gyroscopes, do you have something in mind ?
The fact is there is no relationship between the 3 angular rates (I can't see any) : having X and Y angular rates doesn't tell you anything about the Z angular rate, no ?

Regards,
Thomas Legrand.
By sebmadgwick
#115722
If all you wish to do is integrate the angular rates of the sensor coordinate frame to provide a measurement of its orientation relative to the original (Earth) coordinate frame, see section 3.1 of this report for the solution:
http://www.x-io.co.uk/res/doc/an_effici ... arrays.pdf

Simply put: Unless you can supply any information about [or model of] the system/application then it is impossible to 'filter' the data because we must assume that all magnitudes and frequencies provided by the gyroscope potentially represent the true signal.