METHOD AND SYSTEM FOR LOCATING A DOWNHOLE TOOL IN STEEL-CASED HOLES

- ARAMCO SERVICES COMPANY

A method for locating a downhole tool in a wellbore involves obtaining, by the downhole tool, a pressure measurement in the wellbore, generating a first depth estimate based on the pressure measurement, and anticipating a passing of the downhole tool by a collar, based on the first depth estimate and a known depth of the collar. The method further involves, based on the anticipating of the passing of the downhole tool by the collar, performing, by the downhole tool, a collar detection, and based on the collar detection resulting in a detection of the collar: generating an updated depth estimate, and reporting the updated depth estimate.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of U.S. Provisional Application Ser. No. 63/543,493 entitled “METHOD AND SYSTEM FOR LOCATING A DOWNHOLE TOOL IN STEEL-CASED HOLES” and filed on Oct. 10, 2023, which is incorporated by reference herein in its entirety.

TECHNICAL FIELD

This disclosure relates to logging of subterranean wells. Specifically, it relates to determination of the location of a downhole logging tool within a well.

BACKGROUND

Position, orientation, and or speed of a downhole tool may be variables of high significance. For example, when a downhole tool obtains measurements, it may be important to know the depth at which the measurements were taken. However, finding orientation, speed, and position of a tool in a downhole can be challenging. Wireline tools may use the wire length as reference for the tool's position and spooling rate is related to the tool's speed. The wire tension may also be measured to account for the elongation in wire. Emerging as an alternative to wireline tools, untethered tools do not have any well-known method to estimate orientation, position, and velocity. The ability to accurately estimate depth may be highly desirable, for untethered tools, but also for other tools.

SUMMARY

This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used as an aid in limiting the scope of the claimed subject matter.

In general, in one aspect, embodiments relate to a method for locating a downhole tool in a wellbore, the method comprising: obtaining, by the downhole tool, a pressure measurement in the wellbore; generating a first depth estimate based on the pressure measurement; anticipating a passing of the downhole tool by a collar, based on the first depth estimate and a known depth of the collar; based on the anticipating of the passing of the downhole tool by the collar, performing, by the downhole tool, a collar detection; and based on the collar detection resulting in a detection of the collar: generating an updated depth estimate, and reporting the updated depth estimate.

In general, in one aspect, embodiments relate to an untethered device comprising: a tool comprising a pressure sensor and a processor, wherein the processor: obtains a pressure measurement from the pressure sensor, generates a first depth estimate based on the pressure measurement, anticipates a passing of the untethered device by a collar, based on the first depth estimate and a known depth of the collar; based on the anticipating of the passing of the downhole tool by the collar, performs a collar detection; and based on the collar detection resulting in a detection of the collar: generates an updated depth estimate, and reports the updated depth estimate.

In light of the structure and functions described above, embodiments of the disclosure may include respective means adapted to carry out various steps and functions defined above in accordance with one or more aspects and any one of the embodiments of one or more aspect described herein.

Other aspects and advantages of the claimed subject matter will be apparent from the following description and the appended claims.

BRIEF DESCRIPTION OF DRAWINGS

Specific embodiments of the disclosed technology will now be described in detail with reference to the accompanying figures. Like elements in the various figures are denoted by like reference numerals for consistency.

FIG. 1 shows several states of example untethered devices, in accordance with embodiments of the disclosure.

FIG. 2 shows a cross-sectional view of an example untethered device, in accordance with embodiments of the disclosure.

FIG. 3A shows a flowchart of a method in accordance with embodiments of the disclosure.

FIG. 3B shows a flowchart of a method in accordance with embodiments of the disclosure.

FIGS. 4A, 4B, and 4C show examples of magnetic field measurements in accordance with embodiments of the disclosure.

FIG. 5 shows a computer system in accordance with one or more embodiments.

FIG. 6 shows an example flowchart of an execution of a method in accordance with embodiments of the disclosure.

FIG. 7 shows an example of an execution of a method in accordance with embodiments of the disclosure.

DETAILED DESCRIPTION

In the following detailed description of embodiments of the disclosure, numerous specific details are set forth in order to provide a more thorough understanding of the disclosure. However, it will be apparent to one of ordinary skill in the art that the disclosure may be practiced without these specific details. In other instances, well-known features have not been described in detail to avoid unnecessarily complicating the description.

Throughout the application, ordinal numbers (e.g., first, second, third, etc.) may be used as an adjective for an element (i.e., any noun in the application). The use of ordinal numbers is not to imply or create any particular ordering of the elements nor to limit any element to being only a single element unless expressly disclosed, such as using the terms “before”, “after”, “single”, and other such terminology. Rather, the use of ordinal numbers is to distinguish between the elements. By way of an example, a first element is distinct from a second element, and the first element may encompass more than one element and succeed (or precede) the second element in an ordering of elements.

In general, embodiments of the disclosure include systems and methods for locating downhole tools in steel-cased holes. Knowing the location of a downhole tool may be important for various reasons. For example, a downhole tool may be configured to collect measurements of the properties of the wellbore. In order to enable interpretation of these measurements, it may be important to correlate the measurements with depth.

Unless stated otherwise, “depth” refers to the “measured depth” (MD) or distance along the wellbore from the surface end of the wellbore or from a reference elevation near the surface end, such as the top of the tree at the well, the top of the wellhead, or the Kelly bushing height on a rig when the well was drilled. It will be understood that the measured depth at a position along the wellbore is equal to the true vertical depth (TVD) from a reference elevation to the downhole tool for the case of a vertical wellbore, and the MD will be larger than the TVD if the wellbore departs from vertical within some interval above the tool, such as if the well is deviated or has a horizontal interval or lateral. It will also be understood that a small local change in TVD can be divided by the cosine of the wellbore deviation (angle of the wellbore with respect to vertical) to approximately determine the corresponding small local change in MD. It will also be understood that if a wellbore is filled between two points with a stationary fluid having density p, then the difference in pressure between the two points will equal the difference in TVD between the points times the density.

Embodiments of the inventive method form an estimate depth. The depth estimate may be obtained, for example, based on pressure measurements (along with knowledge of the wellbore deviation and wellbore fluid density) or based on measurements.of acceleration along the direction of the wellbore. In some embodiments, a recursive estimator, such as a Kalman filter, is used to generate the estimate of depth based on using a measurement of pressure or acceleration to update a previous estimate of depth. In some embodiments, a recursive estimator forms an estimate of a state vector comprising a vehicle depth and optionally additionally comprising a vehicle speed (or time rate of change of depth). In some embodiments, a recursive estimator begins with an initial estimate of depth and updates the estimate at steps in time based on the dynamics of motion and corrects its estimate based on sensor measurements. In some embodiments, a recursive estimator such as a Kalman filter forms an estimate of both a state vector (such as a depth or optionally a depth and a speed) and a characteristic of the uncertainty in the estimate of the state vector such as a variance or a covariance matrix characterizing the uncertainty in the estimate of the state vector.

Subterranean wells are commonly lined with steel casing which prevents the wellbore from collapsing and isolates the fluids inside the well from fluids in the surrounding rock formations. This casing is constructed from joints of steel pipe connected end-to-end by couplings. Within the casing is often production tubing. The production tubing serves to convey fluids from a subsurface reservoir at the bottom of the well to the surface and protects the casing from corrosive or damaging effects of the fluid. The production tubing is constructed from joints of steel tubing connected end-to-end. Whether the untethered device is operating within the production tubing or within casing where there is no tubing, or within the annulus between casing and tubing, it is surrounded by joints of pipe connected end-to-end. The measured depth of each such pipe joint is typically determined when the casing or tubing are run into the well. Thus the connections between pipe joints can serve as reference points of known depth. In one embodiment these connections are detected by associated fluctuations of magnetic field inside the casing. In another embodiment, these connections are detected by acoustic measurement of the interior gaps between pipe joints. In another embodiment, these connections are detected by a casing collar locator which senses the thicker steel at the locations of the couplings between pipe joints. With all these techniques, the depth of the connections is accurately know, but there may be uncertainty associated with the detection of the connections such that there are some missed detections (where the untethered device passes a connection without detecting it) and some false detections (where noise in the detector leads the untethered device to believe that a connection has been detected when no connection is actually present.) The inventive method utilizes depth information from detections of pipe joint connections even when there are occasional missed detections and false alarms.

