Rotation Speed Control of the Rotary Valve in MWD Tools Based on Speed Feedforward Compensation

-e rotary valve speed control, seriously affected by the nonlinear characteristic of rotary valve load torque, affects the generation of drilling fluid pressure phase shift keying (PSK) signal and its quality. -e calculation model feedforward of the load torque acts on the speed control system and enables the motor voltage to change according to the law of calculation model, and the linearization correction of the speed system is performed. Additionally, the flow measurement is introduced into the calculation model of the load torque to track the load torque change with the flow, suppressing the influence of large changes in flow rate on open-loop control of rotary valve speed. -e closed-loop proportional-integral-derivative (PID) control is formed by negative feedback of speed, and the PID parameter value rule is established based on the rapid decay control of transient component in the rotary valve speed step response, which speeds up the tracking of the rotary valve speed following the control voltage pulse and reduces the distortion of the drilling fluid pressure PSK signal, increasing the frequency of the drilling fluid pressure carrier and improving the transmission rate of downhole information. Simulink simulation indicates that the closed-loop PID control of rotary valve speed can track the change of control voltage pulse quickly and strongly suppress the interference influences from flow measurement error and load torque calculation model deviation.

Measurement while drilling (MWD) is used to guide the oil and gas drilling by measuring and transmitting downhole data in real time [1][2][3]. e continuous drilling fluid pressure technology, which transmits data at acoustic speed by sinusoidal drilling fluid pressure from rotary valve, is used in downhole data transmission and reaches relatively higher transmission rate [4][5][6]. e rotary valve is comprised of rotor and stator. When the rotor rotates, the rotary valve produces sinusoidal pressure carrier wave and modulates its phase to produce phase shift keying (PSK) pressure signal by changing the speed of rotary valve according to the voltage pulse changes based on the downhole data [7][8][9]. In this way, the measured data, carried by pressure carrier wave, are transmitted to wellhead and the speed of rotary valve should track the change of voltage pulse during the process to avoid serious signal distortion and reliability decline of data transmission. Research shows that the force acted on the rotor of rotary valve is affected by rotary angle, drilling fluid parameters, and orifice structure and makes its speed control quite difficult due to the force complicacy. With respect to speed control of rotary valve, a method using magnetic assistance force to accelerate motor speed response for phase shift keying modulation is proposed in literature [10]. e adaptive PD algorithm is used to control the motor speed by automatic adjusting PD parameters for reducing the impact of drilling fluid and its density on speed. Without considering the complicated nonlinear change from load torque when rotation angle changes, the rotary valve speed cannot follow the change of voltage pulse well. According to the literature, the rise time of rotary valve speed is as long as 33% of carrier wave period under step signal and the distortion of produced drilling fluid PSK pressure signal is 77%. e rapid servo control of rotary valve speed has emerged to be a crucial issue in MWD for its serious influence on signal quality of drilling fluid continuous pressure wave. e difficulty of rotating valve speed control comes from the nonlinear characteristics of its load torque and the influence of downhole environment, such as the vibration of the drill string, of which the former is the main influencing factor [11]. Based on the feedforward compensation method, the calculation model of rotary valve load torque acts on its nonlinear speed control system to make it linearized, and then, through the closed-loop PID speed control system which is formed by the negative feedback of the speed, the influence of PID parameters and interference factors on the speed control of the rotary valve is studied.

Nonlinear Correction of Rotary Valve Load
Torque by Feedforward Compensation

e Load Torque of Rotary
Valve. e rotary valve, installed in the drill collar above drill bit, is composed of stator and rotor, in which there exist the same numbers of holes and blades [12,13]. When the rotor rotates relative to the stator, the hole in the rotor is relative to the stator hole. During the movement, a valve hole with a variable flow area is formed, and the upper part of the valve hole produces a change in the pressure of the drilling fluid, which is transmitted to the wellhead in a fluctuating manner, and the voltage pulse formed by the MWD data quickly changes the speed of the rotary valve to modulate the pressure of the drilling fluid which can realize the upload of underground information. e rotary valve rotor is driven by a motor through a reducer [12,13]. e load torque of the rotor shows a serious nonlinear change with the rotation angle, and the calculation model is where Q is drilling fluid flow, ρ is drilling fluid density, b is constant term, a i represents polynomial coefficients, m is the number of polynomial terms, and θ is rotation angle. According to the equation n(t) � (1/2π) · (dθ/dt), we assume that the steady speed is n s , so there exists θ � 2πn s t. erefore, equation (1) can be transformed to be M L (t) � b + ρQ 2 a 0 + a 1 2πn s t + a 2 2πn s t 2 + a 3 2πn s t 3 + · · · + a m 2πn s t m . (2)

