• No results found

Optimization of an Intelligent Autonomous Drilling Rig: Testing and Implementation of Machine Learning and Control Algorithms for Formation Classification, Downhole Vibrations Management and Directional Drilling

N/A
N/A
Protected

Academic year: 2022

Share "Optimization of an Intelligent Autonomous Drilling Rig: Testing and Implementation of Machine Learning and Control Algorithms for Formation Classification, Downhole Vibrations Management and Directional Drilling"

Copied!
336
0
0

Laster.... (Se fulltekst nå)

Fulltekst

(1)

FACULTY OF SCIENCE AND TECHNOLOGY

MASTER'S THESIS

Study programme/specialisation:

Petroleum Engineering

Spring / Autumn semester, 2019 Open / Restricted access Author:

Erik Andreas Løken Jens Løkkevik

………

………

(signature of author)

Programme coordinator: Karina Sanni Supervisor(s): Dan Sui

Title of master's thesis:

Optimization of an Intelligent Autonomous Drilling Rig: Testing and Implementation of Machine Learning and Control Algorithms for Formation Classification, Downhole Vibrations Management and Directional Drilling

Credits (ECTS): 30 Keywords:

Drilling Automation Drill String Dynamics Vibrations

Machine Learning ROP Optimization Fault Detection Drillbotics®

Number of pages: 291

+ supplemental material/other: 24

Stavanger, 14. Juni 2019

Title page for Master's Thesis Faculty of Science and Technology

(2)
(3)

Abstract

In recent years, considerable resources have been invested to explore applications for- and to exploit the vast amount of data that gets collected during exploration, drilling and production of oil and gas. Such data will potentially become a game changer for the industry in terms of reduced costs through improved operational efficiency and fewer accidents, improved HSE through strengthened situational awareness, ensured optimal placement of wells, less wear on equipment and so on.

While machine learning algorithms have been around for decades, it is only in the last five to ten years that increased computational power along with heavily digitalized control- and monitoring systems have been made available. Consid- ering the state of art technology that exists today and the significant resources that are being invested into the technology of tomorrow, the idea of intelligent and fully automated machinery on the drill floor that is capable of consistently selecting the best decisions or predictions based on the information available and providing the driller and operator with such recommendations, becomes closer to a reality every day.

This thesis is the result of research carried out on the topic of drilling automa- tion. Its basis has been improvements and upgrades conducted on a laboratory- scale drilling rig developed at the University of Stavanger, as part of the multi- disciplinary project; UiS Drillbotics. Main contribution of the thesis is a study on how machine learning can be used to develop models that are capable of ac- curately predicting what rock formation is being drilled using an autonomous control system, along with detecting some common drilling incidents in real-time on the laboratory rig. Methodology is also applied to field data from the Volve field. Furthermore, research and implementation of search algorithms to ensure optimal drilling speed (ROP), safety to personnel and environment (HSE), and efficiency along with a digitalized drilling program for directional drilling, gets presented. Finally, rig upgrades for directional drilling and research into downhole sensors that get used in a closed-loop steering model is elaborated on.

(4)

Taking on this topic and project has been incredibly rewarding. The challenge of working with machine learning and autonomous systems has encouraged us to explore new areas of research, not covered in our study. The project has also given us the opportunity to get hands on experience with machinery, component design, development and manufacturing as well as rather complex programming.

Of equal importance, being able to collaborate with skilled students and industrial partners in a multidisciplinary environment has been particularly rewarding. The project was initiated by Professor Dan Sui at the University of Stavanger in 2016, and for three years, students from several departments at the University have designed, developed and further improved an autonomous rig that gets used for research as well as participation in the international Drillbotics® competition. In addition to this Master´s thesis, three students have written Bachelor´s theses.

We would like to express our gratitude towards our supervisor Professor Dan Sui at UiS. She has been of great guidance throughout the process of our work giving valuable feedback to our research and thesis. We would also like to thank Suranga Chaminda Hemba Geekiyanage and Ekaterina Wiktorski for several interesting and encouraging discussions.

Finally, we would like to thank the UiS Drillbotics team for a great collaboration and the Department of Energy and Petroleum Engineering (IEP) at the University of Stavanger for both technical and financial support.

(5)

Table of Contents

1 Introduction 1

1.1 Research Problem . . . 1

1.2 Background of Study . . . 3

1.3 Control System Architecture . . . 4

2 Experimental Setup 6 2.1 Drilling Rig System . . . 6

2.1.1 Rotation System . . . 6

2.1.2 Hoisting System . . . 7

2.1.3 Circulation System . . . 9

2.1.4 Drill String Assembly . . . 9

2.2 Additions to facilitate for directional drilling . . . 11

2.2.1 Downhole motor (pneumatic) . . . 12

2.2.2 2-axis Actuator System . . . 14

2.2.3 BHA components . . . 17

2.3 Rig Sensors . . . 19

2.4 Downhole Sensor Sub . . . 19

2.4.1 Mechanical design . . . 19

2.4.2 Mechanical design - Stress simulation . . . 21

2.4.3 Sensor Package . . . 21

2.4.4 Final Design . . . 23

2.5 Calibration of systems . . . 24

2.5.1 Pneumatic Motor . . . 24

2.5.2 Top Drive . . . 27

2.5.3 WOB Control . . . 28

2.6 Downhole measurements . . . 31

2.6.1 Inclination and azimuth calculations . . . 31

2.6.2 Calibration of sensors . . . 33

2.7 Downhole Position Tracking . . . 34

2.8 Software Architecture . . . 35 iii

(6)

2.8.2 API - OPC UA . . . 37

2.9 Graphical User Interfaces (GUIs) . . . 38

3 Theory 40 3.1 Data Management . . . 40

3.1.1 Data Mining . . . 40

3.1.2 Data Quality . . . 41

3.1.3 Some challenges concerning data aggregating . . . 44

3.1.4 Importance of utilizing a database for data storage . . . . 45

3.1.5 Downsampling the data . . . 47

3.1.6 Describing the dataset . . . 48

3.1.7 Noise Reduction Methods . . . 50

3.1.8 Normalization and standardization of the data . . . 54

3.2 Machine Learning Theory . . . 57

3.2.1 A Short Introduction to Supervised Learing . . . 57

3.2.2 A Short Introduction to Unsupervised Learning . . . 58

3.2.3 Training and Cross Validation . . . 60

3.3 Supervised Machine Learning Models . . . 61

3.3.1 Selecting the most optimal model . . . 61

3.3.2 Multilayer Feed Neural Network and Back-propagation . . 66

3.3.3 Support Vector Machine . . . 69

3.3.4 Decision Tree . . . 71

3.3.5 Gradient Boosting . . . 73

3.3.6 Random Forest . . . 75

3.3.7 K-Nearest Neighbor . . . 76

3.3.8 Bayesian Classification . . . 77

3.3.9 TPOT Algorithm . . . 78

3.4 Unsupervised Machine Learning Models . . . 80

3.4.1 K-Means Clustering . . . 80

3.4.2 Density Based Spatial Clustering of Applications with Noise 82 3.5 Drilling Theory . . . 83

3.5.1 Drill String Vibrations . . . 83

3.5.2 Directional Drilling . . . 87

3.5.3 Buckling Models . . . 89

4 Data Preparation 91 4.1 Laboratory data preparation for rock / formation classification . . 91

4.1.1 Data source . . . 91

iv

(7)

4.1.2 Data concatenation . . . 93

4.1.3 Data labeling . . . 94

4.1.4 Describing the raw data . . . 94

4.2 Data collection for classification of laboratory rig operations . . . 97

4.2.1 Data source . . . 97

4.2.2 Data concatenation . . . 97

4.2.3 Data labeling . . . 97

4.2.4 Describing the data . . . 97

4.3 Surface Data collection for drilling incident classification . . . 99

4.3.1 Surface data for vibration classification . . . 99

4.3.2 Normal pressure vs leak and overpressure . . . 101

