Nonlinear Least Squares Method for Gyros Bias and Attitude Estimation Using Satellite Attitude and Orbit Toolbox for Matlab

The knowledge of the attitude determination is essential to the safety and control of the satellite and payload, and this involves approaches of nonlinear estimation techniques. Here one focuses on determining the attitude and the gyros drift of a real satellite CBERS-2 (China Brazil Earth Resources Satellite) using simulated measurements provided by propagator PROPAT Satellite Attitude and Orbit Toolbox for Matlab. The method used for the estimation was the Nonlinear Least Squares Estimation (NLSE). The attitude dynamical model is described by nonlinear equations involving the Euler angles. The attitude sensors available are two DSS (Digital Sun Sensor), two IRES (Infra-Red Earth Sensor), and one triad of mechanical gyros. The two IRES give direct measurements of roll and pitch angles with a certain level of error. The two DSS are nonlinear functions of roll, pitch, and yaw attitude angles. Gyros are very important sensors, as they provide direct incremental angles or angular velocities. However gyros present several sources of error of which the drift is the most troublesome. Results show that one can reach accuracies in attitude determination within the prescribed requirements, besides providing estimates of the gyro drifts which can be further used to enhance the gyro error model.


Introduction
Attitude estimation is a process of determining the orientation of a satellite with respect to an inertial reference system.There are a large number of estimation methods, thus, it is necessary to evaluate the processing time and the desired precision in project requirements.The state estimation methods of attitude, that was used in this work, correct successive estimates of attitude parameters, different from the deterministic attitude method in which the same number of observations as variables is used to obtain one or more discrete attitude solutions [9].
In this work, the attitude is represented by Euler angles, due to its easy geometrical interpretation. The state estimation is performed by the Nonlinear Least Squares Estimation using simulated measurements provided by propagator PROPAT [1]. This method is capable of estimating nonlinear systems states from data obtained from different sensors of attitude. It was taken simulated data supplied by one triad of mechanical gyros, two IRES (Infra-Red Earth Sensor) and two DSS (Digital Sun Sensors). These sensors configurations are similar to those found in real satellite CBERS-2 (China Brazil Earth Resources Satellite).

Nonlinear Least Squares Estimation
This method, otherwise known as Gaussian Least Squares Differential Correction, was originally developed by Gauss and employed to determine planetary orbits (during the 1800s) from telescope measurements of the line of sight angles to the planets [6].
The Nonlinear Least Squares Estimation assumes that the dynamic model of the state vector is perfect. Thus the nonlinear dynamic system is gven by [8,3]: where f (x x x) represents the nonlinear vector function of state x x x, y y y k represents the vector of observation of the sensors, h(x x x k ) is the function associated with the model of sensor observations, x x x k represents the state vector at instant t k and υ υ υ k = N (0, R R R k ) represents the vector associated with the noise of the observations at this point and the weighting matrix R R R k are symmetric positive definite. The linearized dynamic equation by the expansion of f (x x x) in Taylor series with truncation on linear term is given by: By setting the following deviations the following expression arises where F F F is the Jacobian matrix given by , and of course this linearization is valid only while δx x x is small.
The observation equation can also be linearized by the expansion of h k into Taylor series with truncation on linear term: The residues are defined by δy y y k = y y y k − h k (x x x), such that the observation equation is given by the linearized equation: where H H H k is given by The a-priori information to the state and covariance in instant t 0 given byx x x 0 =x x x 0 (t 0 ) and P P P 0 =P P P 0 (t 0 ). The method of nonlinear least squares must be implemented in an iterative way, which refines the variations instead of states [3,8]. By setting the following deviations: Finally, the equations that implement the estimation algorithm for nonlinear least squares method are [3,8]:P Normally the iterations continue until convergence. Basically, the most widely used criterion to terminate the algorithm is to verify when the deviation δx x x k becomes small enough, in this work we use six iterations of least squares method for state estimation.
In this way the final solution to the States will bê with covarianceP P P k given by Eq. (8).

