Super-Twisting Sliding Mode Control Law Design for Attitude Tracking Task of a Spacecraft via Reaction Wheels

-e attitude control has been recognized as one of the most important research topics for spacecraft. If the desired attitude trajectory cannot be tracked precisely, it may cause mission failures. In the real space mission environment, the unknown external perturbations, for example, atmospheric drag and solar radiation, should be taken into consideration. Such external perturbations could deviate the precision of the spacecraft orientation and thereby lead to a mission failure. -erefore, in this paper, a quaternion-based super-twisting sliding mode robust control law for the spacecraft attitude tracking is developed. -e finite time stability based on the formulation of the linear matrix inequality (LMI) is also provided. To avoid losing the control degree of freedom due to the certain actuator fault, a redundant reaction wheels configuration is adopted. -e actuators distribution associated force distributionmatrix (FDM) is analyzed in detail. Finally, the reference tangent-normal-binormal (TNB) command generation strategy is implemented for simulating the scenario of the space mission. Finally, the simulation results reveal that the spacecraft can achieve the desired attitude trajectory tracking demands in the presence of the time-varying external disturbances.


Introduction
Sliding mode control (SMC) techniques have been a popular research topic of the control theory in recent years such as adaptive super-twisting SMC [1][2][3], fractional-order sliding mode control [4], finite time control [5], robust backstepping SMC [6][7][8], and model predictive SMC [9]. e superior robustness to the matched perturbations is one of the features of the SMC. However, the price of the robustness is the chattering effect of the control signal. It causes application difficulty for practical implementations [10]. e ways to attenuate the chattering phenomenon include the following [11][12][13]: (i) replacing the discontinuous switching function with a saturation function or a sigmoid function, (ii) applying an adaptive law to adjust the switching gain dynamically, and (iii) using the higher-order SMC techniques. Nevertheless, skill (i) results in losing the robustness to the disturbances. Even though approach (ii) can estimate an adequate magnitude of the switching gain with respect to perturbations [14,15], the estimation of the switch gain could increase monotonically due to the absence of perfect sliding motion in practice. For (iii), the gain/ stability determinations are quite challenging. e high-order SMC approach can drive the sliding variable and its consecutive derivations to zero in the presence of the matched perturbations. However, the main challenge of the high-order SMC is that it uses the information of the high-order time derivatives of the sliding variable [16][17][18]. Among the higher-order SMC techniques, it is worth remarking that the second-order SMC such as the super-twisting algorithm only needs the feedback information of the sliding variable in control process. e supertwisting algorithm was firstly proposed by Dr. Levant in 1993 [19]. A quadratic Lyapunov function proposed in [20] is considered in the proof of the finite-time convergence property. e successive researches include [21][22][23][24]. Owing to the superior properties, the super-twisting algorithm has been applied in several studies, including quadrotor [25,26], industrial emulator [27], and mobile wheeled inverted pendulum [28]. For this reason, the robust continuous super-twisting sliding mode algorithm will be adopted for the attitude tracking control design in this paper. e reaction wheel driven based system is actuated by means of generating the reaction torque from the wheel. e reaction wheel has been widely applied in the most dynamics systems. In literature [29][30][31], the reaction wheels are used in the attitude tracking control demands. e works in [32,33] use the reaction wheel to address the balancing control of the inverted pendulum. e main objective of this paper is to apply the super-twisting algorithm for the attitude control of the spacecraft via using four reaction wheels as the actuated source.
e attitude representation includes several approaches, eor example, Euler angles, Rodrigues parameters, and quaternion [34]. To avoid singularity, the quaternionbased control is considered. e quaternion-based control has been proposed in several studies [30,35,36]. However, it assumes that the scalar component of error quaternion q 0e does not equal zero to guarantee that the matrix 0.5(q 0e I 3 + q × e ) is invertible. is assumption leads to the controllers containing a singularity when q 0e � 0. It should be noted that one of the reasons to use quaternion-based control is to obtain the full attitude tracking task and avoid any singularity limitations. As a result, in this paper, a quaternionbased super-twisting sliding mode algorithm is adopted in the controller design such that the robust performance can be guaranteed. e asymptotic stability proof of the nonlinear reduced-order dynamics by means of an analytic solution will be addressed without imposing assumptions.
Regarding the organization of this article, in Section 2, the governing equations of attitude dynamics based on the quaternion kinematics and the redundant reaction wheels configurations are derived. e configuration is introduced from [30,37,38]. To obtain the feasible reaction torques, the FDM is reformulated as a square and invertible matrix, which minimizes the control energy cost [30]. In Section 3, a robust, continuous super-twisting sliding mode algorithm is considered in the controller design so that the spacecraft can handle the external perturbations in the real and complex space environment. e stability problem will be reformulated as a feasibility problem of a LMI and therefore the finite time stability can be achieved in the sense of Lyapunov. In Section 4, the reference TNB command generation strategy is proposed to verify the tracking performance of the spacecraft. In Section 5, the numerical simulation is carried out and the results reveal that the spacecraft can track the desired attitude trajectory in the presence of time-varying disturbances. e contributions of this paper are summarized as follows: (i) realizes the super-twisting sliding mode algorithm as a robust, continuous quaternion-based attitude controller for the attitude trajectory tracking demands of a spacecraft with the redundant reaction wheels; (ii) proposes a modified version of LMI which has higher degrees of freedom for finding the decision variables and it can satisfy the convergence performance by requirement; (iii) derives the analytic solution of the nonlinear reduced-order dynamics; and (iv) presents a reference TNB command generation strategy so that the feasibility of the controller can be verified.

