Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
SYSTEMS AND METHODS FOR WELL POSITIONING USING A TRANSVERSE ROTATING MAGNETIC SOURCE
Document Type and Number:
WIPO Patent Application WO/2010/059263
Kind Code:
A1
Abstract:
Systems and methods for well-drilling operations involving magnetic ranging with a rotating magnetic dipole are provided. In one embodiment, a system for determining a relative location of a magnetic dipole includes a three-axis magnetometer configured to obtain measurements of a time-dependent magnetic field caused by the magnetic source rotating about an axis and data processing circuitry configured to determine a transverse angle of rotation of the measurements such that one of two transverse components is in phase with one axial component when the transverse angle of rotation is used to transform the measurements. The data processing circuitry may determine a spatial relationship between the magnetic source and the three-axis magnetometer based at least in part on the transverse angle of rotation.

Inventors:
CLARK BRIAN (US)
Application Number:
PCT/US2009/039775
Publication Date:
May 27, 2010
Filing Date:
April 07, 2009
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SCHLUMBERGER CA LTD (CA)
SCHLUMBERGER TECHNOLOGY BV (NL)
PRAD RES & DEV LTD
SCHLUMBERGER SERVICES PETROL (FR)
SCHLUMBERGER HOLDINGS
CLARK BRIAN (US)
International Classes:
G01V3/26; E21B47/022; G01B7/14; G01D5/24
Domestic Patent References:
WO2003040762A12003-05-15
Foreign References:
US20010041963A12001-11-15
US7209093B22007-04-24
Attorney, Agent or Firm:
FONSECA, Darla, P. et al. (Office Of Ip Counsel200 Gillingham Lane Md 200-, Sugar Land TX, US)
Download PDF:
Claims:
CLAIMS

What is claimed is:

1. A system comprising: a three-axis magnetometer configured to determine a set of measurements over a period of time of a time-dependent magnetic field caused by a magnetic source rotating about an axis, wherein the set of measurements includes one axial component aligned with the axis and two transverse components transverse to the axis, wherein the two transverse components are perpendicular to one another; and data processing circuitry configured to determine a transverse angle of rotation of the set of measurements, such that one of the two transverse components is in phase with the one axial component when the transverse angle of rotation is used to transform the set of measurements, and to determine a spatial relationship between the magnetic source and the three-axis magnetometer based at least in part on the transverse angle of rotation.

2. The system of claim 1, wherein the data processing circuitry is configured to determine sinusoidal functions that fit to the one axial component and the two transverse components.

3. The system of claim 1, wherein the data processing circuitry is configured to determine amplitudes of the one axial component and of the two transverse components in the reference frame rotated transversely by the rotation angle and wherein the data processing circuitry is configured to determine the spatial relationship based at least in part on the determined amplitudes.

4. The system of claim 1, comprising a borehole assembly having the magnetic dipole source, wherein the axis is aligned with an axis of the borehole assembly.

5. The system of claim 4, wherein the magnetic source is a permanent magnet, a solenoid, or any combination thereof.

6. The system of claim 4, wherein the borehole assembly is configured to cause the magnetic dipole to rotate about the axis at a constant frequency.

7. The system of claim 4, wherein the borehole assembly is configured to cause the magnetic dipole to rotate about the axis at an increasing frequency or at a decreasing frequency.

8. The system of claim 4, wherein the borehole assembly is configured to cause the magnetic dipole to rotate about the axis at an arbitrary frequency.

9. The system of claim 4, wherein the borehole assembly is configured to cause the magnetic dipole source to rotate while drilling a well.

10. The system of claim 4, comprising control circuitry configured to provide a drilling trajectory to the borehole assembly based at least in part on the spatial relationship between the magnetic dipole source and the three- axis magnetometer.

11. The system of claim 10, wherein the drilling trajectory is configured to cause the borehole assembly to drill the well at an approximately constant distance from the magnetometer.

12. A system comprising:

a memory device having a plurality of routines stored therein;

a processor configured to execute the plurality of routines stored in the memory device, the plurality of routines comprising:

a routine configured to effect, when executed, receiving of a three- component measurement by a three-axis magnetometer of a time-dependent magnetic field caused by a magnetic source rotating about an axis, wherein the three-component measurement includes an axial component aligned with the axis and two transverse components transverse to the axis, and wherein the two transverse components are perpendicular to one another;

a routine configured to effect, when executed, transformation of the three-component measurement by a transverse angle of rotation such that one of the two transverse components is π/2 radians out of phase with the axial component;

a routine configured to effect, when executed, determination of a relative location between the magnetometer and the magnetic source based at least in part on the transverse angle of rotation; and

a routine configured to effect, when executed, outputting of a report indicating the relative location.

13. The system of claim 12, wherein the plurality of routines comprises a routine configured to effect, when executed, fitting of the three-component measurement to sinusoidal curves.

14. The system of claim 12, wherein two transverse components include a vertical component and a horizontal component and wherein the one of the two transverse components transformed to be π/2 radians out of phase with the axial component is the horizontal component.

15. The system of claim 12, wherein the plurality of routines comprises a routine configured to effect, when executed, determination of amplitudes of the transformed three-component measurement.

16. The system of claim 15, wherein the routine configured to effect determination of the relative location is configured to effect determination of the relative location based at least in part on the determined amplitudes of the transformed three- component measurement.

17. The system of claim 16, wherein the routine configured to effect determination of the relative location is configured to effect determination of the relative location based at least in part on a determination of a distance between the magnetometer and the magnetic source, wherein the distance between the magnetometer and the magnetic source is determined based at least in part on one of the determined amplitudes of the transformed three-component measurement.

18. The system of claim 17, wherein the routine configured to effect determination of the relative location is configured to effect determination of the relative location based at least in part on a determination of an axial distance aligned with the axis, wherein the axial distance is determined based at least in part on the determined distance between the magnetometer and the magnetic source and on two of the determined amplitudes of the transformed three-component measurement.

19. The system of claim 18, wherein the routine configured to effect determination of the relative location is configured to effect determination of the relative location based at least in part on a determination of a vertical distance transverse to the axis, wherein the vertical distance is determined based at least in part on the determined distance between the magnetometer and the magnetic source, two of the determined amplitudes of the transformed three-component measurement, the determined axial distance, and the transverse angle of rotation.

20. The system of claim 19, wherein the routine configured to effect determination of the relative location is configured to effect determination of the relative location based at least in part on a determination of a horizontal distance transverse to the axis, wherein the horizontal distance is determined based at least in part on the determined vertical distance and the transverse angle of rotation.

21. A method comprising: generating a time-dependent magnetic field using a magnetic source rotating about an axis, wherein the magnetic source is located in a first well; measuring the time-dependent magnetic field using a three-axis magnetometer located in a second well, wherein the measurements are capable of indicating one axial component aligned with the axis and two transverse components transverse to the axis, wherein the two transverse components are perpendicular to one another; determining a transverse angle of rotation that, when used in a transformation of the measurements of the time-dependent magnetic field, causes extrema of one of the transverse components to occur when extrema of the axial component occur; and determining a relative location between the magnetic source and the magnetometer based at least in part on the transverse angle of rotation.

22. The method of claim 21 , wherein the transverse angle of rotation is determined such that, when used in the transformation of the measurements of the time-dependent magnetic field, the one of the transverse components aligns with the axial component when the one of the transverse components is multiplied by a scalar quantity.

23. The method of claim 21, wherein the relative location is determined based at least in part on a determination of maximum amplitudes of one axial component and two transverse components of the transformed measurements of the time-dependent magnetic field.

24. The method of claim 23, wherein the maximum amplitudes are determined based on curves fit to maxima of the one axial component and the two transverse components of the transformed measurements of the time-dependent magnetic field.

25. A method comprising: drilling a new well using a borehole assembly having a magnetic source source, wherein the magnetic source is configured to rotate about the axis of the borehole assembly, wherein the magnetic source is configured to generate a time- dependent magnetic field; measuring a time-dependent magnetic field using a three-axis magnetometer located in an existing well, wherein the measurement of the time-dependent magnetic field includes one axial component aligned with the axis of the borehole assembly and two transverse components transverse to the axis of the borehole assembly, wherein the two transverse components are perpendicular to one another; determining a relative location of the magnetometer to the magnetic dipole source based at least in part on a transverse angle of rotation that, when used in a transformation of the measurements of the time-dependent magnetic field, causes extrema of one of the transverse components to occur when extrema of the axial component occur; and communicating a drilling trajectory to the borehole assembly based at least in part on the relative location of the magnetometer to the magnetic source.

26. The method of claim 25, wherein measuring the time-dependent magnetic field comprises measuring the time-dependent magnetic field from a single location of the magnetometer.

27. The method of claim 25, wherein determining the relative location of the magnetometer to the magnetic source comprises determining maximum amplitudes of the one axial component and two transverse components of the transformed measurements of the time-dependent magnetic field.

28. The method of claim 25, wherein the magnetic source is a magnetic dipole source.

29. The method of claim 25, wherein the drilling trajectory is configured to cause the borehole assembly to drill the new well approximately parallel to the existing well at an approximately constant distance from the existing well.

30. A well drilled using the method of claim 25.

Description:
SYSTEMS AND METHODS FOR WELL POSITIONING USING A TRANSVERSE ROTATING MAGNETIC SOURCE

BACKGROUND

[0001] The present disclosure relates generally to well drilling operations and, more particularly, to well drilling operations involving magnetic ranging using a rotating magnetic source.

[0002] To access certain hydrocarbons in the earth, two or more wells or boreholes may be drilled with a certain spatial relationship with respect to one another; specifically, one borehole may be drilled such that it has a specific location relative to a previously drilled borehole. For example, heavy oil may be too viscous in its natural state to be produced from a conventional well, and, thus, an arrangement of cooperative wells and well features may be utilized to produce such oil. Indeed, to produce heavy oil, a variety of techniques may be employed, including, for example, Steam Assisted Gravity Drainage (SAGD), Cross Well Steam Assisted Gravity Drainage (X-SAGD), or Toe to Heel Air Injection (THAI). All such techniques may benefit by determining a borehole assembly (BHA) location relative to an existing well.

[0003] SAGD may generally involve two parallel wells separated by an approximately constant vertical separation distance (e.g., 4 to 6m) and an approximately constant transverse horizontal separation distance (e.g., within Im) over a horizontal distance of roughly 500m to 1500m. The upper well in a SAGD well pair may be known as an "injector well." The injector well may inject superheated steam into a heavy oil zone formation, creating a steam chamber to heat the heavy oil contained therewithin. The lower well in a SAGD well pair may be known as a "producer well." When the heated heavy oil becomes less viscous, gravity may pull the oil into the producer well below, from which the oil may be extracted.

[0004] Conventional measurement while drilling (MWD) survey data may not provide sufficient accuracy to maintain a consistent separation distance between the injector well and the producer well. Indeed, the direction of a horizontal well may be measured and controlled to approximately +/- 3°, and the inclination may be measured and controlled to approximately +/- 1°, using conventional MWD sensors and good directional steering practices. However, such relatively small angles may produce large errors in the position of a long horizontal well. For example, a horizontal well with a 1000 meter length having a 3° drift may have a 52 meter lateral error at the toe of the well. If the same horizontal well has a 1° drift in inclination, the well may also have a 17 meter vertical error.

[0005] To drill one well, such as an injector well, with a certain spatial relationship with respect to an existing well, such as a producer well, conventional magnetic ranging techniques may be employed. However, determining a position of a BHA in the injector well relative to a magnetometer in the producer well may involve many time-consuming measurements using conventional magnetic ranging. For example, measurements may be taken at several distinct locations within one or the other well, and the magnetometer may be moved forward or backward a specified distance before taking each measurement. Additionally, such conventional techniques may necessitate that the two wells be essentially parallel, and may not provide a relative location until the BHA has drilled a distance at least equal to the inter-well separation distance.

SUMMARY

[0006] Certain aspects commensurate in scope with the originally claimed embodiments are set forth below. It should be understood that these aspects are presented merely to provide the reader with a brief summary of certain forms the disclosed embodiments might take and that these aspects are not intended to limit the scope of the invention. Indeed, the invention may encompass a variety of aspects that may not be set forth below.

[0007] The present disclosure relates to systems and methods for drilling a well involving magnetic ranging using a rotating magnetic source. In one embodiment, a system for determining a relative location of a magnetic dipole includes a three-axis magnetometer configured to obtain measurements of a time-dependent magnetic field caused by the magnetic source rotating about an axis and data processing circuitry configured to determine a transverse angle of rotation of the measurements such that one of two transverse components is in phase with one axial component when the transverse angle of rotation is used to transform the measurements. The data processing circuitry may determine a spatial relationship between the magnetic source and the three-axis magnetometer based at least in part on the transverse angle of rotation. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Advantages of the invention may become apparent upon reading the following detailed description and upon reference to the drawings in which:

