Research on intelligent alarm method of coupling about snubbing operation in oil and gas field

Because of the complex environment of high temperature, high pressure in the well, the deformation, the tilt and the vibration of the tube in the process of uprooted and insert pipe string by snubbing operation device of the oil-gas field, the present coupling alarm device has high false alarm rate. According to the mathematical principle of 3 points determined a circle and collecting information by analogy proximity sensors, the position of tube at the detection surface is determined. The fuzzy algorithm is used to distinguish the diameter of the detection surface which is pipe diameter or coupling diameter, so as to realize the intelligent alarm of the coupling. In this paper, the configuration design of coupling alarm device that includes information acquisition, processing, control and other parts is designed by WinCC flexible software. In addition, the data of detection and calculation is displayed on the monitoring screen in real time and accurately. Experimental simulations verified the intelligent alarm method can accurately collect distance information, identify the position of the coupling and visualize the relevant data.


Introduction
In order to save energy and protect ecological environment, the production technology of snubbing operation has been widely used in oil and gas field industry [1]. The snubbing operation means that we can control the wellhead pressure and sealing by the snubbing operation equipment under the condition of pressure at the wellhead. Pipe String is lifted and lowered without blowout [2].
Ram blowout preventer is the core component used to isolate and seal high temperature and high pressure environment in a well. When the pipe string coupling passes through the blowout preventer, the rubber core of the blowout preventer needs to be opened to avoid wearing the rubber core, so that the operation of the pipe string can proceed smoothly [3]. In the automated snubbing operation equipment, it is necessary to accurately detect the position of the coupling to ensure the orderly opening and closing of the upper and lower ram blowout preventers, then the coupling can pass safely and efficiently and realizing snubbing operation. Therefore, the accuration of coupling alarm is of great significance to the snubbing operation.
Current coupling alarm devices are mainly divided into two types: one is contact coupling alarm device; the other is electromagnetic induction coupling alarm device [4] . The former generates displacement signal by the coupling touching the roller, while the latter generates alarm signal by the change of induction electromotive force in the coil caused by the coupling passing. There are still many problems in the application of these coupling alarm devices. They often occur false alarms due to inclination, offset vibration, deformation of the pipe string, sludge on the surface of the pipe, metal and non-metallic impurities, etc. In this paper, proximity sensor combined with fuzzy algorithm is used to identify the coupling intelligently, which can eliminate the interference of the above factors and better realize the accurate alarm of the coupling.

Principle of intelligent detection and alarm for coupling
Analog proximity sensor [5,6] is a kind of displacement sensor, which is used to sense the distance between the itself and an object to accomplish a preset function. The proximity sensor belongs to the linear device of metal induction. When the sensor starts to work, an alternating magnetic field will be generated on the induction surface of the sensor. When the metal object is within its induction distance, eddy current is generated in the metal and the energy of the oscillator is absorbed at the same time. The distance between the object and the sensor is detected according to the attenuation of the oscillator's output amplitude. With the change of the position, the electrical signal can be output proportionally.
As shown in Fig. 1, three analog proximity sensors were evenly distributed in the device. When the pipe string arrives at the sensor position in the coupling alarm device shell, there will produce changed electrical signals. Because the distance of the coupling and the pipe are different to sensor. The electric signal is collected, conditioned, A/D converted, the diameter of the pipe string at the detection surface is calculated. Then, the calculation results are analyzed by using the fuzzy intelligent algorithm to determine whether the coupling reaches the predetermined position, thus giving an alarm signal. The information collected by the analog proximity sensor is the distance between the outer diameter of the pipe string and the inner diameter of the snubbing operation equipment, not the diameter of the pipe string. Therefore, according to the principle of the three point circle, the diameter of the pipe can be calculated. As shown in Figure 2.
From the size of diameter d, we can judge whether the diameter is the diameter of the pipe string or the diameter of the coupling. The diameter detected by the sensor can be judged by the principle of three-point circle determination, regardless of the migration and vibration of the pipe string in the well.

