Professional Documents
Culture Documents
Calibration
Calibration
vector. Such a surface can be easily illustrated by recording a three channels data from the vector magnetometer while rotating it in 3D. Figure 1 shows the ideal apex sphere for an ideal sensor.
Figure 1: Spherical surface for calibrated vector sensor It can be easily seen that vector sensor with errors will have an ellipsoidal apex surface. From (1) it is obvious that diagonal elements of matrix A are responsible for ellipsoid main axes length, o-diagonal elements are responsible for the orientation of ellipsoid and elements of b matrix for the transfer of ellipsoid centre. Figure 2 shows an example of such ellipsoid.
For the three-axial accelerometer the diagonal elements of matrix A represent the scale factors, o-diagonal elements - the axis misalignment, and the elements of b matrix - zeros biases. For the vector magnetometer the elements of matrices A and b are represent Poison coecients: A responsible for soft-iron eects and b for the hard-iron ones.
(2)
It can be easily seen that the problem of nding the optimal set of A and b matrices coecients, that will minimize the dierence between measured vector module and desired calibrated module (which in our case is equal to 1 both for the accelerometer and magnetometer) is similar to curve-tting problem done by non-linear LSQ. Let us consider practical example of vector magnetometer calibration using non-linear LSQ and Matlab environment with lsqcurvef it function, that uses Levenberg-Marquardt algorithm. First we need data set, recorded while vector magnetometer was rotated in 3D several times. Figure 3 shows the apex trajectory of measured vector. Figure 4 shows the module of measured magnetic eld during calibration rotation.
Figure 3: Apex trajectory of uncalibrated magnetometer Its obvious from the above gures that sensor is far from being perfectly calibrated and will inevitably cause signicant errors to the AHRS output angles. 3
Applying Matlabs lsqcurvef it or other non-linear LSQ computational routine one can estimate coecients of error model. From the gures 5 and 6 one can see that scalar non-linear LSQ, batch approach to the calibration of vector magnetometer enables eective estimation of this sensors error model. Same results can be obtained for the three-axis accelerometer.
0.85
0.8
0.75
0.7
0.65
20
40
60
120
140
160
180
uncalibrated calibrated
0.5
0.5
0.5
20
40
60
120
140
160
180
(3)
As long as the estimated components of the state are assumed to be constant, the system equation is the following expression: X=0 (4)
Kalman Filter measurements for the scalar calibration case are dened as the dierence between desired eld module (assumed to be 1 here) and measured led module, so the measurement function is dened to be: z = h(X) h(X) =
2 2 2 C1 + C2 + C3
(5)
C1 = (ax Axx + ay Axy + az Axz + bx ) C2 = (ax Axy + ay Ayy + az Ayz + by ) C3 = (ax Axz + ay Ayz + az Azz + bx ) Above equation is a non-linear function of state vector, so we will use an Extended Kalman Filter. Jacobean matrix for the measurement equation is dened as: h H= X H = D1 D2 D3 D4 D5 D6 D7 D8 D9 (6) D1 = D4 = D7 =
mx C1 , 2 2 2 C1 +C2 +C3 my C1 +mx C2
D2 = D5 = D8 =
my C2
D3 = D6 = D9 =
Thus, having dened both state and measurement equation, the standard set of discrete Kalman lter equations can be employed to estimate calibration coefcients: T Pk = Fk Pk1 Fk + Qk
Xk = Fk Xk1 T T Kk = (Pk Hk )/(Hk Pk Hk + Rk ) + Xk = Xk + Kk (zk h(Xk )) + Pk = Pk Kk Hk Pk
trace(P)
10
log(trace(P))
10
10
10
10
20
40
60
120
140
160
180
Figure 7: Evolution of covariance matrix trace during estimation process It can be readily seen from above two pictures that EKF calibration of vector magnetometer provides an ecient way to interactive calibration of one aboard of moving object given sucient amount of attitude modulation.
1.6 1.4 1.2 1 Coefs value 0.8 0.6 0.4 0.2 0 0.2
Pz0
20
40
60
120
140
160
180
3 Conclusion
Two approaches to the scalar calibration of vector sensor was presented. Batch approach is based in non-linear LSQ and provides an ecient and robust procedure of calibration. EKF-based recursive estimation is especially eective when one needs to calibrate sensor, especially magnetometers aboard of moving carrier.