Complementary Filter Optimal Tuning Methodology for Low-Cost Attitude and Heading Reference Systems with Statistical Analysis of Output Signal  
[PERSON]  
1 Department of Avionics and Control Systems, Rzeszow University of Technology, Powstancow Warszawy 12, 35-959 Rzeszow, Poland 12 Department of Mathematics, Lublin University of Technology, Nadbystrzycka 38, 20-618 Lublin, Poland 2  
[PERSON]  
2222  
development of high-efficiency microcontrollers, it should still be considered, particularly in the areas mentioned and similar ones. Higher computing resources increase the cost of the system and require more energy for operation. This aspect should also be considered in modern design trends. The algorithms applied should be as simple as possible to make the system more efficient. Several researchers have focused on the problems of AHRS design, with the key issue being the proper functioning of the correction system. In general, three algorithms are used: the complementary filter, Kalman filter [8], and Madgwick filter [9]. The Kalman filter [10] minimizes the estimate error variance and is commonly used. Extended Kalman filters and unscented Kalman filters are solutions that can be applied in AHRS systems. However, their disadvantage is the high computational resources they require. The complementary filter [11] is the second solution, enabling very simple correction, and due to its simplicity, it is still used in low-cost systems, e.g., [12; 13]. The third algorithm, the Madgwick filter, is gaining popularity, and it uses a gradient descent algorithm tailored to attitude estimation with quaternion algebra. Among the three algorithms mentioned, the complementary filter is the simplest. It enables accurate attitude correction and does not significantly burden the microcontroller resources. Due to its simplicity, the complementary filter appears to be a very good option. An important task is developing a methodology for tuning the complementary filter and analyzing the properties of the acquired signal. Several authors have studied the complementary filter for AHRS systems. Some researchers present results of complementary filter implementations in AHRS systems [8; 14; 15; 16; 17]; however, they do not present a direct methodology for filter synthesis. There is also research focused on the application of different forms of complementary filters. For example, Ref. [18] presents the design and implementation of an AHRS based on MEMS sensors and complementary filtering. They provide application details and results, but do not describe the tuning process in detail. The influence of the controller structure on the correction branch from the accelerometer to the static accuracy of the complementary filter is examined in [19]. The proposition of a novel complementary filter for micro-aircraft vehicles that is quaternion-based is presented in [20]. This filter enables quaternion correction using acceleration and magnetometer data. An advantage of this solution is the introduction of adaptive filter gain, which depends on the vehicle's motion. However, details of the methodology for parameter tuning are not provided. [PERSON] et al. [21] propose a robust dynamic-state detection algorithm for use with aircraft state filters using an accelerometer as a vector measurement. Complementary filter tuning is often performed using frequency-based methods, such as that shown in [22; 23]. In [24], the \(H_{\infty}\) method is used to shape complementary filters. A fuzzy logic system for tuning complementary filters is used in [25]. The mentioned methods are useful during AHRS synthesis; however, they do not minimize measurement error. This article proposes a methodology for the optimal selection of complementary filter parameters. This topic was found to be important based on the authors' experience in designing several aeronautical control and measurement systems [7; 14; 22; 26; 27; 28; 29; 30]. Pitch and roll channels are described.