Skewed-redundant Hall-effect Magnetic Sensor Fusion for Perturbation-free Indoor Heading Estimation

Robust attitude and heading estimation with respect to a known reference is an essential component for indoor localization in robotic applications. Affordable Attitude and Heading Reference Systems (AHRS) are typically using 9axis solid-state MEMS-based sensors. The accuracy of heading estimation on such a system depends on the Earth’s magnetic field measurement accuracy. The measurement of the Earth’s magnetic field using MEMS-based magnetometer sensors in an indoor environment, however, is strongly affected by external magnetic perturbations. This paper presents a novel approach for robust indoor heading estimation based on skewedredundant magnetometer fusion. A tetrahedron platform based on Hall-effect magnetic sensors is designed to determine the Earth’s magnetic field with the ability to compensate for external magnetic field anomalies. Additionally, a correlation-based fusion technique is introduced for perturbation mitigation using the proposed skewed-redundant configuration. The proposed fusion technique uses a correlation coefficient analysis for determining the distorted axis and extracts the perturbationfree Earth’s magnetic field vector from the redundant magnetic measurement. Our experimental results show that the proposed scheme is able to successfully mitigate the anomalies in the magnetic field measurement and estimates the Earth’s true magnetic field. Using the proposed platform, we achieve a Root Mean Square Error of 12.74° for indoor heading estimation without using an additional gyroscope.


I. INTRODUCTION
Attitude and heading estimation is one of the fundamental requirements for robotics, human machine interaction, and navigation in indoor environments [1]- [3]. The ability of self-localization for autonomous systems (e.g., unmanned aerial vehicles, mobile robots) or prediction of head motion for teleportation or virtual reality applications [4], [5], similarly, crucially depend on the reliable estimation of attitude and heading angles [6]- [8]. The result of camera-based or LiDAR-based SLAM systems, for instance, becomes more reliable by utilizing robust attitude and heading information which can be attained mainly from an Attitude and Heading Reference System (AHRS) or an Inertial Measurement Unit (IMU) [9]- [11]. The main difference between an AHRS in contrast to the IMU is the preprocessing of the sensory data in order to provide absolute orientation estimation with respect to the Earth's geometrical characteristics. The known reference of AHRS comes from the Earth's gravitational and *Preprint Version-Accepted article in the 4th IEEE International Conference on Robotic Computing. 1   magnetic field. In this regard, attitude estimation refers to the angular measurement on the vertical plane, with respect to the local level frame, and is computed as inclinations. Similarly, angular measurement on the horizontal plane, with respect to the geographical true north, is referred as heading angle (also known as yaw or azimuth) [12].
Affordable AHRSs are typically using small-scale sensors based on Micro-Electro-Mechanical Systems (MEMS). The MEMS-based sensors have the advantages of low cost, low power consumption, and high update rate. A general 9-DoF AHRS consists of a 3-DoF accelerometer, a 3-DoF gyroscope, and a 3-DoF magnetic field meter. Exploiting the complementary nature of the MEMS-based inertial sensors, 3-DoF accelerometers along with 3-DoF gyroscopes are mainly fused for attitude estimation [13]. Similarly, the MEMS-based AHRSs are mostly using a single 3-DoF magnetometer to measure the magnetic field strength and utilizing the previously determined relative calibration values to extract the Earth's geographic azimuth. In practice, the azimuth estimation from the magnetometer is fused with the gyroscopes to provide more stable heading estimation. Nonetheless, the general accuracy for heading estimation on such a AHRS highly depends on the Earth's true magnetic field measurement.
Determining error-free and reliable heading estimation with respect to a known reference is problematic in case of indoor applications. This is mainly because of different sources of errors in the MEMS-based magnetometer mea-surements [14]- [17]. The most dominant source of error for such a magnetometer sensor, however, is the interference of the external magnetic field in an indoor environment. Permanent magnets and ferromagnetic materials are the main cause of such a magnetic perturbation. In this regard, calibration of the MEMS-based magnetometers for heading estimation has been investigated thoroughly during the last decades [14], [18]. Probabilistic models for sensor calibration and fusion such as the Unscented Kalman Filter (UKF), the Extended Kalman Filter (EKF), and Ellipsoid Fitting are well known in this field [19]- [22]. However, dynamic magnetic deviation caused by external anomalies cannot be fully compensated using the sensor calibration methods. To overcome the aforementioned problem, redundant sensor systems have shown promising results as they are using redundant measurements to determine the source of error and increase the estimation accuracy [23]- [25].
Multiple magnetometers in combination with gyroscopes were used to approximate the external magnetic disturbances and to provide perturbation-free heading estimation [24], [26]- [28]. In these works, the authors used an estimation of the expected magnetic field using the temporary rotation vector to compensate the external magnetic perturbation. These approaches need a precise and simultaneous calibration of the magnetometers and the gyroscopes to be able to provide an acceptable heading estimation. In [29], a magnetic heading compensation method for disturbances introduced by near-surface interference was proposed. The authors used inverse magnetic anomaly vector estimation to compensate for the external perturbation. The main limitations of this approach are the predefined magnetic field model and onedimensional perturbation mitigation. In general, these approaches are usually bulky, expensive, and often rely on expensive calibration procedures. Nonetheless, it has been shown that the accuracy of the magnetic field measurement is significantly improved by using redundant magnetometer sensors [30]- [33]. However, the non-deterministic errors cannot be completely removed in real application scenarios due to their transient nature. This is mainly because of limitations in the system identification procedure, non-linear dynamic errors, and the use of strict calibration models. The skewed-redundant inertial sensor fusion, on the other hand, provides more reliable output, as shown in [34]- [37]. The skewed axes configuration for redundant sensor geometry has been widely investigated for attitude estimation by applying this method on accelerometers and gyroscopes. However, this method has been poorly investigated for the redundant magnetometers.
Inspired by the success of redundant integrated sensors for processing high-dimensional sensor data [24], [26], [38], and the benefits of redundant, non-orthogonal sensor structures [38]- [41], we propose a skewed-redundant magnetometer platform for perturbation-free heading estimation. The approach adopted in this paper relies on the use of redundant sensor information to enhance the overall performance of the heading estimation while at the same time ensuring the integrity of the system. Unique non-orthogonal placement , , of the triple 3-axis magnetometer is designed based on the Hall-effect sensors principle in order to mitigate the external magnetic perturbation by extracting the distracted signals. The proposed approach uses a correlation-based sensor fusion method for external magnetic perturbation mitigation and robust heading estimation (Fig. 1). The skewedredundant magnetometer platform and correlation-based filter and fusion strategy shows substantial improvement in heading estimation accuracy in an indoor environment. In the following, our contributions can be summarized as: • We introduce a skewed-redundant magnetometer platform based on the Hall-effect magnetic sensor principle in order to mitigate the external magnetic perturbation. • We propose a filter model based on correlation analysis and investigate the proposed platform for reliable estimation of the Earth's magnetic field. • Moreover, we validate our approach by means of using the proposed setup in an indoor environment to prove its general validity. In contrast to the naive approach or KF-based fusion, we show its superior performance, where no perturbation compensation is applied.

