Parameter optimization of nonlinear PID controller using RBF neural network for continuous stirred tank reactor

The temperature system of the Continuous Stirred Tank Reactor (CSTR) has the characteristics of strong nonlinearity and uncertain parameters. The linear PID controller makes it difficult to meet CSTR’s control requirements. Nonlinear PID (NPID) can improve the control effect of nonlinear controlled objects, but due to the influence of nonlinear function selection and manual parameter setting, when parameters are uncertain or subject to external interference, the control performance of the system will decrease. To improve the adaptive capability of the NPID controller, the RBF-NPID control algorithm is proposed. The learning ability of RBF neural network is used to adjust NPID parameters online to improve the control performance of the system. In order to verify the effectiveness of the proposed algorithm, a CSTR model was established in MATLAB and algorithm comparison research was carried out. Simulation results show the effectiveness and superiority of the proposed algorithm.


Introduction
CSTR is one of the main equipment for the production of chemical products.In the production process, the control of the CSTR system will directly affect the quality and production efficiency of chemical products.CSTR equipment is affected by internal and external environmental factors, such as raw material purity, reactant mixing, reactor temperature, reaction residence time, and catalyst.The reaction process often has a high degree of nonlinearity and parameter uncertainty. 1,2ID controller has been widely used in engineering because of its simple structure and few parameters, which can be adjusted by experience and formula method, and its control process does not depend on the accurate mathematical model of the system. 3However, for nonlinear systems with parameter uncertainties such as CSTR, the traditional PID controller is difficult to meet the control requirements of the CSTR process. 4n recent years, the control algorithm combining nonlinear control and PID control has been used in system control. 5,6NPID combines PID control with nonlinear control strategy, which not only inherits the simple structure of linear PID algorithm, but also shows good control performance in nonlinear system control, making it one of the simplest and most effective control methods in many control algorithms. 7owever, one of the main problems of the NPID controller is that control performance is affected by factors such as nonlinear function selection and manual parameter tuning.When the system is uncertain, it is difficult to ensure the optimal effect. 8,9n order to solve the limitations of manual tuning parameters of conventional PID control algorithms, more and more artificial intelligence algorithms have been proposed to optimize PID parameters, such as swarm intelligence algorithms, 10 fuzzy rules, 11 and neural networks.Among them, RBF neural network has good generalization ability and simple network structure.It can not only approximate any continuous nonlinear function with any precision, but also has the characteristics of fast convergence speed and strong local approximation ability, which has attracted the attention of scholars.Gao et al. 12 combined RBF neural network with PID control and applied it to inverted pendulum system.The results show that compared with other methods, the overshoot of the tracking signal is further reduced and the response speed is further improved.Xiao et al. 13 updated its parameters via the error signal between the RBF network output and the system output.PID parameters are updated by Jacobian matrix and system motion error.Experiments show that the RBF-PID controller is superior to the traditional PID controller in response speed, antiinterference and tracking.Zhou et al. 14 used the powerful learning ability of the RBF neural network to adjust PID parameters online, which can not only eliminate overshoot, but also improve the adaptability of the controller.In addition, the control of other types of PID is studied by using the characteristics of RBF neural network.Asgharnia et al. 15 used RBF neural network to select the parameters of the proposed gainscheduled fractional-order PID method to optimize the gain-scheduled fractional-order PID at multiple wind speeds.Simulation results show the superiority of the proposed method.Gao and Xiong 16 designed a control strategy combining RBF neural network supervisory control and expert PID control to ensure the stability of the motor load system and improve the performance of the system.
Inspired by the above literature, the RBF neural network is used to optimize the control parameters of the NPID algorithm, and the RBF-NPID control algorithm is proposed.This method inherits the advantages of NPID controller, such as simple structure and suitable for nonlinear systems, and can adaptively adjust the parameters of NPID controller according to the change of controlled object.The proposed algorithm is applied to the design of the CSTR system, and the basic PID tuning method and RBF-PID neural network tuning technology are comprehensively studied.
The structure of this study is as follows: Section 2 introduces the CSTR model.Section 3 describes the design of NPID controller based on RBF optimization.Finally, Section 4 discusses the results obtained from the proposed control strategy.The last part briefly introduces the conclusion of the research work.

