Attitude Control and Parameter Optimization A Stud
Attitude Control and Parameter Optimization A Stud
Attitude Control and Parameter Optimization A Stud
4, 146-153
Abstract: In this work, we build a satellite attitude Proportional-Integral-Derivative (PID) controlled system by using the Hubble Space
Telescope (HST) parameters as a reference and tune its controller parameters using various tuning methods. First, we give the equations for
the motion of a satellite. We elaborate the control structure as controller, actuator, dynamics, and kinematics subsystems and construct an
external disturbance model. We use a reaction wheel assembly used in the HST with the same configuration as the actuator. We evaluate the
performance of the linearization by comparing it with the nonlinear model output. By working on the linearized model, we tune the PID
controller parameters using two different methods: "Model-Based Root Locus Tuning” and "Genetic Algorithm Based Tuning". First, we
obtain the controller parameters by manipulating the poles on the root locus plot of the linearized system. In addition, we use genetic
algorithms to find the optimized controller values of the system. Finally, we compare the performances of the two methods based on their
cost function values and find that the Genetic Algorithm-based tuned parameters are more fruitful in terms of the cost function value than
the parameters obtained by the Root Locus-based tuning. However, it is found that the Root Locus-based tuning performs better in
disturbance rejection.
Keywords: Spacecraft attitude control, controller parameter optimization, reaction wheel actuation, quaternion error feedback, Hubble Space
Telescope.
146
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
using various methods similar to ours. Wang et al. designs a spacecraft, 𝜔 is the angular velocity vector of the spacecraft,
flexible spacecraft attitude control simulation using a PID and 𝑁𝑒 is the external torque acting on the spacecraft.
control algorithm. They optimize the control parameters Equation (1) can be divided into two parts: the spacecraft
using PSO and compare them with the trial-and-error method, and the reaction wheel. For the spacecraft, the angular
which can be described as a time-consuming method for momentum can be defined as 𝐼𝑠 𝜔. Then (1) becomes:
complex systems [11]. Khoshrooz et al. design a reaction
𝑑
wheel actuated satellite attitude control system. They design (𝐼𝑠 ω) + ℎ̇𝑤 = 𝑁𝑒 − ω × 𝐼𝑠 ω − ω × ℎ𝑤 (2)
𝑑𝑡
a PD controller and optimize the PD parameters using
Genetic Algorithm and PSO methods. They compare two where ℎ𝑤 is the angular momentum generated by the reaction
optimized variants with an LQR controller and verify them wheels and 𝐼𝑠 is the moment of inertia matrix of the
with a Hardware-in-the-Loop testbed [13]. Daw et al. design spacecraft. It is also known that the control torque vector 𝑁𝑐
a geostationary satellite attitude control system using PID is related to the rate of change of the angular momentum
controllers. They tune the parameters of the controller using vector of the satellite as:
experimental Ziegler-Nichols, a fairly generic tuning
technique, and a genetic algorithm. At the end of their study ℎ̇𝑤 = −𝑁𝑐 (3)
they compare the performance of the two techniques [14]. Jia
and Yang design a nonlinear adaptive PD controller for than (2) becomes [16]:
attitude control of a rigid spacecraft to compensate for
spacecraft uncertainties such as inertia variation. An adaptive ω̇ = 𝐼𝑠−1 (−𝑆(ω)𝑰𝒔 𝝎 − 𝑆(ω)ℎ𝑤 + 𝑁𝑐 + 𝑁𝑒 ) (4)
part is added to the nonlinear PD controller and the
parameters are determined using a genetic algorithm. where 𝑆 is the skew-symmetric matrix given as:
However, no comparison has been made with other tuning
methods [12]. 0 −𝜔3 𝜔2
In this work, we present a structure for satellite attitude [ 𝜔3 0 −𝜔1 ] (5)
control using PID controllers. We elaborate the design using −𝜔2 𝜔1 0
the physical parameters of the HST. Then we tune the
controller parameters using the model-based root locus Kinematics
method and the genetic algorithm. We simulate and compare To create kinematic equations, a quaternion representation
the results in a commercial software environment. can be used. A quaternion is a representation with three vector
The outline of the paper is as follows: in Section A, the and one scalar element as [17]:
satellite equations of motion are constructed as dynamics,
kinematics, and actuator subsystems. Also, the linearized 𝑞 = 𝑖𝑞1 + 𝑗𝑞2 + 𝑘𝑞3 + 𝑞4 (6)
equations of motion are shared. The attitude control structure
is constructed in Section B, and a comparison between Equation (6) can be rewritten in terms of its vector and
nonlinear and linear models is performed to show that the scalar elements as:
linearized model is reliable to use instead of the nonlinear
model in terms of linear model-based tuning and faster 𝑞 ≡ (𝑔, 𝑞4 ) (7)
computation process. In Section C, the controller parameters
are tuned to meet the time domain requirements using Root It is also possible to indicate the kinematic equations by
Locus and Genetic Algorithm-based methods. Section 3 using the Euler angles, which can be defined as rotations
compares the performance of tuning with respect to cost around the body axis of the spacecraft:
function values. In Section 4, conclusions and the advantages 𝜙: Roll angle (rotation around the x-axis)
and disadvantages of both methods are discussed and future 𝜃: Pitch angle (rotation around the y-axis)
research aspects are explored. 𝜓: Yaw angle (rotation around the z-axis)
2. METHODS
Dynamics
Spacecraft dynamics with reaction wheels as actuators can
be calculated using the dynamics equations based on
Newton’s second law as given below [15]:
where ℎ𝑡𝑜𝑡 is the total angular momentum acting on the Fig. 1. An illustration of the HST with defined axes.
147
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
The defined x, y, and z axes for the HST are shown in To convert the RWA to the SBC system, a transformation
Fig. 1. In addition, Euler angles can be converted to matrix 𝐴 must be created. Multiplying the transformation
quaternions using the following transformation: matrix by the torque vector of the RWA (𝑻𝑹𝑾𝑨 ) results in the
total torque vector in the SBC system (𝑻𝑺𝑩𝑪 ):
𝜙 𝜃 𝜓 𝜙 𝜃 𝜓
𝑠( )𝑐( )𝑐( ) − 𝑐( )𝑠( )𝑠( )
𝑞1
2 2 2 2 2 2 TSBC = [A]TRWA (12)
𝜙 𝜃 𝜓 𝜙𝜓 𝜃
𝑞2 𝑐( )𝑠( )𝑐( ) + 𝑠( )𝑐( )𝑠( )
2 2 2 2 2 2
[𝑞 ] = 𝜙 𝜃 𝜓 𝜙 𝜃 𝜓
(8) The transformation matrix 𝐴 can be written as:
3
𝑐( )𝑐( )𝑠( ) − 𝑠( )𝑠( )𝑐( )
𝑞4 2 2 2 2 2 2
−𝑠(20)𝑐(45) 𝑠(20)𝑐(45) 𝑠(20)𝑐(45) −𝑠(20)𝑐(45)
𝜙 𝜃 𝜓 𝜙 𝜃 𝜓
[𝑐 ( ) 𝑐 ( ) 𝑐 ( ) + 𝑠 ( ) 𝑠 ( ) 𝑠 ( )]
2 2 2 2 2 2
Ω(𝜔) ≡ [−𝑐(20)𝑐(45) −𝑐(20)𝑐(45) 𝑐(20)𝑐(45) 𝑐(20)𝑐(45) ]
𝑠(45) 𝑠(45) 𝑠(45) 𝑠(45)
where 𝑐 stands for cosine and 𝑠 stands for sine. Moreover, (13)
quaternions can be converted to Euler angles using (9):
For the RWA configuration of the HST, the total torque
2𝑞 𝑞 +2𝑞 𝑞 vector in the SBC system can be obtained by substituting the
tan−1 4 1 2 22 3
𝜙 1−2(𝑞1 +𝑞2 ) obtained transformation matrix into (12).
[𝜃] = sin−1 (2𝑞4 𝑞2 − 2𝑞3 𝑞1 ) (9) Moreover, the torque vector in the SBC system can also be
𝜓 −1 2𝑞4 𝑞3 +2𝑞1 𝑞2
tan converted to a RWA torque vector. To do this, the pseudo-
[ 1−2(𝑞22 +𝑞32 ) ] inverse of the transformation matrix, 𝐴† , must be substituted
into the equation[19]:
In this paper, the kinematic equations are represented using
quaternions because singularities occur in high-angle 𝑇𝑅𝑊𝐴 = [𝑨† ]𝑇𝑆𝐵𝐶 (14)
maneuvers, called gimbal lock, when Euler angles are used to
represent the kinematics. The use of quaternions is also For simplicity, a reaction wheel can be assumed to be a
advantageous in terms of fast computational power. Permanent Magnet DC (PMDC) motor. Since not all
Furthermore, the kinematic equations can be represented as parameters of the HST RWA are publicly available, a
[16]: commercial PMDC motor was chosen (PBLH60AS115-430)
that meets the requirements of the HST RWA, which are
1 0.8 Nm torque capability and 3000 rpm speed [3].
𝑞̇ = Ω(ω)𝑞 (10)
2 It is possible to explain the response of a PMDC motor by
where: using a set of linear equations [20]:
𝑑𝑖𝑎 (𝑡) 1
0 𝜔3 −𝜔2 𝜔1 = [𝑒𝑎 (𝑡) − 𝑅𝑎 𝑖𝑎 (𝑡) − 𝐾𝑏 ω𝑚 (𝑡)] (15)
𝑑𝑡 𝐿𝑎
−𝜔3 0 𝜔1 𝜔2
Ω(𝜔) = [ ] (11)
𝜔2 −𝜔1 0 𝜔3 𝑑ω𝑚 (𝑡)
=
1
[𝐾𝑖 𝑖𝑎 (𝑡) − 𝑇𝐿 (𝑡) − 𝐵𝑚 ω𝑚 (𝑡)] (16)
−𝜔1 −𝜔2 −𝜔3 0 𝑑𝑡 𝐽𝑚
By using kinematic equations, it is possible to obtain the where 𝑖𝑎 is the armature current, 𝑒𝑎 is the input voltage, 𝜔𝑚
quaternion elements of a spacecraft from its angular velocity is the motor angular velocity, 𝑇𝐿 is the load torque, 𝑅𝑎 is the
elements. The angular velocity vector can be obtained by armature resistance, 𝐿𝑎 is the armature inductance, 𝐾𝑖 is the
integrating the rate of change of the angular velocity vector torque constant, 𝐾𝑏 is the back-emf constant, 𝐽𝑚 is rotor
into the dynamic equations. inertia, and 𝐵𝑚 is the viscous-friction coefficient.
By combining dynamic and kinematic equations, the From (15) and (16), the resulting angular velocity of a
PMDC motor can be derived as an output by using the voltage
orientation of a satellite can be determined from the forces
as an input. The angular velocity of the RWA in the body
acting on it, i.e., the external torque and the torque generated
frame can be converted to the torque generated by the RWA
by the reaction wheels. In this work, it is assumed that there using the ideal reaction wheel equation [16]:
are no external torques acting on the HST. Also, an actuator
model must be built to calculate the torque generated by the ḣ =
d
Jωw = Tw (17)
RWA. dt
148
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
the gravitational force acting on different points of the HST begins to rotate continuously around the roll axis. This
spacecraft changes and generates a disturbance torque. This is expected because the reaction wheel generates a control
torque can be approximated as a linear equation [22]: torque at the beginning of the movement, then there is no
3𝜇
torque produced to stop the spacecraft.
𝐺𝑥 = (𝐼𝑧𝑧 − 𝐼𝑦𝑦 )𝜙
𝑅3
3𝜇
𝐺𝑦 = (𝐼𝑧𝑧 − 𝐼𝑥𝑥 )𝜃 (18)
𝑅3
𝐺𝑧 = 0
Fd = 0.5𝜌𝑣 2 𝑐𝐷 𝐴 (19)
Fig. 3. Model output for 3 volts input of the reaction wheel.
where 𝜌 is the air density, 𝑣 is the linear velocity vector of the
spacecraft, 𝑐𝐷 is the drag coefficient, and 𝐴 is the reference Linearization of equations of motion
area facing the air. The total disturbance torque can be
constructed using the gravity gradient and the aerodynamic For a linear controller, it is important to have a linear
torques acting on the HST, which are the dominant system in order to adjust the controller parameters to the
disturbances. For the HST, the total disturbance torque varies behavior of the system. Since the attitude control model of
between 0-0.25 Nm, as given in [24]. To represent the total the HST is nonlinear, the equations of motion must be
torque, which varies between 0-0.25 Nm, a band-limited linearized.
white noise with a noise power of 5e-6 and sampling time of Assuming that the external torque is zero, the linear state
0.001 seconds was used. Fig. 2 shows the generated white space equation of a spacecraft can be expressed as [16]:
noise. The values greater than 0.25 Nm represent the
remaining external torques. 𝑥̇ (𝑡) = 𝐴(𝑡)𝑥(𝑡) + 𝐵𝑢 (𝑡)𝑁𝑐 (𝑡) (20)
where as,
𝐼𝑠−1 𝐴𝜔,𝜔 0 𝐼𝑠−1 𝐴𝜔,ℎ
1
A(t) = [ 𝐼 0 0 ] (21)
2 3×3
0 0 0
0
Aω,1 = [−𝜔3 𝐼𝑧𝑧 + 𝜔3 𝐼𝑥𝑥 + ℎ3 ] (23)
𝜔2 𝐼𝑦𝑦 − 𝜔2 𝐼𝑥𝑥 − ℎ2
𝜔3 𝐼𝑧𝑧 − 𝜔3 𝐼𝑦𝑦 − ℎ3
Fig. 2. Generated noise as external torque. Aω,2 = [ 0 ] (24)
−𝜔1 𝐼𝑥𝑥 − 𝜔1 𝐼𝑦𝑦 + ℎ1
Model validation
The model was created in a commercial software −𝜔2 𝐼𝑦𝑦 + 𝜔2 𝐼𝑧𝑧 + ℎ2
environment. To validate the model, 3 volts are applied to the Aω,3 = [ 𝜔1 𝐼𝑥𝑥 − 𝜔1 𝐼𝑧𝑧 − ℎ1 ] (25)
roll DC motor in the SBC system, which represents the 0
reaction wheel of the spacecraft, neglecting the external
0 𝜔3 −𝜔2
disturbance. Since the voltage is given in the SBC, the
Aω,h = [−𝜔3 0 𝜔1 ] (26)
spacecraft is expected to perform only roll motion. The output
𝜔2 −𝜔1 0
of the Euler angles is shown in Fig. 3. As shown in Fig. 3, the
149
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
150
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
151
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
convex problems. However, this does not necessarily mean 4. CONCLUSIONS AND DISCUSSION
that whenever an optimization problem is constructed with All subsystems are built as controller, actuator, and plant
GA, the algorithm will yield the global optimum values. By using equations of motion. Linearization has been performed
its nature, GA has the ability not to converge to the local and it has been shown that the linearized model can be used
optimum, but this is possible with crossover and especially to determine the controller parameters both mathematically
mutation parameters. In several runs of this specific PID and visually. The PID parameters are obtained by two
tuning problem, some of the results did not yield a better cost methods and their performance is compared in terms of cost
function value than the Root Locus-based tuning method. To function values. It is shown that the GA parameters perform
overcome this situation, the population number is increased better in terms of the corresponding cost function values.
so that the coverage of each generation is increased. The However, it is found that in the presence of disturbance, the
mutation rate is adjusted using the trial-and-error method. root locus-tuned parameters perform better in terms of
When the mutation rate is increased, the population deviates disturbance rejection as depicted in Fig. 8.
from the previously known minima, which preferably leads
to finding new minima. The final tuned values of the
controller using GA are 48.894, 0.071, 106.046, and 1.427 for
P, I, D, and N coefficients, respectively.
3. RESULTS
The controllers obtained by two different methods can be
compared in terms of their performance. For this purpose, we
use the cost function values of two different tuning methods.
By inserting PID values obtained by two methods, it is
possible to get a cost function value that is used as a
performance criterion to be minimized.
For the Root Locus-based tuning method, we obtained a
cost function value of 0.7215, while the cost function value
for the GA-based tuning is 0.5129. Since the cost function
value obtained from the GA is lower than Root Locus-Based
Tuning, it can be said that the PID values calculated by the Fig. 8. Comparing tuning methods including external disturbance.
GA are suitable for the control system. To obtain more
realistic results, it is also crucial to compare the results in the The genetic algorithm is able to optimize complex cost
presence of a disturbance. To achieve this, the disturbance functions, considering the saturations of actuating signals,
explained in Section 2.A. was included in the system roll nonlinear, non-convex phenomena acting in the problem
angle. The output of the roll angle for a custom signal input itself. If desired, there is no need to linearize or simplify the
is shown in Fig. 7. system, unlike linear or modern control theory applications.
This comes with the cost of being computationally expensive
and time-consuming. When optimized tuning is advantageous
and even required for a task such as spacecraft control, where
pointing accuracy is quite significant, the time and
computation burden can be neglected.
ACKNOWLEDGMENT
This project was financially supported by the Istanbul
Technical University (ITU) Scientific Research Projects
Coordination Unit Research Start Fund with Project ID:
ITUBAP 40957 and Project Code: MAB-2017-40957.
REFERENCES
[1] Lohani, S., Joshi, R. (2020). Satellite network security.
In 2020 International Conference on Emerging Trends
in Communication, Control and Computing (ICONC3).
IEEE, 1-5.
https://doi.org/10.1109/ICONC345789.2020.9117553
[2] Shiga, D. (2010). Happy birthday Hubble: The
telescope that almost wasn’t. New Scientist, 206 (2756),
26-27. https://doi.org/10.1016/S0262-4079(10)60938-4
[3] Dougherty, H., Rodoni, C., Tompetrini, K., Nakashima,
A. (1983). Space telescope pointing control. IFAC
Proceedings Volumes, 16 (11), 15-24.
Fig. 7. Genetic algorithm based PID tuning chart. https://doi.org/10.1016/S1474-6670(17)62184-0
152
MEASUREMENT SCIENCE REVIEW, 23, (2023), No. 4, 146-153
[4] Nurre, G. S., Sharkey, J. P., Nelson, J. D., Bradley, A. [15] Sidi, M. J. (1997). Spacecraft Dynamics and Control: A
J. (1995). Preservicing mission, on-orbit modifications Practical Engineering Approach, Cambridge
to Hubble Space Telescope pointing control system. Aerospace Series No. 7. Cambridge University Press,
Journal of Guidance Control Dynamics, 18 (2), 222– ISBN 978-0521550727.
229. https://doi.org/10.2514/3.21373 [16] Blanke, M., Larsen, M. B. (2010). Satellite Dynamics
[5] Borase, R. P., Maghade, D., Sondkar, S., Pawar, S. and Control in a Quaternion Formulation (2nd edition).
(2021). A review of PID control, tuning methods and Technical Report, Technical University of Denmark,
applications. International Journal of Dynamics and Department of Electrical Engineering.
Control, 9 (2), 818-827. https://backend.orbit.dtu.dk/ws/portalfiles/portal/9859
https://doi.org/10.1007/s40435-020-00665-4 4729/Satdyn_mb_2010f.pdf
[6] Mohammed, L., Ahmed, M. M. (2014). Spacecraft [17] Yang, Y. (2012). Spacecraft attitude determination and
pitch pid controller tunning using Ziegler Nichols control: Quaternion based method. Annual Reviews in
method. IOSR Journal of Electrical and Electronics Control, 36 (2), 198-219.
Engineering, 9 (6), 62-67. https://doi.org/10.1016/j.arcontrol.2012.09.003
https://www.iosrjournals.org/iosr-jeee/Papers/Vol9- [18] Hasha, M. D. (1987). Passive isolation/damping system
issue6/Version-1/I09616267.pdf for the Hubble Space Telescope reaction wheels. In
[7] Joseph, E. A., Olaiya, O. O. (2017). Cohen-Coon PID NASA-Lyndon B. Johnson Space Center, The 21st
tuning method: A better option to Ziegler-Nichols PID Aerospace Mechanisms Symposium, 211-226.
tuning method. International Journal of Recent https://ntrs.nasa.gov/citations/19870020440
Engineering Research and Development (IJRERD), 2 [19] Wertz, J. R. (ed.) (1978). Spacecraft Attitude
(11), 141-145. http://www.ijrerd.com/papers/v2- Determination and Control (Astrophysics and Space
i11/29-IJRERD-B576.pdf
Science Library, 73). ISBN 978-9027712042.
[8] Wilson, D. I. (2005). Relay-based PID tuning.
[20] Shahgholian, G., Shafaghi, P. (2010). State space
Automation and Control, 10-12.
modeling and eigenvalue analysis of the permanent
[9] Gawthrop, P. (1986). Self-tuning PID controllers:
magnet DC motor drive system. In 2010 2nd
Algorithms and implementation. IEEE Transactions on
International Conference on Electronic Computer
Automatic Control, 31 (3), 201-209.
https://doi.org/10.1109/TAC.1986.1104241 Technology. IEEE, 63-67.
[10] Park, D., Yu, H., Xuan-Mung, N., Lee, J., Hong, S. K. https://doi.org/10.1109/ICECTECH.2010.5479987
(2019). Multicopter pid attitude controller gain [21] Thienel, J. K., Sanner, R. M. (2007). Hubble Space
autotuning through reinforcement learning neural Telescope angular velocity estimation during the
networks. In Proceedings of the 2019 2nd International robotic servicing mission. Journal of Guidance,
Conference on Control and Robot Technology. New Control, and Dynamics, 30 (1), 29-34.
York, US: Association for Computing Machinery, 80- https://doi.org/10.2514/1.20591
84. https://doi.org/10.1145/3387304.3387327 [22] De Guia, N. (2012). Investigating various propulsion
[11] Wang, Y., Xiong, J., Lu, Z., Zhang, Y. (2019). The systems for an external attachment for a controlled
optimization of spacecraft attitude control parameters manual de-orbit of the Hubble Space Telescope.
based on improved particle swarm algorithm. In 2019 https://digitalcommons.calpoly.edu/aerosp/63/
IEEE 3rd Advanced Information Management, [23] Lee, D., Springmann, J., Spangelo, S., Cutler, J. (2011).
Communicates, Electronic and Automation Control Satellite dynamics simulator development using lie
Conference (IMCEC). IEEE, 1691-1694. group variational integrator. In AIAA Modeling and
https://doi.org/10.1109/IMCEC46724.2019.8983855 Simulation Technologies Conference. AIAA 2011-
[12] Jia, Y., Yang, X. (2016). Optimization of control 6430. https://doi.org/10.2514/6.2011-6430
parameters based on genetic algorithms for spacecraft [24] Hur-Diaz, S., Wirzburger, J., Smith, D. (2008). Three
attitude tracking with input constraints. axis control of the Hubble Space Telescope using two
Neurocomputing, 177, 334-341. reaction wheels and magnetic torquer bars for science
https://doi.org/10.1016/j.neucom.2015.11.022 observations. In F. Landis Markley Astronautics
[13] Khoshrooz, A. R., Vahid, D. M., Mirshams, M., Symposium.
Homaeinezhad, M. R., Ahadi, A. H. (2012). Novel https://ntrs.nasa.gov/citations/20080023343
method on using evolutionary algorithms for pd optimal [25] Foster, C. L., Tinker, M. L., Nurre, G. S., Till, W. A.
tuning. Applied Mechanics and Materials, 110-116, (1995). Solar-array-induced disturbance of the Hubble
4977-4984. Space Telescope pointing system. Journal of Spacecraft
https://doi.org/10.4028/www.scientific.net/AMM.110- and Rockets, 32 (4), 634-644.
116.4977 https://doi.org/10.2514/3.26664
[14] Daw, M. S., Zayed, A. S., Allafi, N. I., Husain, R. A.
(2017). Genetic algorithm based PID controller for
attitude control of geostationary satellite. In Received August 11, 2022
International Conference & Exhibition for Geospatial Accepted March 28, 2023
Technologies – Libya GeoTec 2, 318-330.
https://www.lrsgis.org.ly/libyageotec2/ar/paper/34-21-
B5-Eng-rev.pdf
153