Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
IN-SITU DOWNHOLE MEASUREMENT CORRECTION AND CONTROL
Document Type and Number:
WIPO Patent Application WO/2019/222720
Kind Code:
A1
Abstract:
A method includes providing a Bottom Hole Assembly (BHA) in a wellbore. The BHA includes a rotary steerable system and a downhole attitude correction and control system. The downhole correction and control system includes a first sensor set, the sensors of the first sensor set positioned near ferromagnetic components of a drill string and a second sensor set, the sensors of the second sensor set positioned further from the ferromagnetic components of the drill string than the sensors of the first sensor set. The downhole correction and control system also includes a RSS controller operatively coupled to and adapted to receive measurements from the first and second sensor sets, the controller in data communication with the rotary steerable system.

Inventors:
WHITACRE TIMOTHY (US)
WHITE MATTHEW (US)
PIPATWIT PONG (US)
Application Number:
PCT/US2019/033015
Publication Date:
November 21, 2019
Filing Date:
May 18, 2019
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SCIENT DRILLING INT INC (US)
International Classes:
E21B7/10; E21B7/04; E21B7/06; E21B44/00
Foreign References:
US20130126239A12013-05-23
US20130314092A12013-11-28
US5553678A1996-09-10
US5265682A1993-11-30
Attorney, Agent or Firm:
LOCKLAR, Michael (US)
Download PDF:
Claims:
Claims

1. A method comprising: providing a Bottom Hole Assembly (BHA) positioned in a wellbore, the BHA comprising: a rotary steerable system; and a downhole attitude correction and control system, the downhole correction and control system comprising: a first sensor set having sensors; a second sensor set having sensors, the sensors of the second sensor set positioned further from one or more ferromagnetic components of the drill string than the sensors of the first sensor set; and a RSS controller, the RSS controller operatively coupled to and adapted to receive measurements from the first and second sensor sets, the controller in data communication with the rotary steerable system; obtaining corrupted data from the first sensor set and reference data from the second sensor set, the corrupted data including along-hole and cross-axis magnetometer and accelerometer measurements; depth aligning the corrupted sensor data and the reference data; calculating twist misalignment between the cross-axis magnetometer and accelerometer measurements of the corrupted sensor data to obtain a bias estimate; calculating an estimated z axis magnetic scale factor and bias of the first sensor set; calculating a cross-axis magnetic scale factor of the corrupted sensor data; correcting the corrupted sensor data to form corrected sensor measurements; calculating an estimated azimuth from the corrected sensor measurements; and steering the rotary steerable system based on the estimated azimuth.

2. The method of claim 1, wherein the first sensor set and the second sensor set include one or more accelerometers and magnetometers.

3. The method of claim 2, wherein the one or more accelerometers are triaxial accelerometers and the one or more magnetometers are triaxial magnetometers.

4. The method of claim 1, wherein the first sensor set, the second set, or both include one or more gyroscopes.

5. The method of claim 1, wherein the second sensor set is positioned further uphole in the wellbore than the first sensor set.

6. The method of claim 1, wherein the first sensor set and the second sensor set are positioned at a known separation along the drill string.

7. The method of claim 6, wherein the first sensor set and the second sensor set are aligned within a known bend angle.

8. The method of claim 1, wherein the step of steering the rotary steerable system is performed by the RSS controller.

9. The method of claim 1, wherein the RSS controller includes instructions on non-transitory computer-readable media to process the corrupted sensor data, the reference sensor data, or both to calculate the orientation of the BHA, wherein the orientation consists of inclination, azimuth, toolface, or a combination thereof.

10. The method of claim 1, wherein the step of obtaining corrupted data from the first sensor set and reference data from the second sensor set is performed as the drill string is moved within the wellbore.

11. The method of claim 10, wherein drilling string movement within the wellbore includes rotation, longitudinal translation, or both.

12. The method of claim 10 further comprising after the step of obtaining corrupted data from the first sensor set and reference data from the second sensor set: applying calibrated scale factors, bias, misalignments, and combinations thereof to the corrupted data and the referenced data.

13. The method of claim 12, wherein the calibrated scale factors, bias, and misalignments are determined before the first sensor set and the second sensor set are positioned within the wellbore.

14. The method of claim 10 further comprising prior to the step of obtaining corrupted data from the first sensor set and reference data from the second sensor set: phase aligning accelerometer and magnetometer readings.

15. The method of claim 1, wherein the step of obtaining corrupted data from the first sensor set or from the first sensor set and reference data from the second sensor set comprises: calculating delta between magnetic and gravity toolfaces (Mtf-HsTF), cross-axis acceleration (Across), Z-axis acceleration (Az), cross-axis magnetic field (Bcross), z-axis magnetic field (Bz), inclination of the drill string, or a combination thereof at locations of the wellbore at which the first sensor set and the second sensor set are positioned.

16. The method of claim 15, wherein inclination of the drill string is calculated as the four-quadrant inverse tangent of Across and Az according to:

Inc = atan2(Across,—Az)

17. The method of claim 15, further comprising: calculating a plurality of sliding averages and variances of MTF-HsTF, Across, Az, Bcross, Bz, and inclination.

18. The method of claim 17 further comprising: calculating a mean of the plurality of sliding averages and a sum of squares for the plurality of calculated variances.

19. The method of claim 18, wherein the mean of the plurality of sliding averages and a sum of squares for the plurality of calculated variances for the first sensor set is corrupted data.

20. The method of claim 18, wherein the mean of the plurality of sliding averages and a sum of squares for the plurality of calculated variances for the second sensor set is reference data.

21. The method of claim 1, wherein the step of depth aligning the corrupted data and the reference data is performed by: transferring corrupted data to a corrupted sensor data buffer and the reference data to a reference sensor data buffer; and aligning the corrupted sensor data buffer and the reference sensor data buffer such that the attitude of the reference sensor data buffer is taken at the same depth and same attitude as corresponding corrupted sensor data buffer.

22. The method of claim 21, wherein the aligning step is performed by matching patterns in the corrupted sensor data buffer and the reference sensor data buffer.

23. The method of claim 21, wherein the step of aligning is performed by comparing gamma readings, sonic readings, or resistivity.

24. The method of claim 1, wherein twist alignment is calculated as the difference between corrupted data and reference data Mtf-HsTF according to: deltaMtfHtfbiasEstimate = Mtf-HsTFcorrupted— Mtf-HsTFre -erence

25. The method of claim 1, wherein the estimated azimuth is calculated according to: Azimuth

= atan

where deltaMtfHtf Corrected = MTF— HsTF + deltaMtfHtf Bias

BzCorrected = Bz * BzScale + BzBias

BcrossCorrected = Bcross * BcrossScale

26. The method of claim 1, wherein steering the rotary steerable system comprises employing a target plane control mode, the target plane control mode comprising: defining a control plane by a starting attitude and a target attitude to drill towards and hold; and separating steering forces into two orthogonal components, a to-plane steering force in the direction normal to the plane and a to-target steering force parallel to the plane and in the direction of the target attitude.

27. The method of claim 26, further comprising: determining an error input by a single axis attitude controller, the error input being the angle between the tool attitude obtained from the estimated inclination and azimuth, and the control plane, with the output being the steering force to be applied, wherein the attitude controller determines the steering force using a PID, PID with leaky integrator, and integrator dead zone, parameter adaptive, non-parametric adaptive, model reference adaptive, or other control law.

28. The method of claim 27, wherein the to-target steering force defines a turn rate per along hole depth, and wherein the method further comprises: specifying a desired turn rate; and adjusting, with the RSS controller, the to-target steering force applied by the rotary steerable system to achieve the desired turn rate.

29. The method of claim 27, steering the rotary steerable system comprises employing a target hold control mode comprising: determining that the error input is below a predetermined threshold; projecting a target attitude vector onto a cross-borehole plane of the rotary steerable system; determining an estimated attitude vector with respect to North, East and Down coordinates using an estimated inclination and azimuth; and determining, with the RSS controller, a desired steering direction.

30. The method of claim 29, wherein the North, East, and Down coordinates are determined with respect to accelerometer or magnetometer measurements.

31. The method of claim 30, wherein the North, East, and Down coordinates are determined with respect to a weighted sum of the accelerometer and magnetometer measurements.