In order to improve depth accuracy compared to what would be possible using a recursive estimator operating on pressure and acceleration data alone, the depth estimates are verified against and updated based on other known data. It may not be clear whether a particular detection of a pipe connection is a false detection or which connection depth it is associated with. The inventive method is a way to carry forward multiple hypotheses about which if any pipe connection is associated with each detection, use the variances calculated by the recursive estimator for the depth estimates under each hypothesis to evaluate the relative likelihood of that hypothesis, and reject unlikely hypotheses and carry forward only the most likely candidate hypotheses.

Specifically, embodiments of the invention make use of the known location of casing collars at the joint locations between adjacent pipe sections. Based on a comparison of the estimated depth at a location where a collar is detected, a new hypothesis may be generated. Starting at that point, a Kalman filter based on the initial hypothesis and a Kalman filter based on the new hypothesis may be executed to generate separate depth estimates. Any number of additional hypotheses may be generated, as the downhole tool passes additional collars. The estimation accuracy of the hypotheses may be compared (based on known collar location), and the most accurate depth estimate may be relied upon by other operations performed by or associated with the downhole tool.

In one embodiment, each hypothesis is a set of associations between connection or collar detections and specific connection depths. In one embodiment, each hypothesis has a likelihood function associated with it which is the product of the likelihood functions of the individual detections based on the estimated depths and depth variances when the detection took place. Optionally, instead of multiplying the likelihood functions, their logarithms are added. Optionally, considering a detection to be a false alarm and not assigning it to a specific connection depth can be assigned a penalty which is multiplied to the likelihood function or added to the log likelihood function. Optionally, skipping a connection by considering the connection not to have a detection (missed detection) can be assigned a penalty which is multiplied to the likelihood function or added to the log likelihood function. In one embodiment, the false alarm and missed detection penalties would correspond to the likelihood associated with a detection with a depth error of 0.2 to 2 standard deviations.

Embodiments of the disclosure have various benefits. Embodiments of the disclosure rely on the known location of pipe joint connections or collars. Typically, the length of each pipe and their order in a wellbore is known and recorded in a well completion report. Accordingly, the location of collars or connections can be assumed to be known with good accuracy. Thus, embodiments of the disclosure can use reliable location information to continuously adjust the depth estimates for improved accuracy. However, unlike purely collar-based methods which are limited to providing readings at the collar location, embodiments of the disclosure provide accurate depth estimates between collars as well. Embodiments of the disclosure use magnetometers for the collar detection. Unlike casing collar locators that exert a strong magnetic field on the steel casing to scan for changes in the distribution of magnetic field lines in presence of changes in metal thickness at the collar, a magnetometer does not need to actively generate a magnetic field. The use of magnetometers thereby avoids issues with the untethered device getting immobilized against the steel casing as a result of the strong magnetic field. Alternatively, any other type of casing collar locator may be used, without departing from the disclosure.

FIG. 1 shows several states of example untethered devices (100) (e.g., 100a, 100b, 100c, 100d) for measuring properties (e.g., collecting data) along a wellbore (101) to log the wellbore (101). In the example as shown, the wellbore is a steel-cased well bore. Two pipe sections (120, 121) and a casing collar (122) are shown, although the steel-cased well bore may include any number of pipe sections and casing collars. The properties measured along the wellbore (101) may be related to one or both of wellbore fluid (109) within the wellbore (101) or a rock formation (115) in which the wellbore (101) is formed. The untethered devices (100) are unattached (e.g., either directly or indirectly) to a surface (103) from which the wellbore (101) extends. Accordingly, no depth information may be obtained based on wire length of a wireline. The untethered devices (100) are deployable to the wellbore (101) to move (e.g., sink) in a downhole direction (105) through the wellbore fluid (109) while logging the wellbore (101) (e.g., refer to 100a), to sufficiently increase their buoyancy when the untethered logging devices (100) reach a target depth (111) along the wellbore (101) (e.g., refer to 100b), and to consequently move (e.g., rise) in an uphole direction (107) through the wellbore fluid (109) towards the surface (103) while logging the wellbore (101) (e.g., refer to 100c), whereas the ballast may sink (e.g., refer to 100d). Embodiments of the disclosure enable an estimation of the current depth of the untethered device (100) as the untethered device (100) moves in the wellbore (101). A detailed description of the depth estimation is subsequently provided. While FIG. 1 illustrates a scenario involving an untethered device, embodiments of the disclosure may be used in conjunction with other devices, including tethered downhole devices.

FIG. 2 shows a cross-sectional view of an example untethered device (100), in accordance with embodiments of the disclosure.

In one or more embodiments, the tool (200) includes circuitry (230) that controls various functionalities of the untethered device (100). In some embodiments, the circuitry (230) includes one or more processors (238). The circuitry (230) may further include additional components such as a receiver (232), a transmitter (234), and a controller (236). The tool (200) may also include an internal battery (240) that powers various components of the untethered device (100).

In one or more embodiments, the one or more processors (238) may execute a method as further described below in reference to FIGS. 3A and 3B. Alternatively, the method may be executed by any other computing system, e.g., a computer system as shown in FIG. 5.

In one or more embodiments, the tool (200) includes sensors (250). The sensors (250) may measure physical, chemical, geological, or structural properties along the wellbore (101) to log the wellbore (101). The measurements may be continuously performed. Example properties include elapsed time, temperature, pressure, acceleration, fluid density, fluid viscosity, fluid flow rate, magnetic field, gamma ray intensity, tool acceleration, tool rotation, and other parameters. The continuous measurements may be acquired while the tool (200) both descends and ascends through the wellbore fluid (109). In one or more embodiments, the sensors (250) include one or more magnetometers. The magnetometer(s) may be used to locate a casing collar as the untethered device passes a casing collar, e.g., as illustrated in FIG. 1. The magnetometer(s) may monitor the residual magnetic field inside the steel casings. Steel casing pipes are magnetized during their manufacturing and handling processes. Therefore, a magnetic field is formed inside a pipe that varies along the length and radius of its borehole. The magnetic fields are conserved and can be repeatedly acquired. The magnetic field varies along the length (or depth) of the steel casing. More noticeably variations may occur at the casing collars, thus making the casing collars detectable in the magnetometer readings. A detailed description of the magnetometer readings and their use is provided below in reference to the flowcharts of FIGS. 3A and 3B. Other types of collar locators may be used, without departing from the disclosure. In one or more embodiments, the sensors include one or more acceleration sensors.

During the logging operation, the transmitter (224) may send data carrying the real-time measurements to one or more devices located at the surface (103) for further processing of the data. Alternatively, the data may be stored for later retrieval.

As previously noted, the untethered device (100) is configured to change its buoyancy in order to move in an uphole direction (107), e.g., after reaching a target depth (111). The change in buoyancy is achieved by releasing the ballast weight (206). Releasing of the ballast weight (206) may be achieved by dissolving the ballast weight (206) and/or by releasing the ballast weight (206) using a release mechanism (204), e.g., a magnetic release mechanism, activated by the controller (236). Upon release of the ballast weight (206), an overall (e.g., bulk) density of the untethered device (100) decreases (e.g., instantaneously) to a value that is less than that of the wellbore fluid (109). Accordingly, the untethered device (100) (e.g., the functional module remaining after release of the ballast weight (206)) is buoyant enough to float in the uphole direction (207) (e.g., referring to 100c in FIG. 1) to be retrieved at the surface (103). In this way, connection or disconnection of the ballast weight (206) governs whether the untethered device (100) descends (e.g., sinks) in the downhole direction (105) or ascends (e.g., floats upward) in the uphole direction (107) through the wellbore fluid (109).

