Research of Oil Pump Control Based On Fuzzy Neural Network PID Algorithm

## Publications

/ Export Citation / / / Text size:

#### International Journal of Advanced Network, Monitoring and Controls

Xi'an Technological University

Subject: Computer Science, Software Engineering

eISSN: 2470-8038

18
29
Visit(s)
0
Comment(s)
0
Share(s)

SEARCH WITHIN CONTENT

FIND ARTICLE

Volume / Issue / page

Archive
Volume 6 (2021)
Volume 5 (2020)
Volume 4 (2019)
Volume 3 (2018)
Volume 2 (2017)
Volume 1 (2016)
Related articles

VOLUME 3 , ISSUE 4 (Oct 2018) > List of articles

### Research of Oil Pump Control Based On Fuzzy Neural Network PID Algorithm

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

Published Online: 14-October-2019

### ARTICLE

#### ABSTRACT

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.

## I. INTRODUCTION

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, KP, KI, KD 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.

## II. FUZZY NEURAL NETWORK PID CONTROLLER DESIGN AND ANALYSIS

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.

##### Figure 1.

Structure diagram of control system for oil pump

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.

## III. FUZZY NEURAL NETWORK PID CONTROLLER DESIGN AND ANALYSIS

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 KP, KI, KD 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.

##### Figure 2.

Structure diagram of fuzzy neural network PID controller

### A. Fuzzification module

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

##### Figure 3.

Structure diagram of fuzzification module

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 ek and the system error change rate Δek (Δek=ek-ek-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 X1, Y1, Z1 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) $r=X1T×Y1=(x1i∧y1j)=(min(x1i,y1j))$, among them, $X1T$ is the transpose matrix of X1;

• 3) R=r×Z=(r1i∧z1j)=(min(r1j, z1j)), r is expressed in column vector form;

• 4) According to the rule table of fuzzy control, it is known that needs 56 calculations, R=R1∪R2∪...R56;

• 5) Assuming that the actual value at this time is X2, Y2 that $R2=X2T×Y2$;

• 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.

##### Figure 4.

Fuzzy control output table

### B. Neural network module

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.

##### Figure 5.

Neural network module structure diagram

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:

##### (1)
$input: Ii(1)=xi$
##### (2)
$output: Oij(1)=xi$

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:

##### (3)
$input: Iij(2)=-(xi−cij)2bij2$
##### (4)
$output: Oij(2)=exp(Iij(2))$

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:

##### (5)
$input: Ii(3)=O(1,k1)(2)⋅O(2,k2)(2)$
##### (6)
$output: Oi(3)=Ii(3)$

The fourth layer is the output layer of the neural network module, the setting result of the three parameters KP, KI, KD of the PID control, the input and output of this layer are expressed as follows:

##### (7)
$input: Ii(4)=∑1n2Oi(3)⋅wij$
##### (8)
$output: Oj(4)=Ij(4)$

wij is the weight coefficient of the fuzzy reasoning layer to the output layer, and the three parameter output of PID is expressed as:

##### (9)
$KP=∑1Nw(1,j)⋅Oj(3)$
##### (10)
$KI=∑1Nw(2,j)⋅Oj(3)$
##### (11)
$KD=∑1Nw(3,j)⋅Oj(3)$

### C. PID module

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:

##### (12)
$Δu(k)=u(k)-u(k-1)=KP(ek-ek−1)+K1ek+KD[ek−2ek−1+ek−2]$

Δ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, ek, ek−1, ek−2 are the systematic errors of k-th, k-1-th and K-2-th respectivel.

### D. Fuzzy neural network PID online learning

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:

##### (13)
$E(k)=12(r(k)-y(k))2$

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 ek =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:

##### (14)
$Δcij(k)=-2η⋅ek⋅wij(k)⋅xj-cijbj2$

The width of the neural network is:

##### (15)
$Δbij(k)=-2η⋅ek⋅Oi(3)⋅xj-cij2bj3$

The weight coefficient of neural network is:

##### (16)
$Δwij(k)=-η∂E∂w=-η⋅ek⋅Oi(3)$

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

##### (17)
$wij(k)=wij(k-1)+Δwij(k)+α (wij(k-1)-wij(k-2))$

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 KP, KI, KD, 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:

##### Figure 6.

Algorithm flow chart

