Diagnosing RTL Issues in ArduPilot: A Guide to MODE Log Messages
ArduPilotRTLdrone safetylog analysis

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

LogHat Engineering TeamAugust 4, 20265 min read

Key Takeaway

You can diagnose RTL issues in ArduPilot by analyzing MODE log messages.

TL;DR: To diagnose RTL issues in ArduPilot, look for MODE Rsn=0 to MODE Rsn=4 in the logs. Ensure that FS_EKF_ACTION is not set to 2, 3, or 4, which can affect RTL activation. MODE Rsn=5 indicates an EKF failsafe but does not trigger RTL. **Ensure that FS_EKF_ACTION is set to 0 (Disabled) or 1 (Warning only) for proper RTL activation.**

What is Return-to-Launch (RTL) in ArduPilot?

Return-to-Launch (RTL) is a critical safety feature in ArduPilot that directs the drone to its launch point in case of signal loss, low battery, or other issues. Understanding how RTL interacts with various flight modes and failsafes is vital for diagnosing potential problems. During an RTL event, the drone will attempt to return to its original takeoff location, maintaining altitude and direction based on the last known position. We aim to help you diagnose RTL issues in ArduPilot effectively.

MODE Rsn  Rsn
  • MODE Rsn=0: Unknown reason for mode change.
  • MODE Rsn=1: RC command initiated mode change.
  • MODE Rsn=2: GCS command initiated mode change.
  • MODE Rsn=3: Radio failsafe engaged.
  • MODE Rsn=4: Mission end; not a failsafe mode.
  • MODE Rsn=5: EKF failsafe detected; does not trigger RTL.
Key Takeaway: RTL is a critical safety mechanism that directs the drone back to its launch point when certain conditions are met, but understanding the log messages is essential for troubleshooting.

How RTL Interacts with Flight Modes and Failsafes

RTL functionality is closely linked to flight modes and failsafe parameters. When the drone detects a critical condition, such as a low battery or loss of radio signal, it will switch to RTL automatically, provided that the RTL feature is enabled and configured correctly. The interaction between flight modes and failsafes can lead to different behaviors during an RTL event.

Key Takeaway: The effectiveness of RTL depends on proper configuration of flight modes and failsafe settings, ensuring the drone can respond appropriately to critical conditions.

Analyzing MODE Log Messages for RTL Events

To diagnose RTL issues effectively, analyzing MODE log messages is crucial. When the drone enters RTL, specific log messages will indicate the reason for the mode switch. Key log messages to look for include:

MODE  ModeNum  Rsn
  • ModeNum: Indicates the current flight mode number.
  • Rsn: Reason code for the mode change.

Each reason code provides insights into why the drone has switched to RTL, helping identify if it was a manual command, battery failsafe, or another issue.

Key Takeaway: Analyzing MODE log messages allows for an accurate diagnosis of RTL issues, revealing the underlying reasons for mode changes.

Confirming it in Mission Planner

To confirm RTL-related issues in Mission Planner, follow these steps:

  • Open Mission Planner and connect to your drone.
  • Navigate to Flight DataDataFlash LogsReview a Log.
  • Load the relevant log file.

To visualize the relevant fields, plot the following:

  • MODE.ModeNum
  • MODE.Rsn
  • CTUN.Alt
  • CTUN.DAlt
Key Takeaway: Mission Planner provides an intuitive interface to visualize MODE messages, helping identify the triggers for RTL events.

Confirming it in MAVExplorer

Using MAVExplorer, you can confirm RTL issues with the following command:

MAV> graph MODE.Rsn CTUN.Alt

This command plots the reason code for the mode change against the altitude during the flight, helping you visualize the conditions leading up to the RTL event.

Key Takeaway: MAVExplorer allows you to graph key log messages, providing insights into the conditions affecting RTL behavior.

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

  1. Low Battery: An event logged as MODE Rsn=4 indicates mission end, often related to battery failsafe.
  2. Signal Loss: MODE Rsn=3 shows the radio failsafe engaged, triggering RTL.
  3. Configuration Errors: Misconfigured parameters lead to unexpected behavior during RTL events.
  4. GPS Glitches: An ERR Subsys=11 message indicates GPS issues, affecting the ability to return home accurately.
  5. EKF Issues: If MODE Rsn=5 appears, the EKF has detected a problem but does not trigger RTL.
Key Takeaway: Understanding the common causes of RTL issues helps pinpoint problems and leads to effective troubleshooting.

Fixes for Common RTL Issues

  1. Check your battery settings: Ensure BATT_LOW_VOLT is correctly set to prevent early RTL activation.
  2. Verify GPS accuracy: Ensure a minimum of 12 satellites are connected before takeoff.
  3. Review your failsafe settings: Ensure FS_EKF_ACTION is set to 0 (Disabled) or 1 (Warning only) for proper RTL activation.
  4. Adjust GPS_HDOP_GOOD to improve GPS reliability during RTL events.
  5. Inspect configuration parameters: Confirm that all flight mode settings align with your intended RTL behavior.
Key Takeaway: Implementing these fixes can prevent common RTL issues and enhance overall drone safety.

When this isn't actually RTL

  • MODE Rsn=5 does not trigger RTL; it indicates an EKF problem.
  • MODE Rsn=4 means mission end, not a failsafe condition.
  • Signal loss does not always trigger RTL if the FS_THR_ENABLE parameter is misconfigured.
  • GPS issues may not lead to RTL if the drone is programmed to ignore weak signals.
Key Takeaway: Recognizing these conditions helps prevent misdiagnosis of RTL issues and builds trust with your analysis.

When LogHat helps — and when it doesn't

LogHat provides powerful insights into your flight logs, helping diagnose RTL issues by highlighting relevant log messages. However, it cannot directly adjust your drone’s settings or resolve hardware problems, emphasizing the need for hands-on troubleshooting.

Key Takeaway: Utilize LogHat for log analysis, but remember it cannot replace manual adjustments or hardware checks.
What should I do if my RTL is not triggering? Check your failsafe settings and ensure your RTL switch is configured correctly. Make sure the necessary conditions for RTL activation are being met.
How can I improve my drone's GPS accuracy for RTL? Ensure a clear line of sight to the sky and check your GPS module's calibration. Consider using a high-quality GPS receiver for better accuracy.
What are the common causes of RTL not engaging? Common causes include low battery voltage, misconfigured failsafe settings, and insufficient GPS satellite signals.
How can I check if my RTL configuration is correct? Review the FS_THR_ENABLE and BATT_LOW_VOLT parameters in Mission Planner to ensure they align with your desired RTL behavior.
What logs should I check for RTL diagnostics? Focus on MODE messages, especially MODE.Rsn and CTUN data for altitude information during RTL events.

For deeper insights into your ArduPilot logs and to streamline your diagnostic process, consider utilizing LogHat for comprehensive log analysis. By pairing your findings with our tool, you can gain a clearer understanding of your drone's performance and enhance safety during flights.

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

ArduPilotRTLdrone safetylog 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