While FIG. 2 shows an untethered device in a particular configuration, embodiments of the disclosure are applicable to other types of untethered devices and downhole tools in general. For example, an untethered device may be equipped with a bladder that can be emptied or filled with water using a pump to change the effective buoyancy, may rely on fluid flow to move, or may have active means to move such as propeller and movable fins.

FIG. 3A shows a flowchart for a method (300) in accordance with embodiments of the disclosure. The method (300) may be used for locating a downhole device in a steel-cased well. While the various steps in FIG. 3A are presented and described sequentially, one of ordinary skill in the art will appreciate that some or all of the steps may be executed in different orders, may be combined or omitted, and some or all of the steps may be executed in parallel. Furthermore, the steps may be performed actively or passively.

Broadly summarized, the method determines the depth of an untethered tool using a combination of a recursive estimator which optionally also provides estimate uncertainties (such as a Kalman filter), a device for locating pipe connections, such as a magnetometer-based casing collar locator, and prior information of connection depths. The flowchart identifies operations that involve generating (e.g., using the Kalman filter) a depth estimate based on a pressure measurement. Based on the depth estimate, the passing of the downhole tool (e.g., as it is sinking) by a collar is anticipated. When the collar is detected, an update depth estimate is generated based, and the updated depth estimate is reported. A detailed description is subsequently provided, following a brief introduction of the Kalman filter that can be used to generate depth estimates and estimate uncertainties.

Table 1 summarizes a Kalman filter used in accordance with embodiments of the disclosure. The table is based on standard notation, e.g., as commonly used, to describe linear time-invariant systems (Reference notation can be found in Welch, G. (1995). An introduction to the Kalman filter. International Conference on Computer Graphics and Interactive Techniques.).

TABLE 1 Kalman Filter Equations Name Equation Definitions State vector: x k = [ d . k d k ] dk: traversed depth at the kth iteration since last reference {dot over (d)}k: average speed at the kth iteration State transition matrix A k = [ 1 0 dt 1 ] dt: time elapsed since last estimation Observation matrix that Hk = [0 ρk cosθk] ρk: fluid density (known, relates state vector to measured, or estimated) pressure measurement θk: well deviation angle from the vertical (known, measured, or estimated) Covariance matrix for process noise Q k = [ d t 2 d t 3 / 2 d t 3 / 2 d t 4 / 4 ] σ a 2 σa: standard deviation of the tool acceleration or acceleration measurement Covariance for pressure Rk = σm2 σm: standard deviation of measurement noise the pressure measurement Estimation covariance matrix P k = [ σ d . 2 0 0 σ d 2 ] σd: standard deviation of the depth estimation σ{dot over (d)}: standard deviation of the speed estimation Priori estimate (projection) of {circumflex over (x)}k- = Ak−1{circumflex over (x)}k−1 {circumflex over (x)}k−1: Previous state state based on the dynamic estimate (expected value model and the previous state of xk) {circumflex over (x)}k-: Priori estimate of current state Priori estimate (projection) of Pk- = Ak−1Pk−1Ak−1T + Qk−1 Pk−1: Previous covariance covariance based on the estimate previous estimation Pk-: Priori estimate of covariance current covariance Kalman Gain based on the Kk = Pk-HkT(HkPk-HkT + Rk)−1 priori covariance estimation and measurement covariance Relative pressure ΔΠk = Πk − Πk,ref zk: measured differential measurement pressure Πk: measured hydrostatic pressure Πk,ref: measured hydrostatic pressure at the last depth reference Posteriori state estimation {circumflex over (x)}k = {circumflex over (x)}k- + Kk(zk − Hk{circumflex over (x)}k-) based on the priori estimation and measurement Posterior estimation Pk = (I − KkHk)Pk-(I − KkHk)T + covariance in Jospeh form KkRkKkT Estimated absolute depth dk,abs = Hk{circumflex over (x)}k + dk,ref dk,abs: absolute estimated based on the posteriori depth relative depth estimation and dk,ref: last reference depth reference depth

The set of equations above is for a Kalman filter that operates on pressure measurements. If an accelerometer is added to the system, the accuracy of the dynamic model estimation may be improved. In the case of an added accelerometer, the following modifications may be made:

TABLE 2 Extension of Kalman Filter Equations to Accommodate Acceleration Input Input transition matrix B = [ d t d t 2 / 2 ] Priori estimate (projection) {circumflex over (x)}k+1- = Ak{circumflex over (x)}k + Bkuk uk: measured of state in case of a control acceleration or other input control input

Turning to the flowchart of FIG. 3A, in Step 302, an initial hypothesis for the execution of the recursive estimator (e.g., the Kalman filter) is established. The initial hypothesis may be based on the downhole tool being released into the well. This may allow setting the initial conditions for the Kalman filter to a 0-ft depth and 0-ft/s speed. The initial hypothesis may be adjusted, based on what is known at the time of the initial execution of the Kalman filter.

In Step 304, a pressure measurement is obtained. Optionally, an acceleration measurement may be obtained as well. As indicated in the flowchart, measurements may be periodically obtained, e.g., based on a measurement time interval Δt. At may be 0.01 s to 10 s, for example, in case of a typical downhole tool moving between 0-10 ft/s.

In Step 306, a depth estimate is generated based on the measurements, and using the hypothesis. When Step 306 is executed for the first time, the number of hypotheses is equal to the number of initial hypotheses, established in Step 302. If only one initial hypothesis exists, the estimation algorithm used in Step 306 may be parameterized using the initial hypothesis. Later, Step 306 may be executed for multiple hypotheses that may have been generated as further discussed below, and these hypotheses may be used to parameterize the estimation algorithm.

The depth estimate may be made using recursive estimation (e.g., using a Kalman filter). Based on the nature of the Kalman filter, depth estimates are made iteratively and periodically, e.g., in a loop. The Kalman filter, when executed in a loop, can be refreshed for each pressure (and optionally accelerometer) measurement, or at a reduced frequency. A higher frequency execution consumes more computing resources and, thus, energy, but may increase the accuracy and resolution of the depth estimate.

The Kalman filter may use a physical model of the downhole tool and a depth measurement that is derived from the pressure measurement. The physical model estimates the depth based on the equation of motion (1)

d = d 0 + d ˙ Δ t + 1 2 d ¨ Δ t 2 , ( 1 )

where d is absolute depth, d0 is reference depth, {dot over (d)} and {umlaut over (d)} are average linear speed and acceleration during the time interval Δt, respectively. If the fluid density is known and stays constant through the traveled depth, change in pressure can be used to calculate depth (2):

d = d 0 + Δ ρ cos θ , ( 2 )

where ΔΠ is change in pressure, ρ is the fluid density, and θ is the well deviation angle from the vertical. The fluid density may be known, measured, or inferred from other measurements. For example, a density sensor may be placed on the tool to monitor density. Alternatively, the transient response of the pressure measurement may be monitored. More specifically, the buoyant force becomes smaller in oil compared to water due to smaller density while the drag force becomes larger due to larger viscosity. This makes the tool to rise slower in oil. Accordingly, the pressure decrease rate, in oil is expected to be slower than in water. Thus, a correlation may be established to infer density from the pressure build up speed. The deviation angle is usually known from a deviation log ran after the well completion. Both physical model and pressure measurement are prone to errors due to factors such as process noise or measurement noise. These tend to be Gaussian-type noise that may be characterized and, thus, may be known. Embodiments of the disclosure use the Kalman filter as an optimization algorithm that uses multiple sources of information to generate a depth estimate. The depth estimate (which is assumed to be optimal, based on the noise characterizations) takes a value between the measured and model-predicted values depending on their error/noise magnitude.

