Share this

Design of a PID Controller Based on a BP Neural Network

2026-04-06 03:22:53 · · #1

1. Introduction

PID control is one of the earliest developed control strategies. A controller that controls based on the proportional, integral, and derivative of the deviation is called a PID controller. It is a mature and widely used controller in continuous systems. Due to its simple algorithm, easy implementation, good robustness, and high reliability, it can effectively control a large range of industrial objects, making it particularly suitable for deterministic control systems with accurate mathematical models. Traditional PID controllers are relatively mature in technology. Currently, typical PID control is still the most widely used in industrial control systems. However, in practical situations, when the controlled object has nonlinear or time-varying characteristics, parameter tuning and online adaptive adjustment become difficult. As controlled systems become increasingly complex, the requirements for control systems are also increasing, especially the need for control systems to adapt to uncertainties and time-varying objects and environments. Traditional control methods based on accurate models are insufficient to meet these requirements. The concept of control has now broadened, requiring the inclusion of decision-making and learning functions. Because BP neural networks have good online monitoring capabilities, and neural networks are complex networks composed of a large number of simple neurons, possessing the basic characteristics of the human brain, they have opened up new avenues for research in the field of control, especially suitable for complex processes and time-varying parameter systems. The combination of a BP neural network and a PID controller can achieve excellent control results. Due to these advantages, neural networks are receiving increasing attention. Therefore, neural network control technology is well-suited for application in industrial control and regulation systems.

2. Backpropagation (BP) neural network

2.1 BP Neural Network Structure

The brain is an extraordinary intelligent machine, capable of interpreting ambiguous information from sensory organs at astonishing speeds. It can detect whispers in a noisy room, recognize a face in a dimly lit alley, and generate tremendous creativity through continuous learning. A neural network system is a technological system that uses engineering techniques to simulate the structure and function of the human brain's neural networks; it is a large-scale parallel nonlinear dynamic system. Strictly speaking, a neural network should be called an artificial neural network, but for simplicity, the word "artificial" is generally omitted, and it can be simply abbreviated as NN (Neural Network). Because neural networks possess advantages such as distributed information storage, parallel processing, and self-learning, they have broad application prospects in information processing, pattern recognition, and intelligent control. The focus of artificial neural networks is not to completely replicate the cellular networks of organisms using physical devices, but rather to adopt usable parts to solve problems that current computers or other systems cannot solve, such as learning, recognition, control, and expert systems. With the development of biological and cognitive sciences, our understanding of the structure and cognitive processes of the human brain is becoming increasingly profound, promoting the development of artificial neural network technology, and more and more biological characteristics will be utilized in engineering.

Figure 2-1 BP neural network structure diagram

The structure of a backpropagation (BP) neural network is shown in Figure 2-1. As can be seen, a BP network is a neural network with three or more layers of neurons, including an input layer, intermediate layers, and an output layer. Full connections are established between layers, but there are no connections between neurons within the same layer. When a pair of learning samples is provided to the network, the activation values ​​of the neurons propagate from the input layer through the intermediate layers to the output layer, where each neuron receives the network's input response. Next, following the direction of reducing the error between the target output and the actual output, the error propagation proceeds backward from the output layer through each intermediate layer back to the input layer, thereby correcting the connection weights layer by layer. This algorithm is called the "backpropagation algorithm," or BP algorithm. As this backpropagation correction continues, the accuracy of the network's response to the input pattern continuously increases. Unlike the perceptron, because the transfer function is differentiated during backpropagation, the transfer function of the BP network must be differentiable. Therefore, the hard-closed transfer function used in perceptron networks cannot be used; commonly used transfer functions include sigmoid logarithms, tangent functions, or linear functions. Since the transfer function is differentiable everywhere, for a BP network, on the one hand, the region it divides is no longer a linear division, but a region composed of a nonlinear hyperplane, which is a relatively smooth surface. Therefore, its classification is more accurate and its fault tolerance is better than that of a linear division. On the other hand, the network can be strictly learned using the gradient descent method, and the analytical expression for weight adjustment is very clear.

Simulation Study of PID Controller with 3BP Neural Network in a Second-Order Control System

Due to the rapid development of computer technology, it is now possible to obtain the time response of a system using computers; this is known as digital simulation. Digital simulation is essentially a method of experimental research using computers based on a model of the real system under study. The simulations discussed in this chapter are primarily computer simulations. The main process of simulation involves: model building, simulation execution, and analysis of the results. Simulation execution involves using specific algorithms to obtain relevant information about the system, particularly the changes in the system's input and output responses. Because the mathematical models of continuous-time and discrete-time systems differ, the simulation algorithms also differ; for continuous-time systems, there are different numerical calculation methods for solving differential equations.

Given the transfer function of a system, a PID controller is used to bring the system to a steady state. The system is programmed using MATLAB software. The final simulation results are obtained by setting the parameters.

Figure 3-3 PID error dynamic curve

Figure 3-4 Dynamic curves of PID controller input and output

Figure 3-5 Self-tuning curves of Kp, Ki, Kd parameters

From the above figures, the BP neural network PID control system outperforms the conventional PID control system in transient performance, including maximum overshoot, rise time, settling time, and oscillation range during transient processes. It enables the control system's output values ​​to track the setpoint more effectively, thus ensuring high-precision and high-quality control output. However, when the mathematical model changes, the output value of a traditional PID controller fails to reach the setpoint and cannot achieve stability. In contrast, the simulated output value of the BP neural network PID controller still reaches the setpoint and remains stable.

In summary, the BP neural network PID control system is superior to the conventional PID control system mainly in the following ways:

First, it has a shorter transition and rise times to reach stability. The transition and rise times of the BP neural network PID control system are significantly shorter than those of conventional PID control systems. This improves efficiency, saves electricity, and ensures water quality meets standards.

Finally, it possesses strong adaptability and is not easily affected by changes in the external environment. Conventional PID control systems require PID parameter tuning before controlling a process object. Furthermore, in practice, system parameters change frequently, making conventional PID control systems prone to oscillations and hindering the achievement of optimal control performance in a short time. However, BP neural network PID control systems, due to online PID parameter tuning, can quickly adapt to changes in system parameters, thus tracking the setpoint better. All of this demonstrates that BP neural network PID control can be applied to many engineering control applications and exhibits excellent control performance for many real-world control systems.

4. Conclusion

While traditional PID control boasts advantages such as simple structure, good stability, and high reliability, it also suffers from inherent problems: First, traditional PID control theory is based on mathematical models, which can be problematic if the controlled object lacks a sufficiently precise mathematical model. Furthermore, traditional PID control theory lacks universal analysis and design methods for nonlinear systems. Additionally, although traditional PID controllers possess a certain degree of robustness and adaptability, their control performance is poor for objects with strong nonlinearity, rapid time-varying uncertainties, or strong disturbances. This creates conditions for neural network-based PID control. Therefore, research on control strategies combining PID control and BP neural networks has attracted considerable attention. PID neural networks, composed of proportional, integral, and differential neurons, possess rapid learning capabilities and good performance; the self-tuning PID control parameters can be tuned and optimized online, exhibiting strong adaptability and robustness. This makes them applicable to many engineering control systems.

Read next

CATDOLL 128CM Nanako Silicone Doll

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22