13.07.2015 Views

An attitude error correction method based on MARG ... - Jocpr.com

An attitude error correction method based on MARG ... - Jocpr.com

An attitude error correction method based on MARG ... - Jocpr.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________In this paper, <strong>MARG</strong> (Magnetic, <str<strong>on</strong>g>An</str<strong>on</strong>g>gular Rate, and Gravity) sensor array c<strong>on</strong>sisting of MEMS three-axis gyroscope,accelerometer and magnetometer are used to capture three-dimensi<strong>on</strong>al accelerati<strong>on</strong>, magnetic field and angularvelocity. Based <strong>on</strong> steepest descent <str<strong>on</strong>g>method</str<strong>on</strong>g> and <strong>com</strong>plimentary filter theory, we propose to use ground magnetic andgravity field observati<strong>on</strong>s to correct the <str<strong>on</strong>g>attitude</str<strong>on</strong>g> <str<strong>on</strong>g>error</str<strong>on</strong>g> of the gyroscope. Our proposed algorithm is denoted as<strong>MARG</strong> algorithm. To evaluate the performance of the proposed algorithm, we carry out gyro/accelerometer/magnetometer integrated navigati<strong>on</strong> simulati<strong>on</strong> experiment and <strong>MARG</strong>/turntable experiment. Experimental resultsindicate superior performance of our <str<strong>on</strong>g>method</str<strong>on</strong>g> over the traditi<strong>on</strong>al Quaterni<strong>on</strong> extended Kalman filter (QKF) <str<strong>on</strong>g>method</str<strong>on</strong>g>.PROPOSED <strong>MARG</strong> LGORITHMAttitude angle of the rotated carrier can be represented by rotati<strong>on</strong> quaterni<strong>on</strong>. The parameters of quaterni<strong>on</strong> can besolved by minimizing the <str<strong>on</strong>g>error</str<strong>on</strong>g> functi<strong>on</strong> of quaterni<strong>on</strong>. Steepest descent <str<strong>on</strong>g>method</str<strong>on</strong>g> is an ideal iterative algorithm forminimizati<strong>on</strong> which was first introduced by Cauchy in 1847. It can find the local minima of an objective functi<strong>on</strong>and is widely explored in engineering applicati<strong>on</strong>s since it has the advantages of small workload, memory efficientand easy to implement [4]. The search path of the steepest descent <str<strong>on</strong>g>method</str<strong>on</strong>g> appears to be serrated. In the first a fewsteps, the objective functi<strong>on</strong> decreases rapidly. When it approaches the local minima, the c<strong>on</strong>vergence speedbe<strong>com</strong>es slow. Usually steepest descent <str<strong>on</strong>g>method</str<strong>on</strong>g> is used with other techniques for fast c<strong>on</strong>vergence. Based <strong>on</strong>steepest decent algorithm and <strong>com</strong>plementary filter theory, we propose an <str<strong>on</strong>g>attitude</str<strong>on</strong>g> <str<strong>on</strong>g>error</str<strong>on</strong>g> <str<strong>on</strong>g>correcti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>method</str<strong>on</strong>g> by fusinginformati<strong>on</strong> from different sensors. The block diagram of the proposed <str<strong>on</strong>g>method</str<strong>on</strong>g> is shown in Fig. 1.Fig. 1: Block diagram of proposed <str<strong>on</strong>g>method</str<strong>on</strong>g>The discrete functi<strong>on</strong> of body rotati<strong>on</strong> quaterni<strong>on</strong> and angular velocity can be expressed asq qˆ q t,(1)b b bn w, t n est , t1 n w,twherebb t is the sampling interval,nq w,tis the quaterni<strong>on</strong> at time t ,n ,q is the rate of change of quaterni<strong>on</strong>.bq ˆn [ q q q q1 2 3 4]is the rotati<strong>on</strong> quaterni<strong>on</strong> from navigati<strong>on</strong> coordinate system n to body coordinate system b.n ˆ bd [0 d d d ] and sˆ [0 s s s ] represent the measurement of accelerometer and magnetometerx y zx y zin the navigati<strong>on</strong> coordinate system and body coordinate system, respectively. The quaterni<strong>on</strong> <str<strong>on</strong>g>error</str<strong>on</strong>g> functi<strong>on</strong> isdefined as follows:f ( q, dˆ, s) q dˆ q s.(2)b n b b * n b bˆ ˆ ˆ ˆ ˆn n nThe <str<strong>on</strong>g>error</str<strong>on</strong>g> functi<strong>on</strong> can be solved using steepest descent <str<strong>on</strong>g>method</str<strong>on</strong>g> in (3) and (4).w t523


Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________f ( qˆ, dˆ, sˆ)q qˆ , k 0,1,2... nf ( q , d, sˆ)b n bb b n kn k1n kb ˆn kn ˆ b(3)b nˆ ˆ b T b n( , , ˆ) ( ˆ , ˆ b n) ( ˆ , ˆ bf q d s J q d f q d, sˆ)(4)n k n k n kWherein indicates step size, f indicates gradient of the objective functi<strong>on</strong>, and J is the Jacobian matrix. Inthe beginning, the carrier is in still state, the measurements of accelerometer and magnetometer aren gˆ [0 0 0n2 2bˆ [0 b 0 b ] [0 h h 0 h ]x z x y z1] and, respectively. After some arbitraryb b b * qˆ mˆ qˆnnbbchanges in <str<strong>on</strong>g>attitude</str<strong>on</strong>g>, the measurements be<strong>com</strong>e aˆ [0 a a a ] and mˆ [0 m m m ]x y zrespectively. Then, objective functi<strong>on</strong> f and its Jacobian matrix can be formulated as ,x y z2( q q q q ) a2 4 1 32( q q q q ) a1 2 3 4 y1 2 2ˆ 2(2 q2 q3) ab n b n bzˆ ˆ ˆ ˆg, b( n, , , , ) 2 22 bx (0.5 q3 q4 ) 2 bz ( q2q4 q1q3) mxf q g a b mandJ qˆgˆbˆ 2 b ( q q q q ) 2 b ( q q q q ) m2 b ( q q q q ) 2 b (0.5 q q ) mx 2 3 1 4 z 1 2 3 4 y2 2x 1 32 4z23z2q 2q 2q 2q3 4 1 22q 2q 2q 2q2 1 4 30 4q4q0b n n2 3g,b( n, , ) .2bz q3 2bzq4 4bxq3 2bzq1 4bxq4 2bzq22bxq4 2bzq2 2bxq3 2bz q1 2bxq2 2bzq4 2bx q1 2bzq32bxq3 2bxq4 4bzq2 2bxq1 4bzq3 2bxq2x(5)(6)Substitute (5) and (6) to (3) and (4) can obtain the rotati<strong>on</strong> quaterni<strong>on</strong> at time t asqfqˆ .fb bn , t n est , t1t(7)The step size tcan be obtained viabt nqw, tt, 1,(8)whereb t is the sampling interval,nq , tis the quaterni<strong>on</strong> for angular rate measured by gyroscope, is a c<strong>on</strong>stantdetermined by the measurement noise of accelerometer and magnetometer. The rotati<strong>on</strong> quaterni<strong>on</strong> calculated in (1)and (7) respectively can be fused using <strong>com</strong>plementary filter algorithm asq q (1 ) q ,0 1,(9)b b bn est , t t n , t t n w,t t524


Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________bbwherenq , trepresents quaterni<strong>on</strong> solved using angular rate andnq , trepresents quaterni<strong>on</strong> solved using steepestdescent <str<strong>on</strong>g>method</str<strong>on</strong>g>. are weights which satisfy the following equati<strong>on</strong>. and (1 )t tt(1 t) tt(10)Assume is large, (9) be<strong>com</strong>esq qˆ q t(11)b b bn est , t n est , t1 n est , tˆbby substituting (8) to (10).nqest , t 1is the rotati<strong>on</strong> quaterni<strong>on</strong> at time 1qˆchange for rotati<strong>on</strong> quaterni<strong>on</strong>, andn , tbf ft , b b bˆnqest, tnqw, t nq , tis the rate ofis the <str<strong>on</strong>g>error</str<strong>on</strong>g> caused by measurement noise. Proporti<strong>on</strong>al gain and integral gain can be calculated using (12) and (13) with indicating the zero drift of gyroscope,indicating the drift rate , and ˆq being an arbitrary quaterni<strong>on</strong>.1 3 qˆ 0 2 (12)41 3 qˆ [0 ] (13)2 4RESULTSSIMULATION AND RESULTTo evaluate the performance of our proposed <strong>MARG</strong> algorithm, we carried out four simulati<strong>on</strong> experiments. EKFalgorithm is used for <strong>com</strong>paris<strong>on</strong>. We design a track generator following the procedure as described in [12] and adda triaxial magnetometer emulator.The variance of random noise of the gyroscope is set to 10 /h . The variance of the first-order Markov processnoise is set to 4 /h with time durati<strong>on</strong> of 1h. The variance of the first-order Markov process noise is set to 10 -4 gwith time durati<strong>on</strong> of 2h for the accelerometer. The variance of the first-order Markov process noise is 100nt withtime durati<strong>on</strong> of 1h. The sampling rate of the <strong>MARG</strong> sensor array is 100Hz.Picard angle increment <str<strong>on</strong>g>method</str<strong>on</strong>g> is used to obtain the quaterni<strong>on</strong> for the track generator. The calculated <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angleis the same as the ground truth.Fig. 2 shows a <strong>com</strong>paris<strong>on</strong> between the calculated <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angle using <strong>MARG</strong> algorithm with additi<strong>on</strong>al noise andthe ground truth. From the figure, we can see that the calculated value begins to deviate the true value after 20s withadditi<strong>on</strong>al noise added to the simulati<strong>on</strong>. With the simulati<strong>on</strong> time progresses, the <str<strong>on</strong>g>error</str<strong>on</strong>g> increases. The average <str<strong>on</strong>g>error</str<strong>on</strong>g>is over 10°. We can c<strong>on</strong>clude from the experiment that noise has a significant influence <strong>on</strong> the results. However,<strong>MARG</strong> sensors inevitably subject to measurement noise and envir<strong>on</strong>ment noise in real applicati<strong>on</strong>. Therefore,measurement data filtering is necessary before calculating the <str<strong>on</strong>g>attitude</str<strong>on</strong>g>.The <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angle calculated using EKF is shown in Fig. 3. We can see that the calculated value is quite unstabledue to the random initial state and the filtering covariance matrix. After 40s of the simulati<strong>on</strong>, the calculated value isable to track the true value. The average <str<strong>on</strong>g>error</str<strong>on</strong>g> is approximately 0.1°.Fig. 4 displays a <strong>com</strong>paris<strong>on</strong> between the <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angle calculated from <strong>MARG</strong> algorithm and the true angle. Formthe figure, we can observe that the calculated value is able to track the true value after 10s in simulati<strong>on</strong>. Theaverage <str<strong>on</strong>g>error</str<strong>on</strong>g> is about 0.15°. Both EKF and <strong>MARG</strong> algorithms have good c<strong>on</strong>vergence rate. Although <strong>MARG</strong>algorithm achieves similar accuracy as EKF algorithm, <strong>MARG</strong> algorithm c<strong>on</strong>verges much faster than EKF. It takes525


Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________40s for EKF to c<strong>on</strong>verge but <strong>on</strong>ly 10s for <strong>MARG</strong>, which is very desirable in real time applicati<strong>on</strong>. The c<strong>on</strong>vergencetime, <strong>com</strong>putati<strong>on</strong>al <strong>com</strong>plexity and processing time for EKF algorithm and our proposed <strong>MARG</strong> algorithm are<strong>com</strong>pared in table 1.Fig. 2: Track generator simulati<strong>on</strong> results with noiseFig. 3: The simulati<strong>on</strong> results for EKFFig. 4: The simulati<strong>on</strong> results for <strong>MARG</strong>Table 1: The c<strong>on</strong>vergence time, <strong>com</strong>putati<strong>on</strong>al <strong>com</strong>plexity and processing time for EKF and <strong>MARG</strong>AlgorithmC<strong>on</strong>vergence time(s) Computati<strong>on</strong>al <strong>com</strong>plexity Processing time(s)Yaw Pitch Roll add sub mul div total N=48000EKF 37.8 37.5 38.4 833 31 1090 16 1970 80.508587<strong>MARG</strong> 7.5 13.8 7.8 51 57 155 19 277 50.667737TURNTABLE EXPERIMENT AND RESULTSIn the turntable experiment, MPU6050 chip and HMC5883L chip are used for <strong>MARG</strong> sensor array. I2C bus is usedfor <strong>com</strong>municati<strong>on</strong> between <strong>MARG</strong> sensor array and STM32F103RBT6 ARM processor. The experimentalparameters are listed in table 2.526


Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________Table 2: The parameters for turntable experimentParameters Axis X Axis Y Axis ZGyro zero bias(deg/s) 5 5 5Drift rate of gyro(deg/s/s) 0.2 0.2 0.2The <strong>com</strong>plementary filter gain 0.075 0.075 0.075The integral gain 0.003 0.003 0.003The calculated <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angle after <strong>com</strong>plementary filtering is <strong>com</strong>pared with the measured value from turntableplatform. The results are shown in Fig. 5 and Fig. 6. The <strong>com</strong>plementary filtering algorithm needs 277 time ofscalar operati<strong>on</strong> for each update at 10Hz sampling rate. The global variables take 72 bytes space while localvariables take 260 bytes. Roll angle, pitch angle and yaw angle has the standard deviati<strong>on</strong> of 0.31°,0.20°and 0.39°,respectively. As <strong>com</strong>pared to the actual measurements from the turntable experiment, the <str<strong>on</strong>g>error</str<strong>on</strong>g> c<strong>on</strong>vergence after100s.Fig. 5: Error of <str<strong>on</strong>g>attitude</str<strong>on</strong>g> angle after filteringFig. 6: Error <strong>com</strong>paris<strong>on</strong> of n<strong>on</strong>-filtering and filteringCONCLUSIONIn the paper, we propose an <str<strong>on</strong>g>error</str<strong>on</strong>g> <str<strong>on</strong>g>correcti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>method</str<strong>on</strong>g> using <strong>MARG</strong> sensor array. We <strong>com</strong>pared the filteringperformance with the traditi<strong>on</strong>al EKF algorithm. The experiment results indicate that both algorithms have similarfiltering accuracy, but <strong>MARG</strong> algorithm can reduce the c<strong>on</strong>vergence time significantly. EKF is <strong>com</strong>putati<strong>on</strong>alexpensive with more than 7 times of scalar operati<strong>on</strong>s than our proposed <strong>MARG</strong> algorithm. Under low samplingrate (10Hz), the <str<strong>on</strong>g>error</str<strong>on</strong>g> calculated from our <str<strong>on</strong>g>method</str<strong>on</strong>g> is less than 0.5°.AcknowledgmentThe work of this paper is supported by Beijing Municipality Educati<strong>on</strong> Commissi<strong>on</strong> research project “Spread andexploitati<strong>on</strong> of wireless broadband m<strong>on</strong>itoring network of forest fires in Beijing”.527


