How to Diagnose RTL Issues in ArduPilot Using MODE Log Messages
ArduPilotdrone safetyRTL issueslog analysis

How to Diagnose RTL Issues in ArduPilot Using MODE Log Messages

LogHat Engineering TeamJune 11, 20265 min read

Key Takeaway

To diagnose RTL issues in ArduPilot, analyze MODE log messages for insights.

TL;DR: If you encounter unexpected RTL behavior, check for ERR Subsys=5 ECode=1 in your logs, indicating a radio failsafe triggered by RC signal loss. Ensure your radio settings and RTL configurations are correct to prevent issues.

What RTL Actually Is in the Log

Return-to-Launch (RTL) is a critical safety feature in ArduPilot designed to bring the drone back to its launch point in case of failure or loss of control. When RTL is triggered, specific log messages will be generated, most notably in the MODE logs. The relevant fields in the logs help to clarify the conditions under which RTL was activated.

MODE  TimeUS  ModeNum  Rsn
  • TimeUS: Timestamp of the log entry in microseconds.
  • ModeNum: Numeric representation of the flight mode (RTL is mode 3).
  • Rsn: Reason for the mode change, which can indicate how the RTL was triggered.
Key takeaway: Understanding the log fields associated with RTL helps diagnose issues effectively.

Confirming It in Mission Planner

To analyze RTL issues in Mission Planner, follow these steps:

  • Open Mission Planner and connect to your drone.
  • Navigate to the Flight Data tab.
  • Click on DataFlash Logs from the left menu.
  • Select Review a Log to open your flight log.

To effectively visualize the RTL mode changes:

  • Plot MODE.ModeNum alongside MODE.Rsn.
  • Consider adding GPS.Status to check the GPS lock state during RTL.
  • Plot ERR messages to see if any errors were logged during the flight.
Key takeaway: Using Mission Planner’s DataFlash Logs feature allows you to visualize and analyze RTL mode transitions.

Confirming It in MAVExplorer

MAVExplorer is another powerful tool for analyzing flight logs. To examine RTL events, you can use the following command:

MAV> graph MODE.ModeNum MODE.Rsn

This command will display the mode changes and the reasons for those changes throughout the flight. If you observe mode changes to RTL (mode number 3), pay attention to the accompanying reason codes to diagnose potential issues.

Key takeaway: MAVExplorer provides a straightforward way to visualize mode changes and their reasons, essential for diagnosing RTL issues.

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

  1. Radio Failsafe: Logs may show ERR Subsys=5 ECode=1, indicating a radio failsafe triggered by RC signal loss. This often leads to unintended RTL activation.
  2. GPS Glitch: When GPS.Status is below 6, it means the drone cannot achieve a reliable 3D fix, increasing the likelihood of erratic RTL behavior.
  3. Incorrect RTL Configuration: If the FS_THR_ENABLE parameter is set incorrectly, it may prevent RTL from engaging properly. Ensure this is set to 1 to enable throttle failsafe during RTL.
  4. Low Battery Conditions: When battery voltage drops below 3.3V, the drone may initiate RTL as a safety precaution. Monitoring BAT.Volt can help detect this.
  5. Incorrect Mode Transitions: If the logs indicate incorrect mode transitions, check for any MODE.Rsn values that suggest an unintended switch to RTL.
Key takeaway: Identifying the root causes of RTL issues requires careful review of log messages and operational parameters.

Fixes for RTL Issues

  1. Set FS_THR_ENABLE = 1 to enable throttle failsafe during RTL.
  2. Ensure GPS.Status is consistently above 6 for reliable operation.
  3. Check ERR Subsys=5 messages to ensure radio signal is stable; consider replacing or adjusting the receiver if needed.
  4. Monitor BAT.Volt to ensure the battery remains above 3.3V during flight.
  5. Review and adjust RTL configuration settings within Mission Planner, ensuring they align with your operational parameters.
Key takeaway: Implementing specific parameter adjustments can significantly reduce the occurrence of RTL issues in flight.

When This Isn't Actually RTL

  • Unexpected behavior during RTL may occur due to a malfunctioning GPS, which could mislead you into thinking RTL is faulty.
  • Radio signal loss (indicated by ERR Subsys=5) may cause unexpected mode changes that aren’t related to RTL activation.
  • Battery failsafe conditions might trigger RTL-like behaviors but are distinct from a proper RTL command from the autopilot.
Key takeaway: Distinguishing between true RTL issues and related anomalies helps to streamline diagnosis and troubleshooting efforts.

When LogHat Helps — and When It Doesn't

LogHat excels at providing detailed analyses of flight logs, identifying patterns related to RTL issues through error messages and mode transitions. However, it cannot directly resolve hardware issues such as radio signal problems or GPS glitches. Understanding these limitations is crucial for effective troubleshooting.

Key takeaway: While LogHat enhances log analysis, engineers still need to address underlying hardware issues to fully resolve RTL problems.
What should I do if my RTL mode does not engage?

Check your radio signal and RTL configuration settings in Mission Planner.

How can I prevent erratic behavior during RTL?

Ensure your GPS is functioning properly and that all flight parameters are correctly set.

What does ERR Subsys=5 ECode=1 indicate?

It indicates a radio failsafe triggered by RC signal loss, which may cause the drone to initiate RTL.

How can I check GPS status during a flight?

You can plot GPS.Status in Mission Planner to ensure it remains above 6 for reliable 3D lock.

What should I monitor to avoid low battery failsafe?

Monitor the battery voltage; it should remain above 3.3V throughout the flight.

Is there a way to visualize mode changes in my logs?

Yes, use MAVExplorer to graph MODE.ModeNum and MODE.Rsn for insights into mode transitions.

Can I analyze my logs with LogHat?

Yes, LogHat provides detailed analysis of flight logs, helping diagnose issues like RTL 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 safetyRTL issueslog analysis

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