32. The method of claim 29, further comprising: receiving a course correction downlink sent from a surface system, the course correction downlink including a desired attitude; determining a temporary target attitude; entering target plane control mode to steer the rotary steerable system to the temporary target attitude; and entering target plane control mode to steer the rotary steerable system to the desired attitude.

33. The method of claim 29, further comprising: receiving a course correction downlink sent from a surface system, the course correction downlink including a desired attitude, a desired rotation angle, and a desired correction force; rotating the control plane about a vector lying in the original control plane and perpendicular to the desired attitude by the desired rotation angle; and entering target plane control mode to steer the rotary steerable system to the desired attitude using the desired correction force.

34. The method of claim 26, further comprising adjusting the control plane in response to an update to corrections of one or more of Bz, Bcross, or deltaMtfHtf, wherein adjusting the control plane comprises rotating the control plane about the target attitude vector so that the error angle to the plane does not include any error due to the updated corrections.

35. The method of claim 1, wherein steering the rotary steerable system comprises: providing a desired steering direction and steering force to the RSS controller; using the desired steering direction and steering force to set the force applied by the rotary steerable system; and steering the rotary steerable system in the desired direction.

36. The method of claim 1, wherein the rotary steerable system comprises a non-rotating sleeve, and wherein the method further comprises: experimentally determining interference caused by the non-rotating sleeve; and subtracting the experimentally determined interference from the cross-axis magnetometer measurements.

37. The method of claim 1, wherein the rotary steerable system comprises a non-rotating sleeve, and wherein the method further comprises: rotating the first sensor set relative to the non-rotating sleeve; obtaining measurements of the magnetic field with the first sensor set; identifying synchronous variations in the cross-axis magnetic field, total magnetic field, or one or more components of the magnetic field that correspond with the rotation of the first sensor set relative to the non-rotating sleeve; determining the interference caused by the non-rotating sleeve; and subtracting the magnetic interference caused by the non-rotating sleeve from the measurements of the first sensor set.

Description:
IN-SITU DOWNHOLE MEASUREMENT CORRECTION AND CONTROL

Cross-Reference to Related Applications

[0001] This application is a non-provisional application which claims priority from U.S. provisional application number 62/673,320, filed May 18, 2018, which is incorporated by reference herein in its entirety.

Technical Field/Field of the Disclosure

[0002] The present disclosure relates to the establishment of orientation and control of a downhole tool.

Background of the Disclosure

[0003] Knowledge of wellbore position is useful for the development of subsurface oil & gas deposits. Accurate knowledge of the position of a wellbore at a measured depth, including inclination and azimuth of the wellbore, may be used to determine the geometric target location of, for example, a hydrocarbon bearing formation of interest. Additionally, directional borehole drilling typically relies on one or more directional devices such as bent subs and rotary steering systems to direct the course of the wellbore. The angle between the reference direction of the directional device and an external reference direction is referred to as the toolface angle, and may determine the direction of deviation of the wellbore as the wellbore is drilled. During directional drilling, the placement of the borehole is typically compared with the desired path, and a toolface angle and other drilling parameters are selected to advance the borehole and correct the wellbore towards the desired path. Measurement of toolface, inclination and azimuth thus may be a component for borehole steering and placement. Additionally, when a steerable system such as a rotary steering system is used down-hole to direct the wellbore towards the desired path, changes in the selected toolface angle are typically sent from the surface to the down-hole system by downlinking and sending an encoded message via one or more telemetry channels, such as wired pipe, mud pump rate modulation, bypass of some of the drilling fluid through a bypass valve, drill string rotation modulation, or electromagnetic excitation of the drill string and surrounding formation. These downlink methods typically take a significant amount of time and may disrupt drilling of the wellbore.

[0004] Downhole sensors, such as downhole sensors for measurement while drilling (MWD), logging while drilling (LWD) and other measurement methods may be used for determining wellbore position. Certain sensors may be affected by downhole conditions or by the operation or proximate location of other components of the drill string. For example, magnetometers may be affected by ferromagnetic components of the drill string such as a drill bit. Traditionally, such interactions may limit the locations at which downhole sensors may be positioned along the drill string or prevent the downhole sensors from being placed at a preferred location nearer to the drill bit.

Summary

[0005] The present disclosure includes a method. The method includes providing a Bottom Hole Assembly (BHA) positioned in a wellbore. The BHA includes a rotary steerable system and a downhole attitude correction and control system. The downhole correction and control system includes a first sensor set having sensors, the sensors of the first sensor set positioned near ferromagnetic components of a drill string and a second sensor set having sensors, the sensors of the second sensor set positioned further from the ferromagnetic components of the drill string than the sensors of the first sensor set. The downhole correction and control system also includes a RSS controller, the RSS controller operatively coupled to and adapted to receive measurements from the first and second sensor sets, the controller in data communication with the rotary steerable system. The method also includes obtaining corrupted data from the first sensor set and reference data from the second sensor set, the corrupted data including along-hole and cross-axis magnetometer and accelerometer measurements. In addition, the method includes depth aligning the corrupted sensor data and the reference data and calculating twist misalignment between the cross-axis magnetometer and accelerometer measurements of the corrupted sensor data to obtain a bias estimate. The method further includes calculating an estimated z axis magnetic scale factor and bias of the first sensor set and calculating a cross-axis magnetic scale factor of the corrupted sensor data. The method additionally includes correcting the corrupted sensor data to form corrected sensor measurements and calculating an estimated azimuth from the corrected sensor measurements. The method further includes steering the rotary steerable system based on the estimated azimuth.

Brief Description of the Drawings

[0006] The present disclosure is best understood from the following detailed description when read with the accompanying figures. It is emphasized that, in accordance with the standard practice in the industry, various features are not drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion.

[0007] FIG. 1 depicts an overview of a drilling operation utilizing a drill string incorporating downhole sensors consistent with at least one embodiment of the present disclosure.

[0008] FIG. 2 depicts a drill string consistent with at least one embodiment of the present disclosure positioned in a wellbore.

[0009] FIG. 3 depicts a schematic view of a downhole attitude correction and control system consistent with at least one embodiment of the present disclosure. [0010] FIG. 4 depicts a process flow diagram of an attitude correction operation consistent with at least one embodiment of the present disclosure.

[0011] FIG. 5 depicts a schematic view of a steering operation of an RSS consistent with at least one embodiment of the present disclosure.

[0012] FIG. 6 depicts a schematic view of a steering operation of and RSS consistent with at least one embodiment of the present disclosure.

Detailed Description

[0013] It is to be understood that the following disclosure provides many different embodiments, or examples, for implementing different features of various embodiments. Specific examples of components and arrangements are described below to simplify the present disclosure. These are, of course, merely examples and are not intended to be limiting. In addition, the present disclosure may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.

[0014] FIG. 1 depicts an overview of a drilling operation in which wellbore 5 is formed from surface 10 into formation 15 using drill string 20. Drill string 20 may be made up of multiple tubular members coupled end-to-end to extend into wellbore 5. Drill string 20 may include bottom hole assembly (BHA) 25 positioned at a lower end of drill string 20. BHA 25 may include one or more downhole tools used for forming or measuring one or more aspects of wellbore 5 and formation 15 while BHA 25 is positioned in wellbore 5. In some embodiments, for example and without limitation, BHA 25 may include drill bit 30 used to form wellbore 5. In some embodiments, BHA 25 may include downhole motor 35. Downhole motor 35 may be used to rotate drill bit 30 during certain drilling operations such as sliding mode drilling operations. Downhole motor 35 may, for example and without limitation, be a mud motor, turbine motor, or electric motor. In some embodiments, BHA 25 may include one or more sensor packages including, for example and without limitation, azimuthal gamma tool 39. In some embodiments, BHA 25 may include survey tool 41. Survey tool 41 may be positioned at a distance from drill bit 30 on BHA 25. In some embodiments, survey tool 41 may include one or more sensors and controllers, as discussed further below, and may include non-magnetic components such as, for example and without limitation, non-magnetic housing 42. In some embodiments, BHA 25 may include one or more telemetry systems for communicating with surface equipment. In some such embodiments, BHA 25 may include mud pulser 43. In some embodiments, BHA 25 may include one or more power supplies 44, which may include batteries for providing electric power to components of BHA 25. In some embodiments, BHA 25 may include a steering system for guiding the formation of wellbore 5 including, for example and without limitation, rotary steerable system (RSS) 45. RSS 45 may be used for a directional drilling operation. In some embodiments, RSS 45 may include one or more steering members such as pads 50, which may be used to exert a force against wellbore 5 to alter the direction of propagation of wellbore 5. In such an embodiment, the direction in which RSS 45 steers the propagation of wellbore 5 is referred to as the toolface of RSS 45. In some embodiments, RSS 45 may include non-rotating sleeve 55 positioned about a rotating portion of RSS 45. Non-rotating sleeve 55 may be positioned such that while drill string 20 is rotated, non rotating sleeve 55 does not rotate or rotates at a slow rate relative to wellbore 5. In some embodiments, RSS 45 may include turbine generator 46 to, for example and without limitation, provide electric power to RSS 45. In some embodiments, RSS 45 may include RSS sensor package 47. RSS sensor package 47 may include one or more sensors and controllers as discussed further herein below.