II. MAGNETIC FIELD COMPONENTS AND HEADING ESTIMATION USING MAGNETOMETERS
A combination of a 3-axis gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer is typically used in lowcost AHRS sensors. The estimated angles are defined as the corresponding Euler angles roll (α), pitch (β ), and yaw (γ). In order to improve the robustness of the roll and pitch estimation, the measurements provided by the gyroscope and accelerometer are typically fused. The magnetometer, on the other hand, can be complemented using the gyroscope for heading estimation. Heading estimation with respect to a known reference can be performed by considering the fact that solid state magnetometers are used for measuring changes in the strength of the Earth's magnetic field. Dominant technologies for the solid state MEMS-based magnetometers are based on the Hall-effect or the Magneto Resisting effect [17], [42]. Given that the magnetic field is a vector field, it is defined either by its components along the coordinate axes or by its magnitude and direction. A sensor with at least three axes is required to determine the Earth's magnetic field vector (Fig. 2). In a Cartesian coordinate system at the measurement point p, the magnetic field vector B p can be defined as where the x-axis is oriented along the geographical meridian, and the direction to the north is positive, the y-axis along the parallel with positive direction toward the east and the z-axis is directed downward. The observation point p is the origin of the measurement coordinate system. The angle I between the horizontal plane and the vector B p is called the inclination [43]. The local magnetic declination D, sometimes called magnetic variation, is the angle between the magnetic north and the true north. Accordingly, the Earth's geographic azimuth ψ p can be derived by considering the local declination D and the perpendicular components of the measurement vector B p as The magnetic field of a dipole, similarly, is characterized by its magnetic moment M. This field's intensity and direction depends not only on the magnitude of the magnetic moment, but also on its orientation relative to the magnetic field's position [43]. In the presence of multiple dipoles, the magnetic field M g is defined by the sum of all magnetic moments M i and is given by The curl of the magnetic vector potential, the magnetic field B p , is governed by the density of magnetic moments at the measurement point and is derived classically using the Biot-Savart law [44]. The combined field can change the measurement field vector B p due to the presence of multiple dipoles. This change in the magnetic field is the leading cause of heading errors in an indoor environment. As shown in Fig. 3, the effect of the external magnetic field on the p-type Hall element depends highly on the orientation and the distance of the external magnetic moment to the perpendicular sensing axis [45]. Moreover, a minimum number of three Hall elements perpendicular to each other is required to determine the magnetic field B p as it is shown in Eq. 1. This implies that the measuring axis with the lowest angle to the external magnetic anomaly will report a non-correlated measurement compared to the other axes. Additionally, in a perturbation-free environment, the norm of the magnetic field vector measurement should be equal to the magnitude of the Earth's magnetic field. This norm, H p can be extracted from the Earth's geomagnetic model [46]. The aforementioned principles are the main motivation of proposing the skewed-redundant magnetometer platform (see Fig. 1).

