Failsafe
If the radio link is lost, or the receiver fails or becomes disconnected, the pilot will have no control over their aircraft.
Betaflight provides a Failsafe system to safely manage this potential hazard. The flight controller can be programmed to either
- disarm and drop
- to apply a fixed throttle value, and other specific values, with the intent of descending in a controlled manner
- to activate GPS Rescue and autonomously fly home (requires a working GPS module)
Always confirm that your failsafe system is working properly before flying!
Introduction
There are two types of failsafe:
Receiver based failsafe is where the receiver is configured to send specific values on specific channels to the flight controller when the radio link is lost. Normally the values are configured so that the aircraft either cuts motors and falls, or descends in a controlled manner. See your receiver's documentation for this method. Since the data received appears 'normal', the flight controller will be unaware that the link is down. The failsafe settings in the firmware will not be triggered, and you will not see anything in the OSD.
Flight Controller based failsafe is where the receiver is configured to send 'no data', or for a PPM Rx to send invalid values (ie a value below rx_min_usec
), when the link is lost. Some receivers may send a 'link lost' packet in the data stream to the FC at the same time. The flight controller always monitors for the absence of incoming data, 'link lost' packets or bad PPM values. When the flight controller determines that the link is lost, it will respond according to the failsafe settings as set in Configurator. If warnings in the OSD are enabled, a link loss warning will appear.
We do NOT recommend using receiver based failsafe!
Always ensure that the receiver is configured to 'send no data' on signal loss!
Flight Controller based failsafe overview
Flight Controller failsafe continuously monitors the integrity of the radio link.
It is essential that the Receiver is configured to send no data (no packets at all) on signal loss, otherwise Flight Controller based failsafe will never realize that anything is wrong.
Flight Controller failsafe will work if the wires connecting the FC to the Receiver come loose, or break, or your receiver locks up.
Flight Controller failsafe has three stages:
Signal Validation is a short (100ms) period in which the absence of incoming data is noted, the last received values are 'held'.
If signal validation fails, i.e. no signal for more than 100ms:
- the flight controller holds the last known good values for a further 300ms, and then activates failsafe stage 1 values, and
- an arming block will be initiated, and
RXLOSS
will shown in the OSD while that block is active; these will persist for at least thefailsafe_recovery_delay
period.
Failsafe Stage 1, or the 'Guard' period, applies the Stage 1 Channel Fallback Settings for up to the failsafe_delay
period (1.5s by default in 4.5, 1.0s in 4.4), counted from the time of the last valid packet. If any valid data arrives while in Stage 1, the flight controller will respond to it immediately, and the failsafe process stops. During stage 1, he pilot may notice jerky or intermittent stick responsiveness if the signal comes and goes.
Failsafe Stage 2 is entered if the Failsafe Stage 1 or "Guard" period is exceeded. The user decides what will happen in Stage 2. By default, the craft immediately disarms and drops. Alternatively, it can enter Landing Mode
or GPS Rescue
.
When signal returns, after Stage 2 has started, it must be continuously good for at least the failsafe_recovery_delay
period before the signal can be considered 'fully recovered'. Only then will the RXLOSS
message be cleared, and control inputs considered 'real'. In Betaflight 4.5 the failsafe_recovery_delay
period is 500ms, but if built with the RACE_PRO
option, it is only 100ms; in 4.4 it was 1.0s.
When signal fully recovers after a Stage 2 Failsafe:
RXLOSS
will go away,- if Stage 2 was a GPS Rescue, the quad will start checking the inputs for stick movements that are needed to return control to the pilot; when they are detected, and only then, will full control will be returned to the pilot, as if nothing had happened.
- in other Stage 2 modes, if the quad has disarmed, the pilot must disarm before they can re-arm, and the
NOT_DISARMED
warning will be shown in the OSD until the arm switch is put in the disarmed position.
A transmitter switch may be configured to immediately activate Flight Controller failsafe. This is useful for field testing the failsafe system and as a PANIC
switch when you lose orientation. Reversing that switch immediately returns full control to the pilot.
Signal Validation
Signal loss means:
- no incoming data packets, or that the receiver is sending failsafe mode or frame dropped packets, for more than 100ms, or
- invalid pulse length data on any flight channel for more than 300ms (PPM receivers only)
RXLOSS
should be displayed in the warnings field of the OSD when signal loss is detected. This is an 'early warning' of significant packet loss - an indicator that the link is in a bad way. The RXLOSS
message will be held for half a second (100ms in RACE_PRO
builds, one second in 4.4), even if the signal loss is brief. During this time, the quad will not respond to arming commands, for safety reasons.
When the FC decides that signal loss has occurred, the values on the bad channels, or on all channels for total packet loss, will be held at their last received value for 300ms from the last known good data.
If valid incoming data is detected during the signal validation period, the signal is considered 'normal' again, the signal loss detection timers are reset.
After 300ms with no valid data, the previously held values are replaced with Stage 1 Failsafe values, and we enter Stage 1 Failsafe.
When a failsafe switch is enabled, and Failsafe is set to use Stage 1, the flight channels (Roll, Pitch, Yaw and Throttle), but not the auxiliary channels, are immediately set to Stage 1 values, without any delay.
Stage 1 Failsafe
Stage 1 applies fixed values after confirmed signal loss.
The default Stage 1 duration, or 'guard time' is 1.5 seconds in 4.5 (1.0s in 4.4), with a minimum of 200ms. The countdown to Stage 2 starts from the time of the last good packet. The Stage 1 duration may be customised via the "Guard time for stage 2 activation" parameter in Configurator (failsafe_delay
in the CLI).
During Stage 1 Failsafe from signal loss, by default, all stick positions are set to the 'fallback' values (centered, throttle zero), and the current switch positions are held. These settings can be customised in Configurator's 'Channel fallback settings' panel in the failsafe tab, or with the CLI command rxfail
(see the rxfail section in the Rx documentation). For example, the pilot may choose a hover throttle value, or to activate Level mode, in Stage 1, by configuring the relevant fallback switch or aux channel values.
The PID system remains active in Stage 1.
If signal returns during the Signal Validation or Stage 1 periods, control is immediately returned to the pilot, and the failsafe timers are reset.
Because Stage 1 cuts throttle to zero by default, the craft may immediately start to fall from the sky. It may be better to set this to a throttle value where the quad descends slowly, or just hovers. It is essential to do this when GPS Rescue is enabled for Stage 2 Failsafe, or the quad may crash in Stage 1 before the Rescue has time to start.
Stage 1 may be activated by a transmitter switch. The switch should be configured in Configurator's Modes Tab to enable failsafe, and the failsafe_switch_mode
should be set to STAGE1
. Note that:
- the effect is immediate,
- the aux channels remain active, and
- returning the switch to normal terminates the failsafe behavior immediately.
If the switch is held ON for longer than the failsafe_delay
period, the flight controller will enter Stage 2 (see below), and, depending on how Stage 2 is configured, may immediately drop, or disarm.
There is no dedicated 'Stage 1' indicator in the OSD. The flight mode field in the OSD does not show !FS!
during stage 1.
Stage 2 Failsafe
Stage 2 Failsafe is entered when signal loss persists longer then the configured Stage 1 period. Stage 2 may also be entered with a failsafe switch. Once active:
- the selected
Stage 2 Failsafe_procedure
applies. !FS!
will be shown in the Flight Mode field of the OSD.RUNAWAY_TAKEOFF
protection is enabled in failsafe before 4.3, but later versions disable it, to avoid unwanted mid-air disarms that could occur in GPS Rescue.
Entering Stage 2 is not possible until 5 seconds after the flight controller boots up. This is to prevent unwanted activation, as in the case of TX/RX gear with long bind procedures, before the Rx sends out valid data.
Stage 2 Failsafe can be activated by an aux channel switch. If the switch behavior is set to STAGE2
(failsafe_switch_mode
in the CLI), Stage 2 activates immediately. Otherwise it waits until Stage 1 is complete.
When the flight controller enters Stage 2, it implements one of three (actually, four) possible Stage 2 Failsafe procedures::
- Drop, the default, causing immediate disarm and motor stop. There is a time delay before re-arming is possible
- Landing Mode, where the sticks are centered, throttle is held at a defined value, and the aux channels are set as configured for Stage 1 (which could include configuring an aux channel to enable Level mode). These settings will apply for the Landing Time (
failsafe_off_delay
period), which defaults to 1 second, but can be longer. At the end of this period, the quad will disarm (and crash). Landing Mode can be hazardous, since the motors and PIDs are active, and you cannot control where the quad goes. If the machine crashes and the props get stuck, they can burn out, though if the PID errors are bad enough, the runaway takeoff system may disarm the quad. - GPS Rescue, where, with a GPS module, the quad will transfer stick and throttle control to the GPS controller, and it will fly home and land.
- Just Disarm, a 'fourth' internal mode, which applies if the throttle has been held low for at least 10 seconds before entering Stage 2 (unless the mode is set to GPS Return). This can sometimes cause confusion when testing failsafe. Always test with throttle up at some point before the test. Its primary purpose is to force a disarm if the user powers down their radio after landing, but has forgotten to remove the lipo. This prevents the quad entering Landing Mode, for example, spinning the props up unintentionally.
If the link is restored, control will be returned to the pilot:
- in Landing Mode, when the RC signal has recovered for longer than the
failsafe_recovery_delay
period, or - in GPS Rescue Mode, when the link has returned for
failsafe_recovery_delay
and the pilot has moved the sticks more than 30 degrees out from center.
There is no way to instantly recover from Stage 2 Failsafe caused by signal loss, or from a disarm at the end of Stage 2.
At the end of the stage 2 procedure, the flight controller will disarm. The word FAILSAFE
will alternate with RXLOSS
in the warnings field.
The pilot cannot re-arm until after the failsafe_recovery_delay
period expires. All the usual arming checks apply; arming switches must be off, throttle must be zero, and if the accelerometer is enabled, the quad must be within small_angle
range.
After a failsafe disarm, if the link is restored while the Arming switch is active, the quad will not automatically re-arm itself. The OSD message NOT_DISARMED
will be shown (BAD_RX
before 4.5). The user must drop the arm switch to 'disarm' before it can be re-armed.
When Stage 2 is initiated by aux switch, recovery is immediate when the switch is reversed, unless the failsafe_switch_mode
is set to KILL
.