Xi'an Technological University

**Subject:** Computer Science, Software Engineering

**eISSN:** 2470-8038

SEARCH WITHIN CONTENT

Related articles

Chen Gong
** ^{*}**
/
Shengquan Yang

**Keywords : **
Oil Pump,
Fuzzy Control,
Neural Networks,
PID Control

**Citation Information : **
International Journal of Advanced Network, Monitoring and Controls. Volume 3,
Issue 4,
Pages 63-68,
DOI: https://doi.org/10.21307/ijanmc-2019-022

**License : **
(CC-BY-NC-ND 4.0)

**Published Online: ** 14-October-2019

- ARTICLE
- FIGURES & TABLES
- REFERENCES
- EXTRA FILES
- COMMENTS

In view of the fact that oil pumps exist in the more complex mountains and plains, external temperature, humidity, crude oil characteristics and other adverse factors make the oil pumps control system appear the problem of drift, Fuzzy neural network PID algorithm is studied and designed to realize controling the oil pump system in this paper, combined with the advantages of conventional PID control, fuzzy control and neural network control, the composition and structure of the oil pump control system are analyzed, the model structure and algorithm implementation of fuzzy neural network PID control algorithm are designed in detail. The simulation results show that the control algorithm has good adaptability and anti-interference ability.

PID control is one of the early development control strategies. Because of its simple control and good reliability, it is widely used in industrial process control. Oil pump is one of the large-capacity oil pump. Its flow and pressure stability at the inlet and outlet are the key to the safe and efficient operation of the oil pump system. The system is affected by the environment and the characteristics of crude oil and other factors, conventional PID control is difficult to control the oil pump accurately and stably, and is easy to cause system shock. With the development of intelligent control technology, such as fuzzy control, neural network control, and sensor technology, more and more control methods and control technology become more and more mature. This paper synthesizes the advantages of simple PID control, fuzzy control does not depend on model, and neural network control is adaptive. Fuzzy neural network PID control is used to control oil pump accurately, after the number of the input layer and the hidden layer nodes of fuzzy neural network PID control is determined, the input and output errors of the system are fuzzed by the fuzzification module and then used as the input parameters of the neural network, three parameters of PID control, K_{P}, K_{I}, K_{D} are dynamically adjusted under the condition of self-learning of fuzzy neural network and adjustment of weighting coefficient, and the optimal parameters under different states are obtained, so as to achieve the dynamic stability control of oil pump system. Fuzzy neural network has strong adaptive ability and high flexibility, which can solve the shortage of traditional PID control, and conventional PID control can solve the problem of inadequate control precision of fuzzy neural network.

The control system of oil pump is mainly composed of computer, frequency converter, PLC, motor, oil pump and various sensors. The computer that controls the whole system is the central system. Its function is to realize the control algorithm, data storage, data modification, data display and control system to achieve the alarm when it is abnormal, it is the key to achieve man-machine dialogue, PLC is the abbreviation of programmable logic controller. Its function is to perform logic operations, complete the overall control of the system, parameter detection and complete the instructions transmitted by the computer, frequency converter mainly changes the speed of the motor by changing the real-time voltage and frequency of the motor, so as to realize the control of the outlet pressure, inlet pressure, flow rate, pump temperature and ambient gas concentration of the oil pump, these parameters will be transferred to the central computer through A/D conversion, and the computer will display them in data form, the sensor is used to collect all kinds of required parameters information. Figure 1 is a diagram of the structure of the oil pump control system.

The main control performance indexes of the oil pump control system are as follows: (1) High Efficiency η: The oil pump control system can adjust and control the system quickly under the effect of a given signal parameter; (2) Accuracy θ: it can accurately control the outlet pressure, inlet pressure and flow rate of the oil pump; (3) Stability ψ: Oil pump is generally distributed in complex and harsh environment. Under the influence of a series of uncertain factors, such as external environment temperature, moderation, crude oil characteristics, pipeline characteristics, the control system of oil pump should be within the allowable error range, so that the production can run stably; (4) It can automatically adjust the oil pump system under normal conditions, reduce manual intervention and the labor intensity of workers; (5)According to the control requirements, we can distinguish the inlet pressure, flow priority and coordination.

