Adaptive Fuzzy Attitude Control and Stability Analysis for Quadrotor UAVs

In recent years, quadrotor unmanned aerial vehicles (UAVs) have gained significant attention due to their versatility in applications such as surveillance, agriculture, and delivery services. The quadrotor’s ability to hover, take off vertically, and maneuver in tight spaces makes it ideal for complex tasks. However, the quadrotor is an underactuated, highly coupled system with nonlinear dynamics, posing challenges for stable attitude control. Environmental disturbances, model uncertainties, and actuator limitations can lead to instability, resulting in crashes or failed missions. Thus, developing robust control strategies is crucial for enhancing the quadrotor’s performance and reliability.

Traditional control methods, such as proportional-integral-derivative (PID) controllers, are widely used for quadrotor attitude control due to their simplicity and ease of implementation. However, PID controllers often struggle with nonlinearities and external disturbances, leading to overshoot, slow response times, and reduced stability. To address these issues, advanced techniques like adaptive control, neural networks, and fuzzy logic have been explored. Among these, fuzzy logic control (FLC) mimics human reasoning by converting expert knowledge into control rules, enabling adaptive behavior without precise model parameters. This paper proposes a cascaded fuzzy PID (F-PID) control scheme for quadrotor attitude stabilization, integrating a fuzzy controller into the inner loop of a cascaded PID structure to dynamically adjust gains based on real-time error and error rate.

The quadrotor’s dynamic model is derived using Newton-Euler equations, considering the vehicle as a rigid body with symmetric structure. The equations of motion account for translational and rotational dynamics, with Euler angles defining the orientation. The model is linearized around hover conditions to obtain transfer functions for each channel, facilitating controller design. Key parameters, such as mass and moments of inertia, are listed in Table 1. The cascaded F-PID controller uses a Mamdani-type fuzzy inference system with inputs of angular velocity error and error change rate, and outputs for PID gain adjustments. The fuzzy rule base is refined based on expert experience to improve performance, and simulations in MATLAB/Simulink compare the proposed method against traditional cascaded PID and standard F-PID controllers. Results demonstrate that the enhanced cascaded F-PID reduces overshoot and settling time significantly, while maintaining robustness against disturbances.

Mathematical Modeling of the Quadrotor

The quadrotor UAV consists of four rotors arranged in a square configuration, generating lift and control moments through variations in rotor speeds. Two common structures are the ‘+’型和 and ‘X’型 configurations; this work focuses on the ‘+’型, where the body frame axes align with the arms. The dynamic model is derived under assumptions: the quadrotor is a rigid body with coincident center of gravity and geometric center, and aerodynamic drag is negligible. The position in the inertial frame is denoted by $\mathbf{\rho} = [X, Y, Z]^T$, and the attitude by $\mathbf{\Omega} = [\phi, \theta, \psi]^T$, representing roll, pitch, and yaw angles, respectively.

The rotation matrix from the inertial frame to the body frame, for a Z-Y-X Euler angle sequence, is given by:

$$
\mathbf{R}_B^E = \begin{bmatrix}
\cos\psi \cos\theta & \sin\psi \cos\theta & -\sin\theta \\
\cos\psi \sin\theta \sin\phi – \sin\psi \cos\phi & \sin\psi \sin\theta \sin\phi + \cos\psi \cos\phi & \cos\theta \sin\phi \\
\cos\psi \sin\theta \cos\phi + \sin\psi \sin\phi & \sin\psi \sin\theta \cos\phi – \cos\psi \sin\phi & \cos\theta \cos\phi
\end{bmatrix}
$$

The translational dynamics in the inertial frame are:

$$
\begin{aligned}
\ddot{X} &= \frac{1}{m} \left( U_1 (\cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi) – k_x \dot{X} \right) \\
\ddot{Y} &= \frac{1}{m} \left( U_1 (\cos\phi \sin\theta \sin\psi – \sin\phi \cos\psi) – k_y \dot{Y} \right) \\
\ddot{Z} &= \frac{1}{m} \left( U_1 \cos\phi \cos\theta – mg – k_z \dot{Z} \right)
\end{aligned}
$$

where $m$ is the mass, $g$ is gravity, $k_x$, $k_y$, $k_z$ are drag coefficients, and $U_1$ is the total thrust. The rotational dynamics in the body frame are:

