Low Earth Orbit Satellite Attitude Stabilization Using Linear Quadratic Regulator

— This study compares the result of the PID controller to the LQR controller when used in the on-orbit stabilization of a satellite in the low earth orbit. The results from the PID controller show that the controller is too weak when used alone as the controller could not stabilize the system after 500 s which is not even allowable in practical application. For the LQR controller, a performance metric was set which is: i. the settling time is to be ≤ 10 seconds, ii. Maximum power consumption ≤ 1.5 Watts and iii. Zero (0) steady-state error / final value. The LQR controller meets system performance by achieving a settling time of roll (peak amplitude=0.26 s, settling time=10.0 s), Pitch (peak amplitude=0.395 s, settling time=5.52 s), Yaw (peak amplitude=0.350 s, settling time=5.52 s) and Total power consumption are 1.26 watt with a maximum torque of 3.22 mNm. Because power consumption and precision are critical in satellite applications, particularly military surveillance satellites. As a result, for an aerospace engineer to achieve their space mission, for instance, space mission like low earth orbit surveillance satellites, flexible solar panels, a high accuracy pointing accuracy, it will be impossible to adopt a PID controller except the engineer is ready for the complexity of design filters and compensators. An LQR design in this study can take care of all this complexity with minimum power consumption.


I. INTRODUCTION
In satellite engineering and technology, accuracy and reliability are likely to take precedence over numerous other metrics.Aerospace engineers, especially avionics engineers are typically reluctant to take risks and they prefer approaches that have previously been implemented in actual space environments or space control conditions.Owing to the enormous cost (money, time and expertise) of putting a satellite in space, they can't afford to use trial-and-error methods.Notwithstanding the rapid advancement of modern control theories, classical PID control remains unrivalled in aerospace engineering and satellite attitude control and stabilization [1].Since the first space flight in 1957 [2], well over 4000 active spacecraft have landed and are presently in space, with PID serving as the base or foundational controller on more than 98% of them [1].Undoubtedly, existing spacecraft or satellites have evidenced that PID control can satisfy the majority of the vital mission objectives.Numerous strategies, like gain scheduling, and structure-bending filters have been developed to account for the PID controller as baseline controller's insufficiency of adaptability and robustness, which invariably increase weight and power consumption, resulting in satellite control systems becoming more complex that they lack portability and flexibility [1].However, as the demands of space flight increase, satellites do not only need to require different characteristics, like highfrequency oscillations, highly flexible design, low power consumption or unknown dynamics but they are required to have incredibly high-performance standards [3].This pattern puts the PID controller as a baseline control into the test and forces aerospace engineers to employ advanced control mechanisms.
There are various practical instances in which it is important to keep a satellite in a corrected orientation with regards to the Earth, like scanning of cloud cover (weather conditions) for weather prediction, communications, military and scientific observations, the survey of Earth resources, and many others [4].Regrettably, even if a spacecraft is accurately inclined at liftoff or launch, it deviates from this preferred orientation because the problem associated with environmental influences (like solar radiation pressure, Earth's magnetic and gravitational fields interaction, as well as, if the satellites are near the Earth (low earth orbit), it will be affected free molecular reaction forces), internal problem (component failure), and the coupling of attitudinal dynamics (incorrect attitude) with orbital and flexural mechanical systems [5], [6].This complex problem is liberational motion, which must be managed in order to complete a given mission successfully.Therefore, a well-defined space mission and robust satellite attitude control method will be required to solve these problems.The satellite mission requirement determines the satellite attitude control method to adopt, among these control methods are; Magnetic Torquer method [7], [8]: though not expensive, light-weighted but has a problem with accuracy because of the variability of the Earth's Magnetic Field (EMF), Control Moment Gyro (CMG) [9], [10]: the problem encountered with CMG is the singularity problem, a condition in which the CMG is unable to generate torque in a specific direction, and also higher weight, power consumption of the device, and high cost, THRUSTERS [11], [12]: are also rarely used due to fuel mass and volume penalty and its irreversible depletion.
Because of the problems associated with the methods identified above, the reaction wheel method is considered in the study as the actuator and a tune-PID controller and Linear Quadratic Regulator will be designed to control the actuator which is expected to produce a high level of accuracy and eliminate the problems.This study, therefore, compares the tune-PID controller and LQR in the on-orbit stabilization of small satellites in space.

II. RESEARCH BACKGROUND
An earth observation satellite in the low earth orbit will maintain its natural stability and balance via two factors: its velocity and the gravitational influence of the earth [13].To counteract the bigger and more powerful gravitational pull, the satellite orbiting nearer to Earth demands more velocity.Therefore, eight, accuracy, and stability to capture events become big issues for satellite orbit near the earth, especially for surveillance and military applications.
Numerous attitude control approaches have been developed over the years, with several being adopted for practical space applications.They are widely categorized as active, passive, or semi-passive satellite control methods.The active satellite control systems make utilize the satellite's available energy [14], [15] whilst the passive [16] and semipassive systems [17], in contrast, utilize environmental forces to stabilize and control themselves.Satellites in the early years of space travel were generally small, simple mechanical designs, and mainly rigid.This is no longer correct for modern technologically advanced satellites or spacecraft, which may be equipped with large flexible solar panels to match the ever-increasing requirement for electrical power to power onboard electronic instruments, communications systems and scientific experiments.Even some of the recent Micro and nanosatellites come with a lot of complexity that requires active control and advanced control methods for orbital stability, for precision and accuracy.Table I shows the list of some passive control [14], [18], their applications and limitation.While Table II shows a list of active control with their applications and limitations [19], [20].From extant literature, the problem associated with small and microsatellite attitude control and on-orbit stabilization are:

A. Low Redundancy
Actuators and sensors on spacecraft are likely to fail, which could result in massive failures [21].The low redundancy characteristic of microsats, due to mass and volume limitations, is the main problem in their application [22].

B. Alignment Error
The alignment error for satellite sensors and actuators is always calibrated and compensated prior to launch.The hostile environment during the space launch, on the other hand, may change the assembly matrix and lead to errors in attitude control.Furthermore, due to light exchange and eclipse, satellites will experience high/low-temperature alternation during operation, and the matrix will change under different thermal conditions.Traditionally, this problem is solved by implementing active thermal control for the entire satellite and some of its components.

C. High Flexibility
In recent years, increasing mission requirements have increased the complexity of spacecraft, as evidenced by the number of movable parts required, such as large solar panels and deployable antennas, and manipulators.
Considering the problem mentioned above PID controller will continue to increase in high complexity to solve this problem.Therefore, an advanced control method is required.
Several peered reviewed literatures have published several works on advanced control using a controller like LQG, fuzzy, and AI but they mostly end up as just literature because some of these methods have still not been tested on real satellites.few authors have worked on the on-orbit satellite stabilization of small satellites using LQR, but they mostly neglected the effect of the control method on the energy consumption of the controllers.Mathematical models of physical systems are key elements in the design and analysis of control systems.To understand and control the complex satellite system, a quantitative mathematical model of the system must be derived from the basic relationship between system variables.

B. Kinematic Equations for Satellite
The kinematics describes the satellite's orientation in space and is derived by the integration of the angular velocity.The angular velocity of the satellite model can be described by unit quaternions [14].

C. Dynamic Model of a Satellite
Dynamic equations describe how velocity changes for a given force.According to the Newton-Euler formulation presented in [14], [15], angular momentum, H changes according to the applied torque.The total angular momentum of the spacecraft is [16].

D. Reaction Wheel Torque
For a 3-axis RW configuration, x, y, and z, the torques are generally modelled by (3), according to [14].
where,  ) & is the torque caused by the reaction wheel, is the frictional torque caused by wheels and is usually assumed to be zero.
The rotation matrix R, from frame a to b is denoted  7 & .The rotation of a vector from one frame is written with the following notation in [14], [17].
where S is the skew-symmetric operator.
Hence its time derivation is given as (11).
The Euler angles , , and  are defined as the rotational angles about the satellite body axes Roll , about the −axis; Pitch , about the − axis; and Yaw , about the − axis.The term  = represents the initial orbital angular velocity of the satellite.
The state-space equation for this system represented in the linear form of ( 17) and ( 18) can be derived by defining the following state below: Therefore: ( 14)-( 16) will result to (21) and (22).
OUTPUT EQUATION, where, Considering on-orbit satellite information as in Table III.Inputting the information in Table III in (21) to (22), the plant matrix G becomes;