4.3.3 Rotating pipe vs stuck pipe . . . 103

4.3.4 Normal drilling vs drill string twist off . . . 105

4.4 Downhole data for vibration classification . . . 108

4.5 Possible errors present in laboratory data . . . 110

4.6 Volve data . . . 111

4.6.1 Volve data aggregated to classify rock formations . . . 111

4.6.2 Volve data aggregated to classify rig operations . . . 113

4.7 Field data challenges . . . 116

5 Data Quality Improvement 118 5.1 Down sampling experimental data . . . 118

5.2 Removing duplicates . . . 119

5.3 Removing Missing data . . . 119

5.4 Normalizing the data . . . 119

5.5 Outlier removal using IQR method . . . 121

5.6 Four-plots for WOB and Torque . . . 123

6 Feature Engineering and Optimization 126 6.1 Drilling Feature Engineering . . . 126

6.1.1 Natural features . . . 126

6.1.2 Artificial Feature Engineering . . . 128

6.1.3 Drilling Features constructed after processing . . . 129

6.2 Feature Selection . . . 137

6.2.1 With outliers kept in the dataset . . . 137

6.2.2 With no outliers in the dataset . . . 141

6.3 Feature Extraction . . . 144

v

(8)

7.2 Study cases . . . 150

7.2.1 Laboratory formation classification . . . 150

7.2.2 Volve formation classification . . . 168

7.2.3 Laboratory rig operations . . . 186

7.2.4 Volve rig operations . . . 191

7.2.5 Laboratory pressure cases . . . 196

7.2.6 Laboratory vibration cases (surface data) . . . 200

7.2.7 Laboratory vibration cases (downhole data) with downhole motor . . . 205

7.2.8 Laboratory stuck-pipe cases . . . 211

7.2.9 Laboratory twist off cases . . . 215

7.3 Summary of preliminary clasifications results . . . 219

8 Validation 221 8.1 Rock Classification . . . 221

8.1.1 Task a. Laboratory Experimental data . . . 221

8.1.2 Laboratory rig voting system . . . 232

8.1.3 Task b. Volve field data . . . 234

8.1.4 Formation classification - recommendations . . . 240

8.2 Drilling Rig Operations Classification . . . 242

8.2.1 Task c. Laboratory Experimental data . . . 242

8.2.2 Task d. Volve field data . . . 243

8.2.3 Rig operations - recommendations . . . 244

8.3 Drilling Incident Classification . . . 245

8.3.1 Task e. Pressure Incident Detection . . . 245

8.3.2 Task f. Surface Drilling Vibrations Detection . . . 246

8.3.3 Task g. Downhole Vibrations . . . 247

8.3.4 Task h. Stuck Pipe Incident Detection . . . 250

8.3.5 Task i. Twist off Incident Detection . . . 252

8.3.6 Incident classification - recommendations . . . 253

8.4 Limitations using machine learning . . . 254

9 Autonomous Drilling 256 9.1 Search algorithms . . . 257

9.1.1 ROP Optimization Background . . . 257

9.1.2 Various search algorithms . . . 259

9.2 Implemented algorithms . . . 263

vi

(9)

9.2.1 Column-Row search (Implemented in 2018) . . . 263

9.2.2 Gradient Descent (Implemented in 2019) . . . 264

9.2.3 Triggers that can reinitiate search algorithm . . . 268

9.3 Digital Detailed Operating Procedure . . . 268

9.4 Downhole closed-loop steering . . . 271

9.5 Drilling Incident Detection . . . 273

9.6 Rig performance . . . 275

9.6.1 Experiment 1: Inclined well section . . . 275

9.6.2 Experiment 2: Vertical well section . . . 277

9.6.3 Experiment 3: Deviation well with WOB 5 to 20 kg . . . . 278

9.6.4 Experiment 4: Pilot hole section 0 - 166 mm MD. Inclina- tion well from 109 mm to 600 mm MD. . . 279

9.6.5 Experiment 5: Increasing cross-over OD to 30.75 mm (up from 20) . . . 280

10 Conclusion and Future Research 282 10.1 Discussion of results and end state achieved . . . 282

10.1.1 Machine Learning . . . 282

10.1.2 Control System and Control Algorithms . . . 283

10.1.3 Mechanical . . . 284

10.2 Future recommendations . . . 285

10.2.1 Machine Learning . . . 285

10.2.2 Control System and Control Algorithms . . . 286

10.2.3 Mechanical work . . . 287

A Sensor Sub Stress Simulation 292

B Manual Downhole Position Tracking Concept 297

C Autonomous Search Algorithm Code 299

D Active Steering Code 301

E Stuck Pipe Code 304

F Autonomous Drilling Program Code 305

G Downhole Vibration Classification Code 309

H Downhole Position Tracking Code 311

vii

(10)

1.1 3D model of Volve field . . . 3

1.2 Laboratory drilling system at the University of Stavanger. . . 4

2.1 Rotational system . . . 7

2.2 Hoisting system . . . 8

2.3 Circulation System . . . 9

2.4 BHA components: pipe, sensor sub, knuckle joint, downhole motor and bit . . . 10

2.5 Laboratory drilling rig schematic to enable for directional drilling 11 2.6 170 watt drilling motor speficiations . . . 12

2.7 Pneumatic output characteristic . . . 13

2.8 Pneumatic output characteristic . . . 14

2.9 Actuator system concept . . . 15

2.10 Assembled actuator system for directional drilling . . . 16

2.11 Bit entering the whipstock . . . 16

2.12 Illustration and design sketch showing the whipstock design . . . 17

2.13 Knuckle joint design . . . 18

2.14 Rig sensors . . . 19

2.15 Dimensions of the sensor sub . . . 20

2.16 Sensor sub CAD drawing . . . 20

2.17 Cross-sectional view of sensor house . . . 21

2.18 FLORA 9-DOF Accelerometer/Gyroscope/Magnetometer . . . 22

2.19 Adafruit Trinket M0 . . . 22

2.20 Drilled through thread tap and refurbished threads . . . 23

2.21 Sensor sub end result - after sand blasting and assembling . . . . 24

2.22 High frequency camera used to measure bit revolutions . . . 25

2.23 Vertical displacement of a tracked pixel . . . 25

2.24 Frequency of which pixel occurs . . . 26

2.25 Bit RPMs corrected for torque . . . 27

2.26 PID Controller block diagram . . . 28 viii

(11)

2.27 Proof of concept, using simple tracker . . . 35

2.28 Concept illustration of the control system . . . 36

2.29 Implemented control system illustrating layers and dataflow . . . 37

2.30 API . . . 38

2.31 Rig performance graphical user interface . . . 38

2.32 Downhole position tracking graphical user interface . . . 39

3.1 Four Plot . . . 43

3.2 User panel for the developed database at UiS . . . 47

3.3 Python function to describe the dataset . . . 48

3.4 MATLAB pairplot of data from five variables (features) . . . 49

3.5 Box plots and heat maps for visualization of the data . . . 50

3.6 Data that is treated as invalid data gets transformed to NaN . . . 51

3.7 Rows of data that contain NaN is removed . . . 51

3.8 Rows containing maximum and minimum values get added . . . . 56

3.9 Data is normalized using LFS . . . 56

3.10 Work flow illustration to develop a machine learning model . . . . 57

3.11 Charachteristics of different machine learning algorithms . . . 62

3.12 Scikit learn and SAS cheat sheets to select an approproate algorithm 63 3.13 Grid Search CV function from the Scikit Learn software . . . 64

3.14 Classification report providing feedback on the model performance 65 3.15 Feed forward neural network illustration . . . 67

3.16 Example of an overfitted model . . . 69

3.17 Polynomial kernel . . . 70

3.18 Decision Tree concept illustration . . . 72

3.19 K-Nearest Neighbor . . . 76

3.20 TPOT machine learning pipeline . . . 78

3.21 TPOT optimization progress . . . 79