In this paper, the structure of fuzzy neural network PID controller is mainly divided into three parts: (1) PID controller module, the PID controller directly controls the control object, and the three parameters K_{P}, K_{I}, K_{D} of the PID control are on-line self-tuning; Among them: is the proportional adjustment coefficient, the role is to speed up the response, is the integral adjustment coefficient, its role is to increase or reduce the control amount according to the error value, is the differential adjustment coefficient, the role is to avoid overshoot phenomenon, change the dynamic performance of the system; (2) Fuzzification module, fuzzification and normalization of input parameters, according to the nonlinear characteristics of fuzzy control, the input parameters of the model can be pre-processed according to the control query table and fuzzy rules, so that the difference between the input data and the output data can be avoided, and the difference between the initial weights of the neural network and the ideal weights can be small, so that the adjustment times of the weights of the neural network can be reduced, save control time and improving adjustment efficiency; (3) Neural network module, after a large number of data learning and training, neural network can dynamically adjust the input and output pressure, flow, and constantly adjust the system to achieve optimal results, so as to achieve stable operation of the oil pump, thus achieving adaptive control and reducing human intervention, the structure of the fuzzy neural network PID controller is shown in Figure 2 below.

The fuzzy control module of fuzzy neural network PID control mainly fuzzifies the system error e_{k} and the system error change rate Δe_{k}. The processed data will be used as the input data of the neural network module. Its structure is shown in Figure 3.

The work process of fuzzification module is divided into the following parts:

1) Determining the input variables of the system, generally refers to the system error variable e

_{k}and the system error change rate Δe_{k}(Δe_{k}=e_{k}-e_{k-1}), Determining the output variables of the system, generally divided into control output and PID three parameter output two cases;2) Determining the fuzzy subset of each variable, and the element in the subset is called the linguistic value;

3) Determining the scope of each linguistic value;

4) Determining the membership function, the scope value can be dispersive or continuous, and the representation is different according to the specific state;

5) Determining the quantification factor;

6) The accurate calculation of fuzzy quantity, and the accurate calculation method of fuzzy quantity usually used is the center of gravity method.

The final output control query table can be obtained from two membership functions table and fuzzy control rule table.

The calculation process of fuzzy control output table is as follows:

1) Assuming three parameters X

_{1}, Y_{1}, Z_{1}where takes values (1, 0.8, 0.7, 0.4, 0.1, 0, 0, 0, 0, 0, 0, 0, 0), takes values (1, 0.7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), takes another =, in order to increase the robustness of the system and the resolution of the membership function, the domain values of the fuzzy sets should be dispersed a little. The initial values are {- 6, - 5, - 4, - 3, - 2, - 1, 0, 1, 2, 3, 4, 5, 6}.2) ${\text{r=X}}_{1}^{\text{T}}\times {\text{Y}}_{1}\text{=}({\text{x}}_{1\text{i}}\wedge {\text{y}}_{1\text{j}})\text{=}(min({\text{x}}_{1\text{i}},{\text{y}}_{1\text{j}}))$, among them, ${\text{X}}_{1}^{\text{T}}$ is the transpose matrix of X

_{1};3) R=r×Z=(r

_{1i}∧z_{1j})=(min(r_{1j}, z_{1j})), r is expressed in column vector form;4) According to the rule table of fuzzy control, it is known that needs 56 calculations, R=R

_{1}∪R_{2}∪...R_{56};5) Assuming that the actual value at this time is X

_{2}, Y_{2}that ${\text{R}}_{2}={\text{X}}_{2}^{\text{T}}\times {\text{Y}}_{2}$;6) The final output table of fuzzy control is obtained through clear output.

Before calculating the output table of fuzzy control, it is necessary to determine the membership function and fuzzy control rule table of x, y and Z, the membership function table can be determined according to experience, the fuzzy rule table can be obtained by inquiring the relevant books, the membership function table of language variable X the membership function table of language variable Y and Z, and the fuzzy control are also provided, the rule table can get the output table of fuzzy control.

