Unscented Kalman Filter Applied to the Spacecraft Attitude Estimation with Euler Angles

The aim of this work is to test an algorithm to estimate, in real time, the attitude of an artificial satellite using real data supplied by attitude sensors that are on board of the CBERS-2 satellite China Brazil Earth Resources Satellite . The real-time estimator used in this work for attitude determination is the Unscented Kalman Filter. This filter is a new alternative to the extended Kalman filter usually applied to the estimation and control problems of attitude and orbit. This algorithm is capable of carrying out estimation of the states of nonlinear systems, without the necessity of linearization of the nonlinear functions present in the model. This estimation is possible due to a transformation that generates a set of vectors that, suffering a nonlinear transformation, preserves the same mean and covariance of the random variables before the transformation. The performance will be evaluated and analyzed through the comparison between the Unscented Kalman filter and the extended Kalman filter results, by using real onboard data.


Introduction
The attitude of a spacecraft is defined by its orientation in space related to some reference system.The importance of determining the attitude is related not only to the performance of attitude control but also to the precise usage of information obtained by payload experiments performed by the satellite.The attitude estimation is the process of calculating the orientation of the spacecraft in relation to a reference system from data supplied by attitude sensors.Chosen the vector of reference, an attitude sensor measures the orientation of these vectors with respect to the satellite reference system 1 .Once these one or more vectors measurements are known, it is possible to compute the orientation of the satellite processing these vectors, using methods of attitude estimation.There are several methods for determining the attitude of a satellite.Each method is appropriate to a particular type of application and meets the needs such as available time for processing and accuracy to be attained.However, all methods need observations that are obtained by means of sensors installed on the satellite.The sensors are essential for attitude estimation, because they measure its orientation relative to some referential, for example, the Earth, the sun, or a star.In this work, the satellite attitude is described by Euler angles, due to its easy geometric interpretation, and the method to estimate the attitude used is the Unscented Kalman Filter.This method is capable of performing state estimation in nonlinear systems, besides taking into account measurements provided by different attitude sensors.In this work there were considered real data supplied by gyroscopes, infrared Earth sensors, and digital sun sensors.These sensors are on board of the CBERS-2 satellite China-Brazil Earth Resources Satellite , and the measurements were collected by the Satellite Control Centre of INPE Brazilian Institute for Space Research .

Representation of Attitude by Euler Angles
The attitude of an artificial satellite is directly related to its orientation in space.Through the attitude one can know the spatial orientation of the satellite, since in most cases it can be considered as a rigid body, where the attitude is expressed by the relationship between two coordinate systems, one fixed on the satellite and another associated with a reference system, for example, inertial system 2 .For a good performance of a mission it is essential that the satellite be stabilized in relation to a specified attitude.The attitude stabilization is achieved by the on-board attitude control, which is designed to acquire and maintain the satellite in a predefined attitude.The CBERS-2 attitude is stabilized in three axes nominally geo-pointed and can be described with respect to the orbital system.In this reference system, the movement around the direction of the orbital velocity is called roll.The movement around the direction normal to the orbit is called pitch, and finally the movement around the direction Nadir/Zenith is called yaw.To transform a vector represented in a given reference to another it is necessary to define a matrix of direction cosines R , where its elements are written in terms of Euler angles φ, θ, ψ 3 .The rotation sequence used in this work for the Euler angles was the 3-2-1, where the coordinate system fixed in the body of the satellite x, y, z is related to the orbital coordinate system xo, yo, zo through the following sequence of rotations: i 1st rotation of an angle ψ yaw angle around the zo axis, ii 2nd rotation of an angle θ roll angle around an intermediate axis y , iii 3rd rotation of an angle φ pitch angle around the x-axis.
The matrix obtained through the 3-2-1 rotation sequence is given by where R is the matrix of direction cosines with S sin, C cos, and T tan.
By representing the attitude of a satellite with Euler angles, the set of kinematic equations are given by 4 where ω 0 is the orbital angular velocity and w x , w y , and w z are the components of the angular velocity on the satellite system.