Analysis of Load Torque Effect on Rotary Valve Speed.
Because the rotary valve rotor is the load of the reducer, when the speed control signal is a step function, there must be a certain time delay in the rotary valve speed following the control signal due to the mechanical inertia of the motor system. e speed can be indicated as n(t) � n s (1 − e − (t/τ r ) ) when time constant is τ r . According to the equation . erefore, the load torque of the rotary valve transmitted to the reducer is at is, the load torque of the reducer has the same functional structure as the load torque of the rotary valve.
According to torque balance equation of electrical motor [13][14][15][16], the mathematical model of the speed control of rotary valve can be written as where U is control voltage of electrical motor, K e is electrical motor constant, r m is electrical motor internal resistance, J is moment of inertia, and k n is reduction ratio of reducer. In equation ( Since the load torque of the reducer M r (t) is a nonlinear function, the rotating valve speed control system is a nonlinear system accordingly. If the electrical motor is controlled by constant voltage, the speed control of the rotary valve will be tremendously affected by the nonlinearity of the load torque, causing the valve rotor to fail to rotate normally or severely stall.

Open-Loop Speed Control of Rotary Valve Based on
Nonlinear Compensation. In order to realize servo control of rotary valve speed, the linearized correction of rotary valve load torque effect using nonlinear compensation will be carried out, aiming to obtain constant control term of rotary valve speed at the right side of equation (4).
In equation (4), a new variable V, used as given angular acceleration, is introduced and defined as V � (K e U/2πr m Jk n ) − (M r (θ)/Jk 2 n ). en, the linear equation of rotational speed becomes [13] If rotary valve load torque M r (θ) approximately corresponds to calculation model of load torque M L (θ), in other words, M f � e and b m � d m , the electrical motor voltage can be derived by replacing M r (t) in given angular Equation (6) illustrates that equation (4) becomes a linear equation when electrical motor voltage varies according to the law M L (t).
From the Laplace transforms of equations (5) and (6), the control equations of rotation speed and electrical motor voltage can be derived as Equation (7) shows that the open-loop control system of rotary valve can be linearized by introducing motor voltage feedforward compensation in electrical motor driving system, and the Laplace transform of rotation speed is derived from it as follows: where is interference term of speed control from the difference between load torque in calculation model and that in practice. According to equation (7), the block diagram of open-loop speed control system of rotary valve is sketched in Figure 1.
Because of the quadratic relation between load torque of rotary valve and drilling fluid flow, rotary valve speed is highly sensitive to flow change. erefore, the real-time adjustment of motor control voltage by introducing measured flow to calculation model of load torque is used to compensate the speed change caused by influence of flow on practical load torque. Rotary valve and downhole turbine generator under it, tools of measurement while drilling, are installed in the same drill collar. When drilling fluid from rotary valve flows into turbine generator, the rotation speed of turbine generator exhibits an approximate linear dependence on drilling fluid flow [17,18]. Accordingly, the drilling fluid flow can be derived from voltage frequency of turbine generator.

Analysis of Interference Term in Rotation Speed Control.
Due to mechanical inertia, the time delay of rotary valve speed in following the step control signal is unavoidable; thus the interference arising from speed time constant is generally regarded as the inherent one. What is more, the speed control system is also affected by interferences from error of drilling fluid flow measurement and that of load torque calculation model. Consequently, the interference term R(s) of speed control mainly includes interference R 1 (s) arising from speed time constant, combined interference R 2 (s) caused by flow measurement error, and combined interference R 3 (s) caused by deviation of load torque calculation model.

Interference Caused by Speed Time Constant.
Based on the differential characteristic of Laplace transform, the Laplace transform of load torque calculation model is presented by b � e and a m � d m , the interference caused by speed time constant can be given by Motor driving , in other words, introducing difference value ΔQ in term M L (t), the relative flow measurement error (ΔQ/Q) will lead to the change of load torque calculation model M L (t) in form as ΔM L (t) � 2ρQ 2 (ΔQ/Q)[a 0 + a 1 2πn s t + a 2 (2πn s t) 2 + a 3 (2πn s t) 3 + · · · +a m (2πn s t) m ]. Hence, the combined interference caused by speed time constant and flow measurement error is written as

Combined Interference Caused by Speed Time Constant and Load Torque Calculation Model Error.
e difference between load torque calculation model and practical load torque, presented as the difference terms Δb and Δa i which are obtained by the term b and the polynomial coefficient a i in equation (2)  ΔM L (t) � Δb + ρQ 2 [Δa 0 + Δa 1 2πn s t +Δa 2 (2πn s t) 2 + Δa 3 (2πn s t) 3 + · · · + Δa m (2πn s t) m ].
en, the combined interference caused by speed time constant and error of load torque calculation model is given by When there exists speed time constant error, flow measurement error, and error of load torque calculation model, the terms ΔQ ≠ 0, Δb ≠ 0, and Δa i ≠ 0 emerge. As a result, there will be M L (s) ≠ M r (s).

Closed-Loop PID Control of Rotary
Valve Speed

Control Model.
To make sure the rotary valve speed can track the change of phase-modulated pulse and suppress the interference strongly, the closed-loop PID control system, generated by rotation speed feedback of linearized openloop speed control system, is introduced, and PID controller is added in forward channel of V(s) serially to realize the real-time adjustment and to enable the rotary valve speed reach the set value quickly and suppress the interference [19,20], as the block diagram shows in Figure 2 [13]. Based on Figure 2, the control equation can be given by where n(s) is the Laplace transform of speed control signal, G PID (s) � K p + K i /s + K d s is the transfer function of PID controller, K p is the proportional control factor, K i is the integral control factor, and K d is the derivative control factor [21]. By rearrangement of equation (12), the Laplace transform of rotary valve speed can be obtained as follows: where G(s) � (G 1 (s)G PID (s)/1 + G 1 (s)G PID (s)) is the transfer function of closed-loop control system of speed.
en, by residue calculation or inverse Laplace transform, the time response of rotary valve speed is given by

Value Determination Rule of PID Parameters.
e PID parameters of closed-loop control, K i , K p , and K d , have great influence on control effect and are generally determined by experience and test blindly [22]. e prime goal of rotary valve speed control is the quick following of control voltage pulse in conditions of large flow. To realize this, through speed response analysis of rotary valve when acted by step signal and without considering the interference caused by flow measurement error and load torque calculation model deviation, the PID parameter values determination rule based on transient component attenuating control is created.
According to equation (13), the rotation speed control signal is step signal and satisfies n(t) � kU(t), where U(t) � where , is rotation speed without interference, and n 2 (s) � (k/(K d +2π)) · (sR 1 (s)/(s − s 1 )(s − s 2 )) is rotation speed change component caused by interference R 1 (s). e rotation speed in time domain form can be obtained by calculating the inverse Laplace transform of equation (15) with residues method as follows: -

Mathematical Problems in Engineering
, and is time constant of transient component.
It can be seen that n 1 (t) is comprised of steady component k and transient component and n 2 (t) is comprised of transient components formed by e (− t/τ 1 ) , e (− t/τ 2 ) , e − t/τ r , and e − 2t/τ r . According to further mathematical analysis, when τ 1 approximately equals τ 2 as small as possible, n 2 (t) tends to be zero as soon as possible and the transient component of n 1 (t) does the same at the same time. erefore, the rotation speed reaches the steady speed n s � k.
We suppose that (τ 1 − τ 2 /τ 1 ) � Δ ≪ 1; then there is 2π) ) as small as possible, the 2π) is needed. By further mathematical calculation and established constraints, the value determination rule of K i , K p , and K d is presented by τ 1 and Δ as follows: If c 2 is known, the consuming time of rotation speed becomes steady and can be extremely reduced by determining PID parameter values with predetermined values of τ 1 and Δ.

