In recent years, quadcopter unmanned aerial vehicles (UAVs) have gained significant attention due to their high agility, vertical take-off and landing capabilities, hovering performance, and low cost, making them suitable for military operations and search-and-rescue missions. However, the quadcopter model is complex, exhibiting nonlinearity, strong coupling, and underactuation, which complicates controller design. Traditional PID control remains widely used, but it struggles with model uncertainties and low control precision. To address these issues, we propose a quantum-optimized fractional-order PID (FOPID) controller for quadcopter attitude control. By integrating fractional-order calculus into PID control, we expand the control range through additional integration and differentiation orders. Furthermore, we employ an improved quantum genetic algorithm (QGA) with a golden sine strategy to enhance parameter tuning efficiency, improving global exploration and local exploitation. Simulation results demonstrate that our approach outperforms conventional methods in response speed and control accuracy.
The quadcopter is modeled as a rigid body with uniform mass and symmetry. To describe its motion, we define a world coordinate system (XYZ) and a body coordinate system (xyz), where the x-axis aligns with the quadcopter’s head direction. Attitude changes are represented by Euler angles—roll ($\phi$), pitch ($\theta$), and yaw ($\psi$)—which describe rotations around the body axes relative to the world frame. The transformation between these frames is achieved through a rotation matrix $R$. Using Newton-Euler equations, the dynamics of the quadcopter can be derived as follows:
$$ \begin{bmatrix} F_x \\ F_y \\ F_z \end{bmatrix} = R \sum_{i=1}^{4} F_i \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} – m \begin{bmatrix} 0 \\ 0 \\ g \end{bmatrix} $$
where $F_i$ represents the thrust from each rotor, $m$ is the mass, and $g$ is gravitational acceleration. The angular accelerations are given by:
$$ \ddot{\phi} = \left[ (F_1 + F_4 – F_2 – F_3) l + \dot{\theta} \dot{\psi} (I_z – I_x) – K_z \dot{\phi} \right] / I_x $$
$$ \ddot{\theta} = \left[ (F_3 + F_4 – F_1 – F_2) l + \dot{\phi} \dot{\psi} (I_y – I_z) – K_z \dot{\theta} \right] / I_y $$
$$ \ddot{\psi} = \left[ (M_1 + M_3 – M_2 – M_4) + \dot{\theta} \dot{\phi} (I_x – I_y) – K_z \dot{\psi} \right] / I_z $$
Here, $l$ is the distance from the rotor to the center of mass, $I_x$, $I_y$, and $I_z$ are moments of inertia, $K_z$ is the air resistance coefficient, and $M_i$ denotes the moments generated by each rotor. The control inputs are defined as:
$$ \begin{bmatrix} U_1 \\ U_2 \\ U_3 \\ U_4 \end{bmatrix} = \begin{bmatrix} F_1 + F_2 + F_3 + F_4 \\ F_1 + F_4 – F_2 – F_3 \\ F_3 + F_4 – F_1 – F_2 \\ M_1 + M_3 – M_2 – M_4 \end{bmatrix} = \begin{bmatrix} K_F (\omega_1^2 + \omega_2^2 + \omega_3^2 + \omega_4^2) \\ K_F (\omega_1^2 + \omega_4^2 – \omega_2^2 – \omega_3^2) \\ K_F (\omega_3^2 + \omega_4^2 – \omega_1^2 – \omega_2^2) \\ K_M (\omega_2^2 + \omega_4^2 – \omega_1^2 – \omega_3^2) \end{bmatrix} $$
where $U_1$ is the total thrust, and $U_2$, $U_3$, and $U_4$ correspond to roll, pitch, and yaw control inputs, respectively. $K_F$ and $K_M$ are thrust and torque coefficients, and $\omega_i$ represents rotor speeds. Combining these equations, the full dynamics model is:
$$ \ddot{x} = (\cos \psi \sin \theta \cos \phi + \sin \psi \sin \phi) U_1 / m $$
$$ \ddot{y} = (\sin \psi \sin \theta \cos \phi – \cos \psi \sin \phi) U_1 / m $$
$$ \ddot{z} = (\cos \theta \cos \phi) U_1 / m – g $$
$$ \ddot{\phi} = \left[ l U_2 + \dot{\theta} \dot{\psi} (I_z – I_x) \right] / I_x $$
$$ \ddot{\theta} = \left[ l U_3 + \dot{\phi} \dot{\psi} (I_y – I_z) \right] / I_y $$
$$ \ddot{\psi} = \left[ U_4 + \dot{\theta} \dot{\phi} (I_x – I_y) \right] / I_z $$

