Reply by Tim Wescott August 29, 20082008-08-29
On Tue, 26 Aug 2008 23:23:00 -0700, falderals wrote:

> On Aug 27, 5:12 am, Tim Wescott <t...@seemywebsite.com> wrote: >> Kai wrote: >> > Hi, >> >> > I'm trying to work with Kalman Filter for Sensor Fusion/state >> > estimation purposes. >> >> > A very basic question first: >> >> > I model my system with a continuos time state space model. I'm using >> > a high sample rate (3000 Hz). Do I have to transform my state space >> > model into time-discrete domain anyways? What would happen if not, >> > what special properties may occur when I'm using a continous time >> > model? >> >> That depends. Are you going to build a continuous-time Kalman filter, >> complete with precision integrators and analog multipliers? If not, >> then before you can construct your Kalman filter in discrete time you >> need a discrete-time model of your process. >> >> Because (and pay attention, this is important) a Kalman filter is a >> _specific_ filter to go with a _specific_ system and a _specific_ set >> of measurement noise variances. The "Kalman-ness" of it doesn't come >> from the fact that it's a state estimator (there are other flavors of >> those), the "Kalman-ness" comes from the fact that it is the only >> estimator that is both linear and optimal in the least-squares error >> sense -- and that optimality is tightly coupled to the plant and noise >> characteristics. >> >> >> >> > Another question is: >> >> > let's assume I have one sensor, measuring the position of any object. >> > I tried the following: I differentiated the sensor signal to get a >> > (noisy) value for the velocity of the object. After this I calculated >> > the stationary variances of both signals and put them both as >> > measured values in a Kalman Filter like this: >> >> > x(k+1) = [1 T;0 1]*x(k) + w; >> > y(k) = [1 0;0 1]*x(k) + v; >> >> > where x = [position; velocity] >> >> > The idea was to fusion measured and differentiated data to get better >> > (optimal) filtered values for the states x and v. >> >> > Is there theoretically a benefit from this? Or am I doing non-sense? >> >> > TIA, >> > Kai >> >> If you had a separate velocity sensor there would be benefit, but >> you're not adding any information with a differentiated version of your >> position. I'm not going to try to argue "sensible", but one >> mathematically "correct" way to deal with your chosen input is to model >> the two sensor channels correctly (i.e. augment your system to three >> states to account for the differentiator, with the appropriate noise >> variance on the differentiator channel). You should find that your >> augmented Kalman filter will effectively ignore the differentiator as >> it is adding no new information. >> >> For example, let's say that I want to build an "optimal" velocity >> estimator for a control line stunt model airplane, to regulate >> airspeed. >> I can build a pitot-static tube assembly that measures the airspeed >> with some lag, but I want something that'll keep the airspeed constant >> through some pretty abrupt* maneuvers. Just putting a differentiator >> on the airspeed measurement may decrease my error, but if it did then >> that's exactly what a Kalman filter will do. Because the Kalman is, by >> definition, optimal, I won't get a better answer with any linear >> processing than I will with a Kalman. > > Actually you may get a better estimate with an H infinity State > Estimator. > > F.
Very possibly: the Kalman filter is very sensitive to the match between the noise model used to generate it and the actual behavior of the noise. But I was trying to stick to the question... --- Tim Wescott http://www.wescottdesign.com/ Control and communication system consulting.
Reply by August 27, 20082008-08-27
On Aug 27, 5:12 am, Tim Wescott <t...@seemywebsite.com> wrote:
> Kai wrote: > > Hi, > > > I'm trying to work with Kalman Filter for Sensor Fusion/state estimation > > purposes. > > > A very basic question first: > > > I model my system with a continuos time state space model. I'm using a high > > sample rate (3000 Hz). Do I have to transform my state space model into > > time-discrete domain anyways? What would happen if not, what special > > properties may occur when I'm using a continous time model? > > That depends. Are you going to build a continuous-time Kalman filter, > complete with precision integrators and analog multipliers? If not, > then before you can construct your Kalman filter in discrete time you > need a discrete-time model of your process. > > Because (and pay attention, this is important) a Kalman filter is a > _specific_ filter to go with a _specific_ system and a _specific_ set of > measurement noise variances. The "Kalman-ness" of it doesn't come from > the fact that it's a state estimator (there are other flavors of those), > the "Kalman-ness" comes from the fact that it is the only estimator that > is both linear and optimal in the least-squares error sense -- and that > optimality is tightly coupled to the plant and noise characteristics. > > > > > Another question is: > > > let's assume I have one sensor, measuring the position of any object. I > > tried the following: I differentiated the sensor signal to get a (noisy) > > value for the velocity of the object. After this I calculated the > > stationary variances of both signals and put them both as measured values > > in a Kalman Filter like this: > > > x(k+1) = [1 T;0 1]*x(k) + w; > > y(k) = [1 0;0 1]*x(k) + v; > > > where x = [position; velocity] > > > The idea was to fusion measured and differentiated data to get better > > (optimal) filtered values for the states x and v. > > > Is there theoretically a benefit from this? Or am I doing non-sense? > > > TIA, > > Kai > > If you had a separate velocity sensor there would be benefit, but you're > not adding any information with a differentiated version of your > position. I'm not going to try to argue "sensible", but one > mathematically "correct" way to deal with your chosen input is to model > the two sensor channels correctly (i.e. augment your system to three > states to account for the differentiator, with the appropriate noise > variance on the differentiator channel). You should find that your > augmented Kalman filter will effectively ignore the differentiator as it > is adding no new information. > > For example, let's say that I want to build an "optimal" velocity > estimator for a control line stunt model airplane, to regulate airspeed. > I can build a pitot-static tube assembly that measures the airspeed > with some lag, but I want something that'll keep the airspeed constant > through some pretty abrupt* maneuvers. Just putting a differentiator on > the airspeed measurement may decrease my error, but if it did then > that's exactly what a Kalman filter will do. Because the Kalman is, by > definition, optimal, I won't get a better answer with any linear > processing than I will with a Kalman.
Actually you may get a better estimate with an H infinity State Estimator. F.
Reply by Kai August 26, 20082008-08-26
Tim Wescott wrote:

