ArduPilot switches to RTL mode mid-flight
If the drone switches to RTL on its own, a failsafe requested the mode change. You can tell which failsafe it was from the one-line warning on the screen.
You're in the air and the drone is holding a point. You haven't touched the transmitter, and you haven't pressed a button on the ground station. On the screen the mode suddenly becomes RTL, and the vehicle turns its nose toward home and leaves.
The first reflex is to cling to the transmitter. But what you need in that second is the one-line warning scrolling across the top of the screen. When the autopilot changes mode, it doesn't do it silently; it also writes the reason.
Below you'll first learn to read that line, and then, if you missed it, how to extract the same information from the flight log.
Who requested the mode change
The autopilot changes flight mode for two reasons. Either you ask for it, or a failsafe condition occurs. In the second case a short warning appears on the screen, and the first word of that warning names the source.
There are four sources: the transmitter link, the battery, the ground station connection, and the position estimate. The word at the start of the message alone tells you which one it is.
Sometimes a second part is added to the end of the message after a dash. That part explains why the autopilot deviated from the behavior in its settings. For example, if the vehicle is already landing, it continues the landing instead of returning.
Radio failsafe comes in two different ways
When the transmitter link breaks, there are two things the receiver can do, and which one it does is determined by the receiver's own setting.
- The receiver stops sending data to the autopilot entirely. If no frames arrive for a certain time, the autopilot considers the link lost. The default time is one second.
- When the receiver loses the link, it pulls the throttle channel below the normal range. The autopilot compares this value against a threshold, and if three consecutive frames stay below it, it starts the failsafe.
What separates the two paths is the decision criterion: in the first, the autopilot looks at elapsed time; in the second, at the threshold. Whichever your receiver does, you need to configure the setting accordingly.
Setting the threshold to an arbitrary number is the most common trap. If the threshold is too high, the failsafe starts without the link ever breaking, just because you pulled the throttle stick all the way down.
Where the throttle channel threshold should sit
Look at the bottom row in the figure: when the threshold rises above the throttle stick's low value, the red zone covers that point too. The right spot is between the two points, as in the top row.
A single measurement isn't enough to set the threshold. You need to check separately what the throttle channel drops to with the transmitter off, and then what value arrives with the transmitter on and the throttle stick at the bottom. The threshold sits somewhere between these two.
Why battery failsafe comes late
Radio failsafe comes almost instantly: in ArduCopter 4.7.0, the warning is on screen 0.13 seconds after the throttle channel crosses the threshold. On the battery side, a counter sits in between. It isn't enough for the voltage to drop below the threshold; it has to stay there for a while.
The default wait is ten seconds. After the voltage drops below the threshold, the warning comes 10.61 seconds later. A momentary voltage dip during a hard maneuver doesn't start the failsafe; it starts only if the pack is really empty.
From threshold crossing to warning: transmitter link and battery
Look at the distance between the two points in the figure. With battery failsafe, the moment you say "it happened suddenly" is about ten seconds after the trigger occurred. When you look at the log, you need to go back ten seconds.
Example: In the middle of a mission flight the vehicle heads home, and your teammate at the ground station says the strip reads Battery Failsafe. The last time you looked, the voltage was fine, but the warning comes ten seconds after the voltage dropped below the threshold, and you weren't looking at the screen during those ten seconds. In the log, go back ten seconds from the mode change line and you'll find the moment the voltage dropped below the threshold. The warning didn't come "suddenly."
You can see the same event on your desk
Trying this on a real vehicle means turning off the transmitter and waiting for the vehicle to actually return home. The risk is high, it's hard to repeat, and if something goes wrong you have no transmitter either.
In simulation, the same chain runs with the same software and risks nothing. You bring up a vehicle on your own computer with this command:
./arducopter -S -I0 --model + --speedup 1 --defaults copter.parm --home 37.1591,38.7969,500,0Then in a second terminal you run the monitor below. This code only listens: it writes mode changes and failsafe messages with timestamps. If you give it the telemetry port in the field, it does the same job in a real flight.
# Failsafe monitor: logs mode changes and failsafe messages with timestamps.
# For SITL use tcp:127.0.0.1:5762, in the field give a telemetry port such as /dev/ttyUSB0.
import sys, time
from pymavlink import mavutil
PORT = sys.argv[1] if len(sys.argv) > 1 else 'tcp:127.0.0.1:5762'
m = mavutil.mavlink_connection(PORT, baud=57600)
m.wait_heartbeat()
print("connected:", PORT, "sysid", m.target_system)
# Messages don't arrive unrequested; you have to ask for the stream explicitly.
m.mav.request_data_stream_send(m.target_system, m.target_component,
mavutil.mavlink.MAV_DATA_STREAM_ALL, 4, 1)
MOD = {v: k for k, v in m.mode_mapping().items()}
onceki_mod = None
onceki_arm = None
t0 = time.time()
while True:
msg = m.recv_match(blocking=True, timeout=5)
if msg is None:
continue
t = time.time() - t0
tur = msg.get_type()
if tur == 'HEARTBEAT':
mod = MOD.get(msg.custom_mode, str(msg.custom_mode))
armli = bool(msg.base_mode & mavutil.mavlink.MAV_MODE_FLAG_SAFETY_ARMED)
if mod != onceki_mod:
print("[%7.2f] MOD %-9s -> %s" % (t, onceki_mod or "-", mod))
onceki_mod = mod
if armli != onceki_arm:
print("[%7.2f] %s" % (t, "ARMED" if armli else "DISARMED"))
onceki_arm = armli
elif tur == 'STATUSTEXT':
yazi = msg.text.strip('\x00')
if 'Failsafe' in yazi or 'failsafe' in yazi or msg.severity <= 4:
print("[%7.2f] MESAJ sev=%d %s" % (t, msg.severity, yazi))With the vehicle hovering at twenty meters, if you lower the throttle channel below the threshold, these lines appear on the screen:
connected: tcp:127.0.0.1:5762 sysid 1
[ 0.00] MOD - -> GUIDED
[ 0.00] DISARMED
[ 20.98] ARMED
[ 32.90] MOD GUIDED -> LOITER
[ 47.95] MOD LOITER -> RTL
[ 47.95] MESAJ sev=4 Radio Failsafe
[ 85.99] DISARMED
[ 86.27] MESAJ sev=2 PreArm: Throttle below failsafe
[ 86.27] MESAJ sev=2 PreArm: Radio failsafe onThe key information is in the two middle lines. The mode change and the failsafe warning carry the same second timestamp. The reason for the mode change is that warning.
From message to setting
The parameters to check once you've found the first word of the warning are in this table.
| Message on screen | What happened | Parameter to check | Time to warning |
|---|---|---|---|
| Radio Failsafe | transmitter signal lost, or throttle channel dropped below FS_THR_VALUE | FS_THR_ENABLE / FS_THR_VALUE | 0.13 s |
| Battery Failsafe | voltage stayed below BATT_LOW_VOLT for BATT_LOW_TIMER | BATT_LOW_VOLT / BATT_FS_LOW_ACT | 10.61 s |
| GCS Failsafe | no heartbeat from the ground station | FS_GCS_ENABLE / FS_GCS_TIMEOUT | 5 s |
| EKF Failsafe | position or velocity variance exceeded the threshold | FS_EKF_THRESH / FS_EKF_ACTION | 1 s |
In the last column, the radio and battery rows are the time from threshold crossing to warning in ArduCopter 4.7.0. The GCS and EKF rows are parameter defaults.
Error Messages and Their Meanings
Radio Failsafe
The transmitter link was lost or the throttle channel dropped below the threshold. The autopilot switched to the behavior in its settings; the default behavior is RTL.
Radio Failsafe - Disarming
The same event happened while the vehicle was on the ground. Because it wasn't in the air, the motors were stopped instead of returning.
Radio Failsafe Cleared
The transmitter link is back. Note: the vehicle does not return to its previous mode on its own; you have to switch the mode back yourself.
Battery Failsafe
The voltage or consumed capacity crossed the threshold and the wait time expired. If your measurement line is faulty, this message also comes on a full pack.
GCS Failsafe
The regular signal from the ground station was cut. Going out of telemetry range or the ground station program freezing triggers this.
EKF Failsafe
Uncertainty in the position, velocity or compass estimate exceeded the threshold. Behind it is usually vibration or GPS quality.
PreArm: Throttle below failsafe
It comes before takeoff even happens. The throttle channel's current value is below the threshold. Either the threshold is too high or the transmitter is off.
PreArm: Radio failsafe on
Radio failsafe is still active. Bring the link back first; arming isn't allowed until the message clears.
The first three moves in the field
- Don't close the message strip. A failsafe warning passes only once, and it is the only explanation for the mode change.
- After landing, download the flight log and look at the reason for the mode change line. The reason field distinguishes a pilot command from a failsafe.
- Once you've found the source, measure that source's threshold and wait time on your own vehicle. The default values don't have to be right for your setup.
Which course includes this topic
The decision order of the failsafe chain inside the firmware, where each parameter is used, log signatures, and field cases are covered step by step in the Troubleshooting section of the course.
Course: Drone Basics: From Sensors to Flight.
Was this article helpful?
Learn this topic from start to finish
Season plan: all six courses for 9 months, ₺790 a month. ₺390 a month for high school and university students, ₺351 the first month with your member code. You can stop in any month you like. Start the Season plan · I'm a student