Pointing stability results:

## Abstract

Small satellites have begun to play an important role in space research, especially about new technology development and attitude control. The main objective of this research is the design of a robust flight software, in which the key feature is suitably designed control laws to guarantee the robustness to uncertainties and external disturbances. To accomplish the desired mission task and to design the robust software, a classical Proportional Integrative Derivative (PID) method and two robust control system technologies are provided, focusing on applications related to small satellites and on the real-time implementability. Starting from PID approach, simulations are performed to prove the effectiveness of the proposed control systems in different scenarios and in terms of pointing stability and accuracy, including uncertainties, measurement errors, and hardware constraints. Different control techniques are analyzed: (i) a tube-based robust model predictive control (MPC) and (ii) a variable gain continuous twisting (CT) sliding mode controller. Both controllers are compared with loop shaping PID controller.

### Keywords

- precise attitude control
- continuous twisting controller
- model predictive control
- pointing stability
- variable structure control

## 1. Introduction

The attitude tracking of rigid bodies, i.e., spacecraft systems, is an active research area [1, 2], since every system works in a harsh environment far from direct human control. In detail, a space system requires a subsystem that can autonomously handle and control the attitude dynamics. This subsystem has the main purpose of controlling the orientation of the spacecraft with respect to an inertial reference frame. This subsystem includes sensors and actuators to measure the orientation and to apply the torques needed to change the orientation.

This research will focus on small satellites, i.e., object with mass lower than

Due to the presence of uncertainties and dynamical constraints, the main objective of this research is to design and compare different *robust* control systems for attitude tracking. The two proposed control methodologies are based on model predictive control theory [11, 12] and on variable structure theory [13, 14]. A first definition of robustness, although not so rigorous, can be the capability of the control system to work well under sets of parameters different from the nominal one. For example, these parameters can be uncertainties within the system, not known but bounded.

Both of the proposed methods have advantages and drawbacks, briefly described in the following. As explained in [15], a model predictive control approach is able to effectively handle constraints on torque magnitude and attitude angles and can be more effective than other classical methods. However, a high computational effort is required to solve online the optimization problem. Focusing on robust approach, in this chapter, a tube-based robust MPC (TRMPC) is proposed, which focuses on two main goals: (i) the robustness to additive disturbances and (ii) the computational efficiency of a classical MPC, due to an offline evaluation of the constraints. Thanks to this control strategy, the uncertain future trajectories lie in sequence of sets, known as *tubes*, and the online MPC scheme is applied *only* to the nominal trajectories, representing the center of the tube itself as in [16].

The second proposed methodology is based on variable structure strategy [13], in which the control law is a function of the system state and changes among the possible structures according to some suitably defined rules. In particular, in sliding mode controller (SMC) systems, a switching function is designed, which implicitly defines a sliding surface corresponding to the points in the state space in which the switching function is zero. At any time, the structure applied by the control law depends on the position of the state with respect to the sliding surface. When a sliding motion is established, the closed-loop system is in sliding mode, and its trajectories are constrained on the sliding surface. Sliding mode methods provide controllers which can counteract uncertainties and disturbances, if the perturbations affecting the system are matched and bounded (first-order SMC) [17] or smooth matched disturbances with bounded gradient (second-order SMC) [14, 18]. One of the main drawbacks of SMC methods is the chattering phenomenon, which excites the high-frequency unmodeled dynamics in practical applications. Moreover, the performance of the control system is affected by the quality of the measurements and of the computation frequency of the system [19]. For this reason, our idea is to design a Continuous Twisting Sliding Mode Controller (CTSMC) with adaptive gains [20, 21]. The peculiarities of this controller are (i) adaptation of the gains, (ii) continuous control inputs, and (iii) the external disturbances which are included in the definition of the control gains.

For both the proposed controllers onboard, hardware limitations are included in the design and implementation. As clearly explained in [22], limited computational resources and reduced sampling time can be a problem in the design of robust controller. Moreover, the sample frequency reduction in the SMC design implies a residual chattering, which can be reduced with the introduction of a hyperbolic tangent [23]. A comparison with a Proportional Integrative Derivative (PD) controller, in which the gains are defined from loop shaping theory [24], is also proposed.

