Biomedical Research

Research Article - Biomedical Research (2018) Artificial Intelligent Techniques for Bio Medical Signal Processing: Edition-II

A two-step self-calibration method for three-axis field sensors

Xiaoning Zhu, Ming Ma, Defu Cheng and Zhijian Zhou*

College of Instrumentation and Electrical Engineering, Jilin University, PR China

*Corresponding Author:
Zhijian Zhou
College of Instrumentation and Electrical Engineering
Jilin University, PR China

Accepted on August 30, 2017

Visit for more related articles at Biomedical Research


A self-calibration method was proposed to compensate the drawback generated by classic ellipsoid fitting algorithm. In this paper magnetometers and accelerometers were chosen to obtain geomagnetic field and gravitational field for TRIAD algorithm. The first step is using the classic ellipsoid fitting to calibrate the magnetic vector, which is taken as an internal reference in the second step. Due to the direction the geomagnetic vector and gravity vector are relatively invariant; therefore the projection of geomagnetic vector on gravitational vector is a constant value. The second step is using projection method to calibrate accelerometer. At last, both simulation and experiment were taken to prove the accuracy of the calibration method.


Self-calibration method, Three-axis field sensors, Magnetometers.


Biological systems including human beings produce extremely weak magnetic fields and the study of these systems is called Biomagnetism [1]. Magnetometers are the sensors used to detect the weak magnetic fields or changes in the magnetic fields. In medical field, highly sensitive magnetometers are required. SQUID magnetometer (superconducting quantum interference device) or SQUID sensors are mostly used in biomedical arena. They are used to detect minuscule changes in magnetic fields caused by nerve signals. This technique is called magnetoencephalography (MEG). MEG has great scope in neuroimaging, for example it can be used to map brain activity, to diagnose autism, and to study the pathological activity in epilepsy patients [2]. ECG is often used in Cardiology departments to diagnose patients with heart problems. Comparatively Magnetocardiography (MCG) offers significant improvements in diagnostic capability. MCG is efficient in reliable detection of non-ST-elevated myocardial infarction [3].

The complex cryogenic technology and relatively high cost involvement are the major limitations of SQUID magnetometers [4]. Magnetometers are calibrated using ellipsoid fitting algorithm. But ellipsoid fitting algorithm is mostly used to calibrate low cost navigation devices. They often generate unknown misalignment errors. In order to overcome the existing challenges, we propose a self-calibration method using Three-axial attitude determination (TRIAD) algorithm. TRIAD is a widely used algorithm to calculate the vehicle attitude which is an essential element of navigation. It was proposed in [5] by Shuster M D. The algorithm uses two or more non-parallel vectors which directions are known and invariant. The equation was given as below.

equation (1)


where V1 and V2 represent two reference vectors, and W1 and W2 represent the observations of them.

equation (2)

equation (3)

where A is the transformation matrix as well as the rotation matrix. Attitude could be derived from A.

So the sensors used to obtain the vectors should be calibrated before work. In the past research, under no external cases, the errors of sensors were calibrated separately with ellipsoid fitting method which is easy and effective only to low-cost navigation devices [6]. Because it leads to a drawback that unknown misalignment error was generated among the coordinates of sensors [7]. In this paper a two-step method makes the sensors aligning to each other directly and calibrates other errors simultaneously, therefore no misalignment error was generated.

The error model of magnetometer and accelerometer were described by Fong et al. in 2008 [8]. They could be expressed with the same equation.

equation (4)

where V represents the actual vector without error. U represents the measurements from tri-axial field sensor. B represents the constant error caused by hard iron and zero bias. Here K is used to represent the 3*3 matrix of kij, which is the actual calibration matrix combined by three parts as shown in Table 1.

Csf Csi Cmis
equation equation equation

Table 1. Three parts of calibration matrix.

where Csf indicates the scalar factor calibration matrix caused by the different scalar of each component. Csi indicates the soft iron calibration matrix caused by the soft iron material around the sensor. Cmin indicates the non-orthogonal calibration matrix caused by the three axes are not orthogonal to each other perfectly [9-12].


Vector observations algorithm would only make sure that vector positions are relatively fixed. In this paper a novel method was proposed to fix the first vector direction using ellipsoid fitting then calibrate the second vector based on the first one. Therefore, the coordinates of two sensors are unified.

Results and Discussion

Ellipsoid fitting calibration

