Singular value decomposition based satellite attitude determination using different sensor configurations

Satellite’s attitude can be determined by using several different ways. In order to use a recursive filter to determine the attitude especially after crucial intervals for the satellite including detumbling, eclipse, etc., single-framemethods can be used, and singular value decomposition (SVD) method has been selected because of its robustness for this paper. They can be placed for the initial values, or continuous input to the filter in addition to covariance matrix at each step. Also, sensor configurations depending on the position of the Sun are considered and used in the SVD method. Wahba’s loss function is minimized with separating the basic matrix including the reference and model vectors into singular values because many researches show the SVD as the most robust algorithm after error analyses between several single-frame methods. Sun sensor, magnetometer, and horizon sensor are the selected common attitude sensors for small satellites in order to compare their attitude determination performances. For this purpose, absolute errors for different sensor configurations in the simulation environment in addition to the RMS errors are presented. The purpose of the paper is to present an attitude determination concept for a nanosatellite. Also, different sensor configurations are considered in the single-frame method with switching logic depending on the vector data. Horizon sensor and sun sensor are the optimum pair for the light side of the Earth on the other hand, during the eclipse; horizon sensor and magnetometer give the most accurate results. Study shows that the proposed algorithm can be performed for initial values to the Kalman filter, and in the transient phase before the filter tuned in practical satellite usage. In the eclipse period, sun-independent sensors are used and changing configurations provide better attitude estimation results to filtering techniques.


Introduction
The orientation of the satellite on-orbit is called satellite's attitude.Small satellites have specific restrictions to be satisfied such as mass, cost, computational capability and so on.However, off-the-shelf attitude sensors became very common in the market or the universities are developing their own sensors with gaining space heritage.This leads to use small, low cost satellites for many missions.The restrictions and performance limitations for satellite's attitude determination and control system should be satisfied using the mission requirements.
Attitude determination and control subsystem of a small satellite has an importance for having the spacecraft and the instruments directed to specific direction.There are several methods for determining the satellite's attitude using attitude sensors.Sun sensor, magnetometer and horizon sensor are very common sensors for nanosatellites because of the sensors being cheap and commercial on the market with different mass and size options.After the determination of the attitude, using the actuators, satellite should be pointed into the specified orientation.To determine the attitude, reference directions are necessary to define for using them in the methods developed.For doing that, two or more vectors should be used as reference directions.Given a reference vector, the orientations of these vectors can be obtained by using the measurements of the attitude sensor.Single-frame method is one of the common methods used for small satellite attitude determination system.In this method, vectors coming from the selected sensor data and developed models can be placed in Wahba's problem [1][2][3].Coordinate systems used as reference frame and body frame can be transformed to each other with necessary input parameters.Hence, there are no data about the satellite dynamics in those algorithms.The accuracy of the satellite's attitude is required by the scientific payload, which shapes the mission requirements.In [4], for Delfi-n3Xt, required ADCS pointing accuracy is 5°w hich have been achieved using magnetorquer based attitude control for their nanosatellite test platform.
In order to design Kalman filter using the satellite dynamics with the traditional approach, the nonlinear measurements of reference directions including Earth magnetic field, Sun, etc., are used [5][6][7] for both satellite attitude and rate estimation.For a satellite, launch and beginning of the orbiting are critical time intervals.During these intervals, attitude can be estimated by making use of the sensor measurements like single-frame methods.In [8], a simple method is suggested for attitude estimation of low Earth orbiting satellite in the Sun acquisition mode.In [9], an algorithm is proposed having switch logic depending on the phase of the mission, eclipse period, critical angular velocity, and critical attitude.If the satellite's angular velocity did not exceed the critical angular velocity 0.5°/s and the sun is visible, then TRIAD method is used to determine the attitude down to 60°.After that, Kalman filter steps in, with using TRIAD's last determined angles as its input.
In this paper, SVD method is used to determine the satellite's attitude using two or three vector measurements coming from sun sensor, magnetometer and horizon sensor.Those coarse attitude results can be used in several ways.Firstly, after detumbling the satellite in orbit using B-dot algorithm, angles can be reduced in the vicinity of desired coarse attitude about 20°for maximum, in this paper.Then, Kalman filter is generally performed in order to estimate attitude precisely with using input angles.That is why it is necessary to determine the initial values for filter, which is coming from the single-frame method, SVD in this study.Their results can be used as inputs for either beginning of the filter or all the time.Integrated singleframe and Kalman filter algorithm is a non-traditional method because it uses the linear measurements rather than the nonlinear ones [10][11][12][13].Also, covariance matrix can be determined for each step of the SVD and the trend of their results for each axis follows the line of the absolute angle errors.Attitude angle estimations and covariance from SVD are the inputs for tuning the filter at all steps for this case.For example, SVD method is used that provides an initial attitude estimate to Unscented Kalman filter in [14] for a cubesat.Here, the reason of the usage of the SVD is to estimate the satellite's attitude with faster convergence and robustness during the tuning of the attitude estimators.Even in eclipse, acceptable attitude angles are estimated for AAUSAT3 satellite.
In this research, switching between the sensor configurations provides better attitude angle accuracy than using only one sensor pair.Eclipse is the most challenging time interval for the satellite in the operation mode.However, even in the eclipse period, SVD can determine the satellite's Euler angles in which sensors are switched to horizon sensor and magnetometer with the knowledge of no sun sensor data coming.For small satellites, power limitation, another challenging issue, is overcome by using a switching algorithm that prevents all sensors from operating at the same time.Here, the satellite does not reach to the desired coarse attitude, so the considered case is before the filtering starts.In addition, this result is important for the nontraditional Kalman filtering case to increase the accuracy of the attitude angles in eclipse because of lower covariance and better attitude angles from SVD.

