In the field of unmanned aerial vehicles, fixed-wing drones are increasingly favored for applications such as environmental monitoring, target recognition, and precise guidance due to their high flight speed, long endurance, and the ability to carry high-performance payloads. As operational requirements become more demanding, the limitations of classical linear Proportional-Integration-Differentiation (PID) controllers for attitude regulation have become a critical bottleneck. The inherent contradiction between rapid response and low overshoot in these linear controllers makes it difficult to meet the requirements for high-precision trajectory tracking and aggressive maneuvering of modern fixed-wing drones. Over the years, various advanced control methods have been explored, including fuzzy PID, dynamic inversion, backstepping, deep reinforcement learning, genetic algorithms, and model predictive control. While these methods can improve steady-state accuracy and robustness, they often suffer from design complexity, high computational load, and challenging parameter tuning processes, which create significant barriers for practical engineering deployment. Active Disturbance Rejection Control (ADRC) offers strong anti-interference capabilities but is sensitive to sensor noise and has limitations in parameter tuning for specific applications. This paper focuses on the core mechanism of the classical linear PID attitude controller for fixed-wing drones, analyzes the root cause of its inherent conflict between speed and overshoot, and proposes a targeted improvement. We design a nonlinear PID attitude control law based on a tracking differentiator (TD) and validate it through software-in-the-loop simulation using the open-source PX4 autopilot and Gazebo simulator. The enhanced controller is benchmarked against the classic cascade PID structure. Simulation results demonstrate that the proposed method effectively alleviates the speed-overshoot contradiction, significantly improves response speed, and drastically reduces overshoot.