Calculation and Simulation Analysis
In theoretical calculation, the rotation speed response can be obtained by residue method based on equation (13), and PID parameter values are determined by rules in equation (17). e closed-loop PID control simulation of rotary valve speed is carried out by the Simulink module in MATLAB. Calculation and simulation parameter values are listed below: τ 1 � 1ms, Δ � 0.01, proportional factor K p � 16928, integral factor K i � 10 7 , derivative factor K d � 3.82, speed time constant τ r � 1ms, motor constant K e � 0.83V · s, internal resistance of motor r m � 0.36Ω, moment of inertia J � 0.96 × 10 − 4 kg · m 2 , reduction ratio of reducer k n � 10, drilling fluid flow Q � 20L/s, and drilling fluid density ρ � 1100Kg/m 3 . Values from calculation are c 1 � 104, c 2 � 505s − 1 , and c 3 � 382. e rotation speed control function is step signal n � 5U(t)r · s − 1 , which produces drilling fluid carrier wave with frequency of 20 Hz and period of 50 ms.

3.1.
e Variation Law of Load Torque of Rotary Valve. According to equation (2), under the influence of the drilling fluid flow and its density, a plot of the load torque versus the time at Q � 20 L/s is shown in Figure 3. It can be seen that the load torque curve shows a serious nonlinear change. Since the load torque is related to the square of the drilling fluid flow rate, whose change will cause a large fluctuation of the load torque, if the nonlinear correction of the speed system and the closed-loop control of the speed are not performed, the disturbances such as the nonlinearity of the rotary valve load torque, the flow measurement error, and the deviation of model calculation will have a very serious impact on the speed control of the rotary valve.

