# Early detection of bad hole cleaning and stuck pipe

### This page is a description, demonstrator or executable versions of tools and methods.

users have rated this content. We would love to have your vote as well. Log in and rate!

## Algorithm

The algorithm computes a diagnostic feature for a sliding window of time series measurements. The algorithms need real-time measurements of topside torque (TRQ) and bottom hole pressure (BHP) but if the BHP is not available, it can be substituted with the standpipe pressure (SPP).

We first define the sample *skew* F1 and the normalized standard deviation F2 as follows:

where N is the number of samples in a sliding time window, xi is sample No. i and mu is the average and sigma the standard deviation of the N samples.

The algorithm consists of the following steps:

- Collect the last N samples of BHP and TRQ. Substitute BHP with SPP if BHP is not available.
- Over the N samples, compute the skew,
*F*_{1}, of each BHP - Over the N samples, compute normalized standard deviation,
*F*_{2}, of each TRQ vector - Compute the diagnostics signal F as the product of
*F*_{1}and*F*_{2}, i.e.*F*=*F*×_{1}*F*._{2} - Define the number,
*W*, of diagnostics values,*F*, to be used in a moving time window implementation. The moving time window is to be updated with a new*F*value once every*N*samples (see Figure 1). - For every update of the moving time window, detect the number,
*P*, of positive diagnostics signal values within the window (see figure below). - For every update of the moving time window, compute the ratio
*R*=*P*/*W*. - For every update of the moving time window, detect the maximum amplitude,
*A*_{max}, of the*P*positive diagnostics signal values within the window. - For every update of the moving time window, raise a warning if (
*R*>=*R*_{th}) & (*A*_{max}>=*A*_{th}), where*R*_{th}and*A*_{th}are predefined threshold values.

In this figure, for every Nth sample where N=4, F is computed. On top of that we define a sliding window of the last W F values where W=6. "P" is the number of positive F-values among these and R = P/W is the key diagnostic signal. Step 9 determines whether R signals danger or not.

The choice of N, W and the threshold values Rth and Ath is a matter of sampling rate and choice of sensitivity. It can be seen that the full window is N * W samples long. In our tests, we chose N so that the number of samples covered between one and three minutes.

We chose W so that the full window length (N*W) would correspond to between fifteen and thirty minutes.

With the common sampling rate of 1 Hz, N = 60 and W = 30 is a good starting point. Smaller windows will give earlier warnings but produce more false alarms.

For threshold values, Rth = 0.85 and Ath = 0.2 appears to be a good starting point. It's possible to dispense with Ath altogether by setting Ath = 0. Higher values of Rth and Ath give fewer diagnostic warnings.

## Intuitive interpretation

The BHP is a noisy measurement. Under normal conditions we expect the noise to show a statistical "normal distribution". The skew is a measure of whether or not noise is "lopsided", perhaps indicating that cuttings are temporarily restricting the flow and driving up the pressure. The normalized standard deviation of the torque meanwhile, captures how "erratic" the torque behaves, in a way that adjusts for the magnitude of the applied torque. with bad hole cleaning or impending stuck pipe, we may be seeing signs of stick-slip behaviour between the drillstring and the cuttings or wellbore wall, which would manifest as rapid swings in topside torque.

Earlier versions of this algorithm, as patented by Jardine and Remez-Cooper, integrated the diagnostic signal F over time. As F is supposed to average to zero under normal conditons, an alarm would be triggered whenever the magnitude of its integral crept above a given threshold value. The problem with this approach is that the integral would sweep up all kinds of fluctuations such as those caused by switching the pumps on and off and the integral would carry these fluctuations forward in the window, giving them undue weight. By instead counting the *number of deviations *of the F-value to either side, without reference to their magnitude, harmless operations no longer triggers an alarm.

Other key information