Skip to the content
FixTheRobot Explore Robotics / UAV / Module 3 / M3-T16

UAV Systems Engineering · Module 3

M3-T16: Sensor fault detection and isolation

Redundancy only helps if you can tell which sensor is lying. Detect with residuals, isolate with consistency, and measure how long it takes.

  • Lesson 16 of 16
  • Sensor Fusion and State Estimation
  • Established engineering
  • About 6 minutes to read

A fault in one sensor is survivable only if the system notices, identifies the culprit and reconfigures before the error matters. The theory is standard; the engineering is choosing thresholds against two opposing numbers: false alarms and detection delay.

Learning objectives

After this lesson, you should be able to:

  • Generate residuals from redundant sensors or from a model-based prediction.
  • Apply a CUSUM detector and relate threshold to false-alarm rate and detection delay.
  • Isolate the faulty sensor by consistency among the remaining sensors.
  • Describe what recovery requires and what cannot be isolated.

Conceptual explanation

Detection asks “is something wrong?”; isolation asks “which element?”; recovery asks “what do we do now?” (lesson M8-T9). Both rest on residuals: quantities that are zero-mean noise when everything is healthy and shift when a fault occurs. Residuals come from analytical redundancy (a model or another sensor predicts what this sensor should read) or physical redundancy (several sensors of the same quantity).

Detection and isolationThree redundant sensors feed a residual generator. A CUSUM detector flags that something is inconsistent. Isolation then finds the sensor that disagrees with the other two. The faulty sensor is excluded and the estimator continues with the rest.Sensor ASensor BSensor C Residualsvs the others DetectCUSUM / NIS Isolate + reconfigureexclude B, flag, logdetection says that; isolation says which; recovery says what next
The chain from residual to reconfiguration. Each stage has its own failure mode.

Typical UAV faults: stuck, bias step, drift ramp, increased noise, dropout, delayed data, scaling error. Different detectors suit different faults: a threshold catches large steps; CUSUM catches small persistent shifts; a variance test catches noise growth.

Animation of fault detection and isolation among four redundant sensors measuring the same quantity. The left strips show each sensor against the median of the others; sensor 3 develops a bias at 40 percent of the run and its residual leaves the noise band while the other three stay inside. The right chart shows how the mean detection delay of a cumulative-sum test falls as the fault size grows, computed over many random runs.
Redundancy gives residuals: each sensor compared with the others. A fault appears in one residual (isolation) and a CUSUM test accumulates small shifts. Small faults take longer to detect (delay ∝ 1/size); the threshold trades delay against false alarms. Four sensors with noise 0.1, bias 0.35 at 40 %; delay curve averaged over 40 runs per fault size. (Looping, about 6 seconds; drawn and computed for this course with illustrative values.)

Engineering intuition

Two sensors that disagree tell you something is wrong but not which one: you need a third, or a model, to cast the deciding vote. With three, the odd one out is the faulty one if only one fails at a time. A single-fault assumption is therefore baked into most voting schemes: state it, and design what happens when two sensors fail.

Every detector trades two numbers. A lower threshold detects sooner but raises false alarms; a false alarm that excludes a healthy sensor is itself a fault. Choose the threshold from a false-alarm requirement (for example one per 100 flight hours) and then report the detection delay and the smallest detectable fault that result.

Mathematical formulation

Residuals from redundancy

Normalised residual of sensor j
rj(k)=zj(k)−mean of the other sensorsσrr_j(k) = \frac{z_j(k) - \text{mean of the other sensors}}{\sigma_r}
σr=σj1+1m−1\sigma_r = \sigma_j\sqrt{1 + \frac{1}{m-1}}
For m sensors of equal noise σj.

CUSUM

For a shift of unknown sign and a reference (slack) kk and threshold hh in units of σ\sigma :

Two-sided CUSUM
Sk+=max⁡ ⁣(0, Sk−1++rk−κ),Sk−=max⁡ ⁣(0, Sk−1−−rk−κ)S^{+}_k = \max\!\left(0,\ S^{+}_{k-1} + r_k - \kappa\right), \qquad S^{-}_k = \max\!\left(0,\ S^{-}_{k-1} - r_k - \kappa\right)
alarm when max⁡(S+,S−)>h\text{alarm when } \max(S^{+}, S^{-}) > h
κ\kappa
slack, typically half the shift to be detected in σ\sigma units (0.5 detects a one-sigma shift well).
hh
decision threshold; larger hh lowers false alarms and lengthens delay.

The average detection delay after a shift δ\delta (in σ\sigma ) is roughly h/(δ−κ)h/(\delta -\kappa ) samples when δ>κ\delta >\kappa ; the average run length between false alarms grows roughly exponentially with hh. Both are standard results (Page 1954; Basseville and Nikiforov) and should be confirmed by simulation for your noise distribution.

Isolation by consistency

After detection, compare the pairwise differences dabd_{ab} averaged over a short window. Under a single fault, the two healthy sensors agree (|dd| small) and the faulty one disagrees with both. The faulty sensor is the one that is not in the best-agreeing pair.

Chi-square tests for vector residuals

For a measurement vector with innovation covariance SS, NIS = y⊤S−1yy^{\top}S^{-1}y is chi-square (lesson M3-T14). A windowed NIS is the multivariate analogue of the CUSUM above.

Architecture and data flow

Each sensor stream → residual generator (model prediction or other sensors) → detector with a configured threshold → health record per sensor (valid, suspect, failed, with reason and time) → estimator (excludes or inflates the sensor) and navigation manager (confidence and mode, lesson M2-T16). Log every residual and every decision: the log is the evidence for the detection delay claimed in the FMEA (lesson M8-T7).

