Povl,

The idea of a Kalman filter is to fuse several sources of information. If there is only one source, as in your case, then the filter won't be of any help. You might be able to use the tacho's of the motors as an extra source, or a compass. But even then you would need to know the variance (statistical description) of the noise of all sources of information. I think you probably don't know and have to assume it is constant and guess a value. Under these circumstances the filter can be greatly simplified. You'll then end up with a filter that goes like this:

- calculate new heading from old heading and gyro reading.

- calculate new heading from old heading and tacho reading, or get new heading from a compass.

- make a weighted average of the two. The weight should reflect how much you trust the two sources of information.

The difference between the above filter and a real Kalman filter is that in a Kalman filter the weight is based on solid statistics and can vary over time. I hope this demystifies the filter a bit.

On my blog you can read of the proces I went through to understand the filter.

There are other ways to improve gyro output. Some of them also described on my blog as well. The gyrosensor class implements some of these ways.

Oh, my blog is

here.