Diagnosing BARO Glitches in ArduPilot: A Comprehensive Guide
drone engineeringArduPilotflight logsbarometer issues

Diagnosing BARO Glitches in ArduPilot: A Comprehensive Guide

LogHat Engineering TeamJune 27, 20265 min read

Key Takeaway

Diagnosing BARO glitches is essential for ensuring stable drone flight and altitude hold.

TL;DR: To diagnose a BARO glitch in ArduPilot, look for `ERR Subsys=18 ECode=2`, indicating a barometer glitch. Address issues by checking the barometer's physical protection and airflow disruptions.

What Is a BARO Glitch in the Log?

A BARO glitch occurs when the barometer provides rapid, incorrect altitude readings, often leading to unstable flight. In ArduPilot logs, this is identified by specific error codes that indicate sensor malfunctions.

ERR Subsys  ECode  MSG  TimeUS  Inst
  • ERR Subsys: Represents the subsystem reporting the error.
  • ECode: Indicates the specific error, with ECode=2 signaling a barometer glitch.
  • MSG: Textual information about the error event.
  • TimeUS: Timestamp of the error occurrence.
  • Inst: The instance of the barometer reporting the error.
Key Takeaway: Recognizing the specific error codes in ArduPilot logs is essential for diagnosing BARO glitches effectively.

Confirming It in Mission Planner

To analyze the presence of BARO glitches in Mission Planner, follow this sequence:

  • Open Mission Planner.
  • Navigate to Flight Data.
  • Click on DataFlash Logs.
  • Select Review a Log.

Once in the log review section, plot the following fields together:

  • BARO.Alt: The altitude reported by the barometer.
  • CTUN.DAlt: The desired altitude set by the controller.
  • CTUN.CRt: The climb rate achieved.
Key Takeaway: Using Mission Planner to visualize altitude discrepancies can reveal potential BARO glitches in flight logs.

Confirming It in MAVExplorer

In MAVExplorer, you can run the following command to visualize barometer data:

MAV> graph BARO.Alt CTUN.DAlt

This plot will show the relationship between the reported barometric altitude and the desired altitude. Discrepancies between these two values may indicate a barometer malfunction.

Key Takeaway: MAVExplorer is a powerful tool for identifying discrepancies between actual and desired altitudes, aiding in BARO glitch diagnosis.

Why BARO Glitches Happened — Ranked by What We See Most Often

  1. Prop Wash Effects: Rapid changes in altitude can result from turbulence caused by the drone's own propellers. This typically occurs during aggressive maneuvers.
  2. Wind Gusts: Sudden wind gusts can affect the barometer readings, causing spikes or drops in altitude that appear in the logs.
  3. Physical Obstructions: Debris or covers blocking airflow around the barometer can lead to inaccurate readings, resulting in reported glitches.
  4. Electrical Interference: Nearby electronic devices may interfere with sensor readings, causing sporadic glitches in the barometer data.
  5. Calibration Issues: If the barometer is not calibrated correctly, it may produce erroneous readings, manifesting as glitches in flight logs.
Key Takeaway: Understanding the common causes of BARO glitches can inform preventative measures and troubleshooting techniques.

Fixes for BARO Glitches

  1. Ensure proper calibration of the barometer before each flight, using BARO_OFFSET if necessary.
  2. Check for and remove any obstructions around the barometer, ensuring unimpeded airflow.
  3. Use protective covers that allow airflow but shield the barometer from debris.
  4. Adjust EK3_ALT_M_NSE to better match environmental conditions, especially in windy areas.
  5. Install a low-pass filter on the barometer data to smooth out erratic readings.
Key Takeaway: Implementing these specific fixes can significantly reduce the likelihood of encountering BARO glitches during flight.

When This Isn't Actually a BARO Glitch

  • Rapid altitude changes may be due to turbulence rather than a sensor failure, especially in windy conditions.
  • Erratic behavior in altitude readings could stem from a faulty GPS that is incorrectly reporting altitude.
  • Problems in altitude hold may originate from PID tuning issues rather than a barometer malfunction.
Key Takeaway: Distinguishing between actual BARO glitches and other causes is essential for accurate diagnosis and remediation.

When LogHat Helps — and When It Doesn't

LogHat excels at parsing through flight logs to identify patterns related to BARO glitches, providing actionable insights for engineers. However, it does not replace the need for physical inspections and calibrations of sensors, which remain critical for accurate flight performance.

Key Takeaway: While LogHat offers valuable analytical capabilities, routine maintenance and inspection are still necessary for optimal drone performance.
What is a BARO glitch? A BARO glitch is a sudden, incorrect altitude reading caused by sensor interference.
How can I prevent BARO glitches? Use appropriate coverings and check for airflow disruptions around the barometer.
How do I identify BARO glitches in my flight logs? Look for `ERR Subsys=18 ECode=2` in your logs, indicating a barometer glitch.
What are the symptoms of a BARO glitch? Symptoms include abrupt and erratic altitude changes reported in flight logs.
How often should I calibrate my barometer? Calibrate your barometer before each flight to ensure accurate readings.
Can environmental conditions cause BARO glitches? Yes, environmental factors like wind gusts and turbulence can lead to inaccurate barometer readings.
What tools can I use to analyze my flight logs? Use Mission Planner and MAVExplorer for detailed analysis of your flight logs.

For further assistance with diagnosing BARO glitches or analyzing your flight logs, consider utilizing LogHat for in-depth insights into your drone's performance.

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

drone engineeringArduPilotflight logsbarometer issues

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