In this work, we address the path following control problem for a medium-sized fixed-wing UAV operating under wind disturbances. To enhance the tracking accuracy and robustness, we propose an improved lateral guidance algorithm based on the vector field method. This algorithm uses only the cross-track error as the single factor influencing the course angle command, replacing the conventional PID-based lateral guidance law. We integrate this vector field guidance with a PID longitudinal controller. Through numerical simulations and hardware-in-the-loop experiments, we demonstrate that the proposed algorithm significantly improves path following performance and wind disturbance rejection capability.
Problem Formulation and Mathematical Model
We consider the dynamics of a fixed-wing UAV with lateral and longitudinal autopilot loops. The simplified closed-loop transfer functions assume unity gain for the stability augmentation and attitude loops. The lateral motion control loop is shown in Figure 1 (conceptual), and the longitudinal loop follows a similar structure. The kinematic equations for the fixed-wing UAV are:
$$
\ddot{\chi} = \frac{g k_{P\chi}}{\| \mathbf{V}_g \|} (\dot{\chi}_c – \dot{\chi}) + \frac{g k_{I\chi}}{\| \mathbf{V}_g \|} (\chi_c – \chi) = a_{\dot{\chi}} (\dot{\chi}_c – \dot{\chi}) + a_{\chi} (\chi_c – \chi)
$$
$$
\ddot{h} = \| \mathbf{V}_a \| k_{Ph} (\dot{h}_c – \dot{h}) + \| \mathbf{V}_a \| k_{Ih} (h_c – h) = a_{\dot{h}} (\dot{h}_c – \dot{h}) + a_h (h_c – h)
$$
where \(\chi\) is the course angle, \(h\) is the altitude, \(\mathbf{V}_g\) and \(\mathbf{V}_a\) represent ground speed and airspeed vectors, and \(\chi_c\) and \(h_c\) are the commanded course angle and altitude. The roll and pitch angle commands are given by:
$$
\phi_c = k_{P\chi} (\chi_c – \chi) + \frac{k_{I\chi}}{s} (\chi_c – \chi)
$$
$$
\theta_c = k_{Ph} (h_c – h) + \frac{k_{Ih}}{s} (h_c – h)
$$
We define path following as the task of reducing the cross-track error to zero. For a straight line segment, the cross-track error \(e_{Py}\) is computed from the UAV’s position relative to the desired path. For a circular arc, the radial error is \(d – \rho\), where \(d\) is the distance from the UAV to the arc center and \(\rho\) is the arc radius. The relationship between ground speed, wind speed, and airspeed is shown conceptually in the wind triangle.

