Rate of Penetration Optimization using Moving Horizon Estimation

Increase of drilling safety and reduction of drilling operation costs, especially improvement of drilling efficiency, are two important considerations in the oil and gas industry. The rate of penetration (ROP, alternatively called as drilling speed) is a critical drilling parameter to evaluate and improve drilling safety and efficiency. ROP estimation has an important role in drilling optimization as well as interpretation of all stages of the well life cycle. In this paper, we use a moving horizon estimation (MHE) method to estimate ROP as well as other drilling parameters. In the MHE formulation the states are estimated by a forward simulation with a pre-estimating observer. Moreover, it considers the constraints of states/outputs in the MHE problem. It is shown that the estimation error is with input-to-state stability. Furthermore, the ROP optimization (to achieve minimum drilling cost/drilling energy) concerning with the efficient hole cleaning condition and downhole environmental stability is presented. The performance of the methodology is demonstrated by one case study.


Introduction
The oil and gas industry needs to reduce the operation cost and operate safely during drilling operations.Drilling optimization can mean different things, for instance it can be avoidance of drilling problems (poor hole cleaning, kick/lost circulation, pack-off ect.) or it means drilling as efficiently as possible (maximizing the drilling speed).In this paper, the main motivation is to improve drilling efficiency while maintaining good drilling operational environment in consideration of implementing control and optimization strategy.
Drilling parameters heavily affect drilling performances.If they are not adjusted properly, they will make the operation less efficient.Weight on bit (WOB), rotary speed (RPM), flow rate, bit hydraulics and more importantly the type of bits used, are the most important drilling factors affecting rate of penetration (ROP, alternatively drilling speed) and the drilling costs.Real time drilling parameters' manipulation forms the basis for an important methodology that considers past drilling data, predicts drilling trend and gives advice on optimum drilling parameters in order to save drilling costs and reduce the probability of encountering problems.Lots of studies have been performed for determining relationships between ROP and related drilling parameters.The main challenge is that the existing models might not be very accurate in predicting ROP.Some post-analyses possibly provide good prediction compared with historical data, but models have less ability to look ahead to future ROP.In this paper, an MHE method proposed by Sui and Johansen (2014) for the ROP estimation is employed.The reason of using MHE observer is that it can provide a high degree of robustness in the presence of modeling uncertainties since it is based on a batch of the most recent information/measurements.Moreover, the constraints of states and parameters can be naturally considered in the MHE problem, which may lead to the more accurate ROP estimation.Sui and Johansen (2014) proposed a novel MHE observer where the states are estimated by a forward simulation with a pre-estimating observer.Compared with standard MHE approaches, it has additional degrees of freedom to optimize the noise and disturbance filtering through the pre-estimator, see more discussions in Sui and Johansen (2014).
Hole cleaning efficiency is the ability of drilling fluids to transport and suspend drilled cuttings.Cuttings transport and hole cleaning efficiency are the prime concern and remain a vital challenge when planning and drilling wells.Several factors can influence hole cleaning efficiency, such as wellbore deviation and the percentage of time spent drilling, sliding or circulating, RPM, WOB, ROP and flow rate, etc.A cutting concentration C a is the key parameter of evaluating cuttings transport.It is recommended that the concentration of annular cuttings should be kept below some limit by volume (C a < 6% − 8%) for trouble-free drilling.Drilling pressure margin defines the operational pressure boundaries during drilling.In the oil industry, it primarily focuses on fluid pressures under various conditions.The downhole pressure should be managed within the drilling pressure range in order to prevent potential drilling problems, such as a well kick or lost circulation, possibly resulting in serious events, like blowouts.
In general the ROP optimization means that the drilling operational parameters, like WOB and RPM are manipulated to drill the present formation most efficiently.In this paper the optimization problem is formulated with respect to different drilling requirements, for instance minimizing drilling cost or mechanical specific energy while keeping efficient hole cleaning condition (C a < 6% − 8%) and managing downhole pressure within drilling pressure margin, which is achieved by manipulating WOB, RPM and circulation rate.Case study illustrates a good behavior of manipulating parameters like WOB and RPM in order to achieve the ROP optimization, that gives helpful decision support, improve drilling efficiency, and make safe drilling.

Moving horizon estimator
In the following, a linear discrete-time system is considered, where x t ∈ X ⊆ R nx , u t ∈ U ⊆ R nu and y t ∈ R ny are the state, the input and the measurement respectively.
ξ t ∈ R nx is an unknown state disturbance, η t ∈ R ny is a measurement noise vector and disturbances ξ t , η t are known only to the extent that they lie, respectively, in the polyhedral sets Ξ and Σ.It is assumed that: (A1) the pair (A, C) is observable.
(A2) X is a polyhedral set, and contains the origin in its interior.
The idea of MHE is to estimate the current states by solving a least squares optimization problem, which penalizes the deviation between the measurements and predicted outputs and possibly the distance from the estimated state and a priori information state.The basic strategy is to estimate the state using a moving window of data, such that the size of the data set used for estimation is fixed by looking at only a subset of the available information.At time t, the information vector is defined as where N is the window length or horizon.
where Π > 0, M > 0 are weight matrixes and L ∈ R nx×ny which satisfies ρ(Φ) < 1 (Φ := A − LC) and The optimal solution of (4) is defined by xo t−N,t and it yields the sequence of the state estimates xo i,t , i = t − N, . . ., t from (4b).It is assumed that the a priori estimate is determined from xo The estimation error is defined as Theorem 1 (Sui and Johansen, 2014) Suppose that Assumptions (A1)-(A3) hold.There always exist weight matrices Π > 0 and M > 0 such that the error e t is input-to-state stable (ISS).Moreover, when ξ t = 0 and η t = 0, t = 0, 1, . .., e t is exponentially stable.Proposition 1 (Sui and Johansen, 2014) Suppose that Assumptions (A1)-(A3) hold.If the weight matrices M, Π satisfy for some small Q 1 > 0, Q 2 > 0, then the estimated error e t is ISS, where In the paper, M is chosen as a symmetric matrix or M = M T .Then we have such that the inequality (8a) holds.The above inequality ( 9) is a linear matrix inequality (LMI) (Boyd et al., 1998), which can be efficiently solved with some existing toolboxes.Assuming all variables are reasonably scaled, we propose to choose the matrix Π such that and Π 1 is chosen to satisfy where ᾱ > 0 is a scalar tuning parameter and I nx is a n x dimensional identity matrix.Since the system is observable, it leads to where is the pseudo-inverse.According to (8b), ᾱ should be chosen such that ᾱI nx > M .Since the positive tuning parameter ᾱ is scalar, good tuning performance may depend on appropriate scaling of the state and output variables and the associated dynamic.Remark 1 The proposed MHE method (4) is applied in the paper to estimate ROP and other drilling parameters, where the estimation error can be proven to be input-to-state stable.Comparisons of the proposed MHE observers with other observers, like Luenberger observers and Kalman filters are given in Sui and Johansen (2014).Besides the proposed MHE method, other type of MHE estimation methods can also be applied to the problem to estimate ROP.

