Error Analysis of Accelerometer- and Magnetometer-Based Stationary Alignment

This paper revisits the stationary attitude initialization problem, i.e., the stationary alignment, of Attitude and Heading Reference Systems (AHRSs). A detailed and comprehensive error analysis is proposed for four of the most representative accelerometer- and magnetometer-based stationary attitude determination methods, namely, the Three-Axis Attitude Determination (TRIAD), the QUaternion ESTimator (QUEST), the Factored Quaternion Algorithm (FQA), and the Arc-TANgent (ATAN). For the purpose of the error analysis, constant biases in the accelerometer and magnetometer measurements are considered (encompassing, hence, the effect of hard-iron magnetism), in addition to systematic errors in the local gravity and Earth magnetic field models (flux density magnitude, declination angle, and inclination angle). The contributions of this paper are novel closed-form formulae for the residual errors (normality, orthogonality, and alignment errors) developed in the computed Direction Cosine Matrices (DCM). As a consequence, analytical insight is provided into the problem, allowing us to properly compare the performance of the investigated alignment formulations (in terms of ultimate accuracy), as well as to remove some misleading conclusions reported in previous works. The adequacy of the proposed error analysis is validated through simulation and experimental results.


Introduction
Inertial Navigation Systems (INSs) are specialized dead-reckoning systems which provide a standalone navigation solution for attitude, velocity, and position [1]. Like any dead-reckoning system, INSs need to comply with a generally stationary initialization procedure, which, in the specific case of the attitude, is called alignment [2,3]. The very purpose of the alignment is to roughly estimate the attitude of the vehicle (or body) frame relative to the navigation frame, so that it can be used, and posteriorly corrected, by any filtering-based navigation/guidance stage deployed afterwards [4]. As explained by Thompson,Farrell,and Knight [5], the alignment requires the observation of, at least, two noncollinear vectors, whose components should be known in both body and navigation frames. Traditionally, the local gravity and Earth rate vectors, measured by stationary accelerometers and gyros, respectively, provided by an Inertial Measurement Unit (IMU), have been chosen for INS alignment purposes [6].
Despite the recognized efficiency of the aforementioned approach, it requires high quality (navigation-grade) gyros to be employed, which are expensive and contrast with the current expansion trend toward commercial low-cost navigation applications [7]. When low-cost IMUs are sought, a good candidate for replacing the Earth rate vector (for stationary alignment purposes) is the Earth magnetic flux density vector, which can be adequately observed by calibrated magnetometers [8]. When three-axial magnetometers are incorporated into an IMU, the resulting sensor set is often referred to as Attitude and Heading Reference System (AHRS) [9,10], or yet, Magnetic, Angular Rate, and Gravity Even though the aforementioned AHRS stationary alignment approaches have been tested and validated in previous works, very little knowledge is available in the current literature about the analytic description of the residual errors remaining after the alignment or the benefits/drawbacks of each approach (from the analytical standpoint). In [46], for instance, a simplified overview of the main error sources affecting ATAN's heading determination has been provided, but no mathematical background corroborated it. In [47], the analytical description of ATAN's heading error has been proposed, as a function of the magnetometer (bias, scale factor, and cross-coupling) errors and the Earth magnetic model (declination angle) error. The drawbacks of the analysis, however, are: (a) it was only valid for two-axial (levelled) stationary AHRSs, and (b) the heading error equation was derived w.r.t. the magnetic heading, not to the true heading. Liu et al. [48] improved the aforementioned error analysis, by deriving a closed-form formula for ATAN's heading error in a three-axial (nonlevelled) stationary AHRS application. Again, the analysis was confined to the magnetic heading error, which was equated as a function of the true pitch, roll and heading angles and not as a function of the magnetometer and Earth model parameter errors (which would have been more relevant). Even more simplified (or generic) analytical descriptions of ATAN's (and QUEST's) errors can be found in [1,29,44,[49][50][51][52][53], which, however, do not provide much insight into the problem.
Apart from the above-mentioned works, most of the AHRS stationary alignment error analyses reported in the literature are solely based on numerical (simulated and/or experimental) results [54,55]. As an example, we may cite the work of Hu et al. [56], which numerically evaluated the impact of sensor cross-coupling and tilt errors in ATAN's computed heading. Včelák et al. [57,58] improved Hu's work, by also considering the detrimental effects of temperature variation. In [24,[59][60][61][62], the authors numerically investigated the azimuth errors caused by changes in the magnetic field direction (i.e., in the declination and inclination angles), as well as variations (in the magnetic field magnitude) caused by common objects (i.e., hard-iron and soft-iron magnetisms). Sotak [38], Kuga and Carrara [30], and Del Rosario, Lovell and Redmond [42], in turn, evaluated the detrimental impact of accelerometer and magnetometer biases, as well as, scale factor errors, in ATAN, QUEST, and TRIAD, respectively. Bistrov [39], lastly, numerically analyzed the effect of sensor measurement noise in ATAN's estimates. Even if the preceding numerical analyses are relevant, they are incomplete if not accompanied by a solid theoretical (analytical or stochastic) background. As a consequence, they can lead to misleading conclusions, as will be discussed throughout this paper.
To address the aforementioned issues, this paper presents an innovative and comprehensive analytical error description of four of the most employed attitude determination approaches for AHRS stationary alignment purposes, namely, TRIAD, QUEST, FQA, and ATAN. The main contribution of this paper is the derivation of novel closed-form formulae for the residual alignment errors developed in the corresponding DCM attitude solutions. For the purpose of the error analysis, errors in the accelerometers (constant biases), magnetometers (combined effect of constant biases and hard-iron magnetism), local gravity model, and Earth magnetic field model (flux density magnitude, declination angle, and inclination angle) are considered. Following the development of the closed-form formulae, a clarifying insight is provided into the AHRS stationary alignment problem, allowing us to compare the performance (in terms of ultimate accuracy) of the investigated algorithms properly, as well as to remove some misconceptions reported in previous works.
The remainder of this paper is organized as follows: Section 2 reviews TRIAD, QUEST, FQA, and ATAN algorithms. Section 3, in sequence, presents the procedures used to derive the novel closed-form formulae for the DCM residual errors, as well as the error analysis itself. Sections 4 and 5 provide results from simulated and experimental tests, respectively, whilst Section 6 concludes the paper.

AHRS Alignment Formulations
This section reviews the most representative attitude determination methods employed for AHRS stationary alignment purposes. The discussion initiates with the Three-Axis Attitude Determination (TRIAD)-based method.

TRIAD Method
As briefly mentioned in Section 1, TRIAD is able to generate an estimate of the DCM relating body and navigation frames, from the observation of two arbitrary noncollinear vectors [25]. A suitable set of vectors for AHRS alignment purposes is the g P local plumbbob gravity and the m E Earth magnetic flux density vectors. The analytical descriptions of each is straightforward in the navigation frame (In this paper, the navigation frame is represented by the superscript l and is defined with its x l , y l and z l axes pointing to the North, East and Down (NED) directions, respectively.) [1], where g P is the magnitude of the local plumb-bob gravity vector; B is the magnitude of the local Earth magnetic flux density vector; α and γ are the corresponding declination and inclination (dip) angles, respectively; and s and c stand for sine and cosine, respectively.
From (1) and (2), a third vector can be generated using the cross-product operator, Temporarily assuming that the AHRS is perfectly stationary and the accelerometers and magnetometers are uncorrupted, g P , m E and g P × m E can be resolved in the body frame (In this paper, the body frame is represented by the superscript b and is defined with its x b , y b and z b axes pointing forward, to the right-hand side and downward, all with respect to the vehicle on which the AHRS is mounted.) through the outputs of the sensors, where a SF is the specific force acceleration vector measured by the accelerometers; and m m is the total magnetic flux density vector measured by the magnetometers. The C b l DCM, relating body and navigation frames, can be equated as, with, From (7), it is obvious that, As (10) indicates, TRIAD's attitude solution is directly given in terms of DCM and only requires elementary inverse/transpose operations over the B and L triads of vector observations.

QUEST Method
QUEST has been proposed by Shuster [26] aiming at solving Wahba's problem [28]. As originally derived by Davenport [27], Wahba's optimal solution (parametrized as a quaternion) consists of finding the normalized eigenvector corresponding to the largest eigenvalue of the following matrix, with, S = R+ R T (12) where tr is the trace operator, R ij is the element of R in row i and column j, u a is an arbitrary unit vector, and w a is its associated weighting factor, subject to ∑ w a = 1.
For AHRS stationary alignment purposes, suitable unit vectors are u g = g P /|g P | and u m = m E /|m E |, which transform the latter into an optimal two vector observation attitude determination problem [63]. For this particular problem, Shuster [26] already has demonstrated that the λ max maximum eigenvalue of (11) has a closed-form solution, which is given by, with, Given λ max , the computation of QUEST's optimal quaternion (relating l and b frames) simplifies to [26], When QUEST's optimal attitude is required in terms of DCM, it suffices doing [26], (20) where q f is the first element of q b l , and (q×) is the skew-symmetric matrix representation of vector q, formed from the three last elements of q b l .

FQA Method
The idea behind FQA is that a rigid body can be placed into any arbitrary attitude by performing three sequential rotations. In this sense, the AHRS stationary alignment problem can be broken into three pieces, each consisting on the computation of a rotation quaternion.
Let us consider, initially, the q θ quaternion, which is relative to the pitch rotation. As suggested by Yun, Bachmann, and McGuee [32], q θ can be computed as, q θ = c(θ/2) 1 0 0 0 +s(θ/2) 0 0 1 0 with, s(θ/2) = sign(sθ) (1−cθ)/2 (22) c(θ/2) = (1+cθ)/2 (23) where sign() is the signum function that returns +1 for positive arguments and −1 for negative arguments. To save computational effort, sθ and cθ do not need to be computed (in (22) and (23), respectively) using trigonometric functions, but instead, where, Similar to the pitch quaternion, the q φ quaternion, relative to the roll rotation, can be computed as [32], where s(φ/2) and c(φ/2) are calculated as in (22) and (23), respectively (obviously replacing θ by φ), with, sφ = −ā y /cθ (28) The q ψ heading quaternion, lastly, is computed as follows, Once again, s(ψ/2) and c(ψ/2) are calculated as in (22) and (23), respectively (replacing θ by ψ), with, where N = [N x N y ] T is the normalized Earth magnetic flux density vector in the horizontal plane, and M = [M x M y ] T is the corresponding quantity measured by the magnetometers. As suggested by Yun, Bachmann, and McGuee [32], N and M can be calculated as follows, where m N and m E are the north and east components of (2), respectively (In the rest of this paper, scalar variables accompanied by N, E and D subscripts indicate quantities in the north, east and down directions, respectively.); and e m x and e m y are second and third components of the e m m intermediate Earth frame quaternion, computed as where ⊗ represents the quaternion multiplication operator. Once q θ , q φ and q ψ have been computed, the q l b final attitude quaternion relating body and navigation frames can be obtained by simply doing [32], When FQA's attitude solution is required in terms of DCM, it suffices doing, where q i is the i-th element of q l b .

ATAN Method
Differently from the preceding methods, ATAN directly provides an estimate of the AHRS attitude through Euler angles. Basically, the rationale for the φ roll, θ pitch and ψ heading computation comes from the solution of the following equalities, with C b l defined as [64], Substitution of (1), (4) and (40) in (38), yields, whose solution, for φ and θ, is, For the determination of the heading angle, (2), (5) and (40) can be substituted in (39), yielding, after rearrangement [1], where ψ m is the magnetic heading, i.e., the heading w.r.t. the magnetic north. As derived in [1], the solution of (44), for ψ m , is, If (42) and (43) are further substituted in (46), one has, after simplification [65], Once ψ m is obtained, and assuming α is known, ψ can be computed by direct substitution in (45). When ATAN's DCM is required, it can be computed by substituting the previously obtained φ, θ, and ψ in the transposed version of (40).

Error Analysis
Regardless of the adopted approach, all AHRS stationary alignment algorithms presented in Section 2 rely on the same assumptions: vehicle perfectly stationary, sensors uncorrupted, and external information (local gravity and Earth magnetic field models) accurately known. Obviously, none of these assumptions is satisfied in real world conditions, which means that only a corrupted estimate of the true initial attitude can be obtained.
For the analysis that follows, let us assume that the true attitude is provided in terms of the C l b DCM. Without loss of generality, we can equate the corruptedĈ l b to C l b as [66], where I is the identity matrix, and δC l b and E are two representations ofĈ l b errors. As derived in [66][67][68], the following relations hold, to first order in E, with, where η l , o l , and ϕ l are the DCM normality, orthogonality, and alignment error vectors, respectively.
To develop an innovative and comprehensive error analysis for the AHRS stationary alignment formulations presented in Section 2, we can expand their true C l b descriptions by linear perturbation technique, (52) where δx represents the error (Throughout this paper, and for the purpose of the error analysis herein presented, the errors in the investigated variables (sensor readings and gravity/Earth magnetic field model parameters) are assumed to be constant, i.e., systematic biases.) in the generic (scalar or matrix) variable x.
After analytically solving (52), for each alignment method, the result, substituted in (49), and then in (50) and (51), can be used to produce novel closed-form formulae for the DCM residual normality, orthogonality, and alignment errors. Unfortunately, for the purpose of the error analysis herein proposed, an arbitrary orientation of the body frame w.r.t. the navigation frame produces closed-form formulae which are overly complicated and not readily amenable to physical interpretation. For simplification purposes hence, hereinafter, we will assume that body and navigation frames are aligned. Figure 1 summarizes the main steps involved in the process of deriving the closed-form formulae for the residual DCM errors for each investigated AHRS stationary alignment method.

TRIAD Method
Solving (52) for TRIAD's C l b , and substituting the result (jointly with (10)) in (49) to (51), yields the following closed-form formulae for the residual errors, where t stands for tangent. As (53) to (58) indicate, residual normality and orthogonality errors are developed in TRIAD's DCM. According to Choukroun et al. [69], these errors are highly undesirable, as they collaborate to propagate errors in the vector transformation operations conducted at high computational rates (as it is the case in AHRSs). As (50) indicates, however, the normality and orthogonality errors can be estimated, to first order, uniquely from the computedĈ l b , and hence, they are easily compensated in practical implementations [70,71]. Alternatively, a more interesting application for the normality and orthogonality errors consists in using their first order estimates to produce coarse (or pseudo) estimates for some of the sensor biases. As (53) to (58) clearly indicate, there is a linear relationship between the residual η normality and o orthogonality errors, and the underlying δa accelerometer and δm magnetometer biases corrupting the alignment. By using the former (normality/orthogonality errors) as a set of "pseudo"-measurements clearly casts the set of equations (53) to (58) into a least-squares framework, for which solutions can be estimated in terms of some of the sensor biases. A similar idea has been successfully used in [72] for estimating accelerometer and gyro biases, in [73] for accelerometer and magnetometer biases and in [74] for accelerometer and dual-antennae Global Navigation Satellite System (GNSS) baseline biases.
Unlike the normality and orthogonality errors, which can be estimated and compensated, the alignment errors cannot, and hence, are of greater concern. As suggested in [75], this is due to an observability deficiency of the AHRS stationary alignment, which prevents the latter from being properly estimated (and compensated), even in posterior Kalmanfilter-based integration schemes. As (59) to (61) indicate, almost all of the investigated error sources contribute to the development of alignment errors in TRIAD'sĈ l b . It is worth noting, however, that the error terms weighed by sα tends to be less detrimental, since, as analyzed by Chulliat et al. [76], the value of α rarely exceeds ±20 deg in terrestrial applications. Despite this, caution is advised when analyzing the provided equations. In (59), for instance, even though δm z is weighted by sα, its effect on ϕ N can be very significant, especially in the presence of hard-iron magnetism. As explained by Zhang and Yang [77], this magnetism is created by nearby man-made objects (including the navigational equipment itself) and is indistinguishable from the magnetometer bias. In the error analysis presented in this paper, hence, δm represents the cumulative effect of constant magnetometer biases and hard-iron magnetism.
When the related literature is consulted, it is found that (59) to (61) also bring relevant clarifications about TRIAD's accuracy (for AHRS stationary alignment purposes). Equations (59) and (60), for instance, clearly demonstrate that the north and east alignment errors are corrupted not only by accelerometer errors, as claimed in [24,32] but also by magnetometer, gravity, and Earth magnetic field model errors. Equation (61), in sequence, demonstrates that the down alignment error is corrupted by both accelerometer and magnetometer errors, although the former are generally negligible, compared to the latter (i.e., δa/g P δm/B). None of these relations had been addressed in previous works [47,48]. Additionally, (61) provides conclusive evidence for the heading error behavior numerically reported in [59,60], according to which ϕ D seemed to vary, in magnitude, equal to the amount of the magnetic field deviation in the horizontal plane (δα).
Lastly, it is worth noting that the error terms weighted by tγ in the preceding formulae tend to be negligible at low latitudes. As the latitude increases, however, also does the value of γ, causing the residual alignment errors to be dramatically magnified (this is the main reason why the alignment is not practical near the Earth poles). Geometrically speaking, at the poles, the gravity and Earth magnetic flux density vectors become collinear, invalidating the fundamental assumption behind TRIAD.

QUEST Method
If an error analysis, similar to the one conducted for TRIAD, is developed for QUEST, i.e., if we apply (52) in (20) and substitute the result in (49) to (51), the following closed-form formulae arise for the DCM residual errors, As (62) indicates, no normality and orthogonality errors are developed in QUEST's DCM. This corroborates [67], which already had demonstrated that any quaternion parametrization of attitude, when converted to DCM, does not propagate normality and orthogonality errors (as long as the quaternion unit norm constraint is conserved). As previously mentioned, these errors are easily removed from the computed DCM, so, QUEST's ability of not generating them is only significant from the computational efficiency standpoint. Equations (63) to (65), in turn, are more relevant, as they provide analytical proof to a behavior that, hitherto, had been only numerically demonstrated [32]. As (63) and (64) indicate (in comparison to (59) and (60)), QUEST's north and east alignment errors are no longer corrupted by δa z , δg P and δB error terms, but instead, by δm x and δm y . As already explained, this may be very detrimental to be accuracy of ϕ N and ϕ E , especially in the presence of hard-iron magnetism.
Another interesting evidence from (63) and (64) is: the detrimental impact of the magnetometer biases in ϕ N and ϕ E is basically dictated by w m , which, as already defined, is the weight QUEST attributes to the magnetometer vector observations. As a general rule, the larger w m , the worse (more biased) ϕ N and ϕ E will be. While this tells us that less biased estimates could be obtained by decreasing w m , at the limit, where w m → 0, the attitude solution would become indeterminate, as only one vector (u g ) would remain being observed. These verifications are innovative and very enlightening, especially when compared to the results of other error analyses presented so far, whose results lack physical interpretation [29,53]. QUEST's down alignment error, lastly, is expected to reach the same accuracy as that of TRIAD (see (61) and (65)), which corroborates the numerical results given in [32].

FQA/ATAN Methods
Closed-form formulae for the residual errors developed in FQA's DCM can also be formulated. For this, it suffices applying (52) in (37), and substituting the result in (49) to (51). The outcomes are, As (66) indicates, no normality and orthogonality errors are developed in FQA's DCM. Again, this corroborates theory [67], as FQA's attitude solution is primarily given in terms of a quaternion. Equations (67) and (68), in turn, contrast to the conclusions of Yun, Bachmann, and McGuee [32], according to which FQA and TRIAD were said to have similar accuracies. As (67) to (69), in comparison to (59) and (61), clearly indicate, this is only true for ϕ D , as FQA's ϕ N and ϕ E are not corrupted by magnetometer errors, neither by variations in the Earth magnetic field model. Another interesting verification is that FAQ's ϕ N and ϕ E accuracies are similar to those of QUEST, for the particular scenario of w m = 0. As this would result in an indeterminate solution for QUEST, is it straightforward to conclude therefore that FQA's accuracy is globally superior to that of QUEST (and ergo, of TRIAD).
Finally, closed-form formulae for ATAN's DCM residual errors can be also derived. In this case, (42), (43), (45), and (47) are substituted in (40) and the result, used for solving (52). After substitution in (49) and (51), the conclusions are: ATAN's error equations are exactly the same as those derived for FQA (for brevity, therefore, they are not repeated here). This verification confirms the results numerically obtained in [42], according to which ATAN's north and east alignment errors proved not to be corrupted by magnetometer errors, neither by variations in the Earth magnetic field model. Since ATAN provides the same accuracy as FQA, which is, by inspection, better than TRIAD and QUEST, also ATAN is superior to the latter. From the computational efficiency standpoint, however, FQA can still be considered superior to ATAN, since, as suggested in [32], it avoids the explicit computation of trigonometric functions.

Simulation Results
To evaluate the innovative error analysis presented in Section 3, as well as the outlined verifications, a simulated test was carried out. For the purpose of the test, accelerometer and magnetometer data were generated at 100 Hz, considering the ideal scenario of body and navigation frames perfectly aligned. The accelerometers and magnetometers were purposely corrupted by 5 mg and 5 mG of constant biases, as well as by white random noises with root Power Spectral Densities (PSDs) of 0.1 mg/ √ Hz and 0.2 mG/ √ Hz, respectively. These values were chosen as they correspond to typical error parameters of automotivegrade AHRSs found in manufacturer data-sheets (see Section 5) and textbooks [1]. The sensors were simulated at latitude −23.2131 deg, longitude −45.8606 deg, and altitude 629 m. The local gravity acceleration and Earth magnetic field were calculated according to the models described in [76,78], respectively. Corresponding errors (constant biases) of 0.005 mg, 0.1 mG, 0.1 deg, and 0.1 deg were purposely added in the values of gravity, Earth magnetic flux density magnitude, declination angle, and inclination angle, respectively.
For the purpose of the test, we compared TRIAD, QUEST, FQA, and ATAN, in terms of the achieved AHRS stationry alignment accuracies. For QUEST, particularly, values of w g = 0.75 and w m = 0.25 were chosen, following the methodology suggested in [79,80]. Based on the simulated values for the sensor, gravity, and Earth magnetic field errors, the closed-form formulae derived in Section 3 were used to generate predictions for the DCM residual normality, orthogonality, and alignment errors (Table 1). Figure 2 depicts the estimated errors as function of time, where a continuous averaging of the sensor outputs has been adopted, in order to smooth the noise. Table 2 summarizes the errors estimated at the completion of the simulated test, as well as the associated standard uncertainties (The standard uncertainties represent the coverage intervals within which the true values of the estimates are expected to lie (with a level of confidence of 95%, i.e., coverage factor of 2 [81]). In this paper, the standard uncertainties have been computed by dividing the standard deviations of the estimates (characterizing their dispersion about their mean values) by the square root of the number of observations. According to [81], this corresponds to the Type A evaluation of standard uncertainty, i.e., standard uncertainties obtained experimentally, by the statistical analysis of series of observations.).   As can be seen, the estimated errors nicely agree with the predicted ones (confidence intervals experimentally obtained in Table 2 encompass the predicted values in Table 1), which validates the proposed error analysis. Figure 2a-f, in particular, indicate that only TRIAD develops normality and orthogonality errors in the computed DCM (as expected). Figure 2g,h, in turn, demonstrate that, while FQA's and ATAN's north and east alignment errors are only corrupted by accelerometer errors, those from TRIAD and QUEST also depend on magnetometer biases, as well as on gravity and Earth magnetic field model errors. In the specific case of QUEST, the north and east alignment errors are found to be further dependent on w m . Lastly, Figure 2i evidences that, as predicted, no difference exists, in terms of accuracy, between the down alignment error developed in TRIAD's, QUEST's, FQA's, and ATAN's computed DCM. Regarding the standard uncertainties of the estimated DCM errors, Table 2 clearly shows that larger (i.e., more uncertain) values are expected to exist for errors that depend on magnetometer readings (see ϕ N and ϕ E for TRIAD and QUEST, for instance). A statistical and more appropriate way of characterizing the dispersions (i.e., the standard uncertainties) of the estimated DCM errors around their predicted values is using a Monte Carlo simulation. To perform the latter, 10,000 statistically independent simulated runs (of ten seconds each) were repeated (This number of Monte Carlo runs has been chosen based on a trade-off between its ability of adequately recuperating the Probability Density Function (PDF) of the simulated noise and the computational effort. It is in agreement with previous works published in the area [19,43,50,[82][83][84], as well as with [85].), whereas the main input parameters for the simulation were allowed to vary (randomly) according to the standard deviations summarized in Table 3. The predicted and estimated DCM errors obtained at the completion of each run were saved and subtracted from one another. The mean values and standard uncertainties of the formed differences (deviations) are summarized in Table 4.  As can be seen, the mean values of all DCM error deviations (estimated minus predicted values) are close zero, indicating that the closed-form formulae derived in Section 3 are statically reliable (unbiased) estimators of the current DCM residual errors. The obtained standard uncertainties, in turn, follow the same pattern evidenced for the standard uncertainties of Table 2, i.e., closed-form formulae that are independent on magnetometer errors are expected to be less uncertain.

Experimental Results
To verify the results achieved in the simulated tests, an experimental test was conducted. The employed AHRS, namely, an automotive-grade M2 unit from Innalabs ® , was mounted aligned to the navigation frame on a semispherical three degrees of freedom (3-DOF) air bearing [86], as depicted in  To compensate the sensor data (magnetometers, in particular) for residual scale factor/cross-coupling errors and soft-iron magnetism, which are not accounted for in the error analysis presented in this paper, the latter were precalibrated using the algorithm proposed in [87]. In sequence, a stationary sample of the precalibrated data was continuously averaged over about ten seconds (producingā b SF andm b m ), and estimates for theĝ l P local gravity andm l E Earth magnetic flux density vectors were computed (using the models described in [78,88], respectively). Since, in the concerned test, the AHRS was mounted aligned to the navigation frame, the following relations held (The accuracy in these approximations is basically limited to the accuracy of the semispherical 3-DOF air bearing rotating mechanisms [86].):ā b SF ≈ −ĝ l P andm b m ≈m l E . Thus, by numerically subtracting −ĝ l P and m l E from the calibratedā b SF andm b m , respectively, coarse estimates for the residual constant biases corrupting the outputs of the accelerometers and magnetometers were obtained, namely, By substituting (70) and (71) into the closed-form formulae derived in Section 3 and also (purposely) considering the existence of errors (constant biases) of 0.005 mg, 0.1 mG, 0.1 deg, and 0.1 deg, in the values of gravity, and Earth magnetic flux density magnitude, declination angle, and inclination angle, respectively, predictions were obtained for the DCM residual errors in the experimental test (Table 5). Figure 4 presents the estimated errors as function of time, while Table 6 summarizes the errors at the completion of the experimental test alongside their standard uncertainties.   As can be noticed, the estimated errors corroborate the predicted ones, following the same pattern evidenced in the single-run simulated test. Differently from Section 4, we verify now that the confidence intervals fail to encompass all the predicted values (in general, by a very small amount). This, however, is consistent, as the predicted DCM errors were not computed based on the true (and in this case, unknown) values of the sensor biases (as done in Section 4) but instead only on the coarse estimates of (70) and (71). These results, hence, confirm the validity of the innovative error analysis proposed in this paper, as well as the outlined verifications about TRIAD's, QUEST's, FQA's, and ATAN's accuracies for AHRS stationary alignment purposes.

Conclusions
In this paper, four well established attitude determination algorithms for Attitude and Heading Reference Systems (AHRSs) stationary alignment have been reviewed, namely, the Three-Axis Attitude Determination (TRIAD)-based method, the QUaternion ESTimator (QUEST), the Factored Quaternion Algorithm (FQA), and the Arc-TANgent (ATAN) solution. A detailed and innovative error analysis has been proposed, considering the ideal assumption of body and navigation frames perfectly aligned. For the purpose of the latter, we considered errors in the accelerometer/magnetometer readings (cumulative effect of constant biases and hard-iron magnetism) and in the gravity/Earth magnetic field models (flux density magnitude, declination angle, and inclination angle). As the main contribution of this study, novel closed-form formulae for the Direction Cosine Matrix (DCM) residual errors (normality, orthogonality, and alignment errors) were analytically derived. These formulae brought analytical insight into the problem, allowing us to compare the performance of the investigated alignment formulations (in terms of ultimate accuracy) as well as to remove some misconceptions reported in previous works.
As main conclusions of this investigation, we may summarize: (a) TRIAD is the sole algorithm producing normality and orthogonality errors in the computed DCM; (b) FQA's and ATAN's north and east alignment errors are uniquely caused by yand x-axis accelerometer biases, respectively; (c) larger north and east alignment errors are expected to exist when using TRIAD and QUEST, as the latter are also function of the magnetometer biases, the inclination angle error, and the error in the Earth magnetic flux density magnitude; (d) in the specific case of QUEST, the detrimental effect of magnetometer biases in the north and east alignment errors are weighted by w m ; (e) the DCM down alignment error is the same for all investigated approaches and is mainly caused by xand y-axis magnetometer biases, as well as the declination angle error.
As suggestions for future work, the authors plan to expand their error analysis for the generic case of body and navigation frames arbitrarily oriented, which is more relevant for practical implementations. In this sense, it is found that a procedure similar to the one presented in [72,89] can be adopted. Moreover, the consideration of scale factor/cross-coupling errors (which would include misalignments and soft-iron effects for the magnetometers) also seems a topic worthy of future investigation.