Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to/Should I implement a Kalman filter to get accurate Accelerometer data?

I want to get as accurate data from the built in accelerometer in an Android phone as possible. I want to track two dimensional movement in x and y axis and even the small movements must be registered.

When I look at the data from the accelerometer / linear acceleration when the phone is flat on a table it changes a lot when i should be zero.

I have looked at Kalman filters, it seems like a good approach but I am having problems setting up a model.

1. Is a Kalman filter the way to go to get as accurate data as possible from an accelerometer?

2. Will a Kalman filter work? Maybe i have misunderstood but it seems like the acceleration or the velocity must be constant?

3. How do I set up the model for using Kalman filter? I'm having trouble understanding (among other things) what the process noise is?

like image 237
Kersch Avatar asked Mar 23 '14 23:03

Kersch


People also ask

How accurate are Kalman filters?

Accuracy of Kalman Filter is high. Kalman Filter is based on State-Space model where we need to model entire system to achieve optimal value.

What is Kalman filter in IMU?

The Kalman filter estimates orientation angles using all of the sensor axis contributions within the IMU.

How does Kalman filter predict?

The filter estimates the current measurement by multiplying the predicted state by the measurement matrix. The residual, ∼yk , is later then multiplied by the Kalman gain, Kk , to provide the correction, Kk∼yk , to the predicted estimate ˆx−k .

In what sense is the Kalman filter optimal?

Kalman filters combine two sources of information, the predicted states and noisy measurements, to produce optimal, unbiased estimates of system states. The filter is optimal in the sense that it minimizes the variance in the estimated states.


1 Answers

A Kalman filter applies when all measurements (of acceleration in this case) are equal to the true value plus a measurement error. The measurement error is the process noise. For for the original Kalman filter to apply the noise must be normally distributed, i.e. sometimes the error will be positive, sometimes negative, and on average zero.

If you jerk your android phone quickly back and forth, there'll be large accelerations. I'd suggest recording the accelerometer readings in that kind of action, and reviewing by eye to see whether it looks like there's the readings are indeed subject to some kind of normally distributed process noise. My guess is that the answer will be "No", i.e. I expect they readings when plotted on a graph will be smooth-ish. But if they're not smooth, a Kalman filter could be useful.

If you're trying to use accelerometer readings to work out location, I think your project is doomed to failure. Acceleration is the 2nd derivative of position with respect to time, and I've never heard of anyone being able to integrate the readings with sufficient accuracy to be at all useful.

I have applied a Kalman filter successfully to GPS readings on an Android phone to improve the location estimate. See Smooth GPS data for code that implements a Kalman filter for that. I subsequently wondered whether velocity and perhaps acceleration data could be used to improve the location estimate. Although I never followed up on that idea, see https://dsp.stackexchange.com/questions/8860/more-on-kalman-filter-for-position-and-velocity for the maths that I was considering using.

The optimal way of using all the sensor inputs (GPS, accelerometer, gyroscope, etc) to get a good estimate of location is a very hard (and interesting) problem. To find out more, the key phrase to search for is "Sensor fusion". On this subject, there's an old youtube video at http://www.youtube.com/watch?v=C7JQ7Rpwn2k .

like image 124
Stochastically Avatar answered Sep 27 '22 20:09

Stochastically