# Attitude Determination from GNSS Using Adaptive Kalman Filtering Attitude Determination from GNSS Using Adaptive Kalman Filtering

136 AHMED EL-MOWAFY AND AHMED MOHAMED VOL. 58adaptive filtering formulation, therefore, tackles the problem of imperfect a prioriinformation and provides better tracking of the filter states by adopting the systemdynamics changes (Mohamed, 1999).2. ATTITUDE DETERMINATION BY THE MULTI-ANTENNAGNSS SYSTEM. The attitude of a moving object can be estimated from themeasurements of a set of GNSS antennae mounted on its external surface. The attitudeparameters (heading, pitch and roll) can be derived as the Euler angles of thetransformation (rotation) matrix between the antenna baseline vectors in the locallevelframe and their vectors in a selected body frame representing the movingobject. However, if only two antennae are used, only two attitude parameters(heading and pitch) can be determined along the line connecting the two antennae.In this case, the system is known as a pointing system. If three antennae or moreare used, all three-attitude parameters can be determined. Assuming no origin shiftbetween the local-level frame and the body frame, and assuming no scale changebetween the two frames of reference, the relation between the two frames can beformulated as:X l =R b l X b (1)where X l and X b are the antenna vectors in the local-level and the body frames,respectively, and R l b denotes the transformation matrix from the body frame to thelocal-level frame. X l is determined from GNSS measurements, and the X b matrix iscomputed from the antennae layout geometry.Since accurate attitude results are usually needed, the main type of GNSSmeasurements involved are double-differenced phase measurements, including allindependent combinations between the antenna positions. To determine accurateattitude parameters, the antenna vectors should be determined at the mm level ofaccuracy. To reach this accuracy, these vectors have to be solved taking one of theonboard antennae as the reference. In a land vehicle, and some airborne and seabornecases, the antenna spacing is only limited to a few metres, and in some other cases inthe airborne and seaborne modes the spacing can reach tens of metres. Thus, allspatially correlated errors between the reference antenna and the other antennae,including atmospheric errors (ionospheric and tropospheric) as well as orbital errors,are practically eliminated in the differencing process (Cohen, 1996). The remainingerrors that affect performance of attitude determination are multipath, receiver noiseand antenna phase center variation. Due to the short antenna spacing involved,minimization of these errors is of utmost importance.The use of dual-frequency receivers is thus not needed for ionospheric error mitigation,but is however still helpful in faster and reliable ambiguity resolution, usingfor instance the wide-laning technique. After the Galileo system starts service, acandidate hybrid system will use Galileo E2-L1-E1/ GPS L1 pairs. Compared withusing GPS alone, the use of a hybrid system will improve accuracy of attitudedetermination as a result of the increased number of measurements and improvedsatellite geometry. This is seen today, in practice, with hybrid receivers employingGPS and GLONASS systems. On the other hand, in navigation, attitude determinationis usually coupled with position estimation. Thus, one antenna from the attitudedetermination system can be used for this purpose, e.g. the base one. A second

