Keywords

1 Introduction

In the drilling process, due to the different strata encountered, it is necessary to adjust the rotational speed of the drill pipe to adapt to different formations. The automation degree of the drilling rig is not high, and the drilling effect is highly dependent on the operator. When the encountered formation changes are complicated, owing to the limitations of the operator’s experience and the influence of the change of the formation environment; it is often difficult for the operator’s reaction speed to adapt to the change of the working conditions. The speed regulation process may have hysteresis, and the speed regulation effect is not ideal, resulting in poor drilling efficiency [1]. The proximity of the operating table to the orifice is a safety hazard. At present, the control of drilling parameters is still in the state of theoretical research, mainly due to the complexity of the drilling process mechanism, the correlation among the variables, is the nonlinear and uncertain process. The interference factors are many random and difficult to accurately measure and there is no clear functional relationship between the monitoring parameters and the drilling parameters. However, it is impossible to describe the drilling process with a precise mathematical model. In order to improve the adaptive ability of drilling rigs in complex rock formations, Xie et al. [1], used the ratio gong method to identify the formation, which provided conditions for realizing the adaptive control of rotational speed. Xu et al. [2], analyzed the drilling parameters collected by a real-time monitoring system and showed that it is effective to judge the formation based on the follow-drilling parameters. Wu et al. [3], established a propulsion adaptive control system, which improved the adaptive ability of the drilling rig in complex formations and controlled the degree of drilling deflection. Cheng et al. [4], proposed a synergistic adaptive control method between the propulsion system and the rotary system, and the optimal rotational speed was determined by using the collected parameters of the drilling with the drill. Lu et al. [5], designed a fuzzy PID control system to realize the stable control of drilling pressure of drilling rig. Chang et al. [6], used BP neural network technology to analyze historical drilling data and realize adaptive control of drilling pressure. H. Graham investigated a system identification method using ROP and RPM as inputs and WOB and Torque as outputs for identification. The method can be applied in real time during the drilling process to recognize typical drilling dynamics for adaptive control [7].

Machine learning algorithm is the research focus of lithology identification, which has the advantages of high precision, intelligence, high efficiency, accuracy and real-time acquisition of stratigraphic information compared with the traditional method of lithology identification by monitoring the follow-drill parameters. Yue et al. [8], summarized the current status of the application of various types of commonly used machine learning algorithms in the field of lithology identification, and compared the advantages and disadvantages of various types of algorithms in the application of lithology identification. Gao et al. [9], established a K-means based lithology classification model to realize the classification of lithology. Zhang et al. [10], proposed a clustering algorithm to classify rock types on core data to realize the classification and identification of lithology. Zhang et al. [11]. established a group clustering algorithm to recognize volcanic lithology and compared it with K-means and other algorithms, and the results showed that this method is a more effective lithology recognition algorithm with high accuracy.

L. A. Castañeda et al. used adaptive control for solving problems with uncertain dynamic models. The results show that the adaptive controller also outperforms the PID controller [12]. In this paper, the fuzzy clustering algorithm (FCM) technology is introduced into the control system of power head speed to realize the discrimination of strata, and then realized the adaptive control of speed, Laying the theoretical foundation for automation and intelligence of drilling rigs. AMESim and Simulink are used for joint simulation to realize closed-loop speed regulation and speed curve tracking by fuzzy PID algorithm.

2 Modeling and Analysis of the Powerhead Hydraulic System

The power head rotary circuit consists of Rexroth’s A8VO variable double pumps, multi-way valves, and variable motors. The main pump A8VO double pump supplies oil to the LUDV valve. The LUDV system can be divided into three parts, including the throttling part, the pressure compensation part and the reversing part, in which the throttling part regulates the flow size of the system by controlling the size of the throttling port area; the pressure compensation part maintains the stability of the pressure difference between the front and rear of the valve; and the reversing part controls the flow direction of the oil to control the motor’s forward and reverse rotation. Due to the complexity of the power head system, in order to simplify the system model to speed up the simulation, the main pump is represented by a variable pump, and the main component parameters are shown in Table 1.