Geometry Configuration Analysis.
From the perspective of practical realization, to avoid losing a degree of freedom of control in space due to certain actuator faults, the redundant reaction wheels configuration is adopted [30,37,38]. e dynamic configuration is shown in Figure 1. To formally derive the governing equations of the attitude dynamics, we firstly define the coordinate system as follows: (i) the body frame denoted as xyz, which is fixed in the body of the spacecraft to represent the attitude of the spacecraft, and (ii) the auxiliary rotation frame denoted as x i y i z i , which is fixed in the i-th reaction wheel to describe the relative rotation of i-th reaction wheel to spacecraft.
Taking the first reaction wheel as an example, the geometry mapping relation between xyz and x 1 y 1 z 1 is explained in Figures 2 and 3, respectively. Referring to Figure 2, the body frame xyz rotates about the z-axis with an angle β, and the new frame is denoted as x ′ y ′ z ′ . From the rotation property, the mapping relation between x ′ y ′ z ′ and xyz can be constructed as Regarding Figure 3, the frame x ′ y ′ z ′ rotates about negative y-axis with an angle α, and then the new frame x ′′ y ″ z ′′ is obtained. Again, from the rotation property, we have the mapping relation between x ′ y ′ z ′ and x ′′ y ″ z ′′ : On the basis of previous illustrations, the mapping relation between xyz and x 1 y 1 z 1 can be derived by combining (1) and (2): In general, the mapping relation between xyz and x i y i z i can be formulated as where 2 Mathematical Problems in Engineering and β i � β + 0.5(i − 1)π, i � 1, 2, 3, 4.

Attitude Dynamics.
To avoid the singularity problem in the Euler approaches, the quaternion-based attitude representation is considered. Let Q � [q 0 , q T ] T � [q 0 , q 1 , q 2 , q 3 ] T ∈ R 4 be the unit quaternion and let ω � [ω x , ω y , ω z ] T ∈ R 3 be the angular velocity of spacecraft; then the quaternion kinematic equations are given by e above equations can be rewritten in a compact matrix form: where e symbol a × represents a cross product matrix of vector a � [a 1 , a 2 , a 3 ] T ∈ R 3 , which is defined as In the following, the kinetic equations based on the redundant reaction wheels configuration will be derived. Let Ω i , i � 1, 2, 3, 4, be the relative rotational speed of each reaction wheel to the spacecraft; then the angular velocity of each reaction wheel with respect to x i y i z i is given by e angular momentum of spacecraft relative the body frame xyz is

