FixTheRobot Explore Robotics / Systems Engineering / Tools

D · Interactive tool · Module 11

EKF Tuning Playground

A position-and-velocity Kalman filter tracking a robot with noisy position measurements. Make the filter’s noise settings wrong on purpose and watch the estimate, the ±2σ band and the consistency statistics.

Preliminary engineering guidance. Results depend on the assumptions listed below and on simplified models. Verify with manufacturer datasheets and a test on your own hardware before committing to a design.

The real system

What the filter believes

Measurements

Result

Assumptions and limitations

  • Model: state [position, velocity], constant-velocity motion driven by white random acceleration; Q = σa²·[[Δt⁴/4, Δt³/2],[Δt³/2, Δt²]] with Δt = 0.1 s. Measurement: position plus Gaussian noise. The filter is linear and the model matches the simulator, so a correctly tuned filter is optimal; a real robot never matches its model this well.
  • An EKF differs from this filter only by linearising a nonlinear model around the current estimate. Tuning logic (Q, R, consistency, delay, gating) carries over; nonlinear effects such as linearisation error do not appear here.
  • NEES (normalised estimation error squared) averages about the number of states (2) for a consistent filter; much larger means overconfident, much smaller means conservative. NIS does the same for the innovation (1 for a scalar measurement). Both need the truth or a model, so on a real robot only NIS is available; this tool shows both.
  • Delay: a measurement taken at step j arrives at j + delay. “Naive” applies it to the current state as if it were current. “Replay” rolls back to j, applies it and re-predicts to now, as a delayed-measurement filter does. Out-of-order arrival is not modelled.
  • Outliers are measurements displaced by ±20 σ with the given probability. The gate rejects a measurement whose innovation exceeds the chosen number of σ of the innovation covariance.
  • Metrics skip the first 5 s so the start-up transient does not dominate. Results depend on the random seed; change it to see the spread.
  • Several covariance structures real systems use (cross-correlated sensors, bias states, non-white noise) are not covered. For robot_localization specifics see Module 11.

References

  • Bar-Shalom, Li and Kirubarajan, Estimation with Applications to Tracking and Navigation (Wiley, 2001): NEES/NIS consistency tests. Textbook reference, not re-checked online in this build.