The Measurements System of Satellite
In order to estimate the satellite attitude accurately, several types of sensors, including gyros, earth sensors, and solar sensors, are used in the attitude determination system.The equations of these sensors are introduced here.

The Model for Gyros
The advantage of a gyro is that it can provide the angular displacement and/or angular velocity of the satellite directly.However, gyros have an error due to drifting, meaning that their measurement error increases with time.In this work, the rate-integration gyros RIGs are used to measure the angular velocities of the roll, pitch, and yaw of the satellite.The mathematical model of the RIGs is 4 where ΔΘ are the angular displacement of the satellite in a time interval Δt, and ε i are components of bias of the gyroscope.Thus, the measured components of the angular velocity of the satellite are given by where g t is the output vector of the gyroscope, and η 1 t represents a Gaussian white noise process covering all the remaining unmodelled effects:

The Measurement Model for Infrared Earth Sensors (IRESs)
One way to compensate for the drifting errors present in gyros is to use the earth sensors.These sensors are located on the satellite and aligned with their axes of roll and pitch.In the work, two earth sensors are used, with one measuring the roll angle and the other measuring the pitch angle.In principle, an earth sensor cannot measure the yaw angle.The measurement equations for the earth sensors are given as 5 where η φ H and η θ H are the white noise representing the small remaining misalignment, installation, and/or assembly errors assumed to be gaussian: 3.5

The Measurement Model for Digital Solar Sensors (DSSs)
Since an earth sensor is not able to measure the yaw angle, the solar sensors are used by the Attitude Control System in order to overcome this problem.However, these sensors do not provide direct measurements but coupled angle of pitch α θ and yaw α ψ .The measurement equations for the solar sensor are obtained as follows 5 : when |S x cos 60 • S z cos 150 • | ≥ cos 60 • , and , where η α ψ and η α θ are the white noise representing the small remaining misalignment, installation, and/or assembly errors assumed Gaussian: The conditions are such that the solar vector is in the field of view of the sensor, and S x , S y , and S z are the components of the unit vector associated to the sun vector in the satellite system and given by S x S 0x ψS 0y − θS 0z , S y S 0y − ψS 0x φS 0z , S z S 0z − φS 0y θS 0z , 3.9 where S 0x , S 0y , and S 0z are the components of the sun vector in the orbital coordinate system and φ, θ, and ψ are the Euler angles-estimated attitude.

Attitude Estimation Methods
The goal of an estimator is to calculate the state vector attitude based on a set of observations sensors 6 .In other words, it is an algorithm capable of processing measurements to produce, according with a given criterium, a minimum error estimate of the state of a system.In this paper, the real-time estimator used to estimate the satellite attitude is a variant of the Kalman filter, applied to problems that present some nonlinearity.This estimator is described as follows.

Unscented Kalman Filter
The basic premise behind the Unscented Kalman Filter UKF is that it is easier to approximate a Gaussian distribution than it is to approximate an arbitrary nonlinear function.
Instead of linearizing to first order using Jacobian matrices, the UKF uses a rational deterministic sampling approach to capture the mean and covariance estimates with a minimal set of sample points.The nonlinear function is applied to each point, in turn, to yield a cloud of transformed points.The statistics of the transformed points can then be calculated to form an estimate of the nonlinearly transformed mean and covariance.We present an algorithmic description of the UKF omitting some theoretical considerations, left to 7, 8 .
Consider the system model given by where x k is the n × 1 state vector and y k is the m × 1 measurement vector.We assume that the process noise w k and measurement-error noise ν k are zero-mean Gaussian noise processes with covariances given by Q k and R k , respectively.In this work the state vector at time k is defined by the Euler angles and gyro biases: Performing the necessary simplifications small Euler angles in the set of 2.2 , the attitude angles and gyro angular velocity biases are modelled as follows:

