## 3 Overall Algorithm Design  
### Controller Design  
The Proportional-Integral-Derivative (PID) controller is a fundamental closed-loop feedback control mechanism prevalent in engineering systems. It generates a corrective output signal by computing a weighted sum of three distinct terms derived from the current error (\(e(t)\) = Setpoint (SP) \(-\) Process Variable (PV)): the Proportional term (responding to the present magnitude of the error), the Integral term (responding to the accumulation of past errors), and the Derivative term (responding to the predicted future trend of the error based on its rate of change). This composite control action aims to minimize the error over time, driving the system output towards the desired setpoint dynamically while ensuring stability, accuracy, and a responsive performance. Due to its robustness, straightforward structure, and adaptability across diverse applications, the PID controller remains one of the most widely implemented control strategies. The PID control equation is defined as follows:  
\[u\ =\ k_{p}e(t)\ k_{i}\int_{0}^{T}e(\xi)d\xi\ +\ k_{d}\frac{d}{dt}e(t) \tag{11}\]  
In classical PID control methods, the controller gain parameters are predetermined. Although these methods can achieve satisfactory control accuracy, they lack the ability to adapt to sudden changes. This limitation renders classical PID methods inadequate for quadrotor UAVs with nonlinear dynamics and require high-precision control requirements. The Linear Quadratic Regulator (LQR) necessitates linear or precisely linearizable system dynamics. However, UAV attitude dynamics--characterized by inherently strong nonlinearities such as aerodynamic coupling and rotor interference--defy accurate linearization. Linear approximations introduce model discrepancies that degrade the actual control performance. Model Predictive Control (MPC) requires online rolling optimization, where computational complexity grows exponentially with the prediction horizon length. Given the computational constraints of UAV embedded platforms, satisfying millisecond-level real-time control demands becomes infeasible. Backstepping control entails the recursive construction of Lyapunov functions and virtual control variables, resulting in protracted derivation processes. Moreover, strong cross-coupling among UAV degrees of freedom (e.g., roll-pitch interaction) significantly increases design complexity. Figure 6: H-shaped quadcopter skeleton. This paper proposes a parameter self-adjusting fuzzy adaptive PID algorithm that integrates fuzzy control with conventional PID control. During operation, the algorithm adaptively tunes the PID parameters to maintain the stable flight of quadrotor UAVs in the event of actuator failures. In the fuzzy adaptive PID framework, the first step involves establishing fuzzy relationships between the error (\(e\)), error rate (\(ec\)), and the PID parameters (\(k_{p}\), \(k_{i}\), and \(k_{d}\)) [28]. Through fuzzy inference, the incremental adjustments to the PID parameters (\(\Delta k_{p}\), \(\Delta k_{i}\), and \(\Delta k_{d}\)) are dynamically calculated based on real-time \(e\) and \(ec\) values. The parameter tuning of the fuzzy adaptive PID controller is then achieved using the following formulation:  
\[k_{\delta}={k^{\prime}}_{\delta}+\Delta k_{\delta} \tag{12}\]  
Here, \(\delta\ \in\ \{P_{i},\ I_{i},\ D_{i}\}\), where \({k^{\prime}}_{\delta}\) denotes the initial parameter values of the fuzzy adaptive PID controller, and \(\Delta k_{\delta}\) represents the real-time adjustments to \(k_{\delta}\). As depicted in Figure 7 of the quadrotor UAV control system, the tracking position error \(e\) and error rate \(ec\) are utilized as controller inputs. These inputs undergo three sequential stages:  
Fuzzification: Convert crisp inputs \(e\) and \(ec\) into fuzzy linguistic variables. Fuzzy Inference: Apply a predefined rule base to derive the adjustments \(\Delta k_{p}\), \(\Delta k_{i}\), and \(\Delta k_{d}\).