[0015] In some embodiments, drill string 20 may include downhole attitude correction and control system 100. Downhole attitude correction and control system 100 may include two or more sensor sets positioned at different locations along drill string 20, referred to herein as first sensor set lOla and second sensor set lOlb. Although described with respect to two sensor sets, the methods described in the present application may be applied to any number of sensor sets. In some embodiments, each of first sensor set lOla and second sensor set 10 lb may include one or more accelerometers and magnetometers such as triaxial accelerometers and triaxial magnetometers. In some embodiments, each of first sensor set lOla and second sensor set 10 lb may include additional sensors including, for example and without limitation, gyroscopes. In some embodiments, first sensor set lOla may be positioned at a location along drill string 20 such that the readings of one or more sensors of first sensor set lOla are interfered with by components of drill string 20 such as drill bit 30. For example, in some embodiments, first sensor set lOla may be part of RSS sensor package 47. Second sensor set 10 lb may be positioned at a location along drill string 20 at which the readings of second sensor set 10 lb are not expected to be affected by other components of drill string 20. For example, in some embodiments, second sensor set lOlb may be part of survey tool 41. In some such embodiments, first sensor set lOla may be positioned nearer to ferromagnetic components of drill string 20 such as, for example and without limitation, drill bit 30, RSS 45, pads 50, non-rotating sleeve 55, turbine generator 46, or other components of BHA 25 than second sensor set lOlb. Such sources of interference may include hard and soft iron components that may cause apparent bias and scale factor errors for a magnetometer of first sensor set lOla positioned nearby. Second sensor set 10 lb may, in such an embodiment, be placed at a location on drill string 20 further uphole where less magnetic interference from components of drill string 20 is expected as shown in FIGS. 1 and 2. In some embodiments, as discussed above, survey tool 41 may be positioned in non-magnetic housing 42. In some embodiments, first sensor set lOla and second sensor set 10 lb may be positioned at a known separation distance apart along drill string 20 and may be aligned within a known maximum bend angle, defined as the angle between the along-hole axis of wellbore 5 at first sensor set lOla and the along-hole axis of wellbore 5 at second sensor set lOlb. As discussed further below, the twist angle between first sensor set lOla and second sensor set lOlb, defined as the angle about the along-hole axis of wellbore 5 between first sensor set lOla and second sensor set 10 lb, may not need to be known and may change.

[0016] In some embodiments, each of first sensor set lOla and second sensor set 10 lb may be connected to a corresponding first sensor controller l02a and second sensor controller l02b. In some embodiments, first sensor controller l02a may be part of RSS sensor package 47 and second sensor controller l02b may be part of survey tool 41. First sensor controller l02a and second sensor controller l02b may, among other operations, take and record measurements from the respective first sensor set lOla and second sensor set lOlb. In some embodiments, downhole attitude correction and control system 100 may include RSS controller 103 included with drill string 20. In some embodiments, RSS controller 103 may be part of RSS 45 and may include first sensor set lOla. In some embodiments, downhole attitude correction and control system 100 may include MP controller 104. MP controller 104 may periodically request and receive measurements of second sensor set 10 lb from survey tool 41. MP controller 104 may then transfer the measurements of second sensor set 10 lb to RSS controller 103. Each of first sensor controller l02a, second sensor controller l02b, RSS controller 103, and MP controller 104 may be interconnected, such as by a data bus and therefore able to communicate measurements, instructions, and other data between the controllers. For the purposes of this disclosure, RSS controller 103 is described; however operations described herein below may be distributed between one or more additional controllers. In some embodiments, as depicted in FIG. 3, RSS controller 103 may be operatively coupled to and adapted to receive measurements from first sensor set lOla and second sensor set 10 lb. In some embodiments, RSS controller 103 may include processor 105 adapted to perform computer program instructions according to methods including those described herein below. In some embodiments, processor 105 may be, for example and without limitation, a microprocessor, microcontroller, digital signal processor, ASIC, FPGA, or CPLD. In some embodiments, RSS controller 103 may include storage memory 107 that may be used to, for example and without limitation, store measurements received from first sensor set lOla and second sensor set 10 lb as well as any other information provided to RSS controller 103. In some embodiments, RSS controller 103 may include one or more communications systems 109 to allow communication between RSS controller 103 and other components of drill string 20 such as survey tool 41, first sensor controller l02a, and second sensor controller l02b, or other systems positioned at the surface through telemetry apparatus 111. Communication systems 109 may include, for example and without limitation, one or more of wired communication, wireless electromagnetic communication, or wireless acoustic communication systems. In some embodiments, RSS controller 103 may be adapted to communicate with or control RSS 45. In such an embodiment, RSS controller 103 may provide instructions to RSS 45 to, for example and without limitation, control the direction of drilling of wellbore 5 by drill string 20 during a drilling operation.

[0017] In some embodiments, RSS controller 103 may include instructions on a non-transitory computer-readable media to process the measurements received from first sensor set 10 la and second sensor set lOlb to determine the orientation of BHA 25 within wellbore 5 including, for example and without limitation, the inclination, azimuth, and toolface of drill string 20 within wellbore 5. In some embodiments, first sensor controller l02a may take measurements from first sensor set lOla and second sensor controller l02b may take measurements from second sensor set 10 lb within wellbore 5 as drill string 20 is moved within wellbore 5, such as during a drilling operation. In some embodiments, measurements may be taken while drill string 20 is moving within wellbore 5. The measurements may be received and stored by RSS controller 103. Because first sensor set lOla and second sensor set 10 lb are spaced apart along drill string 20, the measurements of first sensor set lOla and second sensor set 10 lb may make measurements at the same point along wellbore 5 at different times. However, because first sensor set 101 a is positioned proximate a source of interference on drill string 20, the measurements made by first sensor set lOla may be less accurate than the measurements made by second sensor set lOlb.

[0018] In some embodiments, RSS controller 103 may combine measurements from first sensor set lOla and second sensor set 10 lb to, for example and without limitation, estimate measurement errors on the measurements from first sensor set lOla, second sensor set 10 lb, or both. In some such embodiments, the measurements may be corrected for the identified measurement errors and may be used to estimate the orientation of BHA 25 including, for example and without limitation, the attitude including the inclination and azimuth of RSS 45.

[0019] FIG. 4 depicts a process flow diagram of a downhole measurement correction and control operation 200 consistent with at least one non-limiting embodiment of the present disclosure. In FIG. 4, first sensor set lOla and second sensor set 10 lb each includes sensors to measure cross axis and Z-axis (aligned with the longitudinal axis of drill string 20) components of the magnetic and gravitation fields. Different embodiments of the present disclosure may make use of different sensors to accomplish these measurements. For example and without limitation, in some embodiments, a z-axis gyro and a canted magnetometer and accelerometer could estimate these fields. In other embodiments, each of first sensor set lOla and second sensor set 10 lb may include two magnetometers oriented such that the sensitive axes are substantially not parallel and two accelerometers oriented such that the sensitive axes are substantially not parallel. In other embodiments, each of first sensor set lOla and second sensor set 10 lb may include at least one magnetometer aligned with the longitudinal axis of drill string 20 (Z-axis magnetometer), at least one magnetometer aligned substantially perpendicular to the longitudinal axis of drill string 20 (cross-axis magnetometer), an accelerometer aligned with the longitudinal axis of drill string 20 (Z-axis accelerometer), and at least one accelerometer aligned substantially perpendicular to the longitudinal axis of drill string 20 (cross-axis accelerometer).