$$
\begin{aligned}
\ddot{\phi} &= \frac{1}{I_x} \left( (I_y – I_z) \dot{\theta} \dot{\psi} + J_r \dot{\theta} \Omega_r + U_2 – k_\phi \dot{\phi} \right) \\
\ddot{\theta} &= \frac{1}{I_y} \left( (I_z – I_x) \dot{\phi} \dot{\psi} – J_r \dot{\phi} \Omega_r + U_3 – k_\theta \dot{\theta} \right) \\
\ddot{\psi} &= \frac{1}{I_z} \left( (I_x – I_y) \dot{\phi} \dot{\theta} + U_4 – k_\psi \dot{\psi} \right)
\end{aligned}
$$

Here, $I_x$, $I_y$, $I_z$ are moments of inertia, $J_r$ is the rotor inertia, $\Omega_r$ is the residual rotor speed, and $U_2$, $U_3$, $U_4$ are control moments for roll, pitch, and yaw. The control inputs are related to rotor speeds $\omega_i$ by:

$$
\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 &= d (\omega_2^2 + \omega_4^2 – \omega_1^2 – \omega_3^2)
\end{aligned}
$$

where $b$ is the thrust coefficient, $l$ is the arm length, and $d$ is the drag coefficient. The motor dynamics are approximated as a first-order system:

$$
G_m(s) = \frac{k}{\tau s + 1}
$$

with gain $k$ and time constant $\tau$. Linearizing the model around hover conditions ($\phi \approx 0$, $\theta \approx 0$) yields decoupled transfer functions for each channel. For instance, the pitch angle transfer function is:

$$
G_\theta(s) = \frac{\theta(s)}{U_3(s)} = \frac{19.97}{s(s + 0.1)}
$$

Similar functions apply for roll and yaw. Table 1 summarizes the quadrotor parameters used in this study.

Table 1: Quadrotor Parameters
Parameter Value
Mass, $m$ (kg) 0.8
Arm Length, $l$ (m) 0.225
Moment of Inertia, $I_x$ (kg·m²) 0.01038
Moment of Inertia, $I_y$ (kg·m²) 0.01038
Moment of Inertia, $I_z$ (kg·m²) 0.01038
Thrust Coefficient, $b$ 3.13e-5
Drag Coefficient, $d$ 7.5e-7

The transfer functions for attitude channels are listed in Table 2, derived from the linearized model.

Table 2: Transfer Functions for Quadrotor Channels
Channel Transfer Function
Pitch Angle $\frac{19.97}{s(s + 0.1)}$
Roll Angle $\frac{19.97}{s(s + 0.1)}$
Yaw Angle $\frac{11.3}{s(s + 0.1)}$
Pitch Rate $\frac{19.97}{s + 0.1}$
Roll Rate $\frac{19.97}{s + 0.1}$
Yaw Rate $\frac{11.3}{s + 0.1}$

Controller Design

The cascaded fuzzy PID controller combines a traditional cascaded PID structure with a fuzzy logic system for adaptive gain tuning. The outer loop controls attitude angles (roll, pitch, yaw), while the inner loop manages angular rates. The fuzzy controller is embedded in the inner loop to dynamically adjust the PID gains based on the error $e$ (difference between desired and actual angular rate) and error change rate $ec$. This approach enhances the quadrotor’s response to nonlinearities and disturbances.

The fuzzy inference system uses Mamdani-type rules with two inputs and three outputs: adjustments for proportional gain $\Delta K_p$, integral gain $\Delta K_i$, and derivative gain $\Delta K_d$. The overall PID gains are computed as:

$$
\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 baseline gains. Inputs $e$ and $ec$ are fuzzified over the domain $[-3, 3]$ using seven linguistic variables: NB (Negative Big), NM (Negative Medium), NS (Negative Small), ZO (Zero), PS (Positive Small), PM (Positive Medium), PB (Positive Big). Outputs $\Delta K_p$, $\Delta K_i$, $\Delta K_d$ are defined on $[0, 6]$, $[-1, 1]$, and $[0, 6]$, respectively. Membership functions include zmf, smf, and trimf for varying resolution. For example, the membership function for $e$ is shown in Figure 1(a), while outputs use triangular functions for most sets.