[0009] FIG. 1 is a schematic of a well-drilling operation involving magnetic ranging in accordance with an embodiment;

[0010] FIG. 2 is a schematic illustrating geometry associated with a rotating magnetic dipole in accordance with an embodiment;

[0011] FIG. 3 is a schematic further illustrating the geometry described by FIG. 2;

[0012] FIG. 4 is a schematic illustrating a spatial relationship between two vectors to an observation point in accordance with an embodiment;

[0013] FIG. 5 is a schematic illustrating geometry associated with a transverse vector to the observation point of FIG. 4;

[0014] FIGS. 6A-C illustrate components of a magnetic field resulting from a magnetic dipole rotating about the z axis in the x - y plane, at the instant it is pointing in the +x direction, in accordance with an embodiment; [0015] FIGS. 7A-C illustrate components of a magnetic field resulting from a magnetic dipole rotating about the z -axis in the x - y plane, at the instant it is pointing in the +y direction, in accordance with an embodiment;

[0016] FIG. 8 is a schematic illustrating geometry associated with a transverse vector to an observation point where a magnetic field associated with a rotating magnetic dipole is measured, in accordance with an embodiment;

[0017] FIG. 9 is a schematic illustrating geometry associated with a rotated frame of reference for magnetic field measurements taken from an observation point, in accordance with an embodiment;

[0018] FIG. 10 is a flowchart describing a method of determining a relative location between a rotating magnetic dipole and a magnetometer, in accordance with an embodiment;

[0019] FIG. 11 is a plot simulating three-axis measurements of a magnetic dipole rotating at a constant frequency, in accordance with an embodiment;

[0020] FIG. 12 is a plot in which the simulated measurements of FIG. 11 have been transformed into an a rotated frame of reference, in accordance with an embodiment; [0021] FIG. 13 is a flowchart describing a method of determining a relative location between a rotating magnetic dipole and a magnetometer by transforming magnetic field measurements into a rotated reference frame, in accordance with an embodiment;

[0022] FIG. 14 is a plot simulating noisy three-axis measurements of a magnetic dipole rotating at a constant frequency, in accordance with an embodiment;

[0023] FIG. 15 is a plot of sinusoids fitting least squares fit sinusoids to the noisy three-axis measurements of FIG. 14, in accordance with an embodiment;

[0024] FIG. 16 is a plot in which the least squares sinusoids of FIG. 15 have been transformed into a rotated frame of reference, in accordance with an embodiment;

[0025] FIG. 17 is another plot simulating noisy three-axis measurements of a magnetic dipole rotating at a constant frequency, in accordance with an embodiment;

[0026] FIG. 18 is a plot of sinusoids least squares fit to the noisy three-axis measurements of FIG. 17, in accordance with an embodiment;

[0027] FIG. 19 is a flowchart describing a method of determining a relative location between a magnetometer and a magnetic dipole rotating at a constant frequency by transforming magnetic field measurements into a rotated reference frame, in accordance with an embodiment; [0028] FIGS. 20 A-C are plots illustrating distance errors using the technique of FIG. 19 in the x , y, and z directions, respectively;

[0029] FIG. 21 is a flowchart describing a method of determining a relative location between a magnetometer and a magnetic dipole rotating at an increasing or decreasing frequency by transforming magnetic field measurements into a rotated reference frame, in accordance with an embodiment;

[0030] FIG. 22 is a plot of sinusoids least squares fit to noisy three-axis measurements of a magnetic field caused by a magnetic dipole rotating at an increasing frequency, in accordance with an embodiment;

[0031] FIGS. 23 A-C are plots illustrating distance errors using the technique of FIG. 21 in the x , y, and z directions, respectively;

[0032] FIG. 24 is a plot describing variations in frequency and frequency range associated with simulated measurements taken at various points along in the z - direction using the technique of FIG. 21, in accordance with an embodiment;

[0033] FIG. 25 is a plot simulating noisy three-axis measurements of a magnetic dipole rotating at an arbitrary frequency, in accordance with an embodiment;

[0034] FIG. 26 is a plot in which the simulated measurements of FIG. 25 are rotated and scaled such that the phase of a transverse magnetic field component has the same phase as the is aligned with an axial magnetic field component, in accordance with an embodiment;

[0035] FIG. 27 is a plot in which the simulated measurements of FIG. 25 are transformed based on the rotation of FIG. 26, in accordance with an embodiment;

[0036] FIG. 28 is a plot in which extrema of the transformed measurements of FIG. 27 are fitted to determine a maximum amplitude of each component of the measurements, in accordance with an embodiment; and

[0037] FIG. 29 is a flowchart describing a method of determining a relative location between a magnetometer and a magnetic dipole rotating at an arbitrary frequency by transforming magnetic field measurements into a rotated reference frame, in accordance with an embodiment.

DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS

[0038] One or more specific embodiments of the present invention are described below. In an effort to provide a concise description of these embodiments, not all features of an actual implementation are described in the specification. It should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system- related and business-related constraints, which may vary from one implementation to another. Moreover, it should be appreciated that such a development effort might be complex and time consuming, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure.

[0039] Additionally, as used herein, the terms "up" and "down," "upper" and "lower," and other like terms indicating relative positions to a given point or element are utilized to more clearly describe some elements of the embodiments of the invention. Commonly, these terms relate to a reference point at the surface from which drilling operations are initiated as being the top point and the total depth of the well being the lowest point, whether or not the drilled well continues in a true downward direction.

[0040] FIG. 1 illustrates a well drilling system 10 for drilling a new well such that the new well has a particular spatial relationship with a prior-drilled well. Particularly, FIG. 1 presents an example involving parallel Steam Assisted Gravity Drainage (SAGD) wells; however, the well drilling system 10 may be used to drill any new well such that the new well has a particular spatial relationship with respect to an existing, prior-drilled well. As illustrated in FIG. 1, a SAGD well pair may be formed when an injector well 12 is drilled approximately constant vertical separation distance (e.g., 4 to 6m) and an approximately constant transverse horizontal separation distance (e.g., within Im) over a horizontal distance of roughly 500m to 1500m above a prior- drilled producer well 14 in a heavy oil zone formation 16. However, the well drilling operation 10 and the techniques disclosed herein may be employed to drill a new well having any desired spatial relationship to any existing well. For example, the well drilling operation 10 and the techniques disclosed herein may be employed to drill Cross Well Steam Assisted Gravity Drainage (X-SAGD) wells, Toe to Heel Air Injection (THAI) wells, and/or to avoid collisions with existing wells while drilling in a field having existing wells.

[0041] To drill the injector well 12, a borehole assembly (BHA) 18 may include, among other things, a drill bit 20, a steerable system 22 to set the direction of the drill bit 20, and/or one or more measurement while drilling (MWD) or logging while drilling (LWD) tools 24. Drill pipe 26 may provide drilling mud and/or communication to the BHA 18 from the surface. The steerable system 22 may be a rotary steerable system, such as PowerDrive, which may receive downlinked commands and drill ahead in a specified trajectory of direction and inclination. Alternatively, the steerable system 22 may be a mud motor with a bent sub; however, such an arrangement may be less efficient, as it may rely on manual orientations of the bent sub by a driller at the surface to control the direction and inclination of the drill bit 20.

[0042] The BHA 18 may further include a magnetic dipole 28 coupled such that the north-south axis of the magnetic dipole 28 is essentially perpendicular to the axis of the BHA 18. As the BHA 18 rotates, the magnetic dipole 28 may rotate accordingly, which may produce a time-dependent magnetic field, illustrated in FIG. 1 as a magnetic field B . The magnetic dipole 28 may produce the time-dependent magnetic field B using a permanent magnet or one or more solenoids. If the magnetic dipole 28 is formed by one or more solenoids, the electric currents driving the solenoids may be direct current (DC), and the BHA 18 may rotate to produce the time-dependent magnetic field B . Alternatively, the currents driving the solenoids may be alternating current (AC), and the BHA 18 may remain still to produce the time-dependent magnetic field B . The direction and inclination of the first well may be known, as determined using inclinometer and/or data from the MWD tool 24. Because the north-south axis of the magnetic dipole 28 is essentially perpendicular to the axis of the BHA 18, a coordinate system (x,χ, z) may be centered on the magnetic dipole

28, where the z -axis is aligned with the borehole axis, the x -axis points upwards, and the y -axis is horizontal.

[0043] A three-axis magnetometer 30 capable of measuring low-frequency AC magnetic fields may be deployed to measure the magnetic field B on a wireline tractor 32 inside the producer well 14, which may or may not be cased with magnetic or non-magnetic casing 34. The tractor 32 may also carry a three-axis inclinometer 36, which may enable determination of the gravity tool face (i.e., up, or the high side of the hole). The tractor 32 may move the magnetometer 30 along inside the producer well 14. However, rather than move the magnetometer 30 to take measurements at multiple points along the length of the producer well 14, the tractor 32 may move the magnetometer 30 only occasionally. For reasons discussed below, measurements of the magnetic field B over time, observed from a single location in the producer well 14, may provide sufficient information to determine a relative location between the magnetometer 30 in the producer well 14 and the magnetic dipole 28 in the BHA 18.

As such, the three-axis magnetometer 30 may take readings of the magnetic field B over a predetermined time (e.g., approximately 1-2 seconds or one or more periods of rotation of the magnetic dipole 28), from which the relative location may be determined in accordance with techniques disclosed herein. The BHA 18 may typically rotate at approximately 60 to 180 RPM, while the rate of penetration through the formation 16 may be significantly slower, at approximately 50 to 200 feet per hour. As such, obtaining measurements of the magnetic field B from a single configuration may substantially increase the efficiency of magnetic ranging.

[0044] Measurements of the magnetic field B may be transmitted from the magnetometer 30 over a cable 38 to the surface 40 for processing. As such, the measurements may be received by data acquisition circuitry 42. The data acquisition circuitry 42 may represent a stand-alone, special-purpose data acquisition module associated with the magnetometer 30, or may represent an input device for a general processor-based system that may be employed for processing the measurements in accordance with the present techniques. A database 44 and data processing circuitry 46 may also represent components of a general processor-based system. Such a processor-based system may be a general-purpose computer, such as a personal computer, configured to run a variety of software, including software implementing all or part of the present technique. Alternatively, the processor-based system may include, among other things, a mainframe computer, a distributed computing system, or an application-specific computer or workstation configured to implement all or part of the present technique based on specialized software and/or hardware provided as part of the system. Further, the processor-based system may include either a single processor or a plurality of processors to facilitate implementation of the presently disclosed functionality. [0045] In general, the processor-based system that may encompass all or part of the data acquisition circuitry 42, database 44, and/or data processing circuitry 46 may include a microcontroller or microprocessor, such as a central processing unit (CPU), which may execute various routines and processing functions. For example, the microprocessor may execute various operating system instructions as well as software routines configured to effect certain processes and stored in or provided by a manufacture including a computer readable-medium, such as a memory device (e.g., a random access memory (RAM) of a personal computer) or one or more mass storage devices (e.g., an internal or external hard drive, a solid-state storage device, CD- ROM, DVD, or other storage device). In addition, the microprocessor may process data provided as inputs for various routines or software programs, such as data provided as part of the present techniques in computer-based implementations.

[0046] Such data associated with the present techniques may be stored in, or provided by, the memory or mass storage device of the processor-based system that may encompass all or part of the data acquisition circuitry 42, database 44, and/or data processing circuitry 46. Alternatively, such data may be provided to the microprocessor of the processor-based system via one or more input devices. In one embodiment, the data acquisition circuitry 42 may represent one such input device; however, the input devices may also include manual input devices, such as a keyboard, a mouse, or the like. In addition, the input devices may include a network device, such as a wired or wireless Ethernet card, a wireless network adapter, or any of various ports or devices configured to facilitate communication with other devices via any suitable communications network, such as a local area network or the Internet. Through such a network device, the processor-based system may exchange data and communicate with other networked electronic systems, whether proximate to or remote from the system. The network may include various components that facilitate communication, including switches, routers, servers or other computers, network adapters, communications cables, and so forth.

[0047] Processing in accordance with techniques of the present disclosure may begin when the measurements of the magnetic field B , obtained by the magnetometer 30, are received at the surface 40 by the data acquisition circuitry 42. As noted above, the magnetometer 30 may obtain three-axis measurements of the magnetic field B ; though the three axes of the magnetometer 30 may not generally be aligned with the (x,χ, z) coordinate system of the magnetic dipole 28, the data acquisition circuitry 42 or the data processing circuitry 46 may rotate the three-axis magnetometer 30 readings into the (x,χ,z) coordinate system using known survey information for the two wells and a reading from the inclinometer 36. Henceforth, the three magnetic field components may be understood to have been transformed into the (x,χ,z) coordinate system associated with the BHA 18 of the injector well 12.