[0020] In some embodiments, downhole measurement correction and control operation 200 may include obtaining measurements from first sensor set lOla and second sensor set 10 lb (201). In some embodiments, the sensors of first sensor set lOla and second sensor set 10 lb may be sampled while drill string 20 is moving within wellbore 5, including during rotation and longitudinal translation during a drilling operation. In certain embodiments, first sensor set lOla and second sensor set 10 lb may be sampled while drill string 20 is rotating or not rotating and while drill string 20 is at constant depth or while changing in depth. In some embodiments, sensors of first sensor set lOla and second sensor set 10 lb may be sampled at, for example and without limitation, between 50Hz and lKHz. In some embodiments, one or more controllers such as first sensor controller l02a and second sensor controller l02b may initially correct the measurements by applying calibration parameters to the sensor readings (202). For example, in some embodiments, calibrated scale factors, bias, and misalignments may be applied to the respective sensor readings. Such calibrated scale factors, biases, and misalignments may be determined by calibration experimentation undertaken before first sensor set lOla and second sensor set 10 lb are used in wellbore 5. In some embodiments, such calibrated scale factors, biases, and misalignments may be determined in-situ. In some embodiments, a combination of calibration parameters determined prior to sensor sets lOla and 10 lb being in the wellbore and calibration parameters identified in- situ, may be used to correct the measurements. In some embodiments, where the measurements are obtained during rotation of drill string 20, accelerometer and magnetometer readings may be phase aligned to, for example and without limitation, reduce or remove phase error of the magnetometer readings due to eddy-current effects caused by conductive materials of drill string 20 rotating in the earth’s magnetic field. In some embodiments, magnetic interference may likewise be subtracted from the magnetometer readings due to experimentally determined interference of non-rotating sleeve 55 or RSS 45. In some embodiments, such magnetic interference may be determined in-situ. In some embodiments, one or more sensors may be used to determine the relative orientation between first sensor set 10 la and non-rotating sleeve 55 such as an encoder or tick-sensor. As discussed above, the measurements may then be received by RSS controller 103. In some embodiments, second sensor controller l02b may perform fewer operations than first sensor controller l02a. In some such embodiments, second sensor controller l02b may correct scale factor bias and misalignment, and may provide an average of the corrected samples to RSS controller 103. In some embodiments, RSS controller 103 may perform one or more of these operations.

In some embodiments, the in-situ determination of magnetic interference due to non-rotating sleeve 55, utilizes measurements of the corrupted magnetic field sensed by sensor set lOla as well as the relative orientation of non-rotating sleeve 55. Variations in the cross axis and along axis field that are synchronous with the rotation of non-rotating sleeve 55 can be identified using the method described in U.S. Patent Application No. 15/676,463, the entirety of which is hereby incorporated by reference. The synchronous variations in the magnitude of the cross axis magnetic field, the total magnetic field, as well as the individual components of the magnetic field, sensed by sensor set lOla, can be used to estimate the magnetic interference when the actual inclination and azimuth of sensor set lOla is varying. In some embodiments, estimations of the inclination and azimuth of sensor set lOla can be utilized to help separate out the variations that are due to the magnetic interference of non-rotating sleeve 55 from the variations that occur due to changes in orientation of sensor set lOla.

In some embodiments, a state estimator, such as a Kalman Filter, may be utilized for estimating the magnetic interference that is due to non-rotating sleeve 55. Using the methods described in U.S. Patent Application No. 15/676,463, rotating measurements from sensor set lOla may be processed to obtain estimates of the magnetic field components in a different frame of reference. The orientation of non-rotating sleeve 55 may also be calculated in this same frame of reference. In some embodiments, one of the axes, herein called the Z axis, of said frame of reference is aligned with the nominal rotational axis of sensor set lOla, which is typically the same, or nearly the same rotational axis of non-rotating sleeve 55 as well as the along direction of the proximate wellbore. In some embodiments, the magnetic field components sensed by sensor set lOla due to the magnetic interference of non-rotating sleeve 55 can thus be modelled as a function of the angle Q of non-rotating sleeve 55 about this Z axis. In some embodiments, the modelling function for the cross-axis magnetic interference may be sinusoidal:

B lNT = / * cos(0) + Q * sin(— Q) Where I and Q are the portion of the interference aligned with the X and Y axes respectively. The magnetic field components sensed by sensor set lOla are a combination of non-rotating sleeve 55 magnetic interference components, earth’s magnetic field components, and other magnetic interference components that are not of interest. The cross axis magnetic field components sensed by sensor set lOla can thus be modeled as:

5 / = / * cos(O) + B cross * cos(6 MTF ) + h }

B Q = Q * sin(-0) + Bcross * sin ( ~ 0 MTF ) + V Q

Where 77 / and ?7 Q are the magnetic interference components and noise that are not of interest, and 0 MTF is the magnetic toolface of the frame of reference, which is the negative rotation angle of the frame of reference about the Z axis that would cause the X axis to align with the cross-axis projection of earth’s magnetic field vector. In some embodiments, the state to be estimated by the state estimator may be: where l bias and Qtias are intended to track the combination of the earth’s magnetic field and the bias of the magnetometer sensors of sensor set 1 Ola that are present in the cross axis components. In some embodiments in which a Kalman Filter is used as the state estimator, the measurement model may be: Resulting in measurements of the true state: where is the true state and h is measurement noise. In some embodiments, upon obtaining a new measurement of Q , a Kalman state transition matrix is calculated so as to propagated forward the I and Q estimates:

Where the subscript k corresponds to the sample number. In some embodiments, the Kalman Filter correction, as well as growth of the error covariance matrix, may not be performed for each new measurement 0, but only when the new Q is sufficiently different from the value of Q that was used for the prior correction. Other criteria may also be used to determine when to perform the correction step and growth of the error covariance matrix, such as whether or not the new Q measurement is deemed an outlier based on estimations of rotation rate and uncertainty of rotation rate of non-rotating sleeve 55. In some embodiments, estimations of the change in inclination and azimuth may also be used to update the state estimates of I bias and Qtias- Such estimations of inclination and azimuth may be performed separately, as additional states in the same state estimator, or as calculations based on additional states in the same estimator, as would be obvious to those skilled in the art. The estimates of I and Q may then be used to subtract out the magnetic interference from the estimates of the cross axis components of the magnetic field sensed by sensor set lOla, and corrected estimations of Mtf can be made. In some embodiments, similar estimations and corrections can be made for the Z axis magnetic interference that varies as a function of Q. [0021] In some embodiments, RSS controller 103 may periodically calculate a difference (delta) between magnetic and gravity toolfaces (Mtf-HsTF), cross-axis acceleration (Across), Z-axis acceleration (Az), cross-axis magnetic field (Bcross), z-axis magnetic field (Bz), and inclination of drill string 20 at the locations of wellbore 5 at which first sensor set 10 la and second sensor set 10 lb are located based on the respective measurements of first sensor set lOla and second sensor set lOlb. In some embodiments, inclination may be calculated as the four-quadrant inverse tangent of Across and Az according to:

Inc = atan2(Across,— Az )

In some embodiments, the attitude may be determined at, for example and without limitation, once per second. Such an attitude determination may be undertaken according to the methods described by U.S. Patent Application No. 15/676463, the entirety of which is hereby incorporated by reference in its entirety.

[0022] In some embodiments, RSS controller 103 may calculate at predetermined intervals a sliding average and variance of MTF-HsTF, Across, Az, Bcross, Bz, and inclination for the measurements of first sensor set 10 la or for each of the measurements of first sensor set lOla and second sensor set lOlb. A sliding or windowed average calculation may be computed as the sum of samples divided by the number of samples taken over the specified time period. Likewise, a sliding or windowed variance may be computed by calculating the variance of the samples taken over the specified time period. These computations may be performed incrementally rather than re-calculated at each new sample or by use of infinite impulse response filters or other iterative techniques to reduce computational and or memory requirements on the processing system used to perform the calculations, i.e. RSS controller 103. In some embodiments, the sliding averages and variances may be calculated, for example and without limitation, across a time period between 1 second and 30 seconds. In some embodiments, the sliding averages and variances may be computed once per second.