Mathematical Problems in Engineering
Assume that the reaction wheels are perfect circle plate. Hence, the moment of inertia matrix of i-th reaction wheel with respect to x i y i z i is e angular momentum of each reaction wheel relative frame x i y i z i can be constructed: Mapping H w,i onto spacecraft body frame xyz yields e total angular momentum of the system (spacecraft and reaction wheels), H T , is the summation of H and H B w,i , which is Define the following: (i) Equivalent moment of inertia matrix of the system: (ii) Force distribution matrix (FDM): (iii) Axial moment of inertia matrix: Combining (17)- (20), equation (16) can be further simplified to where

e Euler equation of motion is given by
in which the total external torque M G is equal to the summation of the external control torques τ a and the external disturbance torques d(t). Substituting (21) into (22) yields Define the control torque τ and the reaction torque τ w as

Mathematical Problems in Engineering
Hence, (23) can be further simplified as In this paper, τ a � 0 is considered. (24), we have

Actuator Analysis. From
Once τ c is designed for the attitude trajectory tracking demands of the system dynamics (6), (7), and (25), it is desired to obtain each reaction torque τ wi . However, FDM (19) is a nonsquare matrix, so the inverse does not exist. To obtain the FDM with a special matrix structure, the two following geometry constraints are imposed [30]: or, equivalently, From (27), we have the following FDM: and then the following static optimization problem is formulated [30]: subject to To formally address the problem, refer to [39], and define the Lagrangian L together with the Lagrange multiplier λ � [λ 1 , λ 2 , λ 3 ] T ∈ R 3 as follows: Let τ * w and λ * be the optimal solution. e first-order necessary condition to minimize T is and From (33), it is implied that Combining (34) and (35), the distribution matrix can be augmented as e inverse mapping is Hence, when τ c is designed for the system dynamics (6), (7), and (25), the reaction torque τ wi for each reaction wheel can be obtained by inverse mapping (37). Moreover, it can be guaranteed that the reaction torque is an optimal value τ * w to minimize the performance index (30).

Mathematical Problems in Engineering
Because the reaction wheels are actuated by servo motors, that is, the reaction torques are generated by servo motors, the following linear dynamic equation is considered: From the definition, (24) and (38) become where the parameters a i � 0.02 and b i � 3 are considered. V in,i is the control input voltage. Conclusively, τ c is first designed for the system dynamics (6), (7), and (25). Secondly, inverse mapping (37) is used to obtain the optimal reaction torque τ wi of each reaction wheel to minimize the energy cost (30). Finally, apply (39) to obtain the corresponding control voltage V in,i . In the following, the discussion focuses on how to design τ c so that the desired trajectory can be achieved in the presence of timevarying disturbances.

Super-Twisting Sliding Mode
Algorithm. e design process of sliding mode control includes two steps: (i) A sliding variable s is designed so that the stability of the reduced-order dynamics can be guaranteed. (ii) Seeking the robust, continuous control law to guarantee the sliding mode s � _ s � 0 occurs in a finite time in the presence of the time-varying external disturbances. In the following, the super-twisting sliding mode algorithm [19] is introduced. e super-twisting sliding mode algorithm is one of the outstanding robust control algorithms which handles a system with a relative degree (u ⟶ s) equal to one. Based on the algorithm, the closed-loop sliding dynamics is designed as where s � s(x, t) ∈ R is the sliding variable; x ∈ R n is state vector; d(t) ∈ R is an unknown time-varying perturbation and it is assumed that | _ d(t)| ≤ δ; the gain pair (k 1 , k 2 ) is to be designed so that the sliding mode can occur in a finite time.
In fact, the more general representation of (40) is to express it as the following state-space form. Let where (42) is nonlinear, consider the following variable transformation [20]: Taking the time derivative yields which can be rewritten in the matrix form as For system (45), the stability problem is proven in the following. It is shown that the stability issue can be reformulated as a feasibility problem in terms of the LMI.
Theorem 1 (See [21,22,25]). Suppose that there exist symmetric and positive definite matrices P � P T > 0 and Q c � Q T c > 0 so that the following LMI, 6 Mathematical Problems in Engineering is feasible, where c � 1/δ, C � 1 0 , and A and B are provided in (45). en the quadratic form, is a strict Lyapunov function for system (45) and the trajectory reaches the origin in a finite time.
Proof of eorem 1. Applying the Rayleigh inequality, V is bounded by where ‖ζ‖ 2 � |z 1 | + z 2 2 represents the Euclidean norm of ζ. For (48), taking time derivative gives According to (46), the following inequality is satisfied: which guarantees Hence, (50) can be rewritten as where c � 1/δ. Based on (47) and (49), (53) can be further simplified to Again, from (49), the following inequality can be deduced: Based on (55), it can be concluded that (54) satisfies For (56), one has which implies Hence, V(t) reaches zero within a finite time described by where V(0) is the initial condition of V(t) and α is given by (56). Based on the appropriate gain pair (k 1 , k 2 ) selection, the LMI equation (47) can be established. As a result, the finite time stability as shown by (59) can be achieved.

