Abstract:
A method and apparatus is disclosed for improving the accuracy of directional surveys using magnetometers and accelerometers. The method corrects errors in bias, scale-factor, misalignment of cross-axial magnetometers, and bias or scale-factor of axial magnetometer by requiring the magnitude of measured cross-axial magnetic field to be as constant as possible over several tool face angles at a survey point in a wellbore and the magnitude of the measured total magnetic field and dip angle equal to the reference values, respectively. The axial component of the measured magnetic field is also determined. The method also corrects accelerometers similarly. The calibration parameters obtained at one survey point are applied to measurements at other survey points to improve the accuracy of surveys and the efficiency of drilling operations.

Description:
FIELD OF THE INVENTION  
         [0001]    This invention relates to the directional drilling of boreholes using Measurement-While-Drilling (MWD) directional sensors and provides a method of and means for calibrating the directional sensors downhole to improve the determination of a well orientation.  
           [0002]    MWD directional sensors are used to determine the orientation of wells. A MWD directional sensor uses three magnetometers and three accelerometers. The sensor array is packaged and housed in a tool as a section of the drillstring near the drill bit. The three magnetometers are used to obtain magnetic field components along three orthogonal axes either directly by mounting magnetometers orthogonally or indirectly by transforming the three nearly orthogonal measurements onto the orthogonal axes. The same is true for the accelerometers. The accelerometers measure acceleration which has the same magnitude but opposite sign as the gravity field when the directional tool is at rest. Therefore, accelerometers are used to measure gravitational field components along three orthogonal axes. They are used as gravity meters.  
           [0003]    The axes of magnetometers and accelerometers are usually made to be exactly aligned with each other and are used as those of the directional sensor frame, even though it is not necessary to do so. As long as the relative orientation between magnetic and gravitational axes are known, one can always transform magnetic measurements into those along gravity axes or vice versa or both types of measurements into a different frame. Without a loss of generality, it is assumed that the three magnetometers measure magnetic field components along x, y, and z directions where z is along the drillstring axis and x, y, and z are orthogonal. The accelerometers measure the gravitational field components along the same x, y, and z directions.  
           [0004]    The directional sensor measures the earth&#39;s magnetic vector {right arrow over (B)}=(B x , B y , B z ) and gravity vector {right arrow over (G)}=(G x , G y , G z ) at a survey point in a well. These measurements are used to obtain through known methods the orientation of the well at the survey point, namely, the inclination and azimuth. The sensor orientation about drillstring axis, i.e. the tool face angle, can also be obtained.  
           [0005]    The correct determination of well azimuth relies on accurate measurement of the earth&#39;s magnetic vector. Two factors related to magnetometers may corrupt the determination of azimuth. One is due to a magnetic field generated by magnetizations in magnetic material near the directional sensor package so that the measured magnetic field is not purely that of the earth. The extra field interferes with the earth field and is called magnetic interference or interference. The other is magnetometer sensor error causing a magnetometer reading to be different from the field being measured.  
           [0006]    The magnetometers and accelerometers in a sensor package are calibrated when the directional tool is manufactured. The calibration parameters are bias and scale factor for each sensor and misalignments among sensor axes. The parameters are applied to convert sensor output into magnetic and gravitational measurements. For example, magnetometer measurements are related to the magnetic sensor outputs by the following equation:  
                 (           B   x               B   y               B   z           )     =       (         1         m   xy           m   xz               m   yx         1         m   yz               m   zx           m   zy         1         )                     {         (           1   /     s   x           0       0           0         1   /     s   y           0           0       0         1   /     s   z             )          (           V   x               V   y               V   z           )       -     (           B     0      x                 B     0      y                 B     0      z             )       }         ,           (   1   )                               
 
           [0007]    where s&#39;s are scale-factors, m&#39;s are misalignments, V&#39;s are sensor outputs such as voltages, and B 0 &#39;s are biases. The accelerometer measurements are related to accelerometer sensor outputs by an equation identical in form to the above equation.  
           [0008]    Many factors cause the calibration parameters to drift with time. Directional sensors are recalibrated from time to time.  
           [0009]    To eliminate the magnetic interference, a directional sensor array is housed in the midsection of a nonmagnetic drill collar. If the nonmagnetic collar is long enough, then the interference is negligible. Nonmagnetic collars are used in all drilling operations where magnetometers are used for directional sensing.  
           [0010]    Because of mechanical and other operational constraints and considerations, sometimes an operator has to use a shortened nonmagnetic collar for directional sensor.  
           [0011]    With a shortened nonmagnetic collar for the directional sensor package, the magnetic interference from adjacent magnetic material on drillstring corrupts the readings of magnetometers. Namely, the magnetometer measurements are no longer those of the earth&#39;s magnetic field, but the sum of the earth&#39;s field and the interference field due to the magnetizations in the magnetic material.  
           [0012]    When interference is present, well-calibrated magnetometers still measure correctly the magnetic field at the survey point. But the interference term is an error in the measurement of the earth&#39;s magnetic field. Because of the rigid relative position between the directional sensor and the interfering magnetic material on the drillstring, interference is a constant in the directional sensor frame. Thus a magnetic interference appears as a bias error in the measurement of the earth&#39;s magnetic field. To obtain an accurate measurement of azimuth, one must subtract the interference from magnetometer measurement. Methods and techniques for correcting magnetic interference from the use of shortened nonmagnetic collars to house directional sensors are called short-collar methods or short-collar algorithms.  
         STATEMENT OF THE PRIOR ART  
         [0013]    Because a magnetic interference comes from magnetic materials on sections of the drillstring above or below the directional sensor collar, the interference is mainly in the axial direction. The measurement of the earth&#39;s magnetic field component along the axial direction is affected most.  
           [0014]    Several techniques have been developed to determine and eliminate the axial magnetic interference. In Russell, U.S. Pat. No. 4,819,336, the axial component of the earth&#39;s magnetic field is determined by choosing a B z  so that {right arrow over (B)}=(B x , B y , B z ) satisfies some constraint imposed by the known magnitude and dip angle of the earth&#39;s magnetic field. The known parameters B ref  and θ ref  are called reference magnitude and reference dip angle. They are obtained from sources independent of the directional sensor measurement. In one method disclosed by Russell, B z  is determined by requiring the measured magnitude, B={square root}{square root over (B x   2 +B y   2 +B z   2 )}, to equal to that of reference, B ref.  By determining axial magnetic field component this way, one obtains a B z  value free of axial magnetic interference. In fact, the measurement of B z  is not necessary if the sign of it is known from the approximate orientation of the well at the survey point.  
           [0015]    The shortcoming of all methods using known properties of the earth&#39;s magnetic field as constraints to correct only axial interference is that in obtaining the interference-free axial magnetic component, B z , the measurements of the cross-axial component, {right arrow over (B)} oxy =(B x , B y ), are assumed to be exact. Therefore, measurement errors in the cross-axial components cause errors in B z  obtained from a short-collar algorithm, which in turn cause errors in azimuth. This effect is especially pronounced when the directional tool is near the East-West and horizontal direction. Near this orientation, error in B z  from a short-collar algorithm due to a small and otherwise acceptable {right arrow over (B)} oxy  error can be much larger than the axial interference. Therefore, axial interference correction is often not applied in this region. The amplification of azimuth error from {right arrow over (B)} oxy  error in this region by a short-collar method is due to geometry, not the details of the method. The only effective way to reduce the amplification effect is to reduce the {right arrow over (B)} oxy  measurement error.  
           [0016]    The above-mentioned shortcoming is partially overcome by interference-correction methods where magnetic bias errors in all three directions are corrected. In van Dongen et al., U.S. Pat. No. 4,682,421, a method is disclosed for eliminating magnetic interference from magnetometer measurements. The interference in the x and y directions which are perpendicular to the drillstring axis is eliminated by making B x  and B y  measurements at several tool face angles at a survey point. If the magnetometers are accurate and the interference is absent, then the magnitude of the cross-axial magnetic field,  
           B   oxy     =         B   x   2     +     B   y   2           ,                         
 
           [0017]    should be constant for all tool face angles. The interference in the x and y directions is determined by adjusting the x and y biases so that the corrected B oxy  is as constant as possible over tool face. The adjustment is the interference term. By subtracting the interference from B x  and B y , the measurements are those of the earth&#39;s field, free of magnetic interference. The magnetic field component in the axial direction B z  is then determined by requiring the smallest vector difference between measured magnetic field vector and that of the earth obtained from another source to be minimal, namely by choosing a B z  that minimizes the E in the following equation,  
         E   =         B   2     +     B   ref   2     -     2        BB   ref                     cos        (     θ   -     θ   ref       )               ,                         
 
           [0018]    where B ref  and θ ref  are the reference magnitude and dip angle of the earth&#39;s magnetic field, and  
         B   =         B   x   2     +     B   y   2     +     B   z   2           ,                         
 
           [0019]    are the measured magnitude and dip angle where B x  and B y  are bias corrected measurements of cross-axial magnetic field components. In this method, the measurement of B z  is sometimes not necessary.  
           [0020]    In Brooks, U.S. Pat. No. 5,623,407, the bias errors due to interference and other sources are determined by choosing the biases that minimize the variance of magnetic field magnitude at several sensor orientations.  
           [0021]    All existing methods designed for eliminating magnetic interference by correcting bias errors in magnetometers also eliminate bias errors caused by factors unrelated to interference. In fact, the improvement on axial interference determination and elimination by methods of van Dongen et al. and Brooks come mainly from the elimination of cross-axial bias errors unrelated to interference since the cross-axial interference is rarely significant.  
           [0022]    The scale-factor errors and misalignment errors in x and y magnetometers can still produce errors in the measurement of B oxy  which in turn produce errors in B z  determined from a short-collar algorithm, thus causing an extra error in azimuth in addition to the error directly created by errors in the measurement of B oxy .  
         SUMMARY OF THE INVENTION  
         [0023]    The present invention consists of the steps of:  
           [0024]    (1) obtaining reference values of magnitude and dip angle of the earth&#39;s magnetic field;  
           [0025]    (2) making magnetometer and accelerometer measurements at several tool face angles at a survey point in the wellbore;  
           [0026]    (3) determining the bias errors in x and y magnetometers and errors of misalignment and relative scale-factor between x and y magnetometers by choosing the error parameters so that the magnitudes of the corrected cross-axial magnetic field at all tool face angles are as constant as possible;  
           [0027]    (4) determining the axial component of magnetic field, B z , and the scale-factor error common to both cross-axial magnetometers by requiring the measured magnitude and dip angle of magnetic field after applying corrections to equal to their reference values, respectively;  
           [0028]    (5) applying corrections obtained in steps (1) to (4) to obtain corrected magnetic field measurements, {right arrow over (B)} c =(B xc , B yc , B zc ) at one or all the tool face angles;  
           [0029]    (6) calculating well orientation using {right arrow over (B)} c =(B xc , B yc , B zc ) and accelerometer measurements.  
           [0030]    In step (4), the axial component of the magnetic field is determined. This can be done without an axial magnetic measurement in cases where the approximate inclination and azimuth of the directional tool is known. Therefore, this invention can be used when only the measurements of cross-axial magnetometers are available. When the measurement of axial magnetometer is available, the bias error caused by interferences or other factors is the difference between B zc  and the axial magnetometer reading before correction if bias is known to be the dominant problematic calibration parameter. If axial scale-factor is the main source of error in axial magnetometer, then the difference between one and the ratio of B zc  over the axial magnetometer reading before correction is the scale-factor error.  
           [0031]    The calibration parameters determined using this invention at one survey point can be used at other survey points. This invention can be viewed as a downhole calibration method.  
           [0032]    This invention is also a method for calibrating biases, misalignment, scale-factors in x and y directions, and either the axial bias or scale-factor for accelerometers. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0033]    [0033]FIG. 1 is a diagram of the magnetic field measured by the cross-axial magnetometers with only bias errors plotted as a function of tool face.  
         [0034]    [0034]FIG. 2 is a diagram similar to that of FIG. 1 except that the cross-axial magnetometers have both bias and scale-factor errors.  
         [0035]    [0035]FIG. 3 is a diagram similar to that of FIG. 1 except that the cross-axial magnetometers have bias, scale-factor, and misalignment errors.  
         [0036]    [0036]FIG. 4 is a diagram of relationships among a tool face angle and its nearest neighbors where directional sensor measurements are made. 
     
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0037]    [0037]FIG. 1 shows the effect of bias errors in x and y magnetometers on magnetic measurement. For perfect magnetometers, the diagram is a circle centered at the origin. With biases in magnetometers, the diagram is still a circle, but is off-centered. The displacements between the center of the circle and the origin of the B x  and B y  coordinates are the bias errors in x and y magnetometers, respectively. Prior art techniques known to one skilled in the art can been used to determine the bias errors and corrections can been made to x and y magnetometers. After corrections, the diagram is a circle centered at the origin.  
         [0038]    When there are errors in scale-factors in x and y magnetometers, the diagram is in general an ellipse. In FIG. 2., the diagram corresponds to a case where y magnetometer scale-factor is smaller than the correct value. Prior art short-collar algorithms can be used to correct the bias errors so that the corrected diagram is centered at the origin. However, it remains elliptical in shape.  
         [0039]    In this invention, the x and y magnetometer scale-factors are also corrected in addition to bias corrections. They are determined by requiring the diagram in FIG. 2 to be deformed into a circle centered at the origin (constant magnitude constraint). The circular requirement only determines the relative scale-factor error between x and y magnetometers. If both magnetometers have identical scale-factor errors, the diagram is still a circle. The cross-axial scale-factor errors are corrected in two steps.  
         [0040]    In the first step (step (3) in the Summary of the Invention), errors in biases in x and y magnetometers and a relative scale-factor error between the two magnetometers are determined by the centered circle requirement. The cross-axial scale-factor error common to both cross-axial magnetometers and the correct axial magnetic field component, B z , are determined in the second step (step (4) in the summary of the invention). After two steps, errors of bias and scale-factor in the x and y magnetometers and the correct axial component of the earth&#39;s magnetic field are determined.  
         [0041]    There are many ways to parameterize the relative scale-factor error in the first step. They all lead to the same final results after the second step. One way is to assume that there is no scale-factor error in the x magnetometer in the first step. The scale-factor error in the y magnetometer is the relative error.  
         [0042]    Let {right arrow over (B)} i =(B ix , B iy , B iz ) and {right arrow over (G)} i =(G ix , G iy , G iz ) be the measured magnetic and gravitational fields, respectively, at the ith tool face angle among a group of field measurements at N tool faces at a survey point in a well. After the first step, the corrected measurements of the cross-axial magnetic field, ({tilde over (B)} ix , {tilde over (B)} iy ) is related to those of before correction by  
                       (             B   ~     ix                 B   ~     iy           )     =         [         1       0           0         1   +     s   xy             ]                     (           B   ix               B   iy           )       -     (           Δ                   B   x                 Δ                   B   y             )         ,                         i   =   1     ,   2   ,     3                 …                ,   N   ,                 (   2   )                               
 
         [0043]    where ΔB x  and ΔB y  are x and y magnetometer bias errors, respectively, and s xy  is the relative scale-factor error. They are determined by the centered circle requirement. This is accomplished mathematically by solving the following equations for ΔB x , ΔB y , and s xy :  
                   ∂   I         ∂   Δ                     B   x         =   0     ,           (   3   )                     ∂   I         ∂   Δ                     B   y         =   0     ,           (   4   )                     ∂   I       ∂     s   xy         =   0     ,           (   5   )                 I   =       1   N                       ∑     i   =   1     N            [         B   ~     ix   2     +       B   ~     iy   2     -       1   N            ∑     j   =   1     N          (         B   ~     jx   2     +       B   ~     jy   2       )           ]     2           ,           (   6   )                     B   ~     ix   2     +       B   ~     iy   2       =       B   ix   2     +     B   iy   2     +         s   xy          (     2   +     s   xy       )            B   iy   2       -             (   7   )                              2                 Δ                   B   x          B   ix       -     2        (     1   +     s   xy       )        Δ                   B   y          B   iy       +     Δ                   B   x   2       +     Δ                     B   y   2     .                                                 
 
         [0044]    Let (B ixc , B iyc , B zc ) be the magnetic field measurements at the ith tool face angle after the correction made in the second step. Because the axial component of the earth&#39;s magnetic field is a constant with respect to tool face rotation, there should be only one value of corrected axial component for all tool face angles. The corrected magnetic field after the second step correction is related to that of the first step by:  
           B   ixc     =       (     1   +   s     )            B   ~     ix         ,     
            B   iyc     =       (     1   +   s     )            B   ~     iy         ,     
            B   zc     =           1   N            ∑     i   =   1     N          B   iz         -     Δ                   B   z         =         B   _     z     -     Δ                   B   z             ,                         
 
         [0045]    where s is the common cross-axial scale-factor error and ΔB z  is the axial magnetic field correction. In cases where the axial magnetic measurements are not available, {overscore (B)} z  is estimated to be  
         ±         B   ref   2     -       1   N            ∑     i   =   1     N          (         B   ~     ix   2     +       B   ~     iy   2       )               ,                         
 
         [0046]    where the sign is determined by the knowledge of the approximate well orientation at the survey point.  
         [0047]    s and B zc  are determined by requiring (1) the magnitude of measured magnetic field corrected after the second step equal to the reference value of the magnitude of the earth&#39;s magnetic field (B total constraint) (2)the magnetic dip angle calculated with measurements corrected in the second step equal to the reference dip angle (dip angle constraint). In the preferred embodiment, the two constraints are realized mathematically as the following two equations:  
                   1   N            ∑     i   =   1     N          [           (     1   +   s     )     2          (         B   ~     ix   2     +       B   ~     iy   2       )       +     B   zc   2       ]         =     B   ref   2       ,           (   8   )                   1   N            ∑     i   =   1     N                (     1   +   s     )          (         G   ix            B   ~     ix       +       G   iy            B   ~     iy         )       +       G   iz          B   zc                 G   ix   2     +     G   iy   2     +     G   iz   2                      (     1   +   s     )     2          (         B   ~     ix   2     +       B   ~     iy   2       )       +     B   zc   2                 =       sin        (     θ   ref     )       .             (   9   )                               
 
         [0048]    Equations (3)-(5) are quadratic in ΔB y , s xy  and linear in ΔB x . They can be solved algebraically or numerically using known algorithms. In the preferred embodiment of the present invention, they are solved iteratively using linear approximations.  
         [0049]    Because s xy  is very small compared with 1, the term s xy  in (2+s xy ) and (1+s xy ) in equation (7) can be dropped, resulting in the following equation: 
           {tilde over (B)}   ix   2   +{tilde over (B)}   iy   2   ≅B   ix   2   +B   iy   2 +2 s   xy   B   iy   2 −2 B   ix   ΔB   x −2 B   iy   ΔB   y   +ΔB   x   2   +ΔB   y   2 .  (10) 
         [0050]    With this approximation, equations (3)-(5) become linear in ΔB x , ΔB y , and s xy , resulting in the following three equations:  
                 s   xy            ∑     i   =   1     N            B   iy   2          (       B   ix     -       B   _     x       )           -     Δ                   B   y            ∑     i   =   1     N            B   iy          (       B   ix     -       B   _     x       )           -           (   11   )                                Δ                   B   x            ∑     i   =   1     N            B   ix          (       B   ix     -       B   _     x       )           =       -     1   2              ∑     i   =   1     N            (       B   ix   2     +     B   iy   2       )          (       B   ix     -       B   _     x       )             ,                                 s   xy            ∑     i   =   1     N            B   iy   2          (       B   iy     -       B   _     y       )           -     Δ                   B   y            ∑     i   =   1     N            B   iy          (       B   iy     -       B   _     y       )           -           (   12   )                                Δ                   B   x            ∑     i   =   1     N            B   ix          (       B   iy     -       B   _     y       )           =       -     1   2              ∑     i   =   1     N            (       B   ix   2     +     B   iy   2       )          (       B   iy     -       B   _     y       )             ,                                 s   xy            ∑     i   =   1     N            B   iy   2          (       B   iy   2     -       B   _     y   2       )           -     Δ                   B   y            ∑     i   =   1     N            B   iy          (       B   iy   2     -       B   _     y   2       )           -           (   13   )                                Δ                   B   x            ∑     i   =   1     N            B   ix          (       B   iy   2     -       B   _     y   2       )           =       -     1   2              ∑     i   =   1     N            (       B   ix   2     +     B   iy   2       )          (       B   iy   2     -       B   _     y   2       )             ,                                             
 
         [0051]    where {overscore (B)} x , {overscore (B)} y , {overscore (B)} y   2  are the averages over N tool face measurements, namely,  
             B   _     x     =       1   N            ∑     i   =   1     N          B   ix           ,     
              B   _     y     =       1   N            ∑     i   =   1     N          B   iy           ,     
              B   _     y   2     =       1   N            ∑     i   =   1     N            B   iy   2     .                                 
 
         [0052]    Equations (11)-(13) can also be obtained by simply dropping quadratic and higher terms in ΔB x , ΔB y , and s xy  from equations (3)-(5). They are solved easily using known algorithms for linear equation systems.  
         [0053]    In cases where the linear approximation is unsatisfactory, iterations are required. The first step of the iteration is to solve equations (11)-(13) and apply the solutions to obtain corrected magnetic field measurements. Then the coefficients in equations (11)-(13) are computed using the corrected magnetic field and the equations are solved again with newly computed coefficients. This process repeats until the solutions become smaller than preset limits. Mathematically, the iterations are carried out using the following equations:  
               s   xy     k   +   1              ∑     i   =   1     N            B   iy     k   2            (       B   ix   k     -       B   _     x   k       )           -     Δ                   B   y     k   +   1              ∑     i   =   1     N            B   iy   k          (       B   ix   k     -       B   _     x   k       )           -     Δ                   B   x     k   +   1              ∑     i   =   1     N            B   ix   k          (       B   ix   k     -       B   _     x   k       )             =       -     1   2              ∑     i   =   1     N            (       B   ix     k   2       +     B   iy     k   2         )          (       B   ix   k     -       B   _     x   k       )             ,                      s   xy     k   +   1              ∑     i   =   1     N            B   iy     k   2            (       B   iy   k     -       B   _     y   k       )           -     Δ                   B   y     k   +   1              ∑     i   =   1     N            B   iy   k          (       B   iy   k     -       B   _     y   k       )           -     Δ                   B   x     k   +   1              ∑     i   =   1     N            B   ix   k          (       B   iy   k     -       B   _     y   k       )             =       -     1   2              ∑     i   =   1     N            (       B   ix     k   2       +     B   iy     k   2         )          (       B   iy   k     -       B   _     y   k       )             ,     
                s   xy     k   +   1                ∑               i   =   1     N            B   iy     k   2            (       B   iy     k   2       -       B   _     y     k   2         )           -     Δ                   B   y     k   +   1                ∑               i   =   1     N            B   iy   k          (       B   iy     k   2       -       B   _     y     k   2         )           -     Δ                   B   x     k   +   1                ∑               i   =   1     N            B   ix   k          (       B   iy     k   2       -       B   _     y     k   2         )             =       -     1   2                ∑               i   =   1     N            (       B   ix     k   2       +     B   iy     k   2         )          (       B   iy     k   2       -       B   _     y     k   2         )             ,     
                    B   ix     k   +   1       =              B   ix   k     -     Δ                   B   x   k           ,     i   =   1     ,   2   ,   3   ,   …              ,   N   ,                   B   iy     k   +   1       =                (     1   +     s   xy   k       )          B   iy   k       -     Δ                   B   y   k           ,     k   =   0     ,   1   ,   2   ,     …                 K     ,                   B   ix   0     =            B   ix       ,     i   =   1     ,   2   ,   3   ,   …              ,   N   ,                   B   iy   0     =            B   iy       ,                                 
 
         [0054]    where superscript k in x k  denotes x after k iterations.  
         [0055]    After K iterations, ΔB x , ΔB y , and s xy  are given by  
           s   xy     =         (     1   +     s   xy   1       )          (     1   +     s   xy   2       )                   …                   (     1   +     s   xy     k   +   1         )       -   1       ,     
            Δ                   B   x       =       ∑     k   =   1     K          Δ                   B   x   k           ,     
            Δ                   B   y       =         (     1   +     s   xy       )          B   iy       -     B   iy     K   +   1           ,     1   ≤   i   ≤     N   .                             
 
         [0056]    The iteration stops at k=K when ΔB x   K , ΔB y   K , and s xy   K  become smaller than the preset accuracy requirements. The linear approximation used to obtain equations (11)-(13) is very good. Rarely more than one iteration is needed. The iteration method is a multivariate version of the Newton-Raphson method (multivariate Newton-Raphson method).  
         [0057]    Equations (8) and (9) are also solved for s and ΔB z  using the multivariate Newton-Raphson method. Because s and ΔB z  are very small compared with 1 and the magnitude of magnetic field, respectively, the multivariate Newton-Raphson method is very effective. In most cases, only one iteration is required. Namely, the solution to the following linear equations is an excellent approximation of that of equations (8) and (9):  
                   s        1   N            ∑     i   =   1     N          (         B   ~     ix   2     +       B   ~     iy   2       )         -     Δ                   B   z            B   _     z         =              1   2          [       B   ref   2     -       1   N            ∑     i   =   1     N          (         B   ~     ix   2     +       B   ~     iy   2     +       B   ~     z   2       )           ]         ,           (   14   )                       s        1   N              ∑               i   =   1     N          [             B   _     z   2          (         G   ix            B   ~     ix       +       G   iy            B   ~     iy         )       -       G   iz            B   _     z            B   ~     ioxy   2             G   i            B   ~     i   3         ]         -     Δ                   B   z          1   N              ∑               i   =   1     N          [         G   iz         G   i            B   ~     i         -         (         G   -&gt;     i     ·         B   ~     →     i       )            B   _     z           G   i            B   ~     i   3           ]           =       sin        (     θ   ref     )       -       1   N              ∑               i   =   1     N                G   -&gt;     i     ·         B   ~     -&gt;     i           G   i            B   ~     i                 ,     
        where          
                      B   ~     i     =           B   ~     ix   2     +       B   ~     iy   2     +       B   _     z   2           ,                     B   ~     ioxy   2     =         B   ~     ix   2     +       B   ~     iy   2         ,                   G   i     =         G   ix   2     +     G   iy   2     +     G   iz   2           ,                     G   -&gt;     i     ·         B   ~     -&gt;     i       =         G   ix            B   ~     ix       +       G   iy            B   ~     iy       +       G   iz              B   -     z     .                         (   15   )                               
 
         [0058]    [0058]FIG. 3 is a plot of the cross-axial magnetic field measured by a pair of x and y magnetometers that are not orthogonal to each other. The misalignment error causes the magnitude of the cross-axial magnetic field to vary with tool face. Therefore, the misalignment error can also be determined by the constant magnitude constraint. In cases where the errors in misalignment between x and y magnetometers are not negligible, equation (2) is replaced by the following:  
                 (             B   ~     ix                 B   ~     iy           )     =         [         1       m           m       1         ]          (           B   ix                 (     1   +     s   xy       )          B   iy             )       -     (           Δ                   B   x                 Δ                   B   y             )         ,     i   =   1     ,   2   ,     3                 …                ,   N   ,           (   16   )                               
 
         [0059]    where m is the misalignment error parameter.  
         [0060]    Substitute equation (16) into equation (6) and then set the first derivatives of I with respect to ΔB x , ΔB y , s xy , and m to zero, respectively. The resulting four equations are solved by the multivariate Newton-Raphson method. Then s and ΔB z  are obtained by solving equations (8) and (9) in the same way as described previously.  
         [0061]    The solutions are applied to correct magnetic readings at the survey point by  
                     (           B   ixc               B   iyc               B   izc           )     =                [           1   +   s           m        (     1   +   s     )           0             m        (     1   +   s     )               (     1   +   s     )          (     1   +     s   xy       )           0           0       0       1         ]          (           B   ix               B   iy                 B   -     z           )       -                            (             (     1   +   s     )        Δ                   B   x                   (     1   +   s     )        Δ                   B   y                 Δ                   B   z             )     ,     i   =   1     ,   2   ,   3   ,   …              ,     N   .                     (   17   )                               
 
         [0062]    The corrected magnetic measurements of the cross-axial magnetic field are free of errors in bias, scale-factor, misalignment in x and y magnetometers. The corrected axial magnetic measurement is free of errors. The cross-axial magnetic measurements at other survey points in the well can be corrected by  
               (           B   xc               B   yc           )     =           (     1   +   s     )          [           1       m           m         1   +     s   xy                      0           0           ]            (           B   x               B   y           )       -       (     1   +   s     )            (           Δ                   B   x                 Δ                   B   y             )     .                 (   18   )                               
 
         [0063]    The ΔB z  represents the axial magnetic measurement error at the survey point. In cases where bias error is the dominant source of error, i.e., when magnetic interference is significant, ΔB z  is the bias error in the axial magnetometer. Then, axial magnetic measurements at other survey points can be corrected by 
           B   zc   =B   z   −ΔB   z .  (19) 
         [0064]    When scale-factor error is known to be the main source of error in the axial magnetometer, the error is s z =({overscore (B)} z −ΔB z )/{overscore (B)} z −1. This scale error can be corrected at other survey points by 
           B   zc =(1 +s   z ) B   z .  (20) 
         [0065]    Well orientations obtained by using the magnetometer measurements corrected by methods of this invention are free of errors in bias, scale-factor, and misalignment in x and y magnetometers and are free of errors in z magnetometers. In interference correction applications this invention greatly reduce the size of the region near the East-West and horizontal orientation where the corrections are ineffective and erroneous.  
         [0066]    Either of the two steps can be used without the other to improve magnetometer measurements. In a case where the first step is not necessary or unrealizable, only s and B zc  (hence ΔB z ) are determined. Equations (8) and (9) are modified by replacing the cross-axial magnetic measurements corrected by the constant magnitude constraint by the uncorrected ones. s and B zc  can be obtained with measurements at only one tool face. Therefore, the second step alone can be applied to any survey to improve the accuracy of well orientation determination.  
         [0067]    Applying the second step alone to correct the axial magnetic interference is still advantageous over prior art methods where both reference values of the magnitude and dip angle of the earth&#39;s magnetic field are used to obtain the axial magnetic measurement only. The scale-factor error in x and y magnetometers is not corrected and can cause azimuth error as mentioned previously. In this invention, the two reference values are used to determine two unknowns. In addition to the axial magnetic measurement, the scale-factor error common to x and y magnetometers is also corrected. The axial magnetic measurement determined using method of this invention is less prone to cross-axial magnetic measurement error than that of prior art method.  
         [0068]    Measurement at each tool face is given an equal weight of 1/N in computing I in equation (6). The equal weighting is based on the assumption that the directional measurements are made at the tool face angles approximately evenly distributed in the entire range of tool face. If the tool face angles are not evenly distributed, uneven weights are used. The weight for measurement at the ith tool face angle is  
                 W   i     =       0.5                   mod        (       tf_i1   -   tf_i2   +   360     ,   360     )         360       ,           (   21   )                               
 
         [0069]    where tf_i1 and tf_i2 are the nearest tool face angles in degrees from the ith tool face counter-clockwise and clockwise, respectively, and mod(a, b) is the remainder of a/b. The angles are shown in FIG. 4. The numerator in the above expression is the angle between the two dashed lines in the figure.  
         [0070]    Accelerometer measurement errors can also be corrected using the method of this invention in two steps in a similar way as described above for magnetometer measurements. In the first step, the gravitational measurements at multiple tool face angles at a survey point are used to determine errors in biases, a relative scale-factor, and a misalignment in x and y accelerometers by the centered circular requirements (constant magnitude constraint) for cross-axial gravitational measurements. Then the reference magnitude of earth&#39;s gravity (G total constraint) and the magnetic dip angle are used to determine the correct axial gravitational measurement and the common scale-factor error in the cross-axial accelerometers.  
         [0071]    The magnetic dip is a joint property between the earth&#39;s gravitational and magnetic fields. Once the constraint is satisfied by correcting either magnetic or gravitational measurements it is no longer a constraint for the other measurements. Thus the dip angle constraint can not be applied simultaneously to correct both gravitational and magnetic measurements as described above. When both types of sensors are calibrated and corrected using the method of this invention, the second step for either magnetic or gravitational measurements must be modified. For example, in operations with shortened nonmagnetic collars, the dip angle constraint is used for magnetic calibration and correction. The second step for accelerometer measurements is changed to using the G total constraint to determine either the axial gravitational field or the common cross-axial scale-factor error.  
         [0072]    The foregoing disclosure and description of the invention is illustrative and explanatory thereof. Various changes in the details of the method may be made within the spirit and scope of the claims of this invention. The present invention should only be limited by the claims below and their equivalents.