What it is
The Kalman Filter (1960, Rudolf Kálmán) is a recursive optimal-estimation algorithm for linear dynamic systems affected by Gaussian noise. At each time step it fuses the prediction of the system's physical model with the noisy sensor measurement, weighting both in inverse proportion to their uncertainty.
The Extended Kalman Filter (EKF) generalises the algorithm to the non-linear domain: instead of propagating the Gaussian distribution exactly (impossible in non-linear systems), it linearises the model at each operating point using the Jacobian. This makes it suitable for real physical systems such as bearing degradation or door-mechanism wear, where the dynamics are not strictly linear.
How it works in IN-SIGHT
IN-SIGHT's EKF implements a two-phase estimation loop that runs on the CM4 at 200 Hz:
- Initialisation from Golden Run: The initial state x₀ and the initial uncertainty covariance P₀ are loaded from the vehicle's Golden Run baseline. This calibrates the filter for that specific vehicle at that point in its life cycle.
- Predict: The transition model f(x) predicts the state at the next instant using the system physics (bearing dynamics, wear model). The Jacobian Fₖ is computed analytically around the current state.
- Update: When a new measurement arrives from the MEMS sensor, the filter computes the innovation ỹ = z − h(x̂), the difference between measured and predicted.
- Kalman gain: The gain K weights how much to "trust" the innovation vs. the model. If the sensor is very noisy, K is small (more trust in the model). If the model is imprecise, K is large (more trust in the sensor).
- Anomaly detection: The normalised innovation is compared against a statistical threshold (χ² test with p = 0.01). If the innovation exceeds the threshold, the system logs an anomaly and classifies its severity by magnitude.
Key advantage: The EKF does not detect fixed thresholds (e.g. "vibration > 5 g"). It detects deviations from the expected behaviour for that specific vehicle at that point in its service life. This eliminates false positives due to vehicle-to-vehicle variability and makes it possible to detect incipient degradation months before failure.
Core equations
── PREDICTION PHASE ──────────────────────────────
x̂ₖ⁻ = f(x̂ₖ₋₁, uₖ) ← transition model
Pₖ⁻ = Fₖ · Pₖ₋₁ · Fₖᵀ + Q ← uncertainty propagation
── UPDATE PHASE ──────────────────────────────────
ỹₖ = zₖ − h(x̂ₖ⁻) ← innovation
Sₖ = Hₖ · Pₖ⁻ · Hₖᵀ + R ← innovation covariance
Kₖ = Pₖ⁻ · Hₖᵀ · Sₖ⁻¹ ← Kalman gain
x̂ₖ = x̂ₖ⁻ + Kₖ · ỹₖ ← updated state
Pₖ = (I − Kₖ · Hₖ) · Pₖ⁻ ← updated covariance
── ANOMALY DETECTION ─────────────────────────────
ε² = ỹₖᵀ · Sₖ⁻¹ · ỹₖ ← Mahalanobis distance
If ε² > χ²(dof, p=0.01) → ALERT