Real-world UAV applications

  • Redundant IMUs and barometers on the flight controller.
  • Cross-checking GNSS against odometry (lesson M2-T6).
  • Rejecting a failed camera or LiDAR from a VIO and LIO estimator.
  • Motor and ESC fault detection from current, rpm and expected response.

Implementation example

This runs as shown: three sensors measure the same signal; sensor BB gets a 5-sigma bias at t=30 st=30\,\mathrm{s}. CUSUM detects it within a few samples without false alarms in the nominal period, and the pairwise-consistency rule isolates BB in every one of ten seeds.

import numpy as np

def cusum_first_alarm(r, kappa=0.5, h=8.0):
    sp = sm = 0.0
    for i, x in enumerate(r):
        sp = max(0.0, sp + x - kappa); sm = max(0.0, sm - x - kappa)
        if max(sp, sm) > h: return i
    return None

def run(seed, fault_at=300, bias=1.5, sigma=0.3, n=600):
    rng = np.random.default_rng(seed)
    t = np.arange(n) * 0.1; truth = 5 * np.sin(0.05 * t)
    z = truth[:, None] + sigma * rng.standard_normal((n, 3))
    z[fault_at:, 1] += bias                                         # sensor B develops a 5-sigma bias
    res = np.empty((n, 3))
    for j in range(3):
        others = [i for i in range(3) if i != j]
        res[:, j] = (z[:, j] - z[:, others].mean(axis=1)) / (sigma * np.sqrt(1.5))
    alarms = [cusum_first_alarm(res[:, j]) for j in range(3)]
    nominal_alarms = [cusum_first_alarm(res[:fault_at, j]) for j in range(3)]
    t_alarm = min(a for a in alarms if a is not None)
    w = slice(t_alarm - 5, t_alarm + 15)                            # short window around the alarm
    d = {(a, b): abs(np.mean(z[w, a] - z[w, b])) for a, b in [(0, 1), (0, 2), (1, 2)]}
    best_pair = min(d, key=d.get)                                   # the two sensors that agree best are healthy
    faulty = [j for j in range(3) if j not in best_pair][0]
    return t_alarm - fault_at, faulty, nominal_alarms

results = [run(s) for s in range(10)]
delays = [r[0] for r in results]
print("detection delay (samples):", delays, "| isolated sensors:", [r[1] for r in results])
assert all(r[2] == [None, None, None] for r in results)            # no false alarms in the healthy period
assert all(0 <= d <= 8 for d in delays) and all(r[1] == 1 for r in results)
Residuals, CUSUM detection and isolation by consistency, with detection delay measured over ten seeds.

Common engineering mistakes

Setting thresholds by eye

Choose from a false-alarm requirement, then report the delay and minimum detectable fault.

Residuals contaminated by the faulty sensor

A residual against the mean of all sensors (including the faulty one) smears the fault across all residuals; use leave-one-out or a model.

Assuming single faults only without saying so

State the assumption and design the response to a second fault.

Detecting without a recovery action

A flag that nobody reads is not protection (lesson M8-T9).

Common-mode faults

Identical sensors with a shared dependency (power, vibration, clock) fail together and agree with each other while wrong; add diversity.

Failure modes

Failure modes, symptoms and causes
Failure modeHow it shows upLikely cause
False alarmHealthy sensor excludedThreshold too low for the real noise (non-Gaussian, heavy tails)
Missed slow driftFault grows below the detector’s sensitivityThreshold or slack too large; drift slower than the detector can resolve
Wrong sensor isolatedHealthy sensor excluded, faulty one keptTwo simultaneous faults or correlated errors
ChatteringSensor excluded and re-admitted repeatedlyNo hysteresis on re-admission

Debugging approach

  1. Replay recorded data with injected faults of each type and size and tabulate detection delay and misses.
  2. Plot residuals with the alarm thresholds drawn; check they look white and zero-mean in healthy data.
  3. Estimate the real false-alarm rate on many hours of healthy logs.
  4. Test isolation with every single-sensor fault and with a double fault.

Practical exercises

  1. Choose hh for an average run length between false alarms of 5000 samples and estimate the delay for a 3σ3\sigma bias.
  2. Add a drift fault (ramp) instead of a bias and find the slowest ramp that is detected within 20 s.
  3. Extend the example to a stuck-at fault (sensor holds its last value).
  4. Use the GNSS-Denied Failure Simulator to inject a camera failure and read the detection time from the log.

Interview questions

Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.

Question 1

What is the difference between detection, isolation and recovery?

Model answer

Detection decides that a fault exists, isolation decides which element is faulty, recovery reconfigures the system (exclude, switch, degrade or stop) to remain safe.

Question 2

What does a CUSUM detect that a simple threshold does not?

Model answer

Small persistent shifts: it accumulates evidence over time so a bias well below the single-sample threshold is eventually caught.

Question 3

Why do you need at least three sensors for isolation by voting?

Model answer

With two, a disagreement cannot say which is wrong; the third provides the deciding comparison, assuming only one fault at a time.

References and further reading

Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.

What’s next

Mark this lesson

Saved in this browser and synced to your account when you are signed in.

Practice this lesson

M3-L6: Detect faulty sensor measurements

Use innovation gating to reject spoofed GNSS.

Next lesson

M4-T1: SLAM fundamentals

State the SLAM problem, the roles of the front-end and back-end, and why loop closure is needed.