CSTR model
As a chemical reactor, CSTR must accurately control the temperature change of the material reaction.However, the chemical reaction mechanism in the system is complex and has a strong exothermic effect, which makes the reaction process of the system have strong nonlinearity and parameter uncertainty, and it is difficult to control the system.A class of nonlinear CSTR is studied, and its structure is shown in Figure 1. 17 According to the material balance and energy balance in the reaction process, the CSTR model is as follows 17 : The definition of the corresponding parameters is shown in Table 1.
For further analysis, synthesis and design, the dimensionless parameter description of the system is introduced. 18The dimensionless model is shown in (2), where the parameters and variables are shown in Table 2.

RBF-NPID control algorithm design
The structure of NPID controller The traditional PID controller is a linear controller, which cannot adjust the nonlinear factors in real time, and it is difficult to further improve the control performance.Therefore, when the traditional PID controller is applied to systems with nonlinear factors, its control performance will decrease.The nonlinear transformation of the control parameters in the NPID controller ensures that the control parameters can change in real time according to the error e(t) of the system, which can deal with the interference of nonlinear factors in the system.The control law expression of the NPID controller is shown in (3). 6 Specific parameters for proportional gain coefficient K p (e(t)), integral gain coefficient K i (e(t)), and differential gain coefficient K d (e(t)) are as follows:

RBF neural network
Artificial neural network (ANN) is an artificial intelligence system that mimics biological neural network (BNN). 19It uses nonlinear processing units to simulate biological neurons, and simulates the biological synaptic behavior between neurons by adjusting the variable weights between the connection units.RBF is a feedforward network based on function approximation theory.It has a strong local approximation ability and can guarantee that the network can approximate any type of nonlinear function with any precision. 20The structure diagram of RBF neural network consists of three layers of neural network, input layer, hidden layer, and output layer.The mapping from input to output of the network is nonlinear, while the mapping from hidden layer space to output space is linear.That is, the output of the network is the linear weighted sum of the output of the hidden unit.The weight here is the adjustable parameter of the network, and the selection of the weight has an effect on the learning speed and the local optimal solution. 21n the RBF network structure of Figure 2, the vector X = ½x 1 , x 2 , Á Á Á , x i T represents the input vectors i of the neural network, u j is the radial basis function vector, and the Gaussian basis function is used as the radial basis function of the neural network.It can be expressed as: where h represents the number of hidden layer nodes, m j = ½m j1 , m j2 , Á Á Á , m ji T represents the center vector of the jth node, and s j represents the cardinality parameter of the jth node.The output of RBF network is expressed as: the weight v j , node center m j and base width parameter s j from hidden layer nodes to the output layer of the neural network are updated by gradient descent during algorithm iteration.Update the output weight v j is shown in (7).
Update the hidden layer node center m j is shown in (8).
Update the base width parameter s j of the hidden layer node is shown in (9).
Table 1.Meaning of CSTR object parameters.

Meaning of parameters Notation
Reactant concentration (mol/L) where h is the learning rate, the value range h 2 (0, 1), a is the momentum factor, the value range a 2 (0, 1).The Jacobian matrix is the sensitivity information of the target output to the input change, which can be identified by the RBF network.When the reaction temperature identification output becomes very close to the measured output, that is, y m (k)'y(k), the Jacobian matrix is defined as follows: where x 1 = Du(k) is the control increment, which is defined as the first input of the neural network.