ROP model
ROP is an important drilling parameter for both drilling cost and efficiency.ROP is defined as the slope of the measured depth evaluated over a short time.It gives a snapshot perspective of how a particular formation is being drilled or how the drilling system is functioning under specific operational conditions.The mathematical expression of ROP is shown below: where h is the measured depth.Several ROP models were proposed in the recent 30 years.The simplest contains only a few parameters, while as many as twenty variables have been identified for the complex rock/bit interaction.In the study (Bourgoyne et al., 1984;Beck et al., 1995;Rupert et al., 1981), it is convenient to divide the factors which affect the ROP into the list: formation characteristics, mechanical factors (e.g.WOB, bit type and RPM), hydraulic factors, drilling fluid properties.Some models are derived from extensive laboratory investigations, and work well under controlled conditions.It is difficult, however, to extrapolate the results to field conditions due to the lack of data.The drilling process is very complex.There exists nearly no model that could accurately describe the drilling rate under all conditions.Two factors seem to have a major impact, namely the cuttings cleaning process and the drillability of the rock.To approach this problem, Warren Warren (1987) arrived at the following equation for the drilling rate, which is All parameters shown in this section are given in Table 1.The first term on the right hand side gives the maximum drilling rate.The second term relates to the mechanical efficiency of the drill bit, like tooth embedment, and the third term relates to the efficiency of the drilled cuttings transport.The hydraulic jet impact force, F , is given with the equation: where the factor A v is the ratio between the nozzle velocity and the return velocity of the drilling fluid.For the case of three equal nozzles, this expression becomes: In ( 14), the model did not take differential pressure into account, so the differential pressure term from Bourgoyne and Young's model (Bourgoyne et al., 1984) is added into the ROP model, which is: This term is directly multiplied to the drilling rate equation ( 14).Another critical consideration in this paper is the worn condition of drill bits, which naturally affects ROP.A composite tooth wear equation of roller-cone bits can be obtained by combining the relations approximating the effect of tooth geometry, bit weight and rotary speed on the rate of tooth wear (Bourgoyne and Yong, 1974), which is given by To take the bit worn condition into account, the term is multiplied to ROP model ( 14).Coefficient K represents the rock strength meaning the relative drillability of a rock under perfect cleaning conditions, which tends to vary during the drilling activity.The poor selection of drilling parameters might lead to degraded estimation performance.Here it is assumed that K = 0.
The three equations, ( 14), ( 17) and ( 19) constitute the basic ROP model.In summary, the drilling system can be formulated in the state space representation where the state x, input u and output y are given as Then the model becomes The nonlinear ROP model ( 23)-( 26) can be linearized around a solution (x 0 , u 0 ) which satisfies The perturbations in x, u and y can be defined as Then a linearized model is shown below where ν is added as unknown state disturbances and κ is added as a measurement noise; A, B, C can be expressed as This linear model ( 29) can be easily converted to the discrete-time expression shown in (1)-(2).
At time t, given measurements , solving the MHE problem (4), it can estimate R r , K and h b .The next sections will focus on the ROP optimization while maintaining good drilling operational environments.