The chapter is structured as follows. In Section 2 mathematical models of the spacecraft are described, with an emphasis on the external disturbance definition. Section 3 is focused on the definition of mathematics and implementation of the two proposed control laws: (i) TRMPC and (ii) CTSMC. In this section the real-time implementability of both controllers is included. Simulation results are detailed in Section 4, in which a *nadir* pointing nominal attitude with an additional *roll* pointing is performed. Finally, concluding remarks are proposed in Section 5.

## 2. Mathematical models

Section 2 introduces in detail all the mathematical models, designed and implemented for the design of an orbital simulator. Attitude dynamics and quaternion kinematics are introduced to identify the system. Moreover, a detailed description of all the external disturbances is provided, with a focus on LEO maneuvers. Finally, a complete description of the different actuation configurations is included, starting from NASA configuration to tetrahedral.

### 2.1 Spacecraft attitude dynamics

In the present section, the mathematical model of the rigid body attitude dynamics is described. The rigid body attitude dynamics are described by Euler’s equation:

where *reaction* torque, i.e., the torque applied to the spacecraft structure has opposite sign with respect to the torque generated by the electric motors of the wheels, this torque has to be considered *internal*, and hence the *minus* sign is considered. Torque is achieved by momentum exchange between the reaction wheels and the rest of the spacecraft body. Eventually, the spacecraft angular velocity,

The attitude of the spacecraft is expressed in *quaternion* form. The use of quaternions is very common in space applications. The advantages of using the quaternion notation are that singularities that may occur using the classical Euler angles^{2} are completely eliminated, since the quaternion expresses a specific attitude unambiguously. In the following, some fundamentals required to understand the use of quaternions will be provided, while for a more detailed discussion, please refer to [25].

A quaternion is basically a vector of four elements:

where the vectorial part,

A quaternion of the form

is the *unitary* quaternion, and it represents an attitude which is perfectly aligned with the selected reference frame.

The quaternion kinematics is described by

where

The quaternion inverse is defined as the normalization of the conjugate quaternion, i.e.,

### 2.2 External disturbances

In the low Earth orbit (LEO) environment, four main sources of orbital disturbances which affect the attitude and orbit dynamics of a spacecraft can be found: residual atmospheric drag, gravitational disturbances, solar radiation, and electromagnetic disturbances. The last two sources of disturbances present a lower magnitude with respect to the other sources, so they are described but not detailed in the following. A brief summary of LEO disturbances is presented in [26].

#### 2.2.1 Atmospheric drag

The drag disturbance is due to the residual atmospheric gases which impact on the surface of the spacecraft. At high altitude, above 100 km, the residual atmosphere cannot be considered a continuum medium anymore, and a discrete medium model must be considered: the free molecular flow model. Indeed, the residual atmospheric drag is computed by considering the momentum exchange between the gas particles and the spacecraft. When hitting the surface of the spacecraft, some particles may be completely or partially reflected, depending on the number of factors, such as surface and incident flow temperature, molecular weight of particles, speed of the spacecraft, and more. To consider such effects, the accommodation coefficient has been introduced in order to compute the spacecraft drag coefficient by Cook [27]. The analysis of Cook shows that in some cases it may be useful to accurately compute the drag coefficient of a spacecraft; however, there are other uncertainties in the atmospheric models (determination of the exact temperature, density, magnetic flux, and more) such that the computation of the total drag force is affected by uncertainties higher than uncertainties which affect the computation of the drag coefficient. The work of Koppenwallner [28] analyze the real data of three spacecraft (CHAMP, GRACE, and GOCE) in order to derive a method to determine the drag coefficient of slender spacecraft. In this method, the effect of the accommodation coefficient is evaluated and compared with the results of CFD analysis. This method allows an easy computation of the drag coefficient depending on the ratio between the frontal and side areas. As already mentioned, this method can be applied only to spacecraft with simple shape. The work of Huges [29] proposes the computation of the drag force and torque integrating the incident flow on the surface of the spacecraft, without computing the drag coefficient. In this case, the accommodation coefficient is always required to compute the normal and tangential drag force applied to the surface. To compute the drag torque, the computation of the center of pressure is required. For simple shape, e.g., a plate with constant mass density, the center of pressure is located in the center of the plate area. For complex shapes, the total center of pressure can be computed by summing the contribution of the number of plates used to discretize the whole spacecraft surface.

