Diagnosing RTL Issues in ArduPilot: A Guide to MODE Log Messages
ArduPilotdrone safetyRTL issueslog analysis

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

LogHat Engineering TeamJuly 7, 20265 min read

Key Takeaway

Diagnosing RTL issues in ArduPilot can be done by analyzing MODE log messages.

TL;DR: To diagnose RTL issues in ArduPilot, check the MODE Rsn values in your logs: Rsn=0 indicates normal operation, Rsn=1 signifies a GCS command, Rsn=2 is a radio failsafe, Rsn=3 indicates a battery failsafe, and Rsn=4 is a GCS failsafe. Note that MODE Rsn=5 indicates EKF failsafe, which does not trigger RTL unless configured to do so.

What is RTL Functionality in ArduPilot?

Return-to-Launch (RTL) is a critical feature in ArduPilot that allows a drone to autonomously return to its launch point in the event of a failsafe condition. Understanding how RTL is designed to function is essential for diagnosing any related issues. Common triggers for RTL activation include loss of signal, battery voltage drops, and manual commands from the ground control station (GCS). In this section, we'll look at how RTL is supposed to work and what can go wrong.

Key Takeaway: RTL is vital for drone safety; understanding its triggers can help diagnose issues effectively.

How to Analyze MODE Log Messages

To effectively diagnose RTL issues in ArduPilot, you need to analyze the MODE log messages. These logs provide crucial information regarding the operational mode of the drone at any point during the flight. You can access these messages via the DataFlash logs captured during flight. The relevant fields in the MODE message include:

MODE TimeUS  ModeNum  Rsn
  • TimeUS: Timestamp of the log entry in microseconds.
  • ModeNum: The flight mode number (e.g., 6 for RTL).
  • Rsn: The reason for mode change, crucial for diagnosing RTL issues.
Key Takeaway: Accessing and interpreting MODE log messages is essential for diagnosing RTL issues.

How to Confirm Mode Behavior in Mission Planner

To confirm the behavior of the drone in RTL mode using Mission Planner, follow these steps:

  1. Open Mission Planner.
  2. Navigate to Flight Data.
  3. Go to DataFlash Logs and select Review a Log.

Once in the log review section, you should plot:

  • MODE.ModeNum to confirm the mode.
  • MODE.Rsn to see the reason for mode changes.
  • CTUN.Alt to monitor altitude during RTL.
Key Takeaway: Using Mission Planner to plot MODE and CTUN values can reveal critical insights into RTL behavior.

How to Confirm Mode Behavior in MAVExplorer

MAVExplorer is another useful tool for analyzing flight logs. To check the RTL behavior, you can use a command to visualize the relevant parameters:

MAV> graph MODE.Rsn CTUN.Alt

This command will allow you to plot the Rsn values alongside the altitude data, helping you see how the drone's altitude changes during potential RTL events.

Key Takeaway: MAVExplorer can effectively visualize key parameters to confirm RTL behavior.

Common Issues Leading to RTL Failures

Understanding the common issues that may prevent RTL from functioning properly is critical. Based on our observations, here are the most frequent causes:

  1. Configuration Errors: Incorrect settings in RTL parameters, such as FS_THR_ENABLE, can lead to unexpected behavior.
  2. Signal Loss: If the drone loses connection to the GCS and FS_THR_ENABLE is not properly set, it may not trigger RTL.
  3. Battery Voltage Issues: If the battery voltage drops below the configured threshold and BATT_FS_LOW_ACT is not set to RTL, the drone may not return to launch.
  4. GPS Signal Quality: Insufficient satellites (minimum of 6 required) or high HDOP values (below 2.0) can hinder reliable navigation, impacting RTL.
  5. Incorrect Flight Mode Transitions: Unintentional transitions into other modes due to misconfigured MODE settings can disrupt the RTL process.
Key Takeaway: Identifying the most common issues leading to RTL failures can guide troubleshooting efforts effectively.

Key Fixes for RTL Issues

To address RTL issues, consider the following actionable steps:

  1. Check and configure FS_THR_ENABLE=1 to ensure RTL is triggered on signal loss.
  2. Set BATT_FS_LOW_ACT=4 to enable RTL on low battery conditions.
  3. Verify that your drone has at least 6 satellites before takeoff, aiming for 8-10+ for reliable performance.
  4. Review and adjust GPS_HDOP_GOOD to ensure it is set below 1.0 for optimal GPS accuracy.
  5. Ensure transitions into RTL mode are intentional by reviewing MODE.Rsn logs.
Key Takeaway: Implementing specific configurations can help ensure reliable RTL functionality.

When This Isn't Actually RTL Failure

Sometimes, conditions may appear to indicate RTL issues but are not related. Here are some scenarios to consider:

  • Flight mode changes due to manual piloting actions, which may not trigger RTL.
  • High vibration levels logged as VIBE.VibeX/Y/Z, which can cause instability but may not directly impact RTL.
  • Instances of ERR Subsys=18, indicating an EKF primary change, which isn't related to RTL issues.
Key Takeaway: Distinguishing between actual RTL failures and unrelated issues can prevent unnecessary troubleshooting.

When LogHat Helps — and When It Doesn't

LogHat excels in analyzing flight logs to identify patterns and potential issues related to RTL functionality. By providing visualizations and insights into specific log messages, we can help you diagnose RTL issues more effectively. However, LogHat cannot directly configure your drone's settings or resolve hardware-related issues that may impact RTL.

Key Takeaway: While LogHat provides valuable insights, it is not a substitute for hands-on troubleshooting and configuration.
What are common symptoms of RTL issues?

Symptoms include failure to return, erratic behavior during RTL, and unexpected altitude changes.

How can I improve my RTL performance?

Ensure proper configuration of RTL settings and regularly analyze log data for issues.

What causes signal loss during a flight?

Signal loss can be caused by physical obstructions, distance from the transmitter, or malfunctioning hardware.

How can I check my GPS signal strength in logs?

Look for the GPS.Status field to verify the number of satellites connected and the quality of the lock.

What does MODE Rsn=4 indicate?

MODE Rsn=4 indicates a GCS failsafe, which can trigger RTL if properly configured.

Why is HDOP important for RTL?

HDOP values help determine the accuracy of the GPS signal; lower values indicate better accuracy, crucial for reliable RTL.

If you're facing challenges diagnosing RTL issues in your drone, consider trying LogHat for advanced log analysis. Our platform simplifies the process and helps you uncover the insights you need for effective troubleshooting.

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