MAKING FOR REGULATING ANNULUS BOTTOM HOLE PRESSURE WHILE DRILLING OIL WELLS

Real time measurements and development of sensor technology are research issues associated with robustness and safety during oil well drilling operations, making feasible the diagnosis of problems and the development of a regulatory strategy. The major objective of this paper is to use an experimental plant and also field data, collected from a basin operation, offshore Brazil, for implementing smart monitoring and decision making, in order to assure drilling inside operational window, despite the commonly observed disturbances that produce fluctuations in the well annulus bottom hole pressure. Using real time measurements, the performance of a continuous automated drilling unit is analyzed under a scenario of varying levels of rate of penetration; aiming pressure set point tracking (inside the operational drilling window) and also rejecting kick, a phenomenon that occurs when the annulus bottom hole pressure is inferior to the porous pressure, producing the migration of reservoir fluids into the annulus region. Finally, an empirical model was built, using real experimental data from offshore Brazil basins, enabling diagnosing and regulating a real drilling site by employing classic and advanced control strategies.


INTRODUCTION
A drilling process presents a rotating drill string which is placed into the well.A drilling fluid is pumped through the drill string and exits through the choke valve (Figure 1).There are many disturbances that produce fluctuations in the annulus pressure during oil well drilling.When the well is drilled, there are hydrostatic pressure increases because of the growth of the well length.A monitoring tool named mud-pulse telemetry pressure-while-drilling (PWD) gives the ECD (Equivalent Circulation Density) values while the pump is on and the ESD (Equivalent Static Density) measurement when the fluid circulation is interrupted.The ECD value is expected to increase gradually with the increase of well depth.However, abrupt increases in ECD or pressure peaks can indicate potential operational problems.In addition, fluid influx from the reservoir changes the well flow rate and the rheological properties of the fluid Brazilian Journal of Chemical Engineering mixture inside the well.Finally, the pipe connection procedure, which requires stopping and starting the pump, produces severe fluctuations in the well flow rates.The geometry of the well imposes a pressure gradient along the length due to the presence of the drilling fluid.The pressure balance between the well section and the reservoir is primordial for operation and security purposes.If the pressure in the well is higher than the pore pressure of the reservoir, the operation is called over-balanced drilling, which may induce lost circulation problems, however; if the pressure in the well is lower than the pore pressure of the reservoir, an under-balanced drilling mode is characterized, allowing the migration of the reservoir fluids into the well annulus, if the formations are permeable.The over-balanced drilling is the most used method for drilling oil wells, minimizing the risk of a blow-out, which produces the penetration of reservoir fluid into the well until reaching the surface.Most field cases, offshore Brazil, are drilled inside an operational window, possessing as constraints: pore pressure (minimum limit) and fracture pressure (maximum limit), which defines the mud density range.The under-balanced drilling mode, through a permeable formation, constitutes an operation mode through which reservoir fluids (oil/gas) penetrate continuously into the well, diluting and reducing the mud pressure, configuring a kick scenario, which might lead, if uncontrollable, to a gush at the wellhead (blowout).Different situations may produce kick and blowout: hydrostatic pressure of the mud inferior to the pore pressure of the reservoir, for maximizing penetration of the drill bit; occurrence of the swab effect due to the pipe connection procedure or due to the withdrawal procedure of the drill pipe; the reduction of the level of the mud in the annulus region due to lost circulation problems or malfunction in the procedure of the withdrawal of the drill pipe; improper monitoring of mud density reduction while drilling a gas formation (gas-cut mud).
Concerning the drilling process, maximizing the rate of penetration (ROP) into the well reduces the drilling cost, but increase cuttings production.An increase of solids concentration might produce the formation of a bed of cuttings (horizontal drilling) or increase the loading of cuttings (vertical drilling).Friction losses and flow rate are related straightforward and proportionally; however, a flow rate increase produces hole cleaning, reducing solids concentration.As a result, depending on the design of the well, one may observe an inverse response for the annulus bottom hole pressure, that is, as the flow rate increases, the annulus bottom hole pressure initially decays, due to the enhancement of hole cleaning, reducing solids concentration.Then, the annulus bottom hole pressure increases due to the increase of friction losses.The rheology plays a complex role concerning annulus bottom hole pressure, altering hole cleaning, friction losses and potentially producing pressure overshoots after the circulation stops.Considering dynamic conditions, a highly pseudoplastic nature is the desired behaviour for the drilling mud.
In order to assure drilling inside the operational window, there is a regulatory strategy for the annulus bottom hole pressure, which contains compression pressure, hydrostatic pressure, friction pressure loss, differential pressure across the choke and atmospheric pressure, despite process disturbances (Perez-Téllez et al., 2004).Traditionally, in normal drilling operations, the choke valve is adjusted manually.The fluid composition and pressures are evaluated based on steady-state values, and the choke valve is adjusted accordingly.The main problem of pressure control during drilling is that there are no measurements of pressure available during the periodic disturbance, namely the pipe connection procedure, when mud circulation stops.Wind et al. (2005) employed an electro-magnetic transmission system, which might have problems due to the signal attenuation in deep wells.Monitoring data from the tools known as mud-pulse-telemetry pressure-while-drilling (PWD) and mud logging are very efficient ways to implement process monitoring and control and also to anticipate drilling problems (hole cleaning, wellbore stability, fluid gelification, kick detection, breathing/ballooning, hydrates).In fact, the tools operate by sending monitoring data while the drill fluid is circulating.Reeves et al. (2005) developed a system which integrates, into the drill string, a signal cable, which, however, is disconnected during the pipe connection procedure.Jenner et al. (2004) developed a technique named continuous circulating system (CCS), based on a mechanical device able to continuously pump the drill fluids, even during pipe connections.Nygaard et al. (2006Nygaard et al. ( , 2011Nygaard et al. ( , 2013aNygaard et al. ( , 2013b) ) implemented classic and predictive controllers, through simulation studies, for under balanced drilling of a gas-liquid phase system, using the choke opening index as the manipulated variable in order to control the annulus bottom hole pressure.A new approach for pressure control, while drilling, is named Management Pressure Drilling -MPD.MPD creates a pressure profile for staying inside the operational window (i.e., pore pressure and fracture pressure), controlling frictional losses and hydrostatic pressure, (Fossli & Sangesland, 2006).
Real time measurements, development of sensor technology, mathematical modelling, optimization and control are tools that allow operating under the desired pressure levels, being associated with robustness and safety of drilling operations, making feasible the diagnosis of spurious situations and acting for regulation purposes.Thus, control and automation of drilling operations is a required activity for the future challenges of petroleum engineering, primordially under a scenario of narrow operational windows.A review indicates that most papers in the literature deal with intelligent monitoring (Alvarado et al, 2004;Mohaghegh, 2005;Nikravesh et al., 2002;Zhang, 2004;Sheremetov et al., 2005and Sheremetov et al., 2008, Hermann, 2014) without linkage with regulatory control studies.Nowadays, an expert operator monitors the annulus bottom hole pressure data and identifies undesirable events.
The relevance of the present paper is the construction of an experimental unit, which presents the most important characteristics of the drilling process, and using the experimental unit to validate smart monitoring and the decision making program, based on regulatory feedback control.As a result, the main objective of this paper is to perform automated drilling, assuring an annulus bottom hole pressure inside the operational drilling window, employing smart monitoring and decision making by selecting the appropriate input variable (manipulated variable).Scenarios concerning the rejection of disturbances on the rate of penetration (ROP), set point tracking of the annulus pressure, inside the operational window, and the kick phenomenon are implemented experimentally for analysing of the performance of the methodology developed.Finally, an empirical model was built, according to the methodology presented by Vega et al. (2008), providing a confident model based on neural networks for use in a real drilling environment, employing classic and advanced control schemes in the smart monitoring and decision making program.

THE EXPERIMENTAL DRILLING UNIT
The well drilling unit (Figure 2) was built using a drill string of 6 m, containing in-line sensors of flow and density (Metroval -RHM20), based on the Coriolis effect, and an in line pressure transducer (SMAR -LD301-M).A mud pump (Weatherford -6 HP), connected to a frequency inverter (WEG), a choke device (choke valve -ASCO -290PD-25MM) and valves of the butterfly type (Bray -series30/31), which are connected to the feeding tanks, are used to manipulate the experimental unit (input variables).All these input variables can change the annulus bottom hole pressure, which is the output variable of the program for smart monitoring and decision making.The unit has two feeding tanks containing water (8 ppg) and mud (15 ppg -pseudoplastic behaviour), making feasible injection of varying solid concentrations into the annulus through the butterfly valves (Bray -series30/31).This scenario represents the implementation of different rates of penetration.The idea is to use water in order to simulate the drilling fluids, and mud, to simulate the drill cuttings.This configuration allows the implementation of different rates of penetration, without using a bit or solids injection, since this would be a very difficult experimental task.Concerning the control of the experimental unit, different values of the rate of penetration can be implemented by varying the relative opening index of the butterfly valves, devices that can also be employed as manipulated variables in order to control bottom hole pressure.
The oil well drilling system is represented in the structure of the experimental unit, which has an annulus region, a pump, a choke valve and a drill bit, producing pseudosolids, experimentally implemented through regulating the feeding of water/mud, using the of butterfly-type valves.As a result, the solids injection is made directly by employing the mud tank.Different kinds of drilling phenomena can be captured in the experimental unit.The transient nature of the annulus bottom hole pressure, due to the inherent phenomena of the growth of the length of the well, the modifications in density and viscosity, affecting the hydrostatic pressure and frictional losses, Brazilian Journal of Chemical Engineering can be implemented using the feeding tanks containing water and mud.In fact, by feeding of the unit using the water tank and, after promoting the increasing of the mud content, recycling the exit of the unit to the water tank, makes feasible the study of increasing density levels.This scenario increases both frictional losses and the hydrostatic pressure.Besides, using mud to feed the unit and then increasing the water content through the butterfly valve enables a decrease of the density levels.This scenario reduces both frictional losses and the hydrostatic pressure.The pipe connection procedure can be implemented experimentally through executing the stopping and the starting of the pump.Also, the kick or the lost circulation problem (mud loss) can also be implemented experimentally, being detected through an increase or decrease of the annulus flow levels, respectively.

METHODOLOGY Experimental Aspects
A computational program, using C++ language, was written in order to monitor, diagnose and regulate the drilling unit, employing as output variable the annulus bottom hole pressure and, as input variables, the flow, the opening index of the choke valve and the indices of opening of the butterfly valves.
Several operational parameters and disturbances may impact the annulus bottom hole pressure of the well, such as rate of penetration, flow rate, rheology and the kick phenomenon.Experimental tests concerning rejection of disturbance (rate of penetration), tracking of the annulus pressure set point under increasing density levels, and kick disturbance are analysed in this paper.
For regulation purposes concerning the annulus bottom hole pressure, the fluid density and rate of penetration, actuated by modifying rheology and solid concentration in the annulus region, can be employed.However, these manipulated variables do not alter the annulus bottom hole pressure at the same velocity, due to the nature of the system to be distributed, which presents a large dead time for mud density changes.The rate of penetration is improper for regulation purposes when the pipe connection procedure occurs, due to the requirement of stopping the drill bit.In fact, concerning the rate of penetration, the main objective during drilling is maximizing its value, which reduces costs.Modifying the choke opening index strongly alters the annulus bottom hole pressure and can impact the intrinsic nature of the drilling well, which may act as an open-closed system.Using the mechanical apparatus reported by Jenner et al. (2004), the mud flow is another intended candidate for a manipulated variable, impacting the annulus bottom hole pressure due to frictional losses and also altering the residence time of the mud, modifying well cleaning.As a result, depending on the smart monitoring diagnosing tool, which classifies the specific scenario and provides the severity of the problem during oil well drilling, the selection of the manipulated variable is ROP, flow or choke device, in this sequence, to the extent that the regulation problem becomes more infringing.

Identification
In order to build an experimental regulation scheme for the annulus bottom hole pressure, a mathematical model for the drilling plant is required.The development of a rigorous mathematical model may not be feasible for complex processes involving a large number of differential equations and unknown parameters (physical and chemical properties).The identification through a transfer function of low order (first-order plus dead time, estimating the steadystate gain k, the time constant τ and the dead time td) has proved to be a useful tool and is the most popular framework for empirical model development for the purpose of classic controller synthesis.The methods of reaction curve (Ziegler-Nichols, 1942)

and Sundaresan
Brazilian Journal of Chemical Engineering Vol. 33, No. 04, pp. 969 -983, October -December, 2016& Krisnaswany (1977) were employed in order to identify the oil well drilling unit.
Concerning nonlinear modelling, the approach using neural networks (NN) is a popular strategy for empirical model development, even though the estimate of the many parameters can often be regarded as a difficult problem to be solved (Mönnigmann et al., 2002;Paladino et al., 2000).Vega et al. (2008) developed investigations on systematic techniques for nonlinear model identification, using bifurcation diagrams, the characterization of the amount and type of process data required to build nonlinear empirical models with satisfactory predictive capability and the selection of nonlinear model structures, which are capable of capturing a wide variety of behaviours.
Concerning empirical modelling, the neural networks were validated in terms of the traditional methods (Pollard et al., 1992;Sriniwas et al., 1995) and in terms of their complex static and dynamic behaviour, using bifurcation and stability analysis.As observed through many examples (Vega et al., 2008) the use of traditional validation tests is not enough to guarantee the successful use of neural networks for monitoring and control purposes, because model and plant can present distinct behaviours.The comparison between the bifurcation diagrams of model and plant, using the AUTO (Doedel, 2007), assures a good performance criterion for nonlinear identification purposes.As a result, bifurcation techniques are used to allow the development of confident neural network models, based on experimental data provided by PWD and mud logging from offshore Brazil basins.It is shown that the bifurcation and stability analysis of the neural networks can be very helpful for appropriate development and implementation of the empirical model in real time problems for diagnosis and disturbance rejection purposes.
System stability analysis under parameter changes is unveiled by bifurcation theory.Non linear processes might present multiple steady states, sustained oscillations and travelling waves under parametric changes (Ray and Villa, 2000).The validation of the NNs, using the methodology of Vega et al. (2008), based on bifurcation and stability analyses, employed well-known continuation methods.For the neural network discrete model, the stability characteristics are determined by the eigenvalues of the Jacobian matrix of the nonlinear map, relating past and present data with the future output of the process.The steady states are stable if all eigenvalues of the Jacobian matrix (Floquet multipliers) are inside the unitary circle; otherwise, if any of the eigenvalues is located outside the unitary circle, the steadystate solution is unstable.
A three-layer feed forward NN was built, using hyperbolic tangent and linear activation functions for the hidden and output layers, respectively.The input layer contained 28 neurons, i.e., the neural network inputs contained present time data and past time information concerning: time, hole depth, depth, TVD (true vertical depth), inclination, internal pressure, annulus pressure, block position, temperature, weight on bit, RPM, torque, stand pipe pressure and flow.These data were employed to build the dynamic non linear map, since the equivalent circulating density (ECD), the neural network output, depends on those real time data provided by PWD and mud logging (neural network inputs).In accordance with standard cross-validation procedures (Pollard et al., 1992), a hidden layer with an optimal number of neurons (seven neurons) was selected.In order to build the neural network model, two independent data sets (training and validation sets), containing 5000 data points each set, were employed.As discussed by Pollard et al. (1992), the cross-validation training method minimizes the problem of over fitting.
The influence of the initial guesses of the parameters of the NN, during the training phase, on the resulting dynamic behaviour was also investigated.It was observed that the particular bifurcation diagrams obtained depend on the initial guesses.However, in all cases, the bifurcation patterns observed were qualitatively similar.Besides, the choice of the activation function of the neurons was also studied.Both sigmoidal and hyperbolic tangent functions led to very similar bifurcation patterns.

Control
The schemes implemented inside the control module of the program of smart monitoring and decision making were classic feedback and nonlinear model predictive control.Classic feedback control and nonlinear model predictive control were synthesized in order to regulate ECD, as the main objective is drilling inside the operational window, that is, above porous pressure and below fracture pressure.Ray (1983) and Luyben (1990) pointed out that classic feedback PID controllers (Seborg et al., 2011) have been successfully employed under the majority of process conditions.The review papers by Embiruçu et al. (1996), Richalet et al. (1978), Garcia et al. (1989), Qin and Badgwell (1996), Rodrigues and Odloak (2003), Karra et al. (2008), Dittmar et al. (2012) and Beschi et al., (2014) referred to successful classic controllers implemented in complex systems, representing real industrial processes.Predictive control is a class of control algorithms in which Brazilian Journal of Chemical Engineering a dynamic process model is used to predict and optimize system performance.The first predictive control techniques were developed after 1970 driven by the inability of classical controllers to meet the criteria of increasingly demanding performances (Garcia et al., 1989, Huyck et al., 2014).
In this work, classic controller tuning approaches developed by Ziegler-Nichols (1942) and Cohen-Coon (1953) were employed.Identification of the plant along the entire operational range allows the use of the gain scheduling approach, providing a satisfactory control for each different point of system operation.Thus, the linear control system becomes more robust, compensating the nonlinearity of the process by employing distinct controller parameters for each operational condition (Ramirez-Garduno and Lee, 2007).
The nonlinear predictive control (NMPC) is an advanced control strategy based on a nonlinear model.In recent years, the NMPC is gaining prominence in industry for being able to deal with nonlinearities, employing phenomenological models or nonlinear empirical models and, simultaneously, solving the control problem and the dynamic real-time optimization, satisfying constraints for state variables and manipulated variables.However, the NMPC meets resistance from part of the industry because of the difficulty of implementation.Apart from the difficulty of modelling, there is also the complexity of the algorithm itself.However, the benefits of applying this class of controllers for processes with large nonlinearities have been widely reported in the literature (Manenti, 2011).The optimization routine calculates the control actions (control horizon) and evaluates the response of the model along the prediction horizon.As the prediction horizon is greater than the control horizon, the last control action is repeated until the calculated value of the prediction horizon is achieved.The formulation of the predictive control is a problem of nonlinear programming with nonlinear constraints (Meadows et al., 1997).
For predictive control purposes, a sequence of control actions is calculated to minimize an objective function that includes future values of the output variables, based on the model of the process.The solution of the optimization problem is subject to constraints on the input and output variables and also constraints imposed by the model equations.This formulation generates an optimal controller in open loop.The feedback is included by implementing the manipulated inputs calculated for the present moment, and then the prediction horizon is shifted one step forward; the solving of the problem then uses new measures of the process (Henson, 1998).
Predictive control can deal explicitly with the various changes that affect the process, as it incorporates its mathematical model, interconnections, and physical and economic constraints.In the case of operation under different conditions, the process model must be able to handle the different regions of operation.
In the formulation of predictive controllers, the tuning parameters are the control horizon, the prediction horizon and the weights matrix of the objective function.For a fixed prediction horizon, a small control horizon generates more conservative actions for the manipulated variables and slower responses to the output variables; it is noteworthy that a greater control horizon produces the opposite effect.Because that the control horizon is linearly related to the number of decision variables, for the problem of nonlinear programming, a greater control horizon leads to a big computational effort.Using larger prediction horizon, similar to the control horizon effect, produces a more aggressive control and increases the computational effort required.The weights matrix depends on the scale used in the problem under investigation.Typically, they are diagonal matrices with positive elements.The magnitude of the diagonal elements depends on the scale used and the relative importance between the variables.Meadows et al. (1997) defined the non-linear programming problem according to Eq. ( 1).The objective function J(K) should be minimized by manipulating the optimization variable u, which is the vector of control actions.This objective function consists of two terms: the first minimizes the difference between the controlled variable and its set point, the second minimizes the difference between the control actions calculated at time k, k 1, k 2, k 3,..., + + + producing a smooth effect on the profile of the control actions.There is also a strict restriction to u Δ , which ensures maximum and minimum variations between each sampling time.
( ) Constraints for i k, ,k P 1 = + + : The neural network model, trained with real drilling data from offshore Brazil basins, was employed as the internal model of a model-based control strategy (nonlinear predictive control).It is noteworthy that detailed knowledge of the process is not necessary for purposes of empirical modelling, which is very attractive for complex industrial systems.In addition, the non-linear problem to be solved in closed loop, every sampling time, has complexity in accordance with the structure of the non-linear empirical model adopted.Su et al. (1997) stated that NNs are the structures most frequently used for the purpose of building empirical models, being appropriate for predicting process output, requiring small CPU time.

Scenarios Discussion
A methodology using real time monitoring was built for diagnosing and implementing decision making for both experimental and offshore drilling sites.A computational program was developed in order to provide safe drilling inside the operational window.Different scenarios can be analyzed and qualitative/quantitative actions are recommended in order to regulate annulus bottom hole pressure and ECD.The output variable, annulus bottom hole pressure or ECD, is impacted by the solids travelling in the annulus region, which alters the hydrostatic pressure; by solids forming a cuttings bed in high inclined sections; by modifications in the rate of penetration during oil well drilling; by the depth increase of the oil well; by pipe rotation and by changes in flow rate and in rheology.
As a result, in order to avoid the lost circulation problem, stuck pipe, barite sag, kicks, pressure peaks, and hole cleaning problems, a smart-monitoring computational program was developed in order to diagnose potential problems and indicate alternative actions, minimizing the disturbance effects and regulating the drilling process, assuring operation inside a safe envelope (operational window).Figure 3 presents the methodology for diagnosing and regulating the output variable (annulus bottom hole pressure or ECD) in a typical drilling operational window, that is, above porous pressure and below fracture pressure.For over-balanced drilling operation, the computational program, using real time monitoring and estimating porous and fracture pressures, indicates, in the case that the pressure level is inside the safe range, a message informing that the pressure is inside the safe region, which constitutes the operational window.
If seepage is detected, the preferred input variable is ROP.Experimental changes in ROP are implemented by modifying the relative opening index of the butterfly valves, altering the solids injection in the annulus region.The changes in ROP are associated with slow actions, being appropriate for cases where the output variable is situated 20% below fracture pressure and 20% above porous pressure.
Fast input variables, i.e., flow and choke opening index are recommended under a partial loss scenario and if the output variable is outside the range comprising 20% below fracture pressure and 20% above porous pressure.If the safe range is not achieved, a density change is suggested for the inlet drilling fluid.
Total loss situations are managed through recommending the injection of loss circulating materials, Brazilian Journal of Chemical Engineering such as mica or CaCO 3 .In the case of a more severe scenario, squeezing a cement plug is advised.Finally, critical measures include emergency casing.
The in-line measurements of pressure, flow and density are the monitoring tools for diagnosing the experimental drilling unit operation.The in-line pressure sensor provides, in real time, the output variable (annulus bottom hole pressure), a primordial information for the feedback control loop, which is the configuration employed by the decision-making program.The flow sensor can diagnose pipe connection procedures, the kick phenomenon and lost circulation problems.The density sensor is able to detect the phenomena of kick, barite sag, cleaning problems and disturbances in the rate of penetration.
The routine of decision making comprises a program module containing proportional-integral control and nonlinear model predictive control, allowing variation of the output variable inside a safe operational range.In the decision-making module, set point tracking is imposed through the movements of the manipulated variable, according to the controller parameters, which feed the computational program developed in C++ language.The experimental drilling plant is remotely operated, using a sampling time of 0.1 seconds.Depending on loss severity, different input (manipulated) variables are selected.In fact, if seepage is detected, the choice is to use ROP as the manipulated variable.A detection of a partial loss indicates the use, as input variables, of pump flow and/or choke opening index.Under a scenario of total loss, changing of the inlet density of the drilling fluid is advised, with injection of lost circulation materials, squeezing cement plugs and performing emergency casing.
For the purpose of regulation in real time, nonlinear analysis, plant identification and controller parameter estimation were performed for different operational levels.Concerning the project of the classic controller, which is inside the program module of decision making, proportional and integral actions were selected.The proportional mode makes immediate corrective action, as soon as the error is detected.The integral control action eliminates offset, but generates fluctuations in the controlled variable, reducing system stability.However, a limited amount of oscillation can be tolerated, as it is often associated with a faster response.Because the measured variable of the drilling experimental unit has noise, the derivative action was not included in order to avoid noise amplification.There are several methods for tuning a control loop, which involve the development of some form of process model.The most common tuning method requires the subjecting of the system to a step change in the input, then measure the output as a function of time (process reaction curve), and use this response to determine the control parameters.The reaction curve methodology was built for representing the experimental unit of oil well drilling by a transfer function model (first-order plus dead-time), Table 1.The tuning parameters, Table 2, for different operational levels were calculated through the tuning strategies of Ziegler-Nichols (1942) and Cohen-Coon (1953).In order to identify the plant and select the tuning parameters, different levels of frequency (30-60Hz) and choke opening indexes (25%-95%) were employed, comprising the entire operational range of the mud pump and the choke valve, as can be observed in Tables 1-2.For identification purposes, the magnitude of the step disturbance, applied to the choke opening index and to the pump flow were: 95-25%, 95-35%, 95-55% and 15-30 Hz, 15-40 Hz, 15-50 Hz, 15-60 Hz, respectively.As can be observed in Table 1, the magnitude and the shape of the output variable (annulus bottom hole pressure) depend on the magnitude of the step disturbance implemented in the input variable, indicating that the experimental unit presents a nonlinear behaviour.In fact, the time constant and the steady state gain depend on the operational level.In addition, when the choke opening index is decreased and the flow rate increases, the experimental plant presents the more pronounced nonlinear response.As a result, controller tuning parameters were obtained for the entire range of process conditions, in order to manage the nonlinearity of the system and implement classic PI control (Table 2), using the gain scheduling approach.
In order to analyse the performance of the smart monitoring program and decision making using drilling real data from offshore Brazil basins, the tools: PWD and mud logging were employed.A three-layer feed-forward NN was built, using hyperbolic tangent and linear activation functions in the hidden and output layers, respectively.The 28x7x1 architecture was used to build the dynamic map, since it is assumed that the equivalent circulating density (ECD) depends on actual and past values of time, hole depth, depth, TVD (true vertical depth), inclination, internal pressure, annular pressure, block position, temperature, weight on bit, RPM, torque, stand pipe pressure and flow.Besides, these values may be easily evaluated in-line with PWD measurements and mud logging.
The smart monitoring program and decision making contained a control module that regulates the process output (ECD), using the classic feedback controller or the nonlinear model predictive control-Brazilian Journal of Chemical Engineering Vol. 33, No. 04, pp. 969 -983, October -December, 2016 ler.The classic controller parameters were estimated using Cohen-Coon (1953) and Ziegler-Nichols (1942) methods (Table 2).In the formulation of predictive controllers, the tuning parameters are the control horizon (M=2) and the prediction horizon (P=4).A maximum variation of ± 5 Hz between each sampling time was employed in order to impose real limits of site operation, concerning mud pump constraints.

Experiments
In order to illustrate the methodology of the smart monitoring and the diagnosing tool, experimental tests were performed without implementing the suggested corrective actions that would regulate the annulus bottom hole pressure of the experimental drilling unit.As a result, evolutions of events beginning Brazilian Journal of Chemical Engineering from seepage until attaining a total loss are observed.As illustrated in Figure 4a, the monitoring program indicates that the process is operating regularly, inside the operational window.Next, a disturbance is detected, which produces an increase of annulus bottom hole pressure; as a result, the program suggests reducing the rate of penetration, Figure 4b.The corrective action was not implemented and a partial loss was detected; as a result, the methodology indicates that the choke valve opening index must be increased and/or the pump flow rate must be decreased (Figure 4c).The last scenario presents the suggestions of the program concerning operation outside the safe pressure envelope (above fracture pressure), indicating that fluid density must be reduced and lost circulating material should be introduced into the system; moreover, some critical measurements may also be necessary, like for example squeezing a cement plug (Figure 4d).
Figures 5-7 illustrate the experimental drilling unit implementations of the smart monitoring and decision making, under different scenarios, namely, rejection of load disturbance (ROP perturbation), drilling inside the operational window, the region in between the pore pressure (minimum limit) and the fracture pressure (maximum limit) and the kick phenomenon.
An experimental drilling unit test was performed in order to employ the tool for diagnosing and decision making implemented at the automated drilling unit.An operational window, placed above the porous pressure (20 psi) and below the fracture pressure (55 psi), characterizing an overbalanced drilling scenario, is the constraint imposed on the annulus bottom hole pressure.
The aim of the regulatory control test is to analyse the performance of the closed loop to reject a disturbance, previously detected by the smart monitoring diagnosing tool, employing the manipulated variable (ROP, pump flow or choke valve opening index).The regulatory control test (rejection of load disturbance) was implemented through introducing a perturbation in the rate of penetration, which was experimentally produced by changing the drilling fluid density: water (8 ppg) to drilling mud (15 ppg).As a result, the use of a higher rate of penetration, detected through measuring the annulus density (Figure 5a), produced a higher solids concentration in the annulus region, which increases annulus pressure.The smart monitoring program detected a partial loss and the choke opening index was employed as the input variable for regulating purposes.As can be observed in Figure 5b, after attaining steady state conditions, inside the safe range of the operational window, an annulus bottom hole pressure increase was detected after 2 minutes of operation, which was produced by the higher rate of penetration adopted.The smart monitoring program suggested manipulation of the choke valve device in order to minimize the disturbance, because a partial loss severity was detected.As can be observed, the feedback control scheme successfully regulated the annulus bottom hole pressure by increasing the choke valve opening index (Figure 5c).Next, a variable operational window, with the porous pressure ranging from 3.5-35 psi and the fracture pressure ranging from 50-110 psi, under an overbalanced drilling scenario, is the constraint of the servo analysis, implemented in the drilling experimental unit, whose aim is tracking the desired value for the annulus bottom hole pressure.Simultaneously, disturbance rejection is analysed based on the tool of smart monitoring and diagnosis, which detects increasing density levels.This load disturbance was implemented, experimentally, by increasing the index of opening of the butterfly valve connected to the mud tank (15 ppg) and, simultaneously, by decreasing the index of opening of the butterfly valve connected to the water tank (8 ppg).Figure 6 presents an experimental test concerning drilling inside the operational window, under a scenario of increasing values of the rate of penetration, which produce increasing annulus density values.In fact, the ROP modifies the solids concentration and might produce the formation of a bed of cuttings (horizontal drilling -high angle) or increase the loading of cuttings (vertical drilling -low angle).During oil well drilling, the pore pressure (minimum limit) and the fracture pressure (maximum limit) are the limits that define the mud density range.As a result, the drilling fluid hydrostatic pressure needs to be higher than the pore pressure, in order to avoid formation fluid invasion into the well.Simultaneously, the drilling fluid hydrostatic pressure needs to be smaller than the fracture pressure, avoiding formation damage.When the smart monitoring program detected a partial loss, the choke valve device is employed as the manipulated variable, successfully tracking the desired value of the annulus bottom hole pressure, despite the disturbances imposed by ROP variations.

CONCLUSIONS
An experimental unit was built for analyzing recurrent scenarios that occur during the oil well drilling process.The experimental plant contains sensors in-line: flow, density (Metroval -RHM20) and pressure transducer (SMAR -LD301-M), for disturbance detection purposes.Two butterfly valves (Bray -series30/31), connected to the feeding tanks, a mud pump (Weatherford -6 HP) and a choke valve (ASCO -290PD-25MM) are the candidates for being employed as input variables (manipulated variables), for annulus bottom hole pressure regulating purposes.
A smart monitoring program was built based on in-line sensors.The decision making tool employed classic feedback control and NMPC structures for regulating the process output.
In order to assure the drilling operation, using as constraint a pressure inside the safe envelope, various manipulated variables can be employed, depending on loss severity (seepage, partial loss or total loss).A nonlinear analysis, plant identification and parameter controller estimation were implemented, including classic and advanced control techniques.The smart monitoring program and decision making was implemented in order to guarantee drilling inside the operational window and also to reject disturbances (fluctuations in the rate of penetration).
A kick experimental test was implemented in the drilling unit through injecting liquid and gas into the annulus region.The smart monitoring device identified an annulus flow increase, followed by an annulus bottom hole pressure increase.The shutting procedure was suggested by the program.After the annulus pressure stabilization, additional influxes were avoided, as indicated by the flow/density sensor in the annulus region.
First-order plus dead-time transfer function models were employed for a classic feedback control loop.A neural network model was identified using real drilling data from the tools: Mud logging and PWD.Besides, a nonlinear identification was performed based on traditional validation procedures, bifurcation and stability analysis.The neural network model was employed as the internal model of an advanced control scheme (NMPC) in order to regulate the ECD, using pump flow as the manipulated variable.The nonlinear predictive controller presented faster disturbance rejection than the classic feedback controller.Finally, the smart monitoring and decision making program was also validated using real data from an offshore Brazil basin.

Figure 4 :
Figure 4: Smart monitoring and the diagnosis tool: a) operation inside the operational pressure window, b) smart monitoring seepage detection; c) partial loss smart monitoring detection; d) total loss smart monitoring detection: fracture pressure; pore pressure; collapse pressure.

Figure 5 :
Figure 5: Decision making implementation a) rate of penetration increase diagnostic through the smart monitoring device; b) annulus pressure regulation (controlled variable): fracture pressure; pore pressure; collapse pressure; c) choke opening index manipulation (manipulated variable).

Figure 6 :
Figure 6: Smart monitoring of ROP (density) and decision making for regulating the annulus pressure (controlled variable) through the choke valve opening index (manipulated variable); fracture pressure; pore pressure; water butterfly valve opening index; mud butterfly valve opening index.