The PID controller was selected to guide the UAV along a defined trajectory due to its versatility, widespread use, and proven effectiveness in autopilot systems, as evidenced by numerous studies: [
10,
11,
12,
14,
15,
30,
31,
32,
33]. Its mathematical simplicity allows for straightforward software implementation, and its parameters can be tuned to match the system’s characteristics, offering significant adaptability. Moreover, the PID controller operates in real time, providing rapid and effective stabilization of dynamic systems while minimizing control errors. Additionally, well-established methods for determining the optimal PID settings are thoroughly documented in the literature.
The operator transmittance of an ideal PID controller has the following form:
where:
—proportional gain coefficient,
—integration time constant,
—differentiation time constant.
In practice, it is impossible to achieve perfect differentiation over the entire frequency range. As a result, practical controllers incorporate an inertial component that limits the impact of differentiation at higher frequencies. This inertial element acts as a low-pass filter, governed by a carefully chosen filter parameter
N. Accordingly, a real PID controller was implemented for the control system, with a transfer function given by:
where
N is the filtration coefficient.
The next step in synthesizing the control system for the task outlined in this article was to determine the controller settings (
,
and
), addressing the research problem discussed in
Section 2.2. Initially, the controller parameters were calculated using the Ziegler–Nichols II method, as detailed in
Section 4.1. Subsequently, the settings were optimized through the author’s novel approach, which involves determining the controller parameters using a recursive neural network, as described in
Section 4.2.
4.1. Path Tracking Control System with Classic PID Controller
In this case study, a control system with a controller in real form (Equation (
15)) was used, which is shown in the
Figure 3:
The control strategy focuses on precisely regulating the UAV’s flight altitude. The control signal
, represented as the steering angle
, is generated by the PID controller based on the error signal
, which is the difference between the desired flight height
and the actual flight altitude
. A change in the steering angle
induces a pitching moment
, as described by Equations (
12) and (
13). This pitching moment affects the UAV airframe, leading to a change in the pitch angle
according to Equations (
3) and (
4). Consequently, the pitch angle influences the angle of attack, as defined by Equation (
5). The angle of attack generates a lift force, described by Equations (
10) and (
11), which alters the inclination angle of the velocity vector, as given by Equation (
2). Ultimately, these dynamics result in a change in flight height, governed by Equation (
7), which the control system continuously adjusts to maintain the desired trajectory.
The control signal
coming out of the used PID controller has the following form:
and is then constrained to
= ±15°, as specified by the limitations of the rudders in real supersonic UAVs.
The next stage in synthesizing the control system involved selecting the controller gains. Initially, the engineering approach based on the Ziegler–Nichols II method [
32,
33] was used to determine the controller parameters. The Ziegler–Nichols II method involves using a purely proportional controller, after which the gain of this controller is gradually increased until the system reaches the stability limit. Achieving the stability limit for a system with such high dynamics proved to be both challenging and time-consuming. After several attempts, the control system was successfully tuned to the stability limit, as shown in
Figure 4. The critical gain value
= −0.0015 s and the oscillation period
= 18.24 s were then recorded.
Finally, the following formulae were used:
The gain values of the PID controller were determined as follows:
4.2. Path Tracking Control System with Neural Network PID Controller
Controlling UAV flight at high speeds, particularly near or above the speed of sound, presents unique challenges for the control system. These conditions introduce complex non-linear dynamics and time-varying uncertainties, which make traditional control methods, such as basic PID, less effective. To address this, the control strategy outlined earlier was enhanced by integrating a PID controller with a recurrent neural network (RNN) to optimize performance under these demanding conditions. The inclusion of the RNN enables the controller to adapt and learn over time, thereby improving its resilience to disturbances and dynamic changes in the system.
A neural network (NN) is a non-linear mathematical structure composed of a collection of interconnected neurons or nodes. The properties of a neural network are defined by its topology and the characteristics of its nodes. In this section, we describe the modelling of a PID controller tuned using an RNN, as illustrated in
Figure 5. The RNN was selected for optimizing the controller parameters due to its ability to handle the dynamic and time-dependent nature of UAV flight. Unlike traditional optimization methods, an RNN can learn from historical data and adjust its predictions accordingly. This capability is particularly valuable in UAV control, where system behaviour evolves over time due to changes in altitude, speed, and external disturbances. RNNs can capture temporal dependencies and adapt to changes in the system state, resulting in improved control accuracy and reduced response times. Moreover, RNNs are well-suited to problems requiring sequential decision-making, which is common in trajectory tracking and stabilization tasks. They are capable of processing long sequences (e.g., an extended flight trajectory) and can operate on data of varying lengths (e.g., different flight durations). A PID controller integrated with a neural network will be referred to as a PIDNN.
The used network (
Figure 5) consists of three layers. The input layer contains two neurons:
, which receives the reference signal
, and
, which receives the system output signal
. The middle layer consists of three neurons, a proportional neuron (
), an integral neuron (
), and a derivative neuron (
), each of which performs one of the three fundamental control operations: amplification, integration, and differentiation. The third layer combines these three control components into a single output
.
The weights of the individual neural connections were defined as follows:
By analyzing the signal flow structure of the neural network shown in
Figure 5, from the input layer to the output layer, the functions describing the neurons in the middle layer can be expressed as follows [
33]:
as well as a function describing the output neurone as
The neural network used is an automatic tuning method based on functional analysis in successive simulation trials. The tuning consists of changing the weights of the neurone connections using the backpropagation algorithm (Algorithm 1) [
33]. This algorithm changes the weights
,
,
, initialised with fixed values, which were previously determined by the Z-N method II, in successive simulation runs.
Algorithm 1 Backpropagation |
Input: , , , , , , , , , , , |
- 1:
← - 2:
← - 3:
← - 4:
← - 5:
for to m do - 6:
← - 7:
← - 8:
← - 9:
← - 10:
← - 11:
end for - 12:
← - 13:
← - 14:
← - 15:
← - 16:
← - 17:
m← - 18:
return , , , ,
|
The goal of the backpropagation algorithm is to create a database that links PID gains to their corresponding dynamic responses. In this way, the algorithm searches for gains that produce a specific desired dynamic behaviour. For each sample m, the proposed algorithm monitors the system output signal , the controller output signal , and the individual neuron signals and . It then compares these outputs to the input reference signal and calculates the difference between the actual outputs and the desired output. The network error is defined as the discrepancy between the actual and desired values. The individual weights are updated by backpropagating the calculated error. This process is repeated iteratively to minimize the error. Ultimately, the algorithm learns by sampling these signals.
A crucial factor in the proper functioning of the backpropagation algorithm is the learning rate, a parameter that determines the step size by which the weights are adjusted in the direction opposite to the error gradient. The learning rate of the algorithm is controlled by two coefficients:
, the learning rate for the input neurons, and
, the learning rate for the output neurons [
33]. If the learning rate is too small, the learning process will be very slow, as the weights change only slightly with each iteration. Conversely, if the learning rate is too large, it can cause instability in the system.
In the research described here, the learning rate was determined empirically using established methods for selecting this parameter. Initially, a grid search approach was employed, where several values within a predefined range were tested. The tested values included {1, 0.1, 0.001, 0.0001, 0.00001, 0.000001}. The range that produced the best simulation results was then selected. Following this, dynamic scaling was applied, where the learning rate was adjusted by a specific amount after a fixed number of iterations.