In Step 308, a test is performed to determine whether the depth estimate exceeds a known collar location. The depth estimate may be compared against the known casing collar depths. In other words, the passing of the downhole tool by the collar is anticipated, based on the depth estimate and based on the known collar location. The comparison may include waiting until the downhole tool passes the collar depth by a preset depth tolerance window. This depth tolerance window may establish a range of, for example, between 5-20 ft depending on the confidence in the depth estimate. Until, based on the test, the depth estimate exceeds the known collar location, the method may proceed with the execution of Step 304. Once the depth estimate exceeds the known collar location, the execution of the method may proceed with Step 310.

In Step 310, a collar detection is performed. The collar detection may involve analysis of logged magnetic field data obtained from the one or more magnetometers of the downhole tool. The axial component of the magnetic field (along the borehole axis) may be a better indicator for the presence of a collar, because radial components may also change swiftly due to distance changes from the casing wall. Accordingly, in one embodiment, the axial component is analyzed. The collar detection may be based on any other measurement principle, without departing from the disclosure.

The magnetic field data may be analyzed for a depth interval starting from a tolerance length before the assumed collar location (based on the depth estimate) to a tolerance length after the assumed collar location. The tolerance length may be set to ensure that, even in presence of uncertainty associated with the depth estimate, the magnetic field data for the depth interval captures the passing of the downhole tool by the collar. Limiting the analysis of the magnetic field data to a depth interval may provide a first pass elimination of potential false positives that may be present in the magnetic field data. A filter may be applied to the magnetic field data in the depth interval to extract the collar location. One type of filter may compute the first derivative of the magnetic field amplitude with respect to time or depth, e.g., as shown in FIG. 4B. The differentiation may increase the visibility of the collar location in the magnetic field data because magnetic field changes associated with the presence of a collar tend to occur faster than magnetic field changes that are present for other reasons. Another type of filter that may be used is based on a matching filter where a filter waveform(s) in the shape of the expected magnetic field waveform(s) around the collar is convoluted with the magnetic field data. In this filter, the convolution produces a large and easy-to-detect amplitude where the agreement is strong between the two signals.

In Step 312, if a collar is not detected, the method may proceed with the execution of Step 304. Alternatively, if a collar is detected, the method may proceed with Step 314. Multiple collars may be detected in Step 312, with one of the detections corresponding to the actual collar and the other detection(s) being false detections. However, because it may not be possible to distinguish between true positive and false positive detections, the subsequently performed steps may be performed for all detections.

Briefly summarized, the subsequently performed steps evaluate the collar detections made using a Bayesian approach based on the estimated depth and the expected or known depth. At each collar detection a new hypothesis is created with the state inherited from its parent hypothesis. Therefore, a newly created hypothesis is a version of its parent with a small correction applied to its estimated depth. The parent continues to exist without the correction. New weights are assigned to both parent and child hypotheses based on a Bayesian probability. The child hypotheses start with new Kalman filters whose reference depth starts from the depth of the detected collar. The parent hypothesis continues with its Kalman filter assuming that the detected collar was false. As many hypotheses are created, the ones with the lowest probabilities may be eliminated. The algorithm as described is performed by execution of the subsequently discussed steps.

In Step 314, based on the detection(s) in Step 312, a new hypothesis is generated for each detection. The new hypothesis claims that the detected peak at a specific depth belongs to the collar at this depth. Therefore, the new hypothesis corrects the estimated depth of its parent to align the estimated depth to the known depth of the collar. Accordingly, in Step 314, a discrepancy between the depth estimate and the known depth may be determined in. Then, the new hypothesis may be generated such that it corrects for the discrepancy. In other words, the known depth of the detected collar is set as the reference depth for the subsequent execution of a new Kalman filter associated with the new hypothesis. Referring to the example shown in FIG. 4C, a new hypothesis will be created with 1 ft correction to the depth estimate of its parent because the collar detection (based on the depth estimate) was 1 ft below the expected or known depth. This correction may be performed using different methods. In one method, all the depth points from the last reference to the correction point may be shifted at the same correction amount. In another method, all the depth points from the last reference until the correction point may be multiplied by a correction factor. Optionally, the density value used to calculate depth from pressure may be divided by this correction number. Updating the density may be beneficial where density changes are expected but cannot be measured.

In Step 316, weights are generated for the hypotheses. One weight is generated for each of the hypotheses. The weight may be designed to reflect the accuracy of the predictions made using the corresponding hypothesis, which may facilitate elimination of poor hypotheses, and selection of one that explains the collar detection intervals best, i.e., with a high prediction accuracy. The weight calculation may be performed using different methods.

The first weighting method is as follows:

W c h i l d = T R × W p a r e n t , ( 3 ) W p a r e n t , n + 1 = F R × W p a r e n t , n , ( 4 )

where Wchild is the weight of the new hypothesis and TR is true detection rate of the collar detector. Accordingly, a child hypothesis is established with a weight based on its parent's success in matching the estimated depth of the collar to the expected or known depth and the detector's success in detecting collars. The parent's weight is also updated after passing a collar depth. The parent continues to exist with the assumption that there was a false negative at the depth of the collar. Therefore, its weight is updated by rescaling of its value by a false detection rate, FR. If detector characteristics are known statistically, Bayes' rule can be used to find TR and FR. The Bayesian probability can be defined as below:

T R = P ( Collar exists | Collar detected ) = P ( Collar detected | Collar exists ) × P ( Collar exists ) P ( Collar detected ) , and ( 5 ) FR = P ( Collar exists | Collar not detected ) = P ( Collar not detected | Collar exists ) × P ( Collar exists ) P ( Collar not detected ) . ( 6 ) This may be understood as : TR = T P R T P R + F P R × exp ( - ( RealDepth - D e t e c tionDepth ) 2 2 σ depth 2 ) , and ( 7 ) FR = F N R T N R + F N R , ( 8 )

where TPR and FPR are true and false positive rates of the detector, and TNR and FNR are true and false negative rates of the detector. These ratios are indicative of how selectively the detector detects or rejects a collar. RealDepth is the expected depth of collar, DetectionDepth is the depth of detected collar according to the parent hypothesis, σdepth2 is the expected or measured variance in depth. In (8), P(Collar exists) is set to 1 based on the assumption that there is a collar at this depth, e.g., based on the casing tally, or completion report. The standard deviation, σdepth, can be assumed a constant, or can be extracted from the Kalman filter's estimation covariance matrix, P, such that:

σ depth = P ( 1 , 1 ) . ( 9 )

In a second weighting method, TR and FR may be founds as follows:

T R = T P R T P R + F P R exp ( - ( RealDepth - D e t e c tionDepth ) 2 2 σ depth 2 ) , and ( 10 ) FR = F N R T N R + F N R ( 1 - exp ( - ( RealDepth - D e t e c tionDepth ) 2 2 σ depth 2 ) ) . ( 11 )

This modification to the calculation of FR favors either the child or the parent. For example, in an extreme case where the child is created when the detected collar depth matched exactly the expected collar depth, FR becomes 0. In another case when the detected collar depth is far from the expected collar depth, TR will be small while FR will be large. If there are multiple children born due to multiple detections, the smallest calculated FR is used to weight the parent.

In order to simplify the calculations, the weighting calculations may be performed using logarithms. This approach eliminates the exponentials, and the weighting may be performed using summation instead of multiplication such that

W c h i l d = T R + W p a r e n t , and ( 12 ) W p a r e n t , n + 1 = F R + W p a r e n t , n . ( 13 )

In Step 318, if the number of hypotheses exceeds a specified limit, the execution of the method may proceed with Step 320. Alternatively, if the number of hypotheses does not exceed the specified limit, Step 320 may be skipped, and the execution of the method may proceed with Step 322.

In Step 320, one or more hypotheses may be eliminated to ensure that the number of hypotheses does not exceed the specified limit. In one or more embodiments, the hypotheses with the lowest associated weights are eliminated. An increase in the number of hypotheses can become computationally costly when each of the hypotheses has to be evaluated. The operations of Step 320, thus, ensure that the computational cost is manageable.

In Step 322, the weights are normalized. In one embodiment, normalizing involves scaling the weights such that their sum is equal to 1. Increasingly small weights are, thus, avoided.

