4

I want to use gyro, accelermeter and magnetometer to get a full smooth rotation in 3 axis.

The first problem is that my outputs individualy has very noise and I want to know how can I remove it.

The second problem is the gyro drift that I think it should solve with Kalman filter.

The third problem is the accelerometer. If I combine the gyro and accelermeter when I move the device without rotating the device the output will change. Is Kalman filter can remove the moving effect from output too?

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
khatarat
  • 49
  • 1
  • 1
  • 2

1 Answers1

7

the first problem is that my outputs individualy has very noise and i want to know how can i remove it.

Yes, that is natural, do not worry, you can remove the noise.

the second problem is the gyro drift that i think it should solve with kalman filter.

Yes, Kalman filter is one way to go. You may find these answers useful:

Sensor fusioning with Kalman filter
Combine Gyroscope and Accelerometer Data

the third problem is the accelerometer.if i combine the gyro and accelermeter when i move the device without rotating the device the output will change.

I am not sure I understand that correctly. If you have magnetometer Kalman filter can remove the gyro drift even if you are not rotating the device. Is that what you are asking?

EDIT: Depending on your application, you can assume that the acceleration is zero on average. Read this, especially page 24:

http://gentlenav.googlecode.com/files/DCMDraft2.pdf

I use this assumption in my application for human motion sensing and it works perfectly.

Community
  • 1
  • 1
Ali
  • 56,466
  • 29
  • 168
  • 265
  • you said that kalman filter can remove drift. ok. but moving device effect on accelerometer output.its means when device moving and doesnt rotating the output show that device is rotating because of accelerometer. can kalman filter remove this error too? – khatarat Mar 15 '11 at 19:20
  • If I understand your question correctly, the answer is yes. I have added a reference, see above. – Ali Mar 16 '11 at 00:13
  • about the first problem.how can i remove noise? in this page it seems that the noises have removed but how can i remove noises like that? http://stackoverflow.com/questions/1586658/combine-gyroscope-and-accelerometer-data – khatarat Mar 16 '11 at 08:03
  • The noise was removed by the Kalman filter. If you want to know HOW TO implement Kalman filter then read the answers on those links I gave. However, the complementary filters seems much easier to understand and implement than the Kalman filter, again: read those answers at the links. – Ali Mar 16 '11 at 09:09
  • this reftence used the DCM algorithm. can i use kalman filter for removing accleration from gravity in accelerometer? – khatarat Mar 16 '11 at 09:18
  • Yes. You need the assumption on page 24, that is, the acceleration of the device is zero on average. In other words, you measure gravity "on average". – Ali Mar 16 '11 at 14:35
  • can you explain it more for me? – khatarat Apr 04 '11 at 15:14
  • Please ask your question. By the way, why do you insist on the Kalman filter? The Complementary Filter is a lot easier to understand and implement, or the PI feedback loop in the DCM draft, and they appear to give similarly good results as the Kalman Filter. – Ali Apr 04 '11 at 16:59
  • i have tested some complementry filters but they didnt have good result and another problem is that the moving of device affect the result of rotation because of accelerometer. is kalman filter remove this error or i have to use gps to remove transition from rotation.(as i asked it before). – khatarat Apr 05 '11 at 20:21
  • I just finished the PI feedback loop implementation discussed in the DCMDraft2.pdf and it works like a charm. If you move the device you may want to use a high-pass filter to detect sudden movements and temporarily set the TotalCorrection to zero (see page 27), effectively using only gyro signals when sudden movements are detected. Works perfectly for my application, survives 20-60 m/s^2 shakes for 2 seconds. – Ali Apr 07 '11 at 23:11