In the pursuit of achieving more stable flight attitudes for unmanned aerial vehicles during operation, this work focuses on the optimization of attitude control algorithms for the quadrotor drone. Based on an analysis of conventional control methodologies, a cascade Fuzzy PID self-tuning control algorithm is designed and implemented. The research begins with the development of a nonlinear mathematical model for the quadrotor drone. This model is subsequently linearized, and the transfer functions for each control channel are decoupled. A fuzzy logic controller is then designed, where its rule base is refined and improved based on expert knowledge and empirical data. This designed fuzzy controller is integrated in parallel within the angular velocity inner loop of a cascade PID controller. Finally, a comparative simulation analysis between the traditional cascade PID controller and the proposed cascade Fuzzy PID controller is conducted using the Matlab/Simulink toolkit. To investigate the disturbance rejection capability of the proposed controller, interference signals are introduced during the simulation. The simulation results demonstrate that the improved cascade Fuzzy PID controller reduces the response time by 52.2% and 20.9% compared to the traditional cascade PID and a conventional fuzzy-rule-based cascade Fuzzy PID, respectively. The overshoot is reduced by 91.4% and 73.8%, respectively. These results indicate that the cascade Fuzzy PID controller significantly enhances the dynamic performance of the quadrotor drone, thereby better meeting the stringent stability requirements for mission execution.
Rotor-based unmanned aerial vehicles, particularly the quadrotor drone, have become increasingly prevalent in daily life due to their compact size, rapid response, and high maneuverability. Their applications span numerous fields such as industry, agriculture, and military operations. Across all these domains, maintaining attitude stability is a critical and fundamental requirement. The quadrotor drone is inherently a multi-variable, under-actuated, and strongly coupled system. It possesses multiple interactive variables and is highly sensitive to environmental changes. Therefore, precise control over its attitude stability is paramount. Numerous modern control theories have been applied to the attitude control of quadrotor drones, including neural network PID algorithms and cascade Linear Active Disturbance Rejection Controllers (LADRC) composed of a Linear Tracking Differentiator (LTD), a Linear Extended State Observer (LESO), and a linear error feedback control law. While effective, many of these methods involve significant complexity, requiring extensive floating-point and matrix operations, which impose higher demands on the processing unit. Given that the drone system is already under-actuated, these complex methods can further complicate the system. Other approaches, such as adaptive backstepping control and algorithms combining integral sliding mode and backstepping sliding mode controllers within a dual-loop structure, have also shown good performance. However, these methods typically require accurate model parameters, which are difficult to obtain precisely in a quadrotor drone system. There often exists an inverse relationship between model complexity and practical control accuracy in drone applications; overly complex models can lead to reduced real-world precision. To further enhance the attitude stability of the quadrotor drone during flight, this work optimizes the traditional cascade PID control algorithm by designing a cascade Fuzzy PID control method. The fuzzy controller is placed directly in the attitude inner loop to control the drone, aiming to improve both attitude stability and disturbance rejection. Furthermore, the fuzzy rule base of the controller is corrected and refined. The performance of this optimized control method is validated through simulation software and compared with the traditional cascade PID method, confirming its superior control capabilities and contributing to stable flight operation while mitigating the risk of collisions and crashes due to attitude instability.
Mathematical Model Development
The first step in controller design is establishing a accurate yet tractable mathematical model for the quadrotor drone. The following standard assumptions are made to simplify the model:
- The quadrotor drone is a rigid body symmetrical about its axes.
- The center of gravity coincides with the geometric center of the drone’s body.
- Aerodynamic drag forces are neglected, and gravity is considered constant during flight.
The motion of the drone can be decomposed into translational and rotational movements. Its position in space is defined by the vector $\rho = [X, Y, Z]^T$, and its attitude by the Euler angles $\Omega = [\phi, \theta, \psi]^T$, representing roll, pitch, and yaw respectively.
Two primary coordinate systems are defined: the Earth-fixed inertial frame $E$ and the body-fixed frame $B$. The transformation from the Earth frame to the body frame is described by a rotation matrix $R_E^B$, which depends on the order of rotations. Using the common Z-Y-X (yaw-pitch-roll) rotation sequence, the direction cosine matrix is:
$$
R_E^B = \begin{pmatrix}
\cos\psi \cos\theta & \sin\psi \cos\theta & -\sin\theta \\
\sin\phi \sin\theta \cos\psi – \cos\phi \sin\psi & \sin\phi \sin\theta \sin\psi + \cos\phi \cos\psi & \cos\theta \sin\phi \\
\cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi & \cos\phi \sin\theta \sin\psi – \sin\phi \cos\psi & \cos\theta \cos\phi
\end{pmatrix}
$$
The translational equations of motion in the Earth frame and the rotational equations in the body frame are derived using Newton-Euler formalism. The combined nonlinear dynamic model of the quadrotor drone is given by:
$$
\begin{cases}
\ddot{x} = (\cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi)\frac{U_1}{m} \\
\ddot{y} = (\cos\phi \sin\theta \sin\psi – \sin\phi \cos\psi)\frac{U_1}{m} \\
\ddot{z} = (\cos\theta \cos\phi)\frac{U_1}{m} – g \\
\ddot{\phi} = \frac{(I_y – I_z)\dot{\theta}\dot{\psi} + I_b \dot{\theta}\Omega_r + U_2 – k_{\phi}\dot{\phi}}{I_x} \\
\ddot{\theta} = \frac{(I_z – I_x)\dot{\phi}\dot{\psi} – I_b \dot{\phi}\Omega_r + U_3 – k_{\theta}\dot{\theta}}{I_y} \\
\ddot{\psi} = \frac{(I_x – I_y)\dot{\phi}\dot{\theta} + U_4 – k_{\psi}\dot{\psi}}{I_z}
\end{cases}
$$
where $U_1, U_2, U_3, U_4$ are the control inputs for vertical thrust, roll moment, pitch moment, and yaw moment, respectively. Their expressions in terms of individual motor angular speeds $\omega_i$ are:
$$
\begin{aligned}
U_1 &= b(\omega_1^2 + \omega_2^2 + \omega_3^2 + \omega_4^2) \\
U_2 &= b l (\omega_4^2 – \omega_2^2) \\
U_3 &= b l (\omega_3^2 – \omega_1^2) \\
U_4 &= k_d (\omega_2^2 + \omega_4^2 – \omega_1^2 – \omega_3^2)
\end{aligned}
$$
Here, $m$ is the mass, $g$ is gravity, $I_x, I_y, I_z$ are moments of inertia, $l$ is the arm length, $b$ is the thrust coefficient, $k_d$ is the drag coefficient, and $k_{\phi}, k_{\theta}, k_{\psi}$ are aerodynamic damping coefficients.
The quadrotor drone is typically driven by Brushless DC (BLDC) motors. For control design, the motor dynamics can be simplified. The electrical equation is $u = L\frac{di}{dt} + Ri + k_e \omega_m$, where $u$ is terminal voltage, $i$ is current, and $\omega_m$ is rotor speed. The mechanical equation is $J\frac{d\omega_m}{dt} = \tau_m – \tau_d$, where $\tau_m = k_m i$ is the motor torque. For small motors with low inductance, the dynamics can be approximated by a first-order transfer function:
$$
G_m(s) = \frac{\omega_m(s)}{u(s)} = \frac{k}{\tau s + 1}
$$
where $k$ is the open-loop gain and $\tau$ is the time constant.