Table 1 Main component parameters

The modeling of the hydraulic system of the power head is shown in Fig. 1, because the different loads faced by the power head in different strata, the rotational speed of the motor of the power head in different strata (sand and gravel layer, coal layer, and rock layer) is analyzed through the simulation of AMESim software, and the results of simulation are shown in Fig. 2. From 0 to10 s, the higher motor speed is 1414.4 r/min for load of 168.8 Nm. From 10 to 30 s, the motor speed is 675.25 r/min for load of 976.7 Nm. From 30 to 40 s, the motor speed is 466.2 r/min for load of 1012.8 Nm. The results show that the rotational speeds of the motor of the motor in different strata are different, with the lowest rotational speed of the sand and gravel layer, the rotational speed of the coal layer is higher than the one of the sand and gravel layer, and the rotational speed of the rock layer is the highest.

Fig. 1
A schematic diagram of a hydraulic system. F of x block is connected to the voltameter and then to other blocks for pump, motor, relief valve and directional valve.

Hydraulic system model

Fig. 2
A multiline graph of force versus time. It presents variations for torque at port 2 and shaft speed at port 2. The line for shaft speed at port 2 first increases, then fluctuates. The line for torque at port 2 first becomes parallel to the horizontal axis, then increases, and fluctuates.

Simulation results of rotational speed under different formation loads

3 Stratigraphic Identification Methods

In the drilling process, the different mechanical properties possessed by different strata, and the drilling parameters can obviously reflect their differences [13, 14]. The drilling parameters such as drilling pressure, rotational speed and drilling speed are selected as the characteristic parameters. In this paper, the relevant drilling parameters are obtained through indoor drilling experiment mainly based on the variability of rotational speed in different formations. The drilling test rig consists of drilling rig, hydraulic pumping station, water circulation system and other parts, and the hydraulic system of the drilling rig consists of relief valves, hydraulic cylinders, oil tanks and other components. The relief valve controls the pressure of the whole hydraulic system. The drilling rig test bench is shown in Fig. 3, and the drilling test bench is utilized for the acquisition of parameters with drilling, including rotational speed, drilling speed, and drilling pressure.

Fig. 3
A photograph of a drilling rig. It has a P D C drill bit at the bottom. The drill pipe is attached vertically in the middle. It consists of slewer and racks.

Drilling test rig

In order to adapt the power head of the drilling rig to different strata during the drilling process, it is necessary to manually adjust the rotational speed in the past, disadvantages of speed lag and low efficiency. Clustering is an unsupervised machine learning method, the goal is to collect and categorize data, and the clustering algorithm can collect the drilling parameters to analyze and judge the stratum. In order to select the appropriate rotational speed, it overcomes the disadvantage of manually adjusting the speed. In the clustering process, data objects similar to each other will be divided into the same subset, and the whole observation data will be divided into several subsets. Therefore, FCM algorithm is used as the algorithm for strata identification [15].

A number of problems in different areas have been effectively solved through the use of FCM and its different variants.

Fuzzy C-mean clustering algorithm (FCM) is to classify n vectors into c classes, the clustering center of is V{v1,v2vn}, this is accomplished by finding the minima of the objective function of Eq. (1).

$$J(U,V) = \sum\limits_{i = 1}^{c} {J_{i} } u_{ij}^{m} = \sum\limits_{i = 1}^{c} {\sum\limits_{j = 1}^{n} {u_{ij}^{m} d_{ij}^{2} } }$$
(1)

Affiliations satisfy the condition,

$$\sum\limits_{i = 1}^{c} {u_{ij} } = 1,0 \le u_{ij} \le 1,i = 1,2,...,n$$
(2)

The algorithm obtains the clustering centers by minimizing the objective function, it is solved by the Lagrange multiplier method so that its minimum value satisfies the condition:

$$V_{i} = \frac{{\sum\nolimits_{j = 1}^{n} {u_{ij}^{m} } x_{i} }}{{\sum\nolimits_{j}^{n} {u_{ij}^{m} } }}$$
(3)
$$U_{ij} = \frac{1}{{\sum\nolimits_{k = 1}^{c} {(\frac{{d_{ij} }}{{d_{kj} }})^{{\frac{1}{m - 1}}} } }}$$
(4)

FCM algorithm steps as follows,

  1. (1)

    Initialize the number of clusters c, the fuzzy weighting index m, the generation selection stopping threshold ε > 0, and the number of generation selection t = 0 initialize the cluster center matrix V;

  2. (2)

    Calculate the affiliation matrix Ut + 1 using Eq. (4);

  3. (3)

    Compute the clustering center matrix Vt + 1 using Eq. (3);

  4. (4)

    If Ut + 1 − Ut < ε is satisfied, the algorithm stops and outputs the result, otherwise t = t + 1 and goes to step (2);

The clustering results of the drilling parameters based on the FCM algorithm are shown in the Fig. 4, the results show that the typical drilling parameters of rotational speed, drilling speed and drilling pressure are different for different formations, with obvious partitions, it can be concluded that the application of the clustering algorithm to the identification of formations in the drilling process is reliable and has obvious effects. The cluster center obtained by the clustering algorithm is the optimal drilling parameter for a certain formation.

Fig. 4
A. A 3 D scatterplot of drilling speed versus rotation speed versus bit pressure presents the data positions of sand and gravel layers, coal seam, rock stratum. B. A scatterplot of rotation speed versus bit pressure. The data points are arranged horizontally. C. A scatterplot of drilling speed versus bit pressure plots datapoints in patterns.

Clustering results

In the drilling process, through the clustering algorithm of the drilling parameters collected by the sensor (rotational speed, drilling pressure, drilling speed, etc.) to analyze and process the information of the current stratum, and then select the optimal rotational speed for the realization of adaptive control of rotational speed to provide the conditions.

4 Fuzzy Adaptive PID Control Strategy for Power Head Speed

When facing the nonlinear system and complex working conditions with variable parameters, PID control is less effective. Fuzzy control can control the nonlinear system without obtaining an accurate mathematical model, but the control accuracy is not satisfactory. The use of fuzzy adaptive PID control integrates the advantages of the two, and achieves the purpose of online adaptive adjustment of PID parameters, enhanced the control performance. The principle of fuzzy adaptive PID control is to take the error and the rate of change of the error as the input, through the rules obtained from expert experience, to establish the proportional, differential and integral three coefficients of the fuzzy control table for the control of the system [16], and its principle is shown in Fig. 5.

Fig. 5
A block diagram. Setpoint is connected to P I D controller, control object. It gives output value. The output value is connected to R P M sensor. Fuzzy controller connects to del K p, del K i, del K d and these are connected to P I D controller. e and e c are connected to fuzzy controller.

Fuzzy adaptive controller principle

In this paper, a typical two-dimensional fuzzy controller is used, the inputs are motor speed deviation e and the deviation change rate ec, and the three output parameters Kp, Ki and Kd are obtained through four processes: quantization, fuzzification, fuzzy inference and defuzzification. Set the fuzzy domain of input deviation e = [−3,3], deviation change rate ec = [−3,3], the fuzzy domain of output ΔKp = [−0.3,0.3], the fuzzy domain of ΔKi = [−0.06,0.06], and the fuzzy domain of ΔKd = [−3,3]. The input and output quantities are divided into seven fuzzy subsets {NB, NM, NS, ZO, PS, PM, PB}.

5 AMESim and Simulink Co-simulation

5.1 Control Modeling

Simulink is a modular graphical environment, a visual simulation tool used for model building and simulation analysis of results in many fields, with the advantages of clear structure and high efficiency. Moreover, MATLAB algorithms can be integrated into the model in Simulink, and the simulation results can be exported to MATLAB for further research and analysis [17].

