Non-Linear Control Strategies for Attitude Maneuvers in a CubeSat with Three Reaction Wheels

Development of nanosatellites with CubeSat standard allow students and professionals to get involved into the aerospace technology. In nanosatellites, attitude plays an important role since they can be affected by various disturbances such as gravity gradient and solar radiation. These disturbances generate a torque in the system that must be corrected in order to maintain the CubeSat behavior. In this article, the kinematic and dynamic equations applied to a CubeSat with three reaction wheels are presented. In order to provide a solution to the attitude maneuvering problem, three robust control laws developed by Boskovic, Dando, and Chen are presented and evaluated. Furthermore, these laws are compared with a feedback control law developed by Schaub and modified to use Quaternions. The simulated system was subjected to disturbances caused by a Gravity Gradient Torque and misalignments in the reaction wheels. The effectiveness of each law is determined using the Average of Square of the Commanded Control Torque (ASCCT), the Error Euler Angle Integration (EULERINT), the settlement time, the estimated computational cost (O), and the steady-state error (ess). Keywords—Attitude control; attitude maneuvers; adaptive control; feedback control; CubeSat; Quaternions; reaction wheels; comparison


I. INTRODUCTION
The CubeSat standard, developed in 1999, is intended to reduce development time and costs, as well as increase accessibility to space for students and teachers [1]. As the control of attitude maneuvers is a key factor in the performance of a CubeSat, the aim of this research is to compare and choose the most adequate control law to perform rest-to-rest maneuvers under constant and non-linear disturbances.
Sidi [2], Slotine [3], and Márquez [4] defined the attitude problem as a system of two non-linear matrix equations. Among the attitude system controllers, the one presented by Sidi in [2] is observed. Sidi linearized the attitude equations for small angles and applied PID controllers using Euler Angles and Quaternions. However, this controller was not effective under external disturbances. Control algorithms have also been developed for non-linear systems. These include a feedback control developed by Schaub in [5] where Modified Rodrigues Parameters (MRP) are used to describe the attitude of a satellite, and a Variable Speed Control Moment Gyro (VSCMG) is used as an actuator. Although Schaub's control algorithm had a quick response to constant errors of the inertia tensor, it did not guarantee a quick response to external disturbances. Adaptive control laws have also been developed following the guidelines described by Slotine in [3]. Also, Dando [6] proposed an adaptive control law based on sliding surfaces that calculated the error between the real and the calculated inertia tensor instead of estimating the tensor of inertia itself as proposed by Ahmed in [7]. Nevertheless, this method was only valid for a constant error. Scarritt in [8] estimated a gain applied to the modeled inertia tensor and a rotation associated with the misalignment of the reaction wheel obtaining a robust control algorithm with a high computational cost (O).
All the controllers mentioned above neglected the input control constraints. However, Boskovic [9] focused on evaluating stability under saturation inputs obtaining a robust control algorithm based on the variable structure control. Boskovic's controller was independent of the inertia tensor and has a lower computational cost (O) than the average robust algorithms but its disturbance rejection property cannot be observed. Similarly, Chen [10] developed a robust controller that considered input constraints based on the fast non-singular terminal sliding mode surface (FNTSMS). This controller needed an inertia a priori information but was capable to reject nonlinear disturbances and to keep the tracking error around zero. However, only non-asymptotic stability was guaranteed in a finite time.
This article is divided into the following sections: Section II presents the dynamic and kinematic equations for a rigid body. In Section III, the equations that describe the attitude for a CubeSat with three reaction wheels are introduced. Sections IV and V present the equations necessary to simulate the gravity gradient torque and the internal disturbances torques produced by reaction wheels misalignment. Section VI presents a bibliographic review of adaptive control laws developed by Dando, Boskovik, and Chen. Also, a modification of the control law developed by Schaub to use three reaction wheels instead of VSCMG and Quaternions instead of MRP is presented. In Section VII, simulations subject to the aforementioned perturbations and to a miscellaneous torque were performed. In order to measure the effectiveness of the control algorithm, a comparison was made applying five criteria. The first criterion of comparison is the steady-state error (e ss ), the second is the Error Euler Angle Integration (EULERINT) used by Sidi in [2], the third is the Average of Square of the Commanded Control Torque (ASCCT) presented by Xiao in [12], the fourth is the settlement time, and the fifth is the estimated computational cost (O). Finally, the results, conclusions, and future work are shown in Sections VIII, IX, and X, respectively.

