> ## Content Index
> Fetch the complete content index at: https://openlab.app/llms.txt
> Use this file to discover other available public pages before exploring further.

# WOB Auto Driller using Python Client
- URL: https://openlab.app/tutorial/wob-auto-driller/
- Published: 2023-01-25T09:39:37.000Z
- Updated: 2023-01-25T09:39:37.000Z
- Description: Learn how to drill a well with a WOB setpoint as oppsed to ROP
- Author: Andrew Holsæter
- Tags: Tutorial, Python, Simulation, #Import 2026-11-06 18:08

```
import openlab

username="INPUT CREDENTIALS FROM openlab.app"
apikey="INPUT API KEY HERE"
licenseguid="INPUT LICENSE GUID HERE"

config_name = "PUT CONFIGURATION NAME HERE"
initial_bit_depth = 2495

# WOB Setpoints
wob = 5 * 1000 # 5 metric tons converted to SI unit of kg
# WOB PI controller setpoints 
kp = 1.0 / 1e5 # proportional gain
ki = 1.0 / 1e6 # integral gain

# Login and authenticate to openlab
session = openlab.http_client(username=username, apikey=apikey, licenseguid=licenseguid)

sim = session.create_simulation(config_name, "WOB Example", initial_bit_depth)

# Apply the normal setpoints mandatory for drilling (apart from ROP)
sim.setpoints.FlowRateIn = 2000 / 60000 # 2000 l/m to SI unit of m^3/s
sim.setpoints.SurfaceRPM = 100 / 60 # 100 RPM to SI unit of Hz
sim.setpoints.TopOfStringVelocity = 0.5 # 1.5 m/s to tag bottom, then it gets ignored

# Make the WOB setpoints
sim.setpoints.DesiredWOB = wob
sim.setpoints.WOBAutoDriller = True
sim.setpoints.WOBProportionalGain = kp
sim.setpoints.WOBIntegralGain = ki

# Make 300 steps
sim.step(1, duration=300)

sim.stop()
```