Theorem 2. Consider the LMI given by (47); there exists a feasible solution P, Q c so that the LMI (47) can be established if and only if the parameters k 1 and k 2 in A satisfy
Furthermore, the additional constraints k 2 ≠ 0 for (60) and k 1 ≠ 0 and k 2 1 ≠ 8k 2 for (61) must also be satisfied.
Proof of eorem 2. If the LMI (45) is feasible, then the L 2 -gain of the following system, must be less than or equal to c; that is, Mathematical Problems in Engineering 7 e above statement is the so-called bounded-real condition [40]. In order to find proper (k 1 , k 2 ) in (62) so that condition (63) can be satisfied, calculate and its derivative e extreme point can be obtained by setting (65) equal to zero. Checking for the second-order sufficient condition d 2 /dω 2 |G(jω)| 2 , it can be deduced that max ω |G(jω)| can be reached, when (67) us, combining (63) and (67) shows that if or k 2 then the LMI (47) is feasible. Moreover, to avoid the singularity of (67), the constraints k 2 ≠ 0 for (68) and k 1 ≠ 0 and k 2 1 ≠ 8k 2 for (69) are made.
□ Remark 1. Notice that system (62) is not a transfer function of system (45); it is the corresponding linear system of LMI (47). More details can be found in [40].

