^{1}

^{*}

^{1}

^{2}

^{1}

This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/3.0/).

Inertial Navigation Systems (INS) consist of accelerometers, gyroscopes and a processor that generates position and orientation solutions by integrating the specific forces and rotation rates. In addition to the accelerometers and gyroscopes, magnetometers can be used to derive the user heading based on Earth's magnetic field. Unfortunately, the measurements of the magnetic field obtained with low cost sensors are usually corrupted by several errors, including manufacturing defects and external electro-magnetic fields. Consequently, proper calibration of the magnetometer is required to achieve high accuracy heading measurements. In this paper, a Particle Swarm Optimization (PSO)-based calibration algorithm is presented to estimate the values of the bias and scale factor of low cost magnetometers. The main advantage of this technique is the use of the artificial intelligence which does not need any error modeling or awareness of the nonlinearity. Furthermore, the proposed algorithm can help in the development of Pedestrian Navigation Devices (PNDs) when combined with inertial sensors and GPS/Wi-Fi for indoor navigation and Location Based Services (LBS) applications.

In the recent years, inertial sensors are becoming more popular for navigation in cluttered indoor environments that are challenging for Global Navigation Satellite Systems (GNSS). These Inertial Navigation Systems (INS), consisting of accelerometers, gyroscopes, and a microprocessor, provide position and orientation by integrating the specific forces and rotation rates. Due to the integration process, any errors in the inertial sensor data are accumulated rapidly with time, even with high accuracy sensors. Consequently, regular updates are necessary to provide a drift free position and orientation solution. For updating the position, GNSS signals are utilized, and for heading updates magnetometers may be employed.

For navigation as well as machine control applications, heading information of moving platforms is of paramount importance. Magnetometers based on Anisotropic Magneto-Resistive (AMR) technology depend upon the Earth's Magnetic Field (EMF) from which the heading information can be derived. The ubiquitous nature of EMF makes these sensors available in airplanes, vehicles, ships, and they are now being explored in hand-held devices. In order to improve the robustness of the heading solution, an optimal fusion of these sensors is justifiable [

In addition to the accelerometers and gyroscopes, magnetometers can be used to derive the user heading, by sensing the Earth's magnetic field. The magnetometer employed in this research is devoid of any drifts as observed from the Allan variance plot of the long-term static data. This, therefore, gives us the opportunity to compensate any drift from the gyroscope. Hence, we can use the magnetometer over extended periods of time, especially in magnetically stable environments. The stability of an environment is characterized by low ferrous objects, or power-line nearby the magnetometer. In dense indoor areas, the problem of navigating a user becomes even more challenging, due to the proximity to metallic objects and walls, supported by ferrous pillars.

