From: Positron on
Hello again!

I see now that I had a flawed view of how the Kalman Filter works! I never
really understood how in the context of my problem the filter would
magically produce perfect results. The need for multiple redundant inputs
makes sense.

Michael suggested a GPS input. I've been reading a bit about that, and that
sounds like a nice idea for an additional input. Since this is purely a
Matlab simulation, I could just have a position vector update from the GPS
every second. I could also add some random noise to it in the form of
randn. GPS inputs would be a position measurement every second, which
would provide a periodic update into the Kalman filter. My H matrix would
then be H = [1;0]. I'll have to figure out how to also incorporate the
acceleration data, but I'll think about that one for a bit first. This GPS
idea follows with what Tim suggested of doing a position measurement every
second or so. I'll give a shot at trying to incorporate a GPS readout every
second or so in addition to my noisy acceleration readings.

So, my reformulated problem would be: Design a Kalman filter for a car that
has a driver that does whatever he or she wants, an accelerometer to
measure the acceleration of the car (say every .01 seconds or so) and a
position update every second.

Thanks to both of you for clearing up my fundamental misunderstanding of
the filter and for the suggestions so far. I'll battle it out in Matlab and
see if I have any luck.
From: Tim Wescott on
Positron wrote:
> Hello again!
>
> I see now that I had a flawed view of how the Kalman Filter works! I never
> really understood how in the context of my problem the filter would
> magically produce perfect results. The need for multiple redundant inputs
> makes sense.
>
> Michael suggested a GPS input. I've been reading a bit about that, and that
> sounds like a nice idea for an additional input. Since this is purely a
> Matlab simulation, I could just have a position vector update from the GPS
> every second. I could also add some random noise to it in the form of
> randn. GPS inputs would be a position measurement every second, which
> would provide a periodic update into the Kalman filter. My H matrix would
> then be H = [1;0]. I'll have to figure out how to also incorporate the
> acceleration data, but I'll think about that one for a bit first. This GPS
> idea follows with what Tim suggested of doing a position measurement every
> second or so. I'll give a shot at trying to incorporate a GPS readout every
> second or so in addition to my noisy acceleration readings.
>
> So, my reformulated problem would be: Design a Kalman filter for a car that
> has a driver that does whatever he or she wants, an accelerometer to
> measure the acceleration of the car (say every .01 seconds or so) and a
> position update every second.
>
> Thanks to both of you for clearing up my fundamental misunderstanding of
> the filter and for the suggestions so far. I'll battle it out in Matlab and
> see if I have any luck.

I had GPS in mind when I gave my example. Basically in this case you
update the a-priori state and covariance with every accelerometer
sample. The a-posteriori state and covariance updates do nothing when
the Kalman gain is zero, and the Kalman gain is zero for H = 0. So you
just don't bother to do these except when you have GPS updates.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com