NO. 1 ATTITUDE DETERMINATION FROM GNSS 137antenna of the attitude system can also be used as a backup for positioning. It isrecommended that both antennae are connected to dual-frequency receivers. Thismeans for a hybrid GPS/Galileo receiver adding the signals Galileo E5a (E5b)/ GPSL5, and also probably adding L2C and E6. This will increase estimation robustnessbut will also add to its complexity, in addition to increasing the cost.The use of carrier-phase measurements raises the critical issue of accuratelydetermining the ambiguous number of initial integer carrier-phase cycles and cycleslips detection and repair as a corner stone for successful attitude determination. Toincrease reliability and to speed up the process by limiting the ambiguity search space,three types of constraints can be established from the pre-knowledge of the fixedantenna geometry. The first type of constraint is the known baseline lengths. Thesecond type is the known spatial angles contained between the antenna baselines. Thethird constraint comes from the accurate knowledge of the geometry of the antennaeas a network, such that the accurate double-differenced ambiguities of the baselinesshould satisfy a closed loop condition. For details regarding formulation of theseconstraints, the interested reader may refer to El-Mowafy (2001). In the future, it isexpected that a hybrid GPS/Galileo receiver will be the most effective for achieving anultra high ambiguity resolution success rate due to the increased number of observedsatellites and improved satellite geometry (Eissfeller et al., 2002).If one antenna of the attitude determination system is used for positioning and asecond one is used as a backup, an approximate orientation of their baseline fromtheir real-time determined positions can be used to set the search region for theambiguities. This technique is more efficient than using an array of closely spacedantennae (see El-Mowafy and Schwarz, 1995), or using external information fromother sensors, such as dead reckoning.Ignoring noise and random errors and accounting for ambiguities, the remainingdouble-differenced phase measurements in length units (rDw) can be formulated asin the following observation equation:rDw=E ~X (2)where ~X is the matrix of the antenna baseline vectors (Dx, Dy, Dz) T in the usedgeocentric Earth-Centered-Earth-Fixed (ECEF) frame (e.g. WGS-84), and E denotesthe coefficient matrix of the double-differenced unit vectors between the antennabaselines to the satellites. This coefficient matrix is determined from the satellite andantenna positions using, for instance, either approximate coordinates from the singlepoint positioning solution or the coordinates of the base attitude antenna used forpositioning, if determined as well. The unit vector components (e x ,e y ,e z ) arecomputed, for instance, from the coordinates of antenna number 1 (x, y, z) 1 and thesatellite coordinates (x, y, z) s in the ECEF frame using the equations:e x = cos (u) sin (m) (3)e y = cos (u) cos (m) (4)e z = sin (u) (5)where(zu= tan x1 s xz 1 )p ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi(6)(x s xx 1 ) 2 +(y s xy 1 ) 2

138 AHMED EL-MOWAFY AND AHMED MOHAMED VOL. 58andm= tan (x sxx x1 1 )(y s xy 1 )(7)By substituting equation 1 into equation 2, the final observation equation relating thephase measurements to attitude parameters can be formulated as:rDw=E R l e Rb l X b (8)where R e l is the transformation matrix between the local-level frame and the e-frame(usually Earth-Centered-Earth-Fixed geo-centric frame) in the above equation.Involving the antenna geographic coordinates (latitude a, longitude l), gives us:23x sin (a) cos (l) x sin (a) sin (l) cos (a)R l e = 4 x sin (l) cos (l) 0 5 (9)cos (a) cos (l) cos(a) sin (l) sin (a)The transformation matrix R bl has different forms dependent on the rotationsequence around the axes of the body frame. Attitude parameters estimated from anyof these forms should be numerically equivalent. One of these forms can be expressedas:R b l2=3cos (y) cos (Q)x sin (y) sin (h) sin (Q) sin (y) cos (Q)+ cos (y) sin (h) sin (Q) x cos (h) sin (Q)674 x sin (y)cos(h) cos (y) cos (h) sin (h) 5cos (y) sin (Q)+ sin (y) sin (h) cos (Q) sin (y) sin (Q)x cos (y) sin (h) cos (Q) cos (h) cos (Q)from which a simple estimation of the attitude parameters can be carried out asfollows:(10)Heading (y)=x sin x1 (R b l(2, 1) =Rb l(2, 2) ) (11)Pitch (h)= sin x1 (R b l(2, 3) ) (12)Roll (Q)=x tan x1 (R b l(1, 3) =Rb l(3, 3) ) (13)3. ADAPTIVE KALMAN FILTERING MODELLING OFATTITUDE F ROM GNSS MEASUREMENTS. The mathematicalmodels in the filtering approach used for attitude determination from GNSSmeasurements (e.g. GPS) can be written in matrix form as:i- Dynamics model: Si _ =F i, ixl S i +w i (14)where, for simplicity, W i, ixl =F i, ixl dt+I (15)ii- Observation model: M i =h(S i )+v i (16)iii- Stochastic model: E(w j w T i )={Q j i=j, 0 ilj} (17)E(v j v T i )={R j i=j, 0 ilj} (18)E(w j v T i )={0} (19)