[0048] After receiving the measurements of the magnetic field B , the data acquisition circuitry 42 may store the measurements in the database 44 or transmit the measurements to the data processing circuitry 46. In accordance with one or more stored routines, the data processing circuitry 46 may employ the measurements of the magnetic field B , in conjunction with MWD and/or LWD survey data, to ascertain the relative location of the magnetometer 30 to the rotating magnetic dipole 28 in the BHA 18. The data processing circuitry 46 may thereafter output a relative location report 48, which may be stored in the database 44 or transmitted to a BHA control / MWD interface 50. The relative location report 48 may indicate the location of the magnetometer 30 relative to the magnetic dipole 28 of the BHA 18 in the (x,χ,z) coordinate system. Additionally or alternatively, the relative location report 48 may be provided to an operator via one or more output devices, such as an electronic display and/or a printer.

[0049] The BHA control / MWD interface 50 may communicate with the BHA 18 using E-Pulse™-based electric pulse telemetry, mud pulse telemetry, or any other telemetry system communication downlink. Through the communication downlink, the BHA control / MWD interface 50 may control the BHA 18, as well as receive data obtained by the MWD and/or LWD tool 24; such received data may be stored in the database 44 for use by the data processing circuitry 46. In the presently illustrated embodiment, the BHA control / MWD interface 50 may automatically steer the drill bit 20 based on the relative location report 48. Additionally or alternatively, an operator in control of the BHA control / MWD interface 50 may steer the drill bit 20 based on the printed or electronically displayed relative location report 48.

[0050] FIGS. 2-7 generally illustrate the geometrical and magnetic relationships between the rotating magnetic dipole 28 in the BHA 18 and the magnetometer 30. Particularly, FIGS. 2 and 3 illustrate the disposition of the magnetic dipole 28 in the (x,χ, z) coordinate system and the resultant magnetic moments; FIGS. 4 and 5 illustrate geometrical relationships between vectors to an observation point, from which the magnetic field B caused by the magnetic dipole 28 may be measured; and FIGS. 6A-C and 7A-C respectively illustrate the components of the magnetic field B due to the x and y components of the magnetic dipole as the magnetic dipole rotates.

[0051] Turning to FIG. 2, the magnetic dipole 28 can be modeled as a magnetic dipole M located in the BHA 18. A coordinate system (x,y,z) may be understood to attach to the BHA 18, such that the z -direction is along the axis of the BHA 18 which is generally horizontal, the x direction is generally up, and the y -direction is generally horizontal. Accordingly, in FIG. 2, the magnetic dipole 28 (illustrated as a magnetic dipole M ) is located at the origin of this coordinate system (x,y,z) = (0,0,0) . The magnetic dipole M is transverse to the z -axis and makes an angle φ with respect to the x-axis. Note that φ is a function of time, which will be included later in the analysis. The BHA 18 may typically rotate at approximately 60 to 180 RPM, while the rate of penetration through the formation 16 may be significantly slower, at approximately 50 to 200 feet per hour. As such, the position of the BHA 18 may be assumed to be constant during the time of the measurement, such that time dependence is only in φ . As shown in FIG. 3, the magnetic dipole M can be written as the sum of two components,

M = M χ x + M χ y (1), where M x = Mcosφ and M = Msmφ . [0052] FIGS. 4 and 5 describe relationships between vectors to an observation point

52, from which the magnetometer 30 may take readings of the magnetic field B arising from the magnetic dipole 28 (illustrated in FIGS. 2 and 3 as magnetic dipole

M). Particularly, FIG. 4 illustrates a vector r , located at an observation point

(x, y, z) (x, y, z) relative to the magnetic dipole M at the origin, and a corresponding

transverse vector p . Notably, FIG. 4 provides the relationship between r and p in three-dimensional space. Similarly, FIG. 5 illustrates the geometry of transverse vector p in the x - y plane; the transverse vector p may be understood to rotate an angle ψ from the x -axis toward the y -axis. The geometry illustrated by FIGS. 4 and 5 may be described using the following mathematical relationships. As noted above, the magnetic field due to the magnetic dipole M can be written as the sum of the magnetic fields due to the two components M x and M . The static magnetic field

at an observation point r due to a magnetic dipole m may be given by

*«=^K r m \ - m (2),

where μ 0 = 4π 10 7 Henry/m, r = xx + yy + zz , and x , y , and z are unit vectors in the x , y , and z directions. The magnitude of r is thus

r = yjx 2 + y 2 + z 2 and the unit vector pointing in the r direction is r = r l r . In

addition, the transverse vector p may be defined as p = xx + yy , where

p = yjx 2 + y 2 and p = p /p. [0053] FIGS. 6A-C and 7A-C respectively illustrate the components of the magnetic field B due to the x and y components of the magnetic dipole M as the magnetic

dipole M rotates. As discussed above with reference to FIG. 1, the magnetic dipole

28 or other magnetic source (the magnetic dipole M) may rotate with the BHA 18, and thus may rotate around the z -axis in the x - y plane. As such, the magnetic field

B , as measured from the observation point 52, may vary with the rotation of the magnetic dipole M over time. Particularly, FIGS. 6A-C illustrate the magnetic field B at a point in time when the magnetic dipole M has rotated into alignment with the x -axis, and FIGS. 7A-C illustrate the magnetic field B at a point in time when the magnetic dipole M has rotated into alignment with the y -axis. In FIGS. 6A-C and

7A-C, the observation point 52, from which the magnetic field B may be measured by the magnetometer 30, is located in the upper right quadrant of the x -z plane.

[0054] Referring first to FIGS. 6A-C, because the magnetic dipole M has rotated into alignment with the x -axis, the magnetic field B due to the magnetic dipole M may be entirely due to the dipole component M x . The magnetic field due to the dipole component M x may be calculated as follows. Substituting

m = M x x = Mcosφ x into Equation (2) produces the results:

~ B'Cr) = B ^ (r)x + B Ir (r)y + BJr ~ )z~ (3a); Biy{r) jμj t [χy) (3c); and

[0055] The first subscript ( x) in Equations (3a) to (3d) refers to the magnetic dipole component, while the second subscript ( x , y , or z ) refers to the magnetic field

component. From Equations (3a)-(3d), the magnetic field B due to the dipole component M x may be shown from three perspective views in FIGS. 6A-C; in all

FIGS. 6A-C, the magnetic dipole M is aligned with the x -axis. FIG. 6A illustrates the magnetic field B due to the dipole component M x in the x -z plane; FIG. 6B

illustrates the magnetic field B due to the dipole component M x in the x - y plane;

and FIG. 6C illustrates the magnetic field B due to the dipole component M x in the y - z plane. As shown in FIG. 6A, the observation point 52 is located in the upper right quadrant of the x - z plane, and B^ and B χz are clearly nonzero as measured from the observation point 52. In fact, as described by Equations (3b) and (3d) above, the amplitudes of B 101 . and B xz are maxima at the observation point 52 when the

magnetic dipole M has rotated into alignment with the x -axis and φ is zero. In contrast, as shown in FIG. 6B, B x is zero as measured at the observation point 52.

This is also apparent from Equation (3c) with y = 0 . These conclusions are valid for any quadrant in the x -z plane. Thus, when the observation point 52 is in the x - z plane and the magnetic dipole M has rotated into alignment with the x -axis, the amplitudes of B x ^ and B^ are maxima, while B is zero. [0056] Referring next to FIGS. 7A-C, because the magnetic dipole M has rotated into alignment with the y -axis, the magnetic field B due to the magnetic dipole M may be entirely due to the dipole component M . The magnetic field due to the

dipole component M may be calculated as follows. Substituting

m = M y = Mύnφ y into Equation (2) produces the results:

~ B y (r) = B yx Cr)x+ B yy Cr)y + B yz Cr)z (4a);

The first subscript ( y ) in Equations (4a)-(4d) refers to the magnetic dipole component, while the second subscript ( x , y , or z ) refers to the magnetic field

component. From Equations (4a)-(4d3a)-(3d), the magnetic field B due to the dipole component M may be shown from three perspective views in FIGS. 7A-C; in all

FIGS. 7A-C, the magnetic dipole M is aligned with the y -axis. FIG. 7A illustrates

the magnetic field B due to the dipole component M in the x - z plane; FIG. 7B

illustrates the magnetic field B due to the dipole component M in the x - y plane; and FIG. 7C illustrates the magnetic field B due to the dipole component M in the

y - z plane. As shown in FIGS. 7B and 7C, B and B are clearly zero as measured from the observation point 52. As described by Equations (4b)-(4d) above, B and B are zero when the magnetic dipole M has rotated into alignment with the y -axis and φ is π/2. This may also be seen from Equations (4b) and (4d) with

y = 0 . When the magnetic dipole M is in the same location, the amplitude of B reaches a maximum, as measured from the observation point 52. Thus, when the observation point 52 is in the x - z plane and the magnetic dipole M has rotated into alignment with the y -axis, B reaches a maximum, while B and B are zero.

[0057] The total magnetic field for any angle φ of the magnetic dipole M may be given by adding the magnetic fields from each magnetic dipole component:

B(r) = B χ Cr)x + B y Cr)y+ B z C)z = B x C) + B x C) (5a);

B x (r) =^^£.^(x 2 -r 2 /3)cosφ + (xy)smφ ~ j (5b);

and

[0058] For the situations shown in FIGS. 6A-C and 7A-C, the position of the observation point 52 relative to the magnetometer 30 can be deduced provided one knows when the magnetic dipole M is aligned with the x -axis and when it is aligned with the y -axis. As the magnetic dipole rotates about the z -axis, the

magnetic field is measured at the observation point 52. Referring to FIGS. 6A-C, the

amplitudes of the magnetic field components BJr) and BAr) achieve their

maximum amplitudes when φ = 0 , i.e. when the magnetic dipole M is aligned with

the x -axis. At the same instant BAr) is zero. Referring to FIGS. 7A-C, both

magnetic field components BAj) and BAj) are zero when φ = π 12 , i.e. when the

magnetic dipole M is aligned with the y -axis. At the same instant, BJj)

achieves its maximum value. Note that BJj) and BJr) are in-phase since they

achieve their maximum and minimum amplitudes at the same times. Hence, by

measuring the magnetic field components as the magnetic dipole M rotates, and by observing when the amplitudes of field components are maxima and minima, one can determine the two instants when φ = 0 and φ = π 12.

[0059] Furthermore, once these two instants when φ = 0 and φ = π 12 are

determined, the magnetic field components can be used to deduce the position of the observation point 52. When φ = 0 , the nonzero magnetic field components are