For the purpose of this work, the computation of the residual drag force is carried out using the easiest method:

where

The drag torque is eventually computed:

where

#### 2.2.2 Gravity gradient

Gravitational torque is due to the differential gravitational force which acts on the spacecraft. As shown in Figure 1, two equal masses

where ^{2}/kg^{2} is the universal gravitational constant, *minus* sign in Eq. (10) is due to the fact that the force is directed to the center of the central body. Since

Extending this behavior to the whole body of a spacecraft, the following result is obtained:

where

Equation (12) has been obtained applying Eq. (10) to the infinitesimal mass element

#### 2.2.3 Other disturbance torques

As mentioned at the beginning of Section 2.2, there are other sources of torque disturbances which affect the attitude dynamics of a spacecraft. The first is a magnetic torque due to the residual magnetic dipole that can affect the spacecraft. This torque is due to the interaction between the residual magnetic dipole

An additional disturbance torque is due to solar radiation. This torque is produced by photons emitted by the Sun which exchange momentum with the surface of the spacecraft. Clearly, this disturbance is present only if the orbit of the spacecraft is in the sunlight. When the orbit of the spacecraft is shadowed by the eclipse of the Earth, this disturbance is not present. The magnitude of this torque depends on the activity of the Sun, which presents seasonal variations according to the Sun’s cycles. For spacecraft with a compact shape and without long appendages, the magnitude of this torque is usually lower than the effect of drag and gravity; hence, this disturbance may be neglected.

Other disturbances are due to internal torques, due to fuel sloshing, and/or due to flexible modes which are present for spacecraft with flexible solar arrays or appendages [30]. In particular, the attitude control of a flexible spacecraft must be properly designed, since a bad-designed closed-loop attitude control may excite flexible modes of the spacecraft instead of damping them, causing a catastrophic failure of the mission.

### 2.3 Actuators

To control and stabilize the attitude of a spacecraft, it is necessary to apply torques to the spacecraft structure in order to reorient it and/or to maintain the desired attitude counteracting external disturbances. There exist a number of actuators which are able to accomplish this task, with different working principles and application scope:

Reaction control thrusters (RCT)

Magnetic torquers (MGT)

Control moment gyroscopes (CGM)

Reaction wheels (RWS) and/or momentum wheels

*Reaction control thrusters* are basically small rocket motors (chemical thrusters). The simplest RCT is composed of a combustion chamber and an expansion nozzle. Both fuel and oxidizer are introduced in the combustion chamber, and they are ignited (with a capaciitive discharge, torch ignition, or using hypergolic propellants), and then the exhaust flows in the nozzle^{3} accelerating and exchanging linear momentum, producing thrust. To produce torque, RCT are grouped in a RCS, and they are commanded coupled: two thrusters, installed at a certain distance from each other and firing in opposite direction, are activated simultaneously, producing a defined torque. If thrusters are throttable, i.e., the amount of thrust can be regulated, also the produced torque can be regulated; differently, if they are not throttable, only a fixed amount of thrust, and consequently torque, is generated, then other modulation techniques should be used to obtain a throttable torque (e.g., pulse-width modulation (PWM) modulation). For large spacecraft, e.g., Space Shuttle, chemical thrusters are used, since they produce a high amount of thrust. For smaller spacecraft, cold gas thrusters may also also be used: in this actuators the combustion chamber is eliminated, and the thrust is produced by the gas flowing from the storage tank to the nozzle by opening (or closing) the flow control valve (FCV). Such type of thrusters is not throttable.