The quadrotor drone model presented above is nonlinear and coupled. For initial controller design and simulation, it is linearized around a hover condition (small angles). Assuming $\phi, \theta \approx 0$, we have $\cos\phi \approx 1, \cos\theta \approx 1, \sin\phi \approx \phi, \sin\theta \approx \theta$. After linearization and decoupling, the transfer function matrix relating the attitude angles to the control inputs and incorporating the motor dynamics can be derived. The combined transfer function for the attitude channels is:
$$
G(s) = G_1(s)G_m(s) = \begin{pmatrix}
\frac{k}{m s (\tau s + 1)} & 0 & 0 & 0 \\
0 & \frac{k l}{I_x s (\tau s + 1)} & 0 & 0 \\
0 & 0 & \frac{k l}{I_y s (\tau s + 1)} & 0 \\
0 & 0 & 0 & \frac{k l}{I_z s (\tau s + 1)}
\end{pmatrix}
$$
Using parameters from a representative quadrotor drone, the specific transfer functions for each channel are calculated and summarized in the table below.
| Parameter | Symbol | Value |
|---|---|---|
| Mass | $m$ | 0.8 kg |
| Arm Length | $l$ | 0.225 m |
| Moment of Inertia (X) | $I_x$ | 0.01038 kg·m² |
| Moment of Inertia (Y) | $I_y$ | 0.01038 kg·m² |
| Moment of Inertia (Z) | $I_z$ | 0.01038 kg·m² |
| Motor Gain | $k$ | Assumed for calculation |
| Motor Time Constant | $\tau$ | 0.1 s |
| Channel (Angle) | Transfer Function $G(s)$ |
|---|---|
| Roll Angle ($\phi$) | $\dfrac{19.97}{s(0.1s + 1)}$ |
| Pitch Angle ($\theta$) | $\dfrac{19.97}{s(0.1s + 1)}$ |
| Yaw Angle ($\psi$) | $\dfrac{11.3}{s(0.1s + 1)}$ |
The corresponding angular rate channels (e.g., $\dot{\phi}$) simply have an additional $s$ in the numerator (e.g., $\frac{19.97s}{s(0.1s+1)} = \frac{19.97}{0.1s+1}$).
Cascade Fuzzy PID Controller Design
The core of this work is the design of an adaptive cascade Fuzzy PID controller for the quadrotor drone attitude loop. Fuzzy logic control mimics human reasoning by converting linguistic control strategies based on expert experience into an automatic control action. A typical Mamdani-type fuzzy controller operates by fuzzifying crisp inputs (like error and error rate), processing them through a rule base using fuzzy inference, and finally defuzzifying the result to a crisp output value.
The proposed control structure combines the robustness of cascade PID with the adaptability of fuzzy logic. The cascade control architecture features an outer loop for angle control (position) and an inner loop for angular rate control (attitude). This structure helps in rejecting disturbances that affect the inner loop more quickly. The innovation lies in integrating a fuzzy tuner in parallel with the inner-loop PID controller. The fuzzy controller’s inputs are the angular rate error $e$ and its derivative $ec$. Its outputs are the real-time adjustments $\Delta K_p$, $\Delta K_i$, $\Delta K_d$ to the base PID gains of the inner loop. The adjusted gains are:
$$
\begin{aligned}
K_p &= K_p^* + \Delta K_p \\
K_i &= K_i^* + \Delta K_i \\
K_d &= K_d^* + \Delta K_d
\end{aligned}
$$
where $K_p^*, K_i^*, K_d^*$ are the pre-tuned base values.
The design of the fuzzy tuner involves several steps. First, the input and output variables are mapped to their respective universes of discourse. For the quadrotor drone‘s angular rate loop, the error and error change are typically small, leading to the selection: $e, ec \in [-3, 3]$. The output universes are chosen as $\Delta K_p, \Delta K_d \in [0, 6]$ and $\Delta K_i \in [-1, 1]$. Each universe is partitioned into seven fuzzy sets: Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (ZO), Positive Small (PS), Positive Medium (PM), and Positive Big (PB). Triangular membership functions (trimf) are primarily used for their simplicity and good performance, except for the extreme sets where zmf and smf functions are employed to provide smoother transitions at the boundaries.
The most critical component is the fuzzy rule base. It encapsulates the knowledge of how to adjust the PID parameters based on the system’s state ($e$ and $ec$). The general tuning principles are:
- When $|e|$ is large, a large $K_p$ is needed for fast response, and a small $K_d$ is desired to prevent excessive overshoot. $K_i$ should be small or zero to avoid integral windup.
- When $|e|$ is medium, $K_p$ should be moderated to reduce overshoot while maintaining good response. $K_d$ becomes more significant for damping.
- When $|e|$ is small, a small $K_p$ is used to avoid oscillations near the setpoint. $K_i$ should be increased to eliminate steady-state error.
Based on these principles and through iterative simulation analysis, a refined fuzzy rule table was developed, offering significant improvement over a conventional fuzzy rule set. The improvement focuses on providing more aggressive and appropriate gain adjustments during transients while ensuring smooth steady-state behavior for the quadrotor drone.
| $e$ \ $ec$ | NB | NM | NS | ZO | PS | PM | PB |
|---|---|---|---|---|---|---|---|
| NB | PB/NB/PS | PB/NB/PS | PB/NB/ZO | PM/NM/NB | PB/NS/NB | PB/ZO/NM | PB/ZO/PS |
| NM | PB/NB/PS | PB/NB/NS | PM/NM/NB | PM/NS/NM | PM/NS/NM | PM/ZO/NS | PS/ZO/ZO |
| NS | PM/NB/ZO | PM/NM/NS | PM/NS/NM | PS/NS/NM | PS/ZO/NS | PS/PS/NS | PS/PS/ZO |
| ZO | PM/NM/ZO | PM/NM/NS | PS/NS/NS | ZO/ZO/NS | PS/PS/NS | PM/PM/NS | PM/PM/ZO |
| PS | PS/NM/ZO | PS/NS/ZO | ZO/ZO/ZO | PS/PS/ZO | PS/PS/ZO | PM/PM/ZO | PM/PB/ZO |
| PM | PM/ZO/PB | PM/ZO/PS | PS/PS/PS | PS/PS/PS | PM/PM/PS | PM/PB/PS | PB/PB/PS |
| PB | PB/ZO/PB | PB/ZO/PM | PB/PS/PM | PM/PM/PM | PM/PM/PM | PB/PB/PS | PB/PB/PB |
The refinement, particularly in regions of large error, results in a control surface for $K_p$ that is more responsive compared to the traditional one, enabling the quadrotor drone to react more swiftly to disturbances and setpoint changes.
Simulation Results and Stability Analysis
To validate the performance of the proposed cascade Fuzzy PID controller, comprehensive simulations were conducted in the Simulink environment. The simulation model was built according to the block diagram described earlier, incorporating the linearized plant models from Table 2. Three controllers were compared for the roll/pitch channels: 1) Traditional Cascade PID, 2) Cascade Fuzzy PID with a conventional rule base, and 3) Cascade Fuzzy PID with the refined rule base (proposed method). The yaw channel simulation follows a similar process with its specific transfer function.
The system’s response to a step input was first evaluated. This test reveals key dynamic performance metrics: rise time, settling time, overshoot, and steady-state error. The results for the roll/pitch angle are graphically compared, and the quantitative metrics are extracted and summarized below.
| Control Method | Overshoot (%) | Rise Time (s) | Settling Time (s) |
|---|---|---|---|
| Cascade PID | 5.85 | 0.57 | 0.490 |
| Cascade Fuzzy PID (Conventional Rules) | 1.53 | 0.61 | 0.296 |
| Cascade Fuzzy PID (Refined Rules – Proposed) | 0.51 | 0.63 | 0.234 |
The data clearly demonstrates the superiority of the proposed method. While the rise time is slightly longer due to a less aggressive initial proportional action to curb overshoot, the settling time is drastically reduced. The proposed controller settles 52.2% faster than the traditional PID and 20.9% faster than the conventional fuzzy PID. Most impressively, the overshoot is nearly eliminated, being reduced by 91.4% and 73.8% compared to the two benchmark controllers, respectively. This indicates a significant enhancement in damping and stability for the quadrotor drone attitude loop.
To test the tracking capability for varying commands, a pulse input signal was applied. The response over one pulse period was analyzed. The proposed controller again showed minimal overshoot and rapid settling without oscillatory behavior after reaching the new setpoint, confirming its robustness across different input types.
| Control Method | Overshoot (%) | Rise Time (s) | Settling Time (s) |
|---|---|---|---|
| Cascade PID | 12.71 | 0.079 | 0.303 |
| Cascade Fuzzy PID (Conventional Rules) | 3.57 | 0.073 | 0.217 |
| Cascade Fuzzy PID (Refined Rules – Proposed) | 0.67 | 0.071 | 0.174 |
Finally, the critical aspect of disturbance rejection was evaluated. A step disturbance signal was injected into the attitude loop during both step-response and pulse-response simulations. The results showed that the proposed cascade Fuzzy PID controller could quickly suppress the disturbance effect. The recovery was swift, and the system returned to its steady state with negligible residual oscillation. This demonstrates that the adaptive gain tuning provided by the fuzzy logic effectively increases the controller’s bandwidth and robustness against external perturbations, a vital feature for a quadrotor drone operating in real-world, unpredictable environments.
Conclusion
This work addressed the challenge of achieving high-precision and stable attitude control for a quadrotor drone. By leveraging the strengths of cascade control and fuzzy logic adaptation, a novel cascade Fuzzy PID controller was designed and implemented. A detailed nonlinear mathematical model of the quadrotor drone was established, linearized, and decoupled to form the basis for control design. The core innovation involved the integration of a fuzzy gain scheduler into the angular rate inner loop of a cascade PID structure. Furthermore, the fuzzy rule base was systematically refined based on established tuning principles and iterative analysis to optimize performance specifically for the quadrotor drone dynamics.
Extensive simulations conducted in Matlab/Simulink provided compelling evidence of the controller’s efficacy. In comparison to a traditional cascade PID controller and a cascade Fuzzy PID with conventional rules, the proposed controller with refined rules exhibited dramatically improved performance. Key metrics such as settling time and percent overshoot were significantly reduced. The controller also demonstrated excellent command tracking for different input profiles and strong disturbance rejection capabilities. These attributes collectively enhance the dynamic performance and operational stability of the quadrotor drone, making it more reliable for executing complex tasks in various application domains.
It is acknowledged that the modeling phase involved several simplifying assumptions. Future research directions include incorporating more detailed aerodynamic effects, parameter uncertainties, and actuator dynamics into the model to further improve the controller’s robustness and applicability. Experimental validation on a physical quadrotor drone platform is the essential next step to transition this promising simulation-based work into practical, real-world deployment.