II. ATTITUDE EQUATIONS
Two equations are required to describe the attitude of a rigid body. First, the kinematic equation that describes the motion of the satellite itself without taking into account the action of forces. Second, the dynamic equation that takes into account the torques acting on the body.

A. Kinematics Equation
The kinematics can be described using Euler Angles, Rodrigues Parameters, Modified Rodrigues Parameters, Quaternions, and other parameters derived from these. In this article, Quaternions are used for the description of attitude [13] [14].

The kinematic equation for rotations between
where 'Ξ(q)' is defined in (2).
'q' is a Quaternion that describes the rotation of the inertial frame to the body frame and has the following form: A Quaternion 'q' has a scalar part denoted by 'q 4 ' and a vector part denoted by 'q 13 = [q 1 , q 2 , q 3 ] T '. Also, 'q' must have a unit norm to describe a pure rotation, as seen in (4).

B. Dynamics Equation
The dynamics of the CubeSat, neglecting the effect of the reaction wheels and modeled as a rigid body, is described by (5) [17].ω Where: • ω: Angular velocity of the satellite relative to the inertial frame.
• L: External torque applied to the center of mass expressed in the body frame.

III. THREE REACTION WHEELS CUBESAT MODEL
To consider the effects that reaction wheels have on the system, a CubeSat is simulated with three reaction wheels with the distribution shown in Fig. 1.
'J B ' is defined as the inertia tensor without contributions from the reaction wheels and the general inertia tensor 'J B ' is defined in (6) according to [4]. Where: • W l : Rotation axes.
• J ⊥ l : Reaction wheel inertia perpendicular to the axis of rotation.
• J l : Reaction wheel inertia parallel to the axis of rotation.
Decomposing (6) and taking into account the distribution of the reaction wheels in Fig. 1, the general inertia tensor is defined by (7).
In the case of reaction wheels with radius 'R rw ' , thickness 'd rw ' and mass 'm rw ', the parallel and perpendicular inertias are defined by (8) and (9), respectively.
www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 11, 2020 The dynamics of the satellite is defined in (10) according to [2] and [4]. Where: • L: External torque applied to the center of mass expressed in the body frame.
• L rw : Torque delivered by reaction wheels.
• H w B : Angular momentum delivered by the reaction wheels.
Equation (6) excludes the inertia of the reaction wheels parallel to the rotation axis since this is considered as a body that rotates freely when the reaction wheel is turned off. However, the parallel inertias are taken into account when the general angular momentum of the system is evaluating (11).
The angular momentum delivered by the reaction wheels is defined by (11): where Ω l represents the angular speed of the reaction wheels.
Particularly, (11) is expressed as follows: where J rw is defined by (13).
The torque produced by the reaction wheels can be calculated with (14).
Finally, the attitude for a CubeSat with three reaction wheels is fully modeled with (1) and (15), the acceleration of the reaction wheels can also be calculated with (16).

A. Gravity Gradient Torque
The external torques that affect a CubeSat are various. However, for low orbit satellites, the major disturbance that a CubeSat is exposed to is the gravity gradient torque 'L gg ' which is defined in [13] and [19] as (17).
• r 3 c : Distance from the center of earth. • C(q):Attitude Matrix.

V. REACTION WHEELS DISTURBANCES
Among the most common disturbances, the friction presented in the motors of the reaction wheels [11] and the misalignments [12] are considered.

A. Reaction Wheel Misalignments
The reaction wheel configuration presented in Fig. 1 is an ideal configuration. In practice, the torque produced by the misalignments is modeled as shown in Fig. 2. Adapted from [12].
The equation (20) describes the total torque produced by the reaction wheels when the misalignment angles are small.

