Using Mpc for Managed Pressure Drilling

As production on the Norwegian shelf enters tail production, drilling wells with vanishing pressure windows become more attractive. This motivates use of automatic control systems for improved control of downhole pressure using Managed Pressure Drilling (MPD) techniques. PID SISO control solutions for MPD are by now relatively standard, and well understood. This article explores the potential benefits of using linear Model Predictive Control (MPC) for MPD. It is shown that in combination with wired drill pipe, the downhole pressure can be controlled at multiple locations in the open wellbore, by using both pumps and choke in applied backpressure MPD. Also, downhole pressure constraints (pore and fracture pressures) fit naturally in MPC. Illustrative simulations are presented from using a high fidelity well simulator called WeMod, and Statoil's MPC software SEPTIC.


Introduction
Drilling for hydrocarbons is becoming increasingly difficult.One example is drilling near an already depleted reservoir.When a reservoir is depleted after a period of production, the nearby formations are affected.This can cause smaller pressure windows for the next well.Smaller pressure windows demand better pressure control.
Another example is the depth of new reservoirs, pressure and temperature increases with increasing depth.High pressure high temperature (HPHT) wells create new challenges to downhole pressure control.
When drilling in wide pressure margins, the pressure in the well while drilling can be set by an appropriate mud density.On the other hand, when increased pressure control is needed, managed pressure drilling (MPD) is a popular choice of drilling scheme.
Definitions, categories and variations of MPD are discussed in (Hannegan, 2006), (Rehm et al., 2008).A conventional set up for MPD can be illustrated (simplified) as in Figure 1.The key component is the choke.By adjusting the choke, the right amount of backpressure can be applied, which is the reason for the name applied backpressure MPD (ABP-MPD).The pressure in the well is then decided from the adjustable choke pressure as well as the mud density and flow rate.Manipulating the choke has a more rapid effect on the pressure in the well, which offers increased control.
The main variables which decide the pressure in the well (density, flow, choke) can be adjusted manually or automatically.Automatic control of the choke in ABP-MPD to control the pressure at the bottom of the well (BHP) has been explored in several studies, such as (Breyholtz, 2008), (Breyholtz, 2011), (Godhavn et al., 2011).When such a controller uses the choke to hold the BHP at a desired set point, the operator has more freedom to adjust flow and other variables connected to drilling a well.In (Godhavn et al., 2011) the automatic choke controller was tested on a full scale testing rig (Ullrigg).This test rig is comparable to Figure 1.Further automation has also been considered.The goal of further automation is twofold.On the one hand, more automation is expected to increase efficiency in any process.On the other hand, including more of the MPD equipment in automatic control can also allow precise control of the pressure in the well at two locations, which is very desirable.This has been explored in e.g.(Breyholtz and Nygaard, 2009), where a variation of MPD called dual-gradient MPD was considered.
Many different types of control solutions can be used to control the BHP by means of the choke.PID controllers are relatively standard.For ABP-MPD, gain-scheduled PI control with feed forward for the choke to control the BHP is a high performance controller in MPD operations (Godhavn et al., 2011).Any new controller for consideration in ABP-MPD needs to be able to compete with this, and/or offer something more.
Model predictive control (MPC) (Maciejowski, 2002) offers two very important additions over PID control; handling of constraints and handling several inputs and outputs at once (MIMO systems).Using MPC for ABP-MPD then offers the inclusion of controlling the pumps to better achieve control objectives by varying flow of mud.There are many constraints for an MPC to handle in MPD; the pressure boundaries in the well, max/min limits for the equipment, and so forth.Using MPC for MPD has been studied in e.g.(Breyholtz and Nygaard, 2009), (Breyholtz, 2011), and now (Møgster, 2013).
The main contribution of this article is to show, through mathematical deductions and computer simulations, that by using a MIMO MPC for ABP-MPD it is possible to control the pressure in the well at two locations at once.This is based on (Møgster, 2013).What differentiates the MPC in this article compared to others, is that control of two downhole pressures is accomplished, while using an industrial standard MPC tool with step response models (Strand and Sagli, 2003).This makes real world implementation plausible.
The outline of this article is as follows.First the ABP-MPD system will be presented.Second, the ability to control the pressure at two locations in the well will be argued.Third, the MPC will be presented, followed by its use in the computer simulations.
2 Applied Back Pressure -Managed Pressure Drilling ABP-MPD is a specific type oil well drilling system, which can be illustrated as in Figure 1.Such a system can be viewed as a closed system from the main mud pump with mud flow q p and pressure p p , down the drill string through a non-return-valve (NRV) where the bottomhole pressure (BHP) is measured, up the annulus and towards a rotating control device (RCD) and choke valve with valve opening z c (0-100%), flow q c and upstream pressure p c .When it is not desirable to drill further with the current pressure windows, steel casings are inserted and cemented in place.For these to be inserted, the entire drill string must be retracted.The circulating mud ensures that the cuttings from drilling are lifted to the surface and also manages the temperature in the well.
In conventional ABP-MPD, the flow q p and the choke is adjusted.PI control has been used before to automatically adjust the choke opening as to apply the right amount of back pressure to reach the desired BHP at the bottom of the well.
The pressure throughout the open wellbore, not just the BHP, must be within its constraints at all times.These constraints are often called pore-, fracture-and collapse pressure.The limits can be presented as in eq.
(1) with time t and position along the open wellbore given by the measured depth l. max (p collapse (t, l), p pore (t, l)) < p dh (t, l) < p f racture (t, l) (1) These constraints are important because violating them can be environmentally hazardous and in the worst case fatal.If the pressure in the well becomes too high, the well can fracture and allow drilling mud to escape.Low pressure can allow the well to collapse on itself, or allow influx.
The circulating flow q does also need to be within certain max/min limits.
The maximum limit for the flow is decided from the maximum flow that the mud pump can supply or the maximum flow that the shakers can receive in the other end.Shakers are used to clean the mud.The minimum flow limit is decided from the minimum flow needed to be able to lift cuttings to the surface.When measurements and other signals are communicated between the bottom and the surface by mud-pulsetelemetry (MPT), a minimum flow is required to do so.
As mentioned, the pressure in the well (often called downhole pressure) is given mainly from choke position, flow and mud density.This can be described mathematically as in (Kaasa et al., 2012) with measured depth l, average flow q, fluid viscosity µ and average density ρ as where p c is the adjustable choke pressure, F a (q, l, µ) is the frictional pressure drop in the annulus, and G a (l, ρ) is a term for the hydrostatic pressure at the location with measured depth l from the choke.The easiest way to express eq.( 3) is where an assumption of laminar flow in annulus, and an assumption that the flow resistance is equal in all sections of the well, leads to the linear term l l bit f a q for the frictional pressure drop in the well.The constant f a defines the pressure drop and needs to be identified by experimental testing, as done in e.g.(Møgster, 2013).The hydrostatic pressure term ρgh(l) consists of the average density for the mud in the annulus, gravitational acceleration, and the true vertical depth (TVD) connected to the measured depth l.It should be clear that Eq. ( 4) is significantly simplified.The frictional pressure drop in the well can not realistically be presented as a linear term.Furthermore, there are several other aspects of a well that influences the downhole environment, such as pipe rotation, eccentricity (the case where the drillpipe is not in the center of the annulus) and the shape of the well itself, to name a few.However, Eq. ( 4) should suffice for the purpose of this article to mathematically infer that two downhole pressures can be controlled at once by means of the choke and flow.
In this article, two downhole pressures (DHP) will be considered.These will be chosen as the pressure at the bit and at the end of the last casing shoe.The distance between the two locations will then be the length of the open wellbore, where the bit is located at the bottom.The two pressures can then be expressed as Both p dh (l bit ) and p dh (l cs ) need to be within their respective limits formed by eq. ( 1), but an even tighter pressure window might occur somewhere between the two locations.
Several technologies exist for measuring/estimating pressure in the well, e.g.MPT.Wired drill pipe (WDP) are drill pipes with pressure and temperature sensors, and an electrical interface to the surface (coaxial cable).An assumption in this article is that all the necessary downhole measurements are attainable by i.e. using WDP.

Controlling two downhole pressures
The effect of manipulating the choke, and manipulating the flow, can be illustrated as in Figure 2.This figure can be explained with eq. ( 5) and (6) in mind.The basis for the pressure in the well is the hydrostatic pressure, which increases with increasing TVD.By manipulating the choke, the pressure throughout the well can be increased evenly (with a time delay from top to bottom).Manipulating the flow can add pressure un-evenly; increasing the flow results in a greater pressure increase further down the well.The choke and flow can then be coordinated to achieve set-points for two downhole pressures as will be shown next.
Assuming the bit is at the bottom of the well, the measured depth l bit will be greater than l cs .From this we have that the term lcs l bit < 1 (and h cs ≤ h bit ).From eq. ( 5) and ( 6) it can then be seen that it is the case that increased flow has a greater effect at l bit than at l cs .
By coordinating choke and flow it is possible achieve set-points for both p dh (l bit ) and p dh (l cs ), to within the limits of p c and q.
To see this, consider eq. ( 5) and ( 6) in the matrix form y By choosing the input u as We have y = y ref .
This is possible when p c and q are within their limits and A is invertible.The determinant of A is ( lcs l bit − 1)f a , which is non-zero iff l cs = l bit .This means that the matrix A will be invertible, except for the trivial case when the two downhole locations are at the same measured depth.
When lcs l bit is close to 1, the difference in depth is small and the matrix A is close to singular.This may require a large input u, which is not good given the constraints on p c and q.The larger the difference between l cs and l bit , the better.
Example: Consider the well data in Table 1, f a = 4.0975e + 07 P as/m 3 , g = 9.8 m/s 2 and desired setpoints y ref = 269.25 bar 246.5 bar T .
From eq. ( 7) and ( 8) we find that the choke pressure and flow needed to achieve this is p c = 5.8 bar and q = 2172 l/min.Now, consider the scenario where we want to decrease the pressure at l cs by 0.5 bar, while keeping the pressure at l bit unchanged.By the same procedure the new set-points for choke and flow are p c = 1.9 bar and q = 2733 l/min.
The example shows that to decrease the pressure at l cs from 246.5 bar to 246 bar, the flow needed to be increased from 2172 l/min to q = 2733 l/min, while the choke pressure had to be adjusted down from p c = 5.8 bar to p c = 1.9 bar.This was achieved without changing the pressure at l bit .Half a bar is a small change compared to 561 l/min.This result is due to the short wellbore, that is, the length l bit − l cs was short in the example.
The difference between the two chosen downhole pressures defined as ∆p dh = p dh (l bit ) − p dh (l cs ) can be expressed as From eq. ( 9) it can be seen that the difference between the two DHPs is the hydrostatic pressure resulting from the column of mud reaching from bit to casing shoe, and the frictional pressure drop on the way from bit to casing shoe.It can be seen from eq. ( 9) that this difference can be manipulated by the density and flow.Also, the effect of such manipulation will be greater if the distance between the two locations of interest is large.Now that we know there exist combinations of choke and flow set-points which can achieve our desired  set-points for two DHPs, the next step is to design an automatic controller.
The simplest way is to keep the conventional PID controller which controls the BHP automatically with the choke, and add a second PID controller which will use the pump to control the other DHP.This is a crude solution and will not be satisfactory, see e.g.(Møgster, 2013) for simulations of PID vs. MPC.The problem is the strong coupling between the DHPs, which means that manipulating one affects the other, and that the tolerance for usage of the pump and choke is different.While the choke is fast to manipulate and rather accurate, the pump is not.This needs to be addressed in the controller.An MPC can handle these challenges very well.
One very important consideration when applying an MPC, is something called linearly independent constraint qualification (LICQ).This is connected to optimization theory (Nocedal and Wright, 2006).The MPC uses models of the DHPs to predict the future behavior of the system and calculate the next optimal input.The essence of LICQ in this regard, is that the MPC needs to be able to tell the difference between the DHPs.A discussion of this can be found in (Møgster, 2013), a solution is to tell the MPC to control one pressure and the difference between two pressures, i.e. eq. ( 5) and ( 9), instead of ( 5) and ( 6) .The improvement from this choice can be illustrated as in Figure 3.
The vectors illustrated in Figure 3 are the two rows of matrix A in eq. ( 7) connected to p dh (l bit ) and p dh (l cs ), and a third vector connected to ∆p dh in eq. ( 9) ([0, fa l bit (l bit − l cs )]).Simply put, the red-dashed line is easy to tell apart from the blue and blue-dashed line.By choosing to control p dh (l bit ) and ∆p dh , the MPC will have an easier job of controlling two DHPs.