The quadcopter control system employs a quantum-optimized FOPID strategy. In the presence of external disturbances, the controller aims to track desired values accurately. The improved QGA tunes the FOPID parameters, and virtual control inputs are transformed into actual inputs for attitude control. The FOPID controller extends traditional PID by incorporating fractional-order calculus, with the control law in the time domain expressed as:
$$ u(t) = K_p e(t) + K_i D_t^{-\lambda} e(t) + K_d D_t^{\mu} e(t) $$
where $e(t)$ is the system error, $D_t^{-\lambda}$ and $D_t^{\mu}$ are fractional integral and derivative operators, and $K_p$, $K_i$, $K_d$, $\lambda$, and $\mu$ are controller parameters. The FOPID structure allows for a broader control plane, enhancing dynamic performance and adaptability compared to integer-order PID.
For parameter optimization, we use an improved quantum genetic algorithm. QGA utilizes quantum bits (qubits) for encoding, representing solutions as superpositions of states. A qubit is defined as:
$$ | \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle $$
with $|\alpha|^2 + |\beta|^2 = 1$. The quantum chromosome for the $i$-th individual is:
$$ Q_i^t = \begin{bmatrix} \alpha_{i1} & \alpha_{i2} & \cdots & \alpha_{ij} \\ \beta_{i1} & \beta_{i2} & \cdots & \beta_{ij} \end{bmatrix} $$
Population evolution is achieved through quantum rotation gates:
$$ \begin{bmatrix} \alpha_i’ \\ \beta_i’ \end{bmatrix} = \begin{bmatrix} \cos \theta_i & -\sin \theta_i \\ \sin \theta_i & \cos \theta_i \end{bmatrix} \begin{bmatrix} \alpha_i \\ \beta_i \end{bmatrix} $$
where $\theta_i$ is the rotation angle. To prevent local optima and accelerate convergence, we integrate a golden sine strategy. The position update is:
$$ X_i^{t+1} = X_i^t \left| \sin(R_1) \right| + R_2 \sin(R_1) \left| x_1 P_i^t – x_2 X_i^t \right| $$
where $R_1$ and $R_2$ are random numbers, and $x_1$, $x_2$ are golden ratio coefficients. The pseudocode for the improved QGA is as follows:
Input: Objective function $f(x_t)$, $x_t = [x_1, \ldots, x_i]^T$
Initialize parameters: $a$, $b$, $\text{dim}$, $\text{ub}$, $\text{lb}$, $\text{MAXGEN}$, $\text{size\_pop}$, $\text{lenchrom}$
Output: $x_{\text{best}}$, $f_{\text{best}}$
Initialize population and encode using qubits. Compute fitness and record the best individual.
while ($t < t_{\text{max}}$) or (stopping criterion not met):
Update population via quantum rotation gates.
Compute fitness and update the best individual.
Apply golden sine strategy for position updates.
if $f(x_t) < f_{\text{best}}$: $f_{\text{best}} = f(x_t)$, $x_{\text{best}} = x’$
The FOPID parameters are tuned by minimizing the integral of time-weighted absolute error (ITAE) as the performance index. This ensures fast response with minimal overshoot. The optimization process involves encoding controller parameters as quantum genes, evaluating fitness, and iteratively refining solutions.
To validate the proposed controller, we conducted simulations in MATLAB/Simulink. The quadcopter parameters are listed in Table 1.
| Parameter | Value | Parameter | Value |
|---|---|---|---|
| Mass (kg) | 1.5 | $I_x$ (10³ kg·m²) | 17.37 |
| Arm length (m) | 0.225 | $I_y$ (10³ kg·m²) | 17.37 |
| Time constant (s) | 0.01 | $I_z$ (10³ kg·m²) | 31.75 |
| $g$ (m/s²) | 9.8 | – | – |
We compared PID, fuzzy PID, and quantum-optimized FOPID controllers. The population size was set to 40, with a maximum of 20 iterations. Input signals included step, triangular, and square waves to simulate various scenarios. The convergence curves of particle swarm optimization (PSO), standard QGA, golden sine QGA, and golden cosine QGA are shown in Figure 4, indicating that golden sine QGA achieves faster convergence and avoids local optima. The optimized FOPID parameters are listed in Table 2.
| Control Algorithm | $K_p$ | $K_i$ | $K_d$ | $\lambda$ | $\mu$ |
|---|---|---|---|---|---|
| PID | 20 | 0.1 | 10 | 1 | 1 |
| Fuzzy PID | 20 | 0.1 | 10 | 1 | 1 |
| FOPID | 1.339 | 0.166 | 50 | 1.5 | 1 |
For step response tests, the desired attitude was set to 4 rad, with a disturbance applied at 2 s. The FOPID controller demonstrated rapid recovery and superior disturbance rejection. Triangular wave tests simulated rapid attitude changes, where FOPID achieved minimal overshoot and accurate tracking. Square wave tests evaluated performance under abrupt changes, showing that FOPID provided the best tracking with minimal adjustment time. The performance metrics are summarized in Table 3.
| Controller | Step Recovery Time (s) | Triangular Wave Overshoot (%) | Square Wave Tracking Time (s) – Segment I | Square Wave Tracking Time (s) – Segment II |
|---|---|---|---|---|
| PID | 1.344 | 8.33 | 1.765 | 1.857 |
| Fuzzy PID | 1.058 | 11.67 | 1.287 | 1.525 |
| FOPID | 0.136 | 0.134 | 0.153 | 0.162 |
The results confirm that the quantum-optimized FOPID controller enhances quadcopter attitude control by improving response speed and precision. The integration of fractional-order calculus and advanced optimization algorithms effectively addresses model uncertainties and external disturbances.
In conclusion, we have developed a quantum-optimized fractional-order PID controller for quadcopter attitude control. By leveraging fractional-order theory and an improved quantum genetic algorithm with golden sine strategy, we achieved efficient parameter tuning and robust performance. Simulations under various conditions demonstrate that our approach outperforms traditional PID and fuzzy PID in terms of response speed, control accuracy, and disturbance rejection. This method provides a promising solution for enhancing quadcopter autonomy and reliability in complex environments.