RBF-NPID control algorithm
The structure of the NPID algorithm based on the RBF neural network is shown in Figure 3. RBF neural network will adaptively calculate the weight coefficient and parameter gradient information according to the operating state of the reactor control system.These results will be used to update NPID controller parameters in real time.This repeated process allows adaptive adjustment of NPID parameters and enhances reaction temperature control.The algorithm uses an incremental PID controller, so the control error is defined as follows: where y d (k) is the set value of the expected temperature, y(k) is the measurement process value of the temperature.
According to the derivation process and expression form of incremental PID, the expression of incremental NPID controller can be obtained as follows: where, where De(k) represents the primary error and D2 e(k) represents the secondary error.RBF neural network output performance index function J as shown in the following equation (14).
According to the gradient descent method, the three parameters of the NPID controller are adjusted adaptively.Adjusted parameters are shown as follows: where h p , h i , h d are the rate of change of the proportional, integral and differential parameters of the NPID control algorithm, and ∂y ∂Du is the Jacobian matrix information of the controlled object obtained by the RBF neural network through identification, which can be approximated by equation (10).

RBF-NPID control algorithm flow
The algorithm flow of the RBF-NPID algorithm is shown in Figure 4, and the implementation steps are as follows.
Step 1: Initialize network parameters, including the number of nodes in the input layer and the hidden layer, center vector, base width vector.
Step 2: The system input y d (k) and output y(k) are obtained by sampling, and the error is calculated according to equation (11).
Step 3: Output u(k) and update error e(k) are calculated according to equations ( 12) and ( 13).
Step 4: The network output y m (k) is calculated, and the center vector m j , the base width vector s j , the weight vector v j , and the Jacobian matrix are adjusted according to equations ( 7)- (10) to obtain the network identification information.
Step 5: The controller parameters are adjusted according to equation (15).
Step 6: If the condition is satisfied, terminate the algorithm.Otherwise, return to the second step and repeat the following steps.

Simulation analysis
First, considering the fixed parameters, the values of each parameter in equation ( 2) are taken as b = 0:3, g = 20, b = 28:0, Da = 0:072. 22n order to evaluate the controller performance, the overshoot, settling time and time weighted integral absolute error (ITAE) are used as the performance indexes of the algorithms.The ITAE mathematical expression is as follows: Tracking performance analysis  3.
From the curves in Figure 5, it can be seen that with constant parameters, the three algorithms can stabilize the response curves to the set value and achieve a good control effect on the system.According to the data in Table 3, the overshoot of the RBF-NPID algorithm is minimal, and the setting time and ITAE are between PID and NPID.Overall, the NPID algorithm's  performance index, which has undergone repeated manual parameter tuning, is the best.
However, due to various internal and external environmental factors, the actual CSTR parameters are usually uncertain.The control performance of the system under the condition of parameter changes and external disturbances is discussed in detail in the following sections.

Robustness analysis
In order to verify the control performance of the system after the parameters change, the parameters Da, b, and b which have great influence on the CSTR system are selected to change by 25% and 50%, respectively.The changed parameters are shown in Table 4.
1) Da, b, and b change by 25%, respectively.The temperature tracking response curves of CSTR is shown in Figure 6, and the corresponding performance indexes are shown in Table 5.
It can be seen from Table 5 that the overshoot, settling time and ITAE of the RBF-NPID algorithm are the smallest.
2) Da, b, and b change by 50%, respectively.The temperature tracking response curves of CSTR is shown in Figure 7, and the corresponding performance indexes are shown in Table 6.
The results show that the overshoot, settling time and ITAE values of Table 6 under the three algorithms are larger than those of Table 5, indicating that the performance of the control system becomes worse when the parameter change rate increases.But the performance index of RBF-NPID algorithm is still the smallest.3) Da, b, b randomly increasing or decreasing by 250% to 50%, the CSTR discharge temperature tracking response curves as shown in Figure 8, and the corresponding performance indexes are shown in Table 7.
The results show that the overshoot, settling time and ITAE of RBF-NPID algorithm are still the smallest when the parameters change randomly.Therefore, RBF-NPID is more robust than the other two algorithms.
Anti-interference analysis 1) In order to verify the anti-interference of the proposed algorithm, step disturbance is first applied at positions F1 and F2 when the parameters are fixed, as shown in Figure 9.At the F1 position for 4, 10, 16, and 22 s, a step disturbance with an amplitude of 1.5 is applied as shown in Figure 10, and the corresponding performance indexes are shown in Table 8.At the F2 position for 4, 10, 16, and 22 s, a step disturbance with an amplitude of 0.3 is applied as shown in Figure 11, and the corresponding performance indicators are shown in Table 9.
The results show that when the parameters are constant, the overshoot, settling time and ITAE of RBF-NPID algorithm are the smallest under interference F1 and F2, respectively.
2) When parameters change randomly, the F1 interference response curves are shown in Figure 12, and the corresponding performance indexes are shown in Table 10.The F2 interference response curves are shown in Figure 13, and the corresponding performance indexes are shown in Table 11.
The results show that the overshoot, settling time and ITAE of RBF-NPID algorithm are still the smallest when the parameters change randomly, indicating that the algorithm has the strongest anti-interference ability.