Figure 4 is a fuzzy control output table, which is simulated under SIMULINK environment.

The neural network module of this system is divided into four layers: input layer, fuzzification layer, fuzzy reasoning layer and output layer. The input layer node corresponds to the parameters that the oil pump system needs to be controlled, and the output layer node corresponds to the three parameters of PID, the function of the neural network module is to train and learn a lot of data. The controller can optimize the real-time parameters of the oil pump continuously by adjusting the weight coefficients of each layer, so as to achieve the work of adaptive adjustment. Its structural diagram is shown in Figure 5.

The first layer is the input layer of the neural network module, each neuron node in this layer represents an input variable of the system, because the system needs to control the inlet pressure, outlet pressure and flow of the oil pump, the input layer of the neural network module controlled by the fuzzy neural network PID is composed of three neurons, namely three nodes, the main function of this layer is that the neurons transmit the values of input variables to the neurons in the fuzzy layer through the action function, the input and output of this layer are as follows:

The second layer is the fuzzification layer, each neuron in this layer is used to simulate the membership function of input variables, the input and output of this layer are expressed as follows:

The fuzzy layer of the neural network module adopts Gaussian function, and are the membership functions of the j-th fuzzy set of the i-th input variables respectively.

The third layer is the fuzzy inference layer, which is connected with the fuzzy layer of the upper layer, the connection between the layer and the upper layer is realized by a matrix w, the function is to match the fuzzy rules of the fuzzy module and to realize the fuzzy operation between each neuron node, this is achieved by using the input fuzzy quantity of the upper layer through the multiplication operator, the output value of the layer can be obtained, the input and output of this layer are expressed as follows:

The fourth layer is the output layer of the neural network module, the setting result of the three parameters K_{P}, *K _{I}*,

*w _{ij}* is the weight coefficient of the fuzzy reasoning layer to the output layer, and the three parameter output of PID is expressed as:

Common PID control algorithms can be divided into three categories: incremental PID algorithm, positional PID algorithm and differential forward PID algorithm, the PID module of the fuzzy neural network PID controller is adopted the classical incremental PID controller, the output of incremental PID algorithm is related to the current system error and the first two system errors. The disadvantage that the position PID algorithm needs to consider the cumulative error of the past is avoided, so it has better control precision, in addition, the output of incremental PID algorithm is the relationship between the system and the system increment. When the system error occurs, the memory function of incremental PID algorithm can keep the system in situ, so as to minimize the impact of the system error and not seriously affect the stability of the system, the incremental PID algorithm control formula is:

Δu(k)is the increment of the output control volume of the system u(k) and u(k-1) are the output of k-th times and the output of k-1-th times, e_{k}, *e*_{k−1}, *e*_{k−2} are the systematic errors of k-th, k-1-th and K-2-th respectivel.

Because the oil pump exists in the mountains and deserts, the system runs time-varying and nonlinear, so the neural network needs to adjust the weight coefficients in real time according to the changes of input and output pressure and flow, so that the oil pump system can achieve the best control effect, that is to say, the fuzzy rules of fuzzy module need to be adjusted constantly, and the performance index function E (k) of online network learning is defined:

The r(k) and y(k) in the formula represent the ideal output and the actual output of the neural network system respectively. We can get the iteration error e_{k} =r(k)-y(k) for each iteration, in order to make the actual output of the system close to the ideal output, the performance index function E(k) should be close to 0, We modify the center vector, width of the Gaussian function of the fuzzy neural network PID algorithm and the network connection weight of the neural network module, and an be obtained:

The neural network center vector is:

The width of the neural network is:

The weight coefficient of neural network is:

After considering the actual situation, the weights of the output are expressed as:

The upper K is the number of iterations, and α is momentum factor.