4:
As shown above, the transfer function shows that the system is a MIMO system.
In other to determine the stability of the system, the stability analysis is performed below.

E. PID Controller
Proportional-Integral-Derivative (PID) controller action is a combination of proportional, integral, and derivative actions.To achieve optimal response, the three basic coefficients are varied in each PID controller for each implementation.
The satellite system to be controlled is a MIMO (Multiple Input Multiple Output systems) while the PID controller or any other linear controller are best used for SISO system (Single Input Single Output systems), therefore to apply the PID controller to the system each of the axes of rotation is tuned separately and the graphs were later combined.The PID operation was implemented using Simulink and the response of each roll, pitch and yaw was combined and recorded.The figure shows the PID controller implementation on Simulink.

F. Linear Quadratic Regulator (LQR) Design
LQR is an advanced control technique that is used to design linear controllers for complex systems with stringent performance requirements.Since accuracy is critical for military application especially when it involves collateral damage.Therefore a specific design parameter was set for the controller to determine the performance.For LQR design, the following performance indices are considered, i.The settling time is to be ≤ 10 seconds, ii.Power consumption ≤ 0.3 Watts and iii.Zero (0) steady-state error / final value.The main idea behind the control system is to find a cost function and minimize it.After determining that the cost function is minimized, later feedback into the system using a gain-matrix K. as stated in [18]- [20].Fig. 3 shows the Matlab algorithm implementation of the LQR for the satellite attitude stabilizations while Fig. 2 shows the control block of the LQR controller.