## IV. SIMULATION VERIFICATION AND EFFECT ANALYSIS

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: $Gs=e-τs(T1s+1)(T2s+1)$, T1=1, T2=1, τ=0.3, the ambiguity factor is 0.01, and the ambiguity resolution factor: k1=0.5, k2=0,05. k3=0.05, the initial value of the three parameter of PID is kp=6.5, kI=1, kD=3.5, then the Simulink model is established, in order to improve the resolution of the function the values near the fuzzy universe 0 should be distributed. The initial values are {- 6. - 5, - 4, - 3, - 2, - 1, 0, 1, 2, 3, 4, 5, 6} and the simulation model of fuzzy neural network PID control is established. The final unit step response curve is as follows: Fig.7:

##### Figure 7.

Three control algorithm unit step response curves

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.

## V. CONCLUSION

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..

## ACKNOWLEDGMENT

This paper is supported by the State and provincial Joint Laboratory of Advances Network and Monitoring Control, china(serial number: GSYSJ2016014).

## References

1. Wang Tian-hui, Li Yang, Wng Feng. Study of PID Controller to Servo System Base on Fuzzy-Neural Network[J]. Fire Control and Command Control, 2014, 39(4): 154. (in Chinese)
2. Xu Ying-jie, Pan Ting-zhe, Hu Zhi-nan ect. Elevator Group Control Algorithm Research and Control Program Implementation Based on Fuzzy Neural Network with Four-layer Structure[J].Computer & Digital Engineering, 2017, 45(9):1760. (in Chinese)
3. He Jiang, Peng Shu-yu, Hou Wen. Application of Fuzzy Neural Network PID in Digital Servo Control[J].Computer Measurement & Control, 2016, 24(10):80. (in Chinese)
4. Ou Guo-Hui, Liu Chun-Bo, Pan Feng. Self-Turing of PID Pararmeter Algorithm Based on Improved Fuzzy Neural Networks[J].Journal of Jiangnan University(Natural Science Edition), 2011, 10(2):146. (in Chinese)
5. Guo Rui, Jia Zhen-guo, Application of fuzzy neural network PID in transformer air cooling control system[J]. Changchun lnst. Tcch. (Nat. Sci. Edi.), 2017, 18(3):51. (in Chinese)
6. Chun-yu JIA, Tao BAI, Xiu-ying SHAN ect. Cloud Neural Fuzzy PID Hybrid Integrated Algorithm of Flatness Control[J]. JOURNAL OF IRON AND STEEL RESEARCH, 2014,21(06):562

### FIGURES & TABLES

Figure 1.

Structure diagram of control system for oil pump

Figure 2.

Structure diagram of fuzzy neural network PID controller

Figure 3.

Structure diagram of fuzzification module

Figure 4.

Fuzzy control output table

Figure 5.

Neural network module structure diagram

Figure 6.

Algorithm flow chart

Figure 7.

Three control algorithm unit step response curves

### REFERENCES

1. Wang Tian-hui, Li Yang, Wng Feng. Study of PID Controller to Servo System Base on Fuzzy-Neural Network[J]. Fire Control and Command Control, 2014, 39(4): 154. (in Chinese)
2. Xu Ying-jie, Pan Ting-zhe, Hu Zhi-nan ect. Elevator Group Control Algorithm Research and Control Program Implementation Based on Fuzzy Neural Network with Four-layer Structure[J].Computer & Digital Engineering, 2017, 45(9):1760. (in Chinese)
3. He Jiang, Peng Shu-yu, Hou Wen. Application of Fuzzy Neural Network PID in Digital Servo Control[J].Computer Measurement & Control, 2016, 24(10):80. (in Chinese)
4. Ou Guo-Hui, Liu Chun-Bo, Pan Feng. Self-Turing of PID Pararmeter Algorithm Based on Improved Fuzzy Neural Networks[J].Journal of Jiangnan University(Natural Science Edition), 2011, 10(2):146. (in Chinese)
5. Guo Rui, Jia Zhen-guo, Application of fuzzy neural network PID in transformer air cooling control system[J]. Changchun lnst. Tcch. (Nat. Sci. Edi.), 2017, 18(3):51. (in Chinese)
6. Chun-yu JIA, Tao BAI, Xiu-ying SHAN ect. Cloud Neural Fuzzy PID Hybrid Integrated Algorithm of Flatness Control[J]. JOURNAL OF IRON AND STEEL RESEARCH, 2014,21(06):562