%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#ecf0f1'}}}%%
flowchart TB
Input[New Measurement]
Input --> Check1{Innovation Check<br/>Mahalanobis d2 < 5.99?}
Check1 -->|No| Reject1[Reject Outlier]
Check1 -->|Yes| Update[Update Filter]
Update --> Check2{Physics Check<br/>velocity < max?}
Check2 -->|No| Reset[Reset Filter]
Check2 -->|Yes| Check3{Rate Check<br/>delta position < 10m/s?}
Check3 -->|No| Reset
Check3 -->|Yes| Valid[Valid Output]
style Input fill:#2C3E50,stroke:#16A085,color:#fff
style Valid fill:#27AE60,stroke:#2C3E50,color:#fff
style Reject1 fill:#7F8C8D,stroke:#2C3E50,color:#fff
style Reset fill:#7F8C8D,stroke:#2C3E50,color:#fff
1267 Sensor Fusion Best Practices
Learning Objectives
After completing this chapter, you will be able to:
- Identify and avoid common sensor fusion mistakes
- Implement proper validation and outlier rejection
- Design robust fusion systems with graceful degradation
- Apply calibration and synchronization best practices
1267.1 Common Mistakes in Sensor Fusion
1267.1.1 Pitfall 1: Blindly Trusting Fused Output
The Mistake: Sending fused output directly to actuators without validation.
# WRONG: Blindly trusting fused output
fused_position = kalman_filter.update(gps, imu)
send_to_autopilot(fused_position) # Hope it's right!Why itโs wrong:
- What if GPS gives wildly wrong reading (multipath error)?
- What if IMU sensor fails (stuck at zero)?
- Fusion amplifies garbage-in without sanity checks!
The Fix: Multi-Layer Validation
Essential validation checks:
- Innovation consistency: Mahalanobis distance < chi-squared threshold
- Physics limits: Velocity < max_velocity
- Rate of change: Position canโt jump > 10m in 1 second
- Cross-validation: Compare fused output against raw sensors
- Uncertainty monitoring: If covariance P grows unbounded, filter is diverging
Real-world example: Boeing 737 MAX MCAS system failed because it trusted a single sensor without fusion or validation -> two fatal crashes. Lesson: Always validate, never trust blindly!
The Mistake: Fusing sensor data using arrival timestamps instead of event timestamps.
Why It Happens: Network protocols deliver data โas it arrives,โ and most database systems timestamp on insertion. Developers focus on fusion algorithms and forget that a GPS reading from 200ms ago cannot be directly fused with an accelerometer reading from 10ms ago.
The Fix: Implement proper time synchronization at three levels:
- Clock sync: Use NTP or PTP to synchronize all sensor node clocks to <10ms accuracy
- Event timestamping: Record when measurement occurred, not when received
- Temporal alignment: Use interpolation to align sensor readings before fusion
Warning sign: If your fused position oscillates rapidly despite smooth motion, check timestamp alignment first.
The Mistake: Deploying sensor fusion systems without verifying calibration, assuming factory calibration is sufficient.
The Fix: Implement a three-stage calibration verification:
- Incoming inspection: Test each sensor batch against reference standard
- In-situ calibration: Run 24-48 hour burn-in comparing against known references
- Runtime monitoring: Track sensor bias using fusion residuals
A temperature sensor with +2C uncorrected bias propagates through every fusion calculation, creating systematic errors that averaging cannot fix.
The Mistake: Using arbitrary values for process noise Q and measurement noise R.
Symptoms:
- Q too small: Filter ignores measurements, overconfident in model
- Q too large: Jerky estimates, follows noise
- R too small: Jerky estimates, overweights measurements
- R too large: Slow response, ignores sensor data
The Fix:
- For R: Measure sensor variance empirically (stationary readings variance)
- For Q: Model physical system dynamics, tune based on expected disturbances
- Adaptive: Use innovation covariance monitoring to detect parameter mismatch
The Mistake: Assuming all sensors always work correctly.
The Fix:
- Monitor sensor health: Check for stuck values, excessive noise, timeout
- Graceful degradation: Switch to reduced-sensor mode when failures detected
- Fault isolation: Identify which specific sensor failed
- Recovery: Reinitialize filter state when sensor recovers
Example: GPS failure -> switch to IMU-only dead reckoning with increased uncertainty.
The Mistake: Assuming sensor errors are independent when they share common error sources.
Examples:
- Multiple Wi-Fi APs affected by same multipath
- GPS and GLONASS sharing ionospheric errors
- Temperature sensors on same PCB sharing thermal drift
The Fix:
- Add different sensor types (diversity beats redundancy)
- Model cross-correlation in covariance matrices
- Use decorrelation techniques before fusion
The Mistake: Fusing high-latency sensors with low-latency sensors without compensation.
Example: Camera (100ms processing) + IMU (1ms) - by the time camera result is ready, IMU has moved 10 readings ahead.
The Fix:
- Timestamp all measurements with event time, not processing time
- Use state augmentation or measurement delay compensation
- Predict camera measurement to current time using IMU data
1267.2 Validation Checklist
Before deploying any sensor fusion system, verify:
| Check | Pass Criteria |
|---|---|
| Calibration verified | All sensors within 2-sigma of spec |
| Timestamp alignment | Event times synchronized <10ms |
| Outlier rejection | Mahalanobis test implemented |
| Physics constraints | Impossible states rejected |
| Graceful degradation | Works with sensor failures |
| Uncertainty tracking | Covariance bounded and meaningful |
| Cross-validation | Fused output between raw sensor values |
1267.3 Chapter Summary
Multi-sensor data fusion combines measurements from multiple sensors to achieve higher accuracy, reliability, and robustness than any single sensor provides.
Key takeaways:
- Three fusion levels: Low-level (raw data), feature-level, decision-level
- Kalman filter: Optimal for linear systems with Gaussian noise
- Complementary filters: Simple, efficient for IMU orientation
- Particle filters: Handle non-linear, multi-modal distributions
- Validation is critical: Never trust fused output without sanity checks
- Calibration matters: Uncorrected bias propagates through all calculations
- Graceful degradation: Design for sensor failures from the start
Multi-sensor fusion is fundamental to building robust IoT systems that can make reliable decisions even when individual sensors are noisy or unreliable.
1267.4 Whatโs Next
- Exercises - Practice implementing fusion systems with hands-on exercises
- Edge Compute Patterns - Apply fusion at the edge
- Data Storage - Store fused data efficiently