In my research, I focus on the pitch control design of a fixed-wing UAV using a genetic algorithm (GA) optimized PID controller. Fixed-wing UAVs offer superior endurance and range compared to rotorcraft, making them increasingly valuable in both military and civilian applications such as surveillance, mapping, and agriculture. The pitch angle control is a critical longitudinal channel of the fixed-wing UAV, which directly affects flight stability and maneuverability. Traditional PID tuning methods often fall short in achieving optimum performance across varying flight conditions. To address this, I employ a genetic algorithm to automatically search for the optimal PID gains, resulting in a robust and efficient pitch control system. This article presents the mathematical modeling, control design, GA optimization procedure, and comparative simulation results.
Longitudinal Dynamics of Fixed-Wing UAV
To design the pitch controller, I first derive the linearized longitudinal model of the fixed-wing UAV. The nonlinear six-degree-of-freedom equations are decoupled into longitudinal and lateral subsets under the assumption of small perturbations and symmetric flight. The longitudinal state vector is defined as:
$$
\mathbf{x}_l = [u, \alpha, q, \theta]^T
$$
where \(u\) is the body-axis forward speed, \(\alpha\) is the angle of attack, \(q\) is the pitch rate, and \(\theta\) is the pitch angle. The input is the elevator deflection \(\delta_e\). The linear state-space representation is:
$$
\dot{\mathbf{x}}_l = \mathbf{A}_l \mathbf{x}_l + \mathbf{B}_l \delta_e
$$
Using aerodynamic data from a fixed-wing UAV model (based on reference data), the system matrices become:
$$
\begin{bmatrix} \dot{u} \\ \dot{\alpha} \\ \dot{q} \\ \dot{\theta} \end{bmatrix} =
\begin{bmatrix} -0.1323 & 1.2719 & 0 & -9.754 \\ -0.03416 & -8.122 & 0.8748 & 0 \\ 0.06359 & -116.46 & -24.77 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}
\begin{bmatrix} u \\ \alpha \\ q \\ \theta \end{bmatrix} +
\begin{bmatrix} 0 \\ -1.763 \\ -127.4 \\ 0 \end{bmatrix} \delta_e
$$
The eigenvalues of \(\mathbf{A}_l\) are \(-16.4390 \pm 5.7786i\) and \(-0.0731 \pm 0.5641i\), indicating natural stability. For pitch control design, I focus on the short-period mode by neglecting the slow phugoid and speed variations. The reduced-order model retains only \(\alpha\) and \(q\):
$$
\begin{bmatrix} \dot{\alpha} \\ \dot{q} \end{bmatrix} =
\begin{bmatrix} -8.122 & 0.8748 \\ -116.46 & -24.77 \end{bmatrix}
\begin{bmatrix} \alpha \\ q \end{bmatrix} +
\begin{bmatrix} -1.763 \\ -127.4 \end{bmatrix} \delta_e
$$
Taking Laplace transforms, the transfer functions from elevator to angle of attack and pitch rate are:
$$
\frac{\alpha(s)}{\delta_e(s)} = \frac{-1.763s – 155.119}{s^2 + 32.892s + 303.061}, \quad
\frac{q(s)}{\delta_e(s)} = \frac{-127.4s – 829.4238}{s^2 + 32.892s + 303.061}
$$
To improve damping and ensure closed-loop stability, I introduce a pitch rate feedback loop. The actuator is modeled as a first-order lag \(10/(s+10)\). The inner-loop open-loop transfer function becomes:
$$
G_{\text{inner}}(s) = \frac{K_q (1274s + 8294)}{42.89s^2 + 632s + 3031}
$$
Using root locus analysis, I select the gain \(K_q = 0.203\) to achieve a damping ratio of 0.707. This yields the plant for the outer PID pitch controller.
PID Controller Design
A PID controller is used to regulate the pitch angle \(\theta\) to a desired setpoint. The controller transfer function is:
$$
G_{\text{PID}}(s) = K_p + \frac{K_i}{s} + K_d s
$$
where \(K_p\), \(K_i\), and \(K_d\) are the proportional, integral, and derivative gains. The goal is to minimize the error \(e(t) = \theta_{\text{ref}}(t) – \theta(t)\) with fast response, minimal overshoot, and zero steady-state error.
The classic Ziegler-Nichols (Z-N) tuning method provides an initial set of gains. For the plant under study, the Z-N rules yield:
$$
K_p = 0.833, \quad K_i = 0, \quad K_d = 0.2075
$$
However, the Z-N method often results in sluggish response or excessive overshoot. Therefore, I turn to genetic algorithm optimization for superior performance.
Genetic Algorithm Optimization of PID Gains
Genetic algorithms are stochastic search techniques inspired by natural evolution. I implement a GA that evolves a population of candidate PID gain sets over generations. Each chromosome encodes the three gains \(K_p, K_i, K_d\) into binary strings. The population size is set to 80, and the search ranges are:
| Parameter | Range | Bits |
|---|---|---|
| \(K_p\) | \([0, 8.192]\) | 13 |
| \(K_i\) | \([0, 4.096]\) | 12 |
| \(K_d\) | \([0, 4.096]\) | 12 |
The fitness function is designed to penalize both the integrated time-weighted absolute error (ITAE) and the maximum overshoot \(M_p\). The objective function is:
$$
f_{\text{obj}} = w_1 \int_{0}^{\infty} t |e(t)| dt + w_2 M_p
$$
where \(w_1 = 0.3\) and \(w_2 = 0.7\). The fitness value to be maximized is defined as:
$$
\text{Fitness} = \frac{1}{f_{\text{obj}}}
$$
The GA flow is:
- Initialize the first generation randomly.
- Evaluate fitness for each chromosome.
- Select the top 5 individuals (elitism) and pass them to the next generation.
- Use roulette wheel selection to choose parents for crossover with probability \(p_c = 0.8\).
- Perform single-point crossover on binary strings.
- Apply mutation with probability \(p_m = 0.1\).
- Repeat for 50 generations.
The evolution of the best fitness over generations is shown in the figure below (inserted at the end of this section).