Response Analysis on Speed Track of Step Input.
When only influence of rotation speed time constant exists, the step response of rotary valve speed reflects the track characteristic of speed and to what extent it can be controlled, and then R(s) in equation (13) equals R 1 (s). e theoretical calculation and simulation curves under step signal input are shown in Figure 4, from which it can be seen that theoretical calculation of step response is approximately consistent with its Simulink simulation and the correctness of theoretical analysis and mathematical modeling of rotary valve speed control are illustrated. Moreover, from simulation results, the rise time of rotation speed tracking step signal is less than 1 ms and the overshoot of speed is less than 1% of steady speed value. It is illustrated that the rotary valve speed can steadily track the change of step signal and gets stable fast when affected by inherent interference and the determination rule of PID parameter values is reasonable. e rise time of rotation speed from the above simulation is less than 2% of carrier wave period. In such a case, the distortion factor of differential phase shift keying (DPSK) pressure is 1.1% and that of the quadrature phase shift keying (QPSK) pressure is 8.6%, having little influence on signal quality, as theoretical calculation shows.

Simulation Analysis on Influence of Interference on Rotation Speed.
e simulation curve of rotary valve speed affected by flow measurement error is shown in Figure 5, from which it can be seen that flow measurement error has little influence on steady speed. When the relative error of flow measurement is 50%, the relative steady speed change is only 6% and it will be much smaller because the error is usually less than 10%. erefore, the closed-loop control system of speed can suppress the interference effectively. e interference R 3 (s) will be introduced if the error between load torque of calculation model and load torque in practice appears; Figure 6 is the simulation curve of the step input response of the rotary valve speed when the load torque calculation model of the rotary valve has deviations Δb and Δa i . It is illustrated in Figure 6 that the obvious deviation of load torque calculation model has little influence on speed control and the closed-loop control system of rotation speed has a certain fault-tolerant ability in load torque calculation model of rotary valve. rough theoretical calculation, the rise time of rotation speed value will be 3.2% of carrier wave period if signal distortion of drilling fluid QPSK is 10%. e above control performance (the rise time of speed is 1 ms) can modulate pressure carrier wave with frequency of 40 Hz in QPSK mode for high transmission efficiency and to implement data transmission rate of 20 bps.

Data Availability
All figures used to support the findings of this study are included within the article, and the raw data are available from the corresponding author upon reasonable request.

Conflicts of Interest
e authors declare no conflicts of interest.