Hole cleaning
Good hole cleaning refers to the efficient removal of drilling cuttings during drilling operations.For this condition to hold, many factors must be in place, such as cuttings size and density, hole size and angle, ROP, flow rate, cutting transport ratio and mud properties. where and the parameters used in this section are given in Table 2.The cuttings transport ratio, E t , can be calculated as, see Hyd ( 2006) where the mud velocity v m is determined by the mud flow rate Q and the cross area of wellbore, A w , or The cuttings slip velocity v s is defined as a flow velocity difference between cuttings and drilling fluid.It is related to inclination, cutting size, and mud weight.Its calculation is taken from Rudi Rubiandini (1999); Ranjbar (2010), where v s is described as follows: In ( 33), the uncorrected equivalent slip velocity vs is influenced by the drilling fluid property, cuttings transport velocity and wellbore geometry.It is calculated based on experimental data shown as follows vs = 0.00516µ a + 3.006 if µ a < 53, (34) where µ a is the apparent viscosity and calculated by In ( 33), the correction factor for inclination is calculated by the following expression: The cuttings size correction factor is expressed by: The mud weight correction factor is expressed by: In general, the cutting concentration C a by volume will result in hole cleaning problems, like mud rings and/or wellbore pack-off occurring if C a > 6%−8%.Normally C a should be less than some given boundary, or where τ c is determined with respect to specified formations/enviroments.Combining with equation ( 30) and ( 39), in order to achieve the efficient hole cleaning condition, it requires Together with ( 31)-( 33), the above nonlinear inequality can be simply expressed as follows where 40), it is easy to know that ROP should be within some range to keep the hole cleaning efficiency, otherwise the accumulation of cuttings might hinder the drilling speed, even result in the serious drilling risk, like packoff or stuck pipe.
5 Wellbore pressure margin To ensure safe and stable drilling operation, bottom hole pressure should be kept within some safe margin between pore and fracture pressure gradients.Exceeding the fracture pressure P f rac will fracture the rock formation, and there is a high risk of an underground blowout.If the pressure in the well is lower then the formation pressure P pore , it can lead to an unstable hole, where the walls fall onto the drill pipe.This can lead to a stuck pipe, or a twist-off, which is breaking the drill pipe.Bottom hole pressure consists of two components, the hydrostatic pressure P h and the dynamic fluid pressure loss P Loss .The hydrostatic pressure P h is calculated by where g is the gravitational acceleration constant.Frictional pressure loss is a function of several factors, such as flow rate, wellbore geometry and drill string configuration, fluid rheological behavior, flow regime and fluid properties.It could be described by the mathematical expression ( 42), where f is the friction factor and Re is Reynolds number.Friction factor depends on Re and the roughness of the pipe .Roughness of the pipe represents the pipe wall irregularities.The Reynolds number, Re, gives a measurement of the ratio of inertial forces to viscous forces.Over the years, the Reynolds number is the most important parameter to define the regime of a drilling fluid flow (laminar, transient, or turbulent).
With the correct units, Re is defined as For flow of a Newtonian fluid the flow is considered laminar if the Reynolds number is less than 2000, transitional from 2000 to 3000, and the turbulent for Reynolds numbers greater than 3000.The friction factor for laminar flow is related to Re by the following equation The friction factor for fully developed turbulent flow is described by to approximate the friction factor in this phase.The bottom hole pressure P bhp is then calculated by Therefore, to make the well safe and reduce the drilling risks, the bottom hole pressure should be within the P f rac and P pore , i.e.

Drilling optimization
In the real-time drilling process, although high ROP is desired, ROP optimization should be restricted to drilling safety and efficiency.The drilling speed should not seriously affect the borehole environment, maintain the high hole cleaning efficiency and keep bottom hole pressure within safe pressure window in order to avoid drilling risks, such as kick/lost circulation.Furthermore, the high ROP may damage the drill bit and create borehole instability.Main parameters which should be at most appropriate candidates for the ROP optimization, are WOB, RPM and flow rate.In the paper, we will focus on the optimal approach to regulate drilling parameters (N r , W, Q) to drill the present formation most efficiently.

Minimum drilling cost per foot
In order to study the optimization of the drilling process it is critical to identify the objective function of the problem.The drilling is usually paid on a per-day basis.Thus, the major concern when optimizing the drilling process is naturally to reduce the drilling cost.The calculation of cost per foot is conducted by the cost equation expressed as Bourgoyne et al. (1984) The total time of leasing the drilling rig consists of the drilling time, the time spent making pipe connections, and the total trip time.t d may be expressed as the formation interval drilled, divided by ROP The total time spent making connections to the drill string is a function of both formation interval and the constant connection time (t 0 c ).It is calculated as The total trip in/out time can be expressed as Then from ( 49), the cost function becomes (53) It is easy to know that the drilling cost, J 1 is inversely proportional to R r .Its optimization criterion of interest becomes to seek for the maximum drilling rate.

Minimum mechanical specific energy
The concept of Mechanical Specific Energy (MSE) was introduced by Teale in 1965 Teale (1965).Teale defined MSE as the mechanical energy and the efficiency of bits used to remove a unit volume of rock.In Teale, the MSE model was conducted based on scientific experimental results and shown as where T is the surface torque.From (54), MSE is a function of WOB, RPM, ROP, torque and bit diameter.Such relationship is a guideline to manipulate drilling operational parameters, such as WOB and RPM to optimize drilling performance in such a way that the process has maximum efficiency.Define In other words, the optimal criterion is to minimize MSE or J 2 by regulating WOB and RPM.

Predefined ROP trajectory
In section 6.1, the optimization criterion to minimize the drilling time can be easily converted to maximizing the drilling rate ROP, see equation ( 53).Alternatively ROP trajectory can be pre-defined with respect to designed drilling plan or can be real-time given based on drillers' experiences under different drilling circumstances.Therefore the optimization criteria becomes to manipulate WOB, RPM and flow rate to have realtime ROP approach to the defined ROP trajectory as close as possible.Then the cost function can be formulated as where R sp is the expected setpoint given by operators.

ROP optimization
From the above discussion, we ROP optimization is restricted to hole cleaning conditions and safety operations.In Section 4, the efficient hole cleaning condition is provided, see ( 40).Together with the non-negative limit of ROP, the boundary of ROP can be considered as The boundary of the bottom hole pressure to ensure the safe and stable drilling operation should be given as P pore < P bhp < P f rac , or The limits of WOB and RPM are also assumed as follows where W and W u are the given boundary of W OB; N r and N ru are the boundary of RPM.Therefore, the constraints of ROP , WOB and RPM, the bottom hole pressure are added into the following optimization problem.The formulation can be written as min Then, the ROP optimization can be summarized as below: Algorithm 1.
At time t, the information data set with N length, or 2. Solve the MHE problem (4) to estimate R r , K and h b .
3. Based on the estimated values, the ROP optimization problem (60) is solved.
4. The optimal solution W, N r , Q then is applied to the system. 5. Set t = t + 1, go to step 1.

Case study
In the simulation we select TOMLAB npsol algorithm using a BFGS Quasi-Newton method to solve the nonlinear optimization problem.

ROP estimation
), the MHE problem (4) can be solved to obtain the estimated h, h b and K. Then instantaneous ROP can be easily calculated from equation ( 14) regarding the estimated h, h b and K.The trajectory of instantaneous ROP is shown in Figure 2. The fractional tooth wear is shown in Figure 3. From Figure 2, we know that MHE observer has a good ability to estimate instantaneous ROP, especially predict the trend of ROP.Estimated ROP from the model is varying with the time and the drilling In the case study, the optimization criteria is chosen to minimize the cost function J 3 .Suppose the desired ROP trajectory is given as

Conclusions
This paper presents a modified ROP model with a state-space expression.In addition to the mechanical drilling parameters, hole cleaning situation and wellbore pressure stability.Constraints are included in the ROP optimization.The case gives a good example of optimizing well safety and cost with this optimization approach.Main advantages of the approach are: • Consider the effect of several drilling parameters on ROP.
• Optimally adjust the drilling parameters in order to improve the performance of the drilling.
• Realize the automation of drilling.
In the future the more accurate ROP model will be considered by using wired drill pipe data and the responding ROP optimization and correction will be further taken into account.

Figure 4 :
Figure 1: Measured depth used in the case study Figure 6: Manipulated RPM.

Table 3 :
Drilling parameters used in Section 6

Table 4 :
Values of drilling parameters in Section 7 In the optimization process, the hole cleaning efficiency and wellbore pressure stability issues are considered.The upper bound of RPM is set 21rad/s and the upper bound of WOB is 149KNewton.Figure5shows the trajectories of ROP.Figures6-7show the corresponding control variables, WOB and RPM which are solved by problem (60).During the time t ∈ [0, 2000s), the system has a good performance to manage ROP to approach the setpoint by regulating WOB and RPM.From the ROP model, we know that with the increase of the measured depth h, either WOB or RPM, or both of them should be increased to keep the constant ROP, which is shown in Figures6-7.At t = 2000s, WOB and RPM go to their upper bound, where ROP arrives at its highest value.Then with the time increasing, although WOB and RPM are kept at the maximum operational values, ROP values are decreasing due to the increase of the measured depth h.Then after t = 3000s, the system can approach the predefined ROP trajectory closely again since it has capacity to regulate WOB and RPM.