# A Simulation Study on Pressure Control in Oil Well Drilling Using Gain-Scheduled PID Controllers
## 5 Conclusions  
This research analyzes control strategies in oil well drilling systems, focusing on the tuning of PID controllers to maintain down-hole pressure during drilling at different depths. Problems such as inflow, mud loss, and pipe connection are addressed, which require effective strategies to mitigate disturbances in the system. This study is relevant because it involves personal, environmental, and economic safety.  
The mathematical modeling of the system included nonlinear equations, linearization, and the Laplace representation. The transfer function was adjusted to a first-order model that considered an integrative term, allowing the implementation of control strategies. This research highlights the importance of linearization in tuning PID gains.  
Three control methodologies, based on the Internal Model (IMC), were analyzed. The IMC controller with two degrees of freedom (IMC+2 GL) stood out for achieving the desired stability, even in the presence of disturbances. The methodologies were implemented in MatLab and Simulink, allowing the PID to be tuned for different depths. The comparison between adaptive controllers using Gain Scheduling (GS) and the reference model (MRAC) showed that the GS model performed better at depths above one thousand meters, while the MRAC model always achieved stability.  
This study presents a novel application of the Gain-Scheduled PID control method in oil well drilling systems, offering clear advantages over traditional and adaptive control strategies. Unlike conventional PID controllers, the proposed method dynamically adjusts controller parameters in real time, enhancing stability and robustness across varying drilling depths. Furthermore, the Gain-Scheduled approach demonstrated superior performance compared to the Model Reference Adaptive Control (MRAC) method, particularly at greater depths, where the MRAC model exhibited instabilities. This methodology also simplifies implementation and reduces computational complexity, making it a cost-effective and practical solution for industrial applications.  
Suggestions for future studies include considering temperature variation in the model, implementing the GS controller in real time, and using the gains obtained to train intelligent systems, such as neural networks, aiming at more precise control.  
**Author Contributions:** Conceptualization, C.A.A.-S. and V.O.G.-R.; methodology, C.A.A.-S., F.d.A.S. and V.O.G.-R.; software, C.A.A.-S. and G.C.R.d.O.; validation, E.S.G. and K.L.G.-R.; formal analysis, C.A.A.-S. and V.O.G.-R.; investigation, C.A.A.-S., F.d.A.S. and A.A.R.G.; resources, F.d.A.S. and V.O.G.-R.; data curation, K.L.G.-R.; writing--original draft, C.A.A.-S., V.O.G.-R. and F.d.A.S.; writing--review and editing, A.A.R.G. and G.C.R.d.O.; visualization, E.S.G.; supervision, V.O.G.-R. All authors have read and agreed to the published version of the manuscript.  
This work was carried out with financial support from the Universidad Cesar Vallejo (UCV) through the project with resolution number 302-2022-VI-UCV.  
Not applicable.  
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.  
We gratefully acknowledge the National Petroleum Agency PRH-48 Program of Brazil.  
The authors declare no conflict of interest.