NO. 1 ATTITUDE DETERMINATION FROM GNSS 139where:S i the state vector,M i the measurement vector consisting of the carrier-phase measurements,W i,ix1 the transition matrix,F the dynamics matrix,dt prediction time interval (t i xt ix1 ),I the identity matrixh the functions of the observation equations,w i the noise of the dynamics model,v i the measurement noise,Q the covariance matrix of the dynamics model,R the covariance matrix of the measurement model,j, i time indices.The state vector includes the three attitude parameters (Heading y, Pitch h, Roll Q)and their time rates ( _y _ h _Q), such that:S=(y hQ _y _ h _Q) T (20)As shown in the previous section, estimation of the attitude parameters from phasemeasurements involves non-linear equations. However, standard Kalman filterequations (Kalman, 1960) are intended for linear models, and if applied on non-linearmodels, a significant bias may appear. Several methods have been devised to solvethis problem. Among the most widely used ones is the extended Kalman filtering, seefor instance Brown and Wang (1997). In this technique, using a Taylor seriesexpansion and truncating the higher order terms, the quantity being filtered becomesan estimated correction (d) to an approximate state (S o ), which is a nominal timevarying state updated using filter estimation, such that:d=^SxS o (21)The nominal approximate state vector can be computed from the equations 11 to13 after solving for equation 8, in a normal equations solution, using selectedobservations from the current epoch. A linearized design matrix derived from theobservation equation can then be given as:H= @h (22)@SS=Sowhere the functional relationship of the observation equations (h) between theattitude states and the observations are based on the model presented in equation (8).The measurement misclosure (v) is computed as:v=h(S o )xM (23)The time update (prediction) equations take the form:d i, ix1 =W i, ix1 d i;1 (24)P i, ix1 =W i, ix1 P ix1 W T i, +Q ix1 ix1 (25)K i =P i, ix1 H T i (H i P i, ix1 H T i +R ix1) x1 (26)

NO. 1 ATTITUDE DETERMINATION FROM GNSS 141This adaptive approach can be performed using the innovation sequence (c i ):c i =M i xh(S ix1 ) (31)The variation in the innovation sequence during the estimation process of the filterrepresents well the learning history of the filter and contains the necessary informationabout the filter error propagation. Thus, the innovation sequence can be usedfor the filter self adaptation (Mohammed, 1999). After the measurement update, theresidual sequence (g i ) can be used for this purpose (Hide et al., 2003), which can becomputed as:g i =M i xh(S i ) (32)The adaptive formulation of the R and Q matrices can be given as (Mohammed andSchwarz, 1999):X iC g = 1 Nk=k 0g k g T k (33)R i =C g +H i P i H T i (34)Q i =K i C g K T i (35)where C g is the covariance matrix of the residual sequence, and using k o =i–N+1asthe first epoch inside the estimation of a moving time window of the size (N). It isnecessary, however, in the adaptive approach, to separate the actual system/trajectorydynamics of the vehicle from the measurement noise, noting that this approachmay not succeed if the noise level of the actual measurements is higher than thedynamics of the trajectory or the system itself. Thus, these elements should be regularlymonitored to switch to the classical Kalman filter approach in such a case.With extended Kalman filtering, convergence to a reasonable estimate may not beobtained if the initial estimation is poor or if the disturbances are so large that thelinearization is inadequate to describe the system. To overcome this problem, aGauss-Newton iteration method within a single epoch (i) can be employed to minimizethe linearization bias, see for instance Liu (2001), and Salzmann (1993). Becausetwo iterations are typically needed, the extended Kalman filter and the iterationprocess are performed as two separate steps.4. TESTING OF THE ADAPTIVE TECHNIQUE.4.1. Test Description. The trajectory used for testing the adaptive Kalman filteringfor attitude determination was carried out for a moving van using three GPSantennas. The antennae were attached to a frame mounted on the roof of the van, asshown in Figure 1.Antennae (A1) and (A2) were mounted on the terminals of one arm of the frameplaced approximately along the centreline of the vehicle, while the third antenna wasmounted on a second arm, perpendicular to the first one (the line A1-A2). Theantennae body frame coordinate system was assumed to have an origin at antennaA1. The y-axis (giving reference to heading angle) is taken along the baseline betweenantennae A1 and A2 and points in the forward direction of the vehicle. The x-axis isperpendicular to the y-axis and lies in the plane formed by the antennae A1, A2 and

