Deterministic and Recursive Approach in Attitude Determination for InnoSAT.

Attitude determination system (ADS) was indispensable in attitude control of satellite. Especially for InnoSAT due to the limitation of budget, weight, and power, the attitude was determined using onboard position sensors. Previous research has successfully implemented the attitude determination using only Earth´s magnetic field sensors for small attitude angle, but the approach produced quite big error for large attitude angle. This paper presents attitude determination for InnoSAT using combination of sun sensors and earth´s magnetic field for large attitude angle. The attitude was determined using a deterministic (QUEST) and recursive (EKF) approach. A problem arises when using the sun sensors while the satellite experiencing eclipse. Consequently, the accuracy of both approaches was analyzed at eclipse and no eclipse conditions. The result shows that deterministic approach produced better accuracy at no eclipse but recursive approach produced better accuracy at eclipse. The strategy to apply the both approaches and eclipse conditions also discussed in this paper.


Introduction
The success of InnoSAT having a primary mission of capturing images is strongly influenced by its attitude, position and the light intensity suitable for image capturing [1].Information about attitude and position of the satellite is also required by the control system to make attitude correction from its reference and attenuate incoming disturbances when the satellite is performing its mission.The attitude determination and control system (ADCS) play an important role for the satellite carrying out its mission ensuring the satellite stay in its orbit for the whole mission and during its expected life time [2], [3].The attitude is expressed by the angular position and angular velocity of the satellite in body frame relative to orbit frame and the position is expressed by a vector in Earth Centered Inertial frame.Generally, the attitude is directly provided by attitude sensors (like gyroscope and accelerometer), because of the power and weight limitations, attitude is determined or estimated using optimal combination of two ISSN: 1693-6930 TELKOMNIKA Vol. 9, No. 3, December 2011 : 583 -594 584 position sensors, where the accuracy of the estimated attitude can be an issue in attitude control [4].
InnoSAT orbits the Earth in the Low Earth Orbit (LEO) at altitude about 680 km from the Earth with orbit eccentricity 1e-5 and 9 o inclination from the equatorial line.InnoSAT has allowable maximum weight about 3kg with dimension 10 cm width, 10 cm length, and 30 cm height.The allowable maximum power consumption of all installed sub-systems is limited only 15 Watt.A graphical representation of InnoSAT is shown in Figure 1.
Figure 1.InnoSat Attitude determination methods have been studied, developed, used many types of sensors and applied for many types of satellites for the recent years [5], [6], [7].The use of various number North star tracker to determine attitude using QUEST, Enhanced QUEST and first-order Kalman filter have been implemented in GOES spacecraft and analyzed the accuracy of estimated attitude [8].The accuracy of EKF for estimating the attitude using sun sensor and magnetometer has been analyzed for AAU Cubesat at no eclipse and introduce albedo correction [9].The use of only a star tracker based vector observation to determine attitude using q-davenport, SVD, QUEST, ESOQ1, ESOQ2, and FOAM method has been analyzed for the accuracy of point to point data and the execution time for small satellite [10].The student satellite nCube used light sensor (LDR) to estimate attitude using EKF, LKF, and DKF and produce significant attitude error [11].The satellite HITSAT-1 used magnetometer and gyro to estimate attitude using EKF and analyzed the accuracy for the attitude angle and its angular rate [12].Pico-Satellite UWE-2 used sun sensor and magnetometer and complemented by GPS to determine attitude using TRIAD and EKF [7].The single point optimal attitude determination using modified Rodrigues parameter approach has been used and analyzed the accuracy and the speed of deterministic approach [13].
Previous study of the three-axis attitude determination for LEO satellite using only magnetometer measurement is successfully presented in [14], [15] which estimated small attitude and rate angle and produce acceptable attitude and rate error.A similar approach was performed for LEO EgyptSat-2 using only magnetometer measurement at big attitude angle (in detumbling mode) was presented in [16] and showed that estimated attitude produced quite big attitude error.From [17], [18] found that attitude determination using only magnetometer measurement did not properly provide three-axis attitude information, therefore it requires other measurement from different sensor or another magnetometer measurement.Basically the problem of attitude determination rises while attitude determination system (ADS) has to estimate three-axis attitude/rate simultaneously using limited measurement sensor [19].
After the integration of all sub-systems in InnoSAT structure, it was found that the center of gravity of the satellite was not coincided with center of body axis which caused moment of inertia coupled each other.Therefore, the attitude and rate of one axis automatically are affected by other axis.Based on the literature review and geometry of InnoSAT, the effort of this paper is to develop low cost three-axis attitude determination using combination of two different measurement sensors which came from sun sensor and magnetometer at big attitude angle (in detumbling mode) and slow angular rate with coupled moment of Inertia of InnoSAT.The attitude is determined using deterministic (point-to-point) approach and recursive approach using Extended Kalman Filter (EKF).The paper will evaluate only the accuracy of estimated attitude using both methods.The accuracy of the attitude is very important because the estimated angle will be used by attitude control system (ACS) to stabilize the satellite while the satellite is in detumbling and pointing mode.Although this attitude determination will be used as secondary attitude determination but the accuracy the ADS must meet the design requirement of InnoSAT.Inevitable, using sun sensor as attitude determination has inherent weaknesses, particularly while the satellite experiencing eclipse and albedo [17].Therefore, the paper evaluates the accuracy of estimated attitude of both approaches while the satellite experiencing the eclipse and no eclipse and try to find out the strategy to implement both approaches in ADS.The effect of albedo will not be evaluated in this paper.One of the EKF advantages is accommodating nonlinear dynamics of a system in its algorithm to forecast next estimate attitude.Embedding nonlinear dynamic into ADS could burden the processing time of the processor in ADS especially while the ADS is running in real-time.The accuracy of estimated attitude using nonlinear and linear dynamic in EKF algorithm also evaluated in this paper.

