bitcraze / crazyflie-firmware

The main firmware for the Crazyflie Nano Quadcopter, Crazyflie Bolt Quadcopter and Roadrunner Positioning Tag.
GNU General Public License v3.0
1.16k stars 1.05k forks source link

Stabilizer task blocks due to gyro failure, freezing flight control #1406

Open gemenerik opened 3 weeks ago

gemenerik commented 3 weeks ago

When the gyro sensor stops sending data unexpectedly, the stabilizer task can become blocked here. This causes all processes dependent on the stabilizer to freeze. The rate supervisor task does not appear to be designed to detect a complete block in the stabilizer task, nor does it take any corrective action beyond printing a warning.

This issue was observed on a Crazyflie at the office, where the gyro sensor tends to fail mid-flight, particularly under high thrust conditions. When this occurs, the Crazyflie gets stuck at high thrust. @tobbeanton confirmed the gyro failure by observing a complete absence of data interrupts using an oscilloscope.

Other parts of the system, like USB connectivity and cfclient plotting, continue to function normally.

Steps to Reproduce:

Expected Behavior: The system should handle gyro sensor failures gracefully, preventing the stabilizer task from blocking and allowing dependent processes to cut the motors.

Actual Behavior: The stabilizer task blocks, causing all dependent processes to freeze, which can result in the Crazyflie being stuck at high thrust :see_no_evil: