3
$\begingroup$

In trying to implement an Unscented Kalman Filter (UKF), I have come across the issue of what to do when my measurement signals come in at a different rate than my control inputs, which I use in the prediction step of the UKF. In my implementation, I've tried working around this issue by forming a prediction each time I receive a new measurement, but I've been told that it's also possible and perhaps favorable to only form a prediction when I get a new control input and form a new measurement update when I get a new measurement.

The "standard" Kalman filter algorithm in most textbooks/papers that I've seen do not delve deeply into this issue of different data rates, and they usually just show a simple predict-update loop that occurs at each time step.

I see how it is possible to form multiple consecutive predictions. However, I don't fully understand how one could do an update without a prediction right before it at the same time step, since the computation of the Kalman gain relies on the sigma points passed through the state transition function. Any help would be greatly appreciated!

For reference, I am trying to implement my UKF using the FilterPy Python library: https://filterpy.readthedocs.io/en/latest/_modules/filterpy/kalman/UKF.html#UnscentedKalmanFilter

$\endgroup$
  • $\begingroup$ Your question isn't clear. Could you show your model equations and we'll solve it together? $\endgroup$ – Royi Jul 13 '18 at 22:16
  • $\begingroup$ @Royi, my model equation f(x, u, dt) for the state transition involves integrating velocities to yield change in position, and integrating acceleration control inputs u to yield change in velocity. Therefore, this equation has numerous dt terms. My measurement function h(x) does not have any dt terms. Does this help? $\endgroup$ – theo1010 Jul 16 '18 at 13:46
  • $\begingroup$ Kalman Filter doesn't have to be implemented with fixed step size (What you call dt). I think if you give us the model, and a set of measurements, we'll be able to assist you. $\endgroup$ – Royi Apr 3 at 22:32
2
$\begingroup$

I will use Wikipedia notations - Kalman Filter.

In most models the state transition model matrix $ F $ depends on the interval parameter $ T $. The same goes for the Process Noise Covarinace Matrix $ Q $. For instance, for the constant velocity model:

$$ F = \begin{bmatrix} 1 & T \\ 0 & 1 \end{bmatrix}, \; Q = \begin{bmatrix} \frac{ {T}^4 }{4} & \frac{ {T}^3 }{2} \\ \frac{ {T}^3 }{2} & {T}^{2} \end{bmatrix} $$

Now, one simple policy you act by, whihc works perfectly in real life and is highly flexible, is as following:

  1. Always remember the time stamp of the last Kalman step, be it prediction or update.
  2. Given new input which is not a measurement do as following:
    • Take the input time stamp.
    • Define $ T = {t}_{current} - {t}_{last} $.
    • Build $ F $, $ Q $ and all other model matrices based on the given $ T $.
    • Apply prediction step.
    • Update the time stamp of the last Kalman step to $ {t}_{current} $.
  3. Given new input which is a measurement do as following:
    • Take the input time stamp.
    • Define $ T = {t}_{current} - {t}_{last} $.
    • Build $ F $, $ Q $ and all other model matrices based on the given $ T $.
    • Apply prediction step.
    • Apply update step.
    • Update the time stamp of the last Kalman step to $ {t}_{current} $.

This works and it is very robust. Yet it has the overhead that you need to generate the correct matrices each step.

Also, since the UKF (Unscented Kalman filter) is different only in its Update step, it holds for it as well (For EKF as well).

| improve this answer | |
$\endgroup$
1
$\begingroup$

The most typical linear KF operates on a continuous time constant matrix differential state variable equation that is put into a state transition form, i.e. the integration is solved between 2 points in time. If you use uniform equally spaced time intervals, the matrices in the state transition form are constant. The continuous time state variables aren’t constrained to be evaluated at regular times. If you do the integrations for the 2 time points the state transition equations are valid, you just need to do the integration for those 2 points. For time pairs that aren’t uniform, a new integration will typically be required at each time update. The equations can be deduced for the linear KF but a UKF is a way to do an EKF, so your state variable description is more approximate so smaller time steps are likely to have better fidelity.

This is a bit more involved than what a filter package can do.

If you can tolerate some delay and your controls are smooth, you can try interpolation to synchronize your inputs and just use a standard filter package. You might assume that your controls are zero order hold.

There are papers on “network KF” that deal with these synchronization problems including late and out of order inputs. those might be helpful.

If you need the best possible filter, you will most likely need to derive and implement a custom solution

| improve this answer | |
$\endgroup$
  • $\begingroup$ I understand how to handle the issue of irregular time steps for the integration in the state transition, and the filter package I'm using allows for such modification. However, filter package aside, I am curious about whether or not a KF can even work if you don't synchronize your prediction steps with your update steps. You suggest interpolating the control inputs so that the prediction steps are synchronized with the updates. Do you know of any other valid ways to do this? Thanks. $\endgroup$ – theo1010 Jul 13 '18 at 17:58
  • $\begingroup$ I suggested looking at the network kalman filter literature. as well. There is also the iterated EKF where you can use more than one iteration per update. $\endgroup$ – user28715 Jul 13 '18 at 18:44
1
$\begingroup$

@Royi's and user28715's answers are correct. So just add this answer to theirs.

If you let the system's output matrix $H$ go to zero, then two things happen. First, you are modeling a time increment where you know nothing about what actually happened. Second, the Kalman gain ($K$ in most representations of the Kalman filter) goes to zero, and the entire correction step does nothing. So you can safely leave out the correction step when you have no measurements.

This leads you to @Royi's solution along a path that's paved with fairly rigorous mathematical steps, and which can be made as rigorous as you please with a bit of work.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Why not +1 the answers you used and even better, use edit to improve them? $\endgroup$ – Royi Aug 3 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.