In this paper, visual, MATLAB and AMESim are used. A joint simulation model is created in AMESim for simulation to generate S-functions [18]. In Simulink environment, the S-function is called and the simulation model is created. The control system built in Simulink is shown in Fig. 6.

Fig. 6
A block diagram. It consists of 6 blocks. The connection passes through derivative 1, fuzzy P I D, sim center A m e sim block, and memory 1 block to give the output. The output is received in scope 1.

Simulink model

5.2 Response Under Three Kinds of Rotational Speeds

Taking the rotational speeds of three different strata as input signals, by adjusting the three parameters of the fuzzy PID, the system can achieve a better control effect when KP = 0.1, Ki = 1, and Kd = 0. When the simulation time is 40 s, the response time is 2 s, the simulation results shown in Fig. 7.

Fig. 7
A line graph of rotation speed versus time for rock stratum, coal seam, and sand and gravel bed. The lines for sand and gravel bed and coal seam originate from (0, 0) and ascend vertically to 1400 rotations per minute, then decrease to 500 and 1000, and saturate. Rock stratum has a horizontal trend at 1400.

Three stratigraphic rotational speed responses

5.3 Speed Curve Tracking Characteristics

The drilling characteristics of different strata are different, in order to improve the drilling efficiency, it is necessary to make the dynamic response characteristics of the power head system is good, when the stratum change is the power head can real-time speed adjustment to adapt to different formations. The power head system uses sinusoidal signal and square wave signal as input signals to simulate the rotational speed change of different formations to observe the following effect of the power head, and it can be seen that the dynamic tracking effect of the speed is better through the adjustment of the three parameters of fuzzy PID. Figure 8 shows the opening of the valve port under the sinusoidal signal, and Fig. 9 shows the pressure change. Figure10 shows the following curves of power head speed under sinusoidal and square wave signals. Figure 11 shows the opening of the valve port under the square wave signal, and Fig. 12 shows the pressure change.

Fig. 8
A graph of amplitude versus time. It plots a sine wave curve that originates from ( 0, negative 40) and then fluctuates with the increase in time.

Valve opening with sinusoidal signal

Fig. 9
A graph of pressure versus time. It presents the variations of the pressure at port 3 with the increase in time. The curve originates from (0, 0) and fluctuates with double spikes.

Motor inlet pressure with sinusoidal signal

Fig. 10
Two multiline graphs of r versus time. A. It plots overlapping sinusoidal input and output signals. B. It plots square waveforms for sinusoidal input and output signals.

Power head speed tracking response

Fig. 11
A graph of amplitude versus time. It plots a square waveform that originates from (0, negative 47) and then fluctuates. Values are estimated.

Valve opening under square wave signal

Fig. 12
A graph of pressure versus time. It plots a waveform with alternating spikes and dips.

Motor inlet pressure under square wave signal

6 Conclusions

  1. (1)

    In this paper, the fuzzy clustering algorithm (FCM) clusters the drilling pressure, rotational speed, drilling speed and other parameters that follow the drilling, realizes the identification of strata, and takes the center of clustering as the optimal parameter for a certain stratum, which provides a solution for the automation of drilling rigs.

  2. (2)

    The fuzzy PID control strategy is used to control the rotational speed, and the clustering center is used as the optimal rotational speed for different strata. The simulation results show that when the simulation time is 40 s, the rotational speed of different strata is stable when the response time is 2 s, which provides the conditions to realize the smooth drilling process. At the same time, the dynamic response of the system was simulated and analyzed with sinusoidal and square wave signals as input signals, and the opening of the valve port and the change of pressure under sinusoidal signals were also analyzed.

  3. (3)

    Under the same PID parameters, the powerhead speed tracks the input signal better, both in the sine signal and in the square wave model. A smaller amount of overshooting, about 3.08%, was present only in the case of signaling mutations. The power head speed achieves a good speed curve tracking effect.