142 AHMED EL-MOWAFY AND AHMED MOHAMED VOL. 58YA2A3A1τXFigure 1. The multi-antenna body frame.A3 and points to the right. The z-axis then forms a right-handed system with the xand y axes (pointing upward in a horizontally levelled XY-plane case). The attitude ofthe moving vehicle can be described by relation to the spatial directions of the twovectors (e.g. A1-A2 and A1-A3) of the multi-antennae body frame. The antennavectors can be given as:23X b =640 . . l 13 sin (t)l 12 . . l 13 cos (t)0 . . 0where l 12 and l 13 are the lengths of the antennae baselines A1-A2 and A1-A3,respectively, and (t) is the angle contained between the two baselines.For the test in hand, the length of the baseline A1-A2 is 2 . 5 m, while the length ofthe baseline A1-A3 is 1 . 5 m, and the angle (t) is approximately 45 degrees. It isassumed in this case that the line A1-A2 represents the centreline of the vehicle, andthe antenna body frame coordinate system is taken parallel to the vehicle platformcoordinate system. Thus, the attitude of the antennae body frame system is equal tothe attitude of the vehicle platform. For the purpose of this test, possible misalignmentangles between the two coordinate systems were considered to be small andwere ignored. The fact that the antennae were rigidly mounted on the vehicle makesthese misalignment angles constant and would be treated as biases to the solution.For attitude determination from GNSS, and to compare the results of conventionalKalman filtering with the adaptive Kalman filtering approaches, the followingwas considered:’ Only measurements from GPS were available for testing.’ A cut-off elevation mask angle of 10 degrees was used.’ The phase and code measurements were stored in the internal memory of thereceivers for post-mission processing.’ The antenna A1 was also used for positioning.To assess the performance of the determined attitude by GPS using the testedfiltering techniques, the results were externally referenced to an inertial measuringunit (IMU) of better than 0 . 1 degree accuracy in measuring all three attitude parameters.The IMU was simultaneously running during testing of attitude determinationfrom GNSS. The IMU attitude components were determined in a75(36)

NO. 1 ATTITUDE DETERMINATION FROM GNSS 143Table 1. Mean Absolute Differences of Attitude States (degree).AKFCKFHeading 0 . 0972 0 . 0982Pitch 0 . 1844 0 . 1918Roll 0 . 1899 0 . 1972Heading (deg.)4003503002502001501005000 200 400 600 800 1000 1200 1400epochs (sec.)Figure 2. Change of heading angle of the vehicle during testing.de-centralized Kalman filter with positioning updates estimated from the antenna A1.Misalignment of the attitude angles determined by the IMU and GPS was determinedin a static mission before testing in the kinematic mode. The IMU and GPS data weresynchronized using the 1 PPS data stream from GPS.During testing, the van had a z-shaped trajectory, and changes in the heading angle(azimuth) of the vehicle are illustrated in Figure 2. The test area contains mostly one ortwo storey buildings. The satellite window during testing was good in general withPDOP ranging between 1 . 6and3 . 2, giving an opportunity to observe a minimum ofsix GPS satellites in open sites.4.2. Test Results. The collected GPS phase measurements after resolution of theambiguities were processed twice, first using conventional Kalman filtering (CKF),and next using the adaptive Kalman filtering (AKF). In the latter case, a movingwindow (N) of 25 epochs was used for computation of the covariance matrix of theresidual sequence (C g ) in formulation of the equation (33).The results of both filters were compared to the IMU filtering results. The results ofthe adaptive technique were generally better than those of the conventional filter.This is shown in Table 1, which gives the average values of the absolute differences ofboth filters as compared to the IMU reference attitude. This test shows externalconsistency of the results. In addition, when comparing the standard deviations of theattitude states in both filters computed from the variances-covariance matrix of thesates, the AKF gives more accurate results compared to the CKF. This is shown inTable 2, as the average standard deviations of the attitude states of the AKF were lessthan those of the CKF. This test shows internal consistency of the results. The statesof the three attitude parameters (heading, pitch, and roll) for the AKF and CKF filter

