# Betaflight Crash Detection and Accelerometer Impact Settings: Blackbox Crash Analysis
Crashes happen. What matters is understanding why they happened so you can prevent them in the future. Betaflight’s built-in **Crash Detection** system uses the gyroscope and accelerometer to detect impact events, log them to Blackbox, and — when configured — trigger recovery routines. This guide explains how crash detection works, how to configure its parameters, and how to use Blackbox logs to analyze crash causes.
## How Betaflight Crash Detection Works
The crash detection algorithm continuously monitors three parameters:
| Parameter | What It Measures | Units |
|—|—|—|
| **Gyro Rate** | Angular velocity (how fast the quad is spinning) | degrees/second |
| **Setpoint Error** | Difference between commanded and actual rotation rate | degrees/second |
| **Motor Saturation** | Whether any motor is at 100% output | Boolean |
When the quad experiences a sudden impact, the gyro detects a massive spike in angular velocity that far exceeds what the PID controller commands. If this spike crosses the configured thresholds, Betaflight flags a **crash event** and — if `crash_recovery` is enabled — momentarily disables the PID controller and attempts to self-level using only the accelerometer.
### The Crash Detection Decision Flow
“`
Is gyro rate > crash_gthreshold?
↓ YES
Is setpoint error > crash_setpoint_threshold?
↓ YES
Has this condition persisted for > crash_time?
↓ YES
→ CRASH DETECTED → Disable PID → Self-level for crash_recovery_time
↓
If recovery succeeds (angle < crash_recovery_angle) → Re-enable PID
```
## Crash Detection CLI Parameters
### Core Crash Detection Settings
```
set crash_detection = ON
```
| Parameter | Default | Range | Description |
|---|---|---|---|
| `crash_gthreshold` | 1000 | 200-10000 | Gyro rate threshold (deg/s). Lower = more sensitive. |
| `crash_setpoint_threshold` | 350 | 20-1000 | Setpoint error threshold (deg/s). Lower = triggers on smaller deviations. |
| `crash_time` | 500 | 100-2000 | How long (ms) thresholds must persist before triggering. |
| `crash_delay` | 500 | 0-2000 | Cooldown period (ms) after a crash before detection re-arms. |
| `crash_dthreshold` | 50 | 10-500 | Deadband — minimum gyro change to reset crash timer. |
### Crash Recovery Settings (If Enabled)
```
set crash_recovery = ON
```
| Parameter | Default | Range | Description |
|---|---|---|---|
| `crash_recovery_angle` | 10 | 5-30 | Maximum allowed tilt angle (degrees) before recovery considered successful. |
| `crash_recovery_rate` | 100 | 50-200 | How aggressively the quad self-levels during recovery. |
| `crash_recovery_time` | 500 | 200-1000 | Hard timeout (ms) for recovery phase. Recovery is abandoned after this. |
## Tuning Crash Detection Sensitivity
### For Freestyle / Proximity Flying
Freestyle pilots regularly experience high gyro rates and setpoint errors during tricks (power loops, Matty flips, juicy flicks). Overly sensitive crash detection triggers false positives mid-trick, causing the quad to suddenly self-level — a dangerous surprise.
**Recommended settings for freestyle:**
```
set crash_gthreshold = 2000
set crash_setpoint_threshold = 500
set crash_time = 500
set crash_recovery = OFF # Disable auto-recovery during freestyle
```
### For Racing
Racers hit gates, other quads, and the ground regularly. Crash detection should be sensitive enough to catch real hits but not trigger on aggressive cornering.
**Recommended settings for racing:**
```
set crash_gthreshold = 1500
set crash_setpoint_threshold = 400
set crash_time = 300
set crash_recovery = OFF # In a race, recovery wastes time — disarm immediately
```
### For Long-Range / Cinematic
Long-range and cinematic pilots want maximum protection. If the quad hits something at range, auto-recovery might save you from a long walk (or lost drone).
**Recommended settings for cinematic:**
```
set crash_gthreshold = 800
set crash_setpoint_threshold = 250
set crash_time = 300
set crash_recovery = ON
set crash_recovery_angle = 10
set crash_recovery_rate = 80
```
## Analyzing Crashes with Blackbox Logs
Blackbox logs are the ultimate crash investigation tool. Every crash event is marked in the log, allowing you to see exactly what happened in the moments before impact.
### Step 1: Enable Crash Logging
In Betaflight Configurator **Blackbox** tab, set:
- **Blackbox logging device:** Onboard Flash or SD Card
- **Debug Mode:** `GYRO_SCALED` for gyro analysis, or `NOTCH` for filter debugging
- **Logging rate:** 1:1 (full rate) for crash analysis — you need every data point
### Step 2: Find the Crash Event in the Log
Open the log in **Betaflight Blackbox Explorer**:
1. Look for the **crashDetect** flag in the graph legend
2. A vertical red line or shaded region marks each crash event
3. Zoom in to the 1-2 seconds before the flag
### Step 3: What to Look For
| Graph | What to Check |
|---|---|
| **Gyro (unfiltered)** | Sudden spike >1000 deg/s = impact. Gradual divergence = mechanical failure (prop/motor/ESC). |
| **RC Command** | Was there a stick input at impact? Pilot error vs equipment failure. |
| **Motor Output** | Did a motor saturate (100%) just before impact? Possible desync or ESC failure. |
| **CPU Load** | Did the FC overload? High CPU can delay PID loop and cause loss of control. |
| **Voltage / Current** | Did battery sag cause ESC brownout? Voltage below 3.0V/cell under load is dangerous. |
| **RSSI / LQ** | Did the radio link drop? Failsafe just before impact = range/interference issue. |
### Step 4: Common Crash Signatures
| Crash Type | Blackbox Signature |
|—|—|
| **Prop wash / oscillation build-up** | Progressively increasing gyro amplitude over 0.5-1 second before impact |
| **Desync** | One motor goes to 100% while others drop to 0%, followed by rapid gyro spike |
| **Failsafe** | RSSI drops to 0, RC Command flatlines (last known position), motors stop, quad tumbles |
| **Mechanical failure (arm, prop)** | Sudden asymmetric gyro reading with no corresponding RC input |
| **Battery sag brownout** | Voltage drops below 2.8V/cell, CPU resets (log restarts), gyro resets |
| **Pilot error (over-correction)** | Large opposing RC inputs alternating rapidly just before impact |
## Disabling the Accelerometer (For Performance)
The accelerometer is required for crash recovery but increases CPU load and limits PID loop speed. Many racers and freestyle pilots disable it entirely:
“`
set acc_hardware = NONE
set crash_recovery = OFF
save
“`
Without the accelerometer, you cannot use Angle/Horizon mode, crash recovery, or Turtle Mode that relies on accelerometer orientation. But you gain CPU headroom and the ability to run 8K/8K PID loops — worth it for competitive flying.
## Recommended Flight Controllers with Quality IMUs
Crash detection reliability depends heavily on gyroscope quality. UAVModel stocks flight controllers with premium **BMI270, ICM-42688-P, and MPU6000 gyroscopes** that provide the clean, low-noise data crash detection needs to work accurately. Visit [uavmodel.com](https://uavmodel.com) for FCs with gyros you can trust when things go wrong.