BAr) = μ ° - [ " x 2 - r 2 / 3] and BAr) = μ ° , \ xz 1 , while the nonzero magnetic Aπr L J Aπr

field component for φ = π 12 is B (r) = — — r- \ r / 3 . Once these three magnetic y Aπr L J field components are measured, these equations can be solved for x and z , given that the value for M is known. As y = 0 was initially assumed, the problem is over determined, i.e. only two measurements are needed to obtain the two unknown quantities, x and z .

[0060] In the general case, the observation point may not be in the x - z plane and will have a nonzero value for y . Thus x , y and z are three unknown quantities and they must be determined from at least three measurements. From the previous paragraph, the three measured magnetic field components provide is sufficient information to determine these three unknown quantities. For any value of y , there is a plane that includes the z -axis and the observation point 52. Referring to FIGS. 8 and 9, this plane may be denoted by a primed coordinate system (x',y',z) where the x' -axis and the z -axis define the plane containing the observation point 52, and where the y' -axis is orthogonal to the plane. The x' and y' axes are obtained by rotation of the x and y axes by an angle θ about the z -axis. Since y' = 0 in the rotated coordinate system, the situation in the rotated coordinate system is similar to that illustrated in FIGS 6A-C and 7A-C, except that x is replaced by x' and y is replaced by y' in these figures.

[0061] FIG. 10 is a flowchart 54 that sets forth a general method, based on the relationships illustrated in Equations (5a) to (5d) and in FIGS. 6A-C, 7A-C, 8 and 9 above, for determining the relative location of the observation point 52 to the origin. As noted above, the observation point 52 represents the location of the magnetometer 30, while the origin represents the location of the magnetic dipole 28. Equations (5a) to (5d) may be employed to determine the location of the observation point 52 with respect to the origin. Accordingly, the present disclosure provides techniques for processing the measurements of the magnetic field B obtained by the magnetometer 30. The flowchart 54 of FIG. 10 generally describes how such techniques may be used to determine the relative location of the magnetometer 30 to the magnetic dipole

28.

[0062] In a first step 56, the magnetometer 30 may take a series of measurements of the magnetic field B over a predetermined period of time (e.g., 1-2 seconds or one or more periods of rotation of the magnetic dipole 28). If the magnetometer 30 in the producer well 14 is not completely aligned with the (x,χ, z) coordinate system of the magnetic dipole 28 in the injector well 12, the raw measurements from the magnetometer 30 may be transformed into the (x,χ,z) coordinate system using known survey information for the two wells and a reading from the inclinometer 36.

[0063] In step 58, the data processing circuitry 46 may receive the measurements of the magnetic field B in the (x, y, z) coordinate system over the predetermined period of time. To take advantage of Equations (5a) to (5d), the data processing circuitry 46 may rotate the magnetic field measurements by an angle θ from the (x,χ, z) coordinate system into the (x',χ',z) coordinate system. The angle of rotation θ is determined by requiring the magnetic component in the x ' direction be in-phase with the magnetic field component in the z direction. Equivalently, the angle of rotation θ is chosen such that the maxima and minima of the magnetic component in the x' direction and the z direction occur at the same instants. It should be appreciated that a variety of techniques may be employed to determine a proper angle of rotation of the reference frame, many of which are described in greater detail below.

[0064] In step 60, the relative location of the magnetometer 30 to the magnetic dipole

28 may be determined from the transformed measurements of the magnetic field B in the rotated frame of reference. Particularly, as will be described in greater detail below, the data processing circuitry 38 may determine the relative location based on the angle of rotation of the frame of reference and the amplitudes of the magnetic field

B in the rotated frame of reference.

[0065] The rotation angle θ may be determined by measuring the three components of the magnetic field at the observation point 52 as a function of time. Since the magnetic dipole M is rotating, there will be instances where it is aligned with the x 1 -axis and times when it is aligned with the y' -axis. These instances may be determined by imposing conditions on the magnetic field components. For example, when the magnetic field component in the x' direction is in-phase with the magnetic field component in the z direction, the situation is analogous to FIGS 6A-C. Here, in-phase means that the maximum amplitudes of the two field components occur at the same time, or that the minimum amplitudes of the two field components occur at the same time.

[0066] FIGS. 11-12 illustrate an example for performing the general algorithm of FIG. 10 in an exemplary case when the magnetic dipole 28 rotates at a constant frequency. The following analysis from Equations (5)-(13) may provide a framework for understanding FIGS. 11-12, which are discussed in greater detail below

[0067] Equations (5b), (5c), and (5d) can be recast in forms that explicitly display their phases. First, an angle a may be defined such that:

t ana = (6c) -

[0068] Equation (5b) can be rewritten as:

B ' ( r,t) = ° - Jx 2 V 2 + (x 2 - r 2 / 3) [cos α cos^ + sinα sin Aπr * v ' L

(7a), or

[0069] An angle β may be defined such that:

[0070] Equation (5c) can be rewritten as:

B χ Cr,t) =^4^V +(/ -r 2 /3) 2 cos{φ-β) (9).

[0071] An angle γ may be defined such that:

tan ^ = ^ (10c). x

[0072] Equation (5d) can be rewritten as:

[0073] In summary, the three magnetic field components are:

B χ (r,t) = B ox (r)cos(φ-a) , whcm B ox Cr) =

(12a);

B χ (r,t) = B (r)cos(φ-β) , where B oy (r)

(12b); and B z (r,t) = B oz (r) cos(φ- γ) , where ^) = A 5 -ZJi 2 + / (12c).

[0074] As discussed above, the magnetic dipole 28 may be rotating about the z -axis at the origin in the x - y plane, and the z -axis is aligned with the axis of the BHA

18. When the magnetic dipole 28 rotates at an approximately constant frequency, φ(t) = {2πf)t = ωt , where / is the frequency of rotation, and where ω = 2πf is the angular frequency. However, as will be discussed further below, the techniques disclosed herein are not limited to this special case of constant frequency, but rather may be employed as long as the magnetic dipole is not stationary about the z -axis in Xh& x - y plane.

[0075] The magnetic dipole 28 may be assumed to point in the +x direction at time t = 0 , because the technique disclosed herein relies not on absolute phases, but rather relative phases, among the three magnetic field components. Because the magnetic dipole 28 rotates with time, the magnetic dipole 28 makes an angle φ(t) = (Ot with respect to the x -axis at time t. For frequencies at or below 100 Hz, the magnetic field can be accurately described as a quasi-static field. In other words, the time dependence is given by the following relationships:

B x (r,t) = B ox (r)cos(ωt-a) and B ox (r) = ^Kj x 2 χ 2 + I x 2 - r 2 /3)

A Aππrr * v '

(13a);

B r {r,t) = B or {r)cos{ωt-β) and

(13b); and 3μ 0 M

B z (r, t) = B oz (?) cos(ωt - γ) and B oz (r) = zJx ÷ +

Aπr ' 'V r (13c).

[0076] As noted above, FIGS. 11-12 illustrate an example for performing the general algorithm of FIG. 10 in an exemplary case when the magnetic dipole 28 rotates at a constant frequency. In the example of FIGS. 11-12, / = 3 Hz, M = 100 Amp-m 2 , and the coordinates of the observation point 52 are x = 10 m, y = 1 m, and z = 10 m.

Turning to FIG. 11 , a plot 62 represents an idealized measurement of the magnetic

field B over a period of one second based on the equations above. An ordinate 64

represents the ideal measurement of the magnetic field components of B in units of nanoTesla, and an abscissa 66 represents time in units of seconds. A dash-dotted line

represents a measurement of B x (r, t) , a dashed line represents a measurement of

B (r,t) , and a solid line represents a measurement of B z {r,t) . In the graph 62, the

phases of the components are a = 0.559 radians, β = -1.268 radians, and

γ= 0.197 radians, and the amplitudes are B ox {r) = 1.91 nanoTesla,

B oy C) = 3.38 nanoTesla, and B oz (r) = 5.15 nanoTesla.

[0077] Because the observation point 52 may be located with respect to the magnetic dipole 28 using the three magnetic field components, measured as functions of time

t , the values M , B x {r,t) , B (r,t) , and B z {r,t) may be treated as known

quantities, while the observation point r may be treated as an unknown and to be determined. Note that there are three unknown quantities, x , y , and z . The

solution may be obtained by finding an angle of rotation around the z -axis such that B χ (r,t) and B (r,t) are transformed into magnetic field components H χ (r, t) and

H (r,t) , in which H x (r, t) is in phase with B z (r,t) . Specifically, such a

transverse angle of rotation θ may be defined according to the following equation:

H x (r,t) cos θ sin θ B x (r,t)

(14),

H y (r,t) -sin θ cos (9 B r (r,t)

such that H χ (r,t) is in phase with B z (r,t) .

[0078] In Equation (14), H χ {r,t) and H (r,t) denote magnetic field components

in the rotated frame, while B χ (r,t) and B (r,t) represent magnetic field

components in the original frame. Since the rotation is about the z -axis, the

magnetic field component in the z direction is the same in both frames. B z (r,t)

may be expanded as follows:

B 2 (r, t) = B oz (r) cos(ox - γ) = B oz (r) [cos(-Mf) cos γ+sin(ox) sin γ]

B z (r,t) = B oz (r) cos ^{cos(ft>£ ) + sin(ft>£ ) tan γ] (15).

[0079] Substituting Equations (13a) and (13b) into Equation (14), the following relationship may be written:

+ siaθ (16). [0080] Based on a trigonometric identity and Equation (6), the following relationship may be written: cos{ωt- a) = cos{ωt)cosa + sin(ωt)sina

(17).

[0081] Similarly, using the same trigonometric identity and Equation (8), the following relationship may be written:

(18).

[0082] Inserting Equations (17) and (18) into Equation (16) provides the following relationship:

H χ {r,t) + sin θ \ (xχ)cos(ωt) + (y 2 -r 2 / 3)sin(fflf)l| ,

whose terms may be rearranged as follows:

H x (r,t) =^^ r {cos(ωt) [(x 2 -r 2 /3)cosθ + (xy)sin θ^ + sin(flif) [(xχ)cosθ+ (χ 2 -r 2 /3)sin^]} ,

wherein the cos θ term may be factored to produce the following: - r 2 / 3) + (xχ)tan θl

[0083] By factoring the first term of Equation (19) in square brackets, the following equation may be written:

! cos(flJf ) + sin(fi*) (20).

[0084] Comparing Equations (15) and (20), H x (r,t) will be in phase with B z (r,t)

if the following relationship is satisfied:

[0085] Equation (21) may be solved to yield the following:

tan θ = tan γ = ^- (22), x or, more simply: θ = γ+ n -π (23),

where n is an integer.

[0086] Note that the ambiguity in direction ( n ■ π ) is not an impediment in locating the observation point 52 in a practical drilling situation, since the general direction from the observation point 52 to the magnetic dipole 28 will be known. Applying the rotation angle from Equation (22) to Equation (19) may yield the following:

+ sm(ωt) (x 7 ) + (/-r 2 /3) 7

which may be rearranged and simplified as follows:

HΛr,t) = 3μ 0 M *r 2 -z 2 cos(ox-θ) (24). 4πr 5

[0087] When Equation (22) is satisfied, H ' y ( κ r,t) is π/2 radians out-of-phase with

B z (r,t) . To demonstrate this, substitute Equations (13a) and (13b) into Equation

(14):

insert Equations (17) and (18):

/3)cos{ύX) + (xχ)sin(ωt)}

;

0 M<

HΛr,t) = icos(ffir)r-(x 2 -r 2 /3)sin6'+(^)cos6'l

4πr 5 + sm{ωt)ϊ-(xχ)smθ+(χ 2 -r 2 /3)cosøl};

and factor the cos θ term and using Equation (22) for tan θ :

+ sm(ωt) _(^)21 + ( r 2 _ r 2 / 3 )

- ° , sin(ά;f - 6>)

(25).

[0088] With the condition tan θ = tan γ and comparing Equation (25) to

B z (r,t) = B oz (r)cos(ύX - γ) , it is clear that H (r,t) is π/2 radians out-of-phase with

5 x (Λf) .

[0089] The above-described situation may be understood by referring again to the magnetic field lines of FIGS. 6A-C and 7A-C. For example, consider the instant when the magnetic dipole 28 is aligned with the +x axis as illustrated in FIGS. 6A-C. Note that under the above-described conditions, the observation point 52 may be located in the upper right quadrant of the x - z plane (i.e., at a point (j*r,O, z) ).

Referring to FIG. 6 A, the magnetic field components B z (r,t) and B χ (r,t) will reach maximum amplitudes when the magnetic dipole 28 is aligned with the +x axis, as illustrated. However, the magnetic field component B (r,t) will be zero at this instant, as indicated by FIG. 6B. At the instant when the magnetic dipole 28 is aligned with the +χ axis, as illustrated in FIGS. 7A-C, the magnetic field component

B (r,t) will reach a maximum amplitude at the observation point 52. This

circumstance is apparent in FIG. 7B. Meanwhile, magnetic field components

B z (r,t) and B x (r,t) will be zero at this instant, as indicated by FIGS. 7B and 7C.

Hence, B χ (r,t) is in-phase with B z (r,t) , while B (r,t) is π/2 radians out-of -phase

with B z (r, t) . However, this condition exists only for observation points in the

x - z plane. For points off the x - z plane, the rotation of B χ (r,t) and B (r,t) to

H χ (r,t) and H (r,t) described by Equations (14) and (22) should be applied.

[0090] FIG. 8 illustrates a relationship between the transverse vector p from the

origin, which represents the location of the magnetic dipole 28, to the observation point 52, which represents the location of the magnetometer 30. According to

Equation (10), and as illustrated in FIG. 8, the angle between p and x is

γ = tan " [y I x) . Thus, because the condition for H χ (r, t) to be in phase with

B 2 . (r, t) is given by Equation (22), tan θ = tan γ , the desired phase coherence may be

obtained when frame of reference is rotated by the angle θ from the x -axis. FIG. 9 illustrates the situation where a rotated (x',χ', z) coordinate system is defined when

the (x,χ, z) coordinate system is rotated by the angle θ, according to the following

relationship:

x cos# sin θ x

(26). y -sin θ cos# y [0091] Thus, when the observation point is located off of the x — z plane by an angle γ, rotating the coordinate system by an angle θ = γ+ nπ provides the required phase

coherence. In the (x',χ', z) coordinate system H x (r,t) is in phase with B z (r,t) .

[0092] FIG. 12 represents a plot 68 of the measurements of FIG. 11, rotated to a frame of reference such that H χ (r,t) is in phase with B z (r,t) . An ordinate 70 represents the rotated measurement of the magnetic field in units of nanoTesla, and an abscissa 72 represents time in units of seconds. Recalling that the phases of the idealized measured magnetic field components are a = 0.559 radians, β = -l .268 radians, and γ = 0.197 radians, rotating the magnetic field such that

