FDI Recovery
<50ms
Platform
Crazyflie 2.1
Validation
ROS2 Sim & Hardware
Overview
This project builds a complete fault-tolerant flight control stack for the Crazyflie 2.1 nano-quadrotor. The goal is to detect motor failures in real time and reconfigure the controller within 50 ms to maintain stable flight — enabling safe recovery from single-motor failures without human intervention.
Problem Statement
Small UAVs like the Crazyflie 2.1 are highly susceptible to motor failures due to their thin winding and lightweight design. A single motor dropout causes immediate yaw divergence and altitude loss. Standard PID controllers have no mechanism to adapt — the craft simply crashes. This project addresses that gap by adding a Fault Detection and Isolation (FDI) layer and a reconfigurable controller that adjusts control allocation on the fly.
System Architecture
The stack runs as a ROS2 node graph. A dedicated FDI node subscribes to motor telemetry (PWM commands vs. estimated thrust) and runs a residual-based detector. When a fault is confirmed, it publishes a FaultEvent message containing the failed motor ID and severity estimate. The controller node consumes this and switches to a pre-computed reconfigured control allocation matrix that distributes wrench commands across the three remaining motors while maintaining attitude control authority.
Fault Detection & Isolation
The FDI module uses a model-based residual approach. An analytical model of each motor's thrust-to-PWM curve is maintained. The residual — the difference between expected and measured thrust — is passed through a CUSUM detector tuned for a 50 ms detection latency. Once the residual crosses the threshold for two consecutive samples, a fault is declared. This approach avoids false positives due to transient electrical noise while meeting the tight latency requirement.
Controller Reconfiguration
On fault detection, the allocation matrix switches from the nominal 4×4 mapping to a 3×4 reduced mapping derived offline via constrained optimization. The reconfigured matrix is preloaded at startup so the switch is instantaneous. Post-reconfiguration, the controller operates in a yaw-degraded mode — yaw authority is reduced but roll and pitch remain fully controllable, enabling safe descent and landing.
ROS2 Test Harness
A custom ROS2 test harness was built to validate the stack without risking hardware. It replays log files from previous flight sessions and injects synthetic faults at configurable timestamps. Automated flight scenarios (hover hold, yaw sweep, fault injection at t=5s) run through a CI-style pipeline that checks stability bounds against recorded ground truth. This enables regression testing every time the FDI parameters are tuned.
fault = fdi.check(
motor_states,
tf2.TimePointZero
)
if fault.detected:
ctrl.reconfigure(
fault.failed_id,
cmd_wrench
)Tools & Stack
Key Outcomes
FDI detection latency under 50 ms on hardware
Stable hover maintained post-reconfiguration in all 12 hardware trials
Automated ROS2 test harness covering 4 flight scenarios
Zero false-positive fault detections in 30 minutes of nominal flight logs