144 AHMED EL-MOWAFY AND AHMED MOHAMED VOL. 58Table 2. Mean Standard Deviations of Attitude States (degree).AKFCKFHeading 0 . 0140 0 . 0284Pitch 0 . 0315 0 . 0528Roll 0 . 0303 0 . 0489Heading error state (deg.)Pitch error state (deg.)0.20.150.10.050-0.05-0.1-0.15-0.20.20.150.10.050-0.05-0.1-0.15-0.20.20 200 400 600 800 1000 1200 1400epochs0 200 400 600 800 1000 1200 1400epochsRoll error state (deg.)0.150.10.050-0.05-0.1-0.15-0.20 200 400 600 800 1000 1200 1400epochsFigure 3. AKF estimated attitude states.

NO. 1 ATTITUDE DETERMINATION FROM GNSS 145Heading error state (deg.)0.20.150.10.050-0.05-0.1-0.15-0.20200 400 600 800 1000 1200 1400epochsPitch error state (deg.)Roll error state (deg.)0.20.150.10.050-0.05-0.1-0.15-0.20 200 400 600 800 1000 1200 1400epochs0.20.150.10.050-0.05-0.1-0.15-0.20 200 400 600 800 1000 1200 1400epochsFigure 4. CKF estimated attitude states.estimation are illustrated in Figures 3 and 4, respectively. As shown in Figure 4, in thecase of CKF, the attitude states are relatively smooth and they do not adequatelyrepresent actual system dynamics. On the other hand, as shown in Figure 3, the AKFstates reflect more the actual system dynamics, as will be discussed later.When using GNSS measurements, the attitude is primarily determined from theaccurate relative positions of the antennae. The dynamics of the vehicle have animpact on the determination of such positions, and hence should be taken into considerationwhen estimating attitude. During testing, the vehicle went through differentchanges in its dynamics, including acceleration, deceleration and steady speed, aswell as experiencing different changes in its angular acceleration. In the AKF processingof the collected GPS data, the filter adapts to the system dynamics through

146 AHMED EL-MOWAFY AND AHMED MOHAMED VOL. 58AKF Heading SD (deg.)AKF Pitch SD (deg.)AKF Roll SD (deg.)0.20.150.10.050-0.05-0.1-0.15-0.20.20.150.10.050-0.05-0.1-0.15-0.20.20.150.10.050-0.05-0.1-0.15-0.20 200 400 600 800 1000 1200 1400epochs0 200 400 600 800 1000 1200 1400epochs0 200 400 600 800 1000 1200 1400epochsFigure 5. Standard deviations of AKF states.continuous updating of the actual measurement quality in its noise covariance matrix(R) and the system noise covariance matrix (Q); this is illustrated in Figure 3. Forexample, the spikes seen in the heading state correspond to turns in the trajectory;whereas for the CKF estimation, such an effect was slowly absorbed, as the states didnot track well the changes in the trajectory. This is due to the fact that the measurementnoise covariance matrix (R) and the system noise covariance matrix (Q), andhence the Kalman filter gain, were kept constant. This is evident in the behaviour of thestandard deviations of the filter states in both cases. As can be seen in Figures 5 and 6,the standard deviations of the CKF states, at steady state, stayed approximatelyconstant, while in the case of the AKF they change according to the actualmeasurement noise and system dynamics experienced.

NO. 1 ATTITUDE DETERMINATION FROM GNSS 147CKF Heading SD (deg.)CKF Pitch SD (deg.)CKF Roll SD (deg.)0.20.150.10.050-0.05-0.1-0.15-0.20.20.150.10.050-0.05-0.1-0.15-0.20.20.150.10.050-0.05-0.1-0.15-0.20 200 400 600 800 1000 1200 1400epochs0 200 400 600 800 1000 1200 1400epochs0 200 400 600 800 1000 1200 1400epochsFigure 6. Standard deviations of CKF states.5. S UMMARY AND CONCLUSIONS. The attitude of a moving vehiclecan be determined using a GNSS multi-antennae system by rigidly mounting threeantennae on the vehicle’s external surface. Two antenna-to-antenna vectors can beused to represent the attitude change of the vehicle. Conventional Kalman filteringhas been used, among other techniques, for the estimation of the attitude states. Anadaptive Kalman filtering approach has been proposed and studied in this paper.The proposed approach uses the filter residual sequence as a means of updating themeasurement and system covariance matrices. The change of these covariancematrices is used to reflect changes in the system dynamics.