The fuzzy rule base is designed based on expert knowledge to minimize overshoot and settling time. For instance, when $e$ is large, $\Delta K_p$ is set to PB to accelerate response, and $\Delta K_d$ is reduced to prevent overshoot. Conversely, for small $e$, $\Delta K_p$ is decreased to avoid oscillations. Traditional rules are refined to improve performance; Table 3 compares the original and modified rules for $\Delta K_p$.

Table 3: Fuzzy Rule Table for $\Delta K_p$ (Original vs. Modified)
$e$ $ec$
NB NM NS ZO PS PM PB
NB PB / PB PB / PB PM / PM PM / PM PS / PS ZO / PM ZO / PB
NM PB / PB PB / PB PM / PM PS / PM PS / PS ZO / PM NS / PB
NS PM / PB PM / PM PM / PM PS / PS ZO / PS NS / PS NS / PB
ZO PM / PM PM / PM PS / PS ZO / PS NS / PS NM / PM NM / PM
PS PS / PB PS / PM ZO / PS NS / PS NS / PS NM / PM NM / PM
PM PS / PB ZO / PM NS / PS NM / PM NM / PM NM / PB NB / PB
PB ZO / PB ZO / PS NM / PS NM / PM NM / PB NB / PB NB / PB

Similar tables apply for $\Delta K_i$ and $\Delta K_d$. The modified rules emphasize smoother transitions and reduced aggressiveness for medium errors, enhancing stability. Defuzzification uses the centroid method to compute crisp outputs.

Simulation and Results

The proposed controller is evaluated in MATLAB/Simulink for attitude stabilization of the quadrotor. The simulation model includes the derived transfer functions, with step and pulse inputs to test tracking and disturbance rejection. A manual switch toggles between reference signals, and step disturbances are injected to assess robustness. Performance is compared against traditional cascaded PID and standard cascaded F-PID controllers.

For a step input of 1 rad in roll and pitch, the response metrics are summarized in Table 4. The enhanced cascaded F-PID shows significant improvement: overshoot is reduced to 0.505%, compared to 5.851% for PID and 1.531% for standard F-PID. Settling time drops to 0.234 s, a 52.2% improvement over PID and 20.9% over standard F-PID. Rise time remains comparable, indicating no sacrifice in initial response.

Table 4: Performance Comparison for Step Input
Control Method Overshoot (%) Rise Time (s) Settling Time (s)
Cascaded PID 5.851 0.57 0.49
Cascaded F-PID 1.531 0.61 0.296
Enhanced Cascaded F-PID 0.505 0.63 0.234

Under pulse input with a period of 1 s, the enhanced controller maintains stability with minimal overshoot and no steady-state oscillation. Disturbance rejection tests involve applying a step disturbance during operation; the enhanced F-PID quickly suppresses the error, demonstrating superior robustness. For instance, with a disturbance at 1 s, the settling time is 0.174 s for pulse response, outperforming other methods.

Table 5: Performance Under Pulse Input with Disturbance
Control Method Overshoot (%) Rise Time (s) Settling Time (s)
Cascaded PID 12.712 0.079 0.303
Cascaded F-PID 3.571 0.073 0.217
Enhanced Cascaded F-PID 0.667 0.071 0.174

The fuzzy control surfaces for $\Delta K_p$ illustrate the refinement: the modified surface has smoother gradients, reducing abrupt changes in gain adjustments. This contributes to the improved stability of the quadrotor during aggressive maneuvers.

Conclusion

This paper presents an adaptive fuzzy PID control strategy for quadrotor UAV attitude stabilization. By integrating a fuzzy logic system into the inner loop of a cascaded PID controller, the approach dynamically adjusts gains based on real-time error metrics, enhancing responsiveness and robustness. The mathematical model of the quadrotor is linearized to derive transfer functions, and the fuzzy rule base is optimized through expert insight. Simulations confirm that the enhanced cascaded F-PID controller outperforms traditional methods in overshoot reduction, settling time, and disturbance rejection. For future work, incorporating additional factors such as aerodynamic effects and sensor noise could further refine the control system, ensuring reliable operation of quadrotors in diverse environments.

Scroll to Top