3.22 K-Means Clustering: raw data before clustering . . . 81

3.23 K-Means Clustering - after clustering . . . 81

3.24 Density Based Spatial Clustering of Applications with Noise . . . 83

3.25 Drill String Vibrations . . . 84

3.26 Drill String System . . . 86

3.27 Dogleg angle . . . 88

3.28 Buckling modes . . . 89

3.29 Non-rotating buckling . . . 90

4.1 Rock samples drilled for collecting experimental drilling data . . . 92

ix

(12)

4.3 Description of the original data collected for rock classification models 95

4.4 Plot representing the dataset containing natural features only . . 95

4.5 Seaborn pairplot representing raw data - rock formation classification 96 4.6 Description of dataset containing raw observations for rig operations 98 4.7 Plot representing the raw data from laboratory rig operations . . 98

4.8 Seaborn pairplot representing rig operation raw data . . . 99

4.9 Description of the raw data for vibrations using surface sensors . . 100

4.10 Plot of the raw data for vibrations using surface sensors . . . 100

4.11 Seaborn pairplot - normal vs moderately high vibrations case . . . 101

4.12 Pressure loss and overpressure cases for the mud system . . . 102

4.13 Description of raw data for pressure cases . . . 102

4.14 Pairplot of pressure and WOB features for pressure cases . . . 103

4.15 Normal drilling vs stuck pipe cases for stuck pipe classification . . 104

4.16 Description of raw data to later develop a stuck pipe model . . . . 104

4.17 Pair plot of raw data gathered in order to develop a stuck pipe model105 4.18 Transition from normal drilling to a twist off. Cement drilled at high RPM and WOB . . . 106

4.19 Description of natural features in twist off experiment . . . 107

4.20 Pairplot of raw data collected for twist off model . . . 107

4.21 Description of raw data used in downhole vibration study . . . 109

4.22 Pairplot of raw data collected for downhole vibration level model . 109 4.23 Description of the Volve data for formation classification . . . 112

4.24 Plot of features from Volve field data . . . 112

4.25 Pairplot of features from Volve field data . . . 113

4.26 Description of the Volve data for rig operation classification . . . 114

4.27 Plot of features from Volve field data . . . 115

4.28 Pairplot of features from Volve field data . . . 116

5.1 Normalizing data using MinMaxScaler . . . 120

5.2 Renaming the features in Jupyter Notebook . . . 120

5.3 Changing normalized labels back to their original values . . . 120

5.4 Feature sorting – outlier removal . . . 121

5.5 Quartile identification for IQR method . . . 121

5.6 Illustration of how IQR gets calculated . . . 121

5.7 IQR – upper and lower limit . . . 122

5.8 IQR - upper and lower limits for rock formation classification . . . 122

5.9 Setting outlying data to zero . . . 123 x

(13)

5.10 Number of identified outliers that have been converted to NaN . . 123

5.11 Four-plot for WOB before the data has been pre-processed . . . . 124

5.12 Four-plot – WOB, processed data . . . 124

5.13 Four-plot – Torque, raw data . . . 125

5.14 Four-plot – Torque, processed data . . . 125

6.1 Algorithm used to calculate mean-depth . . . 128

6.2 Algorithm to calculate ROP . . . 129

6.3 MSE different between soft and hard formation . . . 131

6.4 Algorithm to calculate RPM*WOB feature . . . 133

6.5 Algorithm to calculate RPM*WOB/ROP feature . . . 134

6.6 Algorithm to calculate RPM2 feature . . . 134

6.7 Algorithm to calculate WOB2 feature . . . 134

6.8 Algorithm to calculate WOB/RPM feature . . . 134

6.9 Algorithm to calculate standard deviation . . . 135

6.10 Algorithm to calculate mean value . . . 135

6.11 Algorithm to calculate median value . . . 135

6.12 Algorithm to calculate maximum value . . . 135

6.13 Algorithm to calculate maximum value . . . 136

6.14 Algorithm to calculate average divided by standard deviation . . . 136

6.15 Algorithm to calculate median divided by standard deviation . . . 136

6.16 Algorithm to calculate maximum value . . . 136

6.17 Result from feature evaluation before outliers are removed . . . . 138

6.18 Feature dimensionality reduction using PCA . . . 139

6.19 Mean and variance ratio for original features . . . 139

6.20 Feature dimensionality reduction using PCA when z-scaled . . . . 140

6.21 Importance of principal components created . . . 141

6.22 Importance of principal components, z-scaled . . . 141

6.23 ExtraTreesClassifier results after performing IQR . . . 142

6.24 PCA- feature dimensionality reduction and feature importance after using IQR . . . 143

6.25 Real-time flow chart as integrated in Python . . . 144

7.1 Area Under Curve . . . 147

7.42 Volve data rock classification feature importance . . . 168

7.83 Laboratory operation classification feature importance . . . 186

7.89 Volve rig operation classification feature importance . . . 191

7.95 Pressure cases feature importance . . . 196

xi

(14)

7.106Unsupervised K-Means Clustering . . . 203

7.108Downhole vibration classification feature importance . . . 206

7.115Stuck pipe classification feature importance . . . 211

7.121Twist off classification feature importance . . . 215

8.1 Laboratory formation classification with all features, models trained for six formations . . . 222

8.2 Median-filtered laboratory formation classification with all features, models trained for six formations . . . 223

8.3 Laboratory formation classification with only six features, models trained for six formations . . . 224

8.4 Median-filtered laboratory formation classification with only six features, models trained for six formations . . . 225

8.5 Laboratory formation classification with all features, models trained for 3 formations . . . 226

8.6 Median-filtered laboratory formation classification with all features, models trained for 3 formations . . . 227

8.7 Laboratory formation classification with only six features, models trained for 3 formations . . . 228

8.8 Median-filtered laboratory formation classification with only six features, models trained for 3 formations . . . 229

8.9 Raw and median-filtered laboratory formation classification using a granite test set . . . 230

8.10 Raw and median-filtered laboratory formation classification using a granite test set . . . 231

8.12 Volve formation classification without removing outliers and using all features . . . 235

8.13 Median-filtered Volve formation classification without removing outliers with all features . . . 236

8.14 Volve formation classification removing outliers using IQR with all features . . . 237

8.15 Median-filtered Volve formation classification removing outliers using IQR with all features . . . 238

8.16 Volve formation classification removing outliers using IQR with only six features . . . 239

8.17 Median-filtered Volve formation classification removing outliers using IQR with only six features . . . 240

xii

(15)

8.18 Laboratory rig operations classification with raw- and median-

filtered prediction . . . 242

8.19 Volve rig operations classification . . . 244

8.20 Leak and overpressure classification from original dataset . . . 246

8.21 Vibration classification using surface data . . . 247

8.22 Classifying vibration levels in the original dataset . . . 248

8.24 Downhole Vibration Classification as implemented in the drilling system. . . 249

8.23 Classifying vibration levels in a freshly acquired dataset . . . 249

8.25 Classifying stuck pipe in the original dataset . . . 251

8.26 Classifying stuck pipe in the original dataset without removing invalid data . . . 252

8.27 Twist off detection from original dataset . . . 253

9.1 Simplified logic of the control system illustrating the processes . . 256

9.2 Illustration of ROP response from varying drilling parameters . . 258

9.3 Shortest path is the gradient directly towards the goal state of the machine . . . 259

9.4 Gradient Descent . . . 260

9.5 Unimodal function . . . 261

9.6 Illustration of hill climb search . . . 263

9.7 Snapshot of the code implemented in 2018 . . . 264

9.8 State space constraints and ROP contours from Dunlop et al. . . 266

9.9 Gradient descent illustration . . . 267

9.10 DDOP Phases for Autonomous Drilling . . . 269

9.12 Illustration of how the machine uses a look up table to confirm or deny whether sufficient build is achieved . . . 272

9.13 Experiment 1: Well log, downhole motor drilling of 70 mmTVD . 275 9.14 Well profile using 7 degrees whipstock in homogeneous cement . . 276

