Case study
Sensor Timestamp Misalignment State Estimation Case Study
Case study on delayed sensor timestamps in state estimation, position error, Kalman innovation gating, NIS correction and validation evidence.
State estimation can fail even when every sensor is individually accurate. If the measurement timestamp is wrong, stale data can be fused as if it described the current state. The estimator then sees a physically plausible measurement at the wrong time and may reject good data, estimate the wrong state or report misleading confidence.
This case study follows a mobile inspection platform that fuses wheel odometry, an IMU and a position sensor. The position sensor has low random noise, but its timestamp is delayed by a communication and processing pipeline. The filter treats the measurement as current. The result is a large innovation, false fault suspicion and a position estimate that looks smooth but is time-shifted.
The engineering task is to quantify the error caused by timestamp misalignment, show why the Kalman gate rejects the measurement, correct the time basis and define validation evidence before release.
Case Context
A mobile platform moves along a straight inspection path during a commissioning run. It estimates position using:
- wheel odometry at 100\ \text{Hz};
- IMU acceleration and yaw-rate data at 200\ \text{Hz};
- an external position sensor at 10\ \text{Hz};
- a Kalman filter running at 100\ \text{Hz};
- a safety monitor that triggers if the fused position deviates from the allowed path.
The position sensor is accurate in static tests. During motion, its updates frequently fail the innovation gate. The software team initially suspects sensor noise. Log review shows that the sensor timestamp is applied at receive time instead of exposure time.
Failure Signature and Triage
The failure signature is motion-dependent innovation growth. Static tests pass, slow motion is tolerable, and faster motion creates residuals that point in the direction of travel. That pattern is different from random sensor noise, which should not systematically scale with platform speed and latency.
Useful triage checks are:
- plot innovation versus platform speed;
- compare acquisition timestamp, receive timestamp and estimator update timestamp;
- replay the same log with a time shift applied to the measurement;
- check whether rejected measurements become consistent when compared with a delayed state;
- inspect queueing, buffering and scheduler timing around the sensor driver.
The key diagnostic question is not whether the sensor is accurate, but whether the estimator associates the sensor value with the state at the correct time.
Event Data
| Quantity | Symbol | Value |
|---|---|---|
| platform speed | v | 4.0\ \text{m/s} |
| timestamp delay | \Delta t | 0.18\ \text{s} |
| measured acceleration during segment | a | 1.2\ \text{m/s^2} |
| position sensor one-sigma noise | \sigma_z | 0.05\ \text{m} |
| predicted position one-sigma uncertainty | \sigma_x | 0.10\ \text{m} |
| one-dimensional 95 percent chi-square gate | \chi^2_{1,0.95} | 3.84 |
| residual after timestamp correction | r_{aligned} | 0.08\ \text{m} |
The delay is not huge in human terms, but it is large compared with the motion of the platform and the claimed measurement precision.
Time-Basis Boundary
A release package should name every clock boundary in the measurement path: sensor exposure, sensor packet timestamp, microcontroller receive time, bus time, estimator update time, logged time and safety-monitor evaluation time. If those clocks are not synchronized or if one stage overwrites acquisition time with receive time, the estimator can fuse physically valid data at the wrong state.
For this case, the critical boundary is between sensor exposure time and receive time. The measurement describes the platform 0.18 s earlier. The filter originally treated it as a current measurement.
Step 1: Estimate Position Error from Delay
If a position measurement is delayed but treated as current, the first-order position mismatch is:
Substitute:
and:
Then:
The acceleration contribution over the delay is:
Engineering Interpretation
The dominant time-alignment error is about 0.72\ \text{m}. That is much larger than the sensor noise. A high-precision sensor becomes misleading when its time basis is wrong.
Step 2: Compare with Measurement Noise
The delay-induced mismatch relative to sensor noise is:
Engineering Interpretation
The measurement is not noisy in the usual random sense. It is accurately reporting an old state. Treating the residual as random sensor noise would lead to the wrong corrective action.
Step 3: Check Innovation Gating
For a scalar position update, the innovation variance is approximated as:
Using:
and:
gives:
The normalized innovation squared is:
If the uncorrected residual is approximately:
then:
Comparison with the 95 percent scalar gate:
The filter rejects the measurement.
Step 4: Correct the Time Basis
The correct remedy is not to increase measurement noise until the gate passes. The estimator should associate each measurement with the time at which the physical event was observed. Common approaches include:
- hardware timestamping at acquisition;
- timestamp propagation through the communication path;
- prediction to the measurement time before computing the residual;
- delayed-state buffer or out-of-sequence measurement update;
- explicit latency compensation in the measurement model.
After correcting the timestamp basis, the observed residual is:
The aligned normalized innovation squared becomes:
This passes the same gate:
Engineering Interpretation
The sensor did not need a looser noise model. It needed correct timing. The same measurement changes from “invalid” to “consistent” when compared with the state at the correct time.
Residual Release Margin
The aligned residual can be compared with the 95 percent gate using the same innovation variance. The gate residual is:
With (S=0.0125\ \text{m}^2):
The corrected residual is (0.08\ \text{m}), leaving:
of residual margin. That does not prove every operating case is safe, but it shows the corrected time basis is consistent for this commissioning segment.
Validation Evidence
Release evidence should include sensor acquisition timestamps, receive timestamps, clock synchronization basis, latency histogram, jitter distribution, filter update time, buffer behavior, dropped-sample handling, time-base unit tests, replay of logged data with corrected timestamps and field validation at representative speeds.
The test should include motion, not only static checks. Static calibration can prove sensor scale and offset while hiding a timing fault completely.
Minimum validation package:
- latency histogram over nominal and loaded processor conditions;
- replay test showing innovation statistics before and after timestamp correction;
- speed sweep proving residuals no longer scale with platform velocity;
- out-of-sequence or delayed-update behavior for dropped and late packets;
- clock synchronization or monotonic timestamp evidence across all devices;
- firmware and logging records proving acquisition time is preserved to the estimator.
Release Decision
The original estimator should not be released because the uncorrected timestamp delay produces a (0.72\ \text{m}) residual and (NIS=41.5), far outside the 95 percent gate. Inflating measurement noise to hide that residual would make the filter less honest and would weaken fault detection.
The corrected timing basis can be released only if the validation package proves the same alignment under representative speed, bus load, packet loss and scheduler jitter. The release note should distinguish sensor calibration from time-base validation; both are required for a state-estimation claim.
Common Mistakes
A common mistake is treating timestamp error as extra measurement noise. That can make gates pass, but it hides a deterministic data-association error. Another mistake is logging receive time instead of acquisition time. In distributed or embedded systems, those can differ by communication latency, queueing, buffering and scheduler jitter.
Other mistakes include plotting signals against different clock bases, fusing delayed measurements as current data, ignoring filter delay, omitting timestamp uncertainty from the validation plan and accepting a smooth estimate without checking residual timing. A strong state-estimation review states the measurement time, timestamp source, clock synchronization method, latency budget, jitter distribution, out-of-sequence behavior and release criteria.