𝑢(𝑡) = 𝑘𝑥(𝑡)
(34) The feedback gain matrix is denoted by k.To find the control signal 'u', the cost function must minimize, which is defined as the performance index (PI), given in ( 35) and (36).
where ≥0, >0, ≥0 are symmetric, positive definite, and semi-positive matrices respectively defined as state and control weighting matrices.
where  C denotes the number of states and n a denotes the number of actuators [22].The primary goal of the LQR Controller design is to minimize the quadratic cost function  =   Selecting a small value for R, on the contrary, indicates that we do not want to penalize the control signal (cheap control strategy).In a similar fashion, a high value for Q indicates that we are attempting to stabilize the system with as few adjustments in the states as possible, and a high-value Q indicates that we are less concerned about the shifts in the states.Given the trade-off, we kept Q as I (identity matrix) and only adjust R.You can use a large R if the control output signal has a limit (for example, if high control signals introduce sensor noise or cause actuator saturation), and small R if having a large control signal is not a problem for your system.Since the reaction wheel has a fundamental problem of saturation, then logical to have a large signal R to minimize the cost function and avoid saturation.
The Q and R matrices are chosen by adjusting them in the developed MATLAB code until the desired performance is obtained.The feedback gain matrix; K, is computed in MATLAB using the syntax command in (41); [, , ] = (, , , ) IV. COMPUTER SIMULATION

A. System Analysis
To apply a controller or any control method to a system, it is important to know the system's characteristics.Some of the few important characteristics are:

B. Controllability and Observability
A dynamic system is considered to be controllable if it can be driven to any state in a finite number of times using control signals.If the controllability matrix generated by ctrb (CO=ctrb (A, B); has full rank, that is, the rank is equivalent to the number of states in the state-space model, the system is controllable.
The command line on Matlab Co = ctrb(A,B); unco = length(A) -rank(Co) The code returns an output of unco=0; this means that the system is controllable and it has no uncontrollable state.If the observability matrix produced by Ob = obsv(A, C); has full rank, that is, the rank is equivalent to the number of states in the state-space model, the system is said to be observable.Ob = obsv(A,C); unobsv = length(A) -rank(Ob) The code returns an output of unobsv=0; this means that the system is observable and it has no unobservable state.

C. System Analysis before the Controller sys = ss(A,B,C,D); B = isstable(sys)
The code returns an output of B=0; B is equal to logic 0, which means that the system is not stable.Also for the pole of the system, it shows that the system is not stable.
Since the system is controllable and observable, then we can proceed to apply the controller to the system.

D. PID Controller Result
The result of the PID controller is shown in Fig. 7.The PID controller result shows that the controller tries to stabilize the system but even at 100 sec, only the roll stabilized while the pitch is in a continuous oscillation and the Yaw is not even close to stabilizing at 500 sec.This is one of the limitations of using only a PID controller for a dynamic system or MIMO system.

E. LQR Controller Result
It can be observed from the result of Fig. 8-Fig.13, as Q1 is kept constant and increases R, the angular error did not hit the zero mark even at the set time of 30sec.This implies that the system will not achieve a steady state error and hence will not achieve stability within the time frame.Also considering the result of Fig. 14-Fig.23, it can be observed that when R1 is kept constant and Q is varied the time taken for the system to get to achieve zero angular error progressively reduced.The strategy of increasing Q whilst R is constant is called a cheap control strategy.Having a large R (expensive control) may be logical since the reaction will have the problem of saturation, but from our observation, it won't achieve our performance metric.It will be worth noting that the control output signal has a limit (for example, if high control signals introduce sensor noise or cause actuator saturation), and a small R if having a large control signal is not a problem for the satellite system.Since the reaction wheel has a fundamental problem of saturation, then it is only logical to have a small signal R to minimize the cost function and avoid saturation and therefore carefully choose the optimized Q to meet the system requirement (see Table IV and Table V).At Q6 =[8.5 8.5 8.5 8.5 8.5 8.5] and R1 =0.1* diag([1, 1, 1]); the system achieved a settling time of exactly 10sec, achieved a zero steady-state error and hit the zero angular error at exactly 12.7.because increasing Q increases the control signal, it is only logical to check the power dissipated to achieve this performance metric to further influence our control decision.
Q6 has the following system performance: roll (peak amplitude =0.26s, settling time=10.0s),Pitch (peak amplitude =0.395 s, settling time=5.52s), Yaw (peak amplitude =0.350 s, settling time=5.52s) Fig. 24a shows the maximum torque experienced by the satellite.From (9).The display shows all the torque experienced by the satellite from various inputs.Therefore to calculate the maximum possible power for the on-orbit attitude control and stabilization, we choose input 1: output 4. (see Fig. 24a and 24b).22.2588 0.0000 -0.0094 8.0235 -0.0000 4.1217 0.0000 14.9806 -0.0000 0.0000 8.9510 -0.0000 -0.0094 -0.0000 14.3988 -4.1622 -0.0000 7.9456 8.0235 0.0000 -4.1622 21.0155 -0.0000 -7.0491 -0.0000 8.9510 -0.0000 -0.0000 15.7754 -0.0000 4.1217 -0.0000 7.9456 -7.0491 -0.0000 13.4550 E = -0.4742+ 0.0000i -0.8368 + 0.4994i -0.8368 -0.4994i -0.8601 + 0.0000i -1.1398 + 0.9436i -1.1398 -0.9436iFinally, recall that before any of the controllers were applied to the system, it was established that the satellite system is not stable.Therefore to establish that the system is now stable we generate a Nyquist plot of the system.Fig. 25, Fig. 26, and Fig. 27 show the Nyquist plot of the roll, pitch and yaw respectively.From the plot, it is shown that the pole of the system is all now in the left half of the plane which implies that the system is now very stable.

V. CONCLUSION
The PID controller's output established the reason why aerospace engines design filters and different gain amplifiers to aid the PID controller's adaptability for space missions.Although the PID controller is still widely used because it is simple to design, the PID control system is becoming more complex as every limitation of the controller requires an additional circuit to compensate, and as more fixtures, flexibility, and adaptability are required for satellite design, therefore aerospace engineers will have to seek alternates to reduce design complexity, power demand, and the cost of designing filters to meet every design requirements of PID controller.When optimized, the LQR controller is a perfect advanced controller for any satellite application and industrial control design.Because of saturation, combining LQR and reaction wheel actuator may necessitate caution.To avoid actuator saturation, margnetorquer can be added to each axis of the reaction wheel.

Fig. 1
below shows the satellite simulation model architecture which comprises the satellite dynamic and kinematic equations model, models of sensors and actuators, and algorithms of the navigation and control system.This model operates in the time domain.
the Transfer Function of the plant G. Therefore, T = From input 1 to the output are in (23) and (24).
, the Roll, Pitch and Yaw of the equation are below in (31)-(33).

% 6 ∫
2 ( + K =  2 ) .The cost function does have a distinctive minimum that can be derived by finding the solutions to the Algebraic Riccati Equation, irrespective of the Q and R values.To penalize the state variables and control signals, the variables Q and R can be utilized as design parameters.The higher these values, the greater these signals are penalized.Selecting a bigger value for R means that you are attempting to stabilize the system with little (weighted) energy (expensive or costly control strategy).

TABLE II :
ACTUATOR LIMITATION AND APPLICATION TO THE SATELLITE ATTITUDE CONTROL

TABLE IV :
SUMMARY OF THE LQR RESULT WHEN Q IS CONSTANT AND R IS VARIED

TABLE V :
SUMMARY OF THE LQR RESULT WHEN Q VARIED AND R CONSTANT