DOI: 10.54287/gujsa.1939810 ISSN: 2147-9542

Proactive Magnetic Anomaly Suppression Algorithm for Robust Madgwick-Based Heading Estimation

Osman Ünal
Accurate heading estimation is critical for autonomous navigation. However, the widely utilized Madgwick filter may encounter orientation inaccuracies when subjected to environmental magnetic perturbations. This study proposes an enhanced heading estimation framework that integrates a real-time magnetic anomaly detection mechanism into the conventional Madgwick filter architecture. The proposed methodology continuously monitors the instantaneous magnetic field magnitude and inclination angle, evaluating them against threshold boundaries determined in a magnetic-interference-free environment. Upon the detection of a magnetic disturbance, the system proactively adjusts the filter’s gain parameter (β), effectively decreasing the influence of the magnetometer while increasing reliance on gyroscope data. While initial gyroscope bias is calibrated in static conditions in this study, maintaining precision over extended durations or under significant temperature variations may necessitate periodic recalibration. The algorithm was validated through eight experimental trials involving short-range navigation and rotational maneuvers under conditions of magnetic interference. Comparative analysis indicates that the proposed method demonstrates improved performance over the classical Madgwick filter, with the mean of the maximum heading errors across all trials reduced from 24.95° to 2.28°. Furthermore, the method yielded average mean error, standard deviation, and root mean square error (RMSE) values of 1.13°, 0.60°, and 1.29°, respectively. These findings indicate that the integration of an adaptive anomaly mitigation strategy yields improved accuracy in heading estimation, thereby facilitating consistent orientation tracking in environments prone to magnetic interference.