MTBuilder AcademyLearn it. Test it. Build it.
Feedback & motionLesson 39 of 48
Advanced65 minutes2 project connections

Sensor fusion

Combine complementary measurements while preserving frames, calibration, uncertainty, and fault evidence.

After this lesson, you can
  • Fuse two scalar estimates using stated uncertainty assumptions.
  • Identify frame, timing, bias, and correlation failures that make a fused result misleading.
Print / Save PDF
ReadPracticedBench demonstrated
Related study — optional context
01

Understand

The working idea

Different sensors fail differently. Wheel encoders give smooth short-term displacement but drift during slip; a camera can correct global position but may update slowly or lose features. An accelerometer reacts quickly but includes gravity and bias; a slow reference can anchor it. Fusion uses complementary information, not merely more numbers.

For two independent unbiased scalar estimates x₁ and x₂ with variances σ₁² and σ₂², inverse-variance fusion is x̂ = (x₁/σ₁² + x₂/σ₂²)/(1/σ₁² + 1/σ₂²). Its variance is 1/(1/σ₁² + 1/σ₂²). The more precise estimate receives more weight. This result depends on independence, correct uncertainty, a shared physical quantity, synchronized time, and compatible coordinates. If both estimates share the same calibration error, treating them as independent becomes overconfident.

Before combining vectors, transform them into one declared frame. A camera's right direction may not match a robot's lateral axis, and an accelerometer mounted upside down changes signs. Align timestamps or propagate older estimates forward with a model. Compute innovations—the difference between prediction and new measurement—and retain them for gating and diagnosis. The build decision may be to reject a camera update when its residual is physically implausible while continuing short-term encoder prediction and explicitly increasing uncertainty.

A common misconception is that averaging two sensors always improves accuracy. A biased sensor can pull the result away from truth; duplicated sensors exposed to the same vibration have correlated errors. Another failure is assigning tiny uncertainty because a trace looks smooth. Calibration, latency, quantization, environment, and model error all matter. Fusion should report confidence and degraded modes, not conceal disagreement. For a desk robot, stopping or slowing after prolonged localization disagreement is often sounder than trusting a polished but unsupported estimate.

02

Follow the reasoning

Worked example

An encoder estimates travel as 1.20 m with σ = 0.10 m; a camera estimates 1.05 m with σ = 0.05 m. Assuming independent unbiased errors, compute the fused estimate.

  1. 1

    Weights are inverse variances: encoder 1/0.10² = 100 m⁻²; camera 1/0.05² = 400 m⁻².

  2. 2

    Fused value is (100×1.20 + 400×1.05)/(100+400) = 540/500 = 1.08 m.

  3. 3

    Fused standard deviation is √(1/500) m = 0.0447 m.

Result

The fused estimate is 1.08 m with modeled standard deviation about 0.045 m.

Sanity checkThe estimate lies between inputs and closer to the more precise camera value; confidence is only slightly better than 0.05 m because the camera already dominates.

03

Try it yourself

Independent check

Two position sensors share the same incorrectly measured scale factor. Why is naive inverse-variance fusion risky?
04

Move to the bench

Fuse two position estimates and use disagreement to detect a sensor fault.

Gather
  • Toy car or sliding target
  • Measured track
  • Wheel/rotation counts or marked ruler readings
  • Camera or second observer
  • Spreadsheet or script

Experiment

  1. Define a common origin, positive direction, timestamps, and estimated uncertainty for both methods.
  2. Move through several known marks, record actual independent readings, and compute weighted fused positions.
  3. Plot each residual against the track reference and check whether errors appear biased or correlated.
  4. Deliberate fault: introduce one wheel-slip event or a fixed camera offset; diagnose it from innovation and persistent residual pattern before changing weights.

Observe

  • Expected: fusion helps when errors are roughly independent and calibrated; a shared or biased error survives.
  • Measure: actual estimates, timestamps, reference positions, residuals, and chosen variances; label reference uncertainty too.
Transfer it

Define a degraded mode for a desk robot when encoder and camera position disagree beyond a justified threshold for three updates.

Limits and cautions
  • Use a slow, low-energy cart on a clear tabletop or floor track; do not adapt this experiment to a road vehicle.
05

Keep evidence

Bench note

Record what you expected, what you actually measured or observed, and one difference worth investigating. This is self-reported evidence, not a certification.

0 / 5,000A bench demonstration needs a concrete note of at least 20 characters.
Terms in this lessonBrowse the advanced glossary

Sources and further reading

  1. Modern Robotics