After 50 generations, the optimal PID gains converge to:
$$
K_p = 7.309, \quad K_i = 0.01, \quad K_d = 1.002
$$
The fitness value reaches 86.6977, indicating a well-tuned controller.
Simulation Results and Discussion
I simulate the closed-loop pitch response to a unit step reference using both the Z-N tuned PID and the GA-optimized PID. The simulation time is 10 seconds. The transient performance metrics are summarized in the table below:
| Method | Rise Time \(t_r\) (s) | Settling Time \(t_s\) (s) | Peak Time \(t_p\) (s) | Overshoot \(M_p\) (%) |
|---|---|---|---|---|
| Z-N PID | 3.4236 | 4.0236 | 2.1551 | 0.0453 |
| GA-optimized PID | 0.8009 | 1.0448 | 0.6128 | 0.5878 |
As seen, the GA-optimized PID achieves a significantly faster rise time (0.8009 s vs. 3.4236 s) and settling time (1.0448 s vs. 4.0236 s) compared to the Z-N method. The overshoot is slightly increased (0.5878% vs. 0.0453%), but remains within acceptable bounds for most fixed-wing UAV applications. The step response curves (not shown here) demonstrate that the GA-tuned controller tracks the reference more aggressively while maintaining stability.
I also evaluate the integral performance indices for both controllers:
| Performance Index | Z-N PID | GA-optimized PID |
|---|---|---|
| IAE | 0.3281 | 0.1015 |
| ISE | 0.0542 | 0.0224 |
| ITAE | 0.7823 | 0.1451 |
The GA-optimized controller yields lower IAE, ISE, and ITAE values, confirming superior tracking accuracy and reduced error accumulation.
Conclusion
In this work, I have successfully designed a pitch controller for a fixed-wing UAV using a genetic algorithm to optimize the PID gains. Compared to the classical Ziegler-Nichols tuning, the GA-based approach provides substantially faster response and lower integral errors, with only a minor increase in overshoot. The methodology is robust and can be extended to other control loops of the fixed-wing UAV, such as altitude and speed hold. The results demonstrate that genetic algorithm optimization is an effective tool for PID controller design in fixed-wing UAV applications, ensuring high performance and adaptability.
Future work will involve real-time implementation and hardware-in-the-loop testing to validate the controller under practical flight conditions. Additionally, multi-objective optimization could be explored to further balance overshoot and response speed.