Algorithm design based on Fuzzy Theory
Considering the influence of the tolerance about pipe diameter, the accuracy of sensor detection and the complex environment in the well, the calculated diameter d is the detection value fluctuating around the nominal value. At the same time, although the detection value can be discriminated through the direct programming, the fluctuation data and the trend of diameter change can not be identified. The robustness is poor, which affects the accuracy of the discrimination. Therefore, a fuzzy algorithm is used to deal with the obtained diameter value, which is fuzzified and classified fuzzy grade, and then the diameter is identified. We use dual input and single output fuzzy controller to control and improve the level of discrimination.
Setting the standard coupling outer diameter as 89mm  , the pipe string standard outer diameter as 73mm  ,the reference diameter value as 81mm  .The deviation E as the difference between the test  According to the membership function of Figure 3, the membership assignment table of input deviation e and output discrimination value u can be obtained, as shown in Table 1.  According to the strategy of judging the diameter of coupling by experienced operators, the control rules as shown in Table 2 2) The total fuzzy relation matrix R : 3) Finally, the total fuzzy reasoning synthesis operation: According to formulas (3), (4), (5), using the toolbox of fuzzy algorithm in MATLAB, the fuzzy control table is obtained as shown in Table 3.
The fuzzy control table can be inserted into the PLC by using the FILL-N instruction, the ATT instruction can be used to query the output u [7]. Then it judges whether the output is the diameter of the coupling or not, and gives the coupling alarm signal.

experimental design
According to Fig. 1, an experimental device was designed to simulate the complex environment of real oil wells. Sludge was coated on the surface of the pipe string and common impurities were filled between the pipe string and the casing. At the same time, in order to verify whether the method could eliminate the interference of these factors, the pipe string was swayed and inclined during the verification. The experiment was designed according to the flow chart of block diagram shown in Fig. 4. In the experiment, the analog proximity sensor was connected with S7-200PLC, smart 700 IE V3 touch screen. Programs that included intelligent control, diameter calculation and A/D conversion were written into S7-200 PLC. The configuration of Siemens smart 700 IE V3 touch screen was designed by WinCC flexible software, and the diameter value at the detection surface was monitored in real time [8].
The information collected by analog proximity sensor was changed as electrical signal by internal conditioning, amplifying circuit. The 0-10V voltage signal produced by the sensor was inputted into PLC through the analog input expansion module using EM231 and stored in the AIW0. Then ,the digital quantity in AIW0 was transferred to VW10. The digital quantity in VW10 for detecting the distance value, and the result was stored in the VD10. The detection surface of pipe string was calculated by the diameter calculation program. Finally, switch signal was outputted after the algorithm of intelligent identification alarm. At the same time, the data was transmitted to the monitoring screen to provide detection and reference for the coupling alarm.

Analysis of experimental results
The output voltage signal of analog proximity sensor is 0-10V, corresponding to the digital value of EM231 is 0-32000, and the range of analog proximity sensor is 20-200 mm. So, the relationship between them can be deduced as shown in formula (6). 9 20 1600 y x   (6) x-Detection value of analog proximity sensor; y-The digital value of the output voltage signal. According to this formula, the distance between the casing and the pipe string can be calculated, and the diameter of the pipe string can be obtained. At the same time, the configuration software is used to show the trend view of the two sets of data and display the corresponding changes at any time. As shown in figures 5 and 6. From the trend view of Fig. 5 and 6, we can see that when the coupling reaches the detection position, the straighter diameter curve changes, changes a certain value and then stabilizes again. When the coupling passes through, it restores to the original curve position again. The curve can be analyzed and judged manually through the monitoring screen, which can be verified and referred with the method of judging the coupling diameter intelligently by using the fuzzy algorithm.

Conclusion
By the use of analog proximity sensor, the relative distance information of three points on the surface of the pipe to the sensor is obtained, and then the diameter of the pipe string is calculated according to the principle of three-point circle setting. Fuzzy algorithm is used to distinguish the diameter of pipe string intelligently and alarm. Besides, the trend view of diameter curve with real-time change is realized. The research of the intelligent coupling alarm device solves the problems that inaccurate detection of the coupling location and easy to produce false alarm signals.

Acknowledgments
This work was financially supported by BY2016065-45 fund.