Analysis of the Classical Linear PID Attitude Controller for Fixed-Wing Drones
The mainstream attitude control architecture for fixed-wing drones in engineering applications predominantly employs a cascade PID structure. This structure consists of an inner loop for angular rate control and an outer loop for attitude angle control. The inner loop calculates the desired control surface deflection based on the error between the desired angular rate and the actual angular rate measured by the gyroscopes. The outer loop generates the desired angular rate command for the inner loop based on the error between the target attitude angle (e.g., roll, pitch) and the actual attitude angle estimated by the attitude and heading reference system. This cascade architecture offers faster response and better disturbance rejection compared to a single-loop PID, making it a standard choice. The widely used open-source autopilot platform PX4 employs such a cascade PID framework for its fixed-wing attitude controller. The outer loop angle controller uses a proportional (P) controller, while the inner loop rate controller uses a PID controller. Despite its widespread adoption, the classical cascade PID controller for fixed-wing drones suffers from a fundamental design flaw: it operates on the principle of “controlling error based on large errors and small gains”.
To quantitatively demonstrate the limitations of this classical approach, we conducted a software-in-the-loop (SITL) simulation experiment using PX4 and Gazebo. The test involved a fixed-wing drone performing a roll step maneuver. The inner loop gains were kept at their default values, while the outer loop roll angle proportional gain (Kp) was adjusted. The desired roll angle was set to 40 degrees. The experimental results are summarized in the table below.
| Proportional Gain (Kp) | Roll Angle Transition | Rise Time (s) | Peak Overshoot (%) | Settling Time (s) |
|---|---|---|---|---|
| 1.0 | 0° to 40° | 4.17 | 12.8 | 17.41 |
| 1.0 | 40° to 0° | 4.09 | 13.8 | 15.74 |
| 2.5 | 0° to 40° | 2.40 | 7.3 | 11.04 |
| 2.5 | 40° to 0° | 2.34 | 8.1 | 10.41 |
As shown in the results, even when the proportional gain is increased from its minimum limit (1.0) to its maximum limit (2.5), the performance remains suboptimal. While the rise time decreases, the overshoot is still significant (over 7%), and the settling time remains excessively long (over 10 seconds). The underlying reason for this poor performance is the inherent logic of the classical controller. When a large step command (e.g., 0° to 40°) is applied, the initial error is large (approximately 40°). To prevent an excessively large control command that could saturate the actuators or cause structural damage, the proportional gain must be kept small. Conversely, when the actual roll angle approaches the desired value, the error becomes very small. Multiplied by the small gain, the resulting control command is too weak to drive the system efficiently to the steady state, leading to a long settling time. This “large error with small gain” logic fundamentally limits the achievable control bandwidth and precision of classic linear PID attitude controllers for fixed-wing drones.
Design of the Improved Nonlinear PID Attitude Controller
To overcome the fundamental defects of the classical linear PID controller, we propose a paradigm shift from “controlling error based on large errors and small gains” to “controlling error based on small errors and large gains”. This is achieved by introducing a Tracking Differentiator (TD) to arrange a transient profile for the desired attitude angle. The TD smooths out the abrupt step command, generating a physically achievable desired trajectory and its derivative. This ensures that the error between the desired and actual states remains small throughout the maneuver. Consequently, a much larger controller gain can be used, which acts as an error amplifier when the error is small, forcing the system to converge rapidly without inducing large overshoots or control saturation. The architecture of the proposed nonlinear PID attitude controller for fixed-wing drones is based on two tracking differentiators and a nonlinear combination of feedback errors.
The first tracking differentifier processes the desired attitude angle \( v \) to produce a smoothed desired angle \( v_1 \) and its derivative \( v_2 \). The discrete form of the tracking differentiator is given by:
$$ f = f_{han}(v_1 – v, v_2, r_0, h_0) $$
$$ v_1 = v_1 + h \cdot v_2 $$
$$ v_2 = v_2 + h \cdot f $$
where \( r_0 \) is the speed factor, \( h_0 \) is the filter factor, and \( h \) is the integration step size. Similarly, a second tracking differentiator processes the actual roll angle \( z \) to obtain a filtered roll angle \( z_1 \) and its derivative (roll rate) \( z_2 \). This provides a clean estimate of the angular rate, reducing the dependency on noisy gyroscope data for differentiation.
$$ f = f_{han}(z_1 – z, z_2, r_1, h_1) $$
$$ z_1 = z_1 + h \cdot z_2 $$
$$ z_2 = z_2 + h \cdot f $$
The function \( f_{han}(x_1, x_2, r, h) \) is the discrete-time optimal control synthesis function, which ensures a fast and smooth transition. The specific form of the \( f_{han} \) function used in our design is:
$$ d = r h $$
$$ d_0 = h d $$
$$ y = x_1 + h x_2 $$
$$ a_0 = \sqrt{d^2 + 8 r |y|} $$
$$ a = \begin{cases} x_2 + \frac{a_0 – d}{2} \text{sign}(y), & |y| > d_0 \\ x_2 + \frac{y}{h}, & |y| \le d_0 \end{cases} $$
$$ f_{han} = -\begin{cases} r \text{ sign}(a), & |a| > d \\ r \frac{a}{d}, & |a| \le d \end{cases} $$
The control law of the proposed nonlinear PID controller is formulated as a weighted sum of the proportional, integral, and derivative terms of the tracking errors:
$$ u = \beta_0 e_0 + \beta_1 e_1 + \beta_2 e_2 $$
where \( u \) is the controller output (desired angular rate command for the inner loop), and \( \beta_0, \beta_1, \beta_2 \) are the integral, proportional, and derivative gains, respectively. The errors are defined as:
$$ e_1 = v_1 – z_1 $$
$$ e_2 = v_2 – z_2 $$
$$ e_0 = \int_0^t e_1(\tau) d\tau $$
In this configuration, the smooth desired trajectory \( v_1 \) from the TD ensures that the initial tracking error \( e_1 \) is small. Therefore, a large proportional gain \( \beta_1 \) can be used to achieve a fast response without causing a large initial control command. As the actual angle \( z_1 \) gets close to the target \( v_1 \), the large gain continues to amplify the small error, effectively driving the system to converge quickly. The derivative term \( e_2 \) provides damping, allowing for aggressive gains while maintaining stability and minimizing overshoot. This design fully utilizes the “small error with large gain” philosophy.
Simulation Results and Comparative Analysis
We implemented the proposed nonlinear PID attitude controller in the PX4 autopilot code and conducted SITL simulations using Gazebo. The parameters for the improved controller were set as follows: tracking differentiator speed factors \( r_0 = 100 \) and \( r_1 = 20000 \), filter factors \( h_0 = h_1 = 0.004s \), and control gains \( \beta_0 = 0.1 \), \( \beta_1 = 80 \), \( \beta_2 = 1 \). The same roll step maneuver from the classical PID test was performed. The results are presented in the table below, showcasing a dramatic improvement in the attitude control performance for fixed-wing drones.
| Roll Angle Transition | Rise Time (s) | Peak Value (°) | Overshoot (%) | Settling Time (s) |
|---|---|---|---|---|
| 0° to 40° | 1.43 | 40.28 | 0.7 | 1.39 |
| 40° to 0° | 1.43 | -0.17 | 0.4 | 1.40 |
A direct comparison between Table 1 and Table 2 reveals the outstanding performance enhancement achieved by the improved nonlinear PID controller. The rise time for the 0° to 40° maneuver was reduced from 4.17s (or 2.40s) to 1.43s, representing a 38% to 65% improvement in response speed. More importantly, the overshoot was almost entirely eliminated. The obsolete overshoot of 7% to 14% from the classical PID was reduced to a mere 0.7% or less, which is practically negligible for fixed-wing drone maneuvers. The settling time experienced a revolutionary improvement, plummeting from over 10-17 seconds to just about 1.4 seconds. This indicates that the improved nonlinear PID controller not only reacts faster but also stabilizes the fixed-wing drone at the target attitude almost instantly, providing superior precision and stability.
We also compared the control effort (actuator command) between the two controllers. The maximum control command output by the improved nonlinear PID was approximately 0.2, which is comparable to that of the classical linear PID controller. This confirms that the significant performance boost is not achieved by simply demanding more aggressive actuator movements. Instead, it is a result of the more intelligent and efficient control strategy enabled by the “small error with large gain” logic. The improved controller utilizes the control energy exactly when and where it is needed, ensuring both high speed and high precision without overburdening the actuators. This makes the proposed method highly practical for real-world fixed-wing drones where actuator dynamics and saturation limits are critical.
Conclusion
This paper addressed the inherent conflict between rapid response and low overshoot in classical linear PID attitude controllers for fixed-wing drones. By analyzing the underlying mechanism, we identified that the “large error with small gain” logic is the fundamental cause of this limitation. To overcome this, we designed an improved nonlinear PID attitude control law incorporating tracking differentiators to arrange a smooth transient process. This innovation shifts the control logic to a “small error with large gain” paradigm, effectively resolving the contradiction between speed and stability. Software-in-the-loop simulations using the open-source PX4 platform and Gazebo simulator were conducted to validate the performance of our proposed controller. Compared to the classic cascade PID controller, the improved nonlinear PID achieved a significant improvement in all key performance indicators: rise time was reduced by up to 65%, overshoot was virtually eliminated to less than 1%, and settling time was drastically shortened to approximately 1.4 seconds. These results demonstrate that the proposed control law provides a highly effective, straightforward, and practical solution for enhancing the attitude control quality of fixed-wing drones, making it highly valuable for engineering applications in the field of UAV flight control. The design is easy to implement in existing embedded systems and offers a compelling alternative to more complex nonlinear control methods.