Attitude Representation by Euler Angles
In the case of CBERS-2, attitude stabilization is done in three axes namely geo-targeted, and can be described in relation to the orbital system. The rotation sequence adopted in this work was the 3-2-1, see Figure 1, and the following sequences of rotations are used [4,5]  Thus, the rotational matrix that relates the orbital local system (x o , y o , z o ) and the attitude system (x, y, z) is given by [7]: cos θ sin ψ − sin θ sin φ sin θ cos ψ − sin ψ cos φ sin φ sin θ sin ψ + cos φ cos ψ sin φ cos θ cos φ sin θ cos ψ + sin φ sin ψ cos φ sin θ sin ψ − sin φ cos ψ cos φ cos θ   From (11), can be obtained the kinematic equation of the problem used in the estimation process.

Computer Simulation by PROPAT and Results
The nonlinear system that represents the process and measurements equations of the problem is given by [9,5,7]: x +ω y sin φ tan θ +ω z cos φ tan θ + ω 0 (cos φ sin ψ + sin θ sin ψ tan θ) ω y cos φ −ω z sin φ + ω 0 cos ψ ω y sin φ +ω z cos φ + ω 0 sin θ sin ψ cos θ 0 0 0 The state vector is composed by the attitude angles (φ, θ, ψ) and by gyros bias (ε x , ε y , ε z ), present in the angular velocity of the satellite represented on the satellite systemω x ,ω y andω z , respectively; the term ω 0 is the orbital angular velocity. The elements S 0x , S 0y e S 0z are the components of the solar vector in orbital coordinate system [4]. The matrices w w w = w φ w θ w ψ w εx w εy w εz T and υ υ υ k = υ α ψ υ α θ υ φ H υ θ H T are the process and measurements noises, respectively. The orbit and attitude simulation were made by propagator PROPAT [1] and the Nonlinear Least Squares Method is coded in MatLab software with a sampling rate of 0.5s for 10min of observation. Before analyzing the accuracy of the filter in question, it is important to analyze their convergence done through residual frequency configuration for the 6th iteration of the Nonlinear Least Squares Method, that presenting aspects of a gaussian. See  It is said that a Filter is converging when the residual is close to zero average and it happens with the results presented in Table 1 The high values in the 6th iteration for the IRES 1 and IRES 2 are a small oscillation in the average result, the larger the number of iterations, more, the residue approaches to zero. Fig. 3 and 4 present the attitude and gyros bias estimated.  It can be seen that the attitude and gyros bias estimation converge quickly after the third iteration of the NLSE.

Conclusions
The main objective of this study was to estimate the attitude of a CBERS-2 like satellite, using simulated data provided by PROPAT Satellite Attitude and Orbit Toolbox for Matlab considering the sensors available on board this satellite. To verify the consistency of the estimator, the attitude and gyros bias was estimated by Nonlinear Least Squares Estimation (NLSE). The usage of the simulated data from on board attitude sensors poses difficulties like mismodelling, mismatch of sizes, misalignments, unforeseen systematic errors and post-launch calibration errors. However, it is observed that the attitude and gyros bias estimated by the NLSE are in close agreement with the results obtained in a previous work [5] which used the Extended Kalman Filter for estimation.
However, checking the robustness of the estimation method, it was noted that the greater the deterioration of the initial conditions, the NLSE took longer to achieve convergence compared to [5]. In this case, the linearization performed by NLSE was made distant from the initial conditions of the real problem with the intention to validate the convergence of the estimation method. Thus, the NLSE produces satisfactory results for attitude estimation.
The contribution of the NLSE, derived here, assumed that the process noise do not exist and the measureaments noise is zero-mean and white (uncorrelated with itself from one time step to the next), and that the variance of the measurements noise is known. The method applied in this research is an alternative to the criterion of minimum variance estimation. The approach requires an assumption about the sources of uncertainty in the statistics of the problem, assuming the dynamic model of the state vector is perfect, that is, without noise.
Finally, it can be concluded that the algorithm of the NLSE converges, for initial conditions close to the actual values, providing a kinematic attitude solution besides estimating biases (gyro drifts).