Research Method 2.1 Mathematical Model of InnoSAT
EKF method needs mathematical model of the system to forecast next estimate attitude.Mathematical model of InnoSAT consists of two main parts; the kinematic and dynamic model [20].The kinematic model describes the orientation of satellites in space and the dynamic model describes the attitude of the satellite with respect to body or inertial frame.Due to singularity problem for high angle rotation, kinematic and dynamic model of InnoSAT is represented in quaternion [2], [3], [5].Kinematic model is represented as differential equation of quaternion and formulated as, ( ) 1 2 where q t is real part and ( ) 1:3 q t is complex number of quaternion and is the angular velocity of body with respect to orbit frame.The Dynamic model in quaternion is derived from Euler's moment equation, where angular moment acting on a body about its center of mass equals to the time rate of change of its angular momentum.So, the total angular momentum variation of rotating body is equal to the applied torques to the body [5], [21].The dynamic model of InnoSAT is formulated as, where I is the satellite's moment of inertia, is the angular velocity of the body frame with respect to inertial and ( ) T t is external torque applied to the satellite.The The satellite orbit in Low Earth Orbit (LEO), there the external torque comes from gravity gradient torque.From [2], [3], [21] the gravity gradient torque is defined as, The linear model can be achieved by making Jacobian matrix of equation ( 7) with respect to state and input vector at equilibrium state.The state for linear model is defined as x t q q q q ω ω ω The dynamic matrix of linear model ( ( ) The input vector for linear model is defined as ( ) and its equilibrium value is TELKOMNIKA ISSN: 1693-6930 Deterministic and Recursive Approach in Attitude Determination for InnoSAT (M.Fadly) 587

Quaternion Estimation Method (QUEST)
Point-to-pint based attitude estimation of quaternion can be done by solving Wahba's problem.The problem is formulated as an eigenvector problem and directly estimates an optimal attitude quaternion by minimizing Wahba's equation [10], [13], [22], [23].For a given set of 2 n ≥ observation vector, a loss function is formulated which is known as Wahba's problem and given by, ( ) where j w is weight of the th j observation vector, j r is a vector in the orbit frame with respect to body frame j b .Equation ( 10) is known as loss function which is minimized using orthogonal procrustes problem [8], [13], [22], [23] and Wahba's loss function can be rewritten as, ( ) ( ) where B defined as, The problem of equation ( 11) is minimized through maximizing trace R B and finding optimal quaternion that maximizes bilinear form of equation ( 10) and Rodrigue's formula [23], the gain of lost function becomes, where K is 4x4 matrix which is equal to, The optimal quaternion can be determined by normalizing each eigen value K with its maximum eigen value as, The maximum eigen value can be calculated using the equation which was defined in [9] and formulated as, ( )( ) The optimal quaternion opt q using QUEST is estimated by applying the Cayley-Hamilton theorem together with Gibbs vector, where Gibbs vector is solved by the technique of sequential rotation due to a singularity close to angle π as stated in [9], [10], [24].The QUEST optimal attitude quaternion is formulated as, where γ and x are given by, ( ) ( )

Extended Kalman Filter (EKF)
EKF consist of two main parts; time update and measurement update [25], [26].Time update is used to predict next estimate value and measurement update is used to correct the error.Attitude estimation using EKF is initiated by describing non-linear differential equation of a dynamic system [6], [15], [27].The general nonlinear differential equation is defined as, ( ( ) where ( ) t w is process noise which is represented as Gauss white noise and k v is measurement noise and represented as Gauss white noise.The EKF requires derivation of nonlinear dynamic to forecast the next estimation.Due to EKF is in discrete; the derived dynamic is converted using discrete Euler series [28] becomes, ( ) where s T is sample time.Measurement matrix is derived from rotation matrix from orbit to body frame and defined as, where elements of the matrix come from the relation of sensors with dynamic of the system and defined as, ( ) ( ) S + is sun vector in orbit frame at time 1 k + .The time update is produced from, and the measurement update is produced from, where k K is matrix of Kalman gain, R is measurement noise matrix, k P is the priori error covariance matrix, and

Results and Analysis
As InnoSAT has not been launched yet, the actual measurement data of sun sensors and the earth's magnetic field cannot be obtained directly from the satellite.In order to perform functional and performance test of the attitude determination methods and software the sun sensor and magnetic field measurement data are provided from Satellite Tools Kit (STK) ver.6.21 (2005).Assumed the there is no noise inserted in the measurement data.The simulation is performed using real geometry of InnoSAT as shown in Table 1 and its initial position plan in orbit formatted by NORAD is listed as two line element (TLE) as shown in Table 2 The STK scenario simulates InnoSAT attitude in two revolutions orbit with one second of sample time to synchronize the sampling time of the controller.The simulation generates sun and magnetic field vector in body and orbit frame as well as its attitude and angular velocity in body frame.
The attitude determination calculation begins from the extraction and deciphering of orbital elements from TLE (in Table ).The extracted orbital data will be used by Kepler model to produce satellite position vector in ECI frame [9], [23].The ECI vector is a basis to determine sun and magnetic field vector by using sun model and International Geomagnetic Reference Field model (IGRF) respectively.The sun model produces sun vector in ECI frame and IGRF model produces magnetic field vector in ECI frame.In this paper the orbit frame is chosen as a reference attitude and the body frame as output attitude.The vector of sun and magnetic field in orbit frame is produced by transforming the vectors in ECI frame using rotation matrix from ECI to orbit frame [23].The vector of sun and magnetic field in body frame is obtained from measurement of sensors (in this paper it is provided by STK software).
Attitude determination using QUEST begins by creating B matrix in equation (12) which consists of sun and magnetic field vector in orbit and body frame as, where b S is sun vector in body frame and o S is sun vector in orbit frame.b B is magnetic field vector in body frame and o B is magnetic field vector in orbit frame.The Z matrix is built from B matrix using equation ( 15) to form K matrix using equation ( 16).The maximum eigen value of K matrix is calculated using equation (17).The optimal attitude quaternion using QUEST is produced by calculating equation (18).
The EKF estimates the attitude by performing time and measurement update based on reference vectors, measurement vectors, and nonlinear dynamic recursively.The process of state estimation using EKF is described by the following steps: 1. Choose arbitrary initial value for estimate and conjugate state ( ˆ( 0) ( 0) x k x k = = = ).In this paper state initial value of estimate and conjugate state is chosen from initial true attitude (data from STK simulation at t=0).The values are, [ ] ˆ(0) (0) 0.4565 0.5396 0.4557 0.5411 0.0007 -0.061 0 3. Calculate Kalman gain using equation ( 27) by giving initial value of error covariance and measurement matrix as listed in Table 3. 4. Update new estimated state using equation (28). 5. Update covariance matrix P and covariance matrix propagation P using equation ( 29) and ( 26) respectively.6. Update new state propagation value using equation (25).7. Continue the process in step 2 through 7 until last number of data.

P P =
P 0 =diag(1e-3 1e-3 1e-3 1e-3 1e-3 1e-3 1e-3) Q Q=diag(6.25e-16.25e-1 6.25e-1 6.25e-1 6.25e-1 6.25e-1In order to see physical attitude value of the satellite, the optimal attitude in quaternion is converted to Euler and represented in the figures below.θ angle of InnoSAT using QUEST, nonlinear dynamic EKF and linear dynamic EKF as well as errors between the true and estimated attitude for two revolutions orbit.The figures also represent the estimated attitudes while the satellite experiencing eclipse.The eclipse position is calculated based on satellite's range from sun and earth as explained in [23] During eclipse, sun sensor cannot measure the proper position of the sun that causes the QUEST unable to estimate the true attitude properly.But for the EKF, the sun vector in body axis can be obtained from sun model by transforming the sun vector in ECI to body frame.Table 4 represents the accuracy analysis of estimated attitude using QUEST, nonlinear dynamic EKF, and linear dynamic EKF only during no eclipse.The table shows maximum error, mean error, maximum mean square error and error standard deviation of each estimated value.The table shows that the largest error of attitude Yaw coming from QUEST, the Roll coming from EKF, and Pitch coming from EKF.The largest mean error of attitude Yaw is coming from EKF, the Roll coming from EKF, and pitch coming from EKF.So, from overall accuracy of estimated attitude, QUEST gave better accuracy than EKF.But the most important is that both approaches fulfill the design requirement of InnoSAT [29].From the Figure 2 until 7 show that EKF produces very big attitude error at the beginning of the iteration and need about 400 seconds (samples of data) to produce proper estimated value compared with QUEST that just need about 3 seconds (3 samples of data).Table 5 represents the comparison the accuracy of EKF using nonlinear and linear model without eclipse.The table shows that the accuracy of nonlinear model which outperforms the linear model but does not provide significant value of the accuracy between both.
The QUEST gave better accuracy than EKF while the satellite experiencing no eclipse but QUEST gave worst accuracy while the satellite experiencing the eclipse.The problem is how to switch the estimated value from QUEST to EKF or vice versa.The switching from QUEST to EKF or otherwise could possibility introduce some problem for attitude control.Figure 8 shows a zoomed view of estimated YAW that captured from Figure 2 at the transition area before and until eclipse.It can be seen that the error of QUEST attitude enlarges drastically in a short amount of time when the satellite starts to enter the eclipse.This shows that if method switching from QUEST to EKF is performed after the satellite experiences eclipse and the QUEST value is fed to the control system, the satellite would be disoriented for awhile.This disorientation could waste a significant amount of energy because the controller will make reorientation of the attitude.If the satellite performs the method alternately (uses EKF during eclipse and uses only QUEST during non eclipse) in order to save power, the switching has to done before the satellite enters the eclipse approximately 400 seconds before eclipse, because EKF requires a stabilizing period to produce proper attitude estimate and ADCS has to provide the algorithm to predict the eclipse.

Conclusion
This paper has successfully demonstrated deterministic and recursive approach of attitude determination method for InnoSAT.The deterministic approach used QUEST and recursive approach used EKF for linear and nonlinear dynamic model.Both approaches were able to estimate the attitude using two position data from sun and magnetic field sensor.Both approaches produced estimated variables which met the design requirements of InnoSAT.The deterministic approach produced better performance than recursive one when the satellite is not in eclipse but vice versa during the eclipse period.The use of linear and nonlinear model to estimate the attitude using EKF (Kalman) did not give significant difference in the accuracy.Attitude determination for InnoSAT will be used QUEST at no eclipse and EKF in linear model will be used during the eclipse.The switching from QUEST to EKF is performed about 400 seconds before eclipse and switching from QUEST to EKF is performed about 2 seconds after the satellite leave the eclipse.
Deterministic and Recursive Approach in Attitude Determination for InnoSAT (M.Fadly) 585

where b ob ω
is angular velocity of body with respect to orbit, o io ω is angular velocity of orbit with respect to inertial, and b o R is orthogonal rotation matrix from orbit to body frame.The angular acceleration ( ) b ib t & ω is derived from equation (3) with respect to time becomes, S is a skew symmetric operator.Due to the satellite rotates in direction counter clockwise w.r.t Earth Centre Inertial (ECI), the satellite in its orbit w.r.t ECI.

3 c=
is the third column of rotation matrix from orbit to body frame ( b o R ).The following torque comes from control torque and formulated as, is the Earth magnetic field vector in body frame.The other torque comes from disturbance ( ) d T t which comes from exterior and interior elements of the satellite.From equation (1) to (6) the satellite nonlinear model becomes,

TELKOMNIKAFigure 8 .
Figure 8. Zooming of yaw angle ( ) ψ at transition point from no eclipse to eclipse area

Table 2 .
TLE data of InnoSAT

Table 4 .
Accuracy analysis of estimated attitude without eclipse

Table 5 .
Accuracy analysis of EKF for nonlinear and linear model without eclipse