H χ (r,t) is in phase with B z (r,t) may occur by applying Equation (14) with θ = 0.197 radians to the data illustrated in the plot 62 of FIG. 11. In the resulting plot 68, a dash-dotted line represents the x ' -component of the magnetic field, H χ (r,t) , a dashed line represents the y' -component of the magnetic field, H (r,t) , and a solid

line represents the original z -component of the magnetic field, B z {r,t) . Note that

H χ (r,t) is in-phase with B z (r,t ) , while H (r,t) is π/2 out-of -phase with B z (r,t).

[0093] FIG. 13 is a flowchart 74 that describes a manner of determining the relative location of the magnetometer 30 to the magnetic dipole 28 based on the equations disclosed above. It should be appreciated that further embodiments are discussed below for several, more specific, situations that may arise while drilling a new well in the proximity of an existing well. In a first step 76, the magnetometer 30 may take a series of measurements of the magnetic field B over a predetermined period of time (e.g., 1-2 seconds or one or more periods of rotation of the magnetic dipole 28). If the magnetometer 30 in the producer well 14 is not completely aligned with the (x,χ, z) coordinate system of the magnetic dipole 28 in the injector well 12, in step 78, the raw measurements from the magnetometer 30 may be transformed into the {x,y,z) coordinate system using known survey information for the two wells and a reading from the inclinometer 36.

[0094] In step 80, the data processing circuitry 46 may receive the measurements of the magnetic field B taken for the predetermined period of time. The data processing circuitry 46 may rotate the frame of reference of the measurements of the magnetic field B such that the x ' -component of the magnetic field, H x (r, t ) , is in phase with

the z -component of the magnetic field, B z {r,t) . It should be noted that the y' -

component of the magnetic field, H (r,t) , may be π/2 out of phase with H χ (r,t) .

[0095] In step 82, the data processing circuitry 46 may determine the amplitudes of H χ (r,t) and H (r,t) , as will be described further below. In step 84, the data processing circuitry 46 may determine the relative location of the magnetometer 30 to the magnetic dipole 28 using the amplitudes determined in step 82 and the angle of rotation of the rotated frame of reference. Particularly, the data processing circuitry 46 may employ Equations (35)-(41) to perform steps 82 and 84, which are discussed in greater detail below. [0096] In the example illustrated in FIGS. 11-12, discussed above, the measurements of the magnetic field B were idealized and without error. However, measurements taken in the field may contain noise or other errors. FIGS. 14-18 represent examples of the presently disclosed technique that simulate errors in measurement for a magnetic dipole 28 rotating at a constant frequency. Particularly, FIGS. 14-16 represent a first example, while FIGS. 17 and 18 represent a second example. In the example of FIGS. 14-16, as in the example of FIGS. 9-12, / = 3 Hz, M = 100 Ampin 2 , and the coordinates of the observation point 52 are x = 10 m, y = 2 m, and z = 10 m. However, because real data will be noisy, random numbers will be used to simulate noise with a standard deviation of O.lnanoTesla. The noise is added to magnetic field components calculated using Equations (13a), (13b), and (13c). Additionally, to indicate measured quantities, a tilde will be used in the following equations. For example, j i?χ(f ; )| , | ^ j (f ; ) | , and | ^ z (f ; )| refer to N measured

signals obtained at times t } , i = 0, ... , N - 1. The vector r will be suppres sed in the notation for measured quantities. It should be noted that the objective is to determine the observation point ( r ) with respect to the rotating magnetic dipole located at (0,0,0) . The three unknown quantities are x , y , and z , while the four known quantities are M and the three-axis magnetometer 30 readings. Based on the following discussion, the unknown quantities may be determined.

[0097] Turning to FIG. 14, a plot 86 represents simulated data obtained by the magnetometer 30 when / = 3 Hz, M = 100 Amp-m 2 , and the coordinates of the observation point 52 are x = 10 m, / = 2m, and z = 10 m. An ordinate 88 represents a measurement of the magnetic field components of B in units of nanoTesla, and an abscissa 90 represents time in units of seconds. In the plot 86, a triangle represents a data point of a measurement of the x -component of the magnetic field, [B x (C 1 )} , a

diamond represents a data point of a measurement of the y -component of the

magnetic field, j By (c i ) | , and a circle represents a data point of a measurement of the

z -component of the magnetic field, j Bz (C 1 ) | . The magnetometer 30 is assumed to

have taken 100 measurements of each component per second.

[0098] For constant rotation, it may be more convenient to work with functions than raw data points. As such, FIG. 15 illustrates a plot 92 the measured data of FIG. 14 that has been least squares fit to sinusoidal functions of the form: B ) (c) = A cos(&> C - P ) , where A is the amplitude, P is the phase, and ω is the

angular frequency, and where j = x,y,z . An ordinate 94 represents the magnetic

field components of B in units of nanoTesla, and an abscissa 96 represents time in units of seconds. In the plot 92, a triangle represents a data point of a measurement of the x -component of the magnetic field, j Bx(C 1 ) | , a diamond represents a data point

of a measurement of the y -component of the magnetic field, [By(C 1 )} , and a circle

represents a data point of a measurement of the z -component of the magnetic field, 1 Bz(C 1 ) J . Additionally, a dash-dotted line represents a least squares fit sinusoid to

the x -component of the magnetic field, B x (C) , a dashed line represents the least squares fit of a sinusoid to the y -component of the magnetic field, By (c) , and a solid line represents the least squares fit of a sinusoid to the z -component of the magnetic field, Bz (t) .

[0099] To obtain the least squares fitting of the measured magnetic field B data, the frequency for each field component is allowed to float initially (since the rotation frequency may not be known at the observation point 52). There are nine parameters to be obtained by minimizing the following quantities:

Xl = ∑{B At 1 ) - A x COs(CO x C 1 - P x )] 2 (27a);

χ y 2 = -A y cos(ω y t 1 -P x )] (27b); and

χ z = ∑{B z (t ] )-A z cos(ω z t ] -P z )f (27c).

[00100] Once the nine parameters A v A v , A 7 , P v , P v P 7 ω v , ω v , and ω Υ are obtained from the three least squares calculations, a further condition can be imposed: ω = (ω x + ω y + ω z ) / 3 (28), since the rotation rate must be the same for all magnetic field components.

[00101] Using the average value for the angular frequency obtained from Equation (28), Equations (27a), (27b), and (27c) can be minimized a second time with the constraint: ω v = ω τ = ω r = ω. The final values for A v A v , A 7 , P v , P., and P. will be then used in subsequent calculations rather than the raw measurements. For the plot 92 of FIG. 15, the fitting parameters are A x = 1.91 nanoTesla, P x v = 0.561 radians, A y v = 3.38nanoTesla, P y.. = -1.271 radians, A z Ύ = 5.14 nanoTesla,

and P 2 = 0.199 radians. As illustrated in FIG. 15, the agreement between raw data and the fitting functions is very good.

[00102] Using the fitted curves of the magnetic field B measurements, an angle of rotation θ may be determined such that a rotated x -component of the magnetic field,

Hx{t) , is in phase with the z -component of the magnetic field B z (t) . From Equation (14), the fields in the rotated frame can be written as follows:

H x (t) = A x cos(ωt-P x ) cosθ+A y cos(ωt-P y )wiθ (29a);

Hy (f ) = -A x cos ( ωt - P x ) sin θ + A y cos ( ωt - P y ) cos θ (29b) ; and

B z {t) = A z cos {ωt -P z ) (29c).

[0100] Equation (29a) can be re-arranged as follows:

Hx{t) = cos(ωt) \A X COS P X COS θ + A γ cos P γ sinθ ~ \

+ sin(<ϋf ) sin P x cos θ+ A y sin P sin θ \ (30).

[0101] Equation (29c) can be similarly re-arranged as follows: B z (t) = cos(ωt) [A z cosP z ] + sin(ωt) [A z smP z ] (31).

[0102] Forcing the phase of H x {t) to be the same as B z {t) indicates the following relationship:

[A 2 sin P 2 ] _ [A X sin P x cos θ + A y sin P y sin ø] [_4 Z cos P 2 ] ^ x cos P x cos Θ + A χ cos P 7 sin ø]

[0103] Re-arranging Equation (32) produces the following:

[0104] The tilde over the determined rotation angle indicates that the value for the rotation angle is derived from measured data, i.e. from the parameters fit to the data. Equation (33) also provides the direction from the point of observation to the z-axis (i.e., toward the line defined by (0, 0, z) ). Moreover, tan θ = tan γ = y I x , so one unknown quantity ( x or χ ) can be eliminated.

[0105] FIG. 16 illustrates a plot 98 of the rotated magnetic field data, which may be obtained by using Equation (33) to obtain θ = 0.199radians and applying Equations (29a) and (29b). An ordinate 100 represents the least squares fits of the magnetic field components in units of nanoTesla, and an abscissa 102 represents time in units of seconds. In the plot 98, a dashed line represents the rotated x ' -component of the magnetic field, H x (f ) , a dotted line represents the rotated y ' -component of the

magnetic field, Hγ{t) , and a solid line represents the z -component of the magnetic

field, B z {t) . The rotated magnetic field component, H x (t ) , is in-phase with B z {t) ,

while Hy(t) is π/2 radians out-of -phase with B z (t) .

[0106] Having determined the rotated frame of reference, the transformed magnetic field data may be employed in the rotated frame by the data processing circuitry 46 to determine the relative location of the magnetometer 30 to the magnetic dipole 28. To determine the relative location, the data processing circuitry 46 may employ the amplitude values of the rotated magnetic fields in conjunction with the angle of rotation, as discussed below with reference to Equations (34)-(41). As discussed above, in the rotated frame where tan θ = tan γ , the magnetic field components have

the forms:

H x {r,t) = - 5 — r - z cos(fflf - ø) (24); Aπr 3

[0107] In the rotated frame that satisfies Equation (33), and except for noise, the three measured magnetic field components have the same form:

H x (t) = Hoχ Cθs(ωt -P ) (34a); Hy{t) = -Hoy ύa{ωt -P z ) (34b); and

Bz(t) = A z cas{ωt -P z ) (34c),

where H O χ and Hoy are constants.

[0108] The same phase P z occurs in Equations (34a), (34b) and (34c). This is

simply a restatement that the phase of H x {t) is in the same as the phase of B z {t)

and that the phase of Hy(t) is πl 2 radians out-of phase with B z (t) . The amplitude

H ox is obtained by setting Equation (29 a) equal to Equation (34a):

Hx{t) = cos(ωt) I A x COS P X COS θ+ A y cos P y sin θ \

+ sin(<ϋf ) \ A X sin P x cos θ + A y sin P y sin θ \

= H ox cos(ωt-P z ) = H ox ; hence:

\ A Ύ COS P Ύ COS θ + A v cos P v sin θ \ Ho x = ^ y - y - ± (35). cos P ^

[0109] Similarly, the amplitude Hoy is obtained by setting Equation (29b) equal to

Equation (34b) as follows:

Hy (t) = -A x cos(ωt - P x ) sin θ + A cos(ωt - P ' ) cos θ ;

Hy it) = cos(ωt) \ -A x cos P x sin θ + A y cos P y cos θ \