Controller Design.
e control objective is to design a robust control torque τ c such that the spacecraft can achieve the arbitrary attitude trajectory tracking demands in the presence of time-varying disturbances.
For this reason, let Q d � [q 0d , q T d ] T � [q 0d , q 1d , q 2d , q 3d ] T ∈ R 4 be the desired quaternion and let ω d � [ω xd , ω yd , ω zd ] T ∈ R 3 be the desired angular velocity. Define the tracking error vectors Q e � [q 0e , q T e ] T ∈ R 4 and ω e � [ω xe , ω ye , ω ze ] T ∈ R 3 as follows [36]: where ⊗ represents the quaternion multiplication. Based on (70), the quaternion-based error dynamics of (6), (7), and (25) is given by Select the sliding surface as where S � [s 1 , s 2 , s 3 ] T ∈ R 3 ; λ ∈ R 1 is a positive parameter to be designed. Suppose that the sliding motion is fulfilled in a finite time t � t f ; it gives From (71), (72), (74), and (75), the nonlinear reducedorder dynamics can be obtained: e term "reduced-order" means that the system error dynamics described by (71)-(73 with order 7 "reduced" to subsystem (76) and (77) with order 4. In order to analyze the stability of the reduced-order dynamics, apply the identity of unit quaternion: Equation (76) can be decoupled as en, consider the following variable transformation: which implies which implies Clearly, equation (83) is a linear ordinary differential equation. Its solution is given by where C is an integration constant. Apply the inverse mapping from (80); we get Let q 0e (0) be the initial condition; we have Hence, the analytic solution of (79) can be obtained: Observing (87), it can be deduced that (i) the singularity occurs as an improper sliding gain λ is chosen such that (ii) q 0e ⟶ + 1 as t ⟶ ∞ from (87) and q e ⟶ 0 as t ⟶ ∞ from the identity of the unit quaternion (78). Observing (70), it can be found that q 0e ⟶ 1 and q e ⟶ 0 imply q 0 ⟶ q 0d and q → ⟶ q → d . at is, the nonlinear reducedorder dynamics (76) and (77) are asymptotically stable. It is different and more outstanding than [30,35,36]; the assumption that q 0e ≠ 0 is not made. In the following, how to enter the sliding mode in a finite time in the presence of external disturbances by means of the robust control law will be discussed.
In order to introduce τ c , taking the time derivative about (74) yields where Based on the super-twisting sliding mode algorithm [21], the following robust control law is designed: in which the gain matrices are denoted as Substituting (90) into (88) yields the closed-loop sliding dynamics: where D � J − 1 eq d � [D 1 , D 2 , D 3 ] T ∈ R 3 and sign(S) ∈ R 3 is a sign function defined as follows: According to the stability criteria derived from eorems 1 and 2, the following gains are chosen: where δ i � sup( _ D i ), i � 1, 2, 3.

Reference Quaternion Generation from TNB Frame.
In this section, we are going to illustrate how to obtain the reference quaternion from the TNB frame. e procedures are as follows: (1) Reference orbital trajectory: Consider the governing equations of the orbital motion [41]: where r � [X, Y, Z] T ∈ R 3 is the position vector and its magnitude is r � ‖r‖; μ is the gravitational parameter. e reference orbital trajectory can be obtained by integrating (95) in a given initial condition.
(2) Construction of the TNB Frame: According to geometry kinematics, the TNB frame can be constructed by the trajectory information. Let v � _ r be the velocity vector and let a � € r be the acceleration vector. e unit tangent vector can be computed by e unit normal vector can be obtained by e n � a n a n � � � � � � � � .
where a n � a − a t is the normal acceleration and a t � (a · e t )e t is the tangential acceleration. Based on the definition of TNB frame, the binormal vector is (3) Reference Quaternion: Based on the rotational property, the direction cosine matrix (DCM) can be composed by e t , e n , and e b ; that is, Applying the quaternion kinematics, the reference quaternion is (100)

Reference Angular Velocity Generation.
To generate a feasible command trajectory, the following property is proposed [35].

Property 1.
e matrix E(Q) defined in (9) has the following properties: By using Property 1, from (8), the angular velocity and its time derivative can be expressed as Hence, the formula of the desired angular velocity ω d associated with the desired quaternion is

Numerical Simulation
According to [42], the numerical data are considered and summarized as follows.
(i) Moment of inertia of the spacecraft and reaction wheels is as follows:    With regard to Figure 4, it is demonstrated that the spacecraft tracks the reference TNB attitude trajectory successfully. e attitude of the spacecraft with respect to the global frame XYZ is represented as xyz. e response of quaternion tracking errors is shown in Figure 5. It can verify the derivation of analytic solution (87) that the scalar component q 0e ⟶ 1 and the vector component q e ⟶ 0 as t ⟶ ∞ and they satisfy the constraint q 0e + q T e q e � 1. Figure 6 illustrates the response of the sliding variable. It can be found that the converging speed of the sliding variables is fast even though the spacecraft is under the environment with the time-varying external disturbances. e evolution  Mathematical Problems in Engineering of the reaction torques is shown in Figure 7. It can be seen that the control signal is smooth and there is no chattering phenomenon. We can deduce that the controller based on the super-twisting sliding algorithm can be realized in the spacecraft attitude control problem.

Conclusion
In this study, the attitude dynamics based on the redundant reaction wheels configuration of the spacecraft is derived. To achieve full degree of freedom attitude tracking control, the quaternion kinematics is introduced. For practical realization purpose, the nonsquare FDM is reformulated as a square, invertible matrix by means of solving a static optimization problem. e robust, continuous supertwisting sliding mode algorithm is adopted in the attitude controller design to guarantee robust performance in the presence of exogenous disturbances. Furthermore, the corresponding finite time stability based on the LMI is provided in the sense of Lyapunov. Asymptotic stability of the nonlinear reduced-order dynamics is proven by means of an analytic solution without imposing any limitation in quaternion. In a space mission with this scenario, the TNB command generation strategy is presented. Finally, the simulation results verify that the spacecraft can achieve the arbitrary attitude trajectory tracking demands in the presence of the time-varying external disturbances.

Data Availability
No data or software is included in the submission.