PSO-RBF Neural Network PID Control Algorithm of Electric Gas Pressure Regulator

and Applied Analysis 3 For static and dynamic analysis of the system, we need to model the system that mainly includes drive motor model, transmissionmodel, and regulator valvemodel. According to the pneumatic dynamics, the transfer function of controlled object system of pressure valve [27] can be approximately expressed as


Introduction
With the implementation of the strategy on Western development and west-east gas transmission project, the city gas has developed rapidly.How to use gas for higher energy saving and environmental protection and ensure the safety and reliability of the system has been a key problem and this brings opportunity to gas pressure regulating.Gas pressure regulating is one of the most important parts of city gas pipeline system and the key technology of highly efficient use of natural gas resources.The gas pressure regulating can ensure the output pressure in special range; when the pressure reaches a certain value, it can be effectively shut off to ensure safe delivery of gas.Currently, the accuracy of gas pressure regulators at home and abroad that adopt the traditional direct-or indirect-acting regulating principle is not high and susceptible to external environmental factors.The accuracy of gas pressure regulator affects the downstream gas supply system directly and reduces the efficiency of energy conversion, thus resulting in energy waste and environmental pollution and even possible supply security issues [1,2].In order to solve the problems of mechanical gas regulator, electric gas pressure regulating has become the main direction of the future pressure regulating technology.The focus and difficult problem of this field is how to improve the precision and stability and shorten the response time [3,4].We had an indepth study in electric gas pressure regulator under the joint support of national innovation fund and Chongqing science and technology research project and achieved a series of research results; this paper discussed the control algorithms of electric gas pressure regulator.
The current electric gas pressure regulator often adopts the conventional PID control mode to take drive control of the core part (micromotor) of electric gas pressure regulator [5,6].For piped gas, because of the unpredictable changes of downstream load, the pipe friction, and temperature, the system is time-varying, nonlinear, and it's difficult to build a precise mathematical model.The parameters of conventional PID controller, set by experts, cannot be modified online, which brings much difficulty to achieve the expected effects [7].The conventional PID controller ameliorating is needed to further improve accuracy and stability and to shorten response time.
Researches show that RBF [8,9], with fast convergence speed and strong global approximation capability, can approximate any continuous and nonlinear networks with arbitrary precision and shows better performance in the nonlinear system problem-solving [10][11][12].Compared with back propagation (BP) neural network, radial basis function (RBF) neural network has many advantages: faster convergence speed, less training iteration, stronger robustness, and no local minimum, and so forth [13][14][15].RBF is extremely sensitive to the base-width vector, the center vector, the radial basis layer, and the selection of the initial value of connection weights of output layer [16][17][18].If the parameters of this system are selected inappropriately, the convergence rate of the network will be slow and easy to fall into local minima.To this end, we put forward a kind of improved PID intelligent control algorithm which applies to the electric gas pressure regulator.The algorithm uses the RBF neural network based on PSO [19,20] to determine the initial parameters of the network [21] and then makes online adjustment on PID parameters to improve the control accuracy, response speed, and tracking performance of the system.

Electric Gas Pressure Regulating System
The basic principle of traditional pressure regulating is mechanical balance.The electric gas pressure regulating system range from simple single stage [22] to more complex multistage [23], and the principle of operation is the same in all [24,25].The internal structure is shown in Figure 1.When the outlet pressure P2 is stable, the upward force P2 acting on the film is balanced against the spring force.If P2 decreases, the spring force is greater than the upward force of the film.
Then the spring will move down and pull the valve to move upward to increase valve opening and the downstream flow, thereby increasing the gas outlet pressure until the system reaches a new mechanical equilibrium.Obviously, as time goes on, the loss of accuracy of the regulator occurs because of the reduced elasticity of the spring and the friction's damage on diaphragm.Therefore, we replace the original mechanical pressure regulating components with stepping motor and driving system (part 1 of Figure 1) thereof by rebuilding core parts of pressure regulator.The system principle diagram of the improved electric gas pressure regulating is shown in Figure 2. We use the intelligent air pressure sensor array and adopts the information fusion algorithm to detect the electric gas regulator's inlet and outlet pressure [26].Making differential operation with set pressure value and the result value as the input parameter of controller is to adjust the rotation angle of the stepping motor according to the control algorithm.If the outlet pressure value is less than the set pressure value, the stepping motor will rotate forward, on the contrary, it will reverse.The motor, through the driving system, transforms the angle of motor into linear displacement of output shaft which drives the valve rod to control the valve opening and adjust the outlet pressure.From the working principle, we can draw that the regulator system is a single input/single output closed-loop control system.
For static and dynamic analysis of the system, we need to model the system that mainly includes drive motor model, transmission model, and regulator valve model.According to the pneumatic dynamics, the transfer function of controlled object system of pressure valve [27] can be approximately expressed as