VI. CONTROL LAWS
In this article, three control laws for attitude maneuvers are compared. In order to maintain consistency throughout the article, the nomenclatures of each author were changed to those defined in [13] by Markley & Crassidis as shown in Appendix A (Table VI). The 'u' control signal becomes the torque delivered by reaction wheels 'L rw ' from (10).
Before starting to describe the control laws, first define the Quaternion error 'δq' between the CubeSat's attitude 'q'and the desired attitude 'q d ' according to Scarritt [8].
(IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 11, 2020 Where: And the angular velocity error is defined as 'δω = ω −ω d '. Where 'ω' is the angular velocity of the CubeSat relative to the inertial frame expressed in the body frame and 'ω d ' is the desired angular velocity expressed in the frame of the body.
In most cases, only the desired angular velocity expressed in the inertial frame 'ω dR ' is available. Then, the rotation matrix 'C(δq)' is needed to express it in the body frame [6].

A. Quaternion Feedback Controller
The tracking problem is defined by the error variables 'δω' and 'δβ' defined in (26).
The control law is defined in (27).
Where 'K' and 'P' are positive definite matrices. Lyapunov's candidate function is defined by Schaub in [5] as (28).
The dynamics of the closed-loop model is defined by (29).
Where d B dt is the derivative with respect to the body frame. By deriving (28) and replacing it with (29), (30) is described as follows: It can be seen that (31) is a positive semi-defined function. Thus, the system is stable. However, since (28) is dependent on two variables, asymptotically stability can not be ensured.
Nevertheless, using the Mukherjee and Chen theorem [18] we can show that the closed-loop system is asymptotically stable. However, it is important to mention that the value of the calculated inertia tensor will never be equal to the real inertia tensor. Hence, the equation (27) is rewritten as (32).
Where 'J * B ' and 'J * rw ' are the calculated inertia tensor and the matrix of parallel inertias calculated for the reaction wheels, respectively.

B. Boskovic Robust Controller
Boskovic's work [9] is based in the variable structure approach and his control technique does not require previous knowledge of the inertia tensor. In addition, Boskovic designed an adaptive gain that allows to compensate the disturbances torques and to ensure that attitude and angular velocity errors will tend to zero.
The control law proposed by Boskovic is given by (33).
Where 'δ k ' is a positive constant, 'K(t)' is the adaptive gain and 'u max ' is the torque limit for all control torques. The Boskovic Sliding Vector 's(t)' is defined by (34).
where 'γ' is a positive scalar and is called the convergence rate.

C. Dando Adaptive Controller
The adaptive control law proposed by Dando [6] is intended to estimate the error of the inertia tensor instead of the inertia tensor itself.
The closed-loop error dynamics are first defined in (36).
The Dando Sliding Vector is defined in (37).
And the other parameters are defined as: In this control, a priori knowledge of the inertia tensor with a certain level of uncertainty is assumed as defined in (40).
Where 'J B ' is the real satellite inertia tensor and 'J * B ' is the calculated inertia tensor and 'J E ' is the inertia uncertainty. The control law is given by (41) and (42).
Equation (42) is a torque related to the uncertainty inertia tensor. In order to develop an adaptive control, Dando parametrized 'ũ(t)' in terms of 'θ' defined by (43).
And the adaptive law to estimate 'θ' is given by (47).

D. Chen Robust Controller
The robust control law proposed by Chen [10] is based on the Fast Non-singular Terminal Sliding Mode Surface (FNTSMS) method and adaptive control methods to compensate the inertia tensor uncertainties under constraints in the reaction wheels.
The Chen Sliding Vector is defined in (48).
The system to compensate the actuator saturation is defined in (51).
The Chen Control Law is given by (52).
Equations for 'u r ' and 'u n ' are defined in (57) and (58) respectively.
Where 'U max ' is the maximum control torque delivered by the reaction wheels, 'a' is positive constant, and 'i=1,2,3'.

VII. NUMERICAL SIMULATIONS
Numerical simulations were carried out to perform regulation maneuvers for long angles. The block diagram shown in Fig. 3 describes how simulations were performed and the parameters taken from [15]. Parameters, initial conditions, and desired attitude can be seen in Tables I, II, and III, respectively.
The second-order Simpson's rule, shown in Appendix B, was used as the numerical integration method and the fourthorder Runge-Kutta algorithm was used to approximate the solution in differential equations. Simulation time was 200 seconds with a total of 100,000 iterations with a step of 0.2 milliseconds.

A. Attitude Regulation Maneuvers and Torque Magnitude Constraints
The rest-to-rest attitude maneuver for a non-spinning Cube-Sat is simulated with all control laws subject to saturation with a maximum torque of 13.45 ×10 −3 Nm emulating the physical limitations of the reaction wheels. Euler angles, angular rate error, and control torque are shown in Appendix C (Fig. 9, 10, 11, and 12), respectively.

B. Disturbances Torque Rejection
In order to evaluate the Disturbance Torques Rejection, a miscellaneous disturbance torque was added as follows: The results obtained were shown in Euler Angles since the attitude Quaternion does not have any physical sense. The conversion of Quaternions to Euler Angles was carried out using the asymmetric XYZ sequence. The results obtained are shown in Figures 4, 5, 6, and 7.

C. Evaluation of Performance Between Laws of Control
To compare the efficiency of the different control laws, several articles have been published [4][5] [6]. Precision, computational cost, and stability are used as evaluation criteria in [20]. In [21], a performance index that considers both the thruster activity and the attitude tracking performance is used.
In this paper, five criteria of comparison have been used: EULERINT, ASCCT, settlement time at 5% (t s ), average computational cost (O), and steady state error (e ss ).
• Error Euler Angle Integration (EULERINT). Sidi [2] defines it as the integral of the error angle about the Euler axis of rotation. This is a quality indicator since it shows the accumulated angle error that the CubeSat travels to reach the desired position. The adapted formula to calculate it with Quartenions is described in (62). This parameter is similar to the attitude tracking performance metric defined in [21].  • Average of Square of the Commanded Control Torque (ASCCT). It is defined by [12] as a measure of magnitude equivalent to the effective average torque exerted on the three satellite axes. This parameter is similar to the thruster activity performance metric defined in [21].
• Computational Cost (O). The average time that the algorithm takes to calculate the new control command 'u'.

VIII. RESULTS
This section presents the results obtained in the numerical simulations developed in Section VII. The results obtained from Sections VII-A and VII-B are shown in Table IV and  Table V, respectively. 10 −9 Nm for the Gravity Gradient Torque is obtained as seen in Appendix D (Fig. 13).

IX. CONCLUSION
In this article the simulation and comparison of four control laws in a CubeSat environment were carried out to find the most efficient control law that will be applied in the authors' future CubeSat projects.
The Quaternion Feedback Controller explained in Section VI-A is a basic algorithm that needs previous knowledge of the inertia tensor. Although, the miscellaneous torque rejection in this algorithm is not robust, it has an acceptable behavior rejecting constant inertia tensor uncertainties as can be seen in Fig. 4 and 9. However, the steady-state error is higher than the other robust algorithms and stability cannot be ensured in the case of control input constraints.
The Boskovic Robust Controller explained in Section VI-B is a robust algorithm that was developed considering the control input constraints so the authors ensure its global stability. To avoid the problem of chattering in the simulations, gain values for the adaptive parameter 'k' were chosen in order to not achieve convergence before the attitude and angular rate errors. As seen in Fig. 5, the controller does not reject the miscellaneous torque completely but the estimated computational cost is lower than the other robust algorithms as seen in Table IV. Moreover, the ASCCT parameter is the lowest but the EULERINT is only lower than the quaternion feedback algorithm.
The Dando Adaptive Controller law explained in Section VI-C is a robust algorithm that need a priori knowledge of the inertia tensor. Global stability cannot be ensured because this algorithm is not evaluated with control input constraints. Even though the saturation time to perform the maneuver is minimal, the behavior of the control law can be acceptable as seen in Fig. 6 and 11. The disturbance rejection is similar to Boskovic Controller but its steady state behavior is better than the other control laws.
The Chen Robust Controller law explained in Section VI-D is a robust controller that takes into account the control input constraints and needs a priori knowledge of the inertia matrix. Even though the asymptotic convergence in a finite time cannot be ensured as seen in Fig. 7 and 8, the disturbance rejection is better than the other controllers. In the simulations, the minimum steady-state is 0.02 degrees and the ASCCT torque needed to produce the rest-to-rest maneuver is the highest.
In order to choose the best control algorithm the priority was given to the steady-state error because it allows to perform precise attitude maneuvers. As a second evaluation criterion, the EULERINT parameter was chosen since it allows to perform a maneuver with the least possible error. Computational cost (O) was not consider a major factor as complex algorithms are not a challenge in modern micro-controllers. The settling time (ts) was not relevant for the chosen application.
Following these guidelines and according to the results obtained, it can be seen that the best performing control law for rest-to-rest maneuvers is the Boskovic Control law. This controller is capable of maintaining a steady-state error of 0.71 × 10 −6 degrees while rejecting disturbances caused by misalignment, gravity gradient, and miscellaneous torques.
X. FUTURE WORK Further research will implement and compare the studied control laws in an air bearing testing platform as proposed in [15]. Also, it is interesting to evaluate the performance of these control laws under noise effects and uncertainties in the overall system. Moreover, based on [20], further work will be focused on the measurement of the current consumed by each reaction wheel and the overall electric potential in each maneuver.  APPENDIX A Nomenclature used in this paper taken from Markley's book [13] .
APPENDIX C The rest-to-rest attitude maneuver for a non-spinning Cube-Sat simulated in Section VII-A.  APPENDIX D Gravity Gradient Torque described by (17) in Section IV. www.ijacsa.thesai.org