III. SKEWED-REDUNDANT MAGNETOMETER PLATFORM
A significant outcome in [13] is that an ideal setup of redundant inertial sensors in terms of fault tolerance is a "skewed" configuration in which the delicate axes of each triaxial sensor are not aligned and transformations are  performed to align them in a virtual coordinate frame. This method has been examined on inertial sensors such as accelerometers as well as gyroscopes and showed a significant improvement in the measurement accuracy [34], [36], [37]. Following the concept of the skewed-redundant inertial sensor, we propose a skewed-redundant magnetometer platform and analyse its performance.
From the sensor data, it is observable that the perpendicular axis to the external magnetic anomalies can be affected dramatically. The pattern of this change in the data is recognizable, and this motivates us to examine different mounting structures with redundant magnetometers. It is difficult to determine which configuration yields the great overall performance given that the large variety of viable arrangements makes it challenging to derive a deterministic relation between the configuration parameters and the system errors. We investigated more than ten different configurations and analyzed the data to determine for which of them the external disturbance is perceivable by considering the minimum number of axes and the coverage orientation. The skewed configuration in comparison to the orthogonal structures showed better results. Using a tetrahedron skewed configuration [47], we recorded the data shown in Fig. 4, which illustrates that the axis which has the minimum angle difference to the source of the external magnetic perturbation, reports uncorrelated output while the other axes of the magnetic measurements are less impacted.
To determine the Earth's true magnetic field, we consider the measured magnetic field as a combination of the external magnetic perturbation and the Earth's magnetic field. Taking Eq. 3 into consideration, the measured magnetic field B Q in the sensor frame with center point ℑ can be defined as where B ε ℑ is the external magnetic field disturbance and B E ℑ is the local Earth's magnetic field. To have all the true signals in the measurement point p, sensor data needs to be aligned to a defined virtual coordinate frame with the center point p. Additionally, we normalize the measured magnetic field vector to be able to use the correlation analysis later for sensor filtering and fusion. We can define B Q p,k for each sensor k using where R p ℑ,k is the Direction Cosine Matrix (DCM) with respect to roll (α), pitch (β ), and yaw (γ) angles. The angles roll, pitch, and yaw are the representative rotation of the 3axis magnetometer from the sensor coordinate frame with the center point ℑ around the virtual coordinate frame with the center point p. Based on the skewed configuration, the proposed structure with the mounting angles is depicted in Fig. 5. A rotation matrix can be defined for an individual sensor k according to the static angles using Similarly, Table I shows the extracted Direction Cosine Matrix from the generic rotation matrix defined in Eq. 6 for each of the three sensors in the tetrahedron skewed-redundant platform.