[0023] In some embodiments, RSS controller 103 may calculate at predetermined intervals a mean of the calculated sliding averages and sum of squares of the calculated sliding averages of the measurements from first sensor set lOla and second sensor set lOlb. In some embodiments, the means and sums of squares may be calculated once a minute. In some embodiments, the means and sums of squares may be stored in data buffers for the measurements of first sensor set lOla and the measurements of second sensor set 10 lb in storage memory 107. For the purposes of this disclosure, the data associated with the means and sums of squares of first sensor set lOla defines corrupted sensor data and the data associated with the means and sums of squares of second sensor set 10 lb defines a reference sensor data. In some embodiments, depending on the amount of storage space available, RSS controller 103 may store sensor data buffers corresponding to thirty minutes of data.

[0024] In some embodiments, RSS controller 103 may depth align the corrupted sensor data and reference sensor data (203). Because first sensor set lOla and second sensor set 10 lb are separated by an along hole distance, the samples in time may be time shifted for the same depths as drill string 20 moves through wellbore 5. The data buffers are depth aligned such that measurements of the corrupted sensor data buffer and reference sensor data buffer are aligned with respect to the position within wellbore 5 represented by the data of the data buffers, such that the reference sensor data buffer is taken at the same depth and same attitude as the corresponding measurement of the corrupted sensor data buffer taken at the same depth and same attitude. [0025] In some embodiments, the corrupted sensor data buffer and reference sensor data buffer may be depth aligned by searching for matching measurements or patterns in the measurements taken by first sensor set lOla and second sensor set lOlb. In some embodiments, inclination may be used to depth align the data buffers. In some embodiments, measurements taken by other sensors of first sensor set lOla and second sensor set 10 lb including, for example and without limitation, gamma readings, sonic readings, or resistivity, may be used to depth align the data buffers. In some embodiments, one or more such measurements may be used in combination to depth align the data buffers.

[0026] In some embodiments, first sensor set lOla and second sensor set 10 lb may not be sampled simultaneously, at the same sample rate, or at the same sample intervals, and may be sampled, processed, and averaged by separate computing systems of RSS controller 103. In such an embodiment, RSS controller 103 may interpolate samples of first sensor set lOla and second sensor set 10 lb when depth aligning the data buffers. Such interpolation may be used whenever the depth alignment resolution between the samples of first sensor set lOla and second sensor set 10 lb is insufficient with the effective sample rate of the data being used for depth alignment.

[0027] In some embodiments, such as where there is insufficient change in the measurements of first sensor set lOla and second sensor set 10 lb to allow reliable pattern matching between the data buffers, a nominal time lag based on expected rate of penetration (ROP) may be used to depth align the measurements. Such an embodiment may be used, for example and without limitation, where wellbore 5 is straight or near straight and the attitude of first sensor set lOla and second sensor set 10 lb are substantially the same. [0028] In some embodiments, RSS controller 103 may identify and calculate any twist misalignment between the cross-axis magnetometer and accelerometer measurements of the corrupted sensor data using the reference sensor data (205). In some such embodiments, the twist misalignment may be calculated as the difference between the reference and corrupted sensor data Mtf-HsTF according to: deltaMtfHtfbiasEstimate

= deltaMtfHtfbiasEstimate * (1— WtAdaptDeltaMtfHtf)

+ WtAdaptDeltaMtfHtf F reference >)

RSS controller 103 may then calculate the adaptation weighting to be applied to deltaMtfHtfbiasEstimate. In some embodiments, an adaptive infinite impulse response (HR) filter may be used. In some embodiments, the adaptation weighting may be calculated based on one or more of the inclination of the reference sensor data, the inclination difference between the reference sensor data and the corrupted sensor data, the angle between the Z-axis of drill string 20 and the magnetic field vector of the Earth (Bangle), and the difference between Bz readings of the reference sensor data and corrupted sensor data. The adaptation weighting may, for example and without limitation, set the adaptation speed of downhole measurement correction and control operation 200. In some embodiments, the adaption weighting may be calculated according to:

WtAdaptDeltaMtfHtf

= max(0, min(l, AdaptScalar * wtRefinc * wtBangle * wtDeltalnc * wtDeltaBz)) Where incDiffNormF actor = 3.0 (reasonable values depend on the possible physical bend between the reference sensor set and the corrupted sensor set); bzDiffNormFactor = 1000.0 nanoTesla (reasonable values would be 100 nT up to 5000 nT); AdaptScalar = 1.0 (this is a configurable parameter, but 1.0 is a reasonable value, however any positive value could be used); wtReflnc = sin(reference sensor data inclination); wtBangle = sin(b Angle); wtDeltalnc = l-min(l, abs(reference sensor data inclination - corrupted sensor data inclination) + (standard deviation of corrupted sensor data inclination)) / incDiffNormFactor); and wtDeltaBz = l-min(l, abs(ref Bz - (corrected Bz from corrupted sensor data)) / bzDiffNormFactor.

[0029] In some embodiments, RSS controller 103 may update one or both of the estimated z axis magnetic scale factor and bias of first sensor set lOla (209). In some embodiments, both estimated z axis magnetic scale factor and bias of first sensor set lOla may be updated when drill string 20 has changed attitude, such as where the Bz of the reference sensor data and the Bz of the corrupted sensor data are sufficiently different from the mean of the respective Bz values used in the previous iteration to be considered a new orientation. An example of the criteria that may be used for determining whether or not the new sensor data is likely to correspond to a new orientation is as follows:

where minBzDelta is a configured threshold, 200 nT being a reasonable default value, Bz corrupted is mean of the corrupted Bz values used in the previous iteration, Bz re ^ erence is the mean of the reference Bz values used in the previous iteration, Bzcorrupted is the new measurement of Bz from the corrupted sensor set, and Bzreferenc is the new measurement of Bz from the reference sensor set. When both of the above equations are true, it may be concluded that the new measurements of Bz correspond to a sufficiently different orientation such that the new measurements will improve the estimates of z axis magnetic scale factor and bias. The variance of the Bz of both the reference sensor data and corrupted sensor data may also be taken into account in the determination of whether or not the drill string has changed attitude sufficiently. In some such embodiments, RSS controller 103 may use a least squares method, such as linear least squares, iteratively reweighted least squares, or any other type of regression analysis, to solve for z-axis magnetic scale factor and bias of first sensor set lOla. The independent variables in such embodiments are Bz of the corrupted sensor data and a constant. The dependent variable is the estimate of theoretical Bz, which is referred to as Bzreference. When linear least squares is utilized to solve for z-axis magnetic scale factor and bias of first sensor set lOla, the set of linear equations can be formulated as shown in the following equation:

where Bz r eference[k] is the k th estimate of the theoretical Bz, Bz C ormpted[k] is the k th mean value of Bz from the corrupted sensor set lOla, scaleez is the Bz scale factor being solved for, and biasBz is the bias being solved for. In some embodiments, Bzreference may be obtained from z axis measurements from the reference second sensor data set lOlb. In some embodiments, Bzreference may be obtained from the cross axis measurements of the corrupted sensor data (Bcrosseormpted), the estimate for cross-axis scale factor (Bcrossseaie), and a known, or estimated, total magnetic field strength (Btotal reference) according to: Bz reference ~

In some embodiments, Bzreference may be obtained from both of the embodiments described above or from any other method that may result in an estimate of Bz along with a measure of the uncertainty of Bz. In some embodiments, Btotabeference may be calculated from reference sensor set lOlb.

[0030] In some embodiments, the known or estimated differences in orientation between the depth aligned reading of Bzcormpted and Bzreference, may be used to calculate a correction to either Bzcormpted or Bzreference. In some embodiments, such a correction may also utilize knowledge and/or measurements/estimations of the local magnetic field (Btotal and Bdip), local gravitational field (Atotal), azimuth of sensor set lOla, azimuth of sensors set 10 lb, or any combination thereof. One possible purpose of this correction is to account for the differences in orientation between the readings from sensor set lOla and sensor set lOlb. The differences in orientation may be due, for example only and not limited to, inexact depth alignment and/or quantization of the readings to be aligned. In some embodiments, an assumption may be made that the difference in orientation is mainly an inclination difference, such as when drilling the curve of a wellbore. In such embodiments, the correction may be calculated according to:

Where Inccormpted is the inclination of sensor set lOla, Increference is the inclination of second sensor set lOlb, Azicormpted is the azimuth of sensor set lOla, Azheference is the azimuth of second sensor set 10 lb, and Bnorth and Bdown are calculated according to:

Where Biotai is the magnitude of earth’ s magnetic field, and BD IP is the angle of the earth’ s magnetic field with respect to horizontal. The calculated value for BzDiff at each iteration may then be either subtracted from Bzcormpted or added to Bzreference before being included in the set of linear equations.

[0031] In some embodiments, instead of augmenting the set of linear equations at each iteration, the covariance matrix of the independent variables and the cross-covariance between the independent variables and the dependent variables may be stored on RSS controller 103 for iterative updates to, for example and without limitation, save processor time and memory usage. In such an embodiment, the components stored can be used to solve for scale factor and bias according to the following, which is referred to as the normal equation:

Where the hat symbol indicates estimations of the corresponding variable.

[0032] In some embodiments, updates to the components of the covariance matrix and the cross- covariance vector may be weighted based on estimations of the current solutions uncertainty and estimations of the uncertainty of the new set of measurements. In some embodiments, the uncertainty of the new set of measurements may be calculated based on estimations of the uncertainty of the corrupted Bz measurement from first sensor set lOla, and estimations of the uncertainty of the new estimates of Bz. In some embodiments, in which the new estimate of Bz is from second sensor set 10 lb, the estimation of the uncertainty of the new set of measurements may also be based on differences in inclination between the corrupted first sensor set 101 a and the reference second sensor set 10 lb, differences in Bz between the corrupted first sensor set lOla and the reference second sensor set 10 lb, the variances of inclination from the corrupted first sensor set lOla , and the variances of inclination from the reference second sensor set lOlb. In some embodiments, the estimate of the uncertainty of the new set of measurements may be calculated according to:

Where WtlncCorrupted, WtlncReference, and WtDeltalnc are set to positive values in order to provide similar magnitudes for the inclination variances as the Bz variances, as well as provide the ability to adjust the relative weighting between the various uncertainties. Values for WtlncCorrupted, WtlncReference, and WtDeltalnc may be any positive number, with reasonable values being between 10 and 1000, and 100 being used in some embodiments.

[0033] In some embodiments, in which Bzreference is calculate based on knowledge of the local magnetic field and the corrupted Bz measurement from first sensor set lOla, the estimation of the uncertainty of the new set of measurements may be calculated according to:

The weighting to be applied to the new set of measurements may be calculated according to: s

inputWeighting = Estimate

w Estimate 1 w Input

The weighting may be used to update the components of the covariance matrix and the cross- covariance vector according to: BZcorrupted = BZcorrupted * (1 - inputWeighting ) + inputWeighting * Bz corrupted

Bz c z ovariance Bz c z ovariance (1— inputWeighting ) + inputWeighting * Bz corrupted

* BZ est-i-mate

Bz reference = Bz reference * C 1 - inputWeighting ) + inputeW eighting * Bz reference

