
Detecting Optical Flow Sensor Failures in ArduPilot Logs
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.LatandLng: 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
StatusagainstHDopto assess GPS quality. - Compare
Spdwith expected movement to identify discrepancies. - Examine
GCrsalongsideLatandLngfor 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
-
Improper Installation: Misalignment or incorrect mounting can lead to inaccurate readings. This often appears in logs as high
HDopvalues, indicating poor GPS quality. -
Firmware Issues: Outdated firmware may not support the latest optical flow features, resulting in unexpected behavior. Logs may show frequent
ERR Subsys=11entries. -
Hardware Malfunctions: A defective optical flow sensor can cause erratic data. This is typically indicated by erratic
SpdorGCrsvalues in the logs. -
Environmental Factors: Poor lighting or fast-moving objects can interfere with sensor performance, reflected in inconsistent
LatandLngreadings. -
Calibration Errors: Inaccurate calibration settings lead to faulty sensor outputs. The logs may show a mismatch between expected and actual
Spd.
Fixes
GPS_HDOP_GOOD = 1.4: Adjust this parameter to set acceptable HDOP thresholds.- Recalibrate the optical flow sensor according to the manufacturer's instructions to ensure accurate readings.
- Update firmware to the latest version to resolve any known bugs affecting optical flow sensor data.
- Inspect the optical flow sensor installation, ensuring it is secure and properly aligned.
- 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(below6) 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.
About the author
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
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