IV. SKEWED-REDUNDANT MAGNETOMETER FUSION
The main source of magnetometer errors are the sensor offsets, scale factor, non-orthogonality, and magnetic deviation [24], [48], [49]. The latter is based on the magnetization characteristics of the sensor and can have a static or dynamic source. The static magnetic deviation error consists of softand hard-iron parts. In this paper, we are not going to the details of the sensor hard-iron and soft-iron calibration procedure. We assume the measured magnetic field B Q p,k is calibrated by using the method described in [14]. Additional to the static magnetic deviation error which can be addressed by applying the offline calibration, the dynamic magnetic deviation error is still problematic and subsists as the most dominant error source. The proposed multi-magnetometer fusion, therefore, uses dynamic weighting based on the normalized correlation coefficient analysis to filter the axes affected by the external disturbance. This mitigates the external dynamic magnetic field perturbation and allows for the estimation of the true Earth's magnetic field. Let us define the true Earth's magnetic field vector B F p as where n = 3 is the number of sensed magnetic field vectors that are transformed to the measurement point p in the skewed-redundant multi-magnetometer setup, S p,k is the scale factor of the sensor k, b p,k is the bias vector, W p (t) is the white noise vector, M k represent the skew-symmetric misalignment matrix and J k is the adaptive correlation-based identity dynamic weighting matrix. We use the general definition of the S p,k and M k for the proposed magnetometer sensor setup from [31], and [25]. It should be noted that separating all components of the encountered errors for the magnetometer platform requires unique setups (e.g., turning tables) and is hard to accomplish. However, this is not essential in the case of the MEMS-based sensors because some error elements predominate and the error model can, therefore, be simplified [50], [51].
The biases b p,k are approximated for each 3-axis magnetometer sensor and can be defined as where b C k are the constant components of the bias vector and can be extracted from sensor design characteristics, b RC k is the stochastic process with maximum constant value which is extracted from the hard-iron calibration procedure and having the distribution b RC is a firstorder Gauss-Markov stochastic process applied on the sensor constant bias estimation. Constant biases of the sensors are extracted from the standard deviation of the measurements considering that each measurement is a discrete sample measurement at t [52].
where ζ = 1/T is the inverse of the correlation time with the initial condition and E k (t) is a zero-mean Gaussian white-noise process which is applied on the sensor constant bias vector. We denote the finite bandwidth of the respective magnetometer data by ∆ f , which can be calculated from the auto-correlation function as expressed in [53]. The Nyquist-Shannon sampling rate equals 2∆ f which is equal to two samples per period T . Hence, defining T /2 as the correlation time, the Nyquist sampling rate ζ is equal to the inverse of the correlation time. The b RW k (t) is a random walk stochastic process defined aṡ with the initial condition b RW k (t 0 ) = 0. The b BI k (t) are the bias instabilities which were added to the original model developed in [30] and [54] to describe more precisely the noise characteristics observed for the skewed-redundant magnetometer platform (see Fig. 5). We use the same definition of the proposed bias instabilities vector as in [30]. The white noise process W p,k is defined as where σ w w,k are the standard deviation of the measurements. The fixed parameters (i.e., the constant components of the scale factors) and bias vector components were estimated with a classical least-squares parametric compensation. The remaining parameters were estimated with variance analysis techniques, as explained in [30] and [55].
The adaptive correlation-based identity dynamic weighting matrix J k , which is used for identifying the external pertur- bation using the correlation analysis is defined as while the individual component of the dynamic weight vector ω k is defined as the correlation between each axis and the corresponding axes measuring the same direction of the magnetic field in the virtual measurement point p. For the triple measurement, we can define while the normalization term in the identity weighting matrix for the number of n sensors can be defined from all the corresponding axes using Eventually, the joint correlation coefficient ρ between the current axis measurement η and the two similar nonorthogonal axis a and b, which are rotated using the R p ℑ,k from the measurement sensor frame with the center point ℑ to a virtual frame with the center point p, can be calculated by while ε is usually taken as a small value to prevent dividing by zero. The last λ t (i.e., t = 100ms at 100Hz sensor sampling rate system a queue that considers the last 10 observations) sets of the measured data have been considered for the joint correlation calculation. In other words, a queue with a size of λ t is used for calculating the average in the correlation calculation. Based on the basic concept of the Pearson correlation coefficient [56], r χ 1 ,χ 2 between two sensor measurements (i.e., the measurement η and a in Eq (14)) can be defined as in an indoor environment using the MAVI robot platform [57].
while the Pearson correlation coefficient is a measure of the linear correlation between two variables χ 1 and χ 2 and has a quality between -1 and +1, in which 1 is total affirmative linear correlation, 0 isn't any linear correlation, and -1 is total negative linear correlation. Further, the average values χ 1 and χ 2 are calculated from the last λ t sets of the measured data. Lastly, considering Eq. 7, and taking the B F p as a magnetic field vector, the heading estimation can be extracted from Eq. 2.

