# A Simulation Study on Pressure Control in Oil Well Drilling Using Gain-Scheduled PID Controllers
###### Abstract  
Controlling oil well pressure during drilling is one of the most complex and hazardous processes in the exploration stage. The drilling system undergoes constant variations, influenced by factors such as drilling depth, which in turn affects other process parameters. Consequently, applying a time-invariant control strategy becomes impractical. This study aimed to identify the PID parameters necessary to regulate bottom-hole pressure during drilling across different operating depths, with the goal of maintaining system stability and robustness. To achieve this, the parameters were tested using a Gain Scheduling (GS) controller, which adjusted the control gains according to various operating points. In the first section, the development of a mathematical model of the process, based on fluid mechanics, is presented. Linearizing this model introduced an integrating element, which complicated the process dynamics. In the second section, we present the design of the controller using the Internal Model Control (IMC) tuning methodology to address the integration challenges. Finally, PID parameters for different drilling depths were obtained and integrated into the GS controller via Matlab Simulink. The controller's performance was then evaluated through simulations of typical drilling issues, such as simulated disturbances, confirming its viability. The GS-controlled system was compared to a system using an adaptive controller, demonstrating superior performance in the former. p 20 December 2024 20 December 2024 20 January 2025 20 January 2025 20 December 2024 20 December 2024 20 December 2024 20 December 2024 20 December 2024 20 December 2024 2025 20 January 2 assess the extent of the reservoir and determine the viability of extraction. Finally, the extraction stage involves bringing fossil fuels to the surface [2]. Drilling is generally the most costly, complicated, and dangerous phase of oil exploration. This process involves the application of a force to a set of equipment, including a metal tower and a drill string with a drill bit at its end. This drill string is composed of pipes between 9 and 27 m long, connected to each other and added as drilling progresses [3]. During this phase, there is a significant risk of catastrophic incidents that can cause economic losses, environmental damage, and, in extreme cases, loss of human life. Tragic examples include the accidents on the Enchova Platform (Campos Basin, RJ, Brazil) in 1984 and 1988 and the explosion on the Piper Alpha platform in the North Sea in 1988, which resulted in multiple fatalities and significant financial losses [4]. To prevent explosions and control gas or fluid influx (high underground pressure during drilling), it is crucial to apply advanced process control technologies. This not only minimizes associated risks but also optimizes production costs in hydrocarbon extraction. A critical factor during drilling is the control of bottom-hole pressure (BHP) [5]. In conventional drilling operations, the common response to an unexpected influx is to activate blowout preventers, key devices that connect the wellhead at the seafloor to the platform, shutting in the well and, in many cases, abruptly stopping all equipment. Modern drilling technology, known as Managed Pressure Drilling (MPD), introduces a pressure control technique that adds an additional layer of controlled pressure, on top of hydrodynamic and hydrostatic pressures, using a choke valve [6]. On offshore platforms, operators manually adjust the valve actuators during MPD operations. However, due to rapid pressure fluctuations, closing the valve to reduce bottom pressure, if excessive, presents a significant challenge. Manual drilling operations have a high potential for error and present response time limitations. Therefore, implementing automated control systems to maintain the desired bottom-hole pressure is necessary [7].