EmreSAYIN MasterThesis
EmreSAYIN MasterThesis
net/publication/373105080
CITATIONS READS
0 549
1 author:
Emre Sayin
Istanbul Technical University
14 PUBLICATIONS 6 CITATIONS
SEE PROFILE
All content following this page was uploaded by Emre Sayin on 14 August 2023.
M.Sc. THESIS
Emre SAYIN
JUNE 2023
ISTANBUL TECHNICAL UNIVERSITY ⋆ GRADUATE SCHOOL
M.Sc. THESIS
Emre SAYIN
(511201121)
JUNE 2023
İSTANBUL TEKNİK ÜNİVERSİTESİ ⋆ LİSANSÜSTÜ EĞİTİM ENSTİTÜSÜ
Emre SAYIN
(511201121)
HAZİRAN 2023
Emre SAYIN, a M.Sc. student of ITU Graduate School student ID 511201121, suc-
cessfully defended the thesis entitled “DESIGN, ANALYSIS AND DEVELOPMENT
OF OPTIMAL SATELLITE ATTITUDE CONTROL SYSTEM”, which he prepared
after fulfilling the requirements specified in the associated legislations, before the jury
whose signatures are below.
v
vi
To my family,
vii
viii
FOREWORD
I would like to express my heartfelt gratitude to my thesis advisor, Assist. Prof. Dr.
İsmail BAYEZİT, for his unwavering support throughout my master’s education and
the writing process of this thesis.
I also extend my sincere thanks to my beloved spouse, Yağmur Su, for her tremendous
support and patience during this journey. I am also grateful to my parents for their
support in my education, which brought me to this significant milestone in my life.
ix
x
TABLE OF CONTENTS
Page
FOREWORD.............................................................................................................. ix
TABLE OF CONTENTS........................................................................................... xi
ABBREVIATIONS .................................................................................................. xiii
SYMBOLS ................................................................................................................. xv
LIST OF TABLES .................................................................................................. xvii
LIST OF FIGURES ................................................................................................. xix
SUMMARY .............................................................................................................. xxi
ÖZET ...................................................................................................................... xxiii
1. INTRODUCTION .................................................................................................. 1
1.1 Purpose of Thesis ............................................................................................... 2
1.2 Literature Review ............................................................................................... 2
1.3 Outline of Thesis ................................................................................................ 3
2. CONCEPTUAL BACKGROUND......................................................................... 5
2.1 Reference Frames ............................................................................................... 5
2.1.1 Earth-centered Earth-fixed (ECEF) reference frame .................................. 5
2.1.2 Earth-centered inertial (ECI) reference frame ............................................ 5
2.1.3 Local-vertical local-horizontal reference frame (LVLH)............................ 6
2.1.4 Body-fixed reference frame ........................................................................ 6
2.2 Euler Angles ....................................................................................................... 6
2.3 Quaternions......................................................................................................... 8
2.4 Conversion Between Euler Angles and Quaternions........................................ 10
2.5 Skew-Symmetic Matrix .................................................................................... 10
3. SATELLITE EQUATIONS OF MOTION ......................................................... 13
3.1 Satellite Dynamics............................................................................................ 14
3.2 Satellite Kinematics.......................................................................................... 15
3.3 Disturbance Modeling ...................................................................................... 17
3.3.1 Gravity gradient ........................................................................................ 17
3.3.2 Aerodynamic drag..................................................................................... 17
3.4 Nonlinear State Space Model ........................................................................... 18
3.4.1 Model validation ....................................................................................... 18
3.4.2 Dimension reduction of the nonlinear state space model ......................... 20
3.5 Linearizaton of Equations of Motion ............................................................... 21
3.5.1 Analytical linearization............................................................................. 23
3.5.2 Numerical linearization............................................................................. 26
3.6 Comparison of Nonlinear and Linear Models .................................................. 27
4. CONTROLLER DESIGN.................................................................................... 31
4.1 Linear Quadratic Regulator .............................................................................. 31
4.1.1 Controller tuning....................................................................................... 35
xi
4.2 Model Predictive Controller ............................................................................. 38
4.3 Comparison of Controllers ............................................................................... 42
5. CONCLUSIONS AND RECOMMENDATIONS.............................................. 45
REFERENCES.......................................................................................................... 47
APPENDICES ........................................................................................................... 51
APPENDIX A.1: MATLAB Function block: "SCmodel_7state".......................... 53
APPENDIX A.2: MATLAB Function block: "quat2Euler" .................................. 55
APPENDIX A.3: MATLAB Code: Controllability Check Matrix ........................ 57
CURRICULUM VITAE ........................................................................................... 59
xii
ABBREVIATIONS
xiii
xiv
SYMBOLS
A : State matrix
A1 : Rotation matrix around x-axis
A2 : Rotation matrix around y-axis
A3 : Rotation matrix around z-axis
A DCM : Direction Cosine Matrix
Aref : Reference area of the satellite that faces with incoming air
B : Input matrix
C : Output matrix
cD : Drag coefficient
D : Feed-forward matrix
Fd : Drag force
⃗g : Gibbs vector
Gx , Gy , Gz : Gravity gradient torque elements
hI : Angular momentum represented in inertial frame
hs : Satellite angular momentum
I : Identity matrix
Is : Satellite moment of inertia matrix
Ixx , Iyy , Izz : Diagonal elements of the satellite moment of inertia matrix
J : Cost function
M : Controllability matrix
p 1 ,pp2 : Points on the surface of sphere
q0, q1, q2, q3 : Quaternion elements
q : Quaternion
q̄ : Quaternion adjoint
q −1 : Quaternion inverse
||q|| : Quaternion norm
Td : External moment
v : Linear velocity vector
⃗v : Vector on the surface of sphere
α : Angle of rotation on sphere
φ : Roll
θ : Pitch
ψ : Yaw
ρ : Air density
τc : Control torque
τd : Disturbance torque
ω1 , ω2 , ω3 : Angular velocity components
ω : Angular velocity
ω× : Skew-symmetric cross product matrix of angular velocity
xv
xvi
LIST OF TABLES
Page
xvii
xviii
LIST OF FIGURES
Page
xix
xx
DESIGN, ANALYSIS AND DEVELOPMENT OF
OPTIMAL SATELLITE ATTITUDE CONTROL SYSTEM
SUMMARY
xxi
outputs of the system as a part of optimization problem. In this case, the optimization
problem becomes a constrained quadratic programming problem in which the problem
can be solved numerically.
A comparative analysis has been executed between LQR and MPC controllers. Their
disturbance rejection capabilities are analyzed by utilizing a simulation experiment.
A constant disturbance was applied to the system after a specific simulation time. It
is observed that the MPC controller outperforms the LQR controller by successfully
compensating the error between disturbed signal and the reference where the LQR
controller fails to do so. Disturbance rejection performances of two controllers are also
compared with the calculation of root mean square error values between disturbed and
reference signals. It is found that the root mean square error value for LQR controller
is 0.01 whereas this value is 0.0029 for MPC controller, which is significantly lower
than LQR controller.
Based on the outcomes of this thesis, further recommendations for future research
are proposed. As an ongoing study, more advanced satellite attitude control methods
can be utilized such as Linear Quadratic Integrator and Linear Quadratic Gaussian
controllers. These advanced control methods offer improved performance since they
also account the integral action on control, system uncertainties, noise and so on.
Additionally, nonlinear control methods such as sliding mode control and adaptive
control can provide robustness to the system as they account for nonlinearities and
uncertainties in the system. Development of estimators such as Kalman Filter and
Particle Filter can also be utilized to model the measurement noise and including this
noise into the system model to enhance the control performance of the system under the
presence of disturbance. Model-based design techniques such as processor-in-the-loop
and hardware-in-the-loop simulations may assist to improve the system’s control
performance as they allow for the evaluation of control algorithms in real-time.
Implementation of proposed control algorithms into the embedded hardware will
also enable the testing of hardware and software constraints, as well as actual
implementation on real satellites.
xxii
OPTİMAL UYDU YÖNELİM KONTROL SİSTEMİ
TASARIM, ANALİZ VE GELİŞTİRİLMESİ
ÖZET
xxiii
İkinci olarak, Düşük Dünya Yörüngesi’nde hareket eden uydular atmosferin üst
kısımlarında kaldıklarından, üzerlerine etki eden hava dolayısıyla sürtünmeye maruz
kalırlar. Bu aerodinamik sürtünme, sürükleme kuvvet olarak adlandırılır ve bir
diğer bozucu etkidir. Bu sürükleme kuvvetinin modellenmesi için ilgili denklemler
verilmiştir. Dinamik, kinematik ve bozucu kuvvet denklemleri verilmesinin ardından,
doğrusal olmayan durum uzayı denkemleri oluşturulmuş, uydunun açısal hızı ve
kuaterniyon elemanları durum vektörü olarak seçilmiştir.
Oluşturulan doğrusal olmayan matematik modelinin doğrulaması için bir benzetim
düzeneği kurulmuştur. Bu benzetim sisteminde, uydunun dinamik denklemlerinde
girdi olarak, x ekseni etrafında 1 Nm büyüklüğünde bir tork uygulanmıştır. Bu torkun
sonucunda kinematik denklemlerin çıktısına bakarak, uydunun beklenildiği gibi x
ekseni etrafında döndüğü görülmüştür. Bu girdi torku, sabit olarak verilmeye devam
ettiğinden uydunun açısal hızının gittikçe arttığı gözlemlenmiştir; bu da beklenilen bir
sonuçtur ve model doğrulanmıştır. Aynı zamanda, uydunun doğrusal olmayan durum
uzayı hareket denklemlerinin, durum eleman sayısının azaltılabildiği gösterilmiştir.
Kuaterniyon elemanlarından skaler olan eleman kaldırıldığında, uydunun kontrol
edilebilir olduğundan bahsedilmiştir. Bunun sonucunda doğrusal olmayan indirgenmiş
durum uzayı denklemi elde edilmiştir.
Elde edilen doğrusal olmayan durum uzayı denklemleri sonrası, kontrol sistemi
tasarlamak ve analizi amacıyla bu denklemlerin doğrusallaştırılmasına karar ver-
ilmiştir. Denklemlerin doğrusallaştırması için kullanılan yöntemlerden biri olan Taylor
serisi açılımı anlatılmıştır. Taylor serisi açılımı ile elde edilen Jacobi matrisinin
elemanları türev içermektedir. Jacobi matrisindeki bu türev elemanlarının analitik
ve sayısal olarak hesaplamaları açıklanmıştır. Doğrusallaştırılmış model analitik
olarak elde edilmiş, aynı zamanda türevlerin sayısal olarak elde edilmesi için bir
yöntem olan Merkezi Farklar Yöntemi tanıtılmıştır. Son olarak doğrusal olmayan ve
doğrusallaştırılmış modellerin karşılaştırılması yapılmıştır. Bunun testi için uyduya
girdi torku olarak bir beyaz gürültü verilmiş, iki modelin de çıktısı incelenmiştir.
Bu inceleme sonucu doğrusal olmayan ve doğrusallaştırılmış modellerin çıktılarının
yaklaşık 40 derece dönme açısına kadar neredeyse eşdeğer olduğu gözlemlenmiş,
böylelikle doğrusallaştırılmış modelin doğrulaması yapılmıştır. Bu bölümün sonunda
uydu hareket denklemleri, 6 elemanlı bir durum vektörü içeren doğrusallaştırılmış
durum uzayı sistemi şeklinde elde edilmiştir.
Elde edilen doğrusal durum uzayı hareket denklemleri kullanılarak kapalı çevrim
bir kontrol sistemi tasarlanmıştır. Bu tasarımda iki kontrolcü, LQR ve MPC
incelenmiştir. LQR kontrolcü temelde bir maliyet fonksiyonunun minimize edilmesi
üzerine kurulmuş bir optimal kontrolcü türüdür. Bu kontrolcüde maliyet fonksiyonu,
durum vektörü ve kontrol girdi vektörleri kullanılarak oluşturulmaktadır. Durum
vektörü ve kontrol girdi vektörlerinin, sırasıyla Q ve R parametreleri kullanılarak
maliyet fonksiyonundaki ağırlıkları ayarlanabilir. Bu maliyet fonksiyonunu minimize
eden bir durum uzayı geri bildirim kontrolcüsü tasarlanmıştır. Bu kontrolcünün
kazanç parametresi K ile ifade edilmekte olup, bu parametre Ricatti diferansiyel
denkleminin çözülmesi ile elde edilmektedir. LQR kontrolcü için gerçek uydu
verilerinin kullanıldığı bir benzetim tasarlanmıştır. Bu benzetimde elde edilen kazanç
parametresi incelenerek sistemin kararlı olduğu ve verilen kuaterniyon referanslarını
takip ettiği görülmüştür. Buna ek olarak LQR kontrolcünün Q ve R parametrelerinin
sistem performansına etkisi incelenmiştir. Bu bağlamda, Q ve R parametrelerinin
xxiv
değerleri değiştirilerek sistem çıktısı değerlendirilmiştir. Q ve R parametresinin
1 olduğu durumun uygun parametreler olarak seçilmesi kararlaştırılmıştır. Diğer
durumlarda sistem çıktısında kalıcı hal hatası gözlemlenmiştir. Kontrol girdisini
belirli değerler arasında kısıtlamak amacıyla, sisteme bir "satürasyon" bloğu
konmuştur kontrolcü çıktısı, ± 0.02 Nm ile sınırlandırılmıştır. Satürasyon olduğu
durumlarda sitem basamak yanıtının değişimi incelenmiş ve oturma süresinin uzadığı
görülmüştür. Bu satürasyon, doğrusal olmayan bir etken olduğundan LQR çözümünde
bulunmamaktadır ve optimal çözüm değildir.
İkinci kontrol algoritması olarak Model Öngörülü Kontrol kullanılmıştır. MPC, LQR
ile aynı temele dayansa da belirgin farkları bulunmaktadır. MPC kontrolcü, sistem
dinamiğinin kullanıldığı bir "öngörü" modeline bağlı olarak çalışır. Durum uzayı
sistemi denklemleri kullanılarak öngörü modelinin nasıl elde edildiği açıklanmıştır.
MPC’nin LQR’da olduğu gibi benzer bir maliyet fonksiyonu kullandığı gösterilmiştir.
MPC’nin en ayırt edici özelliği, optimizasyon problemine kısıtlama yerleştirme
olanağıdır. Bu kısıtlamalar sayesinde, sistemin durum vektörü, kontrol girdisi ve
sistem çıktısı gibi parametreler belirli değer aralıklarında kısıtlanabilir ve bu şekilde
optimizasyon çözümü yapılabilir. Sistem, kısıtlar ve maliyet fonksiyonu ile çözülmeye
çalışıldığında, bir Karesel Programlama Problemi çözümü yapılmakta olduğundan
bahsedilmiştir. Bu Karesel Programlama Problemi, sayısal olarak çözülerek optimal
kontrol girdisi elde edilmektedir. LQR’dan farklı olarak, MPC kontrolcüde oluşturulan
öngörü modeli ve optimizasyon çözümü, sistem çıktısına göre her zaman adımında
güncellenmektedir. MPC kontrolcü için de gerçek bir uydudan alınan atalet momenti
verisinin yanı sıra LQR’da olduğu gibi kontrol sinyali ± 0.02 Nm aralığında
kısıtlanmış, yapılan bir benzetim ile MPC kullanıldığı durumda sistemin kuaterniyon
elemanlarını doğru şekilde takip ettiği görülmüştür. Aynı zamanda kontrol sinyali de
paylaşılmış ve kısıtlamanın başarıyla gerçekleştiği gösterilmiştir.
LQR ve MPC kontrolcülerin karşılaştırılması için bir benzetim yapılmıştır. Bu
benzetimde, belirli bir saniyeden sonra uyduya bir basamak bozucu sinyal verilmiştir,
farklı kontrolcülerin kuaterniyon çıktıları incelenmiştir. Çıktılar incelendiğinde,
MPC kontrolcünün verilen bozucu torkunu başarıyla sönümlediği ve sistemin tekrar
referansa ulaştığı görülmüştür. Öte yandan LQR kontrolcünün, verilen sabit bozucu
tork karşısında bu bozucuyu sönümleyemediği görülmüştür. Sayısal olarak da
kontrolcü performanslarının karşılaştırılması amacıyla kök ortalama kare hataları
hesaplanmıştır. Bu hata değeri, her iki kontrolcü için de bozucu uygulandıktan
sonra sistem çıktısı ve referans sinyali arasında hesaplanmış; LQR için 0.01, MPC
için 0.0029 değerine ulaşılmıştır. Bu noktada MPC kontrolcünün, bozucu varlığında
LQR’a kıyasla gösterdiği performansın çok daha üstün olduğu ortadadır.
Tez çalışmasının çıktılarının kapsamlı şekilde genişletilmesi için öneriler verilmiştir.
Bunlar arasında Doğrusal Karesel İntegrator (LQI), Doğrusal Karesel Gaussian (LQG)
gibi gelişmiş kontrolcü tasarımları kullanmak bulunmaktadır. Bunun yanı sıra,
uyarlanabilir kontrol, kayan kipli kontrol gibi doğrusal olmayan kontrol tasarımları
da tasarlanabilir. Böylelikle sistemde integratör kullanımı, ölçüm gürültüsü ve
belirsizliklerin eklenmesi mümkün olacaktır. Kalman Filtresi, Parçacık Filtresi gibi
kestiriciler de sistemin ölçüm gürültüsünün modellenmesi ve çıktıların kestirimi
amacıyla kullanılabilir. Böylelikle bozucuların var olduğu durumda da gelişmiş,
gürbüz kontrolcüler tasarlanabilir. Bir diğer adım olarak, işlemci çevrim benzetimi
(SIL) donanım çevrim benzetimi (HIL) gibi adımlar kullanılarak bir model tabanlı
xxv
kontrol yaklaşımı izlenebilir. HIL düzenekleri tasarlanarak sistemin kontrolcüsünün
gömülü bir donanımda çalışması sağlanıp, gerçek sistemdeki kontrolcü performansı
incelebilir.
xxvi
1. INTRODUCTION
The first satellites are launched in the early 1950s. The first satellites were primitive
and did not require any attitude control system. However, with the growth of complex
missions and satellites, advanced attitude control became apparent. Attitude control is
a complex problem since there are many factors that may affect the orientation of the
satellite such as gravity [2], solar radiation [3], atmospheric drag [4] and satellite’s
flexible body [5]. To overcome attitude control problems, different actuator types
are used such as reaction wheels, magnetic torquers, control moment gyros and jet
thrusters.
One of the main actuators that are used in attitude control systems is reaction wheels.
To execute orientation change, one needs to change the angular velocity of the
reaction wheel resulting in angular acceleration. This angular acceleration may also
be interpreted as torque around the center of mass. By the conservation of the angular
momentum principle, the satellite starts to rotate around the opposite direction of
produced torque. Another main actuator used in attitude control systems is magnetic
torquers, also called magnetorquers. One can generate an artificial magnetic field
inside of the satellite by giving voltage to the coils of magnetorquers, this magnetic
field interacts with Earth’s magnetic field so that torque will be generated as a result of
1
this magnetic interaction. The actuator choice might depend on many factors such as
the desired level of performance, cost of the mission and size/mass of the satellite.
The main purpose of this thesis is to design and analyze a satellite attitude control
system by using different optimal control techniques. The main strategy is to design
controllers that can compensate the error between desired attitude and the actual
attitude of the satellite. As the controller, Linear Quadratic Regulator (LQR) and
Model Predictive Controller (MPC) methods are explained in detail. Tuning of
controller parameters and comparison of controllers in terms of disturbance rejection
performances are performed.
Various studies have been performed on satellite attitude control with advanced
methods, LQR and MPC in particular. LQR is a control method based on the solution
of an optimization problem where the cost function to be minimized consists of states,
inputs, and their weights. In [6], Ofodile et. al. design an attitude controller for a
3U CubeSat, "ESTCube2/3". They present the nonlinear satellite model and linearize
it. They propose different control algorithms, in which one of them is an LQR
controller. They compare different control algorithms. Navabi and Hosseini design
a quaternion-based attitude controller for a satellite that is actuated by reaction wheels.
After constructing nonlinear spacecraft dynamics, they use input-output feedback
linearization to obtain the linear spacecraft model and they apply the LQR controller
for attitude control purposes [7]. In [8], Fakoor et. al. focus on designing sliding mode
and LQR controllers for a 4 degree-of-freedom flexible satellite. Tuning of parameters
is performed by the Particle Swarm Optimization method. They use normalized
integral square error as the cost function of the particle swarm optimization algorithm.
Yang designs an LQR controller for a nonlinear spacecraft model. The author develops
a linearized spacecraft model by using three components of the quaternion, which
makes the system fully controllable. After that, the author develops an LQR design
and utilizes this design on a nonlinear spacecraft model [9].
2
The model predictive controller, on the other hand, is alike the LQR controller in terms
of being the solution to an optimization problem. However, in MPC, there exists a
model that predicts ongoing states and inputs/outputs of the system. The control move
is updated at every state according to the prediction model and system measurements.
Control input is determined with respect to the minimization of the cost function that
is similar to the cost function used in the LQR controller. Various studies are presented
on MPC-based attitude control of the satellites. In [10], Mamarasulov et. al. construct
a linear time-variant CubeSat nanosatellite model and design an MPC controller to
control the attitude of this spacecraft. They use Taylor expansion linearization to
obtain the linearized time-variant state space model of the satellite. The authors
also elaborate on the usage of the Kalman filter for sensor fusion purposes. At the
end of the paper, they compare the MPC controller with the LQR controller. Wood
et. al. design a magnetorquer-based attitude controller for a satellite. They use an
MPC controller to control the attitude of the satellite and compare their results with a
well-known controller type: PD controller [11]. Mirshams and Khosrojerdi propose a
method called "tube-based MPC" to stabilize the attitude of an under-actuated satellite
in 3-axis [12]. More studies on MPC-based satellite attitude control can be found
in [13, 14].
3
The last chapter concludes the study with significant outcomes and proposes studies
that may be investigated for ongoing research.
4
2. CONCEPTUAL BACKGROUND
In this section, the reference frames that are used to explain the motion of a satellite
are introduced. Firstly, it is essential to understand the concepts of "inertial" and
"non-inertial" reference frames.
An inertial reference frame is a frame that has no acceleration. This is valid for both
linear and angular accelerations. On the other hand, a non-inertial reference frame
is a frame that has acceleration. One can apply Newton’s mechanical laws for an
inertial frame whereas Newton’s laws are not applicable for a non-inertial reference
frame [15]. For instance, if one writes equations of motion for a rotating frame (which
means existence of angular acceleration) there will exist an extra force called "Coriolis
force" which needs to be implemented into the equations of motion.
In the ECEF coordinate system, the origin is at the center of the Earth. z-axis points
towards the north pole. x-axis points towards the intersection of (0,0) latitude and
longitude. The y-axis is completed by the right-hand rule [16]. This reference frame
rotates with the Earth. Thus, it is a non-inertial reference frame. [17]
ECI reference frame has the origin at the center of the earth. z-axis points towards the
north pole. x-axis points towards the vernal-equinox plane. The y-axis is completed
by the right-hand rule [18]. ECI is an inertial frame. Thus, it is fixed in the universe
and does not rotate.
5
2.1.3 Local-vertical local-horizontal reference frame (LVLH)
This frame is one of the main reference frames explaining a satellite’s orientation. In
the LVLH, the origin is at the center of mass of the satellite. z-axis points towards the
center of mass of the Earth. The y-axis is perpendicular to the orbital frame and The
x-axis completes the right-hand rule.
The body-fixed reference frame is alike the LVLH frame. The origin is at the center of
the mass of the satellite. The is no standard representation of the axis for this frame.
It is common to choose the principle axis of inertia as the frame axes [19]. Visual
representations of ECI, LVLH and body-fixed frames are given in Fig. 2.1.
The attitude of a satellite can be represented as the angle of the body-fixed frame with
respect to an inertial frame. Let us rotate the body-fixed frame around an inertial frame.
This rotation can be represented in different sequences. For instance, one can rotate
the frame around x-y-z, respectively to reach the current angular state of the satellite. It
6
is also possible to rotate with different sequences as well. When the rotation sequence
is z-y-x (also called 3-2-1), it is called as the "Euler angle". The rotation around z-y-x
are called "Yaw (ψ)", "Pitch (θ )" and "Roll (φ )" angles, respectively. Let reference
coordinate system be represented by γ and target body-fixed coordinate system is γ ′ ′′
Visualization of rotation sequence for coordinate transformations are given in Fig. 2.2.
As shown in Fig 2.2, the sequence starts with a ψ deg rotation around the z-axis, which
corresponds to a rotation matrix:
cψ −sψ 0
A3 = sψ cψ 0 (2.1)
0 0 1
where c and s stand for cosine and sine, respectively. The second rotation consists of
rotation around the y-axis of the new frame, γ ′ :
cθ 0 −sθ
A2 = 0 1 0 (2.2)
sθ 0 cθ
The rotation matrix around the x-axis of the new frame, γ ′′ is:
1 0 0
A1 = 0 cφ sφ (2.3)
0 −sφ cφ
The final transformation matrix that consists of the Euler angle rotation sequence is:
7
cθ cψ cθ sψ −sθ
ADCM = A1 A2 A3 = −cφ sψ + sφ sθ cψ cφ cψ + sφ sθ sψ sφ cθ (2.4)
sφ sψ + cφ sθ cψ −sφ cψ + cφ sθ sψ cφ cθ
The matrix ADCM is also called the "Direction Cosine Matrix (DCM)" which is also
another representation to describe the satellite attitude. There exist different DCMs
according to different sequences of rotation. It is possible to obtain the Euler angles
from the DCM A by using basic relations that can be extracted from Eq. 2.4 as:
−1 A23
φ = tan
A33
θ = −sin−1 (A13 ) (2.5)
−1 A12
ψ = tan
A11
One of the main disadvantages of using the Euler angle is there happens singularity
when θ = ±90 deg. which needs to be avoided while representing the attitude.
2.3 Quaternions
Quaternions are the other options to represent the attitude of a satellite. Let us construct
a unit sphere in Fig. 2.3 and specify two points p1 and p2 represented as vectors ⃗p1 and
⃗p2 on the surface of the sphere. Let ⃗v be a vector on the sphere surface perpendicular
to ⃗p1 and ⃗p2 , namely their cross product. It can be said that rotation from ⃗p1 to ⃗p2 can
be achieved by the rotation around the vector ⃗v with an angle α. This rotation can be
represented by using quaternions.
Quaternion is a number system that was first described by William Rowan Hamilton
[20]. Quaternions have 3 vectoral and one scalar element just like given in Fig. 2.3
and can be represented as:
α α
q = cos + sin ⃗v (2.6)
2 2
Which can be also described as scalar and vectoral parts. Let us arrange Eq. 2.6 as:
q = q0 + q1 i + q2 j + q3 k (2.7)
8
where the element q0 is the scalar element; q1 , q2 and q3 are the vectoral elements
represented as imaginary numbers.
Some definitions related to quaternions need to be given. Adjoint (q̄), norm (||q||) and
inverse (q−1 ) of a quaternion can be calculated as [21]:
q̄ = [q0 − q1 − q2 − q3 ] (2.8)
q
||q|| = q20 + q21 + q22 + q23 (2.9)
q̄
q−1 = (2.10)
||q||
Additionally,
i2 = j2 = k2 = i jk = −1 (2.11)
9
ij = k
jk = i (2.12)
ki = j
It is possible to convert Euler angles to quaternions and vice versa. The proper
transformation from Euler angles to quaternions can be written as [22]:
cos φ2 cos ψ φ ψ
θ
θ
2 cos 2 + sin 2 sin 2 sin 2
q0
φ ψ φ ψ
θ θ
q1 sin 2 cos 2 cos 2 − cos 2 sin 2 sin
= 2
q2 φ ψ φ
ψ
(2.13)
θ θ
cos 2 sin 2 cos 2 + sin 2 cos 2 sin 2
q3
cos φ2 cos ψ φ ψ
θ
θ
2 sin 2 − sin 2 sin 2 cos 2
tan−1 2q0 q1 +2q2 q3
φ 2 2 2 2
−1 q0 −q1 −q2 +q3
θ = sin (2q0 q2 − 2q3 q1 )
(2.14)
ψ −1 2q0 q3 +2q1 q2
tan q20 +q21 −q22 −q23
A = −AT (2.15)
Let us define two vectors M and N with basis vectors ê1 , ê2 and ê3 :
10
Cross-product of two vectors can be written as:
M2 N3 − M3 N2 0 −M3 M2 N1
M × N = M3 N1 − M1 N3 = M3
0 −M1 N2
(2.18)
M1 N2 − M2 N1 −M2 M1 0 N3
M × N = M× N (2.19)
where,
0 −M3 M2
M× = M3 0 −M1 (2.20)
−M2 M1 0
Thus, it can be said that the cross-product operator can be represented as a matrix as
given in Eq. 2.20. Notice that this matrix satisfies the condition given in Eq. 2.15,
which is the condition for being a skew-symmetric matrix. Thus, the matrix M× is
called a skew-symmetric cross-product matrix.
11
12
3. SATELLITE EQUATIONS OF MOTION
Satellite equations of motion can be examined under the titles: kinematics, dynamics
and actuator and disturbance modeling. In Fig. 3.1, open loop diagram of a satellite
attitude system is given which clarifies the input-output relation and subsystems
between them.
As the input, voltage, or Pulse Width Modulation (PWM) signal (for the DC motor of
reaction wheels), is given into the actuator subsystem that will produce the command
for generated control torque in which it can be represented as τc the actuated system.
The disturbance torque also needs to be included in the system dynamics since there
occurs disturbances during the operation of satellites such as aerodynamic force (in
low orbit) gravity gradient, solar pressure and so on.
The total force acting on a satellite can be calculated by adding control torque and
disturbance torques. Total torque will be included as the input for the satellite dynamics
subsystem.
The satellite dynamics subsystem will produce the corresponding angular velocity with
respect to time for given input torques acting on the satellite.
The angular velocity state will be used as input for the kinematics subsystem to produce
the final angular state of the satellite. This final state can be obtained by different
representations such as Euler angles, quaternions and so on.
13
The overall system can be interpreted as to be having the voltage as the input and
angular state as the output. One can design an open-loop simulator by constructing all
the equations/subsystems given in this section.
Dynamics is the part that deals with the force acting on the satellite. One can yield the
angular velocity state of the satellite by taking the overall force acting on the satellite
as the input. The force acting on a satellite can be examined as internal force and
external forces (disturbance).
The satellite dynamics equation is basically based on Newton’s second law for angular
motion, which can be described as: "the total external moment acting on a satellite
around its center of mass is equal to the time derivative of the angular momentum"
This can be formulated in inertial frame as [23]:
Te = h˙I (3.1)
where Te is the total external moment acting on the satellite and hI is the angular
momentum represented in the inertial frame, where the subscript I stands for the word
"inertial".
To examine the motion in the body frame, one needs to apply proper transformations
since it is known that the body frame is fixed to the satellite. Thus, it is a non-inertial
frame (See. Section 2.1). The transformation from inertial frame to the body-fixed can
be applied by adding a new term as explained in [23], which converts Eq. 3.1 as to be:
Te = ḣs + ω × hs (3.2)
where hB is the angular momentum vector of the satellite expressed in the body-fixed
frame and ω is the angular velocity vector of the satellite.
It is also known that the external torque can be composed of disturbance torque τd and
control torque τc . Additionally, the angular momentum of a body can be expressed as
the multiplication of the moment of inertia times angular velocity. For a satellite, this
can be defined as:
14
hs = Is ω (3.3)
τd + τc = Is ω̇ + ω × Is ω (3.4)
Leaving the angular velocity term alone in Eq. 3.4 yields the dynamics model for an
inertial pointing spacecraft [24]:
Equation 3.5 represents the final version of the satellite dynamics equations. In this
equation, the input is control torque and disturbance torque whereas the output is
satellite angular velocity. Thus, one can obtain the angular velocity from the inputs
by only having the knowledge of the satellite moment of inertia matrix, which clarifies
the dynamics subsystem given in Fig. 3.1.
Kinematics deals with motion without considering the effect of force. For the satellite
motion, kinematics equations help to convert angular velocity obtained by dynamics
equations into convenient angles.
For a satellite, kinematics equations might be written in different ways. In this section,
the equations are constructed in the way of Euler angles and quaternions.
Euler angle-based kinematics equations differ for different rotation sequences. Since
the base rotation sequence is chosen as 3-2-1 Euler angle sequence for this thesis, the
kinematics equations for this sequence can be written as [25]:
15
One can write Eq. 3.6, in matrix form as:
ψ̇ 0 sin φ cos φ ω1
θ̇ = 1 0 cos φ sin θ − sin φ cos θ ω2 (3.7)
cos θ
φ̇ cos θ sin φ sin θ cos φ sin θ ω3
By using Eq. 3.7, it is possible to obtain Euler angles as roll, pitch and yaw by taking
the angular velocity vector as the input. However, the biggest disadvantage of using
Euler angles to represent kinematics is that the existence of singularity. Notice that
the term 1/cos θ approaches infinity when θ = ±π/2, which destroys the equation.
Thus, when using Euler angle-based kinematics, one needs to avoid the pitch angle to
be ±π/2 radians.
1
q̇ = Ωq (3.8)
2
where
0 −ω1 −ω2 −ω3
ω1 0 ω3 −ω2
Ω = Ω (ω) =
ω2 −ω3
(3.9)
0 ω1
ω3 ω2 −ω1 0
q̇0 q0 −q1 −q2 −q3 0
q̇1 1 q1 q0 −q3 q2 ω1
= (3.10)
q̇2 2 q2 q3 q0 −q1 ω2
q̇3 q3 −q2 q1 q0 ω3
By using kinematics equations expressed in quaternion form, one can obtain the
quaternions by taking the angular velocity as input.
Equation 3.8 can also be separated into two parts as vector and scalar elements of
the quaternion. Let g be the vector that represents the vector elements of q, namely
⃗g = [q1 q2 q3 ]T , which is also known as the Gibbs vector. Equation 3.8 can be written
as:
16
ġ 1 −ω× g + q4 I3×3 ω
= (3.11)
q̇0 2 −ω T g
where I3×3 is 3×3 identity matrix, ω× represents the skew-symmetric cross product
matrix of angular velocity:
0 −ω3 ω2
ω× = ω3 0 −ω1 (3.12)
−ω2 ω1 0
There are various disturbance forces acting on a satellite during its operation. The
disturbance types depend on the mission of the satellite such as its shape, altitude
onboard elements and so on. Let us examine a satellite that operates at Low Earth
Orbit (LEO). The most important disturbances can be examined as aerodynamic and
gravity gradient forces at these altitudes.
Due to the unsymmetrical shape of the satellite, different gravitational force will act
on different points of it, which will cause a disturbance torque around the center of
mass. This disturbance torque is also known as gravity gradient torque and can be
approximated as a linear equation [23]:
3µ
Gx = (Izz − Iyy ) φ
R3
3µ (3.13)
Gy = 3 (Izz − Ixx ) θ
R
Gz = 0
where Gx , Gy and Gz are the gravity gradient torque elements for x,y and z directions,
µ is Earth’s gravitational parameter, R is the radius for circular orbits, Ixx , Iyy and Izz
are the diagonal elements of satellite moment of inertia matrix.
The LEO orbit still consists of air. Satellites orbiting at LEO will be subject to a drag
force due to the presence of the atmosphere. This drag force Fd can be calculated by
the well known drag equation [26]:
17
1
Fd = ρv2 cD Are f (3.14)
2
where ρ is the air density at that altitude, v is the linear velocity vector, cD is the drag
coefficient and Are f is the reference area of the satellite that faces incoming air.
One can collect the whole equations of motion explained in previous sections in state
space representation. It is possible to introduce the dynamical behavior of a system by
defining particular states, inputs and outputs. State space equations for a system can
be written as:
ẋ = F(x, u) (3.15)
Let us define the satellite state vector as to be consisting of satellite angular velocity
an quaternion elements:
T
x = ω1 ω2 ω3 q0 q1 q2 q3 (3.16)
−1
ω̇ Is (−ω× Is ω + τc + τd )
q̇0 = −ω T g (3.17)
ġ 0.5 (−ω× g + q4 I3x3 ω)
In this system, the inputs are control torque (Tc ) and external torque, Te . Output is the
quaternion elements.
To proceed further on the system, let us validate our model by conducting a set of
tests. Nonlinear state space equations were constructed as given in Eq. 3.17. To test the
model, let us give an input torque to the system around the x, y and z axis, respectively.
The constructed Simulink model is given in Fig. 3.2. Content of MATLAB
18
Function blocks "SCmodel_7state" and "quat2Euler" are given in Appendices A.1,
A.2 respectively.
1 Nm of torque around the x-axis was given to the system. The angular position and
velocity outputs of the system are given in Figs. 3.3 and 3.4. When a constant input
torque is applied to the system, it is expected to get a rotating satellite around the
torque-applied axis. This is shown in Fig. 3.3 as expected. Since the torque is given
continuously, the rotation rate must increase, which is proven in Fig. 3.4. Thus, the
time between two rotation periods must decrease by time, which can be also observed
in Fig. 3.3.
19
Figure 3.4 : Variation of angular velocity for a given test input.
Since the model gives expected results for the given input test, one can say that it is
safe to proceed with this nonlinear model.
q
1= q20 + q21 + q22 + q23 (3.18)
which shows that the scalar element of a normalized quaternion can be written as a
combination of quaternion vector elements:
q
q0 = 1 − q21 − q22 − q23 (3.19)
By using Eq. 3.19, one can vanish the state q0 given in Eq. 3.17. All other states that
consist of q0 element can be written in terms of vector elements as stated in Eq. 3.19.
q̇1 q0 −q3 q2 ω1
q̇2 = 1 q3 q0 −q1 ω2
(3.20)
2
q̇3 −q2 q1 q0 ω3
ġ = Qω (3.21)
20
Let us investigate the determinant of the matrix Q. This can be calculated as:
det Q = q0 (3.23)
According to this result, the determinant of the matrix Q is zero when q0 = 0. This
condition is satisfied when α = ±π rad (see Eq. 2.6). Thus reduced quaternion has
also singular point (like in the Euler angles) when the angle reaches ± 180 degrees
since it is not full rank in these cases. However, most of attitude control applications
stay within the safe area.
−1
Is (−ω× Is ω + τc + τd )
ω̇ 1
ẋ = = 2 Qω
(3.24)
ġ
The number of states is now reduced from 7 to 6. This enables the acceleration
of computational power. Furthermore, when the system is linearized, the classical
controller methods can be applied to the reduced system since it is now fully
controllable and stability analysis can be performed [27].
21
in Fig. 3.5 the portion of functions that lay within around ±0.5 rad (corresponding
±20 degrees) are nearly identical. Thus, for small angles, one can use f (x) = x to
calculate the sine of the angle.
ẋ = f (x, u) (3.25)
∂f ∂f
f (x, u) ≈ f (x0 , u0 ) + (x − x0 ) + (u − u0 ) + H.O.T. (3.26)
∂x x=x0 ∂u u=u0
22
δ x ≡ x − x0
δ u ≡ u − u0
δ ẋ ≡ f (x, u) − f (x0 , u0 )
(3.27)
∂f
A≡ (x − x0 )
∂ x x=x0
∂f
B≡ (u − u0 )
∂u u=u0
δ ẋ = Aδ x + Bδ u (3.28)
The matrices A and B might involve more than 1 row and column when the number of
states are more than one, which it is then called the "Jacobian Matrix", which can be
defined for states as:
∂ f ∂ f1 ∂ f1
1
∂x ∂ x2 ... ∂ xn
∂ f12 ∂ f2 ∂ f2
∂x ∂ x2 ... ∂ xn
1
JA = . (3.29)
.. .. ..
.. . . .
∂ fq ∂ fq ∂ fq
∂ x1 ∂ x2 ... ∂ xn
where n is the number of states and q is the number of functions. For input u, the
Jacobian matrix JB can be written as:
∂ f ∂ f1 ∂ f1
1
∂ u1 ∂ u2 ... ∂ um
∂ f2 ∂ f2 ∂ f2
...
∂ u1 ∂ u2 ∂ um
JB =
.. .. .. .. (3.30)
. . . .
∂ fq ∂ fq ∂ fq
∂ u1 ∂ u2 ... ∂ um
where m is the number of inputs. The derivative term can be calculated analytically for
simple equations, whereas it needs to be executed numerically for complex cases.
Let us rewrite the nonlinear state space equations by ignoring disturbance torques and
taking the control torque as input, namely τc = u:
23
−1
Is (−ω× Is ω + u)
ω̇ 1
ẋ = = 2 Qω
(3.31)
ġ
f1 ≡ ω̇
(3.32)
f2 ≡ ġ
The Jacobian matrices for states and inputs can be calculated as:
"∂ f ∂ f1
#
1
∂ω ∂g
JA = ∂ f2 ∂ f2 (3.33)
∂ω ∂g
" #
∂ f1
JB = ∂u (3.34)
∂ f2
∂u
T
x0 = ω10 ω20 ω3 0 q1 0 q2 0 q3 0
T (3.35)
= 0 0 0 0 0 0
T
u0 = u10 u20 u30
T (3.36)
= 0 0 0
∂ f1 ∂ −1
= I (−ω× Is ω + u) = 03×3 (3.37)
∂ω x=x0 ∂ω s x=x0
∂ f1 ∂ −1
= I (−ω× Is ω + u) = 03×3 (3.38)
∂g x=x0 ∂g s x=x0
∂ f2 ∂ 1 1
= Qω = Q (3.39)
∂ω x=x0 ∂ω 2 x=x0 2 x=x0
24
Referring to Eq. 2.9, when the vector elements of quaternion are zero (given as
stationary point), the scalar element of quaternion becomes 1. Thus, the Jacobian
element given in Eq. 3.39 becomes:
1 0 0
1
Q = 0 1 0 = I3×3 (3.40)
x=x0 2
0 0 1
∂ f2 ∂ 1
= Qω = 03×3 (3.41)
∂g x=x0 ∂ω 2 x=x0
∂ f1 ∂ −1
= I (−ω× Is ω + u) = Is−1 (3.42)
∂u u=u0 ∂u s u=u0
∂ f2 ∂ 1
= Qω = 03×3 (3.43)
∂u u=u0 ∂u 2 u=u0
−1
ω̇ 03×3 03×3 ω I
= 1 + s u (3.44)
ġ 2 I3×3 03×3 g 03×3
M = B AB A2 B A3 B A4 B A5 B
(3.45)
1/Is1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1/I s2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1/Is3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1/(2Is1 ) 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(3.46)
1/(2Is2 )
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1/(2Is3 ) 0 0 0 0 0 0 0 0 0 0 0 0
25
Is1 0 0
0 Is2 0 (3.47)
0 0 Is3
From Eq. 3.46, one can see the that rank of matrix M is 6, which is equal to the number
of states. Thus, the linearized state space is fully controllable, which means one can
manipulate all the states by changing the inputs.
To observe the quaternion states, one can choose the output matrix C as:
0 0 0 1 0 0
C = 0 0 0 0 1 0 (3.48)
0 0 0 0 0 1
ω
y = [C] (3.49)
g
Referring to Eq. 3.26, when linearizing a system, one needs the calculate the derivative
to obtain the Jacobian term of the Taylor series. In the Analytical Linearization section,
it is explained to get derivatives analytically. However, it might not be possible to get
analytical derivatives when the system is too complex. To execute this, one can use the
method of numerical linearization. Let us introduce the "Central Difference Method"
to get the derivative terms numerically.
f (x + δ x) − f (x − δ x)
f ′ (x) ≈ (3.50)
(x + δ x) − (x − δ x)
26
Figure 3.6 : Visualization of the central difference method.
One can obtain the numerical derivatives by using this method for complex models. It
is also possible to apply it to the satellite model.
To proceed further, let us compare the nonlinear and linear models to validate the
linearized equations. This is required since from now on, linearized model will be used
for controller design and analysis. Remember that the linearized model was given in
Eq. 3.44. The only parameter to construct this model is the satellite moment of inertia
matrix. Let us choose the satellite moment of inertia matrix as the parameters of a real
satellite taken from [28] as Is = diag([40.45, 42.09, 40.36]).
A Simulink model was established to compare the models. The model is given in Fig
3.7. As the input, a band-limited white noise torque around the roll axis was given
to the system with parameters of noise power 0.01 and a sample time of 0.1 seconds.
To reduce the complexity of the figure, only the roll angle is shown. The output of
nonlinear and linear models are given in Fig. 3.8. As shown by Fig. 3.8 the models are
nearly identical when the angle is smaller than approximately 50 deg. Thus, it can be
said that the linear model is quite successful for small angle approximation and can be
used as a representation of the nonlinear model reliably.
27
Figure 3.7 : Nonlinear-linear model comparison on Simulink.
28
Figure 3.8 : Output of nonlinear and linear models for given input.
29
30
4. CONTROLLER DESIGN
In previous chapters, basic definitions and equations of motion to construct the satellite
attitude control structure were explained. This chapter consists of explanation of
different controllers that are used to compensate the error between the reference and
the output angle. Referring to Fig. 3.1, The basic closed-loop control structure for a
satellite attitude control system is given in Fig. 4.1. Actuator dynamics are ignored
in this diagram. The controller basically takes the error between the reference and the
output. Then, it produces proper control input for the dynamics system, that is control
torque for the satellite attitude control system. The dynamics and kinematics blocks are
used to produce the quaternion output to visualize the orientation state of the satellite.
minimizex J(x)
where J(x) is called the cost function to be minimized, g(x) is inequality constraint and
h(x) is the equality constraint. The number of constraints can be more than one as well
as there might be no constraints. It is possible to apply this optimization problem to
the control theory as well. By using this method, one can generate different problems
such as fuel minimization, time minimization, and so on. Optimal control algorithms
31
are used in many fields such as planetary landing [29], vertical rocket landing [30], and
so on.
ẋ = Ax + Bu
(4.1)
y = Cx + Du
where A is the state matrix, B is the input matrix, C is the output matrix, D is the
feed-forward matrix.
Z ∞
J= (xT Qx + uT Ru)dt (4.2)
0
Where Qn×n and Rm×m are positive definite matrices that determine the weights of
tracking error and control input, respectively. The control law that satisfies the state
space equation given in Eq. 4.1 and minimizes the cost function given in Eq. 4.2 is
determined as:
u = −Kx (4.3)
where
K = R−1 BT P (4.4)
0 = PA + AT P − Q + PBR−1 BT P (4.5)
Once the state space, Q and R matrices are given, the steps of solving the LQR problem
can be sorted as:
32
3. Use K as the gain of state feedback control, given in Eq. 4.3.
Let us design a basic LQR controller by using the state space model explained in Eq.
3.44. The closed loop diagram of the LQR controller is given in Fig. 4.2. The state
space model is explained as the open loop plant. The control law is explained in 4.3.
One can design a linear state space model by only knowing the satellite moment of
inertia. Let us use Is as the same as given in Section 3.6. By using given Is , the state
space becomes:
ẋ = Ax + Bu
(4.6)
y = Cx + Du
where
0 03×3
A = 1 3×3 (4.7)
2 I3×3 03×3
I −1
B= s (4.8)
03×3
C = 03×3 I3×3 (4.9)
The weights Q and R are determined as identity matrices, namely the weight of 1.
Q = [I6×6 ] (4.10)
33
R = [I3×3 ] (4.11)
Inserting given A, B, Q and R matrices and solving the Riccati equation yields the
LQR gain value, which is the gain that minimizes the cost function given in Eq. 4.2:
6.4382 0 0 1 0 0
KLQR = 0 6.5643 0 0 1 0 (4.12)
0 0 6.4312 0 0 1
The stability of a closed loop state-space system for LQR can be found by finding
the eigenvalues of (A − BKLQR ) which is obtained by giving the control input as u =
−KLQR x as mentioned in LQR control problem.
For the gain value found in Eq. 4.12, eig(A − BKLQR ) is found as:
−0.0796 + j0.0776
−0.0796 − j0.0776
−0.0797 + j0.0777
eig(A − BKLQR ) =
(4.13)
−0.0797 − j0.0777
−0.078 + j0.0761
−0.078 − j0.0761
This result gives the closed loop poles. As given in Eq. 4.13, all of the poles lie on the
left of the s-plane, which indicates that the closed loop system is stable.
Let us make a simulation for this LQR solution. The reference quaternion vector
elements [q1 q2 q3 ] are chosen as 0.1, 0.2 and 0.3, respectively. The output of the
simulation is given in Fig. 4.3.
34
As shown in Fig. 4.3, the satellite is able to track the given quaternion references
accurately with zero steady-state error. Additionally, a custom reference signal has
been produced to investigate the performance of LQR controller on tracking. To reduce
the complexity of the graph, only q1 custom reference has been produced. The output
of q1 element with reference is given in Fig. 4.4, which shows that the satellite is able
to track the given quaternion element accurately.
The LQR control has two important parameters to be tuned: Q and R. One can
investigate the effect on the Q parameter. To investigate that, let us keep R as the
identity matrix, namely 1 and alter the Q parameter. The output of q1 for different Q
values is given in Fig. 4.5. As shown in this figure, one can see that a steady state error
occurs when the Q value is lower or greater than 1. Thus, as an intuitive approach, one
can set the Q parameter as 1.
It is also possible to examine the effect of R on the performance. Let us keep the Q
value as 1 and alter the R value. The output of q1 element for different R values is
given in Fig. 4.6. This figure also shows that the values of R other than 1 have also
steady-state error. Thus, one can say that as an intuitive approach, R must be set to 1.
It is known that Q and R parameters are the values that "penalize" the parameters of
the cost function. Referring to the cost function to be minimized, the Q value has the
effect on x, namely states. Thus, increasing the Q value means penalizing changes in
35
states, which means the minimum change in the states. Similarly, the R parameter has
the effect on u, namely control input. Increasing the R parameter means penalizing the
control input. Thus, increasing R means using less "energy".
It is also possible to include the constraints to the LQR solution. Since the LQR
solution is executed for an unconstrained optimization problem, one can include a
"saturation block" to the input of the dynamics subsystem to limit the control torque
36
values. The saturation block is a nonlinear type of block and is not included in the
solution of the optimization problem. It is added subsequently. Thus, the saturation
included LQR is not the "optimal" solution to this attitude control problem.
Let us saturate the control torque between ± 0.02 Nm and give a quaternion reference
to the system as to be q1 = 0.2. Outputs of saturated and unsaturated solutions of LQR
are given in Fig. 4.7. Additionally, the control inputs for saturated and unsaturated
cases are given in Fig. 4.8, which shows that the saturation block works fruitfully, the
input is limited between ±0.02 Nm.
37
4.2 Model Predictive Controller
Model Predictive Control (MPC) is also an optimal control solution. One of the most
important differences between MPC and LQR is that the optimization problem is
solved at each time step. MPC is based on the "prediction" of the next states and
control inputs of the models. Thus, one needs a strong, successful model to use that
control algorithm since the control inputs are updated according to the system model
besides system measurements.
MPC has also two important parameters as Prediction Horizon, N p and control horizon
Nc . These parameters determine the amount of prediction for the given system.
x (k + 1) = Ax (k) + Bu (k)
(4.14)
y (k) = Cx(k)
Where An×n is the state matrix Bm×m is the control matrix and C p×n is the output matrix
where p is the number of outputs.
Let us iterate the state space system given in (4.14) one step:
x (k + 2) = Ax (k + 1) + Bu (k + 1)
Let us bring Eqs. 4.15, 4.16 and 4.17 together to observe the pattern:
38
x (k + 1) = Ax (k) + Bu (k)
As shown in Eq. 4.18, one can "predict" the ongoing states with the equation:
x (k + 1)
A
A2
x (k + 2)
A3
x (k + 3)
= x (k) +
..
..
.
.
x (k + N p ) ANp
(4.19)
B 0 0 ··· 0 u (k)
AB
B 0 · · · 0 u (k + 1)
A2 B · · · 0
AB B u (k + 2)
.. .. .. . ..
· · · ..
. . . .
N −1 N −2 N −3
A p B A p B A p B · · · B u (k + N p − 1)
Where N p is the prediction horizon. One can write the prediction equations by using
Eq. 4.19 to predict the future states and control inputs of the system. In this system, the
prediction horizon is the same as the control horizon. Since there is no issue concerning
computational burden, the control horizon is kept constant. By multiplying predicted
states with the output Matrix, C, one can also obtain the predicted outputs since y = Cx.
The cost function to be minimized for the MPC controller is similar to LQR control:
N p −1
min J ∑ xkT Qxk + uTk Ruk (4.21)
k=0
subject to:
umin ≤ uk ≤ umax
39
where the matrices Q and R are the weights of states and inputs, respectively. The
block diagram of the MPC-controlled satellite system is given in Fig. 4.9. As shown
in the block diagram, in the controller section, there is an optimizer that solves the
optimization problem (given in 4.21) in every time step to find the feasible solution,
which is control torque for the satellite. The optimizer works with the prediction
model and predicts the ongoing states of the system. Furthermore, predictions are also
updated according to system output, qre f for this case. The produced control torque is
used in the satellite dynamics subsystem to obtain the angular velocity vector of the
satellite, whereas the angular velocity vector is then used to obtain the quaternion state
of the satellite.
One of the most powerful sides of MPC is its constraint-handling capability. This
means that the user can provide specific constraints such as interval of control input
(which might be dc motor voltage constraint for a reaction wheel), and constraints
on states and outputs. For instance, one can also constrain the output quaternions
to make sure that the satellite is operating under the given angle interval. An
unconstrained MPC is also a controller type that has no constraints such as the classical
LQR controller. Unconstrained MPC has an analytical solution [31] whereas to
solve constrained MPC problems, one needs to define the optimization problem as a
"quadratic programming" problem and solve it numerically. Numerous open-source
libraries can be used to solve quadratic programming problems in many different
languages.
Let us also perform a simulation to investigate the performance of the MPC controller.
The simulation parameters are given in Table 4.1. As distinct from the LQR controller,
MPC has the capability of constraint handling. Thus, one can determine constraints
for control torque. Let us determine this control torque constraint as given in Table
4.1. Reference quaternion vector is chosen as qre f = [0.08, 0.05, 0.03]. Under these
conditions step response of quaternion outputs, qout is given in Fig. 4.10.
40
Table 4.1 : MPC simulation parameters.
Additionally, the control torque input plot for the case of Fig. 4.10 is given in Fig.
4.11. Fig. 4.10 shows that the satellite is able to track given references accurately.
Furthermore, Fig. 4.11 shows that the input constraint is satisfied accordingly between
± 0.02 Nm. This is the solution to a quadratic programming problem with input
constraints. So the optimal solution also includes the constraints as well. The
constraints are not included subsequently, contrary to the LQR controller.
41
Figure 4.11 : Control torques for MPC controller.
One can compare LQR and MPC controllers with respect to their disturbance rejection
performances. To evaluate this, a step (constant) output disturbance was given into the
system. The reference quaternion element, g1 was taken as 0.1. Only g1 was examined
to reduce the complexity of the graph. The disturbance was given into the system at
70th second and the magnitude is determined as 0.01. The output response of LQR
and MPC controllers are given in Fig. 4.12.
42
It is obvious that the MPC controller successfully compensates the disturbance whereas
the LQR controller fails to do so. Since the disturbance is given as an output
disturbance, a sudden change in the output occurs, as expected. The disturbance
rejection performance of the controllers can be also compared by using a mathematical
approach, Root mean square error (RMSE). RMSE values of the controllers between
the output and reference were calculated after the disturbance was applied. RMSE
value for the LQR controller was found as 0.01 whereas this value is 0.0029 for the
MPC controller, which is exceptionally lower than LQR.
43
44
5. CONCLUSIONS AND RECOMMENDATIONS
In this thesis, design, analysis and optimization of controllers for a satellite attitude
control system have been explored. The main purpose was to investigate improving
the performance and robustness of attitude control systems. To achieve this, LQR
and MPC controllers were investigated and compared in terms of disturbance rejection
performances.
In the initial chapters, the required definitions to design a satellite attitude control
system were introduced. Satellite mathematical model were explained as dynamics
and kinematics subsystems. The nonlinear system dynamics were linearized around
the operating point. The linearization process was explained in detail and a comparison
of nonlinear and linear models was executed.
The controller design mainly focused on optimal control methods. Initially, LQR
controller was introduced with tracking performance evaluation. The tracking
performance was also investigated with the tuning of cost function weights. It has been
observed that the cost function weights Q and R have a significant effect on the system
output. It was also observed that the LQR is capable of stabilizing the attitude of
the satellite and tracking the given reference accurately. Additionally, an investigation
of the MPC controller was executed in detail. Model Predictive Controller has the
advantage of predicting the future states and outputs by the prediction model as well
as it has the capability of constraint handling. Then, LQR and MPC controllers were
compared in terms of their disturbance rejection performances. It was observed that
the MPC controller was able to compensate the disturbance successfully and brings
the state to the reference quaternion whereas the LQR controller was not able to
compensate the error between reference and output after the disturbance was applied.
Future research could explore the implementation of advanced control algorithms such
as Linear Quadratic Integrator, Linear Quadratic Gaussian, Nonlinear control and so
on. Advanced estimators may also be developed such as Kalman Filter, and Particle
Filter to include the measurement noise into the system model and enhance the control
45
models in the presence of this noise. Additionally, model-based design techniques such
as processor-in-the-loop, and hardware-in-the-loop can be developed in embedded
hardware to achieve more realistic results.
This thesis contributes the body knowledge for satellite attitude control design and
provides profitable insights for the engineers and researchers employed in satellite
missions. It also aims to provide intuition on selecting and optimizing appropriate
control parameters.
46
REFERENCES
[1] Meza, L., Tung, F., Anandakrishnan, S., Spector, V. and Hyde, T. (2005). Line
of sight stabilization of James Webb space telescope, 27th Annual AAS
Guidance and Control Conference, AAS-05-002.
[2] Zhou, K., Huang, H., Wang, X. and Sun, L. (2017). Magnetic attitude
control for Earth-pointing satellites in the presence of gravity gradient,
Aerospace Science and Technology, 60, 115–123.
[4] Xu, G., Tianhe, X., Chen, W. and Yeh, T.K. (2011). Analytical solution of
a satellite orbit disturbed by atmospheric drag, Monthly Notices of the
Royal Astronomical Society, 410(1), 654–662.
[5] Xiao, B., Yin, S. and Kaynak, O. (2016). Attitude stabilization control of flexible
satellites with high accuracy: An estimator-based approach, IEEE/ASME
Transactions on Mechatronics, 22(1), 349–358.
[6] Ofodile, I., Ehrpais, H., Slavinskis, A. and Anbarjafari, G. (2019). Stabilised
LQR control and optimised spin rate control for nanosatellites, 2019
9th International Conference on Recent Advances in Space Technologies
(RAST), IEEE, pp.715–722.
[8] Fakoor, M., Nikpay, S. and Kalhor, A. (2021). On the ability of sliding mode
and LQR controllers optimized with PSO in attitude control of a flexible
4-DOF satellite with time-varying payload, Advances in Space Research,
67(1), 334–349.
[9] Yang, Y. (2012). Analytic LQR design for spacecraft control system based on
quaternion model, Journal of aerospace engineering, 25(3), 448–453.
[11] Wood, M., Chen, W.H. and Fertin, D. (2006). Model predictive control of low
earth orbiting spacecraft with magneto-torquers, 2006 IEEE Conference
47
on Computer Aided Control System Design, 2006 IEEE International
Conference on Control Applications, 2006 IEEE International Sympo-
sium on Intelligent Control, IEEE, pp.2908–2913.
[13] Hu, Y., Lu, Z., Ling, K., Liao, W. and Zhang, X. (2022). Multiplexed MPC
attitude control of a moving mass satellite using dual-rate piecewise
affine model, Aerospace Science and Technology, 128, 107778.
[14] Walsh, A., Di Cairano, S. and Weiss, A. (2016). MPC for coupled station
keeping, attitude control, and momentum management of low-thrust
geostationary satellites, 2016 American Control Conference (ACC),
IEEE, pp.7408–7413.
[16] Cai, G., Chen, B.M. and Lee, T.H., (2011). Coordinate Systems and
Transformations, Springer London, London, pp.23–34, https://
doi.org/10.1007/978-0-85729-635-1_2.
[18] Du, W., Wie, B. and Whorton, M. (2008). Dynamic modeling and flight control
simulation of a large flexible launch vehicle, AIAA Guidance, Navigation
and Control Conference and Exhibit, p.6620.
[19] Lavezzi, G., Grøttey, M.E. and Ciarcià, M. (2019). Attitude control strategies
for an imaging cubesat, 2019 IEEE International Conference on Electro
Information Technology (EIT), IEEE, pp.149–155.
[21] Diebel, J. et al. (2006). Representing attitude: Euler angles, unit quaternions, and
rotation vectors, Matrix, 58(15-16), 1–35.
[23] Sidi, M.J. (1997). Spacecraft dynamics and control: a practical engineering
approach, volume 7, Cambridge university press.
48
[24] Yang, Y. (2012). Spacecraft attitude determination and control: Quaternion based
method, Annual Reviews in Control, 36(2), 198–219.
[25] Nudehi, S.S., Farooq, U., Alasty, A. and Issa, J. (2008). Satellite attitude control
using three reaction wheels, 2008 American control conference, IEEE,
pp.4850–4855.
[26] Lee, D., Springmann, J., Spangelo, S. and Cutler, J. (2011). Satellite dynamics
simulator development using lie group variational integrator, AIAA
Modeling and Simulation Technologies Conference, p.6430.
[27] Yang, Y. (2010). Quaternion based model for momentum biased nadir pointing
spacecraft, Aerospace Science and Technology, 14(3), 199–202.
[29] Acikmese, B., Casoliva, J., Carson, J. and Blackmore, L. (2012). G-fold: A
real-time implementable fuel optimal large divert guidance algorithm
for planetary pinpoint landing, Concepts and Approaches for Mars
Exploration, 1679, 4193.
[30] Liu, X. (2019). Fuel-optimal rocket landing with aerodynamic controls, Journal
of Guidance, Control, and Dynamics, 42(1), 65–77.
49
50
APPENDICES
51
52
APPENDIX A.1: MATLAB Function block: "SCmodel_7state"
53
54
APPENDIX A.2: MATLAB Function block: "quat2Euler"
q0 = q(1);
q1 = q(2);
q2 = q(3);
q3 = q(4);
phi = phi*180/pi;
theta = theta*180/pi;
psi = psi*180/pi;
end
55
56
APPENDIX A.3: MATLAB Code: Controllability Check Matrix
clear;
clc;
A = [ zeros(3,3) zeros(3,3);
0.5*eye(3,3) zeros(3,3)];
B = [inv(Is); zeros(3,3)];
57
58
CURRICULUM VITAE
59