PDA

View Full Version : Question What are the inputs for Kalman filter ?


mikel
Oct 26, 2006, 06:01 PM
I've been reading alot about UAVs for the past couple months and now have some idea about particular parts - what sensors I can use in IMU, what Kalman/Complementary filters are, how to connect Flightgear simulator to matlab, etc. But I still don't have the whole thing figured out in my head.

Kalman filter theory doesn't look too complicated, but I don't understand what exactly is being filtered.
One example shows a filter with 2 imputs - position from gps and position from a sensor. That's clear.

Reading abut Kalman filtering in 6-DOF IMUs I get the idea that filtering is used even without GPS positions, i.e. only data from gyros & accelerometers is fltered. But they measure different parameters - accelerations and angle rates.
As I understand, the inputs for Kalman filter are 2 or more variables describing the same parameter, such as position for example. Do we calculate position using accelerations/speed + previos position? Do we calculate position from the gyro output (angles) too? how?
How exactly the accelerometer data is fused with gyro data?

What about measuring the angles? I don't see how accelerometers can increase gyro precision in measuring angles.

Is there an article that describes this stuff in details?

Thanks,
Mke

Unterhausen
Oct 27, 2006, 10:34 AM
There is coupling between acceleration and the gyros. For one thing, the accelerometers always measure gravity. As long as your model is correct, the Kalman filter will extract the available information.

There are tons of articles but not a lot of them that are comprehensive and basic because that kind of article doesn't get published. Did you look at the top post of this forum?

TheKnife
Oct 27, 2006, 05:16 PM
Just in case you missed it, you might want to see this thread (http://www.rcgroups.com/forums/showthread.php?t=521011). In particular look at this link (http://tom.pycke.be/mav/71/kalman-filtering-of-imu-data) and the links contained within it under the "further reading" heading. To try to directly answer some of your questions, in general Kalman Filtering (KF) is used to produce an estimate from a noisy measurement. If there are multiple measurements then KF can be used to combine (or "fuse") them so as to get a better estimate. In the case of an IMU you might combine position from a GPS with measurements from accelerometers plus velocity measurements to get position estimates (plus other stuff too). So it isn't always position data from 2 different sensors but rather position measurements plus delta position estimates gotten by integrating velocity and acceleration. You might not even have GPS and just use original position plus KF'ed velocity & acceleration to get estimated position. There isn't just 1 exact set of equations that is universally used, it depends on what you have for sensors and then what you have for computing power.

As to getting position from gyro data ... well you can get angular position or attitude from integrating gyro data. You can try to use accelerometers as a tilt sensor to aid in getting attitude (and I think this is mentioned in the link above) but personally I wouldn't do this. You do need to estimate attitude (thus perhaps using the gyros) to get X,Y,Z position IF you're using accelerometers in your position estimation. This is because the accels are always measuring 1G due to gravity and if the vehicle is rolled or pitched, this 1G won't always show up in just the up/down accel. Gravity's 1G now shows up in the other 2 accels. If you don't remove this error then when you integrate the accel outputs you'll be feeding false data into your delta position estimations. Knowing vehicle attitude, perhaps via integrating gyro outputs, allows you to calculate how much gravity is being sensed by each accel and compensate accordingly. This can all be done via a KF if you want. But by now I'm babbling so I'll shut up and let you do the reading.

mikel
Oct 29, 2006, 03:57 AM
Thanks guys!
I've done some reading and the whole thing is much clearer to me now than it was 3 days ago. Now I understand what you're saying about coupling between accelerometers and gyros (gravity vector for example), different ways of fusing the data from sensors and different sets of equations for each particular system. The last time I had to deal with linear algebra and probability theory was more than 5 years ago and it took some time to refresh my memory.
Thanks for the links. I've found and read (or skimmed through) about 30-40 articles related to INS. Unfortunately, most of them are not step by step explanations but rather deal with particular aspects of INS/filtering. Here's what I like:

Master's thesis "Development of a INS/GPS navigation loop for an UAV" has good explanations of coordinate frames & transformations between them, different attitude
representations & transformations. Of course, the rest of it is also useful.
http://epubl.ltu.se/1402-1617/2000/081/LTU-EX-00081-SE.pdf

G. Welch has written great articles on Kalman filtering
Intro
http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf
Coursepack
http://www.cs.unc.edu/~tracker/media/pdf/SIGGRAPH2001_CoursePack_08.pdf
Doctoral dissertation
http://www.cs.unc.edu/~welch/media/pdf/scaat_dissertation.pdf

After reading about various ways of IMU/GPS integration and filtering, I like the one described by D. Kingston in "Real-Time Attitude and Position Estimation for Small UAVs Using Low Cost Sensors"
http://www.et.byu.edu/~dbk4/papers/KingstonBeard04_full.pdf
They used 3 accelerometers, 3 gyros IMU, gps and cascaded filter approach - estimate only attitude (with EKF) at first and then use it for position estimation. The filter is not optimal, but seems to be good enough. The attractive part is that it doesn't require a 200MHz ARM with coprocessor. They have tested the algorithm with 30Hz update rate on a 15MHz 8-bit microcontroller.
The article is a step by step description of their method and it was relatively easy to understand. However, they don't tell how to find noise covariance matrices R and Q. Even though a section in G. Welch's dissertation describes how to calculate R and Q in general, I can't do it myself at this moment :(

Does anybody know an article that has a complete description of an INS system suitable for Matlab simulation ? :) It doesn't have to use Kalman filtering. A complementary filter or something similar would be good enough for now.

Right now I'm reading "Integration of Inertial Navigation System and Global Positioning System Using Kalman Filtering" by Vikas Kumar.
The state vector in their Kalman filter is a set of errors - position, attitude and velocity errors. I don't like that approach because it's harder for me to understand, but their Q and R matrices seem to be easier to calculate. They are basically diagonal matrices with values of standard sensors' deviations. I'm still reading...

Unterhausen
Oct 29, 2006, 02:36 PM
If you have a full version of Matlab, you might want to check out the KF toolbox. Just getting something to work is often a large step in understanding.

Again, I doubt you're going to find anything simple in an article. Books are better for that.

mikel
Oct 31, 2006, 03:57 AM
I have access to Matlab + KF toolbox, but I wanted to write the code myself. I was looking for a complete description of an INS based on 6DOF IMU and GPS. Some of the articles I've read had good descriptions, but they don't tell you how to calculate noise covariance matrices. After reading some more and talking to a professor at school, I got the idea that none of Kalman filtering books/articles talk much about that stuff :(
I gave up. Anyway, it's too much for an undergraduate project... considering I have about half a year left. RC car + gps + 1 gyro + some simple filter/estimator should be gould enough for a final project.