4.3
Given the state vector at step k − 1, we compute a collection of sigma-points, stored in the columns of the n × 2n 1 sigma point matrix χ k−1 , where n is the dimension of the state vector.In our case, n 6, so χ k−1 is a 6 × 13 matrix.The columns of χ k−1 are computed by in which λ R, n λ P k−1 i is the ith column of the matrix square root of n λ P k−1 .Once χ k−1 computed, we perform the prediction step by first predicting each column of χ k−1 through time by Δt using where f is differential equation defined in 2.2 or 4.3 .In our formulation, we perform a numerical Runge-Kutta integration.With χ k i being calculated, the a priori state estimate is where W m i are weights defined by

4.7
As the last part of the prediction step, we calculate the a priori error covariance with where Q k is the process error covariance matrix, and the weights are defined by where α is a scaling parameter which determines the spread of the sigma points and β is a parameter used to incorporate any prior knowledge about the distribution of x 9 .
To compute the correction step, we first must transform the columns of χ k through the measurement function to Y k .In this way

4.10
With the mean measurement vector y − k , we compute the a posteriori state estimate using where K k is the Kalman gain.In the UKF formulation, K k is defined by 12 where

4.13
where R k represents the measurement error covariance matrix.
Finally, the last calculation in the correction step is to compute the a posteriori estimate of the error covariance given by 4.14

Results
Here, the results and the analysis from the algorithm developed to estimate the attitude are presented.Figures 4 and 5 present the standard deviations for both estimators for the attitude and the bias of the gyro.It is observed that the attitude standard deviations and the standard deviations of the gyro bias decrease with a tendency to stabilize around a value for both filters.However, the graphs show the superiority of UKF, because in most cases it works within a range of protection better than the EKF.
In Figures 6 and 7, we can see that the residues of sun sensors and Earth sensors have the same behavior for both estimators.For the Earth sensors, the residuals obtained by the both estimators are smaller and show a tendency to zero mean.However, the residues of UKF are still lower, being at about −0.009 deg for IRES 1 and 0.004 deg for IRES 2 .Already the residues of the EKF are approximately 0.01 deg and −0.027 deg for IRES 1 and IRES 2 , respectively.
These results seem consistent because in this case it is not possible to compare the estimated values with true values, since these values are not known.

Final Comments
In this paper, the Unscented Kalman Filter estimator applied in nonlinear systems was presented for use in real-time attitude estimation.The main objective was to estimate the attitude of a CBERS-2 like satellite, using real data provided by sensors that are on board of the satellite.To verify the consistency of the estimator, the attitude was estimated by two different methods.The usage of real data from on-board attitude sensors poses difficulties like mismodelling, mismatch of sizes, misalignments, unforeseen systematic errors, and postlaunch calibration errors.However, it is observed that, although the EKF and UKF have roughly the same accuracy, the UKF leads to a convergence of the state vector faster than the EKF.This fact was expected, since the UKF prevents the linearizations needed for EKF, when the system has some nonlinearity in their equations.

Figure 1 :
Figure 1: Real measurements supplied by attitude sensors.
To validate and to analyze the performance of the estimators, real sensors data from the CBERS-2 satellite were used see 10, 11 .The CBERS-2 satellite was launched on October 21, 2003.The measurements are for the month of April 2006, available to the ground system at a sampling rate of about 8.56 sec.The algorithm was implemented through MATLAB software.To check the performance the UKF, their results were compared with the estimated attitude by the more conventional EKF Extended Kalman Filter , considering the following set of initial conditions: iii initial covariance P : σ 2 φ,θ,ψ 0.5 deg 2 error related to the attitude , and σ 2 bg 1 deg/hour 2 error related to the drift of gyro ; Attitude estimated by the Unscented Kalman filter end Extended Kalman filter.Bias estimated by the Unscented Kalman filter end Extended Kalman filter.Attitude errors Standard Deviation estimated.Residuals related to DSS attitude sensors.
c Figure 3: c Figure 4: c Figure 5: Bias errors Standard Deviation estimated.