International Journal of Engineering Insights: (2024) Vol. 2, Nro. 1, Regular Paper
https://doi.org/10.61961/injei.v2i1.15
PI-Filter compensator for LQG controller aimed to fixed-wings
aircrafts
Mar´ıa del Carmen Claudio · Alida Ort´ız-Pupo · Gloria Chicaiza-Claudio
Received: 13 January 2024 / Accepted: 10 May 2024 / Published: 15 May 2024
Abstract: Fixed-wing aircraft generate lift and propul-
sion using their wings, relying on forward motion for
airflow instead of rotating blades like helicopters. They
offer advantages such as extended range, higher ve-
locities, stability in turbulent weather, and lower op-
erational costs compared to rotary-wing aircraft. This
study introduces a method to enhance control smooth-
ness for fixed-wing aircraft using Linear Quadratic Gaus-
sian control and Proportional-Integral filter compen-
sation. Flight simulators like FlightGear are employed
to test control algorithms, providing realistic flight dy-
namics and versatile options for various aircraft types.
This approach offers a cost-effective and efficient means
to develop and test controllers for challenging flight
scenarios, while demonstrating the performance of the
LQG+PI method by displaying the trends in longitu-
dinal and lateral control errors.
Keywords PI+LQG · fixed-wing aircraft · FlightGear
1 Introduction
Fixed-wing aircraft are airplanes that generate lift and
propulsion by directing airflow over their wings, which
remain fixed in position during flight [1]. Unlike rotor-
craft such as helicopters, which utilize rotating wings or
blades to achieve lift, fixed-wing aircraft rely on forward
motion to create the airflow necessary for lift genera-
tion. While rotary-wing aircraft offer enhanced maneu-
verability due to their ability to perform vertical take-
off and hovering, fixed-wing aircraft are the standard
in aviation for various purposes, including long-distance
Mar´ıa del Carmen Claudio · Gloria Chicaiza-Claudio
Inmersoft Technologies
Quito, Ecuador
{mclaudio, gchicaiza}@inmersoft.com
Alida Ort´ız-Pupo
Instituto de Autom´atica
Universidad Nacional de San Juan
San Juan, Argentina
aortiz@inaut.unsj.edu.ar
transportation, aerial surveillance, cargo transport, and
military operations [2]. This preference is due to the
inherent advantages rooted in the aerodynamic design
and operational characteristics. The advantages of fixed-
wing aircraft are numerous and encompass various as-
pects of performance, efficiency, versatility, and oper-
ational capability. Compared to rotary-wing aircraft,
fixed-wing types offer extended flight range and en-
durance due to their design optimized for forward mo-
tion rather than vertical takeoff and hovering [3]. Ad-
ditionally, fixed-wing aircraft can achieve significantly
higher speeds, thanks to their aerodynamic configura-
tion, and they demonstrate superior stability in turbu-
lent weather conditions [4]. Moreover, fixed-wing air-
craft can carry larger payloads and offer lower opera-
tional and maintenance costs than rotary-wing aircraft.
Flight simulators are a cost-effective and efficient
way to calibrate, test, and improve control algorithms
before conducting experiments on fixed-wing aircraft.
Whether for military, entertainment, or commercial ap-
plications, a suitable simulator can be an excellent tool
for proper vehicle handling, particularly when the ve-
hicle can be damaged if the pilot loses control or is
inexperienced [5]. In this context, the control of an air-
craft that is challenging to test in a laboratory can be
significantly enhanced by utilizing a simulator with flex-
ible characteristics capable of interfacing with mathe-
matical software, especially when assessing responses
to wind disturbances that are difficult to measure and
replicate experimentally. Simulation software such as
X-Plane, AirSim, Gazebo, and FlightGear have such
capabilities, with research studies employing them for
various purposes. FlightGear features an intuitive user
interface, the ability to communicate with external soft-
ware, dynamic properties for an assortment of freely
downloadable simulated prototypes, options for adding
a debugging mode for communication errors, and the
ability to display prototype states over LAN networks
[6]. Furthermore, the versatility of FlightGear allows
the use of different aircraft and flying objects and avoids
the use of potentially oversimplified flight dynamics mod-
18 International Journal of Engineering Insights, (2024) 2:1
els. Given these features, FlightGear can communicate
with mathematical software to modify the state of sim-
ulated prototype actuators to test controllers or cali-
brate them against simulated disturbances [7]. In this
way, FlightGear performs the flight calculations, with
the program treated as a black box to Matlab, akin to a
real aircraft [8]. This approach leverages a high degree
of realism provided by FlightGear, which utilizes estab-
lished and realistic Flight Dynamics Models (FDMs) [9]
based on nonlinear equations of motion.
Research has explored the use of LQG control for
managing fixed-wing aircraft [10], yet a significant hur-
dle emerges during the linearization process and the dy-
namic alteration of linearization points, leading to un-
wanted abrupt maneuvers [11]. To overcome this chal-
lenge, this study introduces a PI filter compensation
method aimed at enhancing the smoothness of LQG-
generated control. As the aircraft, we used the F-104
Starfighter data to achieve the linearized model while
employing its complete dynamics within FlightGear.
The results show the lateral and longitudinal behav-
ior of the system, indicating a trend of control errors
towards zero.
The article is divided into five parts, including the
Introduction and Conclusions. In Section 2, the lin-
earization of the model is presented, while Section 3
develops the PI-Filter compensator. Furthermore, Sec-
tion 4 includes the results of this work.
2 Modeling
When determining the acceleration of each mass ele-
ment, we must consider the contributions to its velocity
from both the linear velocities (u, v, w) in each of the
coordinate directions and the contributions due to the
rotational rates (p, q, r) about the axes (Fig. 1). There-
fore, the time rates of change of the coordinates in an
inertial frame that is instantaneously coincident with
the body axes are:
˙x = u + qz ry,
˙y = v + rx pz,
˙z = w + py qx.
The linearized equations are derived from Caughey
et al. [12]. In this way, for the longitudinal control, the
equation is given by:
˙u
˙ω
˙q
˙
θ
= F
LO
u
ω
q
θ
+ G
LO
δ
e
δ
T
, (1)
where
F
LO
=
X
u
X
ω
0 g
Z
u
Z
ω
u
0
0
M
u
+ M
˙ω
Z
u
M
ω
+ M
˙ω
Z
ω
M
q
+ M
˙ω
u
0
0
0 0 1 0
,
(2)
and
G
LO
=
X
e
X
T
Z
e
Z
T
M
e
+ M
˙ω
Z
e
M
T
+ M
˙ω
Z
T
0 0
. (3)
Here, the state vector is x
LO
= [u ω q θ]
T
and the
longitudinal control vector (elevator and throttle) is
η = [δ
e
δ
T
]
T
. The orientation of the body is determined
by (β, θ, ϕ), with β representing the yaw rotation about
the Z-axis, θ the pitch rotation about the Y-axis, and
ϕ the roll rotation about the X-axis.
On the other hand, the equation for the lateral con-
trol is:
˙
β
˙p
˙r
˙
ϕ
= F
LA
β
p
r
ϕ
+ G
LA
δ
a
δ
r
, (4)
where
F
LA
=
Y
β
/u
0
Y
p
/u
0
(1 Y
r
/u
0
) g/u
0
L
β
L
p
L
r
0
N
β
N
p
N
r
0
0 1 0 0
, (5)
and
G
LA
=
0 Y
r
/u
0
L
a
L
r
N
a
N
r
0 0
. (6)
Here, the state vector is x
LA
= [β p r ϕ]
T
and the lat-
eral control vector (aileron and rudder) is η = [δ
a
δ
r
]
T
.
3 PI-Filter compensation
The non-zero point regulator is designed under the as-
sumption that the system to be controlled is modeled
without error and that any system disturbances are
white random processes. However these conditions are
violated because of slowly varying disturbances of un-
certain magnitude, that makes the basic LQ regula-
tion inadequate. Therefore there is the need to increase
system robustness by providing dynamic compensation
19 International Journal of Engineering Insights, (2024) 2:1
Fig. 1 The body axis system is centered at the center of gravity of the flight vehicle. The y-axis extends out towards the right
wing.
which can be accomplished by adding new states to
the closed-loop system. The state vector is augmented,
corresponding differential equations are added to the
system model and the control law that minimizes a
quadratic cost function is computed for the augmented
systems. In particular the proportional-integral com-
pensation introduces command-error integrals to the
LQ control law. The systems to be controlled is de-
scribed by the linear, time-invariant model
˙x(t) = Fx(t) + Gu(t) + Lw(t),
y(t) = H
x
x(t) + H
u
u(t) + H
w
w(t).
It is assumed that F, G, H
x
, H
u
, L, and H
w
are known
without error and are a generalization of the lateral and
longitudinal linearization.
The equilibrium of the system is reached when
˙
x (t) =
0. Therefore, we can represent the state system equa-
tions as follows
0
y
=
F G
H
x
H
u
x
u
+
L
H
w
w
,
which can also be written as
0 Lw
y
H
w
w
=
F G
H
x
H
u
x
u
.
If the variables x
and u
are solved, then:
x
u
=
F G
H
x
H
u
1
0 Lw
y
H
w
w
. (7)
Let’s define:
A =
F G
H
x
H
u
and
B =
B
11
B
12
B
21
B
22
= A
1
;
then, the equation (7) can be written as:
x
u
=
B
11
B
12
B
21
B
22
0 Lw
y
H
w
w
.
The reference values x
and u
, dependent on the de-
sired input y
(Fig. 2), are
x
= B
11
Lw
+B
12
(y
H
w
w
) ,
u
= B
21
Lw
+B
22
(y
H
w
w
) ;
with
B
11
=F
1
(GB
21
+I
n
),
B
12
= F
1
GB
22
,
B
21
= B
22
H
x
F
1
,
B
22
=
H
x
F
1
G + H
u
1
.
Fig. 2 Reference values depending on the desired inputs
The quadratic cost function for the Proportional-
Integral-Filter Compensation is
J = lim
T →∞
1
2T
Z
T
0
˜x
T
(t) ˜u
T
(t) ξ
T
(t)
Γ
˜x(t)
˜u(t)
ξ(t)
+ v
T
(t)R
2
v(t)
dt, (8)
20 International Journal of Engineering Insights, (2024) 2:1
with
Γ =
Q
1
M 0
M
T
R
1
0
0 0 Q
2
,
where R
1
, M, Q
1
, and Q
2
are gain matrices.
This equation may be reformulated considering
˙
˜x(t) = x(t) + G˜u(t),
˙
˜u(t) =
˙
˜u
C
(t) v(t),
and adding the integral-state vector to this, the aug-
mented state equation can be formed
˙
˜x(t)
˙
˜u(t)
˙
ξ(t)
=
F G 0
0 0 0
H
x
H
u
0
˜x(t)
˜u(t)
ξ(t)
+
0
I
m
0
v(t); (9)
where
˜u(t) = u(t) u
,
˜x(t) = x(t) x
,
ξ(t) = ξ(0) +
Z
t
0
(y(τ ) y
).
The augmented state equation (9) can also be writ-
ten as
˙χ(t)
=
F G 0
0 0 0
H
x
H
u
0
χ(t) +
0
I
m
0
v(t),
with
χ(t)
˜x(t)
˜u(t)
ξ(t)
.
The cost function in (8) then becomes
J = lim
T →∞
1
2T
T
Z
0
χ
T
(t)Q
χ(t) + v
T
(t)R
v(t)
dt,
which leads to a control law of the form
v(t) = Cχ(t)
or
v(t) = C
1
˜x(t) C
2
˜u(t) C
3
ξ(t).
This equation is equivalent to
˙u(t) = C
1
[x(t) x
] C
2
[u(t) u
]
C
3
ξ(0) +
Z
t
0
(y(τ ) y
)
, (10)
with
y
= H
x
x
+ H
u
u
.
The control law (10) can be rearranged as
˙u(t) = (C
1
B
12
+C
2
B
22
)y
C
1
x(t) C
2
u(t)
C
3
ξ(0) +
t
Z
0
(y(τ ) y
)
(11)
and
˙u(t) = C
F
y
C
B
x(t) C
C
u(t)
C
I
ξ(0) +
t
Z
0
(y(τ ) y
)
, (12)
with C
F
= B
22
+ C
1
B
12
, C
B
= C
1
, C
C
= C
2
, C
I
=
C
3
.
The implementation of the complete controller is vi-
sualized in Fig. 3, where the connection of the control
outputs to FlightGear is shown, with the matrix calcu-
lations being performed in Matlab.
4 Results
4.1 Intercommunication
Based on the work of Aschauer et al. [13], we have pro-
grammed a UDP-based communication tunnel to ex-
change information between the mathematical software
and the flight simulator (see Fig. 5) through an informa-
tion frame. The parameters for obtaining the linearized
model are taken from:
F-104 Starfighter parameters
http://www.gnu-darwin.org/ProgramDocuments/
f104/linear.html
Additionally, the software is executed with the fol-
lowing command:
Command to execute FlightGear
C:\ProgramFiles\FlightGear 2017.3.1\bin\fgfs
–aircraft=F-104
–start-date-lat=2004:06:01:09:00:00
–generic=
socket,out,20,localhost,2054,udp,readUDP
–generic=
socket,in,20,localhost,2055,udp,writeUDP
21 International Journal of Engineering Insights, (2024) 2:1
Fig. 3 Proportional-integral (PI) regulator for nonsingular command vector
where the aircraft type is specified (in our case, the
F-104 Starfighter), along with the simulation start date
and time, and the UDP ports for information exchange.
Finally, the controllers defined in Section 3 are pro-
grammed in Simulink, as shown in Fig. 4.
4.2 States and control errors
The intercommunication between programs allows read-
ing the states of the simulated aircraft in Matlab, while
the control actions are reflected in FlightGear. Thus, we
plot all states of both longitudinal and lateral behavior
in Figures 6 and 7, respectively. For the longitudinal
behavior, we assume a constant throttle, while setting
an elevation of 20 degrees, starting from an initial el-
evation of -20 degrees. On the other hand, for the lat-
eral behavior, both pitch and roll need to be controlled.
Therefore, the roll starts from an angle of 5 degrees,
with a desired roll of 20 degrees. Similarly, the pitch
starts from an angle of 10 degrees and needs to reach
5 degrees. Both Figure 6 and Figure 7 demonstrate the
trend of errors approaching zero.
5 Conclusions
In conclusion, this study focuses on the development
and implementation of control techniques for fixed-wing
aircraft, leveraging flight simulators as a primary tool
for algorithm validation and testing. Key methodolo-
gies such as LQG control and PI filter compensation
are employed to enhance control smoothness and effi-
ciency. The integration of UDP-based communication
tunnels facilitates seamless data exchange between the
flight simulator and mathematical software like Mat-
lab, crucial for real-time control and simulation. Results
presented demonstrate the longitudinal and lateral be-
havior of the controlled system, indicating a trend to-
wards minimal control errors.
Appendix: Tables with constants required for
linearization
Table 1 Constants for Longitudinal–Directional System
Parameter Value
Stability Derivative X
u
= 0.0093
Angle of Attack Deriv. X
w
= 0.0253
Stability Derivative Z
u
= 0.0236
Angle of Attack Derivative Z
w
= 0.1982
Gravity in Slugs g = 32.174
Initial vel. u
0
= 1740.81
Compressibility Effect Deriv. M
u
= 0.0
Elev. Deflection X
e
= 0.0
Dimensional Pitching Mom. Deriv. M
w
= 0.0104
Dimensional Pitching Mom. Deriv. M
˙w
= 0.0
Dimensionless Pitching Mom. Deriv. M
q
= 0.1845
Thrust Deflection X
T
= 0
Thrust Deflection Z
T
= 0
Pitching Mom. (Thrust Deflection) M
T
= 0
Pitching Mom. (Elevator Deflection) M
e
= 18.1525
Elevator Deflection Z
e
= 87.9155
Conflict of interest
The authors declare that they have no conflict of inter-
est.
22 International Journal of Engineering Insights, (2024) 2:1
Fig. 4 Programming of the controller in Simulink
Fig. 5 Connection bewteen Matlab and FlightGear
References
1. B. Sarlioglu and C. T. Morris, “More electric aircraft:
Review, challenges, and opportunities for commercial
Table 2 Constants for Lateral–Directional System
Parameter Value
Roll Rate Y
p
= 0.0
Sideslip Derivative Y
β
= 175.6628
Yaw Rate Derivative Y
r
= 0
Aileron Deflection Derivative Y
a
= 0
Rolling Moment L
p
= 0.8864
Rolling Moment L
r
= 4.0927
Rolling Moment L
a
= 63.6874
Roll Acceleration L
β
= 48.1804
Yawing Moment N
a
= 0.0777
Yawing Moment N
p
= 0.0182
Yawing Moment N
r
= 1.3522
Yaw Acceleration N
β
= 7.5224
transport aircraft,” IEEE transactions on Transporta-
tion Electrification, vol. 1, no. 1, pp. 54–64, 2015.
2. S. G. Gupta, D. M. Ghonge, and P. M. Jawandhiya, “Re-
view of unmanned aircraft system (uas),” International
Journal of Advanced Research in Computer Engineering
& Technology (IJARCET) Volume, vol. 2, 2013.
3. B. J. Brelje and J. R. Martins, “Electric, hybrid, and
turboelectric fixed-wing aircraft: A review of concepts,
models, and design approaches,” Progress in Aerospace
Sciences, vol. 104, pp. 1–19, 2019.
4. D. B. Barber, J. D. Redding, T. W. McLain, R. W. Beard,
and C. N. Taylor, “Vision-based target geo-location using
a fixed-wing miniature air vehicle,” Journal of Intelligent
and Robotic Systems, vol. 47, pp. 361–382, 2006.
5. J. Veltman, “A comparative study of psychophysiological
reactions during simulator and real flight,” The Interna-
23 International Journal of Engineering Insights, (2024) 2:1
Fig. 6 Longitudinal states values and control error
Fig. 7 Lateral states values and control errors
tional Journal of Aviation Psychology, vol. 12, no. 1, pp.
33–48, 2002.
6. A. Nisansala, M. Weerasinghe, G. Dias, D. Sandaruwan,
C. Keppitiyagama, N. Kodikara, C. Perera, and P. Sama-
rasinghe, “Flight simulator for serious gaming,” in Infor-
mation Science and Applications. Springer, 2015, pp.
267–277.
7. J. Ying, H. Luc, J. Dai, and H. Pan, “Visual flight simula-
tion system based on matlab/flightgear,” in 2017 IEEE
2nd Advanced Information Technology, Electronic and
Automation Control Conference (IAEAC). IEEE, 2017,
pp. 2360–2363.
8. N. Horri and M. Pietraszko, “A tutorial and review on
flight control co-simulation using matlab/simulink and
flight simulators,” Automation, vol. 3, no. 3, pp. 486–510,
2022.
9. A. I. Hentati, L. Krichen, M. Fourati, and L. C. Fourati,
“Simulation tools, environments and frameworks for uav
systems performance analysis,” in 2018 14th Interna-
tional Wireless Communications & Mobile Computing
Conference (IWCMC). IEEE, 2018, pp. 1495–1500.
10. E. N. Demirhan, K. C¸ . Co¸skun, and C. Kasnakglu, “Lqi
control design with lqg regulator via ukf for a fixed-wing
aircraft,” in 2020 24th International Conference on Sys-
tem Theory, Control and Computing (ICSTCC). IEEE,
2020, pp. 25–30.
11. S. G. Clarke and I. Hwang, “Deep reinforcement learn-
ing control for aerobatic maneuvering of agile fixed-wing
aircraft,” in AIAA Scitech 2020 Forum, 2020, p. 0136.
12. D. A. Caughey, “Introduction to aircraft stability and
control course notes for m&ae 5070,” Sibley School of
Mechanical & Aerospace Engineering Cornell University,
vol. 15, 2011.
13. G. Aschauer, A. Schirrer, and M. Kozek, “Co-simulation
of matlab and flightgear for identification and control of
aircraft,” IFAC-PapersOnLine, vol. 48, no. 1, pp. 67–72,
2015.
License
Copyright (2024) Mar´ıa del Carmen Claudio, Alida
Ortiz, Gloria Chicaiza-Claudio.
This text is protected under an international Cre-
ative Commons 4.0 license.
24 International Journal of Engineering Insights, (2024) 2:1
You are free to share, copy, and redistribute the ma-
terial in any medium or format and adapt the docu-
ment — remix, transform, and build upon the material
for any purpose, even commercially, provided you
comply with the conditions of Attribution. You must
give appropriate credit to the original work, provide a
link to the license, and indicate if changes were made.
You may do so in any reasonable manner, but not in
a way that suggests endorsement by the licensor or ap-
proval of your use of the work.
License summary - Full text of the license