Update velocity in a Kalman filter

control theorydynamical systemskalman filteroptimization

I am learning about the Kalman filter, and having difficulty understand how to construct a Kalman filter when velocities are introduced. Let's say we are tracking the (x-position, y-position) of an object, and we have a sensor which estimates this position. One way to construct the Kalman filter is to exclude any velocity, such that the prior prediction of the next position is just the old position.

But a better way would be to include the object's velocity. The state vector would then include the x-velocity and y-velocity, i.e. state = (x-position, y-position, x-velocity, y-velocity). The value of x at the next timestep would then be x + dt * x-velocity, and similarly for y.

My question is: how do we update x-velocity and y-velocity? Whilst we have a sensor which estimates positions, we don't have a sensor which estimates velocities. Therefore, we cannot update the velocities using the observation model. We could then assume that the velocity doesn't change, but this is very limiting in my application, as I know that the velocity does change significantly.

One idea I had was to emulate an observation model, by saying that the measured velocity is the difference between the current position and the previous position. Then, I could use an observation model in the same way as with the position measurement. However, this feels like a bit of a hack, since this is not a sensor in the true sense; I am just emulating a sensor using old data. And it seems like this could be incorporated in a more direct way, than by "pretending" I have some sensor which gave me this data.

Can somebody please help me understand this?? Thanks!

Best Answer

The idea in a Kalman filter is that you typically don't measure all the states, so it is a bit unclear what reference you are using where this setup wouldn't be answered already in the definition of the filter and the basic equations.

Write your dynamics as $x_{k+1} = Fx_{k} + Gw_k$ (where $x_k$ denotes your 4 states and $w_k$ is assumed process noise). The measurement model is $y_k = Cx_k + \eta_k$ where $C$ thus only would have two rows in your case. At this point, you just apply standard theory to derive the Kalman gain (i.e. solve the Riccati equation)

Edit: Perhaps I missed the core part of the question: How you define the dynamic model of the state is up to you. Typical approach is to say that the acceleration is random, i.e. $x_{k+1} = x_{k} + w_k$ for the velocity states.