Model Predictive Control
Model predictive control (MPC) is a controller scheme suited for systems with multiple inputs and outputs, important constraints on inputs and outputs, coupled effects, time delays, and more.Its weakness can be the time it needs to compute the next optimal input, and its complexity.The computation time is decreased by means of input blocking, evaluation points, and by using as simple models of the system as possible.
An MPC application uses models of the system at hand to predict future behavior.These models can be equations such as eq.( 5), ( 6) and ( 9), or systems on LTI form, or step response models.If non-linear models are used, the term is NMPC.It solves an optimization problem at each sample instant, in order to find the next optimal input.
The optimization problem for an MPC contains what is called weights and penalties.These are integers used to describe the cost of using the different inputs (pump, choke) and the relative importance of the different set-points and constraints for both the outputs and inputs.
A priority hierarchy is incorporated in most MPCs.The first priority is to respect the given maximum rate of change for the inputs.The second priority is to respect the max/min limits of the inputs (often hardware constraints).The following priorities are the set-points for outputs and inputs, and output constraints, which are sorted by i.e. giving them a number which constitutes their importance.
The above mentioned strengths of MPC are well known in the field of process control.These strengths are difficult to achieve with PID controllers.
To implement an MPC to control two DHPs in computer simulations, SEPTIC has been used.SEPTIC is an abbreviation for Statoil's Estimation and Prediction Tool for Identification and Control.It is an industrial MPC tool which has been in use by Statoil in connection with process industry for many years (Strand and Sagli, 2003).

Simulation set-up
For the simulations, a high-fidelity commercial well simulator from IRIS has been used.It simulates a well with key parameters described in Table 1.The open well section is 300 meters long from the last casing shoe to the bottom.The well is not vertical, so the difference in TVD is 144 meters.The interface for the simulator was written in Matlab, which communicated through an OPC server to SEPTIC.Matlab, SEPTIC and the OPC server was set to run on one normal PC.
The step-response models used for the MPC in SEP-TIC can be found in Figure 4.The models were generated by simply applying a step on the mud pump and recording the effects on the two downhole pressures.The same was done for the choke.In MPC terms, the manipulated variables (MV) are the mud pump and the choke, the controlled variables (CV) are the BHP and the difference between the BHP and the pressure at the last casing shoe, as discussed earlier in this article.The MVs and CVs are summed up in Table 2.As earlier stated, the effect of changing the flow influences the difference between the DHPs, this is backed up by inspection of the lower left step-response in Figure 4.
The scenario to be simulated is reference tracking for the casing shoe pressure, while keeping the BHP constant, and respecting all limits.

Results
The results of the simulations can be found in Figure 5 through Figure 9. Figure 5 shows the measured CV BHP to be within ±0.4 bars of its constant desired value throughout the simulation.Figure 9 shows the CV ∆p dh which is the difference between the BHP and CSP.

Discussion
The results show that the downhole pressure profile can be controlled while using MPC with step-response models.The pressure at the end of the last casing shoe was changed by up to 1.3 bars by automatically adjusting the flow.This was done with a low disturbance on the BHP.The change would be higher if the well was longer and if the flow limits were less stringent.The maximum CSP change divided by the length of the open wellbore was 0.004 bar/m.For comparison, in (Breyholtz and Nygaard, 2009) the comparable number was 0.006 bar/m.In (Breyholtz and Nygaard, 2009), the open wellbore was much longer and deeper, and dual gradient was used.
To keep the BHP error small, the coupled effect of choke and pump on the DHPs needs to be decoupled.This was achieved by the MPC with a maximum BHP error of 0.4 bars.Since the MV max/min limits had a higher priority than the CV set points, the highest/lowest CV set-points were not reached.This shows that SEPTIC respected the set MV limits, as it should.The ideal-value for the pump had the lowest priority and was not reached.This is because the degrees of freedom was 0 (two inputs minus two outputs), which means that MV ideal-values can not be reached without a compromise on the CV set-points.A compromise was not attempted since the ideal-value for the pump had a low priority.Such a priority hierarchy can also be used to monitor all DHPs measured by WDP.The hierarchy would then be set to ensure that the pore-and fracture-pressures are always respected at all locations, and then control two DHP set-points as is done here.
The usage of the MVs choke and pump, was low.Their usage was weighted in the MPC problem to achieve this.Low usage will prolong the lifespan of the equipment.The largest penalty was placed on the pump so that the more precise choke would take care of the faster dynamics.
All constraints were respected.More constraints could be added, even though the degrees of freedom would likely become negative, a priority hierarchy can prioritize limits and set-points.Handling of constraints is one of the key advantages of MPC.

Figure 1 :
Figure 1: Schematic of ABP-MPD.The mud flow is indicated by arrows.

Figure 3 :
Figure3: Vector illustration.The effect of flow q and choke pressure p c on the DHPs are similar, but the effect on the difference between them is more distinct.

Figure 4 :
Figure 4: Step response models.Top row: Effect of flow and choke on p dh (l bit ).Bottom row: Effect of flow and choke on ∆p dh .
Figure 5: Bottom hole pressure.The error is within 0.4 bars.

Figure 6 :
Figure 6: Casing shoe pressureFigure6shows the casing shoe pressure (CSP).It does not reach the highest and lowest reference pressure due to the minimum and maximum flow limits for the pump.Figures7 and 8show the mud flow rate and choke opening, respectively.Both these MVs have smooth transients.The flow limits are respected.

Figure 9 :
Figure 7: Main mud pump flow rate

Table 2 :
Manipulated and controlled variables for the CSP ref. tracking scenario.