Ellipsoid fitting method uses the truth that the module of vector is a constant value. Substitute the equation (4) into VTV-|V|2=0 gives,


where U is the measurements of magnetometer. Bt represents the constant error calculated from ellipsoid fitting. Where,

equation (6)

where Kt represents the calibration matrix calculated from ellipsoid fitting. When Kt is diagonally dominant, Q is a positive definite matrix. So the equation (5) is the equation represents an ellipsoid.

Then Q needs to be decomposed to obtain the calibration matrix K. But when there is an orthogonal matrix represented by R, (RKt)T(RKt) is also equivalent to Q. The number of R is countless, so the number of decomposition result is countless. In most past research to find a definite calibration matrix Kt would be assumed as particular form: upper triangular matrix, lower triangular matrix, or diagonal matrix. But the actual Kt may be not as same as all of them. Which is notable here, each result after decomposing could be converted to the same matrix by product R, i.e. K=RKt. It is notable that producing an orthogonal matrix means rotation here [13-16].

equation (7)

The equation above shows the calibration result of ellipsoid fitting. So if the form of Kt was wrongly assumed, the calibrated vector always deviates from the actual vector by a particular angle which is constant.

Constant projection calibration

After the proceeding calibration algorithm, the calibrated magnetic was rotated a constant angle from the actual geomagnetic field. The equation of the gravitational projection on magnetic vector was given as,

equation (8)

where V1 represents the pseudo vector from ellipsoid fitting algorithm. V2 represents the actual vector, Kg represents the calibration matrix from constant included angle algorithm. Then substitute the equation (8) into (9) gives,

equation (9)

The right side of the equation is a constant value.

equation (10)

Accordingly, using the outputs of tri-axial field sensor and the classic least square algorithm could obtain Kg and Bg.

Simulation: Assuming that the first vector is the geomagnetic field vector which is represented by h=(0.8 0 0.6)nT, the second vector is the gravitational field vector which is represented by g(0 0 1) m/s2. The Gaussian wideband noise of magnetometer was N~(0,0.012)nT. To verify the algorithm proposed in this paper K was set as an irregular matrix as shown in Table 2.

  Kt Bt
Magnetometer equation equation
Accelerometer equation equation

Table 2. Calibration matrix of magnetometer and accelerometer.

Here, use the Frobenius norm to evaluate the error between the matrix calculated and the matrix we set.

equation (11)

where Kg represents the calculated matrix from proposed algorithm.

The results from 10000 Monte Carlo runs were given as below. Table 3 shows the ellipsoid fitting calibration result of accelerometer. And the lower triangular matrix is the transposition of upper triangular matrix.

  Kg Bg
Upper triangular matrix equation equation
Diagonal matrix equation equation

Table 3. Calibration matrix of accelerometer from calculation.

Figure 1 shows that no matter what form that the decomposition chooses, the method proposed in this paper could obtain the calibration matrix of the second vector accurately. Then two vectors’ direction would always be relatively invariant.


Figure 1: Error of the calculated matrix Kg represented by Frobenius norm. a) Kt assumed as upper triangular matrix; b) Kt assumed as lower triangular matrix; c) Kt assumed as diagonal matrix.

Experiment: To verify the ellipsoid fitting an ADXL345 with a resolution of 10 mg and a HMC5883 with a resolution of 500 nT were used to obtain the gravitational field vector and the geomagnetic field vector. Then use a non-magnetic theodolite with three degrees of freedom to provide the attitude reference which has a resolution of 0.002°. According to the simulation results, the calibration matrix of the first vector could be assumed as arbitrate form. In this section it was assumed as diagonal matrix. Two sensors were strap-down placing on the horizontal theodolite. Then the theodolite rotated 360° around the normal direction of itself and attitude was recorded at each 5°.

Figure 2 shows the experimental result calculated from TRIAD algorithm of non-calibration, ellipsoid fitting calibration separately, and two-step calibration method. It verified the accuracy and feasibility of proposed method.


Figure 2: Accuracy of attitude using three calibration methods. A) None calibration; B) Ellipsoid fitting separate calibration; C) Proposed two-step calibration.


The drawback of ellipsoid fitting was detailed that it could induce unknown misalignment between field sensors. Then a two-step calibration method was proposed to compensate the drawback [17,18]. Magnetic vector was calibrated at first using ellipsoid fitting which is fixed and deviated from the actual magnetic field. Then gravitational vector was calibrated with projection method accurately. Both simulation and experiment proved the accuracy of proposed method.