In Step 324, the depth estimate obtained using the hypothesis with the highest weight is used to decide on the depth, to be reported and make subsequent decisions such as changing trajectory, taking new measurements, labeling existing measurements, going to sleep etc.

While not shown in the flowchart, additional operations may be performed by the downhole tool. For example, the downhole tool may measure one or more properties within the well bore while Steps 304-324 are performed in loops. Also, while the flowchart is described in context of a downhole tool that is moving downward (sinking), the method is equally applicable to a downhole tool that is moving upward (rising).

In one embodiment, the range of fluid densities in the well may be known, but the absolute density measurement may not be available. For example, it may be known that a water well has fluid density changing between 0.98 and 1.05 g/cc. In another example, an oil well may contain oil, water and various emulsions where the density may change, for example, between 0.75 g/cc to 1.1 g/cc. Uncertainty of the density is reflected on the uncertainty of the depth measurement using pressure measurement. Depth error, or variance, can be calculated if variances of pressure measurement (σΠ2) and expected densities (or density measurements) (σρ2) are known. Since the depth measurement is inversely proportional with the density, the equation can be linearized around the mean value of the density, μρ as in (14).

d = d 0 + Δ ρ μ ρ cos θ ( 14 )

Then, assuming pressure and density are independent variables, the depth measurement variance can be calculated as

R = σ m 2 = ( 1 μ ρ cos θ ) 2 ( σ 2 σ ρ 2 + σ ρ 2 μ 2 + σ 2 μ ρ 2 ) ( 15 )

where σm2, σΠ2, σρ2 are the depth, differential pressure, and density variances, respectively. μρ and μΠ are the mean values of the measured density and differential pressure, respectively. The measurement variance, R, can be varying as the variances and mean values of the differential pressure and density may be changing over time while the tool is moving.

The algorithm in FIG. 3A can be modified to handle uncertainties in the density. For example, in step 302, multiple initial hypotheses can be used instead of one. A set of initial hypotheses can be constructed where each one assumes a different fluid density in the expected range of densities. These densities are used to convert pressure measurements to depth measurements within the Kalman filter. Hypotheses that use the correct density would have a higher chance to create children with a higher weight during the weighting process 316 because depths of detected collars will register at a better accuracy with the expected collar depths.

If the density is expected to change during the tool operation (e.g., oil well fluids may become stratified as oil column at the top and water column at the bottom), it is kept as a state variable in the state vector whose value can be measured or inferred. As explained in pa. 41, after a child hypothesis is created, a correction may be applied to the estimated depths starting from the last reference depth such that the estimated collar detection depth matches the true depth of that collar. This correction can be a scale factor that is applied to the density variable. As an example, if the expected distance between two collars is Δdreal and estimated depth shows Δdest between the two collars, the density can be corrected as in (16).

ρ N + 1 = Δ d e s t Δ d r e a l ρ N ( 16 )

where ρN is the previous density that is used for the estimation and βN+1 is the corrected density that will be used for the oncoming estimations until the next collar detection event. This process can be repeated for each time a child is born to constantly tune the density. If the corrected density of the new hypothesis is outside the expected range of densities, this hypothesis is eliminated. This elimination can take place between the steps 314 and 316 before a weight is assigned.

FIG. 3B shows a flowchart for a method (330) in accordance with embodiments of the disclosure. The method (330) may be used for locating a downhole device in a steel-cased downhole. While the various steps in FIG. 3B are presented and described sequentially, one of ordinary skill in the art will appreciate that some or all of the steps may be executed in different orders, may be combined or omitted, and some or all of the steps may be executed in parallel. Furthermore, the steps may be performed actively or passively.

Broadly summarized, the method merges two kinds of data about the measured depth (or distance along the well) of the untethered device: (a) detections of magnetic field anomalies that may correspond to collars that connect pipe sections and (b) sensor data which provide continuous though imperfect information about depth. After each detected pipe connection, a Kalman filter is restarted. The Kalman filter estimates (a) the additional distance travelled since the detection of the collar and (b) the variance of this distance estimate. To be robust in the case of missed detections or false detections of collars, multiple hypotheses about which collar was last detected are evaluated and kept active until they can be ruled out based on a low likelihood score.

Let x be a state vector which includes as its elements the distance the untethered device has travelled along the well since the last detected collar, d, and the velocity of the sensor along the well, {dot over (d)}. The state vector changes over time as the sensor moves within the well, and xk will be the state vector at the k-th time step, where the time between steps is dt. For example,

X k = [ d ˙ k d k ] ( 17 )

As time passes, the sensor moves in the well, and the state vector changes according to:

x k + 1 = A x k + B u k + w k . ( 18 )

In this case,

A = [ 1 0 dt 1 ] . ( 19 )

The first row of A requires the new velocity to be equal to the old velocity. The second row of A requires the new distance to be the old distance plus the additional distance that the sensor would have travelled in time dt at its current velocity.

The additive term Buk describes the effect of any deterministic adjustments to the state vector. If the additional sensor is an accelerometer, then its measurement of the acceleration along the direction of the well can be uk. In this case,

B = [ dt 1 2 dt 2 ] , ( 20 )

which states that the change in velocity is dt times the acceleration and the change in distance due to the acceleration over time interval dt is equal to (1/2) dt2, though this second term generally has a small enough effect on distance that it can be ignored. The error in this model for the new state is captured in wk, which includes random forces that may act on the sensor due to bumps with the casing, turbulence in the well, etc. as well as error in any accelerometer measurement. This error has a covariance matrix Qk.

If there are additional sensor measurements that depend on one or more elements of the state vector, these will be included in a vector z. The matrix Hk relates the measurements zk to xk. Let v represent the noise or uncertainty in y, where Rx is the covariance matrix of vk, given the variance of each element of vk and the covariances between elements of vk. It is assumed in this example that the elements of vk are uncorrelated over time, such that all the elements in vk+1 are independent of all the elements of vk.

z k = H k x k + ν k ( 21 )

For example, if the additional sensor measures pressure, the local density of the fluid in the well is ρk, and the local deviation of the well is θk, then Hk=[0 βk cos (θk)]. The vector zk provides the change in pressure since the last collar was detected, i.e., the change in pressure that corresponds to the distance in the state vector, which is measured from the last collar.

Based on this model, an estimate of the state vector at each time step k can be established as:

x ^ k = x ^ k _ + K k ( z k - H k x ^ k _ ) ( 22 )

    • where {circumflex over (x)}k, priori estimate (projection) of state based on the dynamic model and the previous state

x ^ k _ = A k - 1 x ^ k - 1 + B k - 1 u k - 1 ( 23 )

The covariance matrix is:

P k = ( I - K k H k ) P k - ( I - K k H k ) T + K k R k K k T ( 23 )

where Pk, priori estimate of the covariance matrix, and Kalman gain, Kk are defined as

P k - = A k - 1 P k - 1 A k - 1 T + Q k - 1 ( 24 ) K k = P k - H k T ( H k P k - H k T + R k ) - 1 ( 25 )

A running estimate of the distance the sensor has travelled since its last reference point (known collar) may thus be generated based on the velocity of the sensor, and the covariance in the estimates of these properties.

Turning to the flowchart of FIG. 3B, in Step 332, the known collar data are obtained. In contrast to the continuous information from additional sensor data, the magnetic field data provides information at irregular times. To make use of these data, the known depth of the collars is relied upon as a reference. The known collar data may be provided in any form, e.g., in the form of a list or a table. For example, collar 0 may be assumed to be at a depth of Oft, collar 1 is known to be at a depth of 10 ft, collar 2 is known to be at a depth of 53 ft, collar 3 is known to be at a depth of 88 ft, etc.

In Step 334, a measurement is obtained. The measurement may include, for example, an acceleration and/or pressure measurement.

In Step 336, running depth estimates are generated. A separate Kalman filter as previously introduced may be used to generate each of the running depth estimates. One estimate is generated per hypothesis. Each Kalman filter is executing based on the assumption that the hypothesis is true. Hypotheses are discussed in detail below, in the description of Step 342.