> Kai wrote: >> Hi, >> >> I'm trying to work with Kalman Filter for Sensor Fusion/state estimation >> purposes. >> >> A very basic question first: >> >> I model my system with a continuos time state space model. I'm using a >> high sample rate (3000 Hz). Do I have to transform my state space model >> into time-discrete domain anyways? What would happen if not, what special >> properties may occur when I'm using a continous time model? > > That depends. Are you going to build a continuous-time Kalman filter, > complete with precision integrators and analog multipliers? If not, > then before you can construct your Kalman filter in discrete time you > need a discrete-time model of your process. > > Because (and pay attention, this is important) a Kalman filter is a > _specific_ filter to go with a _specific_ system and a _specific_ set of > measurement noise variances. The "Kalman-ness" of it doesn't come from > the fact that it's a state estimator (there are other flavors of those), > the "Kalman-ness" comes from the fact that it is the only estimator that > is both linear and optimal in the least-squares error sense -- and that > optimality is tightly coupled to the plant and noise characteristics. > >> Another question is: >> >> let's assume I have one sensor, measuring the position of any object. I >> tried the following: I differentiated the sensor signal to get a (noisy) >> value for the velocity of the object. After this I calculated the >> stationary variances of both signals and put them both as measured values >> in a Kalman Filter like this: >> >> x(k+1) = [1 T;0 1]*x(k) + w; >> y(k) = [1 0;0 1]*x(k) + v; >> >> where x = [position; velocity] >> >> The idea was to fusion measured and differentiated data to get better >> (optimal) filtered values for the states x and v. >> >> Is there theoretically a benefit from this? Or am I doing non-sense? >> >> TIA, >> Kai > > If you had a separate velocity sensor there would be benefit, but you're > not adding any information with a differentiated version of your > position. I'm not going to try to argue "sensible", but one > mathematically "correct" way to deal with your chosen input is to model > the two sensor channels correctly (i.e. augment your system to three > states to account for the differentiator, with the appropriate noise > variance on the differentiator channel). You should find that your > augmented Kalman filter will effectively ignore the differentiator as it > is adding no new information. > > For example, let's say that I want to build an "optimal" velocity > estimator for a control line stunt model airplane, to regulate airspeed. > I can build a pitot-static tube assembly that measures the airspeed > with some lag, but I want something that'll keep the airspeed constant > through some pretty abrupt* maneuvers. Just putting a differentiator on > the airspeed measurement may decrease my error, but if it did then > that's exactly what a Kalman filter will do. Because the Kalman is, by > definition, optimal, I won't get a better answer with any linear > processing than I will with a Kalman. > > So let's say I put a cheap gyro and accelerometer on it, to measure > rotation and tilt in pitch. Now I can put the pitch information (which > helps to predict trends in airspeed) together with my direct airspeed > measurement (which gets inaccurate when the airspeed is trending). > Figuring out how to put this all together is where the Kalman framework > helps out. > > (and yes, somewhere in there I should be measuring the engine speed as > well) > > * or if you like stunt, pretty _and_ abrupt. >
thanks a lot for your answer! it's such a pleasure having you in the newsgroups around, your contributions are always quite valuable. thanks again.
Reply by Tim Wescott August 26, 20082008-08-26
Kai wrote:
> Hi, > > I'm trying to work with Kalman Filter for Sensor Fusion/state estimation > purposes. > > A very basic question first: > > I model my system with a continuos time state space model. I'm using a high > sample rate (3000 Hz). Do I have to transform my state space model into > time-discrete domain anyways? What would happen if not, what special > properties may occur when I'm using a continous time model?
That depends. Are you going to build a continuous-time Kalman filter, complete with precision integrators and analog multipliers? If not, then before you can construct your Kalman filter in discrete time you need a discrete-time model of your process. Because (and pay attention, this is important) a Kalman filter is a _specific_ filter to go with a _specific_ system and a _specific_ set of measurement noise variances. The "Kalman-ness" of it doesn't come from the fact that it's a state estimator (there are other flavors of those), the "Kalman-ness" comes from the fact that it is the only estimator that is both linear and optimal in the least-squares error sense -- and that optimality is tightly coupled to the plant and noise characteristics.
> Another question is: > > let's assume I have one sensor, measuring the position of any object. I > tried the following: I differentiated the sensor signal to get a (noisy) > value for the velocity of the object. After this I calculated the > stationary variances of both signals and put them both as measured values > in a Kalman Filter like this: > > x(k+1) = [1 T;0 1]*x(k) + w; > y(k) = [1 0;0 1]*x(k) + v; > > where x = [position; velocity] > > The idea was to fusion measured and differentiated data to get better > (optimal) filtered values for the states x and v. > > Is there theoretically a benefit from this? Or am I doing non-sense? > > TIA, > Kai
If you had a separate velocity sensor there would be benefit, but you're not adding any information with a differentiated version of your position. I'm not going to try to argue "sensible", but one mathematically "correct" way to deal with your chosen input is to model the two sensor channels correctly (i.e. augment your system to three states to account for the differentiator, with the appropriate noise variance on the differentiator channel). You should find that your augmented Kalman filter will effectively ignore the differentiator as it is adding no new information. For example, let's say that I want to build an "optimal" velocity estimator for a control line stunt model airplane, to regulate airspeed. I can build a pitot-static tube assembly that measures the airspeed with some lag, but I want something that'll keep the airspeed constant through some pretty abrupt* maneuvers. Just putting a differentiator on the airspeed measurement may decrease my error, but if it did then that's exactly what a Kalman filter will do. Because the Kalman is, by definition, optimal, I won't get a better answer with any linear processing than I will with a Kalman. So let's say I put a cheap gyro and accelerometer on it, to measure rotation and tilt in pitch. Now I can put the pitch information (which helps to predict trends in airspeed) together with my direct airspeed measurement (which gets inaccurate when the airspeed is trending). Figuring out how to put this all together is where the Kalman framework helps out. (and yes, somewhere in there I should be measuring the engine speed as well) * or if you like stunt, pretty _and_ abrupt. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by Kai August 26, 20082008-08-26
Hi,

I'm trying to work with Kalman Filter for Sensor Fusion/state estimation
purposes.

A very basic question first:

I model my system with a continuos time state space model. I'm using a high
sample rate (3000 Hz). Do I have to transform my state space model into
time-discrete domain anyways? What would happen if not, what special
properties may occur when I'm using a continous time model?


Another question is:

let's assume I have one sensor, measuring the position of any object. I
tried the following: I differentiated the sensor signal to get a (noisy)
value for the velocity of the object. After this I calculated the
stationary variances of both signals and put them both as measured values
in a Kalman Filter like this:

x(k+1) = [1 T;0 1]*x(k) + w;
y(k) = [1 0;0 1]*x(k) + v;

where x = [position; velocity]

The idea was to fusion measured and differentiated data to get better
(optimal) filtered values for the states x and v.

Is there theoretically a benefit from this? Or am I doing non-sense?

TIA,
Kai