Additionally, a quantification of the uncertainty, here denoted by s Estimate > °f the adapted covariance matrix and the cross-covariance vector, may be updated according to:

Estimate = 0 - inputWeighting ) 2 * o^ stimate + inputWeighting 2 * s 1 Input

[0034] In some embodiments, such as where drill string 20 is not changing attitude sufficiently from a prior iteration of the above calculations, Bz bias alone may be estimated. In some such embodiments, Bz bias may be estimated using an adaptive Kalman filter to track the difference between the Bz of the corrupted sensor data (corrected for scale factor only) and the Bz of the reference sensor data.

[0035] In some embodiments, the adaptive Kalman filter may be configured to estimate a single constant. The measurement covariance, R, and process covariance, Q, may be set based on, for example and without limitation, one minute estimates of variance for the reference sensor data Bz and the corrupted sensor data Bz. One or both of these parameters may, in some embodiments, be adjusted in-situ. In some embodiments, state estimate covariance may also be selected such that the adaptation rate is coordinated with the adaptation rate, inputWeighting. The variance of the current estimate for the scale factor and bias solution, s Estimate > ma Y be used to calculate an upper bound for the state covariance, P, of the adaptive Kalman filter according to:

P = min(P, o stimate * P factor) where Pfactor is a configurable variable, with 3 being a typical value, and reasonable values being in the range of 1 to 5.

[0036] In some embodiments, reasonable bounds of the angle between the orientation of sensor set lOla and sensor set 10 lb are either predetermined or calculated in-situ. The reasonable bounds for orientation differences between the two sensor sets may be utilized to calculate reasonable bounds for the expected difference between the reference sensor set 10 lb readings and the corrected readings from sensor set lOla. In some embodiments, the inclination and azimuth calculated from corrected sensor set lOla readings may be used in combination with the readings from second sensor set 10 lb to calculate maximum and minimum thresholds for the differences between the corrected readings of sensor set lOla and sensor set lOlb. In some such embodiments, the maximum and minimum thresholds may be calculated according to: Aziieft— Azi C orrected — maxAziBend ziright— Azi CO rrected— maxAziBend

Where Bnorth and Bdown are the horizontal and vertical components of local gravity, coneAngle is the maximum angle determined to be possible between sensor set lOla and 10 lb, and Azicorrected is the calculated azimuth from the corrected sensor readings from sensor set lOla. DeltaBzmin and DeltaBzmax can then be used to determine the maximum and minimum threshold values for

Bzreference according to:

MaxBz reference = Bz reference + DeltaB z max + B z mar gi n

MinBz re f erence — Bz re f erence DeltaB z min B z mar gi n

Where Bzmargin is a configuration parameter, with a value of 50nT being reasonable for some embodiments, and reasonable ranges being between lOnT and lOOOnT. Similar bounds may be calculated for other readings, such as Bcross and deltaMtfHtf. In some embodiments, the adaptation rates for the adapted parameters may be adjusted when one or more readings do not lie within their respective calculated bounds. In some embodiments, when this occurs, real-time notifications may be sent to the surface and/or to the closed loop controller indicating the identified condition. In some embodiments, any of the details or results of an in-situ compensation and control operation as described herein may be sent to the surface by any telemetry method known in the art. In some embodiments, one or more states or parameters of the in-situ compensation and control operation may be adjusted by commands sent from the surface by any telemetry method known in the art.

[0037] In some embodiments, RSS controller 103 may calculate the cross axis magnetic scale factor of the corrupted sensor data using the depth aligned reference sensor data and may adapt the estimated cross axis scale factor of the corrupted sensor data towards the estimated value (211). In some such embodiments, RSS controller 103 may use an HR filter of the depth aligned Bcross of the reference sensor data as the estimate. In some embodiments, the estimated cross axis scale factor of the corrupted sensor data may only be adapted if the corrupted Bcross is above a threshold, such as, for example and without limitation, a value between 50 and 5000nT.

[0038] In some embodiments, RSS controller 103 may use the updated estimates of z axis scale factor and bias and cross axis scale factor of the corrupted sensor data to correct the measurements from first sensor set lOla (213).

[0039] In some embodiments, RSS controller 103 may calculate an updated estimated azimuth based on at least one of the corrected measurements from first sensor set lOla (215). In some embodiments, the updated estimated azimuth may be calculated according to:

Azimuth

= atan

where deltaMtfHtf Corrected = MTF— HsTF + deltaMtf Fit f Bias

BzCorrected = Bz * BzScale + BzBias

BcrossCorrected = Bcross * BcrossScale

Other embodiments may calculate an updated estimated azimuth using other formulas that utilize at least 1 of the corrected measurements of deltaMtfHtfCorrected, BzCorrected, or BcrossCorrected.

[0040] Thus, inaccuracies in determining the attitude of RSS 45 at the location of first sensor set lOla caused by the effects of magnetic interference proximate to first sensor set lOla may be reduced, and a more accurate azimuth may be determined.

[0041] In some embodiments, RSS controller 103 may calculate a change in estimated azimuth due to an update to the corrections of Bz, Bcross and deltaMtfHtf, thus separating the change in estimated azimuth due to updates to corrections from the change in azimuth due to estimated physical attitude change. In some embodiments, RSS controller 103 uses both the updated estimated azimuth and the updated change in estimated azimuth due to updates to corrections to adjust control of RSS 45 as described below.

[0042] In some embodiments, RSS controller 103 may be used to control RSS 45, and may use the estimated azimuth or the estimated azimuth and the change in estimated azimuth due to updates to corrections to provide instructions to RSS 45 and thereby steer the propagation of wellbore 5 (217). In some such embodiments, a target plane control mode may be employed. Referring now to Fig. 5, in one embodiment of a target plane control mode, a control plane 501 may be defined by a starting attitude 503 and a target attitude 505 to drill towards and hold. In some embodiments, both the starting attitude 503 and target attitude 505 may be sent from the surface via a downlink message. In other embodiments, only the target attitude 505 may be sent from the surface via downlink and the starting attitude 503 determined by the estimated attitude of the tool at the time the target attitude downlink was received. Defining control plane 501 based on the downlinked target attitude 505 and estimated attitude at the time the downlink is received may reduce downlink transmission time and reduce wellbore tortuosity due to steering forces applied to correct for the attitude error between a downlink specified starting attitude and the estimated attitude at the time the downlink is received. In some embodiments, control plane 501 may be defined by its normal vector 507 which may be calculated according to: controlPlaneN ormal = startAttitude x targetAttitude where X denotes the vector cross product and startAttitude and targetAttitude are the starting attitude 503 and target attitude 505 vectors in North, East, Down earth coordinates and may be calculated according to:

[0043] Once a control plane is defined, RSS controller 103 may separate steering forces into two orthogonal components, a to-plane steering force 509 in the direction normal to control plane 501 and a to-target steering force 511 parallel to control plane 501 and in the direction of target attitude

505.

[0044] In some embodiments, RSS controller 103 may operate autonomously down-hole on the to-plane steering force 509 by employing a single axis attitude controller with the error input 513 being the angle between the estimated attitude 515 obtained from the estimated inclination and azimuth and control plane 501 and the output being the to-plane steering force 509 applied by RSS 45 normal to control plane 501. In such embodiments, the attitude control law applied may, for example and without limitation, be determined by a PID, PID with leaky integrator, PID with leaky integrator and integrator dead zone, parameter adaptive, non-parametric adaptive, model reference adaptive, or other control law known in the art. In some such embodiments, the to-plane controller error input 513 may be calculated according to: 90° where denotes the dot product, || || denotes the vector magnitude or L2 norm, and estimatedAttitude is the estimated attitude 515 vector which can be calculated from the updated estimated azimuth and inclination according to:

[0045] In some embodiments, RSS controller 103 may adjust the control plane in response to an update to corrections of Bz, Bcross and deltaMtfHtf. In some such embodiments, RSS controller 103 may mathematically rotate the control plane about the target attitude vector so that the error angle to the plane does not include any error due to the updated corrections, and thus avoid steering force corrections due to the correction updates which may undesirably introduce increased wellbore tortuosity. In some such embodiments, the control plane rotation angle about the target vector may be calculated according to: where err or AngleToPlane is the error angle to the control plane with updated estimated azimuth with the most recent corrections, err or AngleT oPlanePrior is the error angle to the control plane with the updated estimated azimuth calculated with the prior corrections and error AnglelnPlanePrior is the angle between the target attitude and the projection of the attitude vector obtained using the updated estimated azimuth calculated with the prior corrections onto the control plane, all of which may be calculated according to: error AnglelnPlanePrior

where estimatedAttitudePrior is the attitude vector calculated from the estimated Azimuth using the prior deltaMtflitfCorrected , BzCorrected and BemssCorrected. In such embodiments, the control plane may be rotated about rotationAngle according to the following calculations: controlPlaneN ormali = RM * controlPlaneN ormal i-1 where controlPlaneNormah is the rotated control plane used in the present iteration and controlPlaneNormali-i is the non-rotated control plane normal from the prior iteration and RM is the rotation matrix which may be calculated according to:

RM = cos(rotationAngle) * I + sin rotationAngle) * [targetAttitude] x

+ (1— cos(rotationAngle )) * tar get Attitude * tar get Attitude 7 where / is the identity matrix, [tar get Attitude] x denotes the cross product matrix of the target attitude vector and targetAttitude 7 denotes the transpose of the target attitude vector. The cross product matrix of the target attitude vector may be constructed according to:

where targetAttitude N , targetAttitude E , and tar get Attitude D correspond to the North, East and Down components of the target attitude vector described above. In some such embodiments, RSS controller 103 may calculate a 3D angle difference between the estimated attitude utilizing the corrections from the current update and prior update and rotate the control plane only when the 3D angle difference exceeds a particular value so that smaller corrections resulting in less wellbore tortuosity are immediately accounted for which may result in reduced 3D wellbore path error. In such embodiments, the 3D angle difference may be between O. ldeg and 0.5deg. In other embodiments, RSS controller 103 may adjust the control plane in response to an update to corrections of Bz, Bcross and deltaMtfHtf by applying the updated corrections to the uncorrected Bz, Bcross and deltaMtfHtf stored at the time the target attitude downlink was received, calculating an updated starting attitude from the corrected Bz, Bcross and deltaMtfHtf values, and calculating an updated control plane based on the updated starting attitude.

[0046] In a further aspect of an embodiment of a target plane control mode, to-target steering force 511 applied by RSS 45 in the direction parallel to the control plane in the direction of the target attitude control the turn rate towards the target attitude. In some embodiments, the to-target steering force 511 may be determined by an operator and sent manually via downlink from the surface to RSS controller 103. In other embodiments, turn rate per along hole depth within the target plane may be specified by the operator and used as the set point in a turn rate controller which regulates to-target steering force 511 to achieve a desired turn rate towards the target attitude. In some embodiments of a turn rate controller, the desired turn rate may be downlinked from surface to RSS controller 103 which may operate autonomously down-hole to adjust to-target steering force 511 applied by RSS 45 parallel to the control plane to achieve the desired turn rate towards the target attitude. In such an embodiment, RSS controller 103 may estimate the turn rate towards the target, for example and without limitation, by projecting the estimated attitudes from first sensor set lOla and second sensor set 10 lb onto the control plane and dividing the angle between the projections by the distance between first sensor set lOla and second sensor set lOlb. RSS controller 103 may then compare the estimated turn rate to the desired turn rate and adjust to- target steering force 511 applied by RSS 45 parallel to the control plane to achieve the desired turn rate. Since wellbore 5 will only change attitude as drilling progresses, RSS controller 103 may calculate an updated estimate of turn rate towards the target only after detecting that drilling has occurred for a minimum time period, where the minimum time period may be between 30sec and 3min. Methods for detecting drilling may include, for example and without limitation, comparing down-hole measured lateral vibration, axial vibration, weight on bit, torque on bit, angular acceleration or any combination thereof to pre-defmed thresholds. In some embodiments, the range of to-target steering force 511 autonomously adjusted by RSS controller 103 may be limited. In some embodiments the force may be limited to a pre-defmed range, for example and without limitation, +- 15% about a nominal force theoretically expected to achieve the desired turn rate. In embodiments incorporating autonomous down-hole turn rate control, communication of data between the surface and RSS controller 103 may be minimized, allowing, for example and without limitation, more rapid control corrections and more accurate placement of wellbore 5 by RSS 45. In other embodiments, the turn rate controller may be implemented in a surface computing system. In such embodiments, the surface computing system may estimate turn rate periodically by dividing the angle difference between the estimated wellbore attitude transmitted by downhole attitude correction and control system 100 through telemetry apparatus 111 obtained at two different depths by the difference in depths. The surface computing system may then compare the estimated turn rate to the desired turn rate and calculate an adjustment to to-target steering force 511 to achieve the desired turn rate which may be transmitted via downlink to RSS controller 103. In such an embodiment, the downlink may be triggered automatically or the operator may be prompted to perform the downlink manually. In other embodiments, surface estimated turn rate may periodically be downlinked and RSS controller 103 may merge downhole and surface determined estimates of turn rate via a Kalman filter or other similar optimal or adaptive estimation method to obtain the estimate of turn rate used by the turn rate controller. In some embodiments, a model of the expected turn rate as a function of steer force may be used by the turn rate controller, whether located up-hole or downhole, to improve the accuracy of the adjustment of the steer force to achieve the desired turn rate. In some such embodiments, the model may be non-parametric and may be adapted based on past measurement of turn rate per steer force. In other such embodiments, the model may be parametric and may be dependent, for example and without limitation, on parameters such as weight on bit, RSS 45 attitude, bit condition, the turn rate of wellbore 5 directly above RSS 45. In other embodiments of a turn rate controller, the surface system may periodically downlink the along-hole depth of drill bit 30 measured at the surface by use of a draw-works encoder or other depth measurement device to RSS controller 103 which may then calculate the turn rate as the difference in angle between the estimated wellbore attitudes divided by the difference in depths.