Steps 334 and 336 may be executed at a fixed rate, e.g., using a time step Δt, as previously discussed in reference to FIG. 3A.

In Step 338, a collar detection is performed. The detection may be performed as previously described in reference to FIG. 3A.

In Step 340, if, based on the execution of Step 338, a collar is detected, the execution of the method may proceed with Step 342.

In Step 342, hypotheses are generated for the next (N+1st) collar, i.e., the collar detected in Step 342. The hypotheses may be generated based on previously hypotheses. For each of the old hypotheses the following possibilities are considered (assuming here that the previously detected feature in the old hypothesis list was N):

    • The current detection is a false detection. Apply the false detection likelihood penalty to the likelihood function for this hypothesis.
    • The current detection was collar N+1. As a result, the true depth zT is the depth of collar N+1.
    • The current detection was collar N+2. As a result, the true depth zT is the depth of collar N+2.
    • Optionally consider higher collar numbers N+3 and greater.

Note that there may be only one hypothesis for N=0 if the initialization is known to be true such that initial position, velocity, pressure as well as density are known.

As previously noted, running depth estimates may be generated for each of the hypotheses, because it is initially unknown whether a hypothesis is true or false.

In Step 344, for each hypothesis a likelihood function which depends on the true depth for that possibility and the estimated depth μ is evaluated, where μ is the depth of feature N plus the distance from the state vector since the collar:

L ( z T , μ ) = 1 σ 2 π exp ( - ( z T - μ ) 2 2 σ 2 ) . ( 25 )

In Step 346, the hypothesis/hypotheses which has/have a likelihood function less than a threshold value α is/are discarded. Each of the remaining hypotheses are included in a new hypothesis vector. If the new hypothesis is a detection error, the number of the last collar remains the same, and the state vector of the Kalman filter remains the same. If the new hypothesis was a detection, the last detected feature is updated accordingly, and a Kalman filter is started with the current velocity estimate as the velocity state and zero as the distance state, and the variance of the distance state estimate set to zero.

To save computational time, the logarithm of the likelihood function should be used with threshold log (α), rather than evaluating the likelihood function itself.

log L ( z T , μ ) = l o g 1 σ 2 π - ( z T - μ ) 2 2 σ 2 . ( 26 )

Finally, if the depth turns out to be within a specified distance D from the depth where the ballast weight is to be released, all hypotheses except the one with the highest likelihood may be discarded, and the release of the ballast weight may be performed based on that hypothesis.

The subsequent discussion relates to detecting casing collars in vertical and deviated wells using a combination of a magnetometer and an accelerometer. The detection as described may be incorporated in the methods of FIGS. 3A and 3B.

In some embodiments, a 3-axis magnetometer is used to collect data from steel cased wells. 3-axis magnetometers measure the magnetic field amplitude in 3-perpendicular axes. These axis (such as x, y, z) may be aligned with respect to the sensor package giving three orthogonal magnetic field amplitude measurements Bx, By, and Bz, respectively. To determine the direction of the measured magnetic field, it may be desirable to have the sensor package aligned with respect to the measured space's coordinate frame. For example, the measured magnetic field Bz of the magnetometer may be aligned with the borehole axis.

As previously discussed, the measured magnetic field signal may be processed to find collar locations with a better accuracy. A first derivative of the magnetic field amplitude with respect to time or depth may be taken. Alternatively, a matching filter may be used, where a filter waveform(s) in the shape of the expected magnetic field waveform(s) around the collar is convoluted with the data.

Although the axial component of the magnetic field may provide a relatively clear signal for casing collar detection, a freely falling or rising tool may not have a consistent alignment with the borehole axis due to the interactions with the borehole fluid and the casing wall. To address this concern, embodiments of the disclosure introduce a corrective step to the measured magnetic field vector.

A 3-axis accelerometer may be used to detect the direction of the Earth's gravity. The dot product of the magnetic field vector and the gravity vector then produces the magnetic field component in the direction of the gravity. Vertical wells may have small deviations from the gravity vector (i.e., <10°). Due to the small angle between the gravity vector and the borehole axis, the found magnetic field component along the gravity vector may have a large contribution from the magnetic field component along the borehole axis and a relatively small portion from the radial component.

If the cartesian coordinates of the 3-axis magnetometer and 3-axis accelerometer are aligned, the dot product can be calculated as below where individual components are multiplied with each other and summed:

B g r a v i t y = B · g = B x g x + B y g y + B z g z . ( 27 )

If there is a deviation angle, θ, between the borehole axis and the gravity vector, the calculated magnetic field will be composed of axial and radial magnetic field components:

B g r a v i t y = B a x i a l ‖cos θ + B r a d i a l ‖sin θ . ( 28 )

This means for θ<10 deg, the calculated field along the gravity will be the sum of more than 98% of the axial field and less than 17% of the radial field.

Finding the gravity vector may require some additional steps. The measured acceleration by the accelerometer, {right arrow over (α)}meas, can be described as follows:

a m e a s = g + a i n t + b + w , ( 29 )

    • where, {right arrow over (g)} is gravitational acceleration vector, {right arrow over (α)}int is the acceleration due to interaction forces with the wellbore structure and fluids, {right arrow over (b)} is the bias due to sensor imperfections, and {right arrow over (w)} is the measurement noise and or error. In a miniaturized untethered downhole tool, an accelerometer predominantly measures the gravitational acceleration as a constant and usually as the largest contributor. Other accelerations due to interactions with the environment are usually short lived. Using a low-pass filter may filter out fast changing components such as {right arrow over (α)}induced and {right arrow over (w)}. The biases, on the other hand, cannot be filtered with a low pass filter as they may remain constant or change slowly. The low pass filter may be applied in several ways. For example, a moving average may be applied to the collected measurements. Alternatively, signals collected over time may be converted into the frequency domain via Fourier transform, and the resulting spectra may be multiplied by a low-pass filter.

The accelerometer may need an initial or periodic calibration depending on its specifications to find the linear sensitivity coefficients (c) and biases (b) that relate measured values to calibrated values (αm to αc) as shown below. This can be done by aligning axes of the accelerometer with respect to gravity and taking measurements. For example, a full calibration of an accelerometer may need at least 12 measurements taken at 12 different orientations.

[ a x c a y c a z c ] = [ c x x c xy c x z c y x c y y c y z c z x c zy c zz ] [ a x m a y m a z m ] + [ b x b y b z ] ( 30 )

The measurements can be repeated at several temperatures to also account for the temperature effects. In this case each coefficient and bias can be represented as a function of temperature as in Eq 28 and Eq 29.

c ( T ) = α T 2 + β T + γ ( 31 ) b ( T ) = δ T 2 + ε T + ϑ ( 32 )

However, often the contributions of some coefficients, such as cross axis sensitivities or quadratic temperature relation, can be insignificant. In such a case, the relevant terms can be neglected to simplify the calculations and to reduce the required computational power. For example, for one axis, a simplified calibration can be as in Eq 30.

a x c ( T ) = β x T a x m + γ x a x m + ε x T + ϑ x ( 33 )

The performance of the method can be further improved for rapidly moving untethered tools. This may be accomplished using a gyroscope. Gyroscopes measure the rate of rotation around principal axes. Therefore, they work better than solely using accelerometers in short time intervals. There are several methods developed to fuse accelerometer and gyroscope data to find an orientation with respect to the vertical axis (i.e., the gravitational axis).

FIGS. 4A, 4B, and 4C show examples of magnetic field measurements as used by the method (300). FIG. 4A shows a segment of magnetic field measurements (400) collected at ±10 ft of the collar at 80 ft. FIG. 4B shows the magnetic field measurements of FIG. 4A after differentiation (410). FIG. 4C shows a further processed version (420) of the waveform shown in FIG. 4B. The further processing aims to make thresholding easier and includes taking an absolute value or an even power of the differentiated signal, and it may also include normalizing values between 0 and 1 such that a standard threshold can be selected as a value between 0 and 1. For example applying a threshold of 0.5 to the signal in FIG. 4C reveals a single peak at around 81 ft, identified by a star symbol. The estimated depth of the collar is identified using a circle symbol.