Parameters Tuning of PID Controller by RBF Neural
Network.Choose the stepper motor as the operator of the electric gas pressure regulator and use digital incremental PID control mode; the control algorithm can be expressed by the following difference equation: In formula (2),   ,   , and   are constant parameters which cannot be adjusted online and expected control effect is impossible to get when the controlled system is nonlinear or is with large delay.Therefore, we adjust PID parameters with RBF neural network online.The performance index of PID parameter is In formula (3), () is the set value of outlet pressure, () is the actual output value of system, and  is the sampling time.
In order to minimize the (),   ,   , and   are sets via the gradient descent method.Consider To find Δ  , Δ  , and Δ  in (4), (5) ) ,  = 1, 2, . . ., . (7) In formula (7),  = { 1 ,  2 , . . .,   }  is the -dimensional input layer vector;   is the central value of  node; and  = [ 1 ,  2 , . . .,   ]  is basis-width vector of the network. = [ 1 ,  2 , . . .,   ]  is weight vector of the network, so the output layer can be expressed as In formula (8), () is the actual output of the controlled object after  iterations.In order to make  minimum, according to the gradient descent method, the iterative algorithm of output weights, center vector, and basis-width vector parameters is shown as follows: Δ In (9),  is the learning rate and  is the momentum factor.Since the online identification ability of neural networks in Jacobian matrix (sensitivity of output versus input change) is powerful, when the neural network identifier can approach the object, we can use   () instead of the actual output of the controlled object in the system ().The Jacobian matrix algorithm of neural network is In formula (10),  1 = Δ(), Δ() = () − ( − 1).Taking Jacobian information of the RBF neural network into (4), ( 5), and ( 6), three parameter variations (Δ  , Δ  , Δ  ) of PID can be obtained.Although RBF neural network can adjust PID parameters online, the selection of the initial parameters of RBF network will affect the performance of PID control directly, so we use the particle swarm algorithm to optimize RBF neural network to determine initial parameters of the network.

Realization of Particle Swarm Algorithm to
Optimize RBF Neural Network.Suppose there are m particles in a swarm; the information of th particle is expressed by  vector, so its position and velocity are expressed, respectively, as   = ( 1 ,  2 , . . .,   ) and   = {V 1 , V 2 , . . ., V  }.After each iteration, every particle updates its position and velocity according to individual extremism (pbest) and group extremum (gbest), which are shown as follows: = V  () In formula (11),  1 and  2 are learning factors,  1 and  2 ⊂ (0, 1) are random variables,  is the inertia factor, and  is an iteration number.A large number of experiments show that: with the algorithm iteration performing,  decreases linearly, improving the convergence of the performance of the algorithm significantly [28].Consider In formula (13),  max and  min are the maximum and minimum values of  and  max is the total number of iterations and make  max = 0.9 and  min = 0.4.The PSO algorithm convergence is quick but easy to fall into local optima.This paper makes individual mutate at a certain probability by using genetic algorithm variation theory.The specific steps of center vector, basis-width vector, and output weights of RBF neural network optimized by particle swarm optimization are as follows: (1) particle swarm initialization: determine the number of particle swarm, the initial position, speed, individual extremum, and swarm extremum; (2) map each individual component to the RBF network parameters and put them into the neural network to calculate the fitness value; (3) identify individual extremum and swarm extremum according to fitness value; (4) update the particle's velocities and positions according to formulas ( 11) and ( 12); (5) if the number of iterations reaches a predetermined maximum or meet the performance requirements of minimum error, stop the iteration and output current swarm extremum as initial parameters of the RBF neural network or return to Step (2).