V. EXPERIMENTAL RESULTS
We designed a skewed-redundant magnetometer sensor platform and used the described correlation-based fusion to estimate the true Earth's magnetic field in an indoor environment. To evaluate the proposed method and mitigate the external magnetic field perturbation, a tetrahedron configuration is utilized and the azimuth angle estimation has been performed using the proposed fusion approach. We designed a 3D printed frame for mounting the sensors in a skewedredundant structure. The designed sensing platform consists of three 3-axis AK8963C magnetometer sensors from Asahi Kasei Microdevices Corporation. The sensors are located on the planar surface of the 3D printed tetrahedron frame as shown in Fig. 6.
In order to evaluate the heading estimation and data recording, we used two different setups: one is a stationary platform mounted on an absolute rotary shaft encoder which can be rotated while providing the absolute orientation, and the second is the mobile robot platform MAVI [57] with the ability of self-localization using Inertial-LiDAR fusion (Fig. 7). In the first scenario, the computed heading from the turning encoder on a static table is used as a reference to assess the performance of the proposed method. We consider the offset of the heading reference that is calculated from the absolute shaft encoder to the Earth's true magnetic heading using the Earth's magnetic model [46]. The proposed fusion method has been tested in multiple scenarios portraying different magnetic configurations artificially introduced by permanent magnets or ferromagnetic materials. The comparison with the heading direction estimated from the raw and Kalman filtered data is shown in Table II. We used all the nine axes of the skewedredundant magnetometer for the Kalman filter, but only one axis has been considered for naive heading estimation in the experiments. The result of the heading estimation (Fig. 8) using the correlation-based fusion shows the improvement and robustness in the presence of the external magnetic field anomaly. We achieved a RMSE of 12.74°in an indoor environment by using only the skewed-redundant magnetometer data fusion with no help of the gyroscopes. We also tested the proposed system in a large outdoor area with no additional permanent magnet or ferromagnetic material presence in the near surroundings. The result of this experiment shows that the output of the proposed fusion algorithm with no external disturbances provides a similar heading estimation accuracy as the Kalman filter approach. Furthermore, all the results are validated on an internally recorded dataset in our lab with more than 1.2 million sample sets which are encountered with and without external magnetic anomalies.
Additionally, we used the MAVI platform to perform a heading estimation using the Inertial-LiDAR localization system and used it as a reference for error calculation of the heading estimation in a diverse indoor environment. The experiment was conducted using a predefined trajectory followed by the MAVI platform while the estimated heading of the localization system is compared with the proposed fusion approach. In all the tests, the offset of the heading in the starting moment has been set to zero. As shown in Fig. 9, the average error encountered within the different environments is variable. This is caused by the changes in the external magnetic anomalies. The fluctuations observed for various indoor environments in the processed probability distributions indicate that the influences of magnetic disturbances on heading estimation are highly reliant on the construction of the building and surroundings. Although the  external anomalies were diverse from magnetic characteristics in tested indoor environments, the average error for azimuth estimation within these tests shows the reliability of the proposed approach.

VI. CONCLUSIONS
In this paper, we proposed a skewed-redundant magnetometer fusion approach for robust heading estimation in an indoor environment. We provided a description of heading estimation using the Earth's magnetic field and the different sources of perturbation for heading estimation in the presence of the external magnetic anomalies. We showed the principle of the Hall-effect magnetic sensors and analyzed the source of the external magnetic field on a 3-axis MEMS-based magnetic sensors. Inspired from the skewed-redundant configuration, we designed a tetrahedron platform using triple 3-axis magnetometer in order to detect and mitigate the magnetic perturbations. In order to filter the sensory data and mitigate the external disturbances, we proposed a correlationbased fusion approach for multi-magnetometer platforms. We further investigated the suggested method in different indoor environments and validated the algorithm using the internally recorded dataset. Additionally, experiments using a mobile robot platform have been conducted in diverse scenarios to verify the generality of the proposed fusion method by means of robust heading estimation using the skewed-redundant magnetometer platform.
We intend to use a deep neural network in future work to improve the quality of the measurement. Additionally, in cases where there is a constructive disturbance along with changes in user dynamics, the perturbation mitigation approach will be further enhanced to take into account the uncertainty between perturbation and agent motion. Furthermore, the effect of the number of the sensing axes on the estimation of the true Earth's magnetic field needs to be studied using analytical models.