+ sm(ωt ) [-v4 x sin P x sin 6> + -4 χ sin P y cos ^l

= -Hoy sin(ωt -P z ) = -H O y [sin ωt cos /^ - cos ωt sin i^ 1 ; hence,

I A x COS P X sin Θ-A y cos P y cos θ \

H oy — (36). sin/"

[0110] Equations (34c), (35) and (36) define the amplitudes of the three magnetic field components in the rotated frame in terms of the parameters obtained by least squares fitting the raw data to the cosine functions in Equations (27a), (27b), and (27c). Comparing Equations (24), (25), and (13c) to Equations (34a), (34b) and (34c) yields the following:

TT __ ^ 3μV 0 M" ( 2 2 2

H ox ~ r λ - z λ 4 πr .5 - (37a); 5

_ μ 0 M

H ' °OyV —— - T (37b); and y 4πr 3

_ 3μ 0 M

A = (37c).

4πr b

[0111] Inverting Equation (37b) yields the estimated distance between the magnetometer 30 and the magnetic dipole 28:

where the tilde indicates that r is obtained from inverting the measurements.

[0112] Equation (37a) may be recast as:

[0113] Note that the proper sign must be chosen inside and outside of the square root to produce a physically reasonable answer. Again, the tilde indicates that z is obtained from inverting measurements. Noting that:

Equation (37c) can be recast as follows:

[0114] Finally, the last unknown is determined from the following relationship:

χ = x tdinθ (41).

[0115] FIGS. 17 and 18 illustrate an example similar to that of FIGS. 14-16 for using the presently disclosed technique. As in the example of FIGS. 14-16 above, FIGS. 17 and 18 simulate slight errors in measurement for a magnetic dipole 28 rotating at a constant frequency. In the example of FIGS. 17 and 18, / = 3 Hz, M = 100 Amp-m 2 , and the coordinates of the observation point 52 are x = 10 m, y = 2 m, and z = -10 m.

However, because real data will be noisy, random numbers will be used to simulate noise with a standard deviation of 0. lnanoTesla. The noise is added to magnetic field components calculated using Equations (13a), (13b), and (13c). Additionally, to indicate measured quantities, a tilde will be used in the following equations. For example, refer to TV measured signals obtained at

times C 1 , i = 0,..., N -1. The vector r will be suppressed in the notation for measured quantities. It should be noted that the objective is to determine the observation point ( r) with respect to the rotating magnetic dipole located at (0,0,0) . The three unknown quantities are x , y , and z , while the four known quantities are

M and the three-axis magnetometer 30 readings. Based on the following discussion, the unknown quantities may be determined.

[0116] Turning to FIG. 17, a plot 104 represents simulated data obtained by the magnetometer 30 when / = 3 Hz, M = 100 Amp-m 2 , and the coordinates of the observation point 52 are x = 10 m, χ = 2m, andz = -10 m. An ordinate 106

represents a measurement of the magnetic field components of B in units of nanoTesla, and an abscissa 108 represents time in units of seconds. In the plot 104, a triangle represents a data point of a measurement of the x -component of the magnetic field, I B X (I 1 )} , a diamond represents a data point of a measurement of the y -

component of the magnetic field, [By ( J 1 )\ , and a circle represents a data point of a

measurement of the z -component of the magnetic field, j Bz (f, ) | • The magnetometer 30 is assumed to have simultaneously sampled each magnetic field component every 0.01 seconds for a total measurement time of one second.

[0117] FIG. 18 illustrates a plot 110 of the measured data of FIG. 17 that has been least squares fit to sinusoids. An ordinate 110 represents a least squares fitting of the magnetic field components of B in units of nanoTesla, and an abscissa 114 represents time in units of seconds. In the plot 110, a triangle represents a data point of a measurement of the x -component of the magnetic field, [Bx(U 1 )} , a diamond

represents a data point of a measurement of the y -component of the magnetic field, , and a circle represents a data point of a measurement of the z -component

of the magnetic field, j Bz (C 1 ) | .

[0118] The least squares fitting of FIG. 18 may be determined in two steps. A first least squares fitting may employ Equations (27a), (27b), and (27c) to obtain A x 5 A ,

A z , P x , P P z . ύ) χ , CO , and co z . As such, the angular frequencies are

ω Λ γ = 18.83 radian/sec, ω χ v = 18.87 radian/sec, CO z 7 = 18.86 radian/sec, and

CO = 18.85 radian/sec. A second least squares fitting may employ Equations (27a), (27b), and (27c) using ω χ = ω = ω z = ω = 18.85 radian/sec. The fit parameters are

thus A x = 1.55 nanoTesla, P x = 3.013 radians, ^ 4 = 1.99 nanoTesla,

P = -1.451 radians, A z = 1.88 nanoTesla, and P 2 , = 3.538 radians. The resulting

functions, A cos(cot -P ) , A cos(cx-P ) , and A cos(cot -P ) , are illustrated as a dash-dotted line, a dashed line, and a solid line, respectively, in the plot 110 of FIG. 18.

[0119] Based on the least squares fitting of FIG. 18, the relative location of the magnetometer 30 to the magnetic dipole 28 may be determined. Equation (33) may be used to compute the angle θ , which gives the direction from the observation point to the z -axis, and where tan# = y I x can be used to eliminate one unknown quantity. The results are thus tan ^ = 0.407 and θ = 0.386 radians. Next, Equations (35) and (36) may be used to obtain H O χ = 1.45 nanoTesla, and Hoy = 2.07 nanoTesla, and

Equation (38) yields r = 16.90 m with an error Ar = r - r = 0.02 m, where the "true" value for r was obtained from the initial conditions in the calculation. Finally, Equation (39) yields z = -16.03 m with an error Az = z - z = -0.03 m, Equation (40) yields x = 4.99 m with an error Ax = x - x = -0.01 m, and Equation (41) yields y = 2.03 m with an error Ay = y — y = 0.03 m.

[0120] FIG. 19 is a flowchart 116, which describes a general manner of drilling a new well, such as the injector well 12, proximate to an existing well, such as the producer well 14. The flowchart 116 generally recounts the techniques described above, for use when the magnetometer 30 in the producer well 14 takes measurements when the magnetic dipole 28 is rotating at a constant frequency in the injector well 12.

[0121] In a first step 118, the three magnetic field B components from the rotating magnetic dipole 28 may be measured by the magnetometer 30 for a predetermined period of time (e.g., one second or one or more periods of rotation of the magnetic dipole 28). Such measurements may be denoted as I B X (I 1 )} , IBy(I 1 )} , and for i = 0, 2, 3,..., N -1 . The magnetic field components are represented in

the (x,y, z) coordinate system defined by the magnetic dipole 28, in which the magnetic dipole 28 rotates around the z -axis in the plane of the x and y axes. The raw magnetometer 30 readings may be received by the data acquisition circuitry 42 before being stored in the database 44 or transmitted to the data processing circuitry 46. Particular examples of simulated magnetometer 30 readings are discussed above with reference to FIGS. 14 and 17.

[0122] In steps 120-124, the raw data collected in step 118 may be least squares fitted to sinusoidal curves. As such, in step 120, the data processing circuitry may

minimize the quantities χ χ = ∑ IB X (t 2 ) - A x cos (ω x t l - P x )) ,

, where i = 0, 2, 3,..., N -I with respect to A x t A A z , P x , P P z ω χ , ω > and

ω z . In step 122, the data processing circuitry 46 may compute an average angular

frequency according to the equation ω = (O) x + ω + co z ) 13. In step 124, the data processing circuitry may next minimize the quantities 2 χl = ∑[β Z(C 1 ) -A z cos(ωt l -P z )} , with respect to A x , A y , A x , P x , P χ , and P x . Particular examples of the least squares fitting of step 124 are discussed above with reference to FIGS. 15 and 18.

[0123] The rotated frame of reference may be determined in steps 126 and 128. In step 126, the data processing circuitry 46 may calculate the rotation angle using the

relationship In step 128, the data processing circuitry may obtain the direction γ from the z -axis of the magnetic dipole toward

the magnetometer from γ = θ + n ■ π , where /2 = 0, 1 .

[0124] In steps 130-138, the data processing circuitry 46 may determine the relative location of the magnetometer 30 to the rotating magnetic dipole 28. In step 130, the data processing circuitry 46 may calculate the magnetic field amplitudes

\ A Ύ COS P Ύ COS θ + A v cos P v sin θ \

H ox =^ y - y - ± and cos P ' z,

A x cos P x sin θ - A cos P cos θ

Hoy = . Based on the calculation of step 130, in sin P z

step 132, the data processing circuitry 46 may next calculate the distance between the

magnetic dipole and the magnetometer with r • I n ste P 134, the data processing circuitry 46 may calculate the magnetometer's z position with

calculate the magnetometer's x position with x processing circuitry 46 may finally calculate the magnetometer's y position with

y = x tan# in step 138.

[0125] Based on the above steps 134-138, in step 140, the data processing circuitry 46 may output a relative location report 48 indicating the relative location of the magnetometer 30 to the magnetic dipole 28. Thus, the position of the magnetic dipole 28 in a coordinate system attached to the magnetometer is (-x,-y,-z) . The information provided by the report 48 may be employed to steer the BHA 18 to drill a desired configuration. For example, the BHA 18 may be steered by the BHA control / MWD interface 50 such that the BHA 18 drills at an approximately constant distance (e.g., 4-6 m) above an existing well containing the magnetometer 30, which may create a SAGD well pair as illustrated in the well-drilling operation 10 of FIG. 1.

[0126] FIGS. 20 A-C illustrate the amount of error associated with the above techniques when the magnetometer 30 is located at various distances from the magnetic dipole 28 along the z -axis. In FIGS. 20A-C, measurements are simulated as being taken along the line defined by x = 5 m and y = 2 m, with data points every

2 meters along the z direction at the points: z = -30, - 28, - 26, ... ,+28, + 3O m. In this simulation, the coordinates of the observation point 52 are changing, while the magnetic dipole source remains at the origin. At the point z=0 m, the magnetometer 30 is directly below the magnetic dipole 28 in the (x,y,z) coordinate system. FIGS.

20A-C simulate what may occur when drilling the injector well 12, which contains the rotating magnetic dipole 28, while measuring the magnetic field B using the magnetometer 30 in the producer well 14 at a fixed location. Each data point in FIGS. 20A-C corresponds to a solution of the position of the magnetometer 30 using data from a single relative location to the magnetic dipole 28. The inferred position (x, y, z) of the magnetometer 30 relative to the magnetic dipole 28 can be compared

to the "true" position (x,y,z) used to initially simulate the magnetic field B . In practice, the desired quantity is the inferred position of the magnetic dipole relative to the magnetometer 30. This is given simply by (-x,-y,-z) in the coordinate system centered on the magnetometer 30. Hence, the information from the known position of the magnetometer 30 and the measured magnetic field B components can be used to steer the drill bit 20 in the injector well 12.

[0127] FIG. 2OA represents a plot 142 of an error Ax = x- x , which indicates the difference between the value in the x -direction calculated according to the above- described techniques and the actual value of the x -direction, at various points in the z -direction. An ordinate 144 represents the error Ax = x - x in units of meters, while an abscissa 146 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 142, the errors are less than 0.5m over the range of z = -20 m to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m. Note that there is no calculation possible at z = 0 m since B z (t) = 0 at this location. [0128] FIG. 2OB similarly represents a plot 148 of an error Ay = y — y , which indicates the difference between the value in the y -direction calculated according to the above-described techniques and the actual value of the y -direction, at various

points in the z -direction. An ordinate 148 represents the error Ay = y — y in units of meters, while an abscissa 152 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 148, the errors are less than 0.5m over the range of z = -20 m to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m.

[0129] FIG. 2OC similarly represents a plot 154 of an error Az = z - z , which indicates the difference between the value in the z -direction calculated according to the above-described techniques and the actual value in the z -direction, at various points in the z -direction. An ordinate 156 represents the error Az = z - z in units of meters, while an abscissa 158 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 154, the errors are less than 0.5m over the range of z = -20 in to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m.

[0130] In the discussion above, the rotation of the magnetic dipole 28 in the BHA 18 has been assumed to be constant. However, the BHA 18 may not have a constant rotation frequency. Indeed, stick-slip and other drilling dynamics may cause the frequency to vary during a measurement cycle. Variations in frequency may be accommodated by modifying the previous formulas slightly. For example, the instantaneous frequency may increase or decrease during the measurement period as a chirp according to the following relationship:

/(f) = / 0 +/ l f (42),

where f Q , and /[ are constants.

[0131] This type of variation is not unrealistic as the BHA rotation can be accelerating or decelerating. The angular frequency term becomes

ω(t) = ω o ι t = 2π(f o +f 1 t) (43).

[0132] The measurements can be least squares fit to based on equations similar to Equation (27 a): ή=∑{B ^t 1 )- A x cos(ω x { ti ) U 1 -P x )] 1 (44a);

Z χ 2 =∑{Br(t 1 )-Λ χ cos(ω χ (t i ) I 1 -P x )] (44b); and i

χ z =∑{B z (t ] )-A z cos{ω z (t ] .)t ] .-P z )} 2 (44c),

except that O) (t) = 2 ;r(/ 0 ■ + /^ ■ t ) for j = x,y,z are functions of time; the fitting parameters are: A x , P x , f Qx , f , A y , P y , f Qy , f ly , A 2 , P z , f Qz , and f lz . [0133] FIG. 21 illustrates a flowchart 160, which describes a general manner of drilling a new well, such as the injector well 12, proximate to an existing well, such as the producer well 14. The flowchart 160 generally recounts the techniques described above, as modified for use when the magnetometer 30 in the producer well 14 takes measurements when the magnetic dipole 28 is rotating at an increasing or decreasing frequency in the injector well 12, rather than when the magnetic dipole 28 is rotating at a constant frequency.

[0134] In a first step 162, the three magnetic field B components from the rotating magnetic dipole 28 may be measured by the magnetometer 30 for a predetermined period of time (e.g., two seconds or one or more periods of rotation of the magnetic dipole 28). Such measurements may be denoted as j B x [t t ) | , j By (f, ) } , and

J Bz (C 1 ) J for i = 0, 2, 3,..., N -1 . The magnetic field components are represented in

the (x,χ, z) coordinate system defined by the magnetic dipole 28, in which the magnetic dipole 28 rotates around the z -axis in the plane of the x and y axes. The raw magnetometer 30 readings may be received by the data acquisition circuitry 42 before being stored in the database 44 or transmitted to the data processing circuitry 46.