In most of the early research, the calibration of magnetometers either accomplished in the heading domain [

Anisotropic Magneto-Resistive (AMR)

Hall Effect Sensors

Magneto-elastic Sensors

Fluxgate Sensors

Mechanical Magnetic Sensors

The sensor used in this research is based on the AMR technology and will be discussed briefly. The discussion of all other technologies is beyond the scope of this research. The magnetometer adopted in this research is a tri-axial sensor which converts any external magnetic field sensed by the sensitive axis directions to a differential voltage output. The AMR sensors are made up of thin-film Perm-alloy (nickel-iron) material, patterned as a resistive strip. When a magnetic field is applied, the element being sensitive to such fields undergoes a resistivity change, leading to a change in resistance. This disturbs the balance of the Wheatstone bridge configuration leading to a differential change in voltage output, which is proportional to the differential change in incident magnetic field. Because the output is proportional to the one-dimensional axis (principle of anisotropy) and its magnitude, additional sensor placed at orthogonal directions permit measurement of arbitrary field directions (HMC5843 data sheet).

Apart from having directionality and high sensitivity, these sensors also have a unique property called “flipping” action, associated with dipole switching due to internal magnetization in the presence of oscillating external fields. This behaviour may be exploited in eliminating undesirable DC-offsets in the presence of weak magnetic fields [

Inaccurate knowledge of noise statistics (Process Noise/state Covariance).

Matrix implementation, especially, inversion operation which may lead increased computation time and leads to singularity.

Higher heading initialization uncertainty.

Artificial Intelligence (AI)-based algorithms are considered as practical tools for nonlinear optimization problems [

In this paper we introduce a PSO-based technique for calibration of magnetometers by estimating the values of the low cost magnetometer bias and scale factor. We introduce a robust parameter estimation technique, which has its origin in AI. The method referred to here as PSO is best suited for problems of non-linear and non-Gaussian nature. This consideration also becomes important since we don't know the nature of external fields corrupting the magnetometer's signal. PSO is a better choice to circumvent all these difficulties, and is extensively employed to solve complicated design optimization problems as it can handle both discrete and continuous variables as well as nonlinear objective and constrained functions without the computation of a gradient [

Section 2 of the paper provides the mathematical background for calibration, while Section 3 has a brief discussion of particle swarm optimization technique. Section 4 describes the proposed estimator algorithm adopted in magnetometer calibration. The calibration test results with real magnetometer data are given in Section 5. The paper ends with a conclusion in Section 6.

Based on the Earth's magnetic field, the formulation can be stated by the following mathematical model [

_{x} B_{y} B_{z}^{T}

_{x}_{y}_{z}

_{x} b_{y} b_{z}^{T}

_{x}_{y}_{z}^{T}

To simplify the mathematical formulation we can ignore the white noise which is not part of the model used for calibration parameters in the estimation process, in this case,

The bias and scale factor are estimated subject to the following objective function:
_{m} is the true, reference, magnitude of the Earth's magnetic field in a given geographical location (can be obtained from the IGRF model). Every five years, a group called the International Association Geomagnetism and Aeronomy (IAGA) revise the IGRF parameters. The user is required to input the latitude, longitude and height of the place where the Earth's magnetic field intensity is sought. The 11th generation IGRF accepts the years in between 1900–2020. The accuracy of the estimated Earth's magnetic field is claimed by the IAGA to be 1 nT (0.01 mGauss).

Bird flocks, fish schools, and animal herds are examples of natural systems where an organized behaviour is successful in producing impressive, collision-free, and synchronized movements [

A promising performance is shown by swarm-based algorithms, being efficient, robust and very simple to implement [

The PSO technique employs a set of feasible solutions called a “swarm of particles” that are populated in the search space with initial random positions and velocities as shown in _{best} (_{i}_{best} (_{g}

For a swarm of ^{th}_{i}_{i1}, x_{i2}_{iD})_{i}_{i1}, v_{i2}_{iD})

_{1}_{2}_{1}_{2}

_{i1}_{i2}

^{th}_{1}, and c_{2} to be 1, 2, and 2 respectively:

The algorithm re-evaluates all particles' locations after every iteration and gets the new best values. To find the optimum value, a recurring searching process is done until the maximum iteration number is reached or the minimum error condition is achieved. The PSO general computational steps are shown as in

The proposed algorithm is used to estimate the bias (

As mentioned in Section 2 and by substituting from ^{−1})^{T}^{−1}, ^{T} λ

The value of scale factor matrix A is evaluated as the diagonal matrix of the scale factor where

The main objective of proposed technique is to estimate the values of the scale factor and bias respectively according to _{x}_{y}_{z}^{T}_{x}_{y}_{z}^{T}

In all previous work on calibration, the selection of a range of interest of the measurements is not taken in account. This might lead to inefficient calibration and increased time complexity. In order to make the calibration procedure more efficient, the appropriate range of the signal from the entire dataset is extracted and processed. The RIST is used to select the most effective part of the raw data which will be used during the calibration process. The proposed technique is searching for the maximum change in the magnetic field for each axis and gets the interval in between. The algorithm receives the overall raw measurements and returns the start and end indices of the nominated interval as shown in

RIST is important for the real time calibration which is a typical process for most of the compass calibration in a personal navigation devices or smart phones. In doing so, the calibration algorithm becomes fast, and therefore, fits the real time requirements. In order to improve upon this methodology, outlier detection may be implemented to improve the results by distinguishing between signal max/min arising out of rotation and external disturbance or noise. The trust in selecting the peak values may further be enhanced by observing the signal pattern of other sensors. These sensors might be found in the same device (e.g., gyroscopes and accelerometers), which attains a specific pattern during rotation motion as the calibration of the magnetometer requires a full rotation of the sensor on a (horizontal/vertical) plane.

The embedding of RIST into the scheme leads to less samples needing to be processed during the calibration step. As a result, the total time of the calibration process is decreased which leads to power savings for consumer devices.

The PSO algorithm is based on an iterative process to reach the optimum solution. Through this algorithm, an iterative process is conducted to estimate

Maximum number of iterations.

Hit a minimum error value.

Change in bias and scale factor values becomes less than a threshold of 0.01 for consecutive iterations.

To assess the overall performance for the proposed new calibration technique, a group of field tests were conducted at the University of Calgary campus. The tests include collecting data in static, walking, indoors and outdoors mode of operations. The collected data are the raw sensor readings from the Honeywell 3-axis magnetometer (HMC5843). The data rate of the magnetometer readings is 40 Hz with 25 ms between two consecutive epochs. For the 2-D calibration, the magnetometer was rotated 360° in the horizontal plane and then the heading was computed using the estimated SF and b. The 3-D test was conducted by rotating the device about the vertical axis followed by the horizontal axis rotation. In all tests, the algorithm successfully converges to a good estimate of the SF and b values and showed improvement in terms of heading results after the calibration.

The results are described below where the basic PSO algorithm is first applied using the entire dataset of the magnetometer measurements in the parameters estimation process. With the basic PSO there is no modification in the core of the PSO algorithm. Secondly, the effect of applying the RIST is illustrated where a range of interest of the dataset is selected to be used instead of the entire dataset as described in Section 4.2. Finally, the MPSOT is used where a significant change is applied to the core of the basic PSO algorithm.

2-D calibration tests are done by holding the PNS in the horizontal plane. The total magnetic field is calculated in the horizontal frame,

In this section, the impact of applying RIST in reducing the time required to estimate

To show the final impact of the proposed algorithm, both RIST and MPSOT are fused and applied. In such scenario, the entire dataset is applied to RIST to produce the range of interest of the dataset. Thereafter, the MPSOT is applied to reduce the number of iterations required by the algorithm to converge.

To examine the performance of the proposed technique in the 3-D calibration, six different tests are conducted. During the 3-D tests, the device is moved freely in the space. Actually, the 3-D calibration is more convenient for the user where the device shouldn't be held in the horizontal plane. The total magnetic field is calculated where the reference of the total Earth's magnetic is 560 mGauss. The algorithm receives data from the 3-axis magnetometer. The results are discussed below where it conforms to the previous discussion on the performance of the 2-D calibration.

Again,

In this paper, a PSO based calibration algorithm to estimate the values of the bias and scale factor for a low cost magnetometer is presented. In our approach, the selection of the effective range from the entire dataset is made automatic. In addition, a significant change in the core of the basic PSO algorithm is proposed to reduce the required time for the calibration process. The proposed technique has many advantages over any other conventional method such as the use of the artificial intelligence, which does not need any error modeling or awareness of the nonlinearity. The use of the RIST reduces the processing time to 40% of the time for the entire dataset while MPSOT improves the overall processing time to 35% of the time consumed by the basic PSO. The estimated bias and scale factor values from the proposed algorithm improve the overall performance of the calibration process with regard to the accuracy and time complexity. This technique would help decrease the heading errors of the users in pedestrian navigation. It can also help in the development of Pedestrian Navigation Devices (PNDs) when combined with the INS and the available RF signals, especially in indoors environments. Clearly, the fusion of the RIST and MPSOT techniques decreased the required time for the calibration process, extending the opportunity to apply the proposed algorithm in real-time applications.

This work was supported in part by research funds to Naser El-Sheimy from TECTERRA Commercialization and Research Centre, the Canada Research Chairs Program, and the Natural Science and Engineering Research Council of Canada (NSERC).

The basic PSO algorithm.

The range of interest selection technique principles.

RIST algorithm.

MPSO based calibration algorithm.

Basic PSO calibration. (

A comparison between the numbers of samples applied for magnetometer calibration in case of using the entire dataset and RIST in 2-D calibration.

A comparison between the numbers of iterations in case of using the basic PSO and MPSOT in 2-D calibration.

A comparison between the numbers of samples applied for magnetometer calibration in case of using the entire dataset and RIST in 3-D calibration.

A comparison between the numbers of iterations in case of using the basic PSO and MPSOT in 3-D calibration.

Magnetometer parameters values resulted from using the entire dataset and applying RIST in 2-D calibration. (

0.873 | 0.866 | 0.998 | 0.973 | 87.279 | 87.419 | 54.190 | 50.008 | |||

0.601 | 0.598 | 0.655 | 0.649 | 33.490 | 32.674 | 42.887 | 42.193 | |||

0.925 | 0.913 | 1.018 | 1.050 | 66.016 | 63.461 | 61.332 | 58.556 | |||

2.498 | 2.535 | 2.720 | 2.773 | 36.912 | 50.207 | 42.229 | 51.725 | |||

0.791 | 0.793 | 0.872 | 0.869 | 19.483 | 19.986 | 42.121 | 43.142 | |||

( |
( |

Magnetometers parameters resulted from using the basic PSO and MPSOT in 2-D calibration. (

0.858 | 0.863 | 0.982 | 1.027 | 85.615 | 86.025 | 50.381 | 46.695 | |||

0.597 | 0.602 | 0.649 | 0.629 | 32.659 | 29.96 | 42.003 | 43.227 | |||

0.913 | 0.911 | 1.05 | 1.049 | 63.563 | 62.955 | 58.489 | 58.503 | |||

2.534 | 2.535 | 2.773 | 2.773 | 50.356 | 50.162 | 51.822 | 51.59 | |||

0.787 | 0.775 | 0.856 | 0.859 | 18.75 | 16.295 | 40.415 | 47.76 | |||

( |
( |

Magnetometers parameters resulted from using the entire dataset and RIST in 3-D calibration. (

( | ||||||
---|---|---|---|---|---|---|

1.0371 | 1.0325 | 1.1141 | 1.0985 | 0.9394 | 0.9317 | |

1.0479 | 1.0465 | 1.1003 | 1.1014 | 0.9364 | 0.9384 | |

1.0153 | 1.0158 | 1.0895 | 1.0860 | 0.9318 | 0.9324 | |

0.9136 | 0.9249 | 0.9761 | 0.9718 | 0.8453 | 0.8541 | |

0.9286 | 0.9248 | 0.9817 | 0.9859 | 0.8368 | 0.8460 | |

0.9454 | 0.9311 | 1.0169 | 1.0167 | 0.8733 | 0.8674 |

( | ||||||
---|---|---|---|---|---|---|

38.1795 | 40.0139 | 30.8485 | 38.8051 | 135.8694 | 128.0139 | |

36.3021 | 35.7039 | 34.2721 | 33.6313 | 135.5421 | 134.6297 | |

40.3624 | 38.9419 | 37.8209 | 36.4251 | 134.4415 | 134.2701 | |

28.4165 | 16.2188 | 46.2673 | 53.2383 | 121.8317 | 114.8561 | |

34.5628 | 34.1847 | 58.8522 | 58.1043 | 129.9453 | 126.9294 | |

46.1353 | 40.1545 | 33.8024 | 37.6382 | 126.3606 | 128.5436 |

Magnetometers parameters resulted from using the basic PSO and MPSOT in 3-D calibration. (

( | ||||||
---|---|---|---|---|---|---|

1.0267 | 1.0228 | 1.1643 | 1.1334 | 0.9385 | 0.9515 | |

1.0485 | 1.0449 | 1.0994 | 1.0998 | 0.9385 | 0.9325 | |

1.0079 | 1.0082 | 1.0807 | 1.0903 | 0.928 | 0.9371 | |

0.9249 | 0.9152 | 0.9717 | 0.9868 | 0.8539 | 0.8452 | |

0.9235 | 0.9008 | 0.9812 | 0.9916 | 0.8504 | 0.8608 | |

0.9227 | 0.9276 | 1.0191 | 1.0281 | 0.8703 | 0.8644 |

( | ||||||
---|---|---|---|---|---|---|

40.0418 | 35.2361 | 8.1353 | 23.3182 | 133.0826 | 150.0231 | |

36.1018 | 25.7854 | 33.8402 | 42.4474 | 134.9986 | 130.0379 | |

33.6985 | 32.2681 | 32.9084 | 20.48 | 135.5549 | 139.0494 | |

18.5793 | 8.9173 | 51.7038 | 49.8835 | 115.2107 | 128.7535 | |

32.2353 | 33.1784 | 59.1892 | 49.9255 | 127.8947 | 126.5982 | |

38.1294 | 36.6339 | 31.4223 | 28.0506 | 130.0527 | 119.8037 |