Page 1 of 1

kalman filter problem

PostPosted: Sun Aug 07, 2011 12:57 pm
by khatarat
hi
i implemented a one dimension(one vector) kalman filter. but the output has some problem. the biggest problem is that accelerometer has more power in out put and when i move device rapidly up and down the output become incorrect as you can see in pic in region A.
Region A is when i move device up and down without rotating as you can see in gyro output that device has just a little rotation.

can any one tell me where is the problem?


i use this guid to implement kalman filter
http://tom.pycke.be/mav/71/kalman-filtering-of-imu-data

here is three constant values:
E(alpha2) = 0.001
E(bias2) = 0.003
Sz = 0.3 (radians = 17.2 degrees)


how can i calc this values of my sensors? i think this const values causes my problem that i expalin it in first post.

Re: kalman filter problem

PostPosted: Sun Aug 07, 2011 7:32 pm
by Tom
Good remark. You should change the

E(alpha2) = 0.001
E(bias2) = 0.003

constant values until the result satisfies you. Generally, the bias will more slowly converge to the correct one as you change it to what you want.

Re: kalman filter problem

PostPosted: Sun Aug 07, 2011 7:59 pm
by khatarat
i have change this values many times but still moving device affect the output.
can you show me a way to get the best values.

another questeion is that is it possible to just use gyro and accelerometer to remove completely moving affect from output so just rotating device changes the output? or i have to use gps to achive this?

Re: kalman filter problem

PostPosted: Sun Aug 07, 2011 8:59 pm
by khatarat
another question :)
i want to use kalman filter to get three vector output to use in motion capture and i need the output without any noise.

i use this for start
http://tom.pycke.be/mav/71/kalman-filtering-of-imu-data

do you think that it can do what i need? or i should use another kinds of kalman filter?

Re: kalman filter problem

PostPosted: Mon Aug 08, 2011 7:18 am
by Tom
For 3D motion capture you can look at the gluonpilot code (especially the ahrs_quaternion code).

With the kalman filter you are currently using, the constant tell you how much the output should be like the accelerometer, or how much like the intergrated gyro. I propose to change the constant by a factor 10 at a time so you can see the difference.

Re: kalman filter problem

PostPosted: Mon Aug 08, 2011 9:48 am
by khatarat
i use an ahrs_quaternion kalman filter code but it doesnt work. can you give me that code. is it has any document?


in this kalman filter can you tell me exactly witch of them is about power of gyro and witch of them is about power of accel. for example if i want to reduce the power of accel i will test this values.

E(alpha2) = 0.001,0.002,0.003,0.004
E(bias2) = 0.004,0.003,0.002,0.001

is this way is correct? whats your suggestion?
do i should change Sz too?

is there any way to get the best value automaticlly?
in motion capture i need 16 IMU. i should do this for all of them?


-----
another question is that what is the kind of this kalman filter? is it KF or Extended kalman filter?
what is the difference between them?

Re: kalman filter problem

PostPosted: Tue Aug 09, 2011 7:05 am
by Tom
It is especially the ratio E(alpha2) / E(bias2) that is important, so don't change both values at the same time. Also, your changes should be bigger. You can start with a 10x incremental change.


This is a normal kalman filter. Extended kalman filters are better for non-linear problems.

Re: kalman filter problem

PostPosted: Tue Aug 09, 2011 7:54 am
by khatarat
what about ahrs_quaternion?
is it have a sample code or documentation?

Re: kalman filter problem

PostPosted: Wed Aug 17, 2011 7:15 am
by khatarat
i try to test various state of kalman by realtime changing E(alpha2) , E(bias2) , Sz on pre saved data from my imu.
but there is no value for them that remove error that i show you in my first post and drift together.

so i think i have to use gps to remove this two errors together. but in some products lik http://www.xsens.com/en/general/mtx they say that it has no drift and has accurat orintation output with no gps.
whats your opinnion?

Re: kalman filter problem

PostPosted: Wed Aug 17, 2011 12:44 pm
by Tom
A GPS is used to overcome other dynamics, not for shaking the module.

All I can say is you need to tune the variables. I'm sorry it's not working for the moment, but it should. You can choose whether you kalman filter should be more like the integrated gyro, or more like the accelerometer. Clearly, it should be more like the integrated gyro. The wrong reading comes from your accelerometer.