Comparison of Guidance Approaches
We compare the conventional PID-based lateral guidance and the proposed vector field method. The PID lateral guidance law computes the roll command as:
$$
\phi_c = k_{\chi P} \| \mathbf{V}_g \| \Delta\chi – k_{DP} D – k_{DI} \int D \, dt
$$
where \(\Delta\chi\) is the heading error and \(D\) is the cross-track error (lateral deviation). In contrast, the vector field method generates a course angle command \(\chi_c\) directly as a function of the cross-track error \(e_{Py}\) (for straight lines) or the radial error (for arcs). The key advantage is that the vector field relies solely on the lateral offset, making it less sensitive to wind-induced heading errors.
Straight-Line Path Following with Vector Field
For a straight-line path, the desired course angle is defined by:
$$
\chi_c(e_{Py}) = -\arctan(k_m e_{Py}) + \chi_q
$$
where \(\chi_q\) is the path direction and \(k_m\) is a constant gain. When the UAV is far from the path, \(\chi_c\) approaches \(\chi_q \pm \pi/2\), directing the UAV perpendicularly toward the line. As \(e_{Py} \to 0\), \(\chi_c \to \chi_q\). To avoid large heading jumps, we enforce \(|\chi_c – \chi| < \pi\) by adjusting \(\chi_q\) appropriately.
Circular Arc Path Following with Vector Field
For a circular arc with radius \(\rho\), the desired course angle is:
$$
\chi_c(d,\rho,\lambda) = \lambda \arctan\left( k_n \frac{\|d\| – \rho}{\rho} \right) + \chi_o
$$
where \(\lambda = 1\) for clockwise motion and \(\lambda = -1\) for counterclockwise, \(\chi_o = \phi + \lambda \pi/2\) is the tangent direction at the current angular position \(\phi\), and \(k_n\) is a constant gain. The term \(\phi\) is computed from the UAV’s coordinates relative to the arc center, and we prevent \(2\pi\) jumps in the commanded course angle by shifting \(\phi\) with appropriate multiples of \(2\pi\).
Numerical Simulation Results
We conducted three sets of digital simulations to compare the PID and vector field algorithms under wind disturbances. The fixed-wing UAV model parameters are: \(a_{\chi} = 0.732\), \(a_{\dot{\chi}} = 5.968\). PID gains: \(k_{\chi P} = 0.105\), \(k_{DP} = 1.815\), \(k_{DI} = 0.006\). Vector field gains: \(k_m = 0.05\), \(k_n = 8\). The roll angle command is limited to \(\pm 35^\circ\) with a rate limit of \(\pm 35^\circ/s\). The wind speed is 6 m/s from 315°.
Test 1: Short-Distance Straight-Line Path
Initial cross-track error = 100 m, path: \(y=0\). Table 1 summarizes the results.
| Metric | PID Algorithm | Vector Field Algorithm |
|---|---|---|
| Settling time (s) | 54 | 30 |
| Steady-state error (m) | 2.1 | 2.1 |
| Course angle fluctuation | Significant | Minimal |
The vector field method converged faster and exhibited smoother roll activity. The course angle remained stable after convergence, while the PID method showed continuous oscillations.
Test 2: Long-Distance Straight-Line Path
Initial cross-track error = 400 m, same path. Results are in Table 2.
| Metric | PID Algorithm | Vector Field Algorithm |
|---|---|---|
| Settling time (s) | 77 | 46 |
| Steady-state error (m) | 5.5 | 3.5 |
The advantage of the vector field approach is even more pronounced for larger initial offsets: the UAV corrects its trajectory with a shorter adjustment distance and less overshoot.
Test 3: Circular Arc Path
The desired path consists of two semicircles of radius 200 m. The UAV starts at (0,200). Table 3 compares performance.
| Metric | PID Algorithm | Vector Field Algorithm |
|---|---|---|
| Completion time (s) | 81 | 74 |
| Max radial error (m) | ~15 | ~8 |
| Oscillations in second half | Large | Minimal |
Both algorithms performed similarly in the first arc, but the PID controller exhibited significant overshoot and oscillations in the second arc, whereas the vector field method maintained smooth tracking.
Hardware-in-the-Loop Simulation
We further validated the vector field lateral guidance integrated with a PID longitudinal controller in a hardware-in-the-loop (HIL) simulation environment. The fixed-wing UAV model included six degree-of-freedom dynamics, engine model, and rocket booster for launch. We injected a constant wind of 6 m/s from 45°. The flight path consisted of multiple straight segments and arcs. The UAV was launched from coordinates (0 m, 500 m) and completed two circuits before recovery.
The HIL results showed that the UAV closely followed the desired path with minimal cross-track error. The altitude tracking was also smooth, confirming that the vector field lateral guidance combines effectively with the PID altitude controller. The entire flight lasted approximately 200 seconds, and the maximum lateral deviation was less than 10 m during the straight segments and 12 m during the arcs, even under the constant wind disturbance. The roll and pitch commands remained within actuator limits, and no oscillations or instability were observed.
Conclusion
We have presented a vector field-based lateral guidance algorithm specifically designed for a medium-sized fixed-wing UAV. By using only the cross-track error to compute the course angle command, the algorithm provides fast convergence and robust rejection of wind disturbances. Numerical comparisons against a conventional PID lateral controller demonstrate significant improvements in settling time, tracking error, and flight smoothness for both straight-line and circular arc paths. Hardware-in-the-loop experiments confirm that the vector field method integrates seamlessly with a PID longitudinal controller, enabling the fixed-wing UAV to achieve precise and stable path following under realistic wind conditions. This work offers a practical and effective solution for enhancing the autonomy of fixed-wing UAVs in challenging environments.