The fuzzy layer and the fuzzy inference layer are equivalent to the hidden layer of the neural network, and the input-output layer is similar to the input-output layer of the neural network, the input information of the input layer acts on the output layer node through the hidden layer, and then produces the output signal. The data of neural network training are generally the system error and the deviation between actual input and expected output, the weights and thresholds of the minimum error are determined by repeatedly adjusting the connection matrix w between the input layer and the hidden layer and the hidden layer and the output layer, at this point, we can find similar data in the training samples by searching the training neural network model, and then the neural network will process the data itself, so as to obtain the nonlinear transformation information with the least error.

The fuzzy neural network PID algorithm is described in detail:

1) According to the type and quantity of control parameters, the number of nodes in input layer, fuzzy layer and fuzzy reasoning layer of neural network module is determined, the main parameters of PID control modification are K

_{P}, K_{I}, K_{D}, therefore, the number of nodes in the output layer is determined to be 3, ihe initial value of the weighting coefficient of each layer is given, and the initial value of the weighting coefficient is initially determined to be 1;2) Determining the parameter vector according to the control parameters of the oil pump system, so as to form the predictive model of the controller;

3) Collecting the ideal output value r(k) of the oil delivery pump system and the actual output value y(k), and get the system error value;

4) The system error value is sent to the fuzzy module for fuzzy processing, and the output value is used as the input value of the neural network module;

5) According to the input and output formula of each layer, the output value of the neural network is the three parameter of PID control;

6) Calculating and modifying the weight coefficient of fuzzification layer, fuzzy reasoning layer and output layer.

7) Making k = K + 1, go back to the second step and continue the cycle until the weight coefficient is adjusted to the most suitable period of the system.

The algorithm is expressed in the form of flow chart:

The fuzzy neural network PID control algorithm is evaluated by using the Simulink simulation tool in MATLAB R2016b software, using S function in Simulink to realize the control law can avoid direct programming and reduce the trouble caused by using complex source code, moreover, the program of this tool is simple and debugging is convenient, which greatly reduces the workload of simulation evaluation. In the process of simulation, the control speed and stability of the three control algorithms, the conventional PID control, fuzzy PID control and fuzzy neural network PID control, are compared and analyzed.

Supposing the transfer function of the controlled object is: ${\text{G}}_{\text{s}}=\frac{{\text{e}}^{\text{-\tau s}}}{({\text{T}}_{1}\text{s+1})({\text{T}}_{2}\text{s+1})}$, T_{1}=1, *T*_{2}=1, τ=0.3, the ambiguity factor is 0.01, and the ambiguity resolution factor: k_{1}=0.5, *k*_{2}=0,05. *k*_{3}=0.05, the initial value of the three parameter of PID is k_{p}=6.5, *k _{I}*=1,

The three curves in Figure 7 are the unit step response of conventional PID control, fuzzy control and fuzzy neural network PID control, it can be seen that the speed of fuzzy neural network PID control reaching 1 is slightly slower than that of conventional PID control and fuzzy control. This is due to the fact that it takes a certain time for fuzzy neural network PID control to constantly adjust the weight coefficient, but, fuzzy neural network PID control returns to the ideal state much faster than conventional PID control and fuzzy control. in addition, it can be seen that the control stability and overshoot of fuzzy neural network PID control are obviously more than the other two controllers.

For the control system of oil pump in oil field, the conventional PID control algorithm is difficult to satisfy the control precision and stability of the disturbance nonlinear situation., fuzzy control will reduce the accuracy and control quality after fuzzy information processing, aiming at the shortcomings and shortcomings of conventional PID control and fuzzy control, this paper combines the advantages of simple conventional PID control, no dependence of fuzzy control on model, and the on-line adaptive ability of neural network., the fuzzy neural network PID control algorithm is applied to the control system of oil pump in oil field. Simulation experiments show that: Fuzzy neural network PID control algorithm is superior to fuzzy control and PID control in control accuracy and control stability, in addition, the on-line self-adaptive regulation ability of fuzzy neural network PID control not only improves the stability of oil pump operation, but also reduces the times of manual regulation of oil pump control system, prolongs the life of equipment and reduces the production risk of enterprises. The control strategy and method proposed in this paper meet the actual control requirements and have certain practical application value..