[0135] In steps 164-168, the raw data collected in step 162 may be least squares fitted to sinusoidal curves. As such, in step 164, the data processing circuitry may

minimize the quantities {B X (t 2 ) - A x cos (2 π {f Qx + f lx t 2 )t 2 - P x )) , χ χ =∑{B r {t i )-A χ cos(2π{f Qχ+ f ^t 1 -P 7 )] , and

χl =∑{B z (t j )- A z cos(2π (f Oz +f lz t j )t j -P z )} , where i = 0,2,3,..., JV-I , with i

respect to A x , A 7 , A z , P x , P y , P z f , f , f , f , f Oz ,md f lz . Instep 166,

the data processing circuitry 46 may compute an average angular frequency according

to the equations T Q = (f + f + f Qz ) 13 and T 1 = (f + f +f lz )/3. In step 168,

the data processing circuitry may next minimize the quantities

Z x l =∑{B x (t J )-A x co S (2π(7o+fit J )t J -P x )} 2 ,

%y 2 = Σ i { B r (ti ) - A y cos ( 2 π ( /o + fl ti ) { i - P y)} ' and

χl COS(2Λ-(/O+/I t ; )t ; -P z )} , with respect to A x , A 7 , A x ,

P x , P and P 2 . A particular example of the least squares fitting of step 168 is

discussed below with reference to FIG.22.

[0136] The rotated frame of reference may be determined in steps 170 and 172. In step 170, the data processing circuitry 46 may calculate the rotation angle using the

A ϊ cos P x tan P -sin P 1 relationship tan θ = —γ 4- . In step 172, the data processing

A χ ^cos P χ tan P 2 - sin P χ J

circuitry may obtain the direction γ from the z -axis of the magnetic dipole toward

the magnetometer from γ = θ + n π , where /2 = 0,1. [0137] In steps 174-182, the data processing circuitry 46 may determine the relative location of the magnetometer 30 to the rotating magnetic dipole 28. In step 174, the data processing circuitry 46 may calculate the magnetic field amplitudes

A 1 . cos P 1 . cos θ + A v cos P v sin θ

H ox = ^ - - =± and cos P,

A x r cos Px 11 . sin Θ-A y v cos P y v cos θ

H oy — Based on the calculation of step 174, in sin P,

step 176, the data processing circuitry 46 may next calculate the distance between the

magnetic dipole and the magnetometer with In step 178, the data processing circuitry 46 may calculate the magnetometer's z position with

, and in step 180, the data processing circuitry 46 may

calculate the magnetometer's x position with The data processing circuitry 46 may finally calculate the magnetometer's γ position with

y = x tan θ in step 182.

[0138] Based on the above steps 174-182, in step 184, the data processing circuitry 46 may output a relative location report 48 indicating the relative location of the magnetometer 30 to the magnetic dipole 28. Thus, the position of the magnetic dipole

28 in a coordinate system attached to the magnetometer is (-x, -χ, -z) . The

information provided by the report 48 may be employed to steer the BHA 18 to drill a desired configuration. For example, the BHA 18 may be steered by the BHA control / MWD interface 50 such that the BHA 18 drills at an approximately constant distance (e.g., 4-6m) above an existing well containing the magnetometer 30, which may create a SAGD well pair as illustrated in the well-drilling operation 10 of FIG. 1.

[0139] FIG. 22 provides a plot 186 of simulated measurements for a magnetic dipole 28 rotating at an increasing or decreasing frequency. In the example of FIG. 22, M = 100 Amp-m 2 , and the coordinates of the observation point 52 are x = 5 m, y = 2 m, and z = -14 m, with f Q = 2 Hz and /[ = 0.5 Hz/sec. As such, the instantaneous frequency is 2Hz at the beginning of the measurement and 3Hz at the end of the measurement. Because real data will be noisy, random numbers will be used to simulate noise with a standard deviation of O.lnanoTesla. The noise is added to magnetic field components calculated using Equations (13a), (13b), and (13c) and, as in the examples described above, a tilde will be used in the following equations to indicate measured quantities. For example, J ^X^ H J i?^^ ) } , and j i?^^ )! refer

to TV measured signals obtained at times C 1 , ! = 0,..., N -I . The vector r will be suppressed in the notation for measured quantities. It should be noted that the objective is to determine the observation point (r ) with respect to the rotating magnetic dipole located at (0,0,0) . The three unknown quantities are x , y , and z , while the four known quantities are M and the three-axis magnetometer 30 readings.

[0140] In FIG. 22, the plot 186 represents simulated data obtained by the magnetometer 30 that has been least squares fit to sinusoids. An ordinate 188 represents a least squares fitting of the magnetic field components of B in units of nanoTesla, and an abscissa 190 represents time in units of seconds. In the plot 186, a triangle represents a data point of a measurement of the x -component of the magnetic field, I B X (I 1 )} , a diamond represents a data point of a measurement of the y -

component of the magnetic field, j By (C 1 ) ) , and a circle represents a data point of a

measurement of the z -component of the magnetic field, j Bz (C 1 )] ■ The three field

components are simulated as sampled 100 times with a time interval of 0.02 seconds, for a total measurement time of 2 seconds.

[0141] The least squares fitting of FIG. 22 may be determined in two steps. A first least squares fitting may employ Equations (44a), (44b), and (44c) to obtain A x 5 A ,

A z , P x , P χ t P z . f x0 , f xl , f χ0 , f yl , f z0 , and f zl . Next, the frequencies may be

averaged to provide the results f Q = (f + f Q + f Qz ) / 3 = 1.99 Hz and

/ j = (f +/ j + /^) / 3 = 0.5004 Hz/sec. A second least squares fitting may employ

Equations (44a), (44b), and (44c) with all three magnetic field components forced to have the same time dependence with f Q and /j . The parameters, A x ^ A A z , P x ,

P 5 and P 2 may be allowed to float in minimizing X x , χ , and χ z . The resulting

functions A x cos{2π(F Q + J 1 C )t - P x ) , A y cos{2π(F Q + J 1 C)C - P y ) , and

A 2 , cos(2π(7 0 +T 1 C)C-P 2 ) may be fit to the data [B x (C 1 )] ,[B x (C 1 )] and [Bz(C 1 )] , and appear as a dash-dotted line, a dashed line, and a solid line, respectively, in the plot 186 of FIG. 22. [0142] Based on the least squares fitting of FIG. 22, the relative location of the magnetometer 30 to the magnetic dipole 28 may be determined. Equation (33) may be used to compute the angle θ , which gives the direction from the observation point to the z -axis, and where tan# = y I x can be used to eliminate one unknown quantity. The results are thus tan ^ = 0.395 and θ = 0.376 radians. Next, Equations (35) and (36) may respectively be used to obtain H O χ = 1.81 nanoTesla and Hoy = 3.01 nanoTesla, and yields r = 14.93 m with an error Ar = r - r = -0.07 m. Finally, Equation (39) yields z = -13.90 m with an error Az = z - z = 0.10 m, Equation (40) yields x = 4.91 m with an error Ax = x - x = -0.09 m, and Equation (41) yields y = \.9Am with an error Ay = y - y = -0.06 m.

[0143] FIGS. 23 A-C illustrate the error of the above-described techniques used when the magnetic dipole 28 is rotating at an increasing or decreasing frequency for a series of (simulated) magnetometer 30 readings at various distances from the magnetic dipole 28 in the z -direction. In FIGS. 23A-C, measurements are simulated as being taken along the line defined by x = 5 m and / = 2m, with data points every 2 meters along the z direction at the points: z = -30, - 28, - 26, ... ,+28, + 30 m. At the point z=0m, the magnetometer 30 is directly below the magnetic dipole 28 in the (x, y, z) coordinate system. FIGS. 23A-C simulate what may occur when drilling the injector well 12, which contains the rotating magnetic dipole 28, while measuring the magnetic field B using the magnetometer 30 in the producer well 14 at various fixed locations. Each data point in FIGS. 23 A-C corresponds to a solution of the position of the magnetometer 30 using data from a single relative location to the magnetic dipole 28. The inferred position (x, y, z) of the magnetometer 30 relative to the magnetic dipole 28 can be compared to the "true" position (x,y,z) used to initially simulate

the magnetic field B .

[0144] FIG. 23 A represents a plot 194 of an error Ax = x- x , which indicates the difference between the value in the x -direction calculated according to the techniques described with reference to the flowchart 160 of FIG. 21, and the actual value of the x -direction, determined at various points in the z direction. An ordinate 196 represents the error Ax = x - x in units of meters, while an abscissa 198 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 194, the errors are less than 0.5m over the range of z = -20 m to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m. Note that there is no calculation possible at z = 0 m since B z {t) = 0 at this location.

[0145] FIG. 23B similarly represents a plot 200 of an error Ay = y - y , which indicates the difference between the value in the y -direction calculated according to the techniques described with reference to the flowchart 160 of FIG. 21, and the actual value of the y -direction, determined at various points in the z direction. An

ordinate 202 represents the error Ay = y-y m ' units of meters, while an abscissa 204 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 200, the errors are less than 0.5m over the range of z = -20 m to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m.

[0146] FIG. 23 C similarly represents a plot 206 of an error Az = z - z , which indicates the difference between the value in the z -direction calculated according to the techniques described with reference to the flowchart 160 of FIG. 21, and the actual value of the z -direction, determined at various points in the z direction. An ordinate 208 represents the error Az = z - z in units of meters, while an abscissa 210 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 148, the errors are less than 0.5m over the range of z = -20 m to z = +20 m, and generally less than Im over the range of z = -30 m to z = +30 m.

[0147] FIG. 24 provides a plot 212 comparing variations in frequency simulated in the data obtained relating to the plots 194, 200, and 206 of FIGS. 23A-C, respectively. In the plot 212, a first ordinate 214 represents a range of the frequency of rotation of the magnetic dipole 28 in units of Hertz, a second ordinate 216 represents the variation in the frequency of rotation of the magnetic dipole 28 that occurred in each magnetometer 30 reading, and an abscissa 218 represents points in the z -direction in units of meters at which the magnetometer 30 obtained (simulated) measurements. As illustrated in the plot 212 and in view of the plots 194, 200, and 206 of FIGS. 23A-C, variations in frequency may reach beyond +40% and the least squares process may successfully determine the relative location of the magnetometer 30 to the magnetic dipole 28. [0148] The method of the flowchart 160 of FIG. 21 may be modified to include a second order term. The second order term, f 2 , may be incorporated in the definition of the frequency of rotation of the magnetic dipole 28 as follows:

f(t) = f o +f 1 t + f 2 t 2 (45).

[0149] The method of the flowchart 160 may be otherwise unchanged. However, including such higher order terms may particularly benefit from a good signal to noise ratio.

[0150] Under certain circumstances, the rotation of the magnetic dipole 28 may be arbitrary. A more general approach is possible where the measured magnetic field components , j B x (t } ) } , j B x (t } ) } , and j B z (t } ) J , are used directly without fitting

them to sinusoidal or other functions. Note that the three magnetic field components are measured at the same times Jf 7 ] for i = 0, 2, 3, ..., N - 1 . A more general approach may not make assumptions about the time dependence other than that the magnetic dipole rotates and data are obtained over at least one rotation. From Equation (14), the magnetic field in the rotated frame can be written as follows:

Hx(ή = cosθ Bx(ή + sinθ Bχ(ή (46). [0151] The angle of rotation θ should be chosen such that { H x (^ )I is in phase with

[Bz(C 1 )j . The angle θ may be determined by minimizing the following quantity

with respect to the parameters θ and C as follows:

^ = YIc H x ^t 1 ) - B zit, )] = ∑{c[cos0 B x ( tl ) + ύnθ B 7 (C 1 )] - B 2 (C 1 ))

1 ^ ' 1

(47).

[0152] The scaling factor, C , from least squares fitting Equation (47) relates (- " ^) I in an average sense via the following relationship:

H x (C)

(48). Bz(C) ~ C

[0153] Hence, the angle of rotation θ and C may be obtained from the three magnetic field components. The two transverse magnetic field components in the rotated frame may be determined as follows:

H x (C 1 ) cos (9 sin (9 Bx(C 1 )

(49). Hy(C 1 ) -sin θ cos θ By(C 1 ) _

[0154] FIGS. 25-28 illustrate an example in which the magnetic dipole 28 may rotate arbitrarily. In the example of FIGS. 25-28, the magnetic dipole strength is M = 100 Amp-m 2 , the simulated noise is O.lnanoTesla, x = 5 m, j = 2m, and

z = 12 m, and 100 samples are simulated over a 2 second measurement period. To indicate measured quantities, a tilde will be used in the following equations. For example, )} refer to N measured signals obtained at

times t j , i = 0,..., N -1. The three unknown quantities are x , y , and z , while the four known quantities are M and the three-axis magnetometer 30 readings. Based on the following discussion, the unknown quantities may be determined.

[0155] Turning to FIG. 25, a plot 220 represents simulated data obtained by the magnetometer 30 when the magnetic dipole 28 is rotating arbitrarily, M = 100 Ampin 2 , x = 5 m, y = 2 m, and z = 12 m. An ordinate 222 represents a measurement of

the magnetic field components of B in units of nanoTesla, and an abscissa 224 represents time in units of seconds. In the plot 220, a triangle represents a data point of a measurement of the x -component of the magnetic field, j B x (C 1 ) | , a diamond

represents a data point of a measurement of the y -component of the magnetic field,

[B x (C 1 )} , and a circle represents a data point of a measurement of the z -component

of the magnetic field, [Bz(C 1 )} . The magnetometer 30 is assumed to have

simultaneously sampled each magnetic field component every 0.02 seconds for a total measurement time of two seconds, producing 100 data points for each magnetic field component. As apparent in the plot 220 of FIG. 25, there is a significant slowdown of the BHA 18 rotation from 1.5 Hz to 0.7 Hz in 2 seconds, with non-periodic time dependence. [0156] FIG. 26 illustrates a plot 226 of the measured data of FIG. 25 that has been least squares fit such that [c H x (C 1 )} is fit to . An ordinate 228 represents

a least squares fitting of [c H x (C 1 ) J to [Bz(C 1 )j in units of nanoTesla, and an

abscissa 230 represents time in units of seconds. In the plot 226, a triangle represents a data point of a measurement of the rotated and scaled x ' -component of the magnetic field, [c H x (C 1 )] , and a circle represents a data point of a measurement of

the z -component of the magnetic field, [Bz(C 1 )} . The least squares fitting of FIG.

26 may be determined by minimizing χ in Equation (47) to produce θ = 3.515 radians and C = 2.259 . As illustrated in FIG. 26, the two data sets

JC Hx(Y 7 )J and |^^(f i )| now overlay in the rotated frame.

[0157] FIG. 27 illustrates a plot 232 of the rotated magnetic field data, which may be obtained by applying Equation (49) with θ = 3.515 radians. An ordinate 234 represents the magnetic field components in the rotated frame in units of nanoTesla, and an abscissa 236 represents time in units of seconds. In the plot 232, a triangle represents a data point of a measurement of the rotated x ' -component of the magnetic field, [H x (C 1 )J , a diamond represents a data point of a measurement of the rotated

y ' -component of the magnetic field, j Hy(C 1 ) \ , and a circle represents a data point of

a measurement of the z -component of the magnetic field, [Bz(C 1 )} . The rotated

magnetic field component, j H x (C 1 ) I , is in-phase with j Bz (C 1 ) ) . [0158] Once the fields in the rotated frame have been obtained, as illustrated in FIG. 27, it may be possible to calculate the location of the observation point with respect to the arbitrarily rotating magnetic dipole 28. In the prior examples, the amplitudes and phases of the sinusoidal functions were used; in this case, the maximum values for the magnetic field components are used. First, maximum amplitudes of the magnetic field components in the rotated frame of reference may be defined according to the following relationships:

Hxm ≡ max] Hx (t j ) (50a);

Hym ≡ max {|H 7 (f, )|J (50b); and

[0159] For good accuracy, there should be a sufficient density of measurements such that the true peak values are obtained. The distance r may be obtained from the following relationship:

[0160] The z coordinate may be obtained from the following relationship: [0161] As in the techniques described above, the correct signs must be chosen for the result to be reasonable. The x coordinate may be obtained from the following equation:

[0162] The y coordinate may be obtained from the following relationship:

y = x tanθ (54).

[0163] For the data employed by the example illustrated by FIGS. 25-28, Hxm = 2.30nanoTesla, H ym = 4.54 nanoTesla, and Bzm = 5.02 nanoTesla. The results for the observation point are x = 4.89 m, y = 1.92 m, and z = 11.90 m, with errors of Ax = -0.11 m, Ay = -0.08 m, and Az = -0.10 m.

[0164] One advantage of the approach discussed above with reference to Equations (50)-(54) is that no assumption is made regarding the time dependence of the magnetic dipole 28; thus, arbitrary rotation may be accommodated. A disadvantage, however, is that the measurement accuracy may be worse because Equations (51)-(53) rely on a single data point for each magnetic field component. The statistical accuracy for a single datum is poorer than that for a large number of points fit to function. In addition, if the sample density is too small, then the true peak value of the field may not be obtained. [0165] FIG. 28 illustrates a plot 238 illustrating an alternative manner of determining the peak amplitudes of the rotated magnetic field components. The two deficiencies discussed above may be ameliorated by fitting the data to a function of the following form:

F{t) = A + B{T -t) 2 (55),

where A , B , and T are fitting parameters, and the extremum A is obtained at t = T.

[0166] The plot 238 of FIG. 28 illustrates the application of Equation (55) to the data of the plot 232 of FIG. 27. Particularly, an ordinate 240 represents the fitting of the magnetic field maxima and minima in units of nanoTesla, and an abscissa 242 represents time in units of seconds. In the plot 238, a triangle represents a data point of a measurement of the rotated x ' -component of the magnetic field, I Hx(^ )} , a

diamond represents a data point of a measurement of the rotated y ' -component of the

magnetic field, )} , and a circle represents a data point of a measurement of the

z -component of the magnetic field, j Bz (f, ) | • Fittings of the maxima 244 and

minima 246 of the data are illustrated with a solid line. Averaging the peak absolute values for the three magnetic field components yields Hxm = 2.16 ±0.01 nanoTesla, H ym = 4.35 ±0.01 nanoTesla, and Bzm = 4.94 ± 0.04 nanoTesla, where the standard deviations of the individual peaks are also quoted. Using these values in Equations (51) to (54) produces an improvement in the results: x = 5.10 m, y = 2.00 m, and

z = 12.03 m, with errors of Ax = 0.10 m, A j = COOm, and Δz = 0.03 m.

[0167] Other approaches to obtaining the extrema of H M , Hym , and Bzm may be

followed. For example, the magnetic field B measurement data can be least squares fit to polynomials before or after rotation by the angle θ . Another approach is to perform a Fourier transform into the frequency domain, filtering the data in the frequency domain to reduce noise, and then transforming into the time domain. Such an approach may result in smoothed functions from which the extrema may be selected.

[0168] FIG. 29 illustrates a flowchart 248, which describes a general manner of drilling a new well, such as the injector well 12, proximate to an existing well, such as the producer well 14, when the magnetic dipole 28 rotates arbitrarily. The flowchart 248 generally recounts the techniques described above, as modified for use when the magnetometer 30 in the producer well 14 takes measurements when the magnetic dipole 28 is rotating at an arbitrary frequency in the injector well 12, rather than when the magnetic dipole 28 is rotating at a constant, increasing, or decreasing frequency.

[0169] In a first step 250, the three magnetic field components of B from the arbitrarily rotating magnetic dipole 28 may be measured by the magnetometer 30 for a predetermined period of time (e.g., two seconds or one or more periods of rotation of the magnetic dipole 28). Such measurements may be denoted as j B x (C 1 ) | , | By (C 1 ) ) , and | i?.z(£ 7 )| for i = 0, 2, 3,..., N -I . The magnetic field components are represented

in the (x,χ,z) coordinate system defined by the magnetic dipole 28, in which the magnetic dipole 28 rotates around the z -axis in the plane of the x and y axes. The raw magnetometer 30 readings may be received by the data acquisition circuitry 42 before being stored in the database 44 or transmitted to the data processing circuitry 46.

[0170] In step 252, the raw data collected in step 250 may be scaled and fitted such that the rotated magnetic field component, j H x (C 1 ) | , is in-phase with j Bz (C 1 ) | . As

such, in step 252, the data processing circuitry may minimize the quantity with respect to the parameters θ and C ,

2 2 χ 1 = ∑{CH X (C 2 ) - Bz(I 1 )] = ∑{c[cosθ B x (C 1 ) + SmO B x (C 1 )] - Bz(C 1 )] . A

particular example of the least squares fitting of step 252 is discussed above with reference to FIG. 26.

[0171] The rotated frame of reference may be determined in steps 254 and 256. In step 254, the data processing circuitry 46 may obtain the direction γ from the z -axis of the magnetic dipole toward the magnetometer from γ = θ+ n π „ where n = 0, 1 .

It should be noted that θ may be obtained from step 252. In step 256, the data processing circuitry may calculate the two transverse magnetic field components in the rotated frame using the relationship and

using the angle θ .

[0172] In steps 258-266, the data processing circuitry 46 may determine the relative location of the magnetometer 30 to the rotating magnetic dipole 28. In step 258, the data processing circuitry 46 may calculate the magnetic field maximum amplitudes in any manner. For example, the data processing circuitry 46 may determine the

maximum amplitudes from the relationships H xm ≡ max j Hx(f ; ) \ ,

Hγm ≡ ) \\ . Alternatively, the data

processing circuitry 46 may fit the region near each extremum of the measured data to a function of the form F(t ) = A + B(T - 1) 2 and determine the maximum amplitudes from the set of values for A for each magnetic field component in the rotated frame.

[0173] Based on the calculation of step 258, in step 260, the data processing circuitry 46 may next calculate the distance between the magnetic dipole and the magnetometer

with In step 262, the data processing circuitry 46 may calculate the

magnetometer's z position with z and in step 264, the data processing circuitry 46 may calculate the magnetometer's x position with The data processing circuitry 46 may finally calculate the magnetometer's y position with y = x tan θ in step 266.

[0174] Based on the above steps 258-266, in step 268, the data processing circuitry 46 may output a relative location report 48 indicating the relative location of the magnetometer 30 to the magnetic dipole 28. Thus, the position of the magnetic dipole 28 in a coordinate system attached to the magnetometer is {-x, -y, -z) . The information provided by the report 48 may be employed to steer the BHA 18 to drill a desired configuration. For example, the BHA 18 may be steered by the BHA control / MWD interface 50 such that the BHA 18 drills at an approximately constant distance (e.g., 4-6 m) above an existing well containing the magnetometer 30, which may create a SAGD well pair as illustrated in the well-drilling operation 10 of FIG. 1.

[0175] The foregoing analysis has focused on forcing H x (f ) to be in-phase with Bz (t) by choosing the proper rotation angle θ . An alternative approach would be to

force Hγ{t) to be π/2 radians out-of-phase with B z (t) by the proper choice of the rotation angle θ . Both methods are equivalent and based on the same fundamental concept. Based on the least squares fitting of FIG. 26, the relative location of the magnetometer 30 to the magnetic dipole 28. Equation (33) may be used to compute the angle θ , which gives the direction from the observation point to the z -axis, and where tan θ = y I x can be used to eliminate one unknown quantity. The results are thus tan ^ = 0.407 and θ = 0.386radians. Next, Equations (35) and (36) may be used to obtain H O χ = 1.45 nanoTesla, and Hoy = 2.07 nanoTesla, and Equation (38) yields r = 16.90 m with an error Ar = r - r = 0.02 m, where the "true" value for r was obtained from the initial conditions in the calculation. Finally, Equation (39) yields z = -16.03 m with an error Az = z - z = -0.03 m, Equation (40) yields x = 4.99 m with an error Ax = x - x = -0.01 m, and Equation (41) yields y = 2.03 m with an

error Ay = y — y = 0.03 m.

[0100] As described, the entire process may be done without the requirement of human intervention. It can be operated as a closed loop feedback system with human oversight. Various steps in the process, such as computing the corrections and generating the steering correction can of course be done by wellsite personnel in accordance with an exemplary embodiment. However, automated computing may be more efficient. It should be noted that the automated method described above in accordance with an exemplary embodiment may be applied to any pair of wells, and is not limited to SAGD applications. The two wells may be non-parallel in general, and may even be perpendicular. Furthermore, an exemplary embodiment may be used with the magnetometer 30 deployed on a wireline or coiled tubing string, in addition to being mounted in the BHA 18.

[0176] Present embodiments may be more efficient than conventional techniques for magnetic ranging. For example, present embodiments may facilitate efficient determination of the relative location of a magnetometer to a borehole assembly (BHA). Indeed, a rotating magnetic dipole in a BHA may be measured over time from a single remote location. Based on the measurement data from the single remote location, data processing circuitry may determine the remote location. Thus, by refraining from multiple measurement locations, the above-disclosed techniques may conserve rig time. Present embodiments may also facilitate automation of all or a substantial portion of the entire process for determining the position of a BHA from an adjacent well and steering it based on the relative distance to the remote location.

[0177] While only certain features of the invention have been illustrated and described herein, many modifications and changes will occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention..