Method and System for Wellbore Surveying

20250297544 ยท 2025-09-25

    Inventors

    Cpc classification

    International classification

    Abstract

    The present invention provides methods and systems are presented suitable for evaluating a dynamic wellbore azimuth and inclination measurement based on measurements acquired by a downhole tool capable of acquiring accelerometer (gravity) and magnetic field measurements representative of the earth's gravitational and magnetic fields. These methods and systems can also be used for evaluating static inclination and azimuth measurements. These methods and systems comprising the present invention provide an improvement over the prior art for their function and address many shortcomings of prior art.

    Claims

    1. A system for drilling a well bore comprising: a. a drill string in the well bore, the drill string including a drill bit and a sensor housing, the sensor housing including a magnetic sensor and a gravity sensor, b. a means for rotating the drill string; c. a means for acquiring, while the drill string is rotating in the well bore, a sequence of transverse magnetic vectors measured by the magnetic sensor and a sequence of transverse gravity vectors measured by the gravity sensor; d. a means for evaluating an averaged transverse product magnitude using the sequence of transverse magnetic vectors and the sequence of transverse gravity vectors; and, e. a means for using the averaged transverse product magnitude to evaluate one or more of the group: i) an inclination, and ii) an azimuth.

    2. The system of claim 1 further comprising a means for using the inclination or azimuth during drilling the well bore to adjust one or more of the group: i) a position of the well bore, ii) a drilling direction of the well bore; iii) a curvature of the wellbore, iv) a drilling speed, v) a circulation rate, and vi) a well path.

    3. A non-transitory computer-readable medium associated with a processor connected to a drill string in a subterranean well bore, said medium storing one or more instructions that, when executed by said processor while the drill string is rotating in the subterranean well bore, cause the processor to use an averaged transverse product magnitude based on signals measured by a gravity sensor and a magnetic sensor in said well bore for evaluating one or more of the group: i) an inclination, and ii) an azimuth.

    4. The non-transitory computer-readable medium of claim 3 wherein the non-transitory computer-readable medium is selected from one or more of the group: a random-access memory device; a read-only memory device; a flash memory device; a hard drive; a compact disc; a digital versatile disc; a magnetic tape; and a network attached storage device.

    5. A system for well bore surveying comprising: a. a means for using an averaged transverse product magnitude based on signals measured by a gravity sensor connected to a rotating drill string in a well bore and a magnetic sensor connected to the rotating drill string in the well bore for evaluating one or more of the group: i) an inclination, and ii) an azimuth, and b. a means for evaluating a position of the well bore using the inclination or the azimuth.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0017] The novel features believed characteristic of the illustrative embodiments are set forth in the appended claims. The illustrative embodiments, however, as well as a preferred mode of use, further objectives and features thereof, will best be understood by reference to the following detailed description of an illustrative embodiment of the present invention when read in conjunction with the accompanying drawings, wherein:

    [0018] FIG. 1 is a schematic of a bottom hole assembly (BHA) with a three-axis magnetometer and a three-axis accelerometer, a non-transitory computer-readable medium, and a processor suitable for use in many embodiments of the present invention.

    [0019] FIG. 2 is a flow chart of one method for evaluating a transverse sensor offset.

    [0020] FIG. 3 is a pair of plots where the top panel shows a sequence of values representing the x-component of a measured transverse magnetic field, hxm, and the lower panel shows that same sequence multiplied by Blackman weights.

    [0021] FIG. 4 is a plot compairing prior art estimates for a dynamic transverse gravity magnitude against estimates evaluated using an averaged transverse product magnitude and the true values according to an embodiment of the present invention.

    [0022] FIG. 5 is a flowchart showing steps in evaluating an azimuth measurement based on a measured axial gravity value, a measured transverse magnetic vector, a measured transverse gravity vector using a quadratic equation and a predetermined magnetic dip angle.

    [0023] FIG. 6 is a flow chart of a method for evaluating an azimuth or inclination using a correlation wherein a sensor rotation coherence dependence is removed from the correlation to determine a transverse magnitude, the transverse magnitude used in evaluating the azimuth or inclination.

    [0024] FIG. 7 is a schematic of a method for determining an inclination or azimuth measurement using an averaged transverse product magnitude.

    [0025] FIG. 8 is a system-level schematic illustrating two-stage sampling in a preferred embodiment of the invention.

    [0026] FIG. 9 illustrates an Analog LPF for use in two-stage sampling according to a preferred embodiment of the invention.

    [0027] FIG. 10 is a plot of an impulse response for digital LPF filter used in two-stage sampling in a preferred embodiment of the invention.

    [0028] FIG. 11 is a table of coefficients for digital LPF used in two-stage sampling in a preferred embodiment of the invention.

    [0029] FIG. 12 is a flow chart depicting a general embodiment of a system for applying the two-stage sampling method including a prior art calibration.

    SUMMARY

    [0030] The present invention provides a non-transitory computer-readable medium storing one or more instructions that, when executed by a processor, cause the processor to use an averaged transverse product magnitude based on signals measured by a gravity sensor and a magnetic sensor in a wellbore for evaluating one or more of the group: i) an inclination, and ii) an azimuth.

    [0031] The present invention also provides a system of wellbore surveying including a processor, a non-transitory computer-readable medium storing one or more instructions that, when executed by the processor, cause the processor to evaluate an averaged transverse product magnitude using a sequence of transverse magnetic vectors measured by a magnetic sensor in a wellbore and a sequence of transverse gravity vectors measured by a gravity sensor in a wellbore; and, use the average transverse product magnitude to evaluate one or more of the group: i) an inclination, and ii) an azimuth.

    [0032] The present invention further provides a method of wellbore surveying including a magnetic sensor in a wellbore; a gravity sensor in a wellbore; a means for evaluating an averaged transverse product magnitude using a sequence of transverse magnetic vectors measured by the magnetic sensor and a sequence of transverse gravity vectors measured by the gravity sensor; and, a means for using the averaged transverse product magnitude to evaluate one or more of the group: i) an inclination, and ii) an azimuth.

    DETAILED DESCRIPTION

    [0033] A first object of the present invention is to evaluate a transverse gravity or transverse magnetic sensor offset without: 1) requiring a prior gravity or magnetic field magnitude; 2) using an adaptive filter; 3) requiring a sensor offset to be constant over an entire logging run; 4) combining data from more than one sensor; or, 5) solving nonlinear equations. This objective is achieved according to the invention by forming a weighted sum of a sequence of sensor data wherein the weights correspond to a tapered window function. In a preferred embodiment for practicing this invention, this objective is accomplished using weights determined by a Blackman window function and applying them to form a weighted sum of data acquired while a transverse sensor is rotating.

    [0034] A second object of the present invention is to evaluate an axial magnetic field (or an axial sensor offset) without: 1) using a plurality of static gravity tool face angle measurements in an inclined wellbore over various rotational orientations of the drill string; 2) a predetermined magnetic field magnitude; 3) resorting to a numerical equation solver, especially for equations with multiple solutions; 4) attempting to determine which of several ambiguous solutions for an azimuth angle is correct given a sign ambiguity in each one; 5) invoking a drill string magnetization model; 6) using an adaptive filter; or, 7) requiring local magnetic anomalies to be constant over an entire logging run. In a preferred embodiment for practicing the invention, an axial magnetic sensor offset is evaluated using the quadratic formula with a dependence on a predetermined magnetic dip value. Rotating sensor data are not required, but may be used advantageously to, for example, reduce effects of a transverse sensor offset. A so-determined axial magnetic sensor offset is determined under favorable dynamic conditions and retained in memory so that it can be applied to incoming axial magnetic measurements in a preferred embodiment of the invention.

    [0035] A third object of this invention is to evaluate reliable estimates for an inclination and an azimuth angle under dynamic conditions without a predetermined: 1) total gravity magnitude; 2) total magnetic field magnitude; 3) transverse gravity magnitude; and, 4) transverse magnetic field magnitude. Accurate dynamic inclinations or azimuths can be based entirely on data acquired under dynamic conditions. In a preferred embodiment for practicing this invention, an averaged transverse product magnitude is evaluated and used in novel formulas for the inclination and the azimuth. Formulas for the inclination are introduced with a dependency on transverse magnetic measurements. Preferred formulas of the invention for the azimuth angle have a different dependence on averaged gravity and magnetic measurements than do prior art formulas. To the knowledge of the inventor, an inclination measurement with a dependence on a magnetic measurement does not exist in the prior art. One advantage of using an averaged transverse product magnitude is that time-dependent errors on the dynamic transverse magnetic measurements tend to be small which makes them useful for estimating a transverse gravity magnitude.

    [0036] A fourth object of the present invention to provide transverse gravity and transverse magnetic measurements without a relative phase error caused by sensor rotation. This object is achieved using a two-stage sampling procedure that includes a prior art calibration. In a preferred embodiment, each sensor signal passes through an analog low-pass filter, is digitized, digitally filtered, and calibrated before combining with a signal from a different sensor. Preferably, the digital filter output is sampled at a lower frequency than the data were digitized because the digital filtering operation reduces the Nyquist frequency, and the digital filter is a finite impulse response, low pass filter.

    [0037] Statements that rotation-induced eddy currents contribute to this relative phase error are doubted because the device rotates about the axis which is the wrong geometry to induce eddy currents that would not cancel out over each revolution. Furthermore, a numerical calculation shows that such eddy currents would produce magnetic fields too weak to cause an adverse impact on a wellbore survey.

    [0038] An important purpose of wellbore azimuth and inclination measurements is to estimate the tangent vector to the wellbore in a reference coordinate system. This enables evaluation of a wellbore trajectory using a number of tangent vector estimates in conjunction with corresponding distances along the wellbore axis. The reference coordinate system used in most practical applications has a z-axis parallel to the Earth's gravity vector and an x-axis in the direction of magnetic north. Differences between true and magnetic north are trivial to account for because the correction amounts to adding a constant angle to a wellbore azimuth measurement, the constant angle being the difference between true and magnetic north.

    [0039] Systems and methods for acquiring representative values of the Earth's gravity vector using accelerometer measurements and the Earth's magnetic field using magnetometer measurements are known to those of ordinary skill in the art. The method and system presented here is applicable to measurements acquired by such systems. Typically, such a system comprises a three-axis accelerometer, a three-axis magnetometer, a processor for executing instructions, a memory module for storing data, and a communications module for transmitting measurements and processed results to a telemetry system to send to the surface. In many instances, measurements will be processed in the subsurface measurement apparatus and the results transmitted to the surface via mud pulse telemetry. Alternatively, the measurements or partially processed results can be transmitted to the surface and processed by a processor there.

    [0040] FIG. 1 depicts a lower-most portion of a drill string including a bottom hole assembly (BHA) 10 housing a three-axis magnetometer 11 and a three-axis accelerometer 12. In the depicted embodiment, the sensors 11 and 12 are enclosed in a sensor housing 13, and they may are deployed as close to the drill bit 20 as possible. This invention can be practiced with any placement of the sensors in a drill string, the drill string typically inserted into a wellbore and used to drill the wellbore. Sensor 11 is a three-axis magnetometer or a magnetic sensor. Sensor 12 is a three-axis accelerometer or a gravity sensor. The sensor signals are typically processed by a processor 15 that executes instructions stored in a non-transitory computer-readable medium 14 in the BHA, the non-transitory computer-readable medium including instructions to evaluate an azimuth and an inclination. The azimuth and inclination are typically stored in a non-transitory computer-readable medium. Ordinarily, some of the results are telemetered to the surface using a prior art telemetry system and/or telemetered to other parts of the drill string by prior art means. Though the raw sensor signals can be stored in a non-transitory computer-readable medium 14, the volume of data can be large. For this reason, in the preferred embodiment for practicing this invention, averaged quantities derived from the sensor signals are stored in a non-transitory computer-readable medium. The averaged quantities can be used to evaluate the azimuth or inclination results such as those telemetered to the surface. In addition, the averaged quantities (or recorded versions of the sensor signals) can be downloaded to a second non-transitory computer-readable medium at the surface after drilling is completed where they can be further processed, reprocessed, or analyzed. An example of a set of averaged quantities that can be used to practice a simple embodiment of this invention comprises an averaged axial magnetic measurement, an averaged axial gravity measurement, an averaged transverse dot product, an averaged transverse cross product, and an averaged transverse magnetic field magnitude. These and other quantities suitable for storage or processing in a non-transitory computer-readable medium used to practice this invention are specified in the following. It will be understood by those of ordinary skill in the art that non-transitory computer-readable media comprise all computer-readable media except for a transitory, propagating signal. Thus, a non-transitory computer-readable medium refers to any data storage device that can store instructions which can be executed by a processor or that can store data that can be operated on by the processor. Examples of commonly-used non-transitory computer-readable media include devices such as a hard drive, network attached storage (NAS), read-only memory, random-access memory, flash memory, a CD (Compact Discs)-CD-ROM, a CD-R, or a CD-RW, a DVD (Digital Versatile Disc), a magnetic tape, and other optical and non-optical data storage devices.

    1 Coordinate Systems, Coordinate Transformations, and Transverse Vectors

    [0041] In order to explain the operation of the present invention, it is helpful to express the Earth's gravity vector, g, and the Earth's magnetic vector, h in a reference coordinate system, a wellbore coordinate system, and a device coordinate system. When expressed in a specific coordinate system, a vector and its components will be assigned a subscript to denote the relevant coordinate system. For example, g.sub.r and h.sub.r denote the vectors g and h in the reference, r coordinate system. Specifically,

    [00001] g _ r = g [ 0 0 1 ] , and h _ r = [ h xr 0 h zr ] = h [ cos ( D ) 0 sin ( D ) ] . ( 1.1 )

    [0042] From equation (1.1), it is clear that: 1) the gravity vector is aligned with the positive z.sub.r-axis; and, 2) the magnetic vector lies in the x.sub.r-z.sub.r plane. This is consistent with the convention that the z.sub.r-axis is down and the x.sub.r-axis is in the direction of magnetic north. This choice of reference coordinate system is arbitrary and any other choice for the reference coordinate system is equivalent for the purposes of this invention. It is common to define h.sub.r in terms of a magnitude, h, and a magnetic dip angle, D. This can be accomplished by substituting, h.sub.xr=h cos (D) and h.sub.zr=h sin (D) in equation (1.1). From the convention that the x.sub.r-axis is in the direction of magnetic north, it follows that h.sub.xr0. The vectors in equation (1.1) can be normalized to be unit vectors and then the magnitudes need not be referenced.

    [0043] A vector, v.sub.w, expressed in the wellbore coordinate system is related to its value, v.sub.r, in the reference coordinate system via the transformation,

    [00002] v _ w = R _ _ wr v _ r , where ( 1.2 a ) R _ _ wr = [ cos ( ) cos ( ) cos ( ) sin ( ) sin ( ) - sin ( ) cos ( ) 0 - sin ( ) cos ( ) - sin ( ) sin ( ) cos ( ) ] . ( 1.2 b )

    [0044] The matrix R.sub.wr represents the combination of a first rotation about the z.sub.r-axis by the angle followed by a second rotation about a y-axis by the angle . An azimuth angle is , and an inclination angle is . By convention, 0, and <. The invention can be practiced on the basis of alternative conventions for the range of the angles and is in no way limited to any specific convention.

    [0045] Similarly, a vector v.sub.d can be expressed in the device coordinate via the transformation,

    [00003] v _ d = R _ _ dw v _ w , where ( 1.3 a ) R _ _ dw = [ cos ( ) sin ( ) 0 - sin ( ) cos ( ) 0 0 0 1 ] . ( 1.3 b )

    [0046] The matrix R.sub.dw represents a rotation about the z.sub.w-axis by the angle . A tool face is the angle is , and, by convention, <.

    [0047] A tangent vector to a wellbore expressed in the reference coordinate system is

    [00004] _ = [ - sin ( ) cos ( ) - sin ( ) sin ( ) cos ( ) ] . ( 1.4 )

    [0048] A transverse vector can be conveniently defined as the x and y-components of a vector. For example, a vector v can be written as follows:

    [00005] v _ = [ v x v y v z ] = [ v _ T v z ] where ( 1.5 a ) v _ T = [ v x v y ] . ( 1.5 b )

    [0049] The z-component of a vector is referred to as an axial component or an axial value given that it is in the axial direction. This notation is helpful because vector operations in a transverse plane are used extensively in this specification.

    2 Gravity and Magnetic Vectors Device Coordinate System

    [0050] Applying the coordinate transformations (1.3) to g.sub.w and h.sub.w results in

    [00006] g _ d = [ g xd g yd g zd ] = g [ sin ( ) cos ( ) - sin ( ) sin ( ) cos ( ) ] , y and ( 2.1 a ) h _ d = [ h xd h yd h zd ] = [ ( h xr cos ( ) cos ( ) + h zr sin ( ) ) cos ( ) - h xr sin ( ) sin ( ) - ( h xr cos ( ) cos ( ) + h zr sin ( ) ) sin ( ) - h xr sin ( ) cos ( ) - h xr sin ( ) cos ( ) + h zr cos ( ) ] . ( 2.1 b )

    [0051] The transverse components of g.sub.d and h.sub.d are discussed in detail sufficient to define transverse gravity and magnetic vectors according to equation (1.5):

    [00007] g _ Td = [ g xd g yd ] = g [ sin ( ) cos ( ) - sin ( ) sin ( ) ] , and ( 2.2 a ) h _ Td = [ h xd h yd ] = [ ( h xr cos ( ) cos ( ) + h zr sin ( ) ) cos ( ) - h xr sin ( ) sin ( ) - ( h xr cos ( ) cos ( ) + h zr sin ( ) ) sin ( ) - h xr sin ( ) cos ( ) ] . ( 2.2 b )

    3 Reference Values, Transverse Vector Operations, and Prior Art Inclination and Azimuth Formulas

    [0052] The present invention can be practiced with any means for determining g.sub.r and h.sub.r whenever a reference value is required. Those of ordinary skill in the art are familiar with means for determining reference values. One such option is to measure g.sub.r and h.sub.r directly with the measurement device before the measurement device is placed in the well or at a (preferably) nearby calibration facility. If this is done, corrections can be made for local variations in the gravity or magnetic vectors to account for the difference between gravity and magnetic vectors at a location where the reference values were acquired and a location where the angles are being estimated.

    [0053] Those persons of ordinary skill in the art are able to make such corrections by means of mathematical models or via the use of tabulated data. Alternatively, those persons of ordinary skill in the art will understand that appropriate reference values can be estimated directly from subsurface measurements, and if necessary, corrections can also be applied to those values. For example, the following quantities derived from dot and cross-products involving g and h are:

    [00008] .Math. "\[LeftBracketingBar]" g .Math. g .Math. "\[RightBracketingBar]" = g ( 3.1 a ) g .Math. h = g h z r = g h sin ( D ) ( 3.1 b ) .Math. "\[LeftBracketingBar]" g h .Math. "\[RightBracketingBar]" = gh x r = g h cos ( D ) ( 3.1 c ) .Math. "\[LeftBracketingBar]" h .Math. h .Math. "\[RightBracketingBar]" = h x r 2 + h z r 2 = h ( 3.1 d )

    where the symbols .Math. and X respectively represent a dot product and a cross product. These quantities are invariant under the coordinate transformations discussed above; so, it is not necessary to denote which coordinate system the underlying g and h measurements were acquired in. Values for g, h, h.sub.xr, and h.sub.zr in equation (1.1) can be estimated directly from equation (3.1).

    Transverse Vector Operations.

    [0054] Per equation (1.5), transverse gravity and magnetic vectors are g.sub.T and h.sub.T The following definitions will be used:

    [00009] Transverse magnetic magnitude : h T = .Math. "\[LeftBracketingBar]" h T .Math. "\[RightBracketingBar]" = h x 2 + h y 2 ; ( 3.2 a ) Transverse gravity magnitude : g T = .Math. "\[LeftBracketingBar]" g T .Math. "\[RightBracketingBar]" = g x 2 + g y 2 ; ( 3.2 b ) Transverse dot product : g T .Math. h T = g x h x + g y h y = g T h T cos ( B ) ; ( 3.2 c ) Transverse cross product : g T h T = g x h y - g y h x = g T h T sin ( B ) ; ( 3.2 d ) Transverse product magnitude : g T h T = ( g T .Math. h T ) 2 + ( g T h T ) 2 . ( 3.2 e )

    The angle B is known as a tool face offset. This angle can be determined using a four-quadrant (or two-argument) arctangent function,

    [00010] Tool face offset : B = atan 2 ( g T h T , g T .Math. h T ) . ( 3.3 )

    [0055] This arctangent function does not require its arguments to be normalized such that their squares sum to one. Use of an arctangent function with two arguments requiring normalized arguments or any other arctangent function is equivalent for the purpose of practicing any embodiment of this invention. A tool face offset is not computed, evaluated, or used in the practice of this invention. It is defined here for completeness because it is a commonly-referenced quality control measure in wellbore surveying.

    [0056] The term transverse product magnitude will be used to refer to a value for g.sub.Th.sub.T evaluated according to (3.2). A transverse product magnitude is independent of a tool face offset. An averaged transverse product magnitude can be evaluated using averaged transverse dot product and an averaged transverse cross product.

    Prior Art Inclination and Azimuth Formulas.

    [0057] Prior art estimates of an inclination angle are based upon one or more measured gravity values and no magnetic measurements. This prior art approach is problematic because the prior art formulas such as

    [00011] cos ( ) = g z d / g ( 3.4 a ) sin ( ) = g T d / g , or ( 3.4 b ) tan ( ) = g T d / g z d ( 3.4 c )

    all require a gravity magnitude estimate or a transverse gravity magnitude estimate to be derived from a set of measured gravity vectors. However, in a dynamic setting, shock and vibration effects do not readily average out of magnitude calculations because the errors in the individual measurements are squared and do not tend to cancel out when they are aggregated. A typical solution for this is to evaluate a gravity magnitude based on static data and then evaluate a dynamic transverse gravity magnitude using the formula

    [00012] g T d = g 2 - g z d 2 . ( 3.5 )

    However, this solution results in static data being required for a dynamic inclination which poses practical problems because measurement errors are not the same in static and dynamic conditions.

    [0058] Prior art estimates for an azimuth angle are typically evaluated according to the formula

    [00013] = atan 2 ( g g T d h T d , h z d g T d 2 - g z d g T d .Math. h T d ) , ( 3.6 a )

    which has a problematic dependency on various gravity magnitudes for dynamic applications. Challenges with magnetic interference have also been known, especially with systematic errors on h.sub.zd, in high latitudes or during horizontal drilling in close to an easterly or westerly direction. Transverse sensor offsets are also known to adversely impact the quality of inclination and azimuth measurements. Transverse sensor offsets are thus very difficult to estimate according to prior art-based data acquired under static conditions because the sensor is not rotating.

    4 Measured Values and Error Suppression

    [0059] Gravity and magnetic vectors in a device coordinate system specify a dependence of a measured gravity or magnetic vector on the inclination and azimuth angles. In the absence of measurement errors, an inclination and azimuth could be determined accurately based on a single measurement of a gravity and a magnetic vector and a prior art inclination and azimuth formula.

    [0060] In practice, a measured gravity vector g.sub.m and magnetic vector h.sub.m include a residual offset vector and noise vector:

    [00014] g _ m = [ g T m g z m ] = [ g T d g z d ] + [ g T g z ] + [ n _ T g n z g ] = g _ d + g _ + n _ g , ( 4.1 a ) h _ m = [ g _ T m h z m ] = [ h T d h z d ] + [ h T h z ] + [ n _ Th n zh ] = h _ d + h _ + n _ h , ( 4.1 b )

    where the vectors g and h represent a residual offset which can be referred to as an offset or a sensor offset. The vectors n.sub.g and n.sub.h represent time-dependent errors that can be referred to as noise, and these vectors may be referred to as noise vectors.

    [0061] A plurality of measurements is useful for suppressing effects of measurement errors on an inclination or an azimuth measurement. Therefore, it is advantageous to acquire multiple measured vectors over a time interval. The time interval will be referred to as a processing window. The present invention can be practiced with any processing window.

    [0062] In a preferred embodiment for practicing this invention: the processing window is 40.96 seconds long; a value for g.sub.m and h.sub.m is acquired every 10 milliseconds (sample rate 100 Hz); the plurality of measurements comprises a sequence with 4096 values for g.sub.m and h.sub.m; each transverse gravity vector is measured at substantially the same time as each transverse magnetic vector; and, each axial value is measured at substantially the same time as the transverse vectors.

    [0063] The offsets in equations (4.1a) and (4.1b) are referred to as residual because, given an ideal measurement calibration, they would be negligible. A residual offset is expected when using a prior art calibration method. Examples of things that can cause a calibration error include an error in a reference field value, an error in the orientation of the sensor during calibration, human error, perturbations to a magnetic measurement caused by magnetic material in a bottom hole assembly, or damage to electrical or mechanical components in the measurement apparatus.

    [0064] Some of the measurements in a processing window may be excluded from subsequent calculations. Those persons of ordinary skill in the art are familiar with means for excluding unrepresentative data from calculations. For example, a quantile filter that removes outlying data points from a set of data is applicable for this purpose. Alternatively, data corresponding to some number of standard deviations beyond a mean value can be excluded, etc. Instead of excluding undesirable members of a set of measurements, a quantile filter can alternatively be used to select a desirable member of a set such one close to a median or mean value. Even though as few as one of a plurality of measurements may be selected by such means, the use of a quantile filter requires multiple data points; so, any such selection is a combination of multiple data points that can change if more data are added to the plurality or taken away from the plurality of data. A preferred embodiment for practicing this invention is to simply use the data in the processing window without attempting to remove lesser-quality samples or identify a suitable sample.

    [0065] A set of measurements acquired over a processing window will be enclosed by brackets to indicate an average, aggregation, selection from, or other combination of the set of measurements. A bracketed quantity with a subscript d indicates a quantity in the device coordinate system suitable to use for evaluating an inclination or azimuth. A quantity within brackets assigned a subscript m represents an average, aggregation, or combination of a set of measurements. For example, the equation

    [00015] .Math. g T d .Math. h T d .Math. = .Math. g T m .Math. h T m .Math. - .Math. g T m .Math. .Math. .Math. h T m .Math.

    represents an averaged dot product of transverse gravity and magnetic vectors that is a proxy for the value of the averaged dot product in the device coordinate system fit for use in an inclination or azimuth measurement. It is based on an averaged set of measured dot products, custom-characterg.sub.Tm.Math.h.sub.Tmcustom-character and the dot product of estimated offset vectors estimated according to custom-characterg.sub.Tmcustom-character.Math.custom-characterh.sub.Tmcustom-character.

    Transverse Sensor Offsets.

    [0066] Data windowing using a tapered window function is a signal processing technique applicable for determining a transverse sensor offset. Windowing a sequence of measurements produces a weighted average of the sequence that is weighted more heavily toward the center than at the ends. A tapered window function is useful for mitigating end effects that result from a finite processing window. In a preferred embodiment for practicing this invention, a transverse sensor offset is determined using measurements acquired while a sensor is rotating. Weights determined by a suitable window function such as a Blackman window result in an acceptable approximation to a transverse sensor offset. In a preferred embodiment for practicing this invention, a Blackman window of length 4096, is effective to evaluate sensor offsets large enough to impact an inclination or azimuth calculation.

    [0067] As a sensor rotates, the noise varies, and the offsets are approximately constant over the processing window. To an acceptable approximation,

    [00016] .Math. g T m .Math. = .Math. k w ( k ) g T m ( k ) = g Tm , ( 4.2 a ) .Math. h T m .Math. = .Math. k w ( k ) h T m ( k ) = h T m . ( 4.2 b )

    The summation index, k, runs from 0 to N1 in (4.2). The coefficients, w(k), represent the tapered window function, g.sub.Tm(k) and h.sub.Tm(k) are the kth sample in a sequence of measurements. Numerous other suitable window functions are available.

    [0068] The Blackman window is especially useful because it is simple and effective. Other common tapered window functions are a Gaussian window, triangular window, Parzen window, Welch window, Hann window, Hamming window, and more described in https://en.wikipedia.org/wiki/Window_function.

    [0069] The weights for a Blackman window function are defined by the equation,

    [00017] p ( k ) = 0 . 4 2 - 0 . 5 cos ( 2 ( k - 1 ) / ( N - 1 ) ) + 0 . 0 8 cos ( 4 ( k - 1 ) / ( N - 1 ) ) , ( 4.3 a ) w ( k ) = p ( k ) / .Math. k p ( k ) . ( 4.3 b )

    The denominator of (4.3b) is a normalization factor that ensuring that .sub.kw(k)=1.

    [0070] In a preferred embodiment for practicing this invention, the approximated offsets custom-characterg.sub.Tmcustom-character and custom-characterh.sub.Tmcustom-character are stored in memory and subtracted from their respective transverse vector on command. In most practical scenarios, the transverse offsets vary slowly in time and need not be evaluated as frequently as an inclination or azimuth value is required.

    [0071] A rectangular window function has equal weights that are not tapered. Its use results in a simple arithmetic average of the data and the results are less accurate because a measurement sequence is truncated at both ends of the processing window. Thus, using a rectangular window for this application is not desirable for the purpose of estimating a transverse sensor offset, especially when the processing window encompasses only a few revolutions of the sensor.

    [0072] FIG. 2 is a flow chart showing steps for an embodiment of the invention where a transverse sensor offset is evaluated. A transverse sensor rotates while a sequence of measurements from the transverse sensor is acquired. Each member of the sequence is multiplied by the corresponding Blackman weight. The weighted sum is then evaluated. The sensor offset is assigned the value of the weighted sum.

    [0073] FIG. 3 illustrates the performance of an estimate in a preferred embodiment of the invention for the offset for h.sub.xm=custom-characterh.sub.xmcustom-character evaluated according to equation (4.2b). The top panel in FIG. 3 shows a sequence of values representing the h.sub.xm with an offset of 3 uT. In the lower panel, it is multiplied by Blackman weights. The preferred embodiment estimate for the offset is custom-characterh.sub.xmcustom-character=0.29980 uT. A simple arithmetic average of unweighted data results in an estimate of 0.4 uT for the offset, over a 30% error.

    Noise Reduction on Quantities Derived from Transverse Fields.

    [0074] In a preferred embodiment for practicing this invention, the same window function used to approximate the sensor offsets custom-characterg.sub.Tmcustom-character and h.sub.Tmcustom-character is applied in evaluating averaged transverse dot and cross products of g.sub.Tm and h.sub.Tm. The averaged transverse dot and cross products are used with the approximated sensor offsets as follows:

    [00018] .Math. g T d .Math. h T d .Math. = .Math. g T m .Math. h T m .Math. - .Math. g T m .Math. .Math. .Math. h T m .Math. ( 4.4 a ) .Math. g T d h T d .Math. = .Math. g T m h T m .Math. - .Math. g T m .Math. .Math. h T m .Math. ( 4.4 b )

    [0075] Equations (4.4a) and (4.4b) are respectively useful for suppressing adverse effects caused by time-dependent measurement errors. In (4.4),

    [00019] .Math. g T m .Math. h T m .Math. = .Math. k w ( k ) g T m ( k ) .Math. h T m ( k ) ( 4.5 a ) .Math. g T m h T m .Math. = .Math. k w ( k ) g T m ( k ) h T m ( k ) ( 4.5 b )

    [0076] It follows that an averaged transverse product magnitude is:

    [00020] .Math. g T d h T d .Math. = .Math. g T d .Math. h T d .Math. 2 + .Math. g T d h T d .Math. 2 . ( 4.6 )

    [0077] An averaged transverse product magnitude is useful for an averaged custom-characterg.sub.Tdcustom-character given an averaged value for custom-characterh.sub.Tdcustom-character, or for approximating an averaged custom-characterh.sub.Tdcustom-character given a value for averaged custom-characterg.sub.Tdcustom-character given the definition:

    [00021] .Math. g T d .Math. .Math. h T d .Math. = .Math. g T d h T d .Math. ( 4.7 )

    [0078] In a preferred embodiment for practicing this invention, a value for custom-characterg.sub.Tdcustom-character is evaluated by dividing an averaged transverse product magnitude by a value for custom-characterh.sub.Tdcustom-character. This is a much better way to evaluate an averaged transverse gravity magnitude than averaging a sequence of transverse gravity magnitude values because custom-characterh.sub.Tdcustom-character can be evaluated to an acceptable accuracy in nearly all practical cases because the noise vector associated with custom-characterh.sub.Tmcustom-character tends to be relatively small. In contrast, the noise vector associated with g.sub.Tm tends to be relatively large because of mechanical shock and vibration that happens under dynamic conditions.

    [0079] In a preferred embodiment for practicing this invention,

    [00022] .Math. h T d .Math. = ( [ .Math. k w ( k ) h T m ( k ) .Math. h T m ( k ) ] - .Math. h T m .Math. .Math. .Math. h T m .Math. ) 0 . 5 . ( 4.8 )

    [0080] Various products of sensor offsets subtracted from the weighted sums in equations (4.4a), (4.4b), and (4.8). Because the sensor offsets tend to be small quantities and they are multiplied together, their products tend to be very small and can be ignored in many cases. Though this is not a preferred embodiment for practicing the invention, it is simpler and provides adequate accuracy in many practical circumstances. Thus, an alternative embodiment is to respectively replace (4.5a), (4.5b), and (4.8) with:

    [00023] .Math. g _ Td .Math. h _ Td .Math. = .Math. g _ Tm .Math. h _ Tm .Math. , ( 4.9 a ) .Math. g _ Td h _ Td .Math. = .Math. g _ Tm h _ Tm .Math. , and ( 4.9 b ) .Math. h Td .Math. = .Math. h _ Tm .Math. h _ Tm .Math. . ( 4.9 c )

    [0081] The preferred embodiments are equally applicable to static and dynamic scenarios. Embodiments involving (4.9a)-(4.9c) have the potential to be more susceptible to residual transverse sensor offsets if the device is not rotating, but acceptable practical results may be achieved in many cases of interest even if the device is not rotating.

    [0082] The sensor offsets are evaluated using a tapered window function. Though it is preferable to evaluate averaged dot and cross products of the transverse gravity and magnetic measurements using that tapered window function, the present invention can be practiced with any means for averaging, aggregating, combining, or selecting a member of a set of measured transverse dot and cross products. This is also true for evaluating a transverse magnetic magnitude where a preferred embodiment is to use equation (4.8), but the invention can be practiced with any means for evaluating an average, aggregation, combination, or selecting a member of a set of transverse magnetic measurements leading to an estimate for a transverse magnetic magnitude. To the extent that a tapered window function is a limitation on the invention, it is a limitation only for evaluating a transverse sensor offset.

    [0083] FIG. 4 provides a comparison of a preferred embodiment practice for evaluating custom-characterg.sub.Tdcustom-character=custom-characterg.sub.Tdh.sub.Tdcustom-character/custom-characterh.sub.Tdcustom-character against a prior art average of transverse gravity values using equation (3.2b). The estimate using the averaged transverse product magnitude can't be distinguished from the correct values which are also displayed in FIG. 4. The prior art estimates are uniformly high. Biased errors of this type are not acceptable. The rms vibration assumed in these calculations is 0.125 g.

    [0084] An alternative missing in the prior art is the use of correlation detection to evaluate a transverse field magnitude or a transverse product magnitude. This is discussed in detail below under the heading, Transverse field correlations and enhanced noise rejection..

    Axial Magnetic Offset.

    [0085] Axial magnetic measurements have to be especially accurate because, in many practical scenarios, even a small calibration error on an axial magnetic measurement can make a big impact on an estimated azimuth angle. A novel equation for evaluating an axial magnetic field value based on an axial gravity measurement, a transverse gravity measurement, a transverse magnetic measurement, and a predetermined magnetic dip angle is useful for this purpose. This equation is

    [00024] .Math. h zd ( a , b , c ) .Math. = - b b 2 - 4 ac 2 a , where ( 4.1 a ) a = g Td 2 sin 2 ( D ) - g zd 2 cos 2 ( D ) , ( 4.1 b ) b = - 2 g zd g _ Td .Math. h _ T , ( 4.1 c ) c = ( g _ Td h _ Td ) 2 + g zd 2 h Td 2 sin 2 ( D ) - g Td 2 h Td 2 cos 2 ( D ) , and ( 4.1 d )

    the constant D is a known magnetic dip value determined using prior art. Equation (4.10a) is means for evaluating an axial magnetic field without a predetermined value for a magnetic field magnitude. A value for custom-characterh.sub.zd(a, b, c)custom-character estimated using equations (4.10a), (4.10b), (4.10c), and (4.10d) can be used directly in a formula for an azimuth angle in the practice of this invention. Alternatively, a sensor offset can be evaluated by subtracting a h.sub.z-value evaluated according to (4.10) from a measurement of h.sub.zm.

    [0086] In a preferred embodiment for practicing this invention, an averaged measurement custom-characterh.sub.zmcustom-character is used to evaluate the axial offset according to the equation

    [00025] h z = .Math. h zm .Math. - .Math. h zd ( a , b , c ) .Math. , ( 4.11 )

    where the custom-characterh.sub.zmcustom-character can be any combination of more than one h.sub.zm values or even a single h.sub.zm value, but is most advantageously evaluated according to the formula

    [00026] .Math. h zm .Math. = .Math. k w ( k ) h zm ( k ) , ( 4.12 )

    where the sum is evaluated in the same manner in equation (4.2a) and (4.2b), and the same tapered window function is used. Typically, this sensor offset varies slowly over time and need not be evaluated frequently. Thus, a value for h.sub.z can be evaluated under advantageous dynamic conditions, stored in memory, and applied to data acquired over another processing window.

    [0087] In a preferred embodiment for practicing this invention, a transverse magnitude product is used, and

    [00027] a = .Math. g Td h Td .Math. 2 sin 2 ( D ) / .Math. h Td .Math. 2 - .Math. g zd .Math. 2 cos 2 ( D ) , ( 4.13 a ) b = - 2 .Math. g zd .Math. .Math. g _ Td .Math. h _ Td .Math. , ( 4.13 b ) c = .Math. g _ Td h _ Td .Math. 2 + .Math. g zd .Math. 2 .Math. h Td .Math. 2 sin 2 ( D ) - .Math. g Td h Td .Math. 2 cos 2 ( D ) , and ( 4.13 c ) .Math. g zd .Math. = .Math. g zm .Math. = .Math. k w ( k ) g zm ( k ) , ( 4.13 d )

    where custom-characterg.sub.zdcustom-character in equation (4.13d) is evaluated in the same manner explained for equations (4.2a) and (4.2b). Given a value for h.sub.z determined as described above, an estimate for custom-characterh.sub.zdcustom-character that can be used in evaluating an azimuth is

    [00028] .Math. h zd .Math. = .Math. h zm .Math. - h z , ( 4.14 )

    where custom-characterh.sub.zmcustom-character represents an average of axial magnetic measurements, preferably evaluated using a tapered window function, and h.sub.z may be predetermined or evaluated contemporaneously with custom-characterh.sub.zmcustom-character in (4.14). In the contemporaneous case, equation (4.14) is equivalent to assigning custom-characterh.sub.zdcustom-character=custom-characterh.sub.zd(a, b, c)custom-character. Any estimate for custom-characterh.sub.zdcustom-character with a dependency on custom-characterh.sub.zd(a, b, c)custom-character in a prior art azimuth formula is novel and useful.

    [0088] In practice, the sign ambiguity in equation (4.10a) can be resolved by evaluating the sign in advance given a well plan, a magnetic dip, and theoretical values for ideal measurements in the device coordinate system. Those skilled in the art would be able to accomplish this task.

    [0089] An important application for equation (4.10a) is horizontal drilling. In this case, the plus sign is used in (4.10a) when the tangent vector to the well has a component in the northern direction and the minus sign is used when the tangent vector to the well has a component in the southern direction. Because sensor offsets tend to be stable over time, a sensor offset can be determined in favorable conditions, stored in memory, and recalled as needed. For example, a horizontal section of a well drilled in the east-west direction could have a sign ambiguity problem. However, a value for h.sub.z can be evaluated using equation (4.11) when the well is not horizontal or on an east-west heading. Once the axial magnetic offset is known, a driller can use the conditions custom-characterg.sub.zmcustom-character=0 and custom-characterh.sub.zmcustom-characterh.sub.z=0 to establish and maintain a horizontal trajectory on an east-west heading.

    [0090] This invention can be practiced with any means for averaging, aggregating, or combining a sequence of axial gravity or magnetic measurements. The preferred practice for evaluating custom-characterh.sub.zmcustom-character or custom-characterg.sub.zmcustom-character is to use the same tapered window function specified for estimating transverse sensor offsets.

    [0091] FIG. 5 depicts steps in evaluating an azimuth measurement based on a measured axial gravity value, a measured transverse magnetic vector, a measured transverse gravity vector using a quadratic equation and a predetermined magnetic dip angle. In the first step, one or more measurements of: an axial gravity value, a transverse magnetic vector, and a transverse gravity vector are acquired. The measurements and a prescribed magnetic dip value are processed to evaluate coefficients for a quadratic equation. A solution to the quadratic equation is then assigned to an axial magnetic field value. An azimuth is evaluated using the axial magnetic field value. Though it is not preferred for practicing this invention, an axial magnetic value evaluated according the quadratic equation can be used in prior art formulas for evaluating an azimuth.

    5 Transverse Field Correlations and Enhanced Noise Rejection

    [0092] Correlation-based techniques can be applied to evaluate an averaged transverse field magnitude or an averaged transverse product magnitude when the sensor is rotating. These techniques are especially useful when time-dependent errors on the transverse magnetic measurements are severe or the sensor rotation is very irregular.

    [0093] One challenge applying a correlation method to measurements acquired by a sensor affixed to a rotating drill string is that the rate of rotation typically varies over a processing window. The problem is that a correlation depends on both a transverse magnitude and a sensor rotation coherence over the processing window. The prior art does not enable determining either variable from a correlation when the two variables are conflated in this fashion.

    [0094] A novel and useful feature of this invention is that the sensor rotation coherence is evaluated using a first correlation, the first correlation depending upon the sensor rotation coherence but not a transverse magnitude.

    [0095] A second correlation depending on a transverse magnitude (or transverse product magnitude) and the sensor rotation coherence is also evaluated. An estimate of the magnitude independent of the sensor rotation coherence is then evaluated. For the purpose of this invention, perfectly coherent sensor rotation over a processing window would mean the sensor rotated at a constant rate over the processing window. For a less coherent sensor rotation, the rate of rotation varies over the processing window.

    [0096] Complex variables are used for convenience here. Consider a complex-valued variable u=u+iu=|u|exp(i.sub.u). Its real part is u, its imaginary part is u, its magnitude is |u|={square root over (uu+uu)}, its phase is .sub.u=atan2(u, u), and the imaginary number is i={square root over (1)}. A complex conjugate of u is u*=uiu. The imaginary part of a real-valued variable is identically zero. A complex-valued sequence is a sequence of complex variables.

    [0097] Complex variables are applicable to this problem because a transverse vector can be expressed as a complex variable. For example, measurement of a transverse magnetic vector h.sub.Tm can be expressed as the complex variable h.sub.xm+ih.sub.ym, and a measurement of a transverse gravity vector g.sub.Tm can be expressed as the complex variable g.sub.xm+ig.sub.ym.

    [0098] Now consider two complex-valued sequences u(j) and v(j), j=0, . . . , N1. In general, their correlation is a complex-valued sequence, r(l), l=N, . . . , N1, and it is defined by the equation

    [00029] r ( l ) = R ( u , v ) = .Math. j = 0 N - 1 u ( j ) v * ( j + l ) . ( 5.1 )

    The correlation may be referred to as a correlation of u and v or a correlation between u and v. The variable l is referred to as a correlation lag. A full energy of a correlation is defined by

    [00030] EF ( r ) = .Math. j = - N N - 1 r ( j ) r * ( j ) . ( 5.2 a )

    [0099] An energy of a correlation is a combination of terms r(j)r*(j) in equation (5.2a) wherein some terms may be omitted or enter into the sum as a reduced weight, others may be weighted heavily, or is otherwise representative of an average, an aggregation, or combination of r(j)r*(j) values. An energy of a correlation, r will be represented by the symbol E(r). The full energy of the correlation is a special case where the energy is evaluated according to equation (5.2a) or using another numerical method that gives substantially the same result as (5.2a).

    [0100] In a preferred embodiment for practicing this invention, N=4096 and the sensor rotation coherence is represented by a correlation r.sub.0(l) defined by substituting u(j)=h.sub.xm(j)+ih.sub.ym(j) and v(j)=1/u*(j) into (5.1). Specifically,

    [00031] r 0 ( l ) = R ( h xm + ih ym , ( h xm - ih ym ) - 1 ) = .Math. j = 0 N - 1 exp ( i u ( j ) ) exp ( - i u ( j + l ) ) . ( 5.3 a )

    where h.sub.xm(j) and h.sub.ym(j) are sequences comprising N samples of transverse magnetic vector measurements defined in (4.1), preferably with sensor offsets subtracted. The correlation r.sub.0(l) has no dependence on a magnitude of a transverse vector; so, an energy of this correlation, E(r.sub.0), also depends only on the sensor rotation coherence and not a transverse magnitude. This is important because energies of other relevant correlations have the same sensor rotation coherence dependence but also a transverse magnitude or a transverse product magnitude dependence.

    [0101] Persons of ordinary skill in the art will appreciate that an expression analogous to equation (5.3a) could be based on g.sub.T, but it would ordinarily be less reliable because of shock and vibration effects. A preferred embodiment of this invention is to use (5.3a) instead of:

    [00032] r 0 ( l ) = R ( g xm + ig ym , ( g xm - ig ym ) - 1 ) . ( 5.3 b )

    The invention is practicable with either realization of r.sub.0(l).

    [0102] Now consider the correlation,

    [00033] r 1 ( l ) = R ( h xm + ih ym , h xm + ih ym ) = .Math. h Td .Math. 2 .Math. j = 0 N - 1 exp ( i u ( j ) ) exp ( - i u ( j + l ) ) . ( 5.4 )

    It follows that,

    [00034] .Math. h Td .Math. = ( E ( r 1 ) / E ( r 0 ) ) 1 / 4 . ( 5.5 )

    In this equation, a sensor rotation coherence is used to remove a dependence of a correlation on the sensor rotation coherence, and the result is a magnitude of a transverse vector that can be used for evaluating an inclination or azimuth. Likewise, a value for custom-characterg.sub.Tdcustom-character can be evaluated based upon:

    [00035] r 2 ( l ) = R ( g xm + ig ym , g xm + ig ym ) , and ( 5.6 ) .Math. g Td .Math. = ( E ( r 2 ) / E ( r 0 ) ) 1 / 4 . ( 5.7 )

    [0103] In a preferred embodiment of practicing this invention, the transverse gravity magnitude is evaluated using an averaged transverse product magnitude evaluated based upon the correlation:

    [00036] r 3 ( l ) = R ( g xm + ig ym , h xm + ih ym ) , from which it follows that ( 5.8 ) .Math. g Td h Td .Math. = ( E ( r 3 ) / E ( r 0 ) ) 1 / 2 , and ( 5.9 ) .Math. g Td .Math. = E ( r 3 ) 1 / 2 / ( E ( r 1 ) E ( r 0 ) ) 1 / 4 . ( 5.1 )

    [0104] In a preferred embodiment for using correlation-based embodiments of this invention, quantities proportional to an energy of each correlation are evaluated using a Fast Fourier Transform (FFT) and Parseval's theorem. Persons of ordinary skill in the art will understand how to evaluate a correlation using a FFT. For the purpose of this invention, applying Parseval's theorem is superior to evaluating an energy of a correlation directly. Further, according to the invention, the length of the FFT is preferably at least 2N because the FFT should be at least as long as the correlation sequence being evaluated to avoid aliasing in the frequency domain. Let F(u), F(v), and F(r)=F(R(u, v)) respectively denote the FFT of sequences u, v, and r. The FFT of each sequence is a sequence indexed in the frequency domain. These sequences are related by F(r)=F(u)F*(v). According to Parseval's theorem the sum of the squares of the magnitudes of the members of a sequence and its Fourier transform (including a Fourier transform evaluated using a FFT method) are proportional. So, calculations for evaluating a transverse field magnitude using a correlation are more efficiently done using Fourier transforms.

    [0105] Equations (5.4) and (5.6) are referred to as auto-correlations because the same sequence is correlated against itself. Equation (5.8) is referred to as a cross-correlation. Given these definitions, a cross-correlation is useful for determining an averaged transverse product magnitude, and an auto-correlation is useful for determining a averaged transverse magnitude.

    [0106] Alternatively, one component of a sequence of transverse vectors can be synthesized using the other component of the sequence of transverse vectors by means of, a Hilbert transform. While not a preferred embodiment for practicing the invention, but it has the potential to be useful in any embodiment of the invention when a component of a transverse vector is unfit for use. For the purpose of this invention, a synthesized component of a transverse vector is a measurement of that component of the vector.

    [0107] Persons of ordinary skill in the art will appreciate that several alternative embodiments are available given the above disclosure. For example, results obtained using a convolution instead of a correlation trivially differ because their total energy is the same. A one-sided correlation could be done where only positive or negative correlation lags are used, but this reduces the amount of noise cancellation. Any filtering or data windowing operation can be performed on the input data sequences or their Fourier transforms.

    [0108] Instead of evaluating correlations for complex-valued sequences, the method can be applied to real-valued sequences by assigning a value of zero to the imaginary part of u and v, and assigning one of the four transverse field variables, h.sub.xm, h.sub.ym, g.sub.xm, g.sub.ym to the real part of u, and one of same four transverse field variables to the real part of v. Real-valued auto-correlations are less effective for removing time-dependent than real-valued cross-correlations; so, improved performance will not result from correlating a real-valued variable against itself. Nonetheless, this invention can be practiced using any two of the four transverse field variables in a correlation.

    [0109] Samples may sometimes be advantageously omitted from a correlation. One example is when an accelerometer is saturated. Such omissions are best done by assigning a value of zero to any an omitted sample in all correlations over the processing window. This includes correlations determining a sensor rotation coherence.

    [0110] FIG. 6 depicts a method for evaluating an azimuth or inclination using a correlation wherein a sensor rotation coherence dependence is removed from the correlation to determine a transverse magnitude, the transverse magnitude used in evaluating the azimuth or inclination. As specified, a sensor is rotated in a wellbore. The sensor acquires a sequence of measurements of a component of a transverse vector. A correlation involving the sequence is evaluated. The correlation depends on both a transverse magnitude and a sensor rotation coherence. The dependence of the correlation on the sensor rotation coherence is removed. What remains is a transverse magnitude that is an averaged transverse magnitude. The averaged transverse magnitude is used an inclination or azimuth calculation.

    7 Formulas for Inclination, Azimuth, and g Using an Averaged Transverse Product Magnitude or a Sensor Rotation Coherence.

    [0111] In the practice of this invention, one or more of the formulas listed here may be evaluated by processor 15 or any other processor based on sensor signals from magnetometer 11 and accelerometer 12 using instructions stored on non-transitory computer-readable medium 14 or any other non-transitory computer-readable medium.

    [00037] g = .Math. h Td .Math. - 1 .Math. g zd .Math. 2 .Math. h Td .Math. 2 + .Math. g Td h Td .Math. 2 , ( 7.1 a ) = a tan 2 ( .Math. g Td h Td .Math. / .Math. h Td .Math. , .Math. g zd .Math. ) = a tan 2 ( .Math. g Td h Td .Math. / h 2 - .Math. h zd .Math. 2 , .Math. g zd .Math. ) , ( 7.1 b ) = a cos ( .Math. g zd .Math. .Math. h Td .Math. / .Math. g zd .Math. 2 .Math. h Td .Math. 2 + .Math. g Td h Td .Math. 2 ) ( 7.1 c ) = a sin ( .Math. g Td h Td .Math. / .Math. g zd .Math. 2 .Math. h Td .Math. 2 + .Math. g Td h Td .Math. 2 ) . ( 7.1 d ) [ S a C a ] = [ .Math. g _ Td h _ Td .Math. .Math. h Td .Math. .Math. g zd .Math. 2 .Math. h Td .Math. 2 + .Math. g Td h Td .Math. 2 .Math. h zd .Math. .Math. g Td h Td .Math. 2 - .Math. g zd .Math. .Math. g _ Td .Math. h _ Td .Math. .Math. h Td .Math. 2 ] , ( 7.2 a ) = a tan 2 ( S a , C a ) . ( 7.2 b ) g = .Math. g zd .Math. 2 + ( E ( r 2 ) / E ( r 0 ) ) 0.5 , ( 7.3 a ) = a tan 2 ( ( E ( r 2 ) / E ( r 0 ) ) 0.25 , .Math. g zd .Math. ) , ( 7.3 b ) = a cos ( .Math. g zd .Math. E ( r 0 ) 0.25 / .Math. g zd .Math. 2 + E ( r 2 ) 0.5 ) , ( 7.3 c ) = a sin ( E ( r 2 ) 0.25 / .Math. g zd .Math. 2 E ( r 0 ) 0.5 + E ( r 2 ) 0.5 ) . ( 7.3 d ) [ S a C a ] = [ .Math. g _ Td h _ Td .Math. .Math. g zd .Math. 2 + ( E ( r 2 ) / E ( r 0 ) ) 0.5 .Math. h zd .Math. ( E ( r 2 ) / E ( r 0 ) ) 0.5 - .Math. g zd .Math. .Math. g _ Td .Math. h _ Td .Math. ] , ( 7.4 a ) = a tan 2 ( S a , C a ) . ( 7.4 b )

    [0112] None of the above formulas or any equivalent have been used in the prior art for evaluating an inclination or azimuth. A distinguishing feature of these equations is the use of: 1) an averaged transverse product magnitude; or, 2) an averaged transverse magnitude evaluated using an energy of a correlation without a sensor rotation coherence dependence.

    [0113] FIG. 7 depicts a method for determining an inclination or azimuth measurement using an averaged transverse and product magnitude. The averaged transverse product magnitude is evaluated using a plurality of transverse magnetic vectors and transverse gravity vectors.

    [0114] While not a preferred embodiment for practicing this invention, the above formulas (7.1a-7.4b) are applicable without either axial measurement. In these embodiments, an averaged transverse gravity magnitude is expressed in terms of an averaged transverse product magnitude and an averaged transverse magnetic magnitude. An axial gravity value based on the averaged transverse product magnitude, a prescribed gravity magnitude, and the averaged transverse magnetic magnitude is evaluated and used in any of the above formulas. An axial magnetic value can be evaluated according to a quadratic equation if a magnetic dip is prescribed or based on the averaged transverse magnetic magnitude and a prescribed magnetic field magnitude. An axial magnetic value determined in this fashion can be used in any of the above formulas.

    [0115] Though an object of this invention is to achieve accurate results without using an adaptive filter or a nonlinear inversion, this invention can be used advantageously to improve the performance of such prior art. Persons of ordinary skill in the art will understand that any formula relating measurements to an inclination, azimuth, or field magnitude including the above formulas could be applied directly to a method such as the method described in U.S. Pat. No. 9,804,288 to redefine equations of state and state variables. Superior performance is provided according to the invention over the prior art because the equations of state would be recast in variables having narrower error distributions. In the case of an adaptive filter, results would be much less sensitive to statistical assumptions about the error distributions associated with the measurements.

    8 Two-Stage Sampling of Sensor Signals with Prior Art Calibration

    [0116] The prior art indicates that filter delays contribute to errors between the phase of the transverse gravity and transverse magnetic measurements acquired by sensors affixed to a rotation drill string. FIG. 5 in U.S. Pat. No. 9,273,547 shows data with errors ascribed to, at least in part, this effect. A specific source of such phase errors not mentioned in the '547 patent or elsewhere is the fact that the errors on the gravity measurements, largely due to shock and vibration, typically have a wider bandwidth and are larger in magnitude, than the errors on the magnetic measurements.

    [0117] A person of ordinary skill in the art will understand that an analog low-pass filter (LPF) is required to avoid aliasing when sampling an analog signal such as a signal from an accelerometer or magnetometer. It is especially challenging to build such a filter for a typical system that operates at a nominal sample rate suitable for a dynamic wellbore surveying system, roughly 100 Hz. As pointed out in U.S. Pat. No. 9,273,547, a practical filter satisfying these requirements will produce data with errors due to a frequency-dependent filter delay.

    [0118] In a preferred embodiment of practicing the present invention, a two-stage sampling system is applied to signals from the gravity and magnetic sensors. In a first stage, data are sampled at a rate several fold higher than is required for a typical drilling application. In a second stage, a digital LPF preferably having a finite impulse response (FIR) is applied and the data are down-sampled to a lower rate of 100 Hz. FIG. 8 is a schematic illustrating a suitable system architecture.

    [0119] Operating the first stage at a sample rate of approximately 500 Hz, significantly relaxes the requirements on the analog filter. System performance is improved by adding a second stage to digitally filter the data. A preferred analog filter is shown in FIG. 9. After passing through the analog filter, the signal is digitized with an analog-to-digital convertor. Then the digital filtering stage is done, preferably with down-sampling. The impulse response of a preferred digital LPF is shown in FIG. 10, and the coefficients defining the impulse response are listed in FIG. 11.

    [0120] For a signal digitized at a sample rate of 500 Hz with samples sought at a sample rate of 100 Hz, the digital LPF need only be applied to every fifth point. This can be accomplished by convolving the impulse response with an output from an A/D converter, the filter centered on every fifth digitized sample. In an alternative implementation, a Fourier transform of the input data is evaluated and multiplied by the Fourier transform of the filter coefficients, the inverse Fourier transform is evaluated, and every fifth sample of the resulting sequence is retained. The down-sampled data are then calibrated. One skilled in the art would be able to implement this technique based upon the above specification.

    [0121] In a preferred embodiment for practicing this invention, the three accelerometer channels and the three magnetometer channels are sampled at substantially the same time. For the purpose of the two-stage sampling system operating at an initial sample rate of 500 Hz, the six channels are preferably sampled within 50 micro-seconds. A mirror image sample sequencing procedure such as described in U.S. Pat. No. 4,894,923 can be used to mitigate effects of timing errors in systems unable to sample all channels at substantially the same time.

    [0122] This embodiment of the present invention is practicable if a calibration is applied directly to the output of the A/D convertor. However, this is not a preferred embodiment for practicing the invention because many unnecessary calculations are required to calibrate the data before applying the LPF given that it is advantageous to sample the LPF output at a lower rate than the A/D convertor output. However, this embodiment is nevertheless particularly important to calibrate data from two different sensors before a combination of the data from the two sensors is combined. This is especially true when one sensor is a transverse magnetic sensor and the other is a transverse gravity sensor.

    [0123] Persons of ordinary skill in the art will be aware of multi-channel A/D converters that can be used, and they will appreciate that an individual A/D converter for each channel is not strictly necessary. Many A/D converters can operate at a frequency much higher than needed for this application. For this reason, it is also possible to multiplex the six measurement channels, use a single-channel A/D converter, demultiplex the digitized result, and then apply the digital LPF and calibration.

    [0124] The sampling technique specified here includes applying a prior art calibration to the digitized sensor signals. Prior art calibration techniques correct for sensor gain and offset variations, temperature drift, and typically incorporate measured calibration data acquired at a shop or the wellsite prior to placing the device in a wellbore. After calibration, additional processing to remove residual sensor offsets, reduce errors due to sensor misalignment, and noise (time-dependent errors) from the data may be applied prior to evaluating an inclination or azimuth.

    [0125] A person of ordinary skill in the art will understand that uncalibrated measurements are, in general, not suited for combining with each other. For example, a dot or cross product between a transverse magnetic and transverse gravity vector would be evaluated using calibrated data. A combination of measurements to evaluate an inclination or azimuth would be done using calibrated data.

    [0126] FIG. 12 depicts an embodiment of a system for applying the two-stage sampling system of the invention including a calibration and advantageous use of the system to combine two calibrated digitally filtered signals for determining an inclination or azimuth. An analog sensor signal passes through an analog LPF and is digitized to form a digitized signal. A digital LPF is applied to the digitized signal to form a digitally filtered signal. The digitally filtered signal is calibrated to form a first calibrated digitally filtered signal. The first calibrated digitally filtered signal is combined with a second calibrated digitally filtered signal to form a combined digital signal. The combined digital signal is then used to evaluate an inclination or azimuth.

    [0127] In a preferred embodiment for practicing this invention, the six analog signals from sensors 11 and 12 are transformed into six calibrated digitally filtered signals sampled at a rate of 100 Hz. The calibrated digitally filtered signals form a measured values that are combined according to this specification. In general, the calibration can be applied before or after the digital filter, but it is most advantageously applied after the digital filter.

    [0128] The description of the different illustrative embodiments has been presented for purposes of illustration and description and the invention is not intended to be exhaustive or limited to the embodiments in the form disclosed. Many modifications and variations will be apparent to persons of ordinary skill in the art. Further, different illustrative embodiments may provide different features as compared to other desirable embodiments. The embodiments selected are chosen and described in order to best explain the principles of the invention and the practical applications of the invention, and to enable persons of ordinary skill in the art to understand the invention and various embodiments of it and various modifications of it as are suited to the particular use contemplated.