Detecting Optical Flow Sensor Failures in ArduPilot Logs
drone engineeringArduPilotoptical flowsensor troubleshooting

Detecting Optical Flow Sensor Failures in ArduPilot Logs

LogHat Engineering TeamMarch 28, 20265 min read

Key Takeaway

Detect optical flow sensor failures by analyzing ArduPilot logs for better drone performance.

TL;DR: To identify optical flow sensor failures in ArduPilot logs, check for ERR Subsys=11 ECode=2, indicating a CPU issue related to sensor readings. The canonical fix is to inspect the optical flow sensor's installation and configuration, ensuring it is correctly calibrated.

What Optical Flow Sensor Data Actually Is in the Log

An optical flow sensor uses visual data to determine movement relative to the ground, enhancing navigation for drones. In ArduPilot logs, the relevant message for optical flow is the GPS message, which includes fields related to the sensor's performance.

GPS TimeUS I Status GMS GWk NSats HDop Lat Lng Alt Spd GCrs VZ Yaw U
  • Status: Indicates the GPS fix quality.
  • HDop: Horizontal dilution of precision; lower values indicate better accuracy.
  • Spd: Ground speed, which can be influenced by optical flow readings.
  • GCrs: Ground course, essential for understanding directional movement.
  • Lat and Lng: Latitude and longitude provide positional data.

Confirming it in Mission Planner

To analyze optical flow sensor data in Mission Planner, follow this UI path: Flight Data → DataFlash Logs → Review a Log. This will allow you to visualize relevant parameters that indicate optical flow sensor performance.

  • Plot Status against HDop to assess GPS quality.
  • Compare Spd with expected movement to identify discrepancies.
  • Examine GCrs alongside Lat and Lng for navigation accuracy.

Confirming it in MAVExplorer

MAV> graph GPS.Status GPS.HDop

This plot reveals the relationship between GPS status and horizontal dilution of precision. A Status below 6 and a HDop above 2.0 indicate potential navigation issues, often related to optical flow sensor failures.

Why Optical Flow Sensor Failures Happen — Ranked by What We See Most Often

  1. Improper Installation: Misalignment or incorrect mounting can lead to inaccurate readings. This often appears in logs as high HDop values, indicating poor GPS quality.
  2. Firmware Issues: Outdated firmware may not support the latest optical flow features, resulting in unexpected behavior. Logs may show frequent ERR Subsys=11 entries.
  3. Hardware Malfunctions: A defective optical flow sensor can cause erratic data. This is typically indicated by erratic Spd or GCrs values in the logs.
  4. Environmental Factors: Poor lighting or fast-moving objects can interfere with sensor performance, reflected in inconsistent Lat and Lng readings.
  5. Calibration Errors: Inaccurate calibration settings lead to faulty sensor outputs. The logs may show a mismatch between expected and actual Spd.

Fixes

  1. GPS_HDOP_GOOD = 1.4: Adjust this parameter to set acceptable HDOP thresholds.
  2. Recalibrate the optical flow sensor according to the manufacturer's instructions to ensure accurate readings.
  3. Update firmware to the latest version to resolve any known bugs affecting optical flow sensor data.
  4. Inspect the optical flow sensor installation, ensuring it is secure and properly aligned.
  5. Test the sensor in different environments to isolate issues caused by lighting or interference.

When This Isn't Actually an Optical Flow Sensor Failure

  • GPS issues: A low Status (below 6) can indicate poor GPS reception, not necessarily a failure of the optical flow sensor.
  • Power issues: Low battery voltage can affect sensor performance, leading to erroneous readings.
  • Flight mode changes: Switching modes can temporarily affect sensor output, which may appear as failures in logs.

When LogHat Helps — and When It Doesn't

LogHat excels at analyzing logs for patterns related to optical flow sensor performance, quickly identifying ERR Subsys=11 issues and trends in HDop. However, it cannot diagnose hardware malfunctions or installation errors directly, requiring further investigation by the user.

``` ```json { "seo_meta": { "faq": [ { "q": "What causes optical flow sensor failures?", "a": "Failures can stem from improper installation, firmware issues, or hardware malfunctions." }, { "q": "How can I analyze ArduPilot logs for optical flow issues?", "a": "Use Mission Planner to review log data, focusing on flow_x and flow_y parameters." }, { "q": "What parameters indicate optical flow sensor performance in ArduPilot?", "a": "Key parameters include Status, HDop, Spd, GCrs, Lat, and Lng." }, { "q": "How do environmental factors affect optical flow sensors?", "a": "Lighting and movement can interfere with sensor readings, leading to inaccuracies." }, { "q": "What firmware versions should I use for optimal optical flow performance?", "a": "Always use the latest stable firmware from the ArduPilot repository to ensure compatibility." }, { "q": "How can I troubleshoot optical flow sensor issues?", "a": "Start by checking installation, recalibrating the sensor, and reviewing log data for errors." } ] } }

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 engineeringArduPilotoptical flowsensor troubleshooting

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