9.15 Experiment 2: Well log, downhole motor drilling of 170 mmTVD . 277 9.16 Experiment 3: Well log, downhole motor drilling of 600 mmTVD . 278 9.17 Experiment 4: Well log, downhole motor drilling of 166 mmTVD pilot hole . . . 279

9.18 Experiment 4: Well log, downhole motor drilling of 600 mmTVD . 280 A.1 Momentum load case simulation from Fusion 360 . . . 292

A.2 Results from momentum load case simulation in Fusion 360 . . . . 293

A.3 WOB load case simulation from Fusion 360 . . . 293

xiii

(16)

A.5 Overpull load case simulation from Fusion 360 . . . 294

A.6 Results from overpull load case simulation in Fusion 360 . . . 295

A.7 Pressure load case simulation from Fusion 360 . . . 295

A.8 Results from pressure load case simulation in Fusion 360 . . . 296

A.9 Buckling load case simulation from Fusion 360 . . . 296

B.1 Tracking concept for downhole position, part 1 . . . 297

B.2 Tracking concept for downhole position, part 2 . . . 298

xiv

(17)

List of symbols

δ the tolerance specified for when gradient search shall terminate ηk step size used for steepest descent

gk gradient used in steepest descent xk+1 minimal point used in steepest descent xk current position used in steepest descent f frequency

FN integer in fibonacci sequence f r framerate

g gravity

J sum of squared errors

Kd controller gain for derivative controller Ki controller gain for integral controller Kp controller gain for proportional controller u(t) error

u0 bias

α positivity constraint

¯

x mean value β buoyancy factor

χ output value of neuron

xv

(18)

Γ mapping function

λ learning rate for back-propagation µ coefficient of sliding friction µ true mean value

ωij weight coefficient σ standard deviation τ torque

ε neighbourhood radius in DBSCAN ϑ threshold coefficient (referred to as bias) ξ neuron potential

Abit area of bit

Dbit drill bit diameter

E obective function to determine the sum of squared error between predicted and known output in a supervised neural network

Es specific energy

L maximization equation

mi, ci, ki mass-, damping- and spring constants for a spring-mass system G gini index

Q flow rate

xvi

(19)

Common Abbreviations

A - Azimuth

AI - Artificial Intelligence

ANN - Artificial Neural Network

API - Application Programming Interface ARI - Adjusted Rand Index

AUC - Area Under Curve BA - Bit Aggressiveness

BHA - Bottom Hole Assembly BHP - Bottom Hole Pressure CPU - Central Processing Unit CSS - Cascading Style Sheets CSV - Comma Separated Values CV - Cross-Validation

DAQ - Data Aquisition DB - Database

DDS - Data Distribution Service DT - Decision Tree

DBSCAN - Density-based spatial clustering of applications with noise DDOP - Digital Detailed Operating Procedure

DL - Dogleg angle, or Deep Learning DLS - Dogleg Severity

DM - Data Mining DOC - Depth of Cut

DPS - Degrees Per Second DT - Decision Tree

ECD - Equivalent Drilling Density

FSM - Finite State Machine

(20)

gRPC - google Remote Procedure Calls GUI - Graphical User Interface

HSE - Health, Safety and Environment HTML - HyperText Markup Language I - Inclination

ID - Inner Diameter

IDE - Integrated Development Environment

IEP - Department of Energy and Petroleum Engineering IQR - InterQuartile Range

K-NN - K-Nearest Neighbor KOP - Kick-Off Point

LC - Load Cell

LFS - Linear Feature Scaling MD - Mean Depth

MLP - Multi Layer Perceptron MSE - Mechanical Specific Energy MW - Mud Weight

NaN - Not a Number

NPP - Normal Pore Pressure gradient NPT - Non Productive Time

OD - Outer Diameter

OPC UA - Open Platform Communications Unified Architecture PCA - Principal Component Analysis

PDC - Polycrystalline Diamond Compact

PID - Proportional Integral Derivative controller PLC - Programmable Logic Controller

POOH - Pull Out Of the Hole PWM - Pulse Width Modulation Q-Q plot - Quantile-Quantile plot

ii

(21)

RBF - Radial Basis Function

RDBMS - Relational Database Management System RF - Random Forest

RIH - Run In Hole

RL - Reinforced Learning

RMSE - Root Mean Squared Error ROnB - Rotating On Bottom ROP - Rate Of Penetration RPM - Revolutions Per Minute SD - Secure Digital

SPP - Stand Pipe Pressure

SQL - Structured Query Language SVD - Singular Value Decomposition SVM - Support Vector Machine TF - Toolface

TOB - Torque On Bit TVD - True Vertical Depth

UCS - Uniaxial Compressive Strength UI - User Interface

UIS - University of Stavanger WOB - Weight On Bit

XML - Extensible Markup Language

iii

(22)

Introduction

1.1 Research Problem

“My contention is that machines can be constructed which will simulate the be- havior of the human mind very closely. They will make mistakes at times, and at times they may make new and very interesting statements, and on the whole the output of them will be worth attention to the same sort of extent as the output of a human mind. The content of this statement lies in the greater frequency expected for the true statements, and it cannot, I think, be given an exact state- ment. It would not, for instance, be sufficient to say simply that the machine will make any true statement sooner or later, for an example of such a machine would be one which makes all possible statements sooner or later. We know how to construct these, and as they would (probably) produce true and false statements about equally frequently their verdicts would be quite worthless. It would be the actual reaction of the machine to circumstances that would prove my contention, if indeed it can be proved at all.” (Turing, 1951) [1].

In recent years, the concept of drilling automation has advanced from primarily being automation of rig floor equipment to novel solutions that rapidly can be deployed to the rig environment and assist the driller in a variety of operations.

Aside from providing an early warning to the driller, and if necessary, for instance perform a controlled shut-in procedure should a kick that is migrating towards surface get detected, such intelligent systems could improve efficiency and reduce financial costs through continuous monitoring and interaction with the driller.

Smart drilling systems could also be used to suggest operating parameters to the driller through correlating real-time drilling data with vast amounts of historic data stored in a virtual environment, popularly referred to as a digital twin, or

1

(23)

1.1. RESEARCH PROBLEM 2 even exert full control of all rig equipment if permissable (top drive, draw works, mud pumps, elevator, rough neck and so on) leaving only major decision points to be determined by the driller. The latter automation level described for the drilling scene is likely still several years away from being deployable to the field.

A timeline that highlights artificial intelligence (AI) applications in drilling prac- tices is given in Application Of Artificial Intelligence Methods In Drilling System Design And Operations: A Review Of The State Of The Art (Bello et al., 2015) [2].

In our opinion, short term advances in drilling automation lies in developing simple, yet robust tools for the driller to strengthen the understanding of the operations during critical phases, and if possible, automate some of the routine tasks that easily can be controlled by a machine. In the same way that a Tesla can self-operate in known terrain, so should the drilling rig, enabling the driller to remain one step ahead, maintaining an overview of all on-going events.

According to Jordan and Mitchell, “The past decade has seen rapid growth in the ability of networked and mobile computing systems to gather and transport vast amounts of data, a phenomenon often referred to as “Big Data.” The scientists and engineers who collect such data have often turned to machine learning for so- lutions to the problem of obtaining useful insights, predictions, and decisions from such data sets.” (Jordan & Mitchell, 2015) [3]. Given the big amount of wells that get drilled every year, and the amount of data that gets collected from operations, an approach to predict and make decisions based on the data that already gets col- lected through the use of machine learning models is an important area of research.

In this thesis, an approach to develop data-driven models to classify different rock formations is presented. The models have been developed using so-called supervised machine learning, and get trained and validated using both time-based experimental data that have been collected in the laboratory environment on a test bench (see section 1.2) and field data from the Volve field released by Equinor and its partners [4]. Furthermore, unsupervised machine learning models have been developed to classify some drilling incidents such as stuck pipe and plugged drill bit nozzles, in addition to common rig operations such as tripping (POOH – pull out of the hole and RIH – run in hole) and rotating on bottom (ROnB), meaning that the pipe is rotated on bottom of the hole without being raised or lowered in the axial direction.

(24)

Figure 1.1: 3D model of the Volve field (created in the exploration phase), where all subsurface and production data has been made publicly available [4].

Since experimental test data has been gathered using an autonomous laboratory- scale drilling rig that has been developed as part of the UiS Drillbotics project at the University of Stavanger, the thesis will also cover some of the parallel ac- tivities to the data-driven model development, such as developing a bottom hole assembly (BHA) with an integrated sensor package that is capable of measuring forces and bit-rock interaction in real-time during drilling, autonomous search algorithms allowing the system to maximize the rate of penetration (ROP) while minimizing the risk of running into drilling incidents and drilling with sub-optimal parameter setpoints, and finally a digital algorithm that has been implemented to fully autonomously drill a deviation well using a closed-loop steering system.

1.2 Background of Study

Since 2016, students at UiS have designed, constructed and conducted experi- ments in order to optimize an autonomous drilling rig of approximately 3 m × 1.5 m × 1.5 m size. While the system initially got developed with the aim to participate in the annual Drillbotics® competition (Loeken and Trulsen, 2017) [5]

(Hjelm and Nilsen, 2018) [6], hosted by the Society of Petroleum Engineers (SPE) [7], the machine is now being used as a test bench to investigate the potential in various drilling automation applications and data analytics. A picture of the rig as it was in the end of 2018 is shown in Figure 1.2a. Equipping the rig with all upgrades, the improved system is shown in Figure 1.2b.

(25)

1.3. CONTROL SYSTEM ARCHITECTURE 4

(a) Autonomous Laboratory-scale drilling rig devel- oped at the University of Stavanger.

(b) Upgraded rig in 2019.

Figure 1.2: Laboratory drilling system at the University of Stavanger.

Several articles have been published on the research that has been conducted with the drilling system, see (Loeken et al., 2017) [8], (Geekiyanage et al., 2018) [9]

(Loeken et al., 2018)[10] . An important objective in 2019 has been to evaluate whether or not methodology that has been developed to create drilling-related models on the laboratory scale can be directly associated with field data, thus strengthening the research value of the project. More information regarding the experiment setup (rig) to develop the models is given in chapter 2.

1.3 Control System Architecture

The drilling system is a collection of several systems including mechanical, hy- draulic, electrical, hardware, software, and data systems. The hardware architec- ture is comprised of three levels; programmable logic controllers (PLCs) on level 1, computers on level 2 and cloud-based storage of time-based data (optionally also depth-based data) on level 3. On level 1, the control aspect (PLCs) for

(26)

the five main systems on the rig are located (rotational system, hoisting system, pneumatic system, riser and whipstock positioning system and finally hydraulic mud system). Each system gets controlled through its own microcontroller / PLC, that both executes commands to the controllable systems on the rig (actuators, motors, pumps and so on) and gathers information from the equipped sensors.

The PC located on level 2 handles the decision-making logic. This logic involves carrying out the digital detailed operating procedure (DDOP), ROP search algo- rithms, steering algorith, stuck pipe model, machine learning models, detection of drilling incidents and carrying out remedial actions, as well as pushing the data to a configured database for post-analysis and data extraction (level 3). A key factor has been to ensure that all components that make up the drilling system are compatible for real-time and autonomous control.

In 2018, the software architecture was configured to operate as a finite state machine (FSM), meaning that the system at any time would operate in a partic- ular state (from a pre-defined number of finite states such as calibration state, normal drilling state, remedial action state and so on). The Arduino Due micro- controllers / PLCs were programmed using the Arduino integrated development environment (IDE), while the control system was configured using Python and the Visual Studio Code IDE. In 2019, the software architecture has seen a major upgrade, and is now configured as a multithreading system, meaning that several client/server modules, referred to as threads that run on multiple cores on the central processing units (CPUs), run in parallel using a gRPC API to handle communication between each module / thread. In addition, an API based on OPC UA has been developed to support remote connectivity and remote event handling, allowing external partners to execute commands remotely to the control system, for instance through their own API, and receive data from the rig in real-time upon request. The control system is described further in section 2.8.

Additional details are found in (Sand, 2018) [11] and (Guggedal and Steinstø, 2019) [12].

(27)

Chapter 2

Experimental Setup

2.1 Drilling Rig System

The drilling rig consists of in total six hardware systems, in addition to the control system. These are; rotation, hoisting, circulation, pneumatic, whipstock positioning and power systems. In the following subsections, all key systems get described shortly.

2.1.1 Rotation System

There exists two rotational systems that can be used: a conventional top drive, used for vertical drilling and a downhole motor used for directional drilling. While the two rotational systems in theory can operate simultaniously, with the current downhole motor specifiations, the torque is less than in the top drive which could cause severe motor damage if for instance the bit gets stuck.

For the conventional system, a hollow-shaft brushless motor is used to rotate the assembly. The top drive transfers torque directly to the drill string and provides a rated torque of 2.86 Nm and a maximum instantaneous torque of 8.59 Nm.

Because the motor is hollow shafted, the mud injection hose that runs along the derrick can be connected on top of the motor using a swivel (rotary union) (See Figure 2.1). This set-up allows us to circulate drilling fluid (either water, water-based mud - WBM or oil-based mud - OBM) all the way from top of derrick to the drill bit nozzles. Velocity margins and pressure loss across the system can be calculated as shown in (Akisanmi, 2016) [13].

The top drive provides rotational speeds up to 3500 RPM but is limited to 1500 RPM due to the rotary union currently in place.

6

(28)

Figure 2.1: Picture showing the connection between the hose, swivel and motor [6].

By varying two analog voltage signals one can control the RPM- and torque- output from the top drive. The signals are transmitted from programmable logic controllers (PLCs) to a driver for the top drive. The motor driver also has a dynamic braking function that can be programmed using the autonomous control algorithm, or the driller can define the absolute motor torque limitations. This brake acts as a safety measure for the system so that if the system where to exceed the given torque limitations, it will stop, temporarily, in order to prevent incidents such as buckling or twist-off. Instantanious twist-off due to fatigue can however still occur. For the case of this particular rig this is very useful because the drill string is made out of aluminum which has a low mechanical strength and buckling limit, as has been calculated by students on the team in 2018. The braking function can be controlled in the same way that RPM and torque operating setpoints get controlled.

2.1.2 Hoisting System

In order to simulate drilling operations, the system is equipped with a hoisting system that consists of three actuators, each equipped with its designated stepper motor and brake of type normally-closed (in order to reduce the holding torque on the stepper motors when the system is not running). The motors raise/lower the top plate that resembles the drill floor where top drive and other components are mounted. The top plate is situated on three brackets, each equipped with a tri-axial load cell that measures the free hanging weight and hook load of ap-

(29)

2.1. DRILLING RIG SYSTEM 8 proximately one third of the combined drill floor weight. The decision to use three actuators was made for several reasons where the most important were; to ensure that a sufficient lifting force can be provided, the system will be more rigid when mounted between three actuators to prevent vibrations on the drill floor and finally it allows for smaller incremental changes to actuator distance movement which in turn is essential to regulate the WOB. Various safety algorithms are in place to reduce for instance the risk of a brake accidentally closing when either of the three actuators are moving, which can possibly damage parts of the system (Hagen et al., 2018) [14].

Figure 2.2: Illustration of hoisting system, consisting of three actuators operating in synchrony.

The three actuators are controlled by its own stepper motor with a step-angle of 1.8 degrees, where for each 1.8 degrees of stepping 10 micro-steps get transmitted (resulting in a total of 2000 steps/rev). The stepper motor is connected to the a lead screw, where each revolution of the screw results in 8 mm travel length of the top plate which gives an elevation resolution of 4 µm. High accuracy for the actuators is as mentioned above key in order to ensure the required WOB control.

Therefore, powerful stepper motors that combined can provide an approximate maximum WOB up to 500 N is used. To address the challenge of vibrations in the system, a rigid coupling is used between stepper motor and actuator to reduce the

(30)

overall vibration making the system more sturdy compared to the use of spring loaded coupling.

More information and details are found in thesis from 2017 and 2018 [5] [14] [6].

2.1.3 Circulation System

The circulation system consists of two pumps alternating for 30 seconds each.

This prevents the pumps from over-heating and should one pump fail, the other will kick in to ensure the required velocity margin for adequate hole cleaning and cooling of the bit. The pumps have a maximum flowrate of 19 L/min at a working pressure of 3.1 bar (Hagen et al., 2018) [14].

Figure 2.3 shows the circulation system mounted inside the rig structure. This gives a mobile set-up where no dismantling is needed before transportation of the rig, while simultaniously reduces the chance of a leak damaging the electrical components on the rig.

Figure 2.3: Picture showing the circulation system mounted inside the drill rig.

More information and details are found in [14] [6].

2.1.4 Drill String Assembly

The drill string assembly developed in 2019 consists of:

• Aluminum drill pipe

(31)

2.1. DRILLING RIG SYSTEM 10

• Downhole sensor sub

• Knuckle joint

• Pneumatic downhole motor

• Drill bit

The concept of the drill string assembly developed with the aim to drill direc- tionally is shown in Figure 2.4. While the knuckle joint can be used to control the dogleg by varying the WOB setpoint thresholds either so that a spring gets compressed (bend) or left uncompressed (no bend), the mechanical angle of the top drive can be varied through pulsing to change the azimuth, if an offset is registered. Finally, the bit RPM is controlled by throttling the air flow coming from a compressor to the downhole motor.

Figure 2.4: BHA consisting of pipe, sensor sub, knuckle joint, downhole motor and bit.

Aluminum Drill Pipe

The aluminum drill pipe used for drilling has the following dimension:

Parameter Description and Unit Material Aluminum, 6061-T6 alloy Pipe length 914.4 mm

Pipe OD 9.53 mm

Pipe ID 7.75 mm

Wall thickness 1.2446 mm

See [14] for pipe limit calculations and destructive testing of the drill pipe. In short, calculations and destructive tests performed have shown that:

(32)

• the critical slenderness ratio of the pipe is 70.2, and the slenderness ratio of the drill pipe is approximately 280.2,

• provided the same pipe dimensions and material above, the approximate buckling limit is 280.5 N,

• the maximum torque before the pipe yields is approximately 19.0 Nm, while the maximum torque before the pipe shears is approximately 24.7 Nm.

Destructive testing carried out in both 2017 and 2018 has shown that the pipe can sustain a maximum tensile load of approximately 10.331 kN and a maximum compressive load 985.72 N. [14].

2.2 Additions to facilitate for directional drilling

The rig concept to facilitate for directional drilling consists of several additions, in which the most important is presented below. A schematic of the complete system is presented in Figure 2.5:

Figure 2.5: Schematic of the drilling rig design that allows for for directional drilling through downhole motor, benable BHA, downhole position tracking and whipstock to kick off from vertical below KOP.

(33)

2.2. ADDITIONS TO FACILITATE FOR DIRECTIONAL DRILLING 12

2.2.1 Downhole motor (pneumatic)

Two pneumatic motors have been purchased to allow for both vertical and hori- zontal drilling by rotating only the bit (and crossover that connects the bit to the pneumatic motor). The pneumatic motors of type 302916D and 302916F have nominal torques of 2.1 and 4.9 Nm and nominal speeds of 750 and 330 RPM respectively, producing a nominal power of 170 W (= 0.23 HP) [15].

Figure 2.6: Both pneumatic motors deliver 170 W of nominal power [15].

According to the manufacturer datasheet, the power output in kW can be calcu- lated from the following equation [16]:

P[kW] = M[N m]×n[RP M]

9550 (2.1)

The speed and power output from the pneumatic motor can be regulated by either regulating the air volume or pressure of the system. In terms of regulating the air volume, speed can be varied by throttling the exhaust air, while power and torque can be varied through throttling of the air inflow to the motor. Speed, torque, power and air flow can be regulated by varying the operating pressure of the system. In terms of maximum allowable shaft load (assuming the bit being 25 mm away from the collet end) both motors are rated to sustain 380 N axial force and 50 N of radial force.

(34)

Figure 2.7: The charachteristic of the pneumatic motors [15].

The pneumatic system on the rig is designed with a compressor that delivers 345 LPM, a hydraulic maintenance unit (to separate out water from the compressed air, add oil to the air flow for lubrication and choke the inlet pressure to the pneumatic motor), a pressure relief valve, a solenoid valve (to throttle the inlet pressure from 0-100 %), a pressure transmitter, a rotary union (to connect the air hose to the rotating shaft of the top drive) and three manual ball valves to 1) relief the pressure between the hydralic maintenance unit and solenoid valve, 2) relief the pressure between between the solenoid valve and pneumatic motor and 3) manually choke the air flow after the solenoid valve.

(35)

2.2. ADDITIONS TO FACILITATE FOR DIRECTIONAL DRILLING 14

Figure 2.8: Pneumatic system comprised of various components to regulate the air inflow, monitor pressure and lubricate the system.

For experiments, the 1st ball valve (between hydraulic maintenance unit and solenoid valve) can be opened during drilling to simulate a leak in the system (which is monitored by the pressure transmitter) or losses into the formation. The 3rd ball valve (manual choke) can be closed to simulate loss of hydraulics, or to tune the solenoid valve opening positions. In addition, a blind plug can be installed at the air hose outlet to simulate plugged nozzles (also monitored by the pressure transmitter). The pressure relief valve ensures that the operating pressure in the pneumatic motor at no time can exceed the maximum pressure rating of 6 bars, if for instance a different compressor is connected to the system, or if the hydraulic maintenance unit is bypassed for various reasons. For more details, see [17].

2.2.2 2-axis Actuator System

To faciliate for the Drillbotics® 2019 competition to drill a deviation well, a 2-axis actuator system has been developed to provide the following functionality:

• Shift between drilling with riser, whipstock or no lateral constraints above

(36)

the wellbore,

• Lower a whipstock into a pilot hole wellbore section,

• In the future, place a bearing around the drill pipe (which is mounted between actuators on the y-axis) and perform a comparative study on vibrations and the response to drilling with and without a constrained drill pipe.

Figure 2.9: Concept of mounting a riser and a whipstock on the 2-axis actuator system, allowing the system to drill a pilot hole through the riser, re-position and lower the whipstock into the pilot hole, and use the whipstock to kick off from vertical.

The actuators are operated by in total 4 × Nema23 stepper motors with 4 × Geckodrive G250X drivers, controlled by an individual Arduino Due microcon- troller. The two stepper motors used for lowering and raising the whipstock on the z-axis have a combined holding torque of 25.2 kg-cm while the two motors moving the whipstock and riser in the y-direction produce a holding torque of 49 kg-cm. This is to ensure that two z-axis actuators and a whipstock can be operated on the y-axis without operating close to the maximum torque of the stepper motors. The finalized design is shown in Figure 2.10 below:

(37)

2.2. ADDITIONS TO FACILITATE FOR DIRECTIONAL DRILLING 16

Figure 2.10: 2-axis actuator system as it was installed on the rig.

An illustration of the bit entering a whipstock (that has been positioned inside of a 165 mm deep pilot hole section) is given in Figure 2.11:

Figure 2.11: Bit enters the whipstock that has been lowered approximately 165 mm into a pre-drilled pilot hole.

For more details, see [17].

(38)

2.2.3 BHA components

Several additions have been added to the rig to facilitate for directional drilling.

These are whipstocks, a knuckle joint and various 3-cone drilling bits ordered from China to compare the drilling performance between 2-cone and 3-cone PDC drill bits. For more details, see [17].

Whipstock

Three different whipstocks have been developed with 5, 7 and 10 degrees build sections, that deviate from a vertical wellpath. The whipstocks have been de- veloped in Fusion 360, 3D printed in PLA, re-designed and 3D printed in 316L stainless steel at Promet. For more details, see [17].

Figure 2.12: The whipstock is developed with an entry cone at the top and a flat base for level positioning on the rock surface.

Knuckle Joint

A knuckle joint was developed in the team (see [17]) with the possibility of a 10 degree bend to provide the BHA with a bendable joint. The knuckle joint reliefs the drill pipe of the initial bend, when transitioning from drilling a vertical to a deviated section. The knuckle joint is thought used to control the build rate in the deviated well section, as part of the closed-loop steering system developed in section 9.4.

(39)

2.2. ADDITIONS TO FACILITATE FOR DIRECTIONAL DRILLING 18

Figure 2.13: Knuckle joint design, developed by Sander Skjørestad [17].

Drill bits

For details regarding the Baker Hughes drill bit provided by the Drillbotics® competition committee and the 2-cone and 3-cone bits acquired, see [17].

In short, the Baker Hughes poly diamond crystalline (PDC) bit provided has an OD of 1.25 in, a bit length of 1.25 in a back rake angle (BRA) of 25 degrees for the two cone cutters and 20 degrees for both shoulder cutters. Clearance at gauge pads is configurable from 0 to 0.15 in in such way that tungsten carbide avoid elements can get inserted to control either clearance or depth of cut (DOC).

(40)

2.3 Rig Sensors

The sensors that are installed on the rig are:

Figure 2.14: Rig sensors, including high-speed camera and acoustic sensor for research.

Rig sensors, are connected either to a high frequency data acquisition (DAQ) module (surface sensors; analog voltage and current signal), or directly to the PC (downhole sensors; digital I2C to microcontroller that transmits usb signal to PC).

Each sensor is regularly calibrated according to calibration procedure developed as part of the operating procedure for the drilling rig (provided at the rig).

2.4 Downhole Sensor Sub

2.4.1 Mechanical design

The sensor sub is a essential for several objectives during drilling, ranging from providing the driller with a visualization of the downhole conditions and wellpath to vibration classification, in real-time, while drilling. To do so, a versatile sensor sub design, that is both easy to access, maintain and independent of the other parts of the BHA, has been developed.

(41)

2.4. DOWNHOLE SENSOR SUB 20

Figure 2.15: Technical drawings of the sensor sub.

The sensor sub is designed for easy access, making it possible to open and close the sub in order to replace electronics in case of hardware-failure or damage to internal components. This can be done without interacting with other down- hole components which ensures quick replacements or repairs can be carried out if required. Two compartments inside of the house allows for either placing a sensor and a microcontroller (current configuration enabling real-time dataflow to surface), multiple sensors and a tiny controller with internal storage so that data can be accessed post drilling, or the positioning of strain gauges to measure the downhole torque in experiments. Figure 2.16 shows the sensor house when opened. From the housing there is a wire-channel which leads to surface. The OD of the sensor sub is lower than that of the drill bit (under gauge BHA) which ensures that the sub does not scrape along the walls of the wellbore (disturbing measurements if the sub is partially confined in the wellbore) as well as reduces the risk of the non-rotating BHA getting stuck, in particular when passing KOP.

Figure 2.16: CAD drawing of the sensor sub showing inside compartments.

The purpose of the sensor sub is to provide the bottom hole assembly with a sensor package that consists of accelerometers, gyroscopes and magnetomers, allowing the rig to calculate inclination build (dogleg), azimuth (heading), and if necessary the orientation of the BHA (in case of over-torque in connections). Hence, through

(42)

simple sensor equipment, the well trajectory can get calculated in real-time. In Figure 2.17, a cross-sectional view is provided to illustrate the compartments inside of the sub, as well as the thread pitch alignment of the sensor house and locking mechanism.

Figure 2.17: Cross-section analysis showing the dimensions of the sensor house design. The section analysis is used to ensure that thread pitch and depth of threads will match up once the sensor house is 3D printed.

2.4.2 Mechanical design - Stress simulation

In 2018, a novel BHA design was developed [6] for the Drillbotics® competition.

While the stabilizers and drill collars were developed to endure severe axial and lateral vibrations (> 300 N force), the flow channel that connected the sensor package, located in the near-bit stabilizer broke shortly after drilling with the BHA commenced (due to fatigue). For this purpose, a short study on five differ- ent load cases (static momentum stress, static stress for high WOB, static stress for overpull, structural buckling and burst pressure) for the sensor house was conducted, considering the threaded sleeve that is regarded as the weak point in the sensor house design.

The results from performing the stress simulations are found in Appendix A.

2.4.3 Sensor Package

The inside of the sensor house is fitted with two circuit boards. The sensor circuit board is a 9-DOF accelerometer, gyroscope and magnetometer (see Figure 2.18).

(43)

2.4. DOWNHOLE SENSOR SUB 22 The sensor allows the system to calculate the azimuth (magnetometer), inclination and roll (gyro) and vibrations in thex, y, z-directions (accelerometer).

Figure 2.18: Picture showing the combined FLORA 9-DOF Accelerometer/Gy- roscope/Magnetometer sensor [18].

The sensor circuit board is connected to the Adafruit Trinket M0 (see Figure 2.19) using 3V, GND, SCL and SDA connectors with a I2C communcation protocol.

From the Adafruit Trinket M0, a micro-USB cable is run to surface. There is already installed a slipring underneath the top drive. This allows for transmission of data from downhole even though the entire system is rotating. For directional drilling using a downhole motor, no slip-ring is required, as all parts other than the bit are stationary permitting a USB cable from running all the way to the PC. This is desirable since when the cable can be shielded in the high-noise area (drill floor surroundings), the risk of lost connection due to interference is greatly minimized. An oscilloscope has been used to measure the interference on and around the drill floor.

Figure 2.19: Picture showing the Adafruit Trinket M0 [19].

The data stream from the downhole sensor, to surface, is controlled by having a pulse generator in the control system transmit a pulse to request data actively;

simultaniously a pulse gets sent to the high frequency DAQ to request data from the surface sensors. This alleviates the problem of having multiple data sources that can lead to:

• The internal clocks in the Trinket microcontroller and high frequency DAQ are out of synch, causing data that is sampled at different times to be merged in the control system,

• An overflow of data is piled up in the buffer in the PC, so that the system either crashes or data from the sources is received in the control system with a delay.

(44)

There is however one challenge in using such pulse to synchronize sensor mea- surements taken from multiple sources. If it was not for the pulse, a watchdog timer could easily get implemented to detect anomalies in software, downhole microcontroller, PLCs or even in the control system, and reset the CPU if an incident occurs that causes temporary disconnection between PC and sensor (loss in communication). One could then re-initiate communication with the sensor, if for instance a brownout (a drop in voltage for parts of the system) causes a temporary disconnection from the control system. If a common pulse transmitted to all parts of the control system gets used however, a temporarily disconnection and reconnection could possibly cause instability in the dataflow, which is why such solution has not yet been tested or implemented.

2.4.4 Final Design

Upon receiving the 3D print, supports had to be removed, and all threads needed to get refurbished so that the components in the compartments within the sensor sub are properly sealed off from dust or mud. The inner threads of the sensor house was refurbished by drilling through a thread tap (to allow the flow channel to be bypassed), and fine threading the coarse threads in the sleeve.

Figure 2.20: Drilled through thread tap (left) and final results of refurbished threads (right). The tight fit of components inside is shown in the background.

After sand blasting each component while protecting the threads, and installing the sensors inside of the house, the end results is shown in Figure 2.21.

(45)

2.5. CALIBRATION OF SYSTEMS 24

Figure 2.21: End result of sensor sub in 316L stainless steel, equipped with a sensor board containing ten sensors and a small microcontroller within. A swivel connection (right) allows the sub to be directly con- nected to the pneumatic motor or to a knuckle joint when drilling deviated well sections.

2.5 Calibration of systems

2.5.1 Pneumatic Motor

Even if the pneumatic motor is not equipped with an encoder, bit RPM can get calculated in real-time by measuring the torque, pressure, and the solenoid valve opening position (controlled in %). While the top drive brake has been configured to prevent the motor shaft and the drill string assembly from rotating counter-clockwise, the inbuilt encoder of the top drive still measures the torque which is assumed equal in the BHA.

The speed of the downhole motor can be controlled by throttling either the input air flow, the exhaust air flow, or the pressure in the system, as is described in subsection 2.2.1. From Figure 2.7, it can be shown that at nominal torque, the nominal speed is approximately 50 %of the idling speed. This suggests that for motor 302916D, at nominal torque (= 2.1 Nm), the nominal speed is only 750 RPM (as is also confirmed by supplier of motor).

Since the input air flow and pressure are both regulated by the solenoid valve opening position, the first step to calculate the downhole RPM is to use a high frequency camera to measure the number of revolutions per second of the bit at different valve opening positions. A framerate of approximately 150 Hz was selected, since at 1500 RPM only a framerate higher than 25 Hz is required to track 25 revolutions of a pixel per second. The experimental setup is shown in Figure 2.22.

(46)

Ekaterina Wiktorski at the University of Stavanger has developed an approach to use pixel tracking to measure the vertical- and horizontal displacement of the drill string. This allows vibrations in the drill string to get measured without attaching sensor equipment to the pipe, thus affecting the natural frequency of the system [20]. Using the same algorithm, the vertical displacement of an isolated pixel is tracked using an algorithm written in MATLAB, and the frequency that the pixel occurs with is then used to determine the number of revolutions per second.

Figure 2.22: High frequency camera is used to measure the idle speed of the pneumatic motor at different solenoid valve positions (60 to 100

%). Pylon Viewer is used to configure the camera capture settings.

Figure 2.23: Vertical displacement of a pixel at 90 % solenoid valve opening.

(47)

2.5. CALIBRATION OF SYSTEMS 26

Figure 2.24: Frequency of pixel occuring in the same position, so that bit RPM can be calculated.

The RPM can then be calculated by the following equations:

RP M =−0.4509×(V alveopening)2+ 88.289×(V alveopening)−3249.4 (2.2)

RP Midle= f×60

f r (2.3)

where f (frequency of occuring pixel) is given in Hz,f r (framerate of the camera) in Hz and the constant 60 refers to the number of seconds in a minute. For example, this suggests that for a 90% solenoid valve opening, the idle bit RPM is 1038.6, since the pixel occured every 17.31 Hz. This can be verified by manually counting how many images correspond to one full bit revoltuion, which in this case corresponded to between eigth and nine (150Hzf ramrate

8images = 18.75 Hz).

Knowing the idle RPM, the actual bit RPM can now be calculated in the system using linear regression.

RP Mactual,corrected=RP Midle

RP Midle

2

2.1 ×torquetopdrive (2.4)

(48)

This suggests that if the bit at 90 % solenoid valve opening is rotating at 1038.6 RPM and a torque of 1.2 Nm is registered, the actual downhole RPM and power produced is equal to:

RP M(rev/min) = 1038.6− 519,3

2.1 ×1.2 = 610RP M (2.5)

The power output can be calculated to be:

P ower= 1.2×610

9550 = 0.0766kW = 76.6W (2.6)

For the pneumatic motor that provides 2.1 Nm nominal torque and 1500 RPM idle speed, a characteristic using this approach can be created so that:

Figure 2.25: Bit RPMs for solenoid valve opening ranging from 60 to 100 %, corrected for 0 to 2.1 Nm torque.

2.5.2 Top Drive

For several experiments, the top drive is still used to provide the torque on bit.

Previously, the top drive has been controlled using Pulse Width Modulation (PWM). Due to the inconsistent PWM output from the logic controller, the top drive has been re-tuned using the analog output pins from the Arduino, that support an operating range of 0.55 V to 2.75 V.

(49)

2.5. CALIBRATION OF SYSTEMS 28 Through calibration, the top drive can now be controlled from 0 to 1500 RPM with an offset of only 1-2 RPM, which is a significant improvement compared to previous years where the offset has been as high as 50 RPM at certain rotational speeds. For more details regarding how the top drive gets tuned, see [5] and [6].

Command Value Unit

Analog velocity command scale 682 rpm/V Analog velocity command offset 450 mV Analog velocity command clamp level 10 rpm (or mm/s)

2.5.3 WOB Control

A brief introduction to the Proportional Integral Derivative Controller The PID controller is the most used controller for closed-loop systems in the industry and in equation 2.7 below the equation for the controller is shown (Sui, 2019) [21]:

u(t) =u0+Kpe(t) +Ki

Z t

0

e(τ)dτ +Kd

de(t)

dt (2.7)

In the following three subsections, each of the parameters that combined make up the PID controller gets described.

The PID controller block diagram is shown in Figure 2.26:

Figure 2.26: PID Controller block diagram illustrating the concept from setpoint (u), controller (P I D), process, output X(s) and error (e) [22].

Proportional controller (P controller)

The P controller is the first and simplest part of the PID controller. The output of this controller is the output of the proportional control mode with a bias added.

One needs to add the bias in order to maintain a given output while there is no

(50)

error. Equation 2.8 below shows how the output is calculated. The bias (u0) can be thought of as the “start value” of the loop, while the controller gain (kp) can be adjusted in order to change the output if necessary. The bias is what controls the error, u(t), and causes it to become 0 (Sui, 2019) [21].

u(t) =u0+Kpe(t) (2.8)

By increasing Kp, one will reduce the offset between setpoint and output and speed up the process response. On the other hand the system may oscillate or even become unstable. It’s important that the system has a realistic proportional gain. A high proportional gain will give the system big responses for the changes in the error but can also make the system unstable. On the other hand, a small change can make the system unreactive, thus not being able to handle larger changes in the system error (Sui, 2019) [21].

Proportional Integral controller (PI controller) In the PI controller the output signal is controlled by a sum of the proportional- and integral control.

Using equation 2.9 below, one can alter the control variable (Sui, 2019) [21].

u(t) =u0+Kpe(t) +Ki Z t

0

e(τ)dτ (2.9)

The integral part of the controller is added in order to tune the proportional controller in a direction that eliminates the steady state error. There are though negative sides to the adding the integral component such as a reduced response time and decreased stability of the system (Sui, 2019) [21].

Derivative controller (D controller)

The last part of the PID controller is the derivative controller. The D term, illustrated in equation 2.10 below is implemented with the purpose of predicting the future change and increase the stability of the model by considering the rate of change (Sui, 2019) [21].

u(t) =u0+Kdde(t)

dt (2.10)

Referanser

RELATERTE DOKUMENTER

“Synthetic decision making”. These games, designed as simplified land combat simulation models, are defined and some of their properties described. We give a theoretical and

The goal with this thesis is to explore machine learning and the possibilities of using machine learning to create a model that can predict the effect of

The main focus of our paper is to present an indication of what value Machine Learning can provide when making long-term stock predictions and trading based on

This thesis has sought to investigate the use of machine learning in the Norwegian aviation industry and how the number of air passengers potentially can be used as a

Different statistical and machine learning techniques are used to estimate models for predicting default; Logistic Regression, Decision Trees, Random Forest, Neural

• Based on the outcomes of our experimentation and analysis of the DLP data under study, we develop an intelligent machine learning model that is able to predict legitimate data

In this paper, we demonstrate a data poisoning attack towards classification method of machine learning models and we also proposed a defense algorithm which makes machine

The main objective of this thesis is to investigate to what extent sensor data combined with modern machine learning techniques can be used to improve the support in grid operation,