FIG. 6 shows a flow chart illustrating the operation of the method. In Step 601, initial conditions are set, including the initial state vector (which includes the initial depth) and the state covariance matrix representing the uncertainty in the initial state. The initial likelihood function value is set to an initial constant, for example 1.0, and an ordered list of the connection depths is provided.

In Step 602, for each active hypothesis, a Kalman filter is set up and propagated forward in time. The state vector at the next time step is predicted and that prediction is updated based on the sensor measurements according to the Kalman filter method. This step repeats until the next detection occurs.

In Step 603, a connection (or collar) has been detected. For each existing hypothesis, a new set of hypotheses corresponding to various possible identities of the new detection is created. The likelihood function for each new hypothesis is evaluated.

In Step 604, all hypotheses for which the likelihood function value does meet a pruning criterion, removed or “pruned” from further consideration. This may occur for likelihood functions being less than a threshold value or not being among the largest M likelihood function values, where M is a number from 2 to 100, typically 10. Optionally M can be increased as the total number of detections increases. Optionally the threshold value can be adjusted as the number of detections increases to reflect the fact that the likelihood function will decrease with the number of detections. After this pruning is complete, return to Step 602.

FIG. 7 shows a tree structure representing the operation of the method. The initial conditions are represented by node 700. The Kalman filter estimates the new state vector and the updates the state vector estimate based on sensor measurements at each time step until the first connection is detected. After the first detection, hypotheses 710 (that the detection was a false detection), 711 (that the detection is connection 1 on a list of connection depths), and 712 (that the detection is connection 2 on a list of connection depths) are created. The likelihood function is calculated for each of these hypotheses, as shown below the nodes. Since node 710 is the hypothesis that the detection was a false detection, the likelihood function is multiplied by a constant penalty (0.7 in this case). At the time of the first detection, the estimated depth from the Kalman filter was very close to the true depth of the first connection, so the likelihood function at hypothesis 711 was multiplied by a relatively large factor of 0.9. The estimated depth from the Kalman filter was very different, however, than the true depth of the second connection, so the likelihood function at hypothesis 712 is multiplied by a relatively small factor of 0.1. It is assume here that a minimum likelihood function threshold of 0.5 is being used to prune the tree, and so hypothesis 712 is removed. Two Kalman filters now begin operating, one associated with hypothesis 710, which has initial values of state vector and state vector covariance which are the same as the final values of those properties at the time of the first detection. The Kalman filter associated with hypothesis 711, however, begins with a state vector which contains the true depth of connection 1 and zero error variance with respect to that depth. Both Kalman filters proceed forward one time step at a time as before. The best estimate of depth can be obtained as the current depth from the Kalman filter associated with the largest likelihood function at the most recent detection, in this case, the depth from the Kalman filter of hypothesis 711.

When the second detection occurs, the system begins building hypotheses regarding the cause of the second detection. Hypothesis 710 is replaced by hypotheses 720, 721, 722, and 723. Hypothesis 720 is that both the first and second detections were false detections. Once the false detection penalty of 0.7 is applied twice to the likelihood function, the likelihood is now 0.49, below the minimum threshold of 0.5, so hypothesis 820 is pruned. Hypothesis 721 is that the first detection was a false detection (based on hypothesis 710) and the new second detection is connection 1. By the time of the second detection, the estimated depth from the Kalman filter of 710 is much deeper than the first connection, so a small factor of 0.1 is multiplied to the likelihood function, reducing the likelihood function to 0.07 which is below the threshold, and hypothesis 721 is pruned. Hypothesis 722 is that the first detection was a false detection and second detection was connection 2. Since the Kalman filter from 710 provides an estimated depth close to the depth of connection two, the likelihood function multiplier is large, 0.9, and the accumulated likelihood function value is still 0.63, above the cutoff threshold. Hypothesis 723 is that the first detection was a false detection and the second detection is connection 3. However, the estimated depth from the Kalman filter at the time of the second detection is well above the depth of the third connection, so the likelihood function is small and hypothesis 723 is pruned. Next the hypotheses descended from hypothesis 711 are considered. These have in common the hypothesis that the first detection was connection 1 (C1). 724 attributes the second detection to a false detection, and the false detection penalty of 0.7 is multiplied by the likelihood function value from 711 to produce a new likelihood function value of 0.63 for 724. 725 attributes the second detection to connection 2. The estimated depth from the Kalman filter from 711 at the time of detection 2 is close enough to the depth of connection 2 that the likelihood function multiplier is 0.9 and the likelihood function value for 725 is 0.81. 726 attributes the second detection to connection 3, but the estimated depth from the Kalman filter from 711 is not close to the depth of connection 3 and the corresponding low likelihood function multiplier of 0.1 brings the likelihood function of hypothesis 726 down to 0.09, well below the threshold so 729 is pruned.

Embodiments may be implemented on a computer system. One or more of the operations as described can run on a computer as a postprocessing step. In this case, the data may be collected by the downhole tool, whereas the computer performing the postprocessing may not necessarily be a part of the downhole tool. Alternatively, an algorithm based on the operations as described may run live during the mission on the untethered tool's computing device to make autonomous decisions during the mission. The computing device may be based on a microcontroller without an operating system, or can be also a mini computer with an operating system. FIG. 5 is a block diagram of a computer system (502) used to provide computational functionalities associated with described algorithms, methods, functions, processes, flows, and procedures as described in the instant disclosure, according to an implementation. The illustrated computer (502) is intended to encompass any computing device such as a high performance computing (HPC) device, a server, desktop computer, laptop/notebook computer, wireless data port, smart phone, personal data assistant (PDA), tablet computing device, one or more processors within these devices, or any other suitable processing device, including both physical or virtual instances (or both) of the computing device. Additionally, the computer (502) may include a computer that includes an input device, such as a keypad, keyboard, touch screen, or other device that can accept user information, and an output device that conveys information associated with the operation of the computer (502), including digital data, visual, or audio information (or a combination of information), or a GUI.

The computer (502) can serve in a role as a client, network component, a server, a database or other persistency, or any other component (or a combination of roles) of a computer system for performing the subject matter described in the instant disclosure. The illustrated computer (502) is communicably coupled with a network (530). In some implementations, one or more components of the computer (502) may be configured to operate within environments, including cloud-computing-based, local, global, or other environment (or a combination of environments).

At a high level, the computer (502) is an electronic computing device operable to receive, transmit, process, store, or manage data and information associated with the described subject matter. According to some implementations, the computer (502) may also include or be communicably coupled with an application server, e-mail server, web server, caching server, streaming data server, business intelligence (BI) server, or other server (or a combination of servers).

The computer (502) can receive requests over network (530) from a client application (for example, executing on another computer (502)) and responding to the received requests by processing the said requests in an appropriate software application. In addition, requests may also be sent to the computer (502) from internal users (for example, from a command console or by other appropriate access method), external or third-parties, other automated applications, as well as any other appropriate entities, individuals, systems, or computers.