RCTs may be used for two different purposes. The main use is to desaturate reaction wheels and/or control moment gyros: they are activated in order to provide the external torque which contrasts the torque due to the wheel deceleration or gyros reorientation. An additional method is that they are used combined with a different main actuator system (RWS or CGM) when the required torque is too high to be provided by the main system. RCT are also used to generate the force required to accomplish the orbit control task (execution of orbital maneuvers or station-keeping).

*Magnetic torquers* produce force, and torque, by generating an electromagnetic field which interact with the magnetic field of the Earth. Since their performance is linked to the electromagnetic field of the Earth, their effectiveness decreases with the orbit altitude, and they cannot be used during interplanetary missions. For these reasons, they are mainly used in small or all-electric spacecraft for desaturation of momentum accumulation devices (RWS or CGM). Examples of application are found in the Hubble Space Telescope [31].

*Control moment gyroscopes* consist in an assembly of gyroscopes spinning about an axis which can be tilted and consequently change the angular momentum vector of the devices. Differently from RCT and MGT, which are mostly on/off actuators, CMG allows to control the attitude of a spacecraft reaching a very high accuracy, since they can generate a continuous torque by changing the CMG angular momentum. Compared to reaction wheels, CMG are more effective and efficient, since they can produce a higher torque: indeed, they are used to control the attitude of the International Space Station [32]. For mechanical reasons, they are subjected to saturation: when they reach the *gimbal lock*, they are stuck, and they cannot provide further angular momentum change (i.e., torque). When this condition is reached, an external torque must be applied in order to allow CMG to reorient themselves in the original configuration, making them able to provide torque again and restore the attitude control capabilities of the system.

*Reaction wheels* are basically disk masses which rotate about a fixed spin axis driven by an electric motor. By varying the rotation speed, i.e., applying a torque to the wheel, by reaction the same amount of torque is transmitted to the spacecraft structure, and it starts moving. These devices are the most commonly used actuators for fine attitude control due to its simplicity and lower complexity than the CMG, even though they are able to provide less torque and less accuracy than CMGs. RWS are also subjected to two different types of saturation: torque saturation, due to the maximum current that flows into the wires of the electric motor, and momentum saturation, due to the maximum spin velocity before breaking bearings. Once the momentum saturation is reached, RWS must be desaturated in a similar way as for CMG, and external torque, usually provided by RCT or MGT, is applied to counteract the deceleration of the wheels. Once the original condition is reached, RWS starts to provide torque again.

To fully control the three-axis attitude, there are necessarily three reaction wheels, but for redundancy issues, there are usually installed four reaction wheels: in this way, if a wheel failure occurs, a three-axis attitude control is always ensured, even though pointing accuracy may be degraded. The reaction wheel system configuration can be installed using a number of different wheel accommodation, mostly depending on the specific mission since a main control axis may be required. The mostly used configurations are:

NASA 3 + 1: three wheels are aligned with the spacecraft main inertia axis, while the fourth wheel is inclined by 45 deg. with respect to all planes. During nominal operations, only the wheels aligned with the body axis are used, while the fourth wheel is used only during wheel failure.

Pyramidal: the wheels’ spin axes are pointing toward the faces of a pyramid with square base. This means that wheels are inclined with a fixed angle with respect to the base of the pyramid, generating torque along the height of the pyramid, and the projections of the wheel momentum lie in the pyramid base, generating torque along the last two directions.

Tetrahedral: as for the pyramid, in this configuration the spin axes of the wheels are pointing to the faces of a tetrahedron. Hence, a wheel generates torque only along the height of the tetrahedron, while the other three wheels generate torque both in the tetrahedron base and along the height.

Note that, except for the NASA configuration, it is necessary to allocate the three-axis control torque to the four wheel assembly. To do this, it is common to use the Moore-Penrose pseudo-inverse matrix,

In the following of this chapter, reaction wheels are considered as the main actuation system for attitude control accommodated according to the pyramidal configuration.

