Kalman filter - help me to set up a state equation

In summary, the Kalman filter model calculates the distance traveled between two positions by taking the square root of (yEast(i)-yEast(i-1))^2 + (xNorth(i)-xNorth(i-1))^2 + (zDown(i)-zDown(i-1))^2. The model uses the distance from the previous location as well as the current temperature to calculate the distance traveled.
  • #1
9988776655
46
0
I would like to find the distance that a vehicle travels using a Kalman filter. The vehicle is a car that travels the road between two positions. The vehicle has a GPS/barometer/accelerometer device that collects position data, which I converted from a longitude and latitude to a North, East, Down position in metres (This is a position coordinate of the starting coordinate is always 0,0,0). The velocity of the car is measured by this device in North, East, Down coordinates (m/s) (components of the velocity vector). I can access accelerometer measurements but this is in the device frame, not the North East Down frame. The device gives magnetic heading and euler angles roll pitch and yaw. The accelerometer has a problem with drift and the magnetic heading is not always accurate so I think that using the accelerometer for observations is not that important. Can anyone suggest a state matrix that helps me get a distance state? Thanks.
 
Engineering news on Phys.org
  • #2
Some questions first:
  • How accurately are you trying to get the distance? AFAIK, the max GPS error box (not in altitude) is like 9m, so for a car traveling around a city you'd get pretty close to something actual.
  • Is there any reason you can't orient the accelerometers to give readings in the NED frame? That would help with calibration as well as not having to do 3D transformations.
  • Are you sure that the accelerometers drift? Because I know gyroscopes do, but in my experience accels are just noisy.
  • What device are you using to measure velocity? Accels measure acceleration, which is the derivative of velocity.
I don't think you need the magnetometer either. It's nice sometimes, but it's not really reliable or useful for your application.

You might be able to numerically integrate position from acceleration and correct it with your GPS readings, but that's kinda sketchy because there's error all over the place. If you had some way to measure the input to the wheels (like a u(t) function in the LTI equation xdot=Ax+Bu) and some knowledge about the car like the weight, you might be able to get something more accurate. The best way is if you had some sort of encoder on the car wheels. :)
 
  • #3
The distance should just be the best estimation possible, given my observations. I know the GPS can have much error.
The accelerometers can't give readings in the NED frame without transformation using Euler angles. Euler angles are available from the system but I will use the magnitude of acceleration to get around this problem.
The accelerometers are noisy but you are right they don't drift.
The device uses the Doppler effect to measure velocity.
An encoder is not available for use.

I have decided on a Kalman filter model:
http://postimg.org/image/6h29p7e79/

Or for the word file version of this:
http://www.filedropper.com/kalmanfilter_1

The observation for the distance is:
temp(i) = sqrt((yEast(i)-yEast(i-1))^2 + (xNorth(i)-xNorth(i-1))^2+(zDown(i)-zDown(i-1))^2);
distance(i) =distance(i-1) + temp(i);

Where i is the index of a location given by the GPS coordinates in the North East Down frame and i = 0 ... N locations.

Units are metres, metres/sec, metres/sec^2

Can you please give me your thoughts and check if the model can be improved?
Thanks.
 
Last edited:

1. What is a Kalman filter?

A Kalman filter is a mathematical algorithm used to estimate the state of a system by combining measurements with predictions based on a dynamic model. It is commonly used in control and navigation systems to provide accurate and reliable estimates of the system's state.

2. How do I set up a state equation for a Kalman filter?

To set up a state equation, you need to define the state variables (such as position, velocity, and acceleration) and the system dynamics (how the state variables change over time). The state equation is typically represented as a set of first-order differential equations, which can be solved numerically to predict the future state of the system.

3. What are the key components of a Kalman filter?

The key components of a Kalman filter include the measurement model (which relates the measurements to the state variables), the state transition model (which describes how the state variables change over time), and the process noise and measurement noise (which account for uncertainty in the system and the measurements).

4. How do I choose the initial state and covariance for a Kalman filter?

The initial state and covariance are typically chosen based on prior knowledge of the system or through an initial calibration process. If no prior information is available, it is common to use a zero mean and a large covariance to account for a high level of uncertainty in the initial state.

5. Are there any limitations to using a Kalman filter?

While a Kalman filter is a powerful tool for state estimation, it does have some limitations. It assumes that the system dynamics and measurement noise are linear and Gaussian, and it may not perform well if these assumptions are not met. Additionally, it requires accurate knowledge of the system model and noise characteristics, which can be difficult to obtain in some applications.

Similar threads

  • General Math
Replies
6
Views
6K
Replies
2
Views
9K
  • Special and General Relativity
Replies
29
Views
2K
  • Special and General Relativity
Replies
27
Views
4K
  • Introductory Physics Homework Help
Replies
4
Views
2K
Replies
1
Views
4K
  • Other Physics Topics
Replies
0
Views
737
  • Advanced Physics Homework Help
Replies
1
Views
2K
Back
Top