Help with understanding kalman filter

AI Thread Summary
The discussion centers on implementing a Kalman filter for sensor data fusion in a helicopter UAV project, focusing on correcting roll, pitch, and yaw using accelerometers, gyros, and magnetometers. Participants emphasize the complexity of Kalman filters, noting that a solid understanding of calculus, probability theory, and control theory is essential before attempting implementation. Questions raised include the differences between state and measurement vectors, the meaning of subscripts and dot notation, and the origins of specific equations in the provided resources. Some contributors suggest starting with simpler projects or foundational math courses to build the necessary skills. Overall, while the ambition to use a Kalman filter is acknowledged, the consensus is that significant study and preparation are required.
rp181
Messages
2
Reaction score
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
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...
 
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:
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.
 
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 ?
 
i agree. without a special course,you cannot get a basic understanding of Kalman Filtering and assumptions. tutorials do not always work.
 
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.
 
Back
Top