PID Controller Design of PSO-RBF Neural
Network.RBF neural network-based PID control algorithm can solve the shortage problem of conventional PID control and PSO algorithm can solve the problem of the initial parameters of RBF network.The structure of PID controller of PSO-RBF neural network is shown in Figure 3.
The controller is composed of two parts: the classic PID controller with   ,   , and   modified by PSO-RBF online and PSO-RBF network; firstly it uses PSO algorithm to initialize the output weights, the node center, and the basiswidth of the RBF neural network and secondly it utilizes the gradient information of RBF neural network online identification to adjust three parameters of PID controller online, control electric regulator valve opening, and adjust the downstream outlet pressure quickly and accurately.The steps of PID intelligent controller algorithm of PSO-RBF neural network are as follows: (1) select RBF structure: initialize the input layer node number , the hidden layer node number , the learning rate , and the momentum factor ; (2) determine the output weights, center node, and initial value of node basis-width vector of RBF neural network algorithm by using particle swarm algorithm; (3) take the Jacobian information into formulas (4), (5), and ( 6), obtain PID parameter increments Δ  , Δ  , and Δ  , and correct   ,   , and   online; (4) make  =  + 1 and return to Step (3) until it reaches the cycle index or meets the performance index.

Simulation Results and Analysis
The function of electric gas pressure regulator system can refer to formula (1) with the following values: (14)

4.1.
Step Response.To test the ability of the system response to a step input, RBF network structure is chosen as 3-6-1.Suppose  = 0.50,  = 0.05,   =   =   = 0.15, and  0 =  0 =  0 = 0.1.Individual information of particle swarm consists of 30 dimension vectors, which are mapped to the RBF network parameters and its evaluation standard is the minimum error of RBF neural network PID controller.The population size of PSO algorithm is 20 and the number of iterations is 100,  1 =  2 = 2, and individual mutation probability is 0.04.In RBF network, without being optimized by PSO, its initial value is   = 9 × rands (3,6);  = 9×rands (3,6); and  = 9×rands(6, 1).The conventional PID parameters   =   =   = 0.1.The step response of three kinds of algorithms in Figure 4 shows that the step response curve time of the system is 2.4 s and is in a stable state under the adaptive control of PID parameter by PSO-RBF.While without using PSO to optimize RBF or adopting conventional PID control, the curve reaches a steady state in 12 s and 32 s, respectively.The conclusion is that PSO-RBF-PID has the shortest response time and the minimum error.
The parameters adaptive tuning curve of PSO-RBF neural network PID controller is shown in Figure 5; it is set finally that   = 0.280,   = 1.290, and   = 0.001.
The minimum error evolution of PSO-RBF neural network is shown in Figure 6.The minimum error changes obviously in the early stage and reaches an optimal value at 63th iteration.RBF network parameters optimized after 100 times are as follows:  are shown in Figure 7.It shows that electric gas pressure regulator which adopts the PSO-RBF-PID has good dynamic performance and higher control precision.

Conclusion
An in-depth research has been conducted on the mechanism of electric gas regulator about its nonhigh control precision and stability and a longer response time.It shows that the existing electric gas regulators widely use conventional PID control mode for it is simple and easy to be implemented.However, it is difficult to establish a precise mathematical model given that the pressure regulating system is timevarying and nonlinear.Meanwhile, the conventional PID controller parameters, usually set in line with human experience, cannot be modified online.So, it is hard to achieve the expected control effect to use conventional incremental PID control mode.Therefore, on the basis of the original

Figure 3 :
Figure 3: The PID control block diagram set by PSO-RBF online.

Figure 4 :
Figure 4: The step response of three kinds of algorithms.

Figure 5 :Figure 6 :
Figure 5: The adaptive tuning curve of PSO-RBF neural network PID controller.
, and (6), respectively, we must figure out /Δ which can be approximately got by Jacobian matrix of RBF neural network.The radial basis function is  = [ℎ 1 , ℎ 2 , . . ., ℎ  ] and it is usually expressed by Gauss function.Consider ℎ  () = exp (−       − According to the actual needs of the regulator, electric pressure regulator will be formulated according to the input pressure, fast regulate valve opening, and make the outlet pressure stable in the range of errors.So we need to test the tracking performance of the control system.The tracking curves of three kinds of control algorithms