Each of the components of the computer (502) can communicate using a system bus (503). In some implementations, any or all of the components of the computer (502), both hardware or software (or a combination of hardware and software), may interface with each other or the interface (504) (or a combination of both) over the system bus (503) using an application programming interface (API) (512) or a service layer (513) (or a combination of the API (512) and service layer (513). The API (512) may include specifications for routines, data structures, and object classes. The API (512) may be either computer-language independent or dependent and refer to a complete interface, a single function, or even a set of APIs. The service layer (513) provides software services to the computer (502) or other components (whether or not illustrated) that are communicably coupled to the computer (502). The functionality of the computer (502) may be accessible for all service consumers using this service layer. Software services, such as those provided by the service layer (513), provide reusable, defined business functionalities through a defined interface. For example, the interface may be software written in JAVA, C++, or other suitable language providing data in extensible markup language (XML) format or other suitable format. While illustrated as an integrated component of the computer (502), alternative implementations may illustrate the API (512) or the service layer (513) as stand-alone components in relation to other components of the computer (502) or other components (whether or not illustrated) that are communicably coupled to the computer (502). Moreover, any or all parts of the API (512) or the service layer (513) may be implemented as child or sub-modules of another software module, enterprise application, or hardware module without departing from the scope of this disclosure.

The computer (502) includes an interface (504). Although illustrated as a single interface (504) in FIG. 5, two or more interfaces (504) may be used according to particular needs, desires, or particular implementations of the computer (502). The interface (504) is used by the computer (502) for communicating with other systems in a distributed environment that are connected to the network (530). Generally, the interface (504 includes logic encoded in software or hardware (or a combination of software and hardware) and operable to communicate with the network (530). More specifically, the interface (504) may include software supporting one or more communication protocols associated with communications such that the network (530) or interface's hardware is operable to communicate physical signals within and outside of the illustrated computer (502).

The computer (502) includes at least one computer processor (505). Although illustrated as a single computer processor (505) in FIG. 5, two or more processors may be used according to particular needs, desires, or particular implementations of the computer (502). Generally, the computer processor (505) executes instructions and manipulates data to perform the operations of the computer (502) and any algorithms, methods, functions, processes, flows, and procedures as described in the instant disclosure.

The computer (502) also includes a memory (506) that holds data for the computer (502) or other components (or a combination of both) that can be connected to the network (530). For example, memory (506) can be a database storing data consistent with this disclosure. Although illustrated as a single memory (506) in FIG. 5, two or more memories may be used according to particular needs, desires, or particular implementations of the computer (502) and the described functionality. While memory (506) is illustrated as an integral component of the computer (502), in alternative implementations, memory (506) can be external to the computer (502).

The application (507) is an algorithmic software engine providing functionality according to particular needs, desires, or particular implementations of the computer (502), particularly with respect to functionality described in this disclosure. For example, application (507) can serve as one or more components, modules, applications, etc. Further, although illustrated as a single application (507), the application (507) may be implemented as multiple applications (507) on the computer (502). In addition, although illustrated as integral to the computer (502), in alternative implementations, the application (507) can be external to the computer (502).

There may be any number of computers (502) associated with, or external to, a computer system containing computer (502), each computer (502) communicating over network (530). Further, the term “client,” “user,” and other appropriate terminology may be used interchangeably as appropriate without departing from the scope of this disclosure. Moreover, this disclosure contemplates that many users may use one computer (502), or that one user may use multiple computers (502).

In some embodiments, the computer (502) is implemented as part of a cloud computing system. For example, a cloud computing system may include one or more remote servers along with various other cloud components, such as cloud storage units and edge servers. In particular, a cloud computing system may perform one or more computing operations without direct active management by a user device or local computer system. As such, a cloud computing system may have different functions distributed over multiple locations from a central server, which may be performed using one or more Internet connections. More specifically, a cloud computing system may operate according to one or more service models, such as infrastructure as a service (IaaS), platform as a service (PaaS), software as a service (SaaS), mobile “backend” as a service (MBaaS), serverless computing, artificial intelligence (AI) as a service (AIaaS), and/or function as a service (FaaS).

Although only a few example embodiments have been described in detail above, those skilled in the art will readily appreciate that many modifications are possible in the example embodiments without materially departing from this invention. Accordingly, all such modifications are intended to be included within the scope of this disclosure as defined in the following claims.

Claims

1. A method for locating a downhole tool in a wellbore, the method comprising:

obtaining, by the downhole tool, a pressure measurement in the wellbore;
generating a first depth estimate based on the pressure measurement;
anticipating a passing of the downhole tool by a collar, based on the first depth estimate and a known depth of the collar;
based on the anticipating of the passing of the downhole tool by the collar, performing, by the downhole tool, a collar detection; and
based on the collar detection resulting in a detection of the collar: generating an updated depth estimate, and reporting the updated depth estimate.

2. The method of claim 1, wherein the first depth estimate is generated using a Kalman filter.

3. The method of claim 2, wherein the Kalman filter is parameterized using a first hypothesis based on surface parameters.

4. The method of claim 3, wherein the surface parameters comprise a 0-ft depth and a 0-ft/s speed.

5. The method of claim 3, wherein generating the updated depth estimate comprises:

determining a discrepancy between the first depth estimate and the known depth;
generating a second hypothesis that corrects for the discrepancy; and
generating a second depth estimate using the Kalman filter parameterized based on the second hypothesis.

6. The method of claim 5, wherein generating the updated depth estimate comprises:

continue making depth estimates using the Kalman filter parameterized based on the first hypothesis;
continue making depth estimates using the Kalman filter parameterized based on the second hypothesis; and
determining, a first weight for the first hypothesis and the second weight for the second hypothesis, the first and second weights reflecting an accuracy of the depth estimates made using the Kalman filter parameterized based on the first hypothesis and the second hypothesis, respectively.

7. The method of claim 6, wherein the first weight and the second weight are assigned based on Bayesian probability.

8. The method of claim 6,

wherein the first hypothesis and the second hypothesis are members of a plurality of hypotheses, and
wherein generating the updated depth estimate further comprises:
based on determining that a cardinality of the plurality of hypotheses exceeds a specified limit, eliminating a hypothesis with a lowest accuracy from the plurality of hypotheses, based on the weight associated with the hypothesis.

9. The method of claim 6,

wherein the first hypothesis and the second hypothesis are members of a plurality of hypotheses, and
wherein reporting the updated depth estimate comprises reporting a depth estimate associated with a hypothesis with a highest accuracy of the plurality of hypotheses, based on the weight associated with the hypothesis.

10. The method of claim 1, wherein the anticipating of the passing of the downhole tool comprises applying a depth tolerance window to the depth estimate in which the collar is expected.

11. The method of claim 1, wherein the collar detection is performed using a magnetometer.

12. The method of claim 1, wherein generating the depth estimate is further based on an acceleration measurement.

13. The method of claim 1, wherein the downhole tool is configured to obtain measurements of one or more properties along the wellbore, and wherein the updated depth estimate is used to label the measurements.

14. An untethered device comprising:

a tool comprising a pressure sensor and a processor,
wherein the processor: obtains a pressure measurement from the pressure sensor, generates a first depth estimate based on the pressure measurement, anticipates a passing of the untethered device by a collar, based on the first depth estimate and a known depth of the collar; based on the anticipating of the passing of the downhole tool by the collar, performs a collar detection; and based on the collar detection resulting in a detection of the collar: generates an updated depth estimate, and reports the updated depth estimate.

15. The untethered device of claim 14, wherein the tool further comprises a magnetometer, and wherein the collar detection is performed using the magnetometer.

16. The untethered device of claim 14, further comprising a ballast weight releasably attached to the tool.

17. The untethered device of claim 14,

wherein the tool further comprises at least one sensor for obtaining a measurement of a property along a wellbore, and
wherein the processor further labels the measurement of the property using the updated depth estimate.

18. The untethered device of claim 14, wherein the first depth estimate is generated using a Kalman filter.

19. The untethered device of claim 18, wherein the Kalman filter is parameterized using a first hypothesis based on surface parameters.

20. The untethered device of claim 19, wherein generating the updated depth estimate comprises:

determining a discrepancy between the first depth estimate and the known depth;
generating a second hypothesis that corrects for the discrepancy; and
generating a second depth estimate using the Kalman filter parameterized based on the second hypothesis.
Patent History
Publication number: 20250116188
Type: Application
Filed: Oct 10, 2024
Publication Date: Apr 10, 2025
Applicant: ARAMCO SERVICES COMPANY (Houston, TX)
Inventors: Max Deffenbaugh (Houston, TX), Huseyin Rahmi Seren (Houston, TX)
Application Number: 18/911,712
Classifications
International Classification: E21B 47/092 (20120101); E21B 47/04 (20120101); E21B 47/06 (20120101); E21B 47/26 (20120101);