Diagnosing RTL Issues in ArduPilot: A Guide Using MODE Logs
ArduPilotRTLdrone troubleshootingMODE logs

Diagnosing RTL Issues in ArduPilot: A Guide Using MODE Logs

LogHat Engineering TeamJune 12, 20265 min read

Key Takeaway

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

TL;DR: To diagnose RTL issues in ArduPilot, check the MODE Rsn=0 through MODE Rsn=4 log messages. Ensure FS_EKF_ACTION is not set to 2, 3, or 4 to enable proper RTL functionality. MODE Rsn=5 indicates an EKF failsafe but does not trigger RTL.

What is RTL in ArduPilot?

Return to Launch (RTL) is a critical feature in ArduPilot that ensures the drone autonomously returns to its launch point under specific conditions. It can be triggered by various factors, including loss of signal or low battery. Understanding how RTL operates and the common issues associated with it is essential for maintaining safe drone operations. In this section, we will explore the key log messages related to RTL.

MODE Rsn  Reason for Mode Change
0      UNKNOWN
1      RC_COMMAND
2      GCS_COMMAND
3      RADIO_FAILSAFE
4      MISSION_END
5      EKF_FAILSAFE
  • MODE Rsn=0: Indicates an unknown reason for the mode change.
  • MODE Rsn=1: Mode switched via RC commands from the pilot.
  • MODE Rsn=2: Mode changed through GCS commands, such as from Mission Planner.
  • MODE Rsn=3: Indicates a radio failsafe was triggered.
  • MODE Rsn=4: Signifies the end of a mission, not a failsafe.
  • MODE Rsn=5: Reflects an EKF failsafe, which does not trigger RTL.
Key Takeaway: Understanding the MODE Rsn values is crucial for diagnosing RTL issues effectively.

How to Confirm RTL Behavior in Mission Planner

Mission Planner provides a user-friendly interface for analyzing flight logs and confirming RTL behavior. To check the relevant logs:

  1. Open Mission Planner.
  2. Go to the Flight Data tab.
  3. Select DataFlash Logs from the top menu.
  4. Choose Review a Log.

After loading the log, plot the following fields:

  • MODE: To visualize mode changes throughout the flight.
  • CTUN.DAlt: Shows desired altitude during the flight.
  • CTUN.Alt: Displays actual altitude to monitor descent.
  • CTUN.CR: Achieved climb rate to detect anomalies.
Key Takeaway: Use Mission Planner to visualize critical log data that indicates RTL behavior during the flight.

How to Confirm RTL Behavior in MAVExplorer

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

MAV> graph MODE Rsn CTUN.Alt CTUN.DAlt

This command will help you visualize the mode changes alongside the actual and desired altitudes during RTL events. By examining these plots, you can quickly identify whether the drone transitioned into RTL mode successfully and whether it maintained the correct altitude throughout the process.

Key Takeaway: Utilizing MAVExplorer can provide detailed insights into RTL performance by comparing mode changes with altitude data.

Why Do RTL Issues Occur in ArduPilot?

Diagnosing RTL issues requires understanding the common causes that can lead to failures. Here are the most frequent reasons for RTL problems:

  1. GPS Signal Loss: If the drone loses GPS signal, it may not trigger RTL properly. A GPS.Status value of 0 or 1 indicates no lock.
  2. Incorrect Configuration: Parameters such as FS_EKF_ACTION must be set correctly for RTL to activate. Values 2, 3, or 4 prevent RTL.
  3. Low Battery: If battery levels drop below the configured failsafe threshold, the drone may initiate RTL or land unexpectedly.
  4. Radio Failsafe: When the signal is lost, the drone might switch to a failsafe mode instead of RTL, indicated by MODE Rsn=3.
  5. EKF Issues: An EKF failure, shown by MODE Rsn=5, can disrupt RTL functionality.
Key Takeaway: Being aware of the causes of RTL issues helps in effectively diagnosing and addressing them.

How to Fix RTL Issues in ArduPilot

If you encounter RTL issues, consider the following remediation steps:

  1. Ensure adequate GPS reception with at least 6 satellites for a 3D fix.
  2. Check the FS_EKF_ACTION parameter and set it to 0 (Disabled) or 1 (Warning only) to allow RTL activation.
  3. Review battery failsafe settings, ensuring BATT_LOW_VOLT and BATT_CRT_VOLT are configured correctly.
  4. Inspect the radio link quality to ensure a reliable connection between the drone and the ground control station.
  5. Verify that no EKF errors are present in the logs, which may require tuning the EKF parameters.
Key Takeaway: Implementing specific configurations and checks can significantly improve RTL reliability in ArduPilot.

When This Isn't Actually RTL Issues

Sometimes, diagnosing RTL issues can lead to misinterpretation of other conditions. Here are some scenarios that may look like RTL problems but are not:

  • Loss of GPS signal without a failsafe trigger can confuse the operator.
  • Battery failsafe triggering a landing instead of RTL, indicated by MODE Rsn=4.
  • Unexpected mode transitions due to pilot input or GCS commands that might not have been recognized.
Key Takeaway: Distinguishing actual RTL issues from other operational anomalies is essential for accurate diagnosis.

When LogHat Helps — and When It Doesn't

LogHat is designed to provide detailed insights into flight logs, helping users pinpoint issues like RTL failures effectively. By analyzing the logs, we can identify trends and root causes of RTL problems. However, LogHat cannot replace the need for thorough configuration checks and real-time monitoring of flight conditions. Users must still validate settings in their ground control software to ensure optimal performance.

Key Takeaway: LogHat enhances log analysis but doesn't eliminate the need for comprehensive pre-flight checks and settings validation.
What are the common causes of RTL failure in ArduPilot?

Common causes include incorrect configurations, GPS signal loss, low battery levels, and radio failsafe activations.

How can I use MODE logs to troubleshoot my drone?

Analyze the logs for specific parameters that indicate failures or abnormal behavior, such as MODE Rsn and altitude data.

What parameters affect the RTL behavior in ArduPilot?

Key parameters include FS_EKF_ACTION, GPS satellite count, and battery failsafe settings.

How can I ensure my drone triggers RTL correctly?

Check GPS signal quality, ensure proper configuration of failsafe parameters, and validate battery levels before flight.

What should I do if my drone does not return to launch?

Investigate the flight logs for MODE Rsn values and ensure no GPS or battery issues were present during the flight.

For further analysis and support, consider utilizing LogHat for your flight logs. Our platform allows you to draw insights from your flight data effectively.

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 troubleshootingMODE logs

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