## 3. Attitude control laws

The objective of Section 3 is related to mathematics and design of two *robust* control strategies for attitude tracking. As detailed in Introduction, two control systems are considered in this chapter: (i) a robust MPC strategy, based on the concept of

### 3.1 Tube-based robust model predictive control

Tube-based model predictive control (TRMPC) is a class of robust controllers, i.e., controllers which are able to cope external disturbances and uncertainties which affect the system. The concept of *tighten constraints*, which ensure robustness of the TRMPC to external disturbances

where

Let us assume that the system is required to satisfy hard constraints on both state and input:

where

As already introduced before, the TRMPC approach is based on the concept of *tube*. The center of this *tube* corresponds to the nominal undisturbed trajectory, which dynamics is defined as

where

Two features of this controller are (i) the TRMPC which allows to steer the uncertain trajectories to the nominal one via a classical MPC approach and (ii) the robustness which ensured tightening the constraints with respect to the initial ones in Eq. (14), as detailed in [12]. Then, the following time-varying feedback control law related to the

in which

Moreover, to stabilize the system with respect to parametric uncertainty

In the next paragraph, the definition of the feedback gain matrix (summarized in Algorithm 1 is analyzed in detail. First, the terminal state constraint set

in which the following edge-uncertain system matrices are defined:

**Algorithm 1** Feedback Gain Evaluation

1: **procedure**

2: **for** each i-th vertex **do**

3:

4: **end for**

5: Solve

6: Get **X** and

7: Get

8: **end procedure**

Since bounded disturbance

As anticipated before, tightened constraint sets shall be considered for the nominal system, properly designed starting from an outer approximation of the minimal robust positively invariant (mRPI) set [36] for (20):

in compliance with the guidelines provided in [12]. The set is mRPI for (20) because *only* additive disturbance has been considered affecting the system dynamics as in Eq. (13). It is important to highlight that the parametric uncertainty is included only for evaluating the feedback gain matrix

Hence, if the time-invariant control law (16) is employed and the nominal system (15) satisfies the tightened constraint sets,

the initial constraints *restricted disturbances* [12].

Since

with

represents a suitable constraint set for the nominal state

is the solution of a linear programming problem. Hence, it is possible to obtain an upper bound of

In a similar way, the constraint set on the control input

starting from the initial control input constraint set

Then, the finite horizon optimal quadratic cost can be defined for the nominal dynamics in terms of nominal state

where

with

**Algorithm 2** TRMPC Algorithm

1: **procedure**

2: *Offline*: Evaluate the feedback gain matrix

3: *Online*: Initialization: for

4: At current time

5: **for****do**

6: Solve Eq. (29) (30)

7: **end for**

8: Get

9: Evaluate

10: Evaluate

11: **end procedure**

Summarizing, the TRMPC control scheme consists in a classical MPC controller applied to the nominal unperturbed dynamics z subjected to the tightened constraints

#### 3.1.1 Comments on real-time implementability

For the implementation of the TRMPC controller on a real hardware, it is necessary to linearize the equation of motion in order to obtain a linear time-invariant system in the classical form:

In the case of attitude control of a spacecraft, the state and control vectors are assumed to be

with

with

where

where

in which

where

The online optimization problem is solved with the *Quad-Wright solver*, which is an improved version of the *quadprog* Matlab solver. The solver returns the optimal control sequence V according to the inputs H, F, L, and W. The first

### 3.2 Variable gain continuous twisting sliding mode controller

Sliding mode control (SMC) found its origin as discontinuous nonlinear controller for nonlinear variable structure systems (VSS). The basic principle of SMC is to steer the system state to lie on a *sliding manifold*: once the system state reaches the sliding manifold, the sliding mode condition holds by applying a discontinuous high-frequency control, despite the external disturbance affecting the system dynamics. One of the advantages of using SMC is that such control law is robust with respect to the so-called matched uncertainties, i.e., uncertainties which affect the control channel of the system. The basic assumption is that such uncertainties must be bounded. The classical first-order SMC is the following:

The gain *sliding variable* and it is designed considering the system state. For an SMC as Eq. (34), the sliding variable is selected as

Since the classical SMC stabilize a dynamic system by applying a high-frequency—theoretically infinite—discontinuous control, such type of controller cannot be used with actuators that must be controlled with a continuous signal, such as reaction wheels. To adapt SMC to continuous actuators, some smoothing techniques can be introduced in order to compute a continuous signal: for example, the “*virtual* control, while the *physical* control will result in as continuous. In the present work, the CTSMC will be further investigated. Let us consider the system:

which represents a linearized attitude dynamics. *Lipschitz*, i.e., it is differentiable with bounded derivative:

According to this control design, it results in

Such gains ensure robustness against Lipschitz disturbances

The controller of Eq. (36) can be redesigned by substituting gains

where *zero* value of

#### 3.2.1 Comments on real-time implementability

A brief discussion about finite-time controllers is provided. In general, SMC controllers, if properly designed, ensure the convergence

## 4. Simulation results

Both control algorithms, described in Section 3, have been applied in an Earth observation mission scenario. The considered spacecraft has a total mass of ^{2}. The spacecraft has a cubic shape with a frontal area of ^{2}. For the drag torque computation, a drag coefficient of *nadir* pointing nominal attitude with an additional *roll* pointing of *roll* pointing phase lasts about *nadir* pointing. The maneuver is propagated for half an orbital period.

The pointing errors for the three proposed controllers (PID, CTSMC, and TRMPC controllers) are depicted in Figures 5, 6, 7. From these figures, the maximum angular error obtained with the CTSMC (Figure 7) is more than one order of magnitude lower than the maximum error obtained with the other two controllers. In a similar way, the angular error obtained during the pointing phase (zoomed figures) is close to

In Figure 8 the computed inputs are depicted, in terms of reaction wheel torque and momentum for each control law. For the TRMPC, the computed input (i.e., torque in body frame) has been derived as

In Figure 9, the chattering effect, observed in the sliding mode controller, is highlighted. Even if some chattering mitigation strategy is proposed [23], the chattering can be observed due to the low controller update frequency (

Eventually, the pointing stability performance index has been evaluated for all the three proposed control algorithms. Pointing stability is defined as *the time-varying effects on science instrument pointing caused by the dynamic interactions between spacecraft structure and mechanisms, attitude control and determination errors, structural thermal distortion, and other environmental disturbances* [39]. For the mathematical evaluation of the pointing stability, the guidelines expressed in [40] have been followed:

where

Controller | Roll [deg] | Pitch [deg] | Yaw [deg] |
---|---|---|---|

PID | |||

TRMPC | |||

CTSMC |

## 5. Conclusions

In the proposed research, small spacecraft attitude tracking with two advanced robust control laws has been developed: (i) a tube-based robust model predictive control and (ii) a continuous twisting sliding mode controller. A detailed mathematical model, with an emphasis on the external disturbances and the actuation systems, is included. Quaternion-based kinematics is proposed, even if Euler angle kinematics is also described, as more intuitive. Mathematics and some implementation details are also described, including the real-time implementability of both controllers. The performance of both controllers are compared with a PID controller. The advantages of using SMC have been presented, highlighting the lower pointing error over the whole considered mission. Moreover, chattering effects of using SMC have been observed, even though they are strongly reduced with respect to classical SMC. It has been also observed that the use of an optimal and robust control, TRMPC, causes an increment in the pointing performance as well, including the advantage of computing directly the optimal control torque for a complex reaction wheel configuration, instead of allocating the reaction wheel torque with the classical pseudo-inverse allocation.

## Conflict of interest

The authors declare no conflict of interest.

## Notes

- For example, in the rotation sequence 3-2-1, known as Yaw-Pitch-Roll sequence, the singularity occurs for a pitch angle of 90 deg.
- Mainly convergent-divergent nozzles are used: the flow accelerates up to supersonic velocity in the convergent part, and then it continues to expand in the divergent segment.