Coordinate frame definitions
Four references are used in the algorithm in order to obtain attitude of the satellite.ECEF frame is required in order to transform a coordinate one to another as a pre-step.Position of the satellite and magnetic field direction vector from IGRF model are in ECEF system for their algorithm steps to transform all into ECI and finally OC and SBC.Explanation of the coordinate system acronyms used in the algorithm is introduced in Table 1.
SBC and OC are the main coordinates for attitude determination system.Attitude angles are found using transformation/attitude matrix from orbit to body reference system; therefore, rotation of the satellite can be represented as the Euler angles (roll, pitch, yaw about x, y, z axes in orbit respectively).In OC, the z-axis points towards nadir, the x-axis points towards the velocity vector for a near circular orbit and the y-axis along the orbit antinormal.The SBC will nominally be aligned with the OC frame at zero pitch, roll and yaw attitude.Since the sun and satellite orbits are propagated in the ECI frame, transformation between ECI and OC frames is required and can be calculated using the satellite's position and velocity which are obtained in the orbit propagator algorithm (SGP4) [15].
3 Satellite equations of motion and measurement models

Satellite equations of motion
Euler angle representation can be seen in equations (1.a)-(1.c) to be used in the simulation environment as the actual attitude information.Mathematical expressions for satellite's rotational motion can be represented in terms of angular velocities and initial-angle knowledge for all the directions (x, y, z).Euler method is used to propagate both the angles as roll, pitch, yaw (f, u, c) respectively) and the Euler angles that are time-dependent also use angular velocities that can be obtained from the dynamic equations of the satellite in equations (2).
w y ðiÞ ÞðJ x À J y Þ=J z ; ð2:cÞ where J is the inertia matrix including principle moments of inertia (J x , J y , J z ), Dt is sampling time and N T is the disturbance torque vector.

Earth's magnetic field direction
Magnetic field should be modelled in order to use the magnetometer data for attitude determination.The variations in the Earth's geomagnetic field are related to the dynamo within the Earth's core, and crust which is taken into consideration in this study, see (3).Here, IGRF (International Geomagnetic Reference Field) is used for the magnetic field model (in nano Tesla), defining 4-inputvariable (r, u, f, t), using numerical Gauss coefficients (g, h)the global variables in the IGRF algorithm [16].IGRF 12 with updated coefficients up to 2020 is considered in this paper.In equation ( 3), a = 6371.2km is magnetic reference spherical radius as, u is colatitude (°) and f is longitude (°).

Sun direction
Sun direction in the ECI frame can be modelled.The ecliptic longitude of the Sun is l ecliptic and the linear obliquity of the ecliptic is e [17].The unit Sun direction vector (S ECI ) in ECI frame can be obtained as in equation (5).Measurement model of the Sun direction vector (S o ) is modeled, and sun sensor measurement vector (S b ) is formed in equation ( 6) with transforming into the body frame in addition to zero mean Gaussian white noise.

Nadir direction
In order to model horizon sensor in body frame (N b ), nadir direction (N o ) which has the normalized value 1 in the z direction (0, 0, 1) is used.Here, the nadir vector representing the horizon sensor can be found using equation (7).
4 Attitude determination using SVD

Attitude matrix
Wahba defined a problem which aims to minimize the loss between chosen reference and measured unit vectors in 1965 [1].In equation ( 8), b i (set of unit vectors in body frame) and r i (set of unit vectors in reference frame) with their a i (non-negative weight) are the loss function variables obtained for instant time intervals.
To simplify the loss function, B matrix can be defined.Equation (10) shows that trace of the product of transformation matrix A and transpose of the defined matrix B in ( 9) should be maximized with using statistical methods where l 0 = P a i .In this study, singular value decomposition (SVD) method is chosen to minimize the loss function problem as the optimal statistical method [18,19].
The matrices U and V are orthogonal left and right matrices respectively and the primary singular values obey the inequalities P 11 ≥ P 22 ≥ P 33 ≥ 0. To find the rotation angles of the satellite, transformation matrix should be found in equation ( 12) first with the determinant of one.

Covariance matrix
Rotation angle error covariance matrix (P) is necessary for determining the instant times, which gives higher error results than desired.

