
Understanding EKF Primary Changes in ArduPilot: A Log-Based Analysis
Key Takeaway
Understanding EKF primary change ArduPilot enhances your troubleshooting capabilities.
TL;DR: If you encounter an EKF primary change error logged as ERR Subsys=18, it indicates a potential issue with the filter's state. To diagnose RTL issues in ArduPilot, check the MODE Rsn values: 0 (unknown), 1 (GCS command), 2 (radio failsafe), 3 (battery failsafe), 4 (GCS failsafe), and remember that 5 signifies EKF failsafe, which is valid but not a direct cause of RTL failure.
What is an EKF Primary Change in the Log?
An EKF (Extended Kalman Filter) primary change is indicated in the ArduPilot logs as a change in the state of the filter, which can affect the stability and navigation of the drone. This log message is crucial for diagnosing issues related to the EKF's operation. The relevant log message fields include:
ERR Subsys ECode TimeUS Msg Mode
ERR Subsys: Identifies the subsystem triggering the error; for EKF changes, this is18.ECode: Specific error code, with0indicating resolved events.TimeUS: Timestamp of when the error occurred.Msg: Descriptive message accompanying the error.Mode: Current flight mode when the error was logged.
Key Takeaway: Understanding the EKF primary change logs is essential for diagnosing flight stability issues and potential RTL failures.
How to Confirm EKF Issues in Mission Planner
To confirm EKF primary changes in Mission Planner, follow these steps:
- Open Mission Planner and connect to your drone.
- Navigate to Flight Data → DataFlash Logs → Review a Log.
- Select the desired log file to analyze.
- Plot the following fields:
ERR,CTUN,GPS, andMODE.
Key Takeaway: Using Mission Planner effectively helps visualize EKF errors and correlate them with flight modes and other telemetry data.
How to Confirm EKF Issues in MAVExplorer
MAVExplorer can also be used to analyze logs for EKF primary changes. The following command will help you visualize these changes:
MAV> graph ERR.Subsys CTUN.Alt
This command will plot the EKF error subsystems against the altitude data, helping you identify any correlation between altitude changes and EKF errors.
Key Takeaway: Utilizing MAVExplorer allows for a more detailed analysis of EKF errors in relation to altitude and other key flight parameters.
Why Do EKF Primary Changes Happen?
- Sensor Data Interpretation Errors: Incorrect sensor data can lead to EKF inconsistencies, often resulting in primary changes.
- Environmental Factors: Sudden changes in environmental conditions, such as wind or temperature variations, can disrupt sensor readings and affect EKF performance.
- Physical Component Separation: Improper placement of sensors may lead to interference and erroneous data interpretation.
- Calibration Issues: Incorrect calibration of the compass and GPS can trigger EKF errors during flight.
- Firmware Bugs: Occasionally, software issues or bugs in the firmware can cause unexpected EKF behavior.
Key Takeaway: Identifying the root causes of EKF primary changes is crucial for maintaining stable flight and effective troubleshooting.
What Are the Remediation Steps for EKF Issues?
- Ensure proper calibration of the compass using
COMPASS_OFS_X/Y/Zparameters. - Verify GPS signal strength; ensure at least
6satellites are locked for reliable 3D navigation. - Check for proper sensor placement to minimize interference; ensure sensors are physically separated.
- Review and update to the latest firmware to eliminate known bugs.
- Adjust EKF noise parameters if necessary, such as
EK3_ALT_M_NSEfor altitude noise.
Key Takeaway: Following these remediation steps can significantly improve the reliability of your EKF and overall flight stability.
When This Isn't Actually an EKF Primary Change
- Logs showing
ERR Subsys=19indicate a CPU error, not related to EKF. - Inconsistent GPS readings logged as
GPS.Statusdo not directly signify EKF issues. - Barometer glitches logged as
ERR Subsys=18do not indicate EKF primary changes. - Any logs with
MODE Rsn=5indicate EKF failsafe activation, not an EKF primary change.
Key Takeaway: Distinguishing between EKF primary changes and other log messages is essential to accurately diagnose flight issues.
When LogHat Helps — and When It Doesn't
LogHat assists in identifying EKF primary changes through detailed log analysis, highlighting specific errors and their causes. However, it cannot resolve physical issues related to sensor placement or calibration errors directly; those must be addressed through hands-on inspection and adjustments.
Key Takeaway: While LogHat provides valuable insights into EKF issues, successful troubleshooting often requires physical intervention and precise calibrations.
What is EKF in ArduPilot?
EKF stands for Extended Kalman Filter, used for attitude and position estimation.
How can I troubleshoot EKF errors?
Check sensor data, physical component placements, and analyze flight logs.
What causes EKF primary changes?
Common causes include sensor data interpretation errors and environmental factors affecting EKF reliability.
How do I confirm EKF issues in Mission Planner?
Use the Flight Data → DataFlash Logs → Review a Log path and plot relevant fields.
What are the symptoms of EKF errors in logs?
Look for messages indicating ERR Subsys=18 and other related parameters.
How many satellites are needed for a reliable 3D lock?
A minimum of 6 satellites is required, with 8-10+ recommended for reliable flight.
For further analysis and to optimize your drone's performance, consider using LogHat for deeper insights into your flight logs. Our platform can help you pinpoint specific issues, enhancing your troubleshooting capabilities.
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