Diagnosing RTL Issues in ArduPilot: A Guide Using MODE Log Messages
ArduPilotdrone troubleshootingRTL issuesflight modes

Diagnosing RTL Issues in ArduPilot: A Guide Using MODE Log Messages

LogHat Engineering TeamJune 11, 20265 min read

Key Takeaway

Diagnosing RTL issues in ArduPilot involves analyzing MODE log messages for insights.

TL;DR: To diagnose RTL issues in ArduPilot, check MODE Rsn=2 indicating a radio failsafe, MODE Rsn=4 for GCS commands, and MODE Rsn=3 for battery failsafe triggers. Note that MODE Rsn=5 indicates an EKF failsafe and does not directly imply an RTL issue. Ensure FS_BATT_ENABLE is set to 1 for RTL to be activated on battery failsafe.

What Are MODE Log Messages in ArduPilot?

MODE log messages provide critical insights into the flight mode transitions and reasons behind those transitions in ArduPilot. These messages help diagnose RTL issues ArduPilot failures.

MODE  ModeNum  Reason  TimeUS
  • ModeNum: Indicates the current flight mode.
  • Reason: Provides the reason for switching modes, such as a pilot command or a failsafe trigger.
  • TimeUS: Timestamp of when the mode change occurred.

Confirming it in Mission Planner

To access MODE log messages in Mission Planner, follow these steps:

  • Open Mission Planner and connect to your drone.
  • Navigate to Flight Data.
  • Go to DataFlash Logs.
  • Select Review a Log and choose the relevant log file.

Once inside the log review, plot the following fields:

  • MODE.ModeNum
  • MODE.Rsn
  • CTUN.Alt (for altitude context)
  • GPS.HDOP (to check GPS accuracy)

Confirming it in MAVExplorer

MAV> graph MODE.ModeNum MODE.Rsn

This command will plot the mode numbers alongside their reasons, allowing you to visualize any transitions and identify potential RTL issues. Look for unexpected transitions or patterns that could indicate a problem.

Why RTL Issues Happen — Ranked by What We See Most Often

  1. Inadequate battery voltage leading to a MODE Rsn=3 trigger. The battery voltage drops below critical levels, causing a failsafe.
  2. GPS signal degradation resulting in a MODE Rsn=5 for EKF failsafe. Poor GPS conditions can lead to inaccurate position data.
  3. Confusion with MODE Rsn=2 indicating a radio failsafe, which can disrupt expected behavior.
  4. GCS command issues logged as MODE Rsn=4. Incorrect commands sent from Mission Planner can disrupt expected behavior.

Fixes for Diagnosing RTL Issues

  1. Check the parameter FS_BATT_ENABLE is set to 1 to ensure RTL is triggered on battery failsafe.
  2. Ensure GPS_HDOP_GOOD is below 1.0 for reliable GPS performance.
  3. Inspect FS_THR_ENABLE and set it to 1 to trigger RTL under low throttle conditions.

When This Isn't Actually RTL Issue

  • Confusion with MODE Rsn=2 indicating a radio failsafe, not a GCS command.
  • Seeing a MODE Rsn=25 indicating an ADSB issue, which does not affect RTL.
  • Misinterpreting GPS glitches as an indication of RTL failure without considering other factors.

When LogHat Helps — and When It Doesn't

LogHat provides powerful tools for log analysis, helping to quickly identify and interpret MODE messages related to RTL issues. However, it cannot directly diagnose hardware failures or environmental factors affecting the drone's flight, such as GPS signal loss or battery malfunctions.

What troubleshooting steps should I take for RTL issues? Examine MODE logs for anomalies and adjust settings accordingly.
How can LogHat assist in diagnosing RTL problems? LogHat provides detailed log analysis tools for better insights.
What does MODE Rsn=4 mean in my logs? It indicates a GCS command, which may have triggered a mode change.
How can I ensure my GPS signal is strong enough for RTL? Check GPS.HDOP values, ensuring they are below 1.0 for reliable performance.
What should I do if my battery voltage is low? Adjust your parameters, particularly FS_BATT_ENABLE, to prevent RTL activation at critical levels.
What is the significance of MODE Rsn=5? This indicates an EKF failsafe, which may not necessarily mean that RTL is activated.
How can I visualize my MODE logs for troubleshooting? Use MAVExplorer or Mission Planner to graph MODE.ModeNum and MODE.Rsn.

For further assistance with log analysis and troubleshooting, consider utilizing LogHat to gain deeper insights into your drone's performance and behavior.

About the author

LE

LogHat Engineering Team

The LogHat engineering team — drone-systems engineers who build and operate the LogHat flight analytics platform. Posts in this byline are written and reviewed by team members working on the parsers, analysis engine, and Vector AI that the post describes.

Tagged

ArduPilotdrone troubleshootingRTL issuesflight modes

Try LogHat

Analyze your flight logs in seconds

Upload a .bin, .tlog, .log, or .ulg file. Get AI crash analysis, 3D replay, and forensic PDF reports instantly.

Try LogHat Free