Conclusion
In this manuscript, a class of nonlinear CSTR is studied by MATLAB simulation.The object has high nonlinearity and parameter uncertainty, and the linear PID control algorithm cannot meet the control requirements of the CSTR system.Therefore, the RBF-NPID algorithm is proposed, which uses the RBF neural network to adjust the parameters of the NPID controller to improve the adaptive ability of the controller, and thus improve the control performance of the system.The RBF-NPID algorithm is compared with PID and NPID algorithms for the same process.From the results, it is determined that the performance indexes of the proposed algorithm are optimal when the parameters of the CSTR system change significantly or are subject to external disturbances.Therefore, the RBF-NPID algorithm effectively improves the robustness and anti-interference capability of the system.
wherein parameters a p , b p , c p , a i , b i , a d , b d , c d , d d are constants, which are used to adjust the parameter range and change rate of the NPID controller respectively.

=
2h i e 2 (k) ∂y ∂Du DK d = 2h d ∂J ∂K d (e(k)) = 2h d ∂J ∂y ∂y ∂Du ∂Du ∂K d (e(k)) = 2h d e(k) ∂y ∂Du D 2 e(k) Taking the step signal as the control signal, the CSTR discharge temperature response curves under RBF-NPID, NPID and linear PID algorithms are compared and analyzed.The initial parameters of the PID controller are obtained by the engineering tuning method, and further adjusted to obtain the ideal PID controller parameters K p = 24, K i = 18, K d = 0.92.Similarly, by observing the step response curve and repeatedly adjusting it manually, the initial parameter of the NPID controller is set to a p = 30, b p = 25, c p = 30,a i =45, b i = 0.3, a d = 0.388, b d = 0.5, c d = 0.01, d d = 0.09.For the RBF neural network model, first select an appropriate number of neurons in the hidden layer based on experience, and then determine the number based on simulation performance.Finally, the network structure adopts a 3-8-1 structure.The parameter setting values are h = 0:001, a = 0:06, w 0 = ½20, 22, 20, h p = 5, h i = 0:15, h d = 0:08.The sampling time is 0.01 s.The CSTR discharge temperature tracking response curves are shown in Figure 5, and the corresponding performance indexes are shown in Table

Figure 8 .
Figure 8. Discharge temperature tracking response curves when parameters change randomly.

Table 3 .
Mean value of discharge temperature tracking response performance indexes.

Table 4 .
Parameters after model changes.

Table 5 .
Mean value of tracking response curve performance indexes when parameters change by 25%.

Table 6 .
Mean value of tracking response curve performance indexes when parameters change by 50%.

Table 7 .
Mean value of tracking response curve performance indexes when parameters change randomly.Figure 9.The disturbance position of the system.

Table 8 .
Mean value of performance indexes for F1 interference response curves.

Table 9 .
Mean value of performance indexes for F2 interference response curves.

Table 10 .
Mean value of performance indexes for F1 interference response curves with random parameters.

Table 11 .
Mean value of performance indexes for F2 interference response curves with random parameters.