RBBM
Phidgetly
Posts: 19
Joined: Mon Nov 23, 2009 6:03 am
Contact:

Dear Moises,

concerning the covariance matrix: In my case the matrix Q is diagonal as the noise on the roll/pitch angle and the gyro data is independent from each other. The observation noise of our roll/pitch angles is also assumed to be linear with the integration time. So the overall parameters for the Kalman filter reduce to 3 values. We simply performed an educated guess to find starting values for the Kalman and applied these. Then we iteratively found values for a good filter performance by playing around.
In case you want to measure the errors you can mount the IMU onto some sort of testbench. Then you can apply known positions and record the measured values. Afterwards you can fit a gaussian function and gain the error width which you need for the matrices. This is very simple for the acc values but the gyros are much harder to measure.
This also leads to your last question. We calculate the roll/pitch angles from the three acc values and correct them with the according gyro data. this means we have one Kalman for roll and pitch. You can also add another for yaw, but we do not need this information for our current project.

Greetings,

Michael

moisdc
Phidgetsian
Posts: 13
Joined: Wed Oct 07, 2009 6:21 am
Contact:

Dear Michael and colleagues,

Today, we have made some experiments. Currently, I am rebuilding reference signal (position/time) of our mobile robot.
I have 9 data, according to Spatial device. I have some question from your email:

1. Noise of our roll/pitch/yaw angles = 4º drift/minute/signal. Is this correct? So that, Q matrix is [[4 0 0][0 4 0][0 0 4]], isn't it?

2. What are the 3 overall values for the Kalman filter?

3. You are right: We have mounted the IMU onto some sort of testbench and we have a reference signal and 9 data (3/3/3) recorded. Gyros data weren't measured, just position/time. Michael, to be honest, I don't understand how to do this KF yet. Could you give me some idea?

Thank you for your generosity. Greetings:
- Moisés

RBBM
Phidgetly
Posts: 19
Joined: Mon Nov 23, 2009 6:03 am
Contact:

Dear Moises,
For me it seems that you are using one Kalman for all axes. We use one Kalman for each axis. As an example, we measure the roll angle via the acc data. So we get an angle that can also be measured by integrating the roll rate over the measuring time. Now you can apply the predict and update formulas from the Wikipedia link I gave you. This leads to a two-dimensional problem with a 2x2 Q matrix. This matrix is diagonal and keeps the estimated acc and gyro noise. The measure R is a measure for the roll error from the calculation and thus our third variable we have to find.
To get a grip on the subject you could search Tom Pycke's Website for his Kalman tester source ode.

Greetings
Michael

moisdc
Phidgetsian
Posts: 13
Joined: Wed Oct 07, 2009 6:21 am
Contact:

Ok Michael,
KF is clearer now, thanks for your explanation.
I'll tell you what I'm getting with Spatial 3/3/3
- Moisés Díaz Cabrera

danielaaroe
Phidgetsian
Posts: 9
Joined: Mon May 03, 2010 1:30 pm
Contact:

Michael: Sorry if the code did not work. As I earlier wore, it was written to the arduino and for that purpose it works great. I might have altered the code afterwards, but I dont think so.
If you managed to get a KF working on the phidget, cant you post the code for it ?

Another question before i start recoding it for java; did you use the matrices and some sort of function to multiply them in the program, or do you multiply the matrices manually and code the finished equations ?

Moisès: Its quite difficult to get a hold of how the KF works, but reading around on Tom Pyckes blog and trying to find the proper matrix dimensions and code it really helps with the understanding. I'm not sure how experienced you are with matrix multiplications, but if you think its hard to wrap your head around what gets multiplied with what, I really reccomend you to try and multiply the matrices in www.wolframalpha.com. There, it is very easy to see what gets multiplied with what(if you dont want to do it manually of course), but the biggest advantage is that it can multiply algebraic matrices, so you dont have to use actual numbers(you can use Q1, q2, q3 aso. for the covariance). There are probaly multiple programs that can do this, but this is easy accessible and easy to use.

Michael(again): it would be nice to see your progress in the shape of a new video

Best regards,

Daniel

RBBM
Phidgetly
Posts: 19
Joined: Mon Nov 23, 2009 6:03 am
Contact:

Hi all,

As I told you I fiddled around with Tom Pyckes demonstrator code and transferred it to Java after trying to understand it. Then I wrote a little test programme to compare the outcomes with or without the filter.

The filter itself is an explicit implementation of the matrices given in the Wikipedia article. I do not use any functions or methods as everything is calculated manually and so we use the final results. They reduce to a few dedicated equations as the Observation matrix only contains one non-null element. The best would be to extract the code yourselves as I do not want to copy Mr Pyckes work.

Maybe we will release a small video to demonstrate the outcome soon.

Greetings

Michael

moisdc
Phidgetsian
Posts: 13
Joined: Wed Oct 07, 2009 6:21 am
Contact:

Hi colleagues,

Currently I have stopped to work with Kalman Filter. I have saturated and I decided to work with them later. However I am keen on understanding how to use KF with our Spatial 3/3/3 some day.

Thank you very much to everybody has helped me by this forum.

Best regards
- Moises

RBBM
Phidgetly
Posts: 19
Joined: Mon Nov 23, 2009 6:03 am
Contact:

Hi,

just to inform you, there is a small side project at www.robobuam.de called "Hugo". It is basically a new vehicle based upon the Raspberry Pi. It can be steered via a Desktop application as well as a html5 Webapp.

Greetings

Michael

danielaaroe
Phidgetsian
Posts: 9
Joined: Mon May 03, 2010 1:30 pm
Contact:

Hi guys,

Since the kalman filter have been widely discussed in this thread, I want to share something i found today. Many people seems to be using the kalman filter to use intertial measurements for apps(in android and whatnot) so the infomation on the subject online have exploded.
Here is a open source kalman filter implemented in java. I have not yet had a thurough look at it, but anyways, a search for android kalman filter sure gives a loot of hits on google.

http://sourceforge.net/projects/jkalman/