Mingjian Li et al J. Chem. Pharm. Res., 2013, 5(9):522-528______________________________________________________________________________REFERENCES[1] Du,H.Y., Hao, Y.L., and Zhao, Y.X., 2011. Systems Engineering and Electr<strong>on</strong>ics, 33(7): 1653-1657.[2] Gao, X.Z., Hou, Z.X., and Wang, B., et al., 2013. C<strong>on</strong>trol Theory & Applicati<strong>on</strong>s, 30(2): 171-176.[3] Guo, X.H., Yang, Z., and Chen, Z., et al., 2011. Transducer and Microsystem Technologies, 30(11): 149-152.[4] R. Mah<strong>on</strong>y, T. Hamel, and J.M. Pimlin., 2008. IEEE Transacti<strong>on</strong>s, 53(5): 1203 -1218.[5] Sabatini, A.M., 2006. IEEE Trans-acti<strong>on</strong>s <strong>on</strong> Biomedical Engineering, 53(7): 1346 – 1357.[6] Shi, Y., and Han, C.Z., 2011. Acta Automatica Sinica, 37(6): 755-759.[7] Wang, K., Liu, L., and Du, X.J., et al., 2011. Journal of Astr<strong>on</strong>autics, 32(4): 795-801.[8] Wang, Q.T., 2011. Journal of C<strong>on</strong>vergence Informati<strong>on</strong> Technology, 6(6) : 202-211.[9] Wang, X.B., Xu, J.H., and Zhang, Z., 2011. Computer Applicati<strong>on</strong>s and Software, 29(6): 212-215.[10] Xue, L., Yuan, W., and Chang, H., 2009. Nanotechnology and Precisi<strong>on</strong> Engineering, 7 (3): 163 –167.[11] Yang, S.J., Zeng, Q.S., and Yi, G.X., 2012. Transducer and Microsystem Technologies, 31(2): 15-18.[12] Zhao, H., Zhao, Z., L<strong>on</strong>g, G.Q., 2005. Journal of System Simulati<strong>on</strong>, 17(5): 1026-1029.528

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!