Simulation results
In order to evaluate the performance of the four different sensor configurations presented in this paper, several simulations are performed.The simulation cases are categorized by the measurement devices and in/out of the eclipse condition.For sensor measurements, the sensor noises are characterized by zero mean Gaussian white noise and it is assumed that the sensors are calibrated against sensor biases, scale factors, etc. Simulations were performed for 5000 s which is almost one orbital period of the satellite.Measurement frequencies for all of the sensors are 1 Hz also the algorithm is updating itself with 1 s sampling time.Conditions of the simulation environment can be seen in the second column of Table 2.
In the first example, Euler angle results found in SVD by using sun sensor & magnetometer, and those propagated as actual values from kinematic equations are compared.During the eclipse mode, sun sensor measurements are not available which can be seen in Figure 1.Here, the covariance matrix (P) from SVD can help the filtering methods including EKF, UKF, etc., so the filter can be tuned using this aid mechanism even in the eclipse.However, some different configurations should be investigated especially for the eclipse period because of no data coming from the sun sensor.These sensor configurations can be seen in the first column of Table 2.
Angle errors for different sensor configurations are given in Figure 2 as three panels (phi, theta, psi respectively) for the satellite's period excluding the eclipse.For the first and the third panels, 'hs' configuration has the minimum mean error 2.3 and 0.25°for phi and psi respectively that can be also seen as constant line in the panels.In the second panel, 'sm' configuration has the minimum mean error 0.58°for theta which is very close to the 'hs' configuration.
RMS (Root Mean Square), that is more rational error representation technique than mean, errors can be seen in Tables 3 and 4. The first analysis is run considering only the satellite orbiting on the light side of the Earth.As seen, horizon and sun sensor configuration is superior to the others as a complementary result from Figure 2.  In Table 3, RMS errors can be seen for 4000-5000 s interval, which is outside of the eclipse.Moreover, Table 4 represents the RMS error considering only the satellite orbiting on the dark side of the Earth opposite of Table 3.Here, the configuration independent from the Sun is superior to others as expected.3 sensor configuration can be used too if additional computation loads of the switching algorithm is not wanted.As seen from the tables, 3 sensor configuration has very close results to the attitude angle results having minimum error for both in eclipse and out of the eclipse.
Figure 3 is a complementary figure that is showing the angle results of SVD comparing with the actual values for three axes.The results of the switching algorithm are better than the results using only horizon and sun sensor for   all period because self-configurable algorithm written based on the RMS results switches the sensors depending on which side of the satellite at (dark/light side of the Earth).The attitude error for whole period of Figure 3 is about 6°calculated by taking the square root of the mean of the square of the errors of the three attitude angles, which corresponds to the error of the Euler rotation angle.
Here, in the eclipse period hm (horizon sensor + magnetometer) and in the light side of the Earth hs (horizon sensor + sun sensor) sensor pair is used to obtain more accurate results than the non-switching algorithm case (see Fig. 3).

Conclusion
In this research, singular value decomposition (SVD) method is used in order to determine attitude of the satellite.Simultaneously working sensors may lead to exceed the power usage for attitude determination and control system unit.Therefore, the method with switching configurations is proposed especially for small satellites in which the power is limited.Moreover, the attitude angle results are improved by switching the sensors depending on both the covariance analysis and the eclipse for low Earth orbiting small satellites.The configuration including sun sensor and another selected sensor fails in eclipse period because of no sun vector observations.Horizon and sun sensor are the most reliable sensors for outside of the eclipse, so this configuration is used whenever the sun sensor measurements are available.On the other hand, the configuration having horizon sensor and magnetometer can estimate attitude in eclipse although it is a coarse estimate having about 3.8°, 3-axis mean RMS error.Those errors can be reduced with the usage of the satellite dynamics; therefore, the recursive algorithm which is sensitive to covariance matrix and the errors coming from the SVD, can use the presented method as a pre-step.

B
o ðr; u; f; tÞ ¼ À∇ a Transformed magnetic field model in the body coordinates (B b ) with adding a defined noise matrix on the magnetic field model in orbit frame (B o ) is formed as sensor model.In the mathematical model, o indicates the orbit frame and b indicates the body frame at the subscripts of the vectors.Magnetometer measurement vector (B b ) can be found as

S ECI ¼ cos l ecliptic sin l ecliptic cos e sin l ecliptic sin e 2
where s1 = P 11, s2 = P 22, s3 = det(U)det(V) P 33 called secondary singular values.If the satellite only has two sensors (e.g.sun and magnetic field sensor), SVD method fails when the satellite is in eclipse or when the two observations are parallel with the same trend of the absolute error results.However, different configurations of the sensors are considered depending on the covariance analysis to reduce error caused by this situation in this research.

Fig. 1 .
Fig. 1.Angles using sun sensor and magnetometer in SVD for whole orbital period.

Fig. 2 .
Fig. 2. Angles using sun sensor and magnetometer in SVD for the period excluding eclipse.

Fig. 3 .
Fig. 3. Angles using different sensor configurations and switching algorithm in SVD for whole period.

Table 2 .
Conditions and sensor configurations used in the simulations.

Table 3 .
RMS errors for all configurations for outside of the eclipse.

Table 4 .
RMS errors for all configurations for eclipse period.