[0047] When RSS 45 nears the target attitude, RSS controller 103 may automatically exit the target plane control mode described above and enter a target hold mode. Determining when RSS 45 is near the target attitude may be accomplished by projecting the tool attitude vector onto the control plane and determining if the error angle between the projection and the target attitude is below a threshold where the threshold may be, for example and without limitation, a value between 0.1 deg and 10 deg. Now referring to Fig. 6, in one exemplary embodiment of a target hold mode, RSS controller 103 may project the target attitude vector 505 onto the cross-borehole plane 601 of RSS 45 periodically. The period may be lsec but could reasonably be between O. lsec and lOsec depending on processing capability available and expected ROP. At each periodic update of the target hold mode, the estimated attitude vector with respect to earth North, East and Down coordinates may be determined from the estimated inclination and azimuth as [sin(Inclination)*cos(Azimuth); sin(Inclinati on)* sin( Azimuth); cos(Inclination)]. The target attitude vector in NED earth coordinates, which may be determined in like fashion, may then be vector projected (603) onto the cross-borehole plane 601 to determine a desired steering direction. In one embodiment, the cross-borehole plane 601 may be separated into to orthogonal components and separate controllers employing a PID or other similar control law may operate on their respective components of the projected target vector to determine the orthogonal components of a correcting steering force applied by RSS 45 required to maintain the target attitude.

[0048] For both the target plane control mode and target hold control modes described above, RSS controller 103 may define the cross-borehole plane Y axis 605 and cross-borehole plane X axis 607 with respect to any of the earth's fixed fields in order to reference the steering direction to the desired field. For example, when defining a steering direction with respect to the earth's gravity field, the Y axis may be defined to be in-line with the projection of the earth's gravity field onto the cross-borehole plane of the system and the X axis mutually orthogonal to the Y and Z axis where the Z axis is defined down the along-borehole axis. When defining a steering direction with respect to the earth's magnetic field, the Y axis may be defined to be in-line with the projection of the earth's magnetic field onto the cross-borehole plane of the system and the X axis mutually orthogonal to the Y and Z axis where the Z axis is defined down the along-borehole axis. When defining a steering direction with respect to the earth's rotation vector (true north), the Y axis may be defined to be in-line with the projection of the earth's rotation vector onto the cross-borehole plane of the system and the X axis mutually orthogonal to the Y and Z axis where the Z axis is defined down the along-borehole axis. In some embodiments a target steering direction may be determined by a weighted sum of the gravity and magnetic referenced directions where the weights are determined by a function of inclination or a function of the measured cross-borehole gravity and/or magnetic field magnitudes. In other embodiments, weights may be determined as a function of estimates of uncertainty of the gravity, magnetic or gyro measurements used to determine the direction.

[0049] In some embodiments, a target steering direction and force may, alternatively, be sent from the surface to the downhole system and used by RSS controller 103 to set the force applied by RSS 45 to propagate the path of wellbore 5 in the desired direction. In some such embodiments, the steering direction and force may be determined manually by an operator by using the estimated tool attitude as described above and along hole measured depth to determine an error of the wellbore 5 from the desired wellbore path. In other embodiments, the steering direction and force may be determined automatically by a surface computing system by using the estimated tool attitude and along hole measured depth to determine an error of the wellbore 5 from the desired wellbore path. In such embodiments, the determined steering direction and force may automatically trigger a downlink or, alternatively, be recommended to the operator. In other embodiments, the steering force applied in only the horizontal axis of the down-hole controller may be sent from the surface to the downhole system and may be determined and sent in a manner similar to the target steering direction and force.

[0050] In some embodiments, RSS controller 103 may incorporate one or more automated course correction sequences which may further reduce the number and frequency of downlinks required to correct wellbore 5 to the desired well path. In some such embodiments where RSS controller 103 is operating according to target hold control mode described above at the start of the course correction operation, RSS controller 103 may execute an automated course correction sequence in response to a course correction downlink sent from the surface system. In such embodiments, when a course correction downlink is received, RSS controller 103 may store the original target attitude in memory and enter target plane control mode with a temporary target attitude and direct RSS 45 to apply a correcting steer force parallel to the control plane and force normal to the plane as previously described until the temporary target attitude is reached. Once the temporary target attitude is reached, RSS controller 103 may then automatically set the target attitude back to the original target attitude and continue drilling towards the target attitude using target plane control mode as previously described using the correcting steer force. In some embodiments, the course correction downlink may specify the temporary target attitude directly. In other embodiments, the course correction downlink may specify a steering direction and angle relative to the current estimate of tool attitude from which the temporary target attitude is calculated by RSS controller 103 which may reduce the number of possibilities and therefore transmission time compared to specifying the temporary target attitude directly. In some embodiments, the course correcting downlink may specify the correcting steer force directly. In other embodiments, the course correcting downlink may specify a DLS which RSS controller 103 uses to determine the correcting steer force parallel to the plane in an automated manner using any of the previously described methods.

[0051] In another automated course correction sequence embodiment, where RSS controller 103 is operating according to target plane control mode at the start of the course correction operation, RSS controller 103 may apply a course correcting adjustment to the control plane by rotating the control plane about the vector lying in the original control plane and perpendicular to the target attitude vector by a specified angle. In such an embodiment, a downlink from surface may be sent specifying the rotation angle and correction force to be applied normal to the rotated control plane. RSS controller 103 may then proceed in target plane control correction mode, directing RSS 45 to apply the previously indicated force parallel to the plane and the newly specified correction force normal to the plane until the tool attitude is determined to be substantially one the plane. Once RSS controller 103 determines that the tool attitude is substantially on the rotated control plane, the original control plane is restored and RSS controller 103 continues in target plane control correction mode, directing RSS 45 to apply the previously indicated force parallel to the restored original control plane and the correction force normal to the restored original control plane until the tool attitude is substantially on the original control plane. Once RSS controller 103 determines that the tool attitude is substantially on the original control plane, RSS controller 103 exits target plane control correction mode and re-enters target plane control mode with the original parameters.

[0052] For the automated course correcting sequence methods described above, in some embodiments the parameters of the course correcting downlink are determined by an operator and the downlink is sent manually. In other embodiments, the parameters of the course correcting downlink are determined automatically by a surface computing system to achieve the desired displacement of the wellbore to substantially align the wellbore with the desired well path. In such embodiments, the determined parameters may be recommended to the operator or sent via an automatically triggered downlink. In other embodiments, along-hole depth may be periodically downlinked to RSS controller 103 which may then determine the parameters of the course correcting sequence down-hole.

[0053] The foregoing outlines features of several embodiments so that a person of ordinary skill in the art may better understand the aspects of the present disclosure. Such features may be replaced by any one of numerous equivalent alternatives, only some of which are disclosed herein. One of ordinary skill in the art should appreciate that they may readily use the present disclosure as a basis for designing or modifying other processes and structures for carrying out the same purposes and/or achieving the same advantages of the embodiments introduced herein. One of ordinary skill in the art should also realize that such equivalent constructions do not depart from the scope of the present disclosure and that they may make various changes, substitutions, and alterations herein without departing from the spirit and scope of the present disclosure.