
Detecting Optical Flow Sensor Failures in ArduPilot Logs
Key Takeaway
Detect optical flow sensor failures in ArduPilot logs for better drone performance.
TL;DR: To diagnose ERR Subsys=16 indicating optical flow sensor failures in ArduPilot logs, look for symptoms such as drifting in loiter mode and zero readings in Mission Planner. Ensure the optical flow sensor is properly connected and update the firmware as needed. Note that although setting FS_EKF_ACTION=3 is necessary for RTL functionality, it does not provide RTL when an EKF failsafe occurs as there is no RTL option for EKF failsafe.
What Optical Flow Sensor Failures Are in the Log
Optical flow sensor failures can significantly impact a drone's navigation and stability. In ArduPilot logs, these failures are often captured under error messages indicating issues with the sensor. The relevant log message for detecting optical flow sensor failures is:
ERR Subsys=16 ECode=X
Key fields in these logs include:
Subsys: The subsystem code (16 for optical flow).ECode: The specific error code associated with the failure.TimeUS: Timestamp of the error event.
When these failures occur, the drone's ability to accurately maintain its position can be compromised, leading to erratic flight behavior. This can manifest as unintended movement during loitering or hovering, which can be particularly dangerous in confined spaces.
Key Takeaway: Monitor logs forERR Subsys=16and relatedECodevalues to identify optical flow sensor failures.
Confirming it in Mission Planner
To confirm optical flow sensor failures in Mission Planner, follow this path:
- Open Mission Planner and connect your drone.
- Navigate to the
Flight Datatab. - Go to
DataFlash Logsand selectReview a Log.
In the log review window, plot the following fields:
ERR.SubsysERR.ECodeGPS.HDOP
By visualizing these fields, you can easily correlate error events with the drone's actual performance. If your logs show frequent occurrences of ERR Subsys=16 without corresponding environmental factors affecting the GPS, this strongly indicates an optical flow sensor issue.
Key Takeaway: Use Mission Planner to plot error fields to visually confirm optical flow sensor issues.
Confirming it in MAVExplorer
In MAVExplorer, you can further analyze logs for optical flow sensor failures. Use the following command:
MAV> graph ERR.Subsys ERR.ECode
This command will display the error subsystem and code over time, allowing you to identify patterns associated with the optical flow sensor failures. Additionally, you can cross-reference these with other flight data such as altitude and speed to determine if the failures correlate with specific maneuvers or conditions.
Key Takeaway: Utilize MAVExplorer to graph error messages, helping pinpoint the timing and frequency of optical flow sensor failures.
Why Optical Flow Sensor Failures Happen — Ranked by What We See Most Often
- Loose Connections: Often, physical disconnections or poor connections result in sensor failures. Check the wiring and connectors.
- Firmware Incompatibility: Running outdated firmware can lead to compatibility issues with the sensor. Ensure your firmware is up to date.
- Environmental Interference: Optical flow sensors can have difficulty operating in low light or highly reflective environments, leading to failures. Review flight conditions to determine if they are affecting performance.
- Calibration Issues: Improperly calibrated sensors may not provide accurate readings, causing drift. Perform regular calibration checks.
- Mechanical Damage: Physical damage to the sensor due to crashes or rough handling can lead to failures. Inspect the sensor for any visible signs of damage.
Key Takeaway: Common causes of optical flow sensor failures include loose connections, firmware issues, environmental factors, and calibration problems.
Fixes for Optical Flow Sensor Failures
- Check physical connections and secure all wiring.
- Update the firmware to the latest version compatible with your optical flow sensor.
- Recalibrate the optical flow sensor to ensure accurate readings.
- Test the sensor in varying lighting conditions to rule out environmental interference.
- Inspect the sensor for mechanical damage and replace it if necessary.
Key Takeaway: Remediation steps include checking connections, updating firmware, recalibrating the sensor, and inspecting for damage.
When This Isn't Actually an Optical Flow Sensor Failure
- High
GPS.HDOPvalues can indicate poor GPS signals rather than sensor issues. Ensure you are in an area with good satellite visibility. - Other sensor malfunctions (e.g., barometer or IMU) may cause similar symptoms, so check other logs. A comprehensive view of all sensor data is critical.
- Incorrect flight modes or commands from Mission Planner could lead to unexpected behavior not related to the optical flow sensor.
Key Takeaway: Be cautious of misdiagnosing issues; confirm other sensor health before concluding optical flow failures.
When LogHat Helps — and When It Doesn't
LogHat excels at providing a comprehensive analysis of your flight logs, identifying trends and anomalies that point to optical flow sensor issues. However, it cannot perform real-time diagnostics or hardware checks. Always supplement LogHat's insights with physical inspections of your drone's sensors. For example, while LogHat can flag an optical flow sensor failure, it cannot inform you about connection issues that may be physically present.
Key Takeaway: Use LogHat for in-depth log analysis but remember to conduct physical inspections for complete diagnostics.
How can I tell if my optical flow sensor is failing?
Look for symptoms such as drifting in loiter mode and zero readings in Mission Planner. These indicators often suggest sensor issues.
What should I do if my logs show no optical flow data?
First, check the sensor connections and ensure that the firmware is compatible. Recalibrating the sensor may also be necessary.
What are the common causes of optical flow sensor failures?
Common causes include loose connections, firmware incompatibility, environmental interference, and calibration issues. Inspect your drone to ensure all components are functioning properly.
How do I update the firmware for my optical flow sensor?
Visit the manufacturer's website, download the latest firmware, and follow the installation instructions specific to your sensor model. Ensure compatibility with your ArduPilot version.
Can environmental factors affect my optical flow sensor's performance?
Yes, factors like low light and reflective surfaces can interfere with the sensor's ability to function properly. Test your drone in various environments to assess performance.
If you're experiencing issues with your optical flow sensor or need assistance analyzing your flight logs, try using LogHat for enhanced diagnostics. Visit our website for more information and to start optimizing your drone's performance.
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