Help with understanding kalman filter

In summary: Here are some suggestions:1) Get comfortable with the following subjects. You don't have to be an expert, but you need to have some grasp of them:a) Coordinate transformations (e.g. Euler angles, quaternions, etc)b) Integration (you should be able to solve simple problems like finding the velocity from the acceleration function, or finding the position from the velocity function)c) Discrete math (Boolean algebra, the idea of a truth table, etc).2) Get ahold of the documentation for the accelerometer, gyro, and magnetometer you plan to use. Study it.
  • #1
rp181
2
0
I am trying to implement a kalman for use in sensor data fusion, for 3 axis accelerometers, 3 axis gyros, and 3 axis magnetometers for a helicopter UAV project.
The roll, pitch, and yaw need to be known. Gyros do a great job of doing this, but the problem is that they drift of the zero value. Accelerometers are used to correct the roll and pitch values as they don't drift, and a magnetometer corrects yaw based on the magnetic north reference point.
Kalman filters are the most effective way to combine these. There are simpler ways such as a PID loop, but helicopters are very complex, and I do not want to take a chance.
My math is not nearly good enough to go and code a kalman filter, but I found kfilter:
http://kalman.sourceforge.net/doc/example.html
I have some questions in using this.
1) What is the difference between the state vector and measure vector? Is measure what the sensor data shows and state the current position?
2) What does the subscript 'k' represent?
3)what does 'x' with the two dots over it mean? What about the single dot?
4) In the link I posted, in this equation:
form_15.png

where does the part before the parenthesis come from? Why are there two for x and two for y?

Any advice on how to use this in this application/ broken down steps is welcome.
 
Mathematics news on Phys.org
  • #2
rp181 said:
I am trying to implement a kalman for use in sensor data fusion, for 3 axis accelerometers, 3 axis gyros, and 3 axis magnetometers for a helicopter UAV project.
The roll, pitch, and yaw need to be known. Gyros do a great job of doing this, but the problem is that they drift of the zero value. Accelerometers are used to correct the roll and pitch values as they don't drift, and a magnetometer corrects yaw based on the magnetic north reference point.
Kalman filters are the most effective way to combine these. There are simpler ways such as a PID loop, but helicopters are very complex, and I do not want to take a chance.
My math is not nearly good enough to go and code a kalman filter, but I found kfilter:
http://kalman.sourceforge.net/doc/example.html
I have some questions in using this.
1) What is the difference between the state vector and measure vector? Is measure what the sensor data shows and state the current position?
2) What does the subscript 'k' represent?
3)what does 'x' with the two dots over it mean? What about the single dot?
4) In the link I posted, in this equation:
form_15.png

where does the part before the parenthesis come from? Why are there two for x and two for y?

Any advice on how to use this in this application/ broken down steps is welcome.

Welcome to the PF.

It looks like there are a number of fundamental math subjects that you would have to learn before attempting this project. Is there a simpler project that you could do, that is more in line with your math abilities at the moment?

I'm not that familiar with Kalman filters, but it looks to be for discrete time systems (the "k" values are the sample numbers, I would think), and the dot notation refers to differentiation in Calculus. Have you had Calculus yet? How about digital filters? Those would seem to be prerequisite courses for tackling this UAV control project...
 
  • #3
Hey,
Thanks for the reply.
The filter is models a continuous time model, but yes, it is discrete to enable coding for it.

Calculus next year. I was hoping the libraries would eliminate some of the math clearly out of my understanding.

Right now, I am going to take a look at Directional Cosine Matrices, I am able to understand the math for that, so I am going to put a hold on the kalman filter.

BTW, if you are interested, project progress is here:
http://rp181.fortscribe.com
 
Last edited by a moderator:
  • #4
To be brutally honest, a Kalman filter is well beyond what someone who has yet to take calculus. You need to know calculus plus real analysis, probability theory, signal processing, and control theory to understand how Kalman filters work. You need to learn to walk before you learn to run.
 
  • #5
I certainly agree with DH - that Kalman filters are far too complex for someone who has not taken a calculus course. Out of interest though - what's the real analysis needed for Kalman filters ?
 
  • #6
i agree. without a special course,you cannot get a basic understanding of Kalman Filtering and assumptions. tutorials do not always work.
 
  • #7
rp181 said:
I have some questions in using this.
1) What is the difference between the state vector and measure vector? Is measure what the sensor data shows and state the current position?
Yes
2) What does the subscript 'k' represent?
The material treats the process as having discrete steps. 'k' refers to the k th step.
3)what does 'x' with the two dots over it mean?
The acceleration in the x coordinate
What about the single dot?
The velocity in the x coordinate
4) In the link I posted, in this equation:
where does the part before the parenthesis come from? Why are there two for x and two for y?
I think the 'T' is the elapsed time between two consecutive steps. The expressions in the matrix look like truncated Taylor expansions that give the coordinates of the k th step in terms of data for the previous step. A Taylor expansion (in this case) would be a power series in the variable 'T' so it it weren't truncated, it would have all the integer powers of T in it.

Any advice on how to use this in this application/ broken down steps is welcome.

The other posters are correct about that fact that it would take considerable study to understand the Kalman filter. I've looked at the so-called simple tutorials about it on the web and never had the patience to slog my way through them, so I can't recommend any. However, you seem to have an unreasonable amount of ambition. Don't give up yet.
 

1. What is a Kalman filter?

A Kalman filter is a mathematical algorithm used to estimate the state of a system based on noisy measurements and dynamic models. It is commonly used in control systems, signal processing, and navigation applications.

2. How does a Kalman filter work?

A Kalman filter works by combining two sources of information: predictions from a dynamic model of the system and measurements from sensors. It calculates a weighted average of these two inputs to produce an optimal estimate of the true state of the system.

3. What are the advantages of using a Kalman filter?

The main advantage of using a Kalman filter is its ability to handle noisy measurements and provide an accurate estimation of the true state of a system. It also has a low computational cost and is relatively easy to implement.

4. What are the applications of Kalman filters?

Kalman filters are used in a wide range of applications, including navigation and tracking systems, control systems, signal processing, and data fusion. They are particularly useful in situations where there is uncertainty or noise in the measurements.

5. How can I learn more about Kalman filters?

There are many resources available for learning about Kalman filters, including textbooks, online tutorials, and courses. It is also helpful to have a strong understanding of linear algebra and probability theory. Practice and experimentation are key to gaining a deeper understanding of how Kalman filters work.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • General Engineering
Replies
2
Views
3K
  • General Engineering
Replies
2
Views
2K
Replies
8
Views
3K
Replies
14
Views
1K
  • General Engineering
Replies
9
Views
5K
Replies
1
Views
1K
  • General Engineering
Replies
1
Views
2K
  • Differential Equations
Replies
24
Views
8K
  • Calculus
Replies
1
Views
3K
Back
Top