METHOD AND APPARATUS FOR NUCLEAR MAGNETIC RESONANCE MEASURING WHILE DRILLING

Abstract: A NMR measurement-while-drilling tool has a permanent magnet (12) with a magnetic field direction substantially perpendicular to the axis of the borehole (36), a steel collar (10) of a non-magnetic material surrounding the magnet, antenna (14) positioned outside the collar, and a soft magnetic material positioned in a predetermined relationship with the collar and the magnet that helps to shape the magnetic field of the tool.

Description: METHOD AND APPARATUS FOR NUCLEAR MAGNETIC RESONANCE MEASURING WHILE DRILLING This application claims priority of provisional applications Ser. No. 60/071,612 and Ser. No. 60/071 ,699, both filed January 16, 1998. FIELD OF THE INVENTION This invention relates generally to a method and apparatus for making pulsed nuclear magnetic resonance (NMR) measurements of earth formations while drilling a borehole. More specifically, the invention is directed to a NMR measurement-while-drilling (MWD) tool having the required mechanical strength and measurement sensitivity, .and a method .and apparatus for monitoring the motion ofthe measuring tool in order to take this motion into account when processing NMR signals from the formation surrounding the borehole. BACKGROUND AND SUMMARY OF THE INVENTION Various methods exist for performing downhole measurements of petrophysical parameters in geologic formations. Pulsed NMR logging is among the most important of these methods, and was developed primarily for determining parameters such as formation porosity, fluid composition, the quantity of movable fluid, permeability, and others. Importantly, NMR measurements are environmentally safe and are unaffected by variations in the matrix mineralogy. In a typical NMR measurement, a logging tool (measurement device) is lowered into a drilled borehole to measure properties ofthe geologic formation near the tool. Then, the tool is extracted at a known rate while continuously taking and recording measurements. At the end ofthe experiment, a log is generated showing the properties ofthe geologic formation along the length ofthe borehole. This invention relates primarily to an alternative measurement, in which pulsed NMR logging can be done while the borehole is being drilled. The advantages ofthe latter approach in terms of saving both time and costs are apparent. Yet, very little has been done so far in terms of developing practical NMR logging-while-drilling (LWD) or measurements-while-drilling (MWD) solutions. Two of the main stumbling blocks appear to be the very stringent requirements concerning the mechanical strength ofthe device, as well as problems associated with inaccuracies ofthe received signals due to motions ofthe tool. The present invention addresses successfully both issues and therefore is believed to make a significant contribution over the prior art. In order to more fully appreciate the issues discussed in detail next, a brief overview of NMR methods for measuring characteristics of formations surrounding a borehole is presented first. The interested reader is directed, for example, to the following article: Bill Kenyon et al., Nuclear Magnetic Resonance Imaging — Technology for the 21st Century, OILFIELD REV., Autumn 1995, at 19, for a more comprehensive review. The Kenyon article is incorporated herein by reference. Basically, in the field of NMR measurements of earth formations surrounding a borehole, a downhole static magnetic field is used to align the magnetic moment of spinning hydrogen (H) protons in the formation in a first direction, the direction ofthe static magnetic field. In order to establish thermal equilibrium, the hydrogen protons must be exposed to the polarizing field for a multiple ofthe characteristic relaxation time, T,. Then, the magnetic component of a radio frequency (RF) electromagnetic wave pulse, which is polarized in a second direction orthogonal to the static field, is used to tip the protons to align them in a third direction that is orthogonal to both the first and the second direction. This initial RF pulse is thus called a 90° pulse. Following the 90° pulse the protons in the formation begin to precess about the axis ofthe first direction. As a result, the protons produce an oscillating magnetic field. If an antenna is placed into the oscillating magnetic field, the oscillating magnetic field will produce an oscillating electric current in the antenna. Because the amplitude ofthe induced electrical signal is proportional to the porosity ofthe e.arth formation being measured, the signal may be calibrated to measure formation porosity. However, due to dephasing and irreversible molecular processes, the induced signal decays rapidly after the RF pulse is removed. Consequently, when the antenna is used both to transmit the RF pulses and to receive the induced NMR signal as in one embodiment of this invention, this first NMR signal may not be observable because the antenna electronics are still saturated from residual effects ofthe 90° RF pulse. Therefore, the NMR signal must be rebuilt as a spin echo, as discussed below, so that it may be measured. Additionally, the behavioral characteristics ofthe protons after removal ofthe RF pulse can be used to garner information about other formation properties, such as pore size distribution and permeability. Immediately after the 90° RF pulse is turned off, the protons precess in phase. However, due to inhomogeneities in the static magnetic field and irreversible molecular processes, the protons begin to dephase, which causes the induced signal to decay. Nevertheless, the dephasing due to inhomogeneities in the static magnetic field is partially reversible. Therefore, by applying a 180° RF pulse, the instantaneous phases are reversed such that the protons gradually come back into phase, thus rebuilding the induced signal. The antenna can detect this signal because the time required for rebuilding the signal is long enough to allow the antenna electronics to recover from the 180° RF pulse. After the signal peaks at the time when the protons are back in phase, the signal will then begin to decay due to dephasing in the opposite direction. Thus, another 180° RF pulse is needed to again reverse the instantaneous phases and thereby rebuild the signal. By repeating a series of 180° RF pulses, the signal is periodically rebuilt after each dephasing, although each rebuilding is to a slightly lesser peak amplitude due to the irreversible molecular processes. Eventually, the irreversible processes prevail such that no further rephasing is possible and the signal dies out completely. Each rebuilding ofthe signal in this manner is called a spin echo, and the time constant associated with the decay ofthe spin echo amplitudes is called the transverse relaxation time, T 2 . Because experiments have shown that T 2 is proportional to the pore size ofthe formation, calibration and decomposition of T 2 yields a measure ofthe formation's pore size distribution. Moreover, when combined with the porosity measurement, T 2 yields an estimate ofthe formation's permeability. As noted above, the NMR signal may also be calibrated to obtain other formation characteristics, such as free fluid volume, bound fluid volume, fluid identification, and diffusion coefficients. Because the drilling mode of operation using a preferred embodiment of this invention may allow for enough time to develop only one spin echo, or at most a few spin echos, the apparatus may achieve only porosity and limited T 2 measurements while drilling. However, the other types of NMR measurements discussed above are possible in non-drilling modes of operation, such as stationary tool, sliding or wiping tool. From the preceding discussion it should be apparent that in order to enable accurate NMR measurements it is important that the same protons be tipped and rephased for each successive spin echo. Excessive movement ofthe tool in the borehole during NMR measurement can destroy the accuracy ofthe measurement by changing the location ofthe measurement volume, i.e., which protons in the formation are affected by the interaction of the static .and RF pulse magnetic fields. Therefore, if the motion ofthe tool during NMR measurement is not known, which generally is the case in a logging-while-drilling environment, the NMR measurement may not be reliable. The present inventors know of three issued patents directed to practical NMR measurements while drilling: U.S. Patent No. 5,705,927 issued Jan. 6, 1998, to Sezginer et al.; U.S. Patent No. 5,557,201 issued Sept. 17, 1996, to Kleinberg et al.; and U.S. Patent No. 5,280,243 issued Jan. 18, 1994, to Miller. Of these references, the '201 patent more specifically shows how to improve the tool's susceptibility to lateral tool motion by increasing the radial dimension ofthe measurement volume. However, the axial length of the sensitive zone (i.e., the measurement volume) ofthe '201 patent is on the order of two to four inches, whereas that ofthe present invention is on the order of two feet. Thus, the susceptibility ofthe present invention to axial tool movement is greatly improved over the prior art. Indeed, for typical drilling rates, axial movement ofthe present NMR tool has a negligible impact on the quality ofthe NMR measurement. Importantly, none ofthe three patents recited above discloses any means to monitor the tool motion to assure a drilling operator that the NMR measurements are accurate. One method of dealing with the motion ofthe NMR tool in accordance with the present invention is to monitor the tool motion during NMR measurement and discard the measurement if the tool motion is above maximum acceptable limits. For example, in a preferred embodiment of this invention, testing has shown that the lateral velocity ofthe tool must be less than or equal to about 0.2 m/s to preserve the integrity ofthe NMR measurement. Accordingly, an important aspect ofthe present invention is the disclosure of a method for monitoring the tool motion by using two pairs of accelerometers located at the ends of two coplanar, orthogonal drill collar diameters. The accelerometers are used to measure the lateral acceleration ofthe tool, and the acceleration is integrated once to obtain the velocity and twice to obtain the displacement. Although U.S. Patent No. 4,958,125, issued Sept. 18, 1990, to Jardine et al, discloses a similar method and apparatus for determining characteristics ofthe movement of a rotating drill string, the method for determining lateral acceleration in the '125 patent is directed to a vertical drill string orientation. Referring to Figure 8, four accelerometers oriented such that acl and ac2 are on one axis and ac3 and ac4 are on an orthogonal axis, both orthogonal to the general axis of rotation, the '125 patent sets forth the following equations of motion: acl = ac + ax cos d ac2 = ac - ax cos d Eqs. [1] ac3 = ac + ax sin d ac4 = ac - ax sin d where ac is the centripetal acceleration, ax is the lateral acceleration, and d is the angle between the acl/ac2 axis and the lateral acceleration vector. From Eqs. [1], the '125 patent derives the following expressions for the rotation speed, S, and lateral acceleration, ax: S = [60 / 2π] * [(acl + ac2) / (2r)]' /2 Eq. [2] ax = { [(ac 1 - ac2) / (2)] 2 + [(ac3 - ac4) / (2)] 2 } v ' Eq. [3] The direction ofthe lateral acceleration is determined by the following expression: tan d = (ac3 - ac4) / (acl - ac2) Eq. [4] However, Eqs. [1] do not contain any gravitational acceleration terms. Thus, Eqs. [1] correctly describe the tool motion only if the tool is oriented vertically such that the lateral component ofthe gravitational acceleration is zero. To describe the tool motion accurately if the tool is in some general, inclined orientation, the equations of motion must include the gravitational acceleration terms as follows: acl = ac + ax cos d + g sin α cos e ac2 = ac - ax cos d - g sin a cos e Eqs. [5] ac3 = ac + ax sin d - g sin α sin e ac4 = ac - ax sin d + g sin α sin e where g is the earth's gravitational constant (9.81 m/s 2 ), a is the inclination angle ofthe tool axis with respect to the vertical (as shown in Figure 7), and e is the angle between the al/a2 axis and the g sin direction (as shown in Figure 8). As noted in the '125 patent, Eq. [2] still holds true for a general orientation because of fortuitous plus and minus signs on the gravitational acceleration terms. However, neither Eq. [3] nor Eq. [4] holds true for a general orientation. Thus, for a general orientation, another method is needed to determine the magnitude and direction ofthe lateral acceleration, ax. In a specific embodiment, the present invention solves this complication caused by the presence ofthe gravitational acceleration terms in a general, inclined drill string orientation by incoφorating a high-pass filter to eliminate those terms. This solution is possible because the rotational frequencies of typical drilling speeds are well below the frequencies ofthe lateral accelerations of interest. Thus, the gravitational acceleration terms, which vary periodically at the frequency ofthe drill string rotation speed, can be safely eliminated without corrupting the lateral acceleration signals. After filtering in this manner, the governing equations of motion revert back to Eqs. [1], and Eqs. [3] and [4] may be used to determine the magnitude and direction ofthe lateral acceleration. Then, the lateral velocity and lateral displacement may be obtained by integrating the lateral acceleration once and twice, respectively. By comparing the measured motion to the allowable motion criterion, it is possible to modify the NMR measurement to optimally suit a given drilling environment. Based on information from the motion sensors and based on parameters set by the operator before the tool was deployed, in accordance with the present invention the tool enters one ofthe following operating modes: (a) Shutdown. This mode is selected anytime the tool detects the presence of metallic casing and/or is on the surface, or detects motion phenomena that make NMR measurements impossible. (b) Wireline emulation. When no motion is detected, the tool attempts to emulate NMR measurements as typically done by wireline NMR tools. (c) Normal drilling. During normal drilling conditions, moderate lateral motion is present, which allows for abbreviated NMR measurements. (d) Whirling. During whirling, lateral motion is violent, but short time windows exist during which the lateral velocity drops to a point, where a porosity-only measurement is possible. The tool identifies these windows and synchronizes the NMR measurement appropriately. (e) Stick-slip. In this drilling mode, windows exist in which short NMR measurements are possible, interspersed with periods of very high lateral/rotational motion. Again, the tool identifies these windows and synchronizes the NMR measurement appropriately. The motion management aspect of this invention provides an algorithm to predict desirable time windows in which to m-ake valid NMR measurements. As seen in Figure 9, experiments have identified three distinct types of tool motion: (1) normal drilling; (2) whirling; and (3) stick-slip. These three types of motion .are identifiable based on the time histories ofthe rotation speed, lateral velocity, and lateral displacement ofthe tool. In normal drilling motion, the lateral velocity ofthe tool is typically within acceptable limits so that valid NMR measurements may be made at almost any time. Sample plots of typical tool motion during normal drilling are shown in Figures 10A(l)-(6) and 10B(l)-(6). In whirling motion, the lateral velocities are usually outside acceptable limits, which makes valid NMR measurements difficult to obtain. However, as shown in Figure 9, by monitoring the velocity, acceleration, and time duration in which the velocity remains within certain prescribed limits, it is possible to predict acceptable NMR measurement periods during whirling. S-ample plots of typical tool motion during whirling are shown in Figures 13A(l)-(6) .and 13B(l)-(6). In stick-slip motion, the drill bit periodically sticks to the borehole wall and then slips away, causing the drill string to periodically torque up and then spin free. Sample plots of typical tool motion during stick-slip are shown in Figures 1 lA(l)-(6); 1 lB(l)-(6); 12A(l)-(6) and 12B(l)-(6). During the stick phase, the tool is virtually stationary thus providing a good time window in which to make NMR measurements. In contrast, the lateral velocity during the slip phase may be outside acceptable limits, depending on such variables as bit type, formation strength, and stiffness and length ofthe drill string. By analyzing the time histories in this manner, acceptable time windows may be predicted in which to make valid NMR measurements. The motion identification aspect of this invention also provides another benefit with regard to drilling tool damage reduction and service life enhancement. Because whirling and stick-slip motion can be damaging to drilling tools, this invention's capability of identifying these types of motion is very useful to a drilling operator. Specifically, if the operator knows that the drill collar is undergoing whirling or stick-slip motion, the operator can make appropriate changes to the weight-on-bit and rotation speed parameters and thereby change the motion to approach normal drilling as much as possible. As a result, tool damage is reduced and service life is enhanced. Alternatively, this invention also incorporates a method for measurement ofthe tool motion by means of acoustic sensors. In this alternative, at least two acoustic sensors are placed on the perimeter ofthe drill collar. If only two acoustic sensors are used, they are preferably placed on orthogonal diameters (i.e., spaced 90° apart). These acoustic sensors detect the distance from the tool to the borehole wall and thus directly measure the lateral displacement ofthe tool in the borehole. Because the sampling rate ofthe acoustic sensors is much greater than typical drill string rotation speeds, the rotation is negligible with respect to the displacement calculation. In turn, the displacement may be differentiated once to obtain the velocity and twice to obtain the acceleration. Again, by comparing the measured tool motion to the allowable motion criterion, the corresponding NMR measurement may be appropriately retained or discarded. This quality control check may be accomplished using either displacement or velocity data, because the displacement criterion is over a known time span (i.e., the time between the 90° pulse and the signal acquisition window). Alternatively, when combined with an inclinometer or magnetometer measurement from which the drill collar rotation speed may be obtained (as described in U.S. Pat. No. 4,665,511 issued May 12, 1987, to Rodney and Birchak), the time histories of the motion may be used in conjunction with the prediction algorithm discussed above to predict acceptable NMR measurement windows. The same approach could also be used with contact sensors (as described in U.S. Pat. No. 5,501,285 issued Mar. 26, 1996, to Lamine and Langeveld) instead of acoustic sensors to measure the tool displacement by measuring the change in resistance through the drilling mud. Another alternative for the motion management aspect of this invention is to correct the NMR measurement for losses in the NMR signal due to lateral motion during measurement. That is, by measuring the lateral displacement ofthe tool during NMR measurement as described above, the change in the sensitive volume can be calculated, which in turn allows the calculation of an appropriate correction factor to be applied to the received NMR signal to compensate for tool movement. This correction may be accomplished by using displacement information derived from any ofthe three sensor types discussed above (accelerometers, acoustic sensors, or contact sensors). An advantageous embodiment ofthe acoustic sensor form of this invention meets a tool position error specification of about 5%, which allows correction of the NMR signal to within about 95% ofthe signal for a stationary tool. Therefore, rather than discard an NMR measurement taken during a period of what would otherwise be excessive lateral motion, the NMR signal can be corrected to compensate for the tool motion. Another aspect ofthe motion-detection problem of this invention is the operation of phase-alternated signal averaging, which is typical for NMR data acquisition and which is further described below. The salient feature of phase alternation is the coherent accumulation of NMR data, coupled with the progressive suppression of non-NMR artifacts. A large contribution to the latter comes from magneto-acoustic oscillations ("ringing") within the ferrous material as well as pulse-induced vibrations in current- carrying conductors (also customarily termed "ringing"). The pair-wise subtraction process relies on the fact that these artifacts are more or less repeatable, given the same excitation through a series of 180° RF pulses. It has been determined by experimentation that the patterns of these artifacts tend to change cyclically with the tool's orientation and bending. This invention provides for a means to accommodate ringing pattern changes and the effects of partial de-coupling ofthe magnet and antenna by taking advantage ofthe fact that the generally cyclical and repetitive nature ofthe drilling process is the source ofthe dynamic geometry changes. Practically all drilling involves rotation of a drill bit. Rotation is provided by bulk rotation ofthe entire drill string, use of a mud motor, or by a combination of both. As an example, the bit center orbit plots 10B3, 11B3, 12B3 and 13B3 show that the position ofthe bit is very repetitive and essentially duplicated with each revolution for drilling modes other than whirling. By measuring one ofthe many manifestations of this rotation, including oscillations ofthe on-rotating section, the NMR measurement can be repeatedly synchronized to a particular and repeatable geometry. Magnetic and gravity tool face angles are among the most available means for tracking tool orientation on a rotating or oscillating drill string. Bending stress, position derived from integration of acceleration data, sonic sensors or contact sensors are other examples of sensors suitable for synchronization ofthe NMR measurement. In an important aspect, this invention also provides a permanent magnet, preferably having tubular construction, which produces a static magnetic field that is oriented in a substantially orthogonal direction of both the axis ofthe borehole and the drilling device, and that diminishes in magnitude by about the square ofthe distance from the magnet. Over the relatively thin sensitive volume (1.5 mm thickness) the radial field gradient is essentially constant. As shown in Figure 6B, the magnetic field is that of a linear dipole with a field direction that depends on the azimuthal direction ofthe tool. Although some prior NMR tools have used magnets having a linear dipole magnetic field (such as that disclosed in U.S. Patent No. 4,710,713), those tools did not comprise a tubular magnet through which drilling mud may be pumped nor are these magnets meant to be rotated. Additionally, although the Kleinberg et al. '201 patent discussed above comprises tubular magnets, the magnetic field produced is not a linear dipole. The tubular construction used in accordance with the present invention provides a central cavity through which drilling mud may be pumped to enable NMR measurement while drilling. Also, the magnetic field produced by the magnet has an essentially constant gradient within the measurement volume which, when combined with an RF pulse that is tuned to the proper frequency, produces a more uniform annular sensitive region (measurement volume) that is completely within the earth formation. Another aspect ofthe present invention is the use of a magnet that is comprised of multiple segments. Thus, in accordance with the present invention it is possible to tailor the resultant field by tuning the contributions from the individual segments. Such tuning may be accomplished by (a) selective demagnetization, which is possible for the SmCo5 variant of samarium-cobalt material, by (b) adjusting the volume for each segment, or (c) by adjusting the polarization direction of each individual segment. Such freedom in field shaping is advantageous if it is necessary, as in the present invention, to pre-compensate the magnetic field in order to accommodate the effects of soft-magnetic material in the vicinity ofthe magnet. It may not be obvious even to a person skilled in the art that the magnetic field from a linear dipole is suitable for measurements while drilling, where the magnet is rotated with respect to the formation at rates up to about 300 RPM. Any given point within the sensitive volume 36 in Figure 6B experiences a magnetic field of approximately constant magnitude, but that rotates synchronously with the drill collar. It may appear that for hydrogen nuclei with longitudinal relaxation times T, of several seconds, these spins would not align themselves properly with a rotating field that completes a rotation in much less time than it takes for polarization. However, the relaxation time T, only governs the build-up ofthe magnitude ofthe nuclear polarization. A change in direction can be followed much faster and depends on the resonant Larmor frequency ofthe nucleus. At a typical field strength of 117 gauss, the resonance frequency is 500 kHz. The condition for Adiabatic Fast Passage (AFP), under which the nuclear polarization follows a change in direction ofthe polarizing field virtually instantaneously, is that the rate of change must be much less than the period ofthe Larmor frequency. Comparing 500 kHz with a maximum rotational frequency of 5/sec, we find a ratio of 100,000: 1 , which satisfies the requirement for an AFP condition by a wide margin. Consequently, although using a rotating drill collar which causes all fields within the formation to constantly change direction, the hydrogen nuclei always follow the changing directions without noticeable delay. As is known in the art of NMR measurement, the frequency ofthe RF pulse must be tuned to the Larmor frequency (f L ) (in Hertz) ofthe hydrogen protons, which is given by the following equation: f L = 4258 B 0 Eq. [6] where B 0 is the magnitude ofthe static magnetic field (in Gauss). Because the static magnetic field of this invention decreases monotonically as a function of radial distance from the tool, the location ofthe sensitive zone may be selected by choosing a value of B 0 that coincides with the desired radial distance from the tool. In this manner, the sensitive zone can be fixed entirely within the earth formation to be measured, instead of partially in the borehole. As described in U.S. Patent No. 4,350,955, issued Sept. 21, 1982, to Jackson and Cooper, if the sensitive zone is partially in the borehole, that situation presents a serious drawback to the system in that the NMR signal from the borehole fluid overwhelms the signal from the earth formation. Prior art systems have attempted to solve this problem by doping the borehole fluid with chemicals (as described in the '955 patent), which was time consuming and expensive, or by utilizing a gradient coil to produce an additional pulsed magnetic field to cancel the borehole signal (as described in the '201 patent), which further complicated the system. Therefore, the capability ofthe present invention to fix the sensitive zone completely within the earth formation without any additional apparatus constitutes a valuable improvement over most ofthe prior art. Moreover, the static magnetic field of this invention as a function of radial distance from the tool is such that the location ofthe Larmor frequency for the sodium (Na) quadrupole moment lies inside the tool volume, as shown in Figure 23. The gyromagnetic ratio of sodium is 1127 Hertz/gauss. To resonate at the same Larmor frequency, sodium requires approximately four times the field strength, a condition that is met at a diameter of about one-half of the sensitive diameter of hydrogen. The hydrogen diameter of 13.5 inches has been chosen to contain the potential sensitive volume for sodium with a diameter of 6.75 inches entirely within the tool. Therefore, this invention has the added advantage that it is not sensitive to sodium in the borehole fluid. It should be obvious to someone skilled in the art to scale the resonance diameters appropriately for tools used in different-sized boreholes. The above-described advantage with respect to the completely-in-formation sensitive zone is made possible by combining the constant gradient tubular magnet with a nonmagnetic metal drill collar, an axially elongated antenna, high electrical conductivity shielding for the antenna, and a ferrite buffer. Although other practitioners in the art were ofthe opinion that this invention would not work with a metal drill collar, the inventors have demonstrated the contrary. A metal drill collar is desirable to increase the tool's strength .and durability in the harsh downhole environment of high temperatures, pressures, and abrasive fluids and particles and corrosive fluids. The antenna of this invention, which is used both to transmit the RF pulses and to receive the NMR signals, is located on the outside ofthe drill collar and, along with the magnet, has a relatively long axial dimension to produce a sensitive volume having a large axial dimension, as described above. In one embodiment, a shield made of high conductivity material (such as copper) is placed between the outer surface ofthe metal drill collar and the antenna to reduce acoustic ringing ofthe metal drill collar due to the RF pulses and to increase the efficiency ofthe antenna during the transmission ofthe RF pulses. The shield is thin enough to attenuate surface acoustic waves in the shield, yet it is fixed to the collar firmly enough to prevent bulk vibration ofthe shield. Further, the shield is acoustically isolated from the collar to prevent surface acoustic waves in the shield. These acoustic and vibration characteristics are enabled by bonding the shield to the collar with a thin layer of material having the desired acoustical properties, such as rubber or lead-filled epoxy. In another embodiment, the outer surface ofthe drill is made highly conductive, so that there is no need for a separate shield. Further, in accordance with this invention, a layer of ferrite material is placed between the antenna and the shielding to direct the pulsed RF magnetic fields into the formation and to further increase the efficiency ofthe .antenna so that it requires less power in the transmission mode and has increased sensitivity in the receive mode. Preferably, the ferrite material is layered such that a more or less continuous path through the ferrite material exists along the magnetic field lines ofthe RF field, but repeated discontinuities .are introduced in the transversal direction to the RF magnetic field lines. These features in combination enable the placement ofthe sensitive zone far enough away from the tool to be completely in the formation yet still allow accurate sensing ofthe NMR signal by the antenna. Yet another aspect of this invention involves a high-current, low-impedance feed- through connector to connect the antenna to the antenna's tuning capacitors. As in the prior art, tuning capacitors are utilized in the antenna electronics (driving circuitry) to match the impedance ofthe antenna so that the antenna will resonate at the desired frequency. However, the capacitors are sensitive items and require protection from the high pressures .and temperatures ofthe borehole environment. Before the invention described in U.S. Pat. No. 5,557,201, this problem was solved by selecting capacitors with minimal pressure and temperature sensitivities and isolating the capacitors from the borehole fluids in an oil-filled compartment ofthe drill collar. The compartment seal separated the compartment from the borehole fluids, but the seal did not form a pressure seal and therefore the compartment saw the ambient borehole pressure. Consequently, the compartment was filled with oil to transmit the ambient pressure uniformly around the capacitors and thereby prevent them from being crushed by the high differential pressure. Moreover, because the oil expands and contracts with changing temperature and pressure, these prior art devices had to include a means of varying the volume ofthe compartment to compensate for the temperature and pressure changes. Thus, such a scheme was very cumbersome. The '201 invention solved this problem by housing the .antenna driving circuitry in a compartment that is not only sealed off from the borehole fluids but is also sealed off at constant atmospheric pressure. Thus, the compartment is simply filled with air instead of oil, and there is no need for a volume-regulation device. This method of protecting the capacitors makes the manufacturing ofthe tool much simpler and less costly. However, because the pressure in the vicinity ofthe antenna is much higher than the pressure in the capacitor compartment, the apparatus for feeding the antenna into the capacitor compartment must withstand a severe pressure differential. With such a high pressure differential, one would desire to minimize the area ofthe feed-through apparatus to minimize the force acting on it. On the other hand, because this NMR measurement- while- drilling (MWD) tool requires a very high current in the .antenna, the area ofthe feed-through apparatus must be large enough to accommodate a conductor of sufficient size to meet the high current requirement. Additionally, the feed-through area must be large enough to supply a sufficient gap between the two antenna wires as well as to any surrounding metallic material. This invention solves the problem posed by these conflicting area requirements by providing a conductor with a corrugated-shape cross-section for the feed-through connector. The corrugated shape ofthe conductor provides sufficient size to carry the high current, yet the conductor requires much less feed-through area for the connector than that which would be required for a conventional, flat cross-section conductor. Thus, this corrugated design minimizes the force on the feed-through connector while still accommodating the necessary current. Moreover, the corrugated design improves the bond between the conductor and the surrounding connector material by providing more bonding area. The connector maintains a stripline interface, thereby minimizing stray magnetic fields and electromagnetic losses. Yet another aspect of this invention involves a method of mounting the electronics in the outer portion ofthe drill collar in such a way as to minimize the drill collar stresses that are transferred to the electronics. In the borehole, the drill collar is frequently subjected to bending stresses, axial stresses, and torsional stresses. Thus, while one side is in compression, the other side is in tension, and the highest stresses are in the outer portion of the drill collar. Because the drill collar rotates during drilling, the drill collar undergoes many cycles of tensile and compressive stresses. Therefore, any structure that is fixedly mounted to the drill collar will be subjected to similar strains as the collar material undergoes at the mounting surface, and the strains will be highest in the outer portion ofthe drill collar. Hence, the outer portion ofthe collar would seem to be an undesirable location to mount the delicate electronics. This invention allows the installation ofthe electronics in the outer portion ofthe drill collar by means of a mounting scheme wherein the stresses ofthe drill collar are not appreciably transferred to the electronics. Specifically, one ofthe two ends ofthe electronics module is fixedly mounted to the drill collar, but the second end is mounted to the collar with a sliding connection. Thus, as the drill collar bends, elongates, and otherwise develops stresses, the second end ofthe electronics module slides relative to the drill collar and therefore the electronics module remains relatively free ofthe drill collar stresses. By virtually eliminating the transferred stresses, this invention allows the installation ofthe electronics in the outer portion ofthe drill collar and greatly reduces the potential strain and fatigue problems, such as broken printed circuit board traces and broken leads on components due to over-stress. Finally, the NMR MWD tool embodying this invention requires very high downhole power within a very short time period. Specifically, it requires about 1.5 kilowatts during the short duration of an NMR measurement, but only a few watts between measurements For example, a typical load change would be 1 kW for 10 msec, 50 W for three seconds, 1 kW for 10 msec, and so on. Before this invention, existing downhole power generators were not directed to meeting these kind of fluctuating power requirements. Therefore, the apparatus embodying this invention includes a high power generator to meet the need. Accordingly, it is an object of this invention to provide an improved apparatus and method for performing a full range of NMR measurements on formations surrounding the borehole in particular while drilling that address the above issues and overcome deficiencies associated with the prior art. BRIEF DESCRIPTION OF THE DRAWINGS This invention may best be understood by reference to the following drawings, in which like reference numerals designate like elements: Figure 1 is a schematic axial cross-sectional view of an apparatus constituting a preferred embodiment ofthe apparatus of this invention. Figures 2, 3, 4 and 4B are diametrical cross-sectional views ofthe apparatus shown in Figure 1 respectively on planes 2-2, 3-3 and 4-4. Figures 4A, 4C and 4D illustrate bonding layers used in accordance with the present invention. Figure 5 is a schematic perspective view showing the configuration ofthe antenna for the apparatus illustrated in Figure 1. Figure 6A is a schematic sectional view showing the sensitive volume produced by the apparatus of Figure 1. Figure 6B is a schematic sectional view similar to Figure 6A but showing the magnetic flux lines produced by the apparatus of Figure 1. Figure 7 is a schematic elevational view showing the gravitational acceleration of the apparatus of Figure 1 when said apparatus is inclined with respect to the vertical. Figure 8 is a schematic cross-sectional view showing a preferred embodiment for the arrangement ofthe accelerometers in the apparatus of Figure 1. Figure 9 is an algorithm block-diagram ofthe motion management method used in accordance with a preferred embodiment ofthe present invention. Figures 10A(l)-(6), 10B(l)-(6), HA(l)-(6), HB(l)-(6), 12A(l)-(6), 12B(l)-(6), 13A(l)-(6) .and 13B(l)-(6) show plots ofthe lateral motion ofthe apparatus of Figure 1 in different motion regimes. Figure 14 shows various stages ofthe change in sensitive volume for the apparatus ofthe present invention, which are due to lateral motion. Figures 15 and 16 show how the change in sensitive volume may be calculated in accordance with a preferred embodiment ofthe present invention. Figure 17 shows a plot ofthe sensitive volume as a function of lateral displacement. Figures 18 and 18A represent schematic cross-sectional views showing alternate embodiments of feed-through connectors. Figure 19 is an enlarged axial cross-sectional view of a portion ofthe apparatus of Figure 1 showing the magnet assembly and feed-through connector. Figure 20 is a schematic elevational view of an electronics compartment. Figure 21 is a schematic sectional view showing the assembly ofthe reduced-stress electronics mounting apparatus in the drill collar. Figure 22 contains two schematic cross-sectional views ofthe permanent magnet magnetized uniformly and nonuniformly. Figure 23 is a graph showing the static magnetic field versus radial distance from the tool for the apparatus ofthe present invention. Figure 24 is a schematic axial cross-sectional view ofthe power generator used in a preferred embodiment ofthe present invention. Figure 25 is a schematic cross-sectional view ofthe fixed and movable magnets of the power generator. Figure 26 is a schematic cross-sectional view taken on the plane F26-F26 as shown in Figure 24. Figure 27 is a schematic elevational view ofthe stop pin and cooperating structure. Figures 28 A and 28B are schematic views showing the relative positions ofthe fixed and movable magnets ofthe power generator. Figures 29 through 32 are schematic axial cross-sectional views of an apparatus constituting .an alternative advantageous embodiment of this invention. Figure 33 is a block diagram ofthe tool electronics. Figures 33(a) and 33(b) are timing diagrams for two versions of Carr-Purcell- Meiboom-Gill pulse-echo sequences used for NMR measurements in accordance with a preferred embodiment of this invention. Figure 34 is a timing diagram for a single-echo CPMG sequence incoφorating phase alternation. Figure 35 is a schematical sketch ofthe echo amplitudes obtained from a phase- alternated pair, in a stationary tool (a), and during lateral motion (b). Figure 36 shows the NMR data acquisition algorithm used by the signal processor of Figure 33. Figure 37 is a schematic cross-sectional view depicting two positions of an apparatus shown in any of Figures 29 through 32. Figure 38 is a graph showing the sinusoidal variation ofthe electrical signal generated by either the magnetometer or inclinometer, as appropriate, in an apparatus shown in any of Figures 29 through 32. Figure 39 is a schematic cross-sectional diagram showing a rotating coordinate system (x',y') -and a fixed coordinate system (x,y) for the apparatus of Figure 1. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In the following description ofthe preferred embodiments Section A focuses on the components ofthe NMR measurement tool in accordance with a preferred embodiment of this invention, Section B provides a brief description ofthe preferred embodiment for the NMR measurement method ofthe present invention using motion management to compensate for tool motions during NMR logging operations. (A) The NMR Tool There are two versions of modern pulse-NMR logging tools in use today: the centralized MRIL® tool made by NUMAR Coφoration, and the side-wall CMR tool made by Schlumberger. The MRIL® tool is described, for example, in U.S. Pat. 4,710,713 to Taicher et al. and in various other publications including: "Spin Echo Magnetic Resonance Logging: Porosity .and Free Fluid Index Determination," by Miller et al., SPE 20561, 65th Annual Technical Conference ofthe SPE, New Orleans, LA, Sept. 23-26, 1990; "Improved Log Quality With a Dual-Frequency Pulsed NMR Tool," by Chandler et al., SPE 28365, 69th Annual Technical Conference ofthe SPE, New Orleans, LA, Sept. 25-28, 1994). Details ofthe structure, the operation and the use ofthe MRIL® tool are also discussed in U.S. patents 4,717,876; 4,717,877; 4,717,878; 5,212,447; 5,280,243; 5,309,098; 5,412,320; 5,517,115; 5,557,200 and 5,696,448 all of which are commonly owned by the assignee of the present invention. The Schlumberger CMR tool is described, for example, in U.S. Pats. 5,055,787 and 5,055,788 to Kleinberg et al. and further in "Novel NMR Apparatus for Investigating an External Sample," by Kleinberg, Sezginer and Griffin, J. Magn. Reson. 97, 466-485, 1992. The interested reader is directed to the disclosure of these patents for relevant background information. Accordingly, the patents listed above are hereby incoφorated for all puφoses. Referring to Figure 1 , it illustrates an improved NMR MWD tool 40 used and operated in accordance with a preferred embodiment ofthe present invention. NMR tool 40 comprises a nonmagnetic metal drill collar 10 that encloses a tubular, permanent magnet 12, which surrounds a mud tube 34 through which drilling mud may be pumped during the 5 drilling of a borehole 36 into the earth formation 138. The tool 40 further comprises a stabilizer section 66, antenna 14, magnet section 12, capacitor compartment 32 with tuning capacitors 42, accelerometers 24, antenna driver 28, signal processor 30 and data transmitter 150. Some of these components are known in the art and have been described generally, for example, in the prior art publications discussed in the preceding section, which are 10 incoφorated by reference. In the sequel, various improvements to these components ofthe tool and their functions are described in more detail in accordance with the preferred embodiments ofthe present invention . (1) The Magnet 1 In accordance with the present invention, the magnet 12 of NMR tool 40 is polarized such that a static magnetic field B 0 illustrated in further detail in Figure 6B, is produced in the earth formation 138 that is substantially transversally oriented with respect to the longitudinal axis 5 ofthe tool. As shown in Figure 6B, the magnetic field ofthe tool in accordance with the present invention can be modeled as that of a linear dipole. The magnet 20 12 is preferably fabricated from highly stable rare-earth material combinations, such as samarium-cobalt or neodymium-iron-boron. Custom-shaped blocks can be obtained, for example, from Magnetfabrik Schramberg, Schramberg, Germany. In a preferred embodiment, the length ofthe magnet 12 is about four feet (1.2 meters), of which in a preferred embodiment only the center two feet (0.6 meters) are used 25 for the NMR measurement. In accordance with the present invention, the additional one- foot sections at each end provide a way to pre-polarize the hydrogen nuclei in the formation and to establish nuclear polarization equilibrium before a portion ofthe formation enters the measurement volume. Due to the symmetric nature of magnet 12 and the measurement volume for the tool built in accordance with the present invention, the NMR response is 30 independent ofthe direction (i.e., upward or downward) in which the tool moves. As best seen in Figures 4 and 19, the magnet 12 in a preferred embodiment comprises a plurality of magnet segments 58. Axially, the magnet segments 58 are separated by magnet spacers 64, preferably made of silicone foam, which are installed with a compressive preload. Circumferentially, the magnet segments 58 are bonded to an inner 35 magnet sleeve 60 and an outer magnet sleeve 62. In a specific embodiment, each axial section of magnet segments is held in proper circumferential alignment by means of a key 54 pressed into a longitudinal slot formed in the mud tube 34 and inner magnet sleeve 60. Thus, in a preferred embodiment the magnet 12 is segmented both axially and circumferentially. The axial segmentation provides improved static and dynamic load- handling capability. The magnet 12 is installed over the mud tube 34, and a plurality of O- rings 56 are installed in the small gap between the mud tube 34 and inner magnet sleeve 60. The O-rings 56 provide a means for handling radial expansion, isolate the magnet from distortions of mud tube 34, and also help to hold the magnet 12 in place axially. In the preferred embodiment, the magnet segments are made from samarium-cobalt, although for temperatures below about 160°C alternative embodiments, such as neodymium-iron-boron segments would also be a suitable and less expensive choice. In accordance with the present invention, the shaping ofthe magnetic field outside the tool is accomplished in part by grinding the individual samarium-cobalt segments into individual shapes and volumes. In particular, ferrite material layers are 18 mounted in a preferred embodiment over the north and south sides ofthe magnet and have the effect of partially short-circuiting the static magnetic flux. In order to achieve a magnetic field of uniform and sufficient magnitude within the sensitive volume, in a preferred embodiment it is necessary to: (a) slightly increase the volume of all magnetic segments, and (b) to selectively increase the segment volume on the north and south sides at the expense of east and west sides, because it is the former sides that are mostly affected by the presence of ferrite layers 18. A modification to the cross section 4-4 in Fig. 1 , as shown in a specific embodiment in Figure 4 is illustrated in Figure 4C. The arrangement illustrated in Fig. 4C is particularly advantageous because it achieves the mechanical strength ofthe embodiment shown in Figure 4, combined with a simplified geometry for the magnet 12. In the embodiment illustrated in the figure, the magnet 12 is comprised of magnetized segments 58 made from samarium-cobalt. These magnetized segments are bonded to the flat sides of a magnet segment carrier 50, which is made from magnetically permeable steel (type 4130). In accordance with the present invention, the magnet segment carrier 50 is hollow to accommodate the mud tube 34, which encloses the flow channel. The orientation of magnetization is generally along the N-S direction, as indicated in Figure 4C. The magnet segment carrier 50 generally becomes magnetized in the same N-S direction. The aforementioned pre-compensation ofthe magnetic field is easily accomplished, for example, by shortening or elongating the magnet carrier 50 along the N-S and/or along the E-W direction, respectively. (2) Ferrite Material Layers In order to improve the performance ofthe antenna 14 ofthe tool in the receive mode as well as the transmit mode, in accordance with a preferred embodiment ofthe present invention an axially elongated layer of ferrite material 18 is installed between the shield 16 and the antenna 14, as shown in Figures 4, 4A, 4B, 4C and 4D. Generally, the ferrite material layer 18 shapes the radio frequency (RF) field, by offsetting the reduction in the antenna aperture due to shield 16. Without the ferrite layer 18, large eddy currents would be induced in shield 16, which would tend to oppose the antenna currents and would result in significantly reduced sensitivity in receive mode .and in much larger current .and power requirements in transmit mode. Further, it is important to note that the field generated by the magnet 12 is not rotationally symmetric in its amplitude. Rather, in a preferred embodiment, the design and construction ofthe magnet takes into account the effect ofthe soft-magnetic ferrite material layer 18, which is mounted over both the north and the south poles of magnet 12. Ferrite material must be used that does not magnetically saturate in the presence ofthe strong static field surrounding the magnet. Base materials for ferrites 18 that can be used in a preferred embodiment are 3F3 and/or 3F4. Although the ferrites 18 are employed in accordance with the present invention to shape the radio frequency field, it will be appreciated that they also distort the static magnetic field. Accordingly, in the present invention the main magnetic field can be pre-compensated such that the combined field from the magnet and the ferrites is essentially rotationally symmetric in its magnitude within the measurement volume. In a preferred embodiment this can be accomplished by selectively altering the volume of magnetic material on the north and south sides vs. the amount on the east and west sides of the magnet. Alternatively, or in combination with the above approach, the size ofthe ferrites can also be optimized for length and width to increase absoφtion -and/or destructive reflections. In a specific embodiment the ferrites 18 can also be staggered like a brick wall for the same puφose. The required modifications ofthe magnet shapes are preferably determined by numerical modeling, such as provided by commercial packages, of which ANSYS is an example. As shown in the detail Figure 4D, in a preferred embodiment ofthe present invention the ferrites 28 are actually comprised of layers of ferrite material, bonded by lead- impregnated epoxy resin. In a preferred embodiment, the ferrite material layers are about 0.050" thick, while the epoxy resin is about 0.015" thick. The layers are oriented such that a more or less continuous path exists for the magnetic component ofthe RF field. In such an arrangement, the RF magnetic field experiences little attenuation as it passes through the ferrite. On the other hand, magneto-acoustic vibrations, which are introduced by the RF pulse, are optimally dampened because the acoustic wave repeatedly experiences absoφtion and/or destructive reflection on the interfaces between the ferrite material and the bonding layers. As known in the .art, commercially available ferrite is physically porous as well as magnetically permeable and is therefore prone to destruction under the typically high borehole pressures. Additionally, nonisostatic pressure changes the permeability of ferrite, which in turn changes the resonant frequency ofthe antenna 14. Therefore, the ferrite 18 is preferably impregnated with epoxy resin under pressure and temperature as described, for example, in U.S. Pat. No. 5,644,231 to Wignall. In the alternative, the ferrite layer 18 can be prepared by hot isostatic pressure methods to press out all the voids in the ferrite. As with the interface between the drill collar 10 and the shield 16, the preferred method of mounting the ferrite layer 18 to the shield 16 in accordance with the present invention is by bonding a thin layer 112 (Figure 4A) of rubber or lead-filled epoxy between the shield 16 and ferrite layer 18. This thin layer 112 of rubber or lead-filled epoxy serves to acoustically decouple the shield 16 from the ferrite layer 18. (3) The Antenna In accordance with the present invention, the length ofthe measurement volume is defined by the aperture ofthe antenna 14 and in a preferred embodiment is about two feet (0.6 m) long. In the preferred embodiment ofthe tool illustrated in Fig.l the antenna is used both for the transmission of radio frequency (RF) pulses into the surrounding formation 138 and for receiving NMR signals from the formation. In accordance with the present invention antenna 14, also illustrated in a schematic view in Figure 5, is preferably made of flat, elongated copper strips 14A interconnected by peripherally extending copper strips 14B about 1 inch wide and about 0.030 inch thick, and is mounted on the external surface ofthe drill collar 10 along the same axial portion ofthe tool as the magnet 12. The antenna is fed by a transmission line 14C made from two copper strips separated by a thin layer of suitable dielectric material. In a preferred embodiment, antenna 14 is completely encapsulated with a protective coating, which is preferably made of vulcanized viton rubber or a thermoplastic composite material. Antenna-Magnet Coupling In accordance with the present invention it is very important to provide semi-rigid coupling between antenna 14 and permanent magnet 12. If this is not the case, relative movement ofthe antenna against the static magnetic field will induce an electric voltage in the antenna windings. Although such a voltage would be small, it could still be large compared with the voltages induced by NMR signals, and would have a deleterious effect on the accurate measurement ofthe latter. As can be seen in Figure 4, the magnet 12 is rigidly coupled to the drill collar 10 using locking. Despite the potential deleterious effect on the NMR signal, it has been demonstrated by experimentation that it is still advantageous to partially de-couple the antenna from the drill collar 10 through shield 16 and antenna mounting 20. Generally, this de-coupling is believed to provide a measure of isolation from the effects of dynamic geometry changes, such as cyclical bending and torsion variations in collar 10, and high-frequency vibrations created by the drilling process and transmitted through the collar. Mounting ofthe Antenna The best known method for mounting the antenna 14 onto the drill collar 10 is by first installing an antenna mounting 20 made of an electrical and structural insulator material, such as a fiber-reinforced epoxy or thermoplastic composite, onto the ferrite 18 using another thin bonding layer 112 (See Fig. 4A). A recess 20A is formed in the outer surface ofthe anterma mounting 20 for accepting the antenna 14, which is bonded to the antenna mounting 20 with yet another thin bonding layer 112. Alternatively, as shown in Figure 4B, the antenna 14 may be installed directly to the ferrite layer 18, without an intervening antenna mounting 20, using a thin bonding layer 112. In such case, a recess 18 A is formed in the ferrite layer 18 for accepting the antenna 14. In either case, the antenna 14 is preferably covered with an antenna cover 22 in the form of a replaceable sleeve to protect the antenna 14 from the borehole environment. The preferred material for the antenna cover 22 is also a fiber-reinforced epoxy or thermoplastic composite. With further reference to Fig. 1, in a preferred embodiment the antenna cover 22 is held in place by a stabilizer 66 installed at each end ofthe antenna cover 22. These stabilizers 66 are preferably made of shrink-on material that allows installation by heating the stabilizers, sliding the stabilizers onto the drill collar 10, and allowing the stabilizers 66 to contract, or shrink, upon cooling. In addition to holding the antenna cover 22 in place, the stabilizers, which have an outer diameter larger than that ofthe antenna cover 22, serve to minimize damage to the antenna cover 22 due to rubbing and bumping against the borehole wall 38. When installed in this manner, the antenna 14, shield 16, ferrite 18, and magnet 12 cooperate electromagnetically to produce an annular NMR sensitive volume 36, as shown in Figures 6 A and 6B. In a preferred embodiment, the sensitive volume 36 has a nominal diameter D sv of about 13.5 inches (0.34 m), a radial thickness t sv of about 1.5 mm, and an axial length of about 2.0 feet (0.6 m). With reference to Fig. 1, this relatively large nominal diameter allows the sensitive volume to be entirely within the formation 138, yet the antenna is efficient enough to accurately detect the NMR signals at this distance. Additionally, the static magnetic field of this invention as a function of radial distance from the tool is such that the location ofthe Larmor frequency for the sodium quadrupole moment lies inside the tool volume instead of in the borehole 36 or in its wall 38. Therefore, in an important aspect of this invention, sodium signal is prevented from developing in the borehole fluid. As illustrated in a specific embodiment in Fig. 4, the diameter of antenna cover 22 is slightly less than the largest tool diameter. The largest tool diameter is defined by metallic stabilizers (66) that are mounted above and below the sensor section ofthe tool. If no stabilizing action is desired, hardened wear bands may be substituted for the stabilizers. The beneficial effect of stabilizers and/or wear bands used in accordance with the preferred embodiment is that the antenna cover 22 typically does not come into contact with the borehole wall 38. Wear bands are replaceable in the field and can be renewed between runs into the hole. It is also envisioned that metallic rings, such as stabilizers and/or wear bands, are placed immediately adjacent to the main antenna, such that in operation only the center two feet of antenna cover 22 remain exposed. (4 The Drill Collar Figures 4 and 4C, which show cross-sections along line 4-4 in Fig. 1, show two different embodiments ofthe drill collar 10 used in accordance with the present invention. Specifically, in the embodiment shown in Fig. 4, the collar 10 has a "wing-shape" cross section. Figure 4C, on the other hand, illustrates an embodiment with an octagonal cross- section design. Generally, it is important to note that the ferrites 28 are shaped to conform to the outer surface ofthe drill collar. In the embodiment illustrated in Fig. 4C an electromagnetic shield 16 is realized by plating the drill collar, although an arrangement as shown in Figure 4A is also possible in an alternative embodiment. Numerous different drill collar cross-section designs are possible in accordance with the present invention, where each variation embodies a particular compromise between the strength ofthe steel collar 10 and the efficiency of the antenna 14. (5) Conductive Shielding Referring next to Figures 4, 4 A-D, in accordance with a preferred embodiment ofthe present invention a highly conductive shield 16, preferably made of copper, is used between the antenna 14 and the exterior ofthe drill collar 10. The puφose of this shield is to prevent the RF field from entering the conductive steel collar 10. Otherwise, it will be appreciated that the steel collar would reduce the Q factor ofthe antenna 14, resulting in diminished signal amplitude in receive mode, and increased power dissipation in transmit mode. In accordance with the present invention the shield 16 is preferably a "floating" equal-potential surface with no direct connection to the collar. The conductive shield 16, which completely surrounds the drill collar 10 along the axial portion containing the antenna 14, also helps to reduce the ringing ofthe drill collar 10 due to the strong RF pulses used in NMR measurements. The preferred method for installing the shield 16 onto the drill collar 10 in accordance with the present invention is by bonding a thin layer 112 (Figure 4A) of material having suitable acoustic properties, such as rubber or lead-filled epoxy, between the collar 10 and the shield 16. In alternative embodiments the shield can be installed using different methods, such as flame spraying, electroplating, by means of mechanical fasteners, or otherwise. In accordance with the present invention the acoustic decoupling material comprising the bonding layer 112, such as rubber or lead-filled epoxy, is desirable as a dampening material for two reasons: (1) it is soft enough to acoustically decouple the shield 16 from the drill collar 10, and (2) it is rigid enough to prevent the shield 16 from vibrating due to the interaction between the current in the antenna 14 and the static magnetic field. (6 The Tuning Capacitor Compartment Referring back to Figure 1, this preferred embodiment also incoφorates tuning capacitors 42 housed in a tuning capacitor compartment 32 ofthe tool 40. The tuning capacitors 42 are used to match the impedance ofthe antenna 14 so that it will resonate at the desired natural frequency. As described, for example, in U.S. Pat. No. 5,557,201, the tuning capacitor compartment 32 is sealed off from the borehole environment so that the capacitors remain at atmospheric pressure instead of being exposed to the high borehole pressures. This pressure-sealed design eliminates the need for filling the capacitor compartment 32 with oil, as in prior art, to prevent the capacitors from contacting borehole fluids. Additionally, this invention comprises a high-pressure antenna feed-through connector 52, as shown in illustrative embodiments in Figures 18 (corrugated cross- section), 18A (multi-finned cross-section) and 19, to provide a conductive path for the electrical current from the antenna 14 to the tuning capacitors 42. The feed-through connector aspect of this invention is discussed in a preferred embodiment in an application filed concurrently herewith. In accordance with the present invention, by maintaining the capacitor compartment at atmospheric pressure, more pressure-sensitive electronics may be mounted inside the tuning capacitor compartment. This includes, but is not limited to, electro-mechanical relays and associated driver electronics. Under control ofthe driver electronics, such relays can be used to add more tuning capacitors to the resonant circuit formed by the fixed capacitors and the antenna. Thereby, the resonant frequency ofthe resonant circuit can be changed and the system can be made to operate at different frequencies one at a time. Such an arrangement is advantageous because by changing the operating frequency, a different sensitive volume is selected. By using multiple volumes one at a time, more signal can be accumulated in less time and/or different NMR measurement can be performed in a quasi-simultaneous fashion. Reference is made here to the paper "Lithology-Independent Gas Detection by Gradient NMR Logging," by Prammer, Mardon, Coates and Miller, Society of Petroleum Engineers, paper SPE-30562, published in the transactions to the 1995 SPE Annual Technical Conference & Exhibition, pp. 325-336, which is hereby incoφorated by reference. In Figure 6 of this paper, a pulse sequence for an NMR wireline tool is shown that utilizes two measurement volumes at once to affect oil and gas detection. (7) Power Generation Figure 24 illustrates an electric generator 80 in accordance with the present invention for supplying electrical energy to a downhole system 140. Electric generator 80 is driven by a drive shaft 86 that is preferably connected to a conventional mud-powered turbine (not shown) and supported by bearings (not shown). Electric generator 80 comprises permanent magnets 82 and 84, which are preferably of equal length and magnetic strength and which rotate inside a fixed main armature 88 to generate downhole electric energy. Because such electric energy is needed over a wide range of rotation speeds of drive shaft 86 (i.e., the mud-powered turbine) .and electrical demands of system 140, the electrical output must be controlled. The present invention controls the electrical output by providing a regulator for varying the relative rotational position of movable magnet 84 with respect to fixed magnet 82. Specifically, fixed magnet 82 is fixedly attached to drive shaft 86, but movable magnet 84 is mounted to a carriage 114 that is mounted to drive shaft 86 with a bearing 120 such that carriage 114 may rotate with respect to drive shaft 86. The degree of relative rotation between carriage 114 and drive shaft 86 is preferably limited by a stop pin 104 as discussed below. As will be readily apparent to persons skilled in the art, the present invention may be used to generate AC or DC electrical energy. If this invention is used to generate DC electrical energy, a rectifier 142 is provided as shown in Fig. 24to rectify the output from main armature 88 before it is fed into controller 106 and on to system 140. As shown in Figs. 25, 26, 27, 28A and 28B (in which main armature 88, carriage 114, bearing 120, and drive shaft 86 are not shown for cl-arity), magnets 82 and 84 comprise a plurality of longitudinal permanent magnet segments, which are preferably bonded to carriage 114. The magnetization ofthe magnet segments alternates circumferentially from north pointing radially outward to north pointing radially inward. When magnets 82 and 84 are completely aligned as shown in Fig. 28A, the maximum electrical output will be generated. Conversely, when magnets 82 and 84 are completely misaligned as shown in Fig. 28B, zero electrical output will be generated. For the preferred embodiment shown, this range of movement is 45° (-angle θ in Fig. 26). Thus, the requisite amount of electrical output is achieved by positioning magnets 82 and 84 between these two extremes. As shown in Figs. 24, 26 and 27, a preferred embodiment limits this range of motion to the appropriate degree by means of a stop pin 104 that rotates within a transverse cavity in the form of a pair of symmetric sectors 86B within an enlarged portion 86A of drive shaft 86. A biasing element 100, preferably of hexagonal cross-section, is installed through an axial cavity 86C in one end of drive shaft 86 and into a matching, preferably hexagonal, shaped hole in stop pin 104. Biasing element 100 serves to bias carriage 114 and movable magnet 84 in the maximum-output position with stop pin 104 against one extreme of sectors 86B. This biasing effect is accomplished by applying a torsional preload on biasing element 100 in the direction ofthe rotation of drive shaft 86 and securing biasing element 100 in the preloaded position with a set screw 116 contained in an end fitting 118. Stop pin 104 protrudes through a hole in carriage 114 and thereby rotates with carriage 114 when carriage 114 is rotated by a drag torque, as discussed below. After carriage 114 has been rotated from its initial position with respect to drive shaft 86 by means of a drag torque as discussed below, stop pin 104 serves to return carriage 114 to its initial position by means of biasing element 100. Persons skilled in the art will recognize that the hexagonal shape of biasing element 100 and the corresponding hole in stop pin 104 are simply a convenient means of fastening biasing element 100 to stop pin 104 using a segment of a conventional hex key (Allen wrench). In general, the shape need not be hexagonal so long as another means of fastening biasing element 100 to stop pin 104 is provided. Furthermore, the means of biasing carriage 114 and movable magnet 84 toward a certain position could take a variety of other forms, such as a coil spring. Moreover, the biasing mechanism could be located outside rather than inside drive shaft 86 if, for instance, electrical wires need to be routed through the inside of drive shaft 86. Also, although a preferred embodiment comprises a biasing mechanism, a biasing mechanism is not absolutely necessary for all applications and could be eliminated, if desired. Persons skilled in the art will also recognize that the configuration of magnets 82 and 84 and the relative rotation limiting device for varying the amount of electrical output generated by an embodiment of this invention may take a variety of other forms. For example, the relative rotation may be limited to less than that which would be required to achieve complete misalignment of magnets 82 and 84 such that the maximum allowable rotation produces a certain fraction of maximum output instead of zero output. Alternatively, magnets 82 and 84 may be made of unequal axial length such that rotation into the completely misaligned position produces a certain fraction of maximum output instead of zero output. Additionally, the number of magnet segments comprising magnets 82 and 84 may be varied such that a rotation angle other than 45° is required to achieve complete misalignment. As shown in Fig. 25, the cross-sections of magnets 82 and 84 preferably have a circular outer shape and a polygonal inner shape. A circular outer shape is preferable for providing an optimal magnetic field to cooperate with main armature 88, and a polygonal inner shape is preferable for ease of manufacture and to help prevent the magnet segments from de-bonding from carriage 114 due to torsional loads. However, the outer and inner shapes of magnets 82 and 84 may comprise other suitable shapes, as will be readily recognized by persons skilled in the art. Because magnets 82 and 84 may be of polygonal cross-section or circular cross-section, the term "circumferential" as used herein to describe magnets 82 and 84 should be understood to mean the peripheral dimension of those elements, whether flat or curved. Also, although the magnet segments comprising magnets 82 and 84 are preferably of equal circumferential dimensions, they may be of unequal circumferential dimensions, if desired. Further, the regulator for varying the position of movable magnet 84 with respect to fixed magnet 82 may take a variety of forms. Referring to Fig. 24, a preferred regulator comprises a drag element 98 mounted to a bearing 102 on drive shaft 86. Drag element 98, which rotates inside a fixed drag armature 90, is preferably made of copper and serves as a path for developing an eddy current. It should be understood that copper is referred to as a preferred material for certain elements of this invention, but any suitable conductive material could be used in place of copper for such elements. In typical downhole operations, fluctuations in parameters such as input RPM, electrical demands of system 140, and ambient temperature tend to cause fluctuations in the electrical output from main armature 88. Therefore, a preferred regulator includes a controller 106 which contains suitable electronics for monitoring the electrical output from main armature 88 and making appropriate adjustments to the input to drag armature 90, as discussed below, to modify the electrical output from main armature 88 and thereby meet the electrical requirements of system 140. Specifically, controller 106 generates an appropriate electrical control current in the windings of drag armature 90, which sets up a first magnetic field. The rotation of drag element 98 within the first magnetic field creates an eddy current in drag element 98, which is a function of (1) the magnetic field created by drag armature 90, (2) the speed of rotation of drag element 98, (3) the conductivity of drag element 98, and (4) the axial length of drag element 98. In turn, the eddy current in drag element 98 produces a second magnetic field that opposes the first magnetic field, which creates a drag torque on drag element 98. Thus, drag element 98 (rotor) and drag armature 90 (stator) function as a drag torque generator. The drag torque causes drag element 98 to rotate relative to drive shaft 86 in the direction opposite that ofthe drive shaft rotation. Because drag element 98 is connected to movable magnet 84 through a torque converter as discussed below, the drag torque rotates movable magnet 84 relative to fixed magnet 82 by an appropriate amount according to the applied electrical control current. The relative movement of movable magnet 84 with respect to fixed magnet 82 modifies the electrical output from main armature 88. Thus, as controller 106 senses deviations in the output from main armature 88, controller 106 makes appropriate modifications to the electrical control current in drag armature 90 to cause appropriate modifications to the output from main armature 88 and thereby meet the electrical requirements of system 140. Persons reasonably skilled in the art will recognize that the required drag torque may be generated by a variety of other rotor/stator configurations, such as: (1) a copper drag element rotating inside permanent magnets housed in a fixed armature; (2) permanent magnets rotating inside a fixed copper cylinder; (3) a copper drag element rotating inside a motor-driven, rotatable drag armature comprising a series of alternately magnetized permanent magnet segments, similar to magnets 82 and 84 as shown in Fig. 25, which can be rotated in either direction to advance or retard the drag element, as appropriate; or (4) a drag element, comprising a series of alternately magnetized permanent magnet segments similar to magnets 82 and 84 as shown in Fig. 25, rotating within a stator comprising windings which can be energized to control the speed and direction of a rotating magnetic field and thus advance or retard the drag element, as appropriate. The foregoing options (1) and (2) would not include a controller 106 and therefore would not be responsive to the output from main armature 88; rather, those two open-loop options would be responsive only to changes in drive shaft speed .and would simply limit the output from main armature 88. By contrast, the latter two options (3) and (4) would provide an additional advantage of helping to reduce the time that the apparatus takes to return to the initial, maximum-output position by enabling the application of a "reverse" drag torque (i.e., a torque in the same direction as the rotation of drive shaft 86) to drag element 98, thereby assisting biasing element 100 in moving carriage 114 and movable magnet 84 back to their initial position. If 10 desired, option (1) or (2) could be used in conjunction with the other drag torque generator configurations described herein to provide both a rudimentary limit to the output and a more sophisticated output control mechanism. The rudimentary limit provided by option (1) or (2) in such a hybrid configuration may be desirable, for example, to prevent an electrical overload in the event of failure ofthe electronics in controller 106. Of course, the drag 15 torque could also be supplied by a mechanical brake. To achieve the desired movement of carriage 114 with as small a drag torque as possible, the drag torque generated on drag element 98 is preferably multiplied using a torque converter as it is transmitted to carriage 114. In a preferred embodiment, the torque converter comprises a harmonic drive mechanism such as those sold by Harmonic Drive 0 Technologies, Inc. .and HD Systems, Inc. Alternatively, the torque converter could comprise other known gear mechanisms, such as a planetary gear mechanism. Although it may be possible to eliminate the torque converter in certain embodiments of this invention, the absence of a torque converter would increase the input torque requirements to unacceptable levels in most instances. 25 As shown in Fig. 24, a preferred harmonic drive mechanism comprises a wave generator 92, a flexspline 94, and a circular spline 96. Drag element 98 is fixedly connected to wave generator 92, and circular spline 96 is fixedly connected to carriage 114 which comprises movable magnet 84. Circular spline 96 is relatively stiff and has internal teeth to engage flexspline 94. Flexspline 94, which is of slightly smaller diameter than circular 30 spline 96 and has fewer teeth (usually two fewer) than circular spline 96, is relatively flexible and has external teeth to engage circular spline 96. Wave generator 92 comprises an elliptical, thin raced ball bearing that fits inside flexspline 94 and causes flexspline 94 to engage circular spline 96 at each end ofthe major axis ofthe ellipse. Wave generator 92, flexspline 94, and circular spline 96 cooperate such that each revolution of wave generator 35 92 causes circular spline 96 to rotate by only two teeth, for example. Thus, the drag torque on drag element 98 is multiplied as transmitted to carriage 114 and movable magnet 84 as a control torque. A tradeoff for achieving this torque multiplication is that the harmonic drive mechanism increases the response time ofthe apparatus. However, if desired, the use of a motor-driven, rotatable drag armature as mentioned above would help to decrease the response time. Because power generator 80 comprises a brushless, noncontact apparatus, it has an additional advantage of being capable of operating while immersed in oil. Thus, if oil is needed for pressure balancing due to high downhole pressures, this generator can safely operate in an oil-filled compartment. Persons skilled in the art will recognize that other advantageous configurations are possible to vary the amount of electrical output generated by an embodiment of thisinvention. For example, an advantageous configuration may be to fix the initial relationship of magnets 82 and 84 in a certain degree of misalignment such that the default electrical output is somewhat less than the maximum possible output. Indeed, it may be beneficial in certain applications to have an initial relationship of complete misalignment of magnets 82 and 84 such that the initial electrical output is zero. By selecting the proper arrangement ofthe harmonic drive output direction and the direction ofthe biasing torque, the drag torque could be made to increase or decrease the electrical output, as desired. However, in a preferred embodiment of this invention, controller 106 is powered by a portion ofthe output from main armature 88. Therefore, an initial relationship of complete misalignment of magnets 82 and 84 which produces zero initial output generally would not be desirable unless an alternate power source is provided for controller 106. Still another advantageous configuration may be to have a threaded cooperation of movable magnet 84 on drive shaft 86 such that the drag torque created on drag element 98 tr.anslates movable magnet 84 axially and thereby changes the electrical output by ch-mging the percentage of movable magnet 84 that is encompassed by main armature 88. Such a threaded configuration would also vary the electrical output by changing the separation distance between fixed magnet 82 and movable magnet 84. Because the present invention is intended to be able to operate at elevated downhole temperatures, the various magnets referred to herein preferably comprise samarium-cobalt (Sm-Co) magnets. Although some other types of magnets, such as neodymium-iron-boron (Nd-Fe-B) magnets, generally provide better magnetic flux at lower temperatures, Sm-Co magnets maintain better energy density at temperatures above about 150°C. However, any suitable type of magnets may be used, if desired. (8) Electronics Referring next to Figure 33, it illustrates in a block-diagram form the preferred electronics arrangement for the tool ofthe present invention. In particular, the resonant circuit comprised of antenna 14 and the tuning capacitors 32 is interfaced to a transmit/receive switch 330. This T/H switch receives pulsed RF power from the transmitter 355, which is gated by the pulse generator 350. The pulse generator is under control ofthe computer / signal processor 30. The T/R switch 330 routes the received signal to a preamplifier 335, which in turn drives the receiver section 340. The received, amplified signal is digitized in digitizer 345 and fed into the processor 30. In a preferred embodiment, processor 30 receives real-time motion data from the motion sensor interface 310, which conditions the electrical signal from motion sensors 24. The operation ofthe motion sensors is described in further detail below. Additionally, the processor reads from and writes to a non- volatile data and program memory 315. In a preferred embodiment, this memory retains data even when the electronics is not supplied with electrical power. In a preferred implementation, the non- volatile memory uses "Flash" EEPROM integrated circuits. Another suitable option is a battery-powered low-power CMOS static RAM. The memory 315 holds all data acquired during a run. Processor 30 performs real-time processing on the data to extract an indication of formation porosity and of log quality. In a preferred embodiment, this data is converted into a data stream of preferably very low bit rate and are fed into a mud-pulse system 320 that broadcasts the data stream to the surface by means of pressure pulses within the fluid column within the drill collar. Above-surface processing equipment (not shown) can be used to display the results to an operator. It will be appreciated that different tool-to-surface communication approaches are possible in alternative embodiments. Further, those skilled in the art will appreciate that downhole processor 30 may be implemented using two or more dedicated signal processors communicating with each other. In this embodiment, each processor can be performing a different task. For example, with reference to the following section on motion detection, a dedicated processor can be used to monitor signals related to the motion ofthe tool in the borehole and to provide signals for defining appropriate time windows when NMR signals from the formation are to be processed by a separate signal processor. It is applicants' intention that any suitable processor configuration can be used in accordance with the principles ofthe present invention. Further, it should be apparent that various options that exist for storage and communication ofthe acquired information to the user can be used without departing from the spirit of this invention. The electrical power required to operate the tool was described in some detail in the preceding section. Fig. 33 illustrates the power generation in a block diagram form. In particular, as shown this power is derived in accordance with the present invention from one or more ofthe following sources: (a) an (optional) bank of primary battery cells 89, typically ofthe lithium type, or (b) from a turbine/generator combination 80-87 that converts a portion ofthe mechanical energy delivered by the flowing mud column into electrical energy. The generator can be used to directly drive the power conversion unit 360. A potential disadvantage of this arrangement is that the tool cannot operate without mud being continuously pumped from the surface through the drill collar through the NMR tool to the drill bit. This requirement could potentially interfere with the requirements ofthe drilling operation. Therefore, in a preferred embodiment, the turbine/generator combination is used to charge a bank of rechargeable secondary battery cells 81, for example ofthe nickel-cadmium or silver-oxygen type. In a preferred embodiment, the generator 80 is sufficiently powerful to recharge the secondary elements in a short amount of time, while these secondary cells supply electric power to the tool during the time when no or very slow mud flow exists. The power conversion unit 360 converts the energy from primary or secondary cells into a form suitable for short-term storage in high- voltage capacitors 365. These capacitors feed the transmitter power supply 370 and are capable of discharging within fractions of milliseconds as required to generate high-power RF pulses of short durations. (9) Auxiliary Antennas and Their Functions Another important aspect ofthe present invention is the use of one or more auxiliary coils 144 as shown in Figure 33 and Figure 5. These coils .are mounted in one or more recesses within the aperture ofthe main antenna 14, where a small amount ofthe RF flux from the main antenna is sampled by the auxiliary coil(s) 144. Coil(s) 144 act as small antennas and are interfaced to a calibration circuit 325 (Figure 32), which is under control of processor 30. The pmpose of coil(s) 144 is three-fold: Firstly, during transmission of RF pulses, coil 144 picks up a fraction ofthe RF magnetic flux and generates a proportional voltage. This voltage is amplified by the electronics and generates an indicator signal for the strength ofthe outgoing RF pulse. This information is fed back into the driver electronics for the RF pulse generation to increase or to decrease the delivered RF pulse power. Thus, in accordance with the present invention a constant RF pulse amplitude is achieved that is independent of variable load conditions due to changes in borehole size, changes in the conductivity of borehole fluids .and/or changes in conductivity ofthe formation. In accordance with the present invention the auxiliary antennas 144 have another purpose: Before an NMR pulse sequence is started, a reference signal of known amplitude is injected into the system by means of coil(s) 144. The resultant magnetic flux is picked up by the antenna 14, amplified and processed by the signal processor. This reference signal acts in a preferred embodiment as built-in secondary calibration. In particular, by comparing the signal amplitudes received during the CPMG sequence to the apparent signal strength ofthe reference signal, it is possible to derive signal amplitudes which are independent ofthe system gain factor and ofthe Q factor ofthe resonant circuit formed by the antenna and the resonant capacitor(s). The reference signal is typically transmitted once per second through coil(s) 144. Furthermore, a potentially dangerous condition can be detected by monitoring the apparent strength ofthe reference signal generated by the auxiliary antennas. Specifically, a low reference signal is typically caused by excessive loading ofthe antenna 14, for instance by the presence of metallic pipe lining the borehole walls and surrounding the NMR tool. Transmitting an RF pulse in such a situation could potentially damage the RF transmitter by reflecting the outgoing energy back into the tool. Therefore, in accordance with a preferred embodiment, a timing circuit is triggered when an excessive load condition exists and disables the transmitter for about 15 more minutes after the load condition is removed. This is a fail-safe mechanism used in a preferred embodiment to make sure that the tool is never in the vicinity of casing when the transmitter is turned on. The fail-safe mechanism described above is also used in accordance with the present invention to make sure that the tool never transmits RF energy while in free air on the surface. Such a tr.ansmission may be disruptive and potentially hazardous for nearby electronic circuits. Accordingly, a protective, conductive blanket is provided, that the operator wraps around the tool whenever the tool is on the surface. The tool detects this condition once every second and goes into fail-safe mode with the transmitter turned off. After the conductive bl-uiket is removed, in a specific embodiment the operator has about 15 minutes to deploy the tool into the borehole. Typically, the borehole near the surface is cased, which keeps the RF transmitter turned off as long as the tool resides within the cased portion of the borehole . Finally, the periodic signal radiated by auxiliary antenna(s) 144 provides in accordance with the present invention a convenient means for verifying the operation of processor 30 without having to make electrical contact with the tool. (B) NMR Measurement Methods Using Motion Management NMR measurement methods are generally known and are described in a variety of prior art references including, for example, U.S. Pat. Nos. 4,710,713; 5,212,447; 5,280,243; 5,309,098; 5,412,320; 5,517,115, 5,557,200 and 5,696,448 to the assignee ofthe present invention. These patents are incoφorated herein by reference for all puφoses. The following discussion therefore focuses on aspects ofthe NMR measurement methods relevant in the context ofthe present invention. The preferred method for the NMR measurement in accordance with the present invention is to use the Carr-Purcell-Meiboom-Gill pulse sequence (CPMG) as shown in Figures 33(a) and 33(b). The first pulse in the sequence (90°-pulse, with 90° phase) is typically 50 μsec long, all subsequent pulses (180°-pulses, with 0° phase) are typically 100 μsec long. The timing is such that the center-to-center delay between the first and the second pulse (τ) is 250 μsec and all other pulses are 500 μsec center-to-center apart. With such a pulse timing, NMR echoes can be detected between all consecutive 180° pulses. After each CPMG pulse sequence, a wait time T w of several seconds is necessary in order to allow the hydrogen to re-polarize to an equilibrium condition. Therefore, although the actual pulse sequence may last only for milliseconds, each measurement takes several seconds, once the wait time is taken into account. It is therefore advantageous to issue a CPMG sequence only during time windows when lateral tool motion is slow to improve the chances for a valid NMR measurement and not to waste valuable measurement time. Since the exact delay between CPMG pulse sequences is not critical, is it possible, to extend, if necessary, the minimum required delay T w by additional time in order to start a new measurement in a favorable time window. Conversely, the thin shell ofthe sensitive volume 36 (Figure 6 A), suggests that moderate lateral tool motion can be helpful by automatically selecting a new sensitive volume within a small delay after a CPMG measurement. By monitoring the lateral tool motion, the tool can determine when such a condition exists and can speed up the measurement cycle by shortening the wait time T w . (1) Signal Processing Using Phase- Alternated Pairs In accordance with the present invention the echo responses acquired within a CPMG sequence are preferably digitized and recorded in two channels: in-phase and in- quadrature. In a first processing step, data from consecutive CPMG sequences are added echo-by-echo and channel-by-channel to form a phase-alternated pair (PAP). The first data half of a PAP comes from a CPMG sequence as shown in Figure 33(a), the second half is supplied by a CPMG sequence as shown in Figure 33(b). The difference between the sequences shown in Figs. 33(a) and 33(b) is that in the latter the phases of all 180° pulses have been inverted. The net effect of using PAP in accordance with the present invention is that artifacts, which tend to be coherent with the phases ofthe 180° pulses, tend to cancel out, while the NMR signal, whose phase is tied to the initial 90° pulse, is amplified. For those skilled in the art it should be obvious that the same effect can be achieved by inverting the phase ofthe 90° pulse from 90° to 270°, accompanied by subtracting - instead of adding - the resultant echo streams. In order to achieve the beneficial effect of PAP accumulation, both parts of a PAP must be valid NMR measurements. An important part ofthe present invention is that information about the tool motion is incoφorated into the NMR sequencing. Thus, in a specific embodiment, if during any CPMG sequence the lateral motion exceeded the allowable limits, the resultant data set is discarded and the computer / signal processor 30 attempts to re-acquire a valid data set. To this end, the computer delays by the appropriate wait time T w and repeats the previous CPMG sequence. In accordance with this embodiment, only when the data has been validated the sequence proceeds to the next measurement. To describe motion management as used in the present invention in the proper context, it should be noted that it is well known in the art that the amplitude ofthe first echo is fairly good approximation ofthe number of hydrogen atoms in the fluid state and therefore can be calibrated to read fluid-filled porosity. Therefore, in accordance with a first embodiment of this invention, the simplest possible CPMG measurement consists of only one 90° pulse, one 180° pulse and one signal acquisition. The total time from the first pulse to the end ofthe signal acquisition in this case is about 0.5 msec. It has been demonstrated by numerical modeling and by experiments that a lateral displacement of about 0.1 mm is allowable within this time period without causing an undesired change in echo amplitude. This translates into a maximum limit for transversal velocity of 0.2 m/sec. Alternatively, the CPMG pulse sequence may be continued with more 180° pulses and data acquisitions. Subsequent echoes may become more and more depressed because the sensitive volume shifts laterally through the formation. However, as shown in Figs 35a and 35b, even in this case an approximation ofthe initial echo amplitude can be recovered. Figure 35a shows typical echo amplitudes without motion present. The peaks ofthe echoes are curve-fitted .and extrapolated back to the time ofthe initial 90° pulse, as known in the art. The resultant amplitude A 0 is a direct measure of formation porosity. With tool motion present, the echo amplitudes become more and more depressed as shown in Figure 35b, and curve-fitting -and back-extrapolation yields a possibly different approximate value for the initial amplitude A 0 . The following description illustrates approaches to motion management used in accordance with the present invention to correct NMR measurement signals obtained from moving tools. (2) Motion Management Referring back to Fig. 1, in a specific embodiment, the motion management aspect of this invention comprises accelerometers 24 along with a signal processor 30 for processing the accelerometer signals and the NMR signals from the formation, and a conventional data transmitter 150 to transmit the data to the surface. In certain embodiments, an additional high-pass filter 44 can also be used. Alternatively, another advantageous embodiment shown in Fig. 29 comprises acoustic sensors 26 and an inclinometer 48. Yet another embodiment ofthe motion management used in accordance with the present invention, shown in Figure 30, comprises acoustic sensors 26 and a magnetometer 50. Another advantageous embodiment shown in Figure 31 comprises contact sensors 46 and an inclinometer 48. Still another advantageous embodiment shown in Figure 32 comprises contact sensors 46 and a magnetometer 50. In the embodiments of Figures 29 through 32, the signal processor 30 is for processing, in addition to the NMR signals from the formation, the acoustic sensor, contact sensor, inclinometer, and magnetometer signals, as the case may be. The various embodiments having accelerometers, acoustic sensors, contact sensors, inclinometer, and/or a magnetometer can be used in accordance with the present invention to manage the lateral motion ofthe tool 40 in the borehole 36, i.e., to account for it as part ofthe signal processing algorithm. Tool Motion Regimes In the preferred embodiment, the type of NMR measurement performed is adapted to the tool motion regime in an automatic fashion. The following motion regimes can be identified and correspond to particular NMR measurements: 1. Stationary tool. If no lateral motion is detected, the tool can replicate NMR measurements simile to wireline operation. Because the measurement volume does not substantially change during the course of a few 100 milliseconds, the CPMG sequence is extended to include typically 501 pulses and 500 echoes. The wait time between experiments is chosen to allow the same sensitive volume to re-polarize between CPMG sequences and is on the order of 5 seconds. 2. Normal drilling mode. Some lateral motion is present, but the speed does not exceed 0.2 m/s. This means that at least the first echo is always valid and possibly more echoes, depending on the instantaneous velocity. In this motion regime, in a preferred embodiment the tool selects a shortened CPMG sequence of typically 51 pulses and 50 echoes. The wait time is shortened by about a factor of one-half to 2.5 seconds. Data taken during an interval where the velocity exceeds 0.2 m/s are discarded and the sequencer attempts to re-acquire the same data. All data are time- stamped and stored in non- volatile memory, together with motion data immediately acquired before and after the NMR measurement. The echo amplitudes are curve- fitted as shown in Figure 35, and the obtained amplitude A 0 is converted into porosity units and reported in real-time to the surface by means ofthe mud-pulse system. 3. Whirling mode. In this mode, the lateral velocities are typically outside acceptable limits. In a specific embodiment the tool selects the shortest possible CPMG sequence consisting of only two pulses and a single echo. The processor waits for the motion detection to identify a moment when the instantaneous speed is below 0.15 m/s and attempts .an NMR measurement that lasts 0.5 msec. Immediately after the NMR data acquisition, the instantaneous velocity is checked again. If it does not exceed 0.2 m/s, the NMR data point is accepted, otherwise rejected. The minimum delay between measurements is about 2.5 sec, but the actual delay can be highly variable, depending on the frequency of motion windows. 4. Stick/slip mode. In this mode, certain time windows exist in which the tool is almost stationary. The tool monitors the motion data to determine whether or not these windows are longer than a 50-echo CPMG sequence. If not, the tool falls back to the single-echo of a whirling condition (3). If yes, the CPMG sequence compatible with normal drilling is selected (50 echoes). The tool triggers the CPMG measurement at the onset of a "sticking" condition, but no sooner than about 2.5 seconds after the last measurement. Motion data taken during and after the CPMG sequence is recorded to determine if the window was wide enough to validate all 50 echoes. In accordance with the present invention the tool is programmable before being deployed in the borehole. The operator can choose which ofthe operating modes (l)-(4) can be selected during run time. Also, certain modes may be forced, bypassing the downhole decision logic. Fig. 9 is a block-diagram ofthe motion management algorithm used in accordance with the present invention. The algorithm starts at 200 and proceeds to measure the tool's lateral acceleration and rotation speed (RPM) at 205. If in decision block 210 the RPM measurement indicates stick-slip motion (235), the next step 240 is to forecast the stick phase and then calculate the average and maximum lateral velocities in block 245. Next the computed quantities are compared at 250 to some predetermined constants. In particular, if average lateral velocity is less than or equal to V al and the maximum lateral velocity is less than or equal to V^, then it is safe to process the NMR signals, and the algorithm proceeds to prepare NMR sampling at 260. If the conditions in decision block 250 are not met, the velocities indicate that the tool is undergoing whirling motion possibly combined with stick-slip motion, and the whirling portion ofthe algorithm must be followed. If the RPM measurement does not indicate stick-slip motion at 210, then the next step 215 is to calculate the average and maximum lateral velocities. If in decision block 220 the average lateral velocity is shown to be less than or equal to a predetermined value V al and the maximum lateral velocity is also shown less than or equal to another value V^, then the velocities indicate normal drilling motion 225. In such case, it is safe to proceed with the NMR sampling in block 230. However, if the average lateral velocity is greater than V al or the maximum lateral velocity is greater than V^, then the velocities indicate that the tool is tmdergoing whirling motion, indicated in block 265. In that case, further calculations are needed. When the velocities indicate whirling motion, the next step 270 is to calculate the duration of time for which the lateral velocity is less than V^. If that duration is greater than or equal to a parameter T a , then the next step 275 is to calculate the duration in which the lateral velocity is less than a parameter V,,. If this second duration is greater than or equal to T a , then the NMR measurement 280 should be made when the lateral velocity is less than or equal to V al and the absolute value ofthe lateral acceleration is less than a predetermined value. If this second duration is less than T a , then the NMR measurement 285 should be made when the lateral velocity is less than or equal to ύ a - nd the absolute value ofthe lateral acceleration is less than a pre-determined value. Similarly, if the duration of time for which the lateral velocity is less than V^ is also less than T a , then the second duration calculation is not needed and the NMR measurement 285 should be made when the lateral velocity is less than or equal to V^ and the absolute value ofthe lateral acceleration is less than a pre-determined value. In the preferred embodiment, the maximum motion criterion in the MWD mode is that the lateral velocity must be less than or equal to about 0.2 m/s. However, to be conservative, the criterion may be set at 0.15 m/s to provide a 33% margin of safety. The variables used in the embodiment illustrated in Figure 9 are thus as follows: _V,, = 0.10 m/s W a2 = 0.15 m/s T a = 10 ms In the sliding/wiping mode, the maximum motion criterion may be different due to different NMR sampling times, and the cut-off frequency for the high-pass filter 44 (see Fig. 1) may be different depending on the drill collar rotation speed. Accelerometer-based Motion Management In a preferred embodiment, four accelerometers 24 are placed around the circumference ofthe drill collar 10 as shown in Figure 8. Accelerometers acl and ac2 are at opposite ends of one diameter, and accelerometers ac3 and ac4 are at opposite ends of a peφendicular diameter. The in-plane component ofthe gravitational acceleration, g sin α, is oriented in the vertical plane, and the lateral acceleration vector is in some arbitrary direction. In typical applications, the drill collar rotates at angular velocity w, producing centripetal acceleration ac = rw 2 . As discussed above, the motion ofthe drill collar 10 for an arbitrary inclined orientation (as shown in Figure 7) is governed by Eqs. [5]. To eliminate the gravity terms in Eqs. [5], a high-pass filter 44 (see Fig. 1) may be used. The frequency cut-off for the high-pass filter is above that ofthe typical drill string rotation speeds. The governing equations then become simplified to those of Eqs. [1], so that the drill collar rotation speed S and the magnitude and direction ofthe lateral acceleration ax may be determined by Eqs. [2], [3], .and [4]. Because the tool 40 is typically rotating, the initial measurement ofthe lateral acceleration ax is with respect to a rotating coordinate system (x',y'), as shown in Figure 39. However, the velocity .and displacement ofthe tool 40 are needed in the fixed reference frame ofthe borehole (earth). Thus, the lateral acceleration measurement must be converted to a fixed coordinate system (x,y) by way of a coordinate transformation. Referring to Figure 39, the orthogonal components ofthe lateral acceleration ax in the rotating coordinate system are represented as A x ' and A y '. The rotating coordinate system is rotationally displaced from the fixed coordinate system by an angle φ. Therefore, the orthogonal components, A x and A y , ofthe lateral acceleration ax in the fixed coordinate system are calculated as follows: A x = A x ' cos φ + A y ' sin φ Eq. [7] A y = -A x ' sin φ + A y ' cos φ Eq. [8] The angle φ (in radians) is obtained from the following relation: where φ 0 is the initial value ofthe angle φ, ω is the angular velocity (in radians/second) of the drill collar 10, and t is time (in seconds). Because the actual value ofthe initial condition, φ 0 , is not important for puφoses of this invention, φ 0 may be assumed to be zero. After converting the lateral acceleration ax into the fixed reference frame, the signal processor 30 is then used to integrate the lateral acceleration ax once to obtain the tool's lateral velocity, .and twice to obtain the tool's lateral displacement. The signal processor 30 then uses these parameters in conjunction with the motion management algorithm as shown in Figure 9 to predict acceptable time windows in which to make NMR measurements. After NMR measurements are made, the signal processor 30 also verifies that they were made within acceptable levels of lateral motion. Acoustic-Sensor-Based Motion Management In the acoustic sensor versions ofthe apparatus (Figures 29 and 30), a plurality of at least two acoustic sensors 26 are placed around the perimeter ofthe drill collar 10. Similarly, in the contact sensor embodiments ofthe apparatus (Figures 31 .and 32), a plurality of at least two contact sensors 46 are placed around the perimeter ofthe drill collar 10. Instead of measuring the tool's lateral acceleration, these embodiments measure the tool's lateral displacement by sensing the tool's distance from the borehole wall at a plurality of times. Then, the signal processor 30 differentiates the displacement measurements once to obtain the tool's lateral velocity, and twice to obtain the tool's lateral acceleration. In the single-echo acquisition modes of whirling and stick/slip, the measurement can tolerate lateral velocities of up to about 0.5 m/s. Although up to 50% signal amplitude is lost at the upper limit ofthe range 0.2 - 0.5 m/s, this loss can be recovered by estimating the average lateral velocity during the NMR measurement (0.5 msec). In Figure 14, the shaded area represents the portion (overlap) ofthe sensitive volume that is the same at the time of the 90° pulse and the first-echo signal acquisition window. The percentage that the shaded area bears to the original, full cross-sectional area ofthe sensitive volume is the same as the percentage that the received NMR signal amplitude bears to the NMR signal amplitude that would have been received if the tool had remained stationary. Thus, the plot of Figure 17 shows the relationship between the fraction ofthe original sensitive volume at the time of the NMR echo and lateral tool movement between the 90° pulse .and the NMR echo. The signal processor uses this relationship to apply the appropriate correction factor to the NMR signal. Figures 15 shows how to calculate the area ofthe overlapping portions ofthe measurement volume of Figure 14. Referring to Figure 15, because radii r 0 and r, are much greater than the displacement x, the angles α and β are approximately equivalent. Therefore, for a single quadrant, the area enclosed by circle #1 is given by the relation A, = ( 1 /4)(πr 0 2 )[(π/2 - a)/ π/2] Eq. [ 10] .and the area enclosed by circle #2 is given by the relation A 2 = (l/4)(πr, 2 )[(90 + α)/ 90] Eq. [l l] The area ofthe triangle is given by the relation 10 A t « (l/2)(x)[(r 0 + r,) / 2] Eq. [12] Thus, the area A a ofthe hatched portion is given by the equation A a - A, - (A 2 + A t ) Eq. [13] Figure 16 illustrates the computation in another embodiment in which the area A b of 15 the hatched portion 16 is determined by the equation A b = A 2 - A, Eq. [14] Figure 17 is a plot of A a expressed as a fraction ofthe initial area ofthe sensitive volume for x < 1.5 mm. This plot is for a preferred embodiment ofthe NMR MWD tool for 20 which the sensitive volume has a nominal diameter of 13.5 inches and a thickness of 1.5 mm. If the sampling rates ofthe acoustic sensors 26 or contact sensors 46, as the case may be, do not exceed the rotation speed ofthe tool 40 by a sufficient margin, then the 25 rotation ofthe tool 40 is no longer negligible with respect to the lateral displacement. In such cases, at least three acoustic sensors 26 or contact sensors 46 must be used in conjunction with either an inclinometer 48 or magnetometer 50 (Figures 29 to 32). Referring to Figure 37, the acoustic sensors 26 or contact sensors 46 are represented by the - 0 symbols S,, S 2 , and S 3 , which are preferably spaced uniformly (i.e., 120 degrees apart) around the perimeter ofthe tool 40, as shown. The inclinometer 48 or magnetometer 50 is represented by the symbol S 4 (hereafter referred to as instrument S 4 ). For convenience, the location of instrument S 4 is taken to be opposite sensor Sj. The sensors S b S 2 , and S 3 yield displacement measurements d l5 d 2 , and d 3 , which provide an estimate ofthe diameter ofthe 35 borehole 36. As the tool 40 rotates, the instrument S 4 produces a sinusoidal electrical signal, E, as a function ofthe rotational position, f, ofthe tool 40 within the borehole 36 (Figures 37 and 38). Together with the slope, dE/dφ, ofthe curve in Figure 38, the value of E determines the angle φ. The coordinate system (x,y) in Figure 33 is fixed to the borehole 36, but the actual orientation of this coordinate system within the borehole is arbitrary. For convenience, the coordinate system (x,y) has been chosen such that the peak electrical signal, E, occurs when instrument S 4 is in the negative y direction (i.e., φ = π/2), and the angle φ is referenced from the x axis according to the right hand rule. The values of d l5 d 2 , d 3 , and φ determine the location ofthe center ofthe tool 40 within the borehole 36, which may be described in either rectangular coordinates (x,y) or radial coordinates (r,θ), as shown in Figure 33. By measuring the location (xo,yo) -and (xι,yι) ofthe center ofthe tool 40 at two successive times to .and t,, the lateral displacement, d, ofthe tool 40 may be calculated as follows: d = [(x, - xo) 2 + (y, - y 0 ) Eq. [15] The lateral displacement, d, may then be used to correct the NMR signal, as discussed above. Alternatively, the components ofthe lateral velocity (V x -and V ), the lateral velocity (V L ), and the rotation speed (RPM) ofthe tool 40 may be calculated by the following equations V x = (x 1 - Xo) / (t, - to) Eq. [16] V y = (y, - yo) / (tι - to) Eq. [17] V L = [(V 2 + (V y ) 2 ] Eq. [18] RPM = (60/2π) * (φ, - φ 0 ) / (t, - to) Eq. [19] for use in the motion management algorithm of Figure 9. Persons skilled in the art will recognize that a potential difficulty exists for either an inclinometer 48 or magnetometer 50 in certain orientations ofthe tool 40. Specifically, if instrument S 4 is an inclinometer, the electrical signal, E, will be constant rather than sinusoidal if the inclinometer is in a vertical orientation. Similarly, if instrument S 4 is a magnetometer, the electrical signal, E, will be constant rather than sinusoidal if the magnetometer is aligned with the earth s magnetic field. In either case, the consequence of a constant electrical signal, E, is that the angle φ is not determinable, which precludes the calculation ofthe lateral displacement and rotation speed ofthe tool 40. This potential difficulty may be eliminated by including both an inclinometer 48 and a magnetometer 50 in the tool 40 so that, for any orientation ofthe tool 40 within the earth, at least one ofthe two instruments will produce a sinusoidal electrical signal, E. NMR Signal Processing Using Motion Management The preferred method for collecting NMR data during motion is shown as a flow chart in Fig. 36. It is assumed that the principal motion regime has been determined according to the algorithm illustrated in Figure 9. In accordance with the present invention at the start 400 ofthe algorithm this information allows to optimally select the length ofthe CPMG pulse train and the wait time between CPMG pulse/echo measurements in block 405. As a safety measure, prior before pulsing the transmitter, the system gain is determined at 410 by injecting a reference signal into auxiliary coil (See Fig. 5). If the received signal returned through the main antenna 14 is too low, the tool shuts down at 445 for a predetermined time, e. g., 15 minutes. Otherwise, the actual CPMG sequence is delayed at 415 until a suitable time window with an instantaneous lateral velocity of less than 0.15 m/s occurs. In the stationary and normal drilling modes, this condition should always be met. Next, a CPMG pulse-echo sequence of pre-determined length is broadcast and echo data are acquired at 420, as known in the art. After every CPMG sequence, the lateral velocity is re-checked at 425. If it exceeds 0.2 m/s, the newly acquired data is discarded at 455 and the tool delays by a pre-determined time T at 450. Typically, T is shorter than T w to take advantage ofthe fact that the tool moved to a fresh volume. After T w seconds, the search for a suitable time window resumes at 415 as shown in Figure 36. If the check at 425 indicates valid data, the data set is accepted at 430; the tool delays for the pre-determined time T w are set at 435, and the cycle repeats with the acquisition ofthe second half of a PAP. Once the PAP set is complete, at 440 the algorithm exits. As noted above, the beneficial effect of phase-alternated signal averaging is achieved in accordance with the present invention by coherent accumulation of NMR data, coupled with the progressive suppression of non-NMR artifacts. Most ofthe latter is comprised of pulse-induced magneto-acoustic ringing from metallic and magnetic structures within the tool. It has been determined by experimentation that the patterns of said artifacts tend to change cyclically with the tool's orientation and bending. With reference back to Fig. 32, in a preferred embodiment the signal processor 30 derives an estimate ofthe tool's orientation from the set of motion sensors, in particular from magnetic pick-up ofthe earth's magnetic field and/or from the gravity component of the accelerometer data. Within the time windows imposed by the lateral motion, processor 30 attempts to synchronize the NMR measurement with the rotation ofthe tool string. Under normal drilling conditions, lateral velocities are almost always within acceptable limits -and rotational synchronization tends to dominate the time sequencing ofthe NMR data collection. Under whirling conditions, the opportunities for synchronizing the NMR measurement to the tool orientation start to disappear. If the time windows derived from lateral velocities drop under a pre-determined value, processor 30 no longer attempts synchronization based on tool orientation. While the foregoing has described and illustrated aspects of various embodiments of the present invention, those skilled in the art will recognize that alternative components and techniques, and/or combinations and permutations ofthe described components and techniques, can be substituted for, or added to, the embodiments described herein. It is intended, therefore, that the present invention not be defined by the specific embodiments described herein, but rather by the appended claims, which are intended to be construed in accordance with the following well-settled principles of claim construction: (a) Each claim should be given its broadest reasonable inteφretation consistent with the specification; (b) Limitations should not be read from the specification or drawings into the claims (e.g.. if the claim calls for "antenna", and the specification and drawings show a coil, the claim term "antenna" should not be limited to a coil, but rather should be construed to cover any type of antenna); (c) The words "comprising", "including", and "having" are always open-ended, irrespective of whether they appear as the primary transitional phrase of a claim or as a transitional phrase within an element or sub-element ofthe claim; (d) The indefinite articles "a" or "an" mean one or more; where, instead, a purely singular meaning is intended, a phrase such as "one", "only one", or "a single", will appear; (e) Words in a claim should be given their plain, ordinary, and generic meaning, unless it is readily apparent from the specification that an unusual meaning was intended; (f) an absence ofthe specific words "means for" connotes applicants' intent not to invoke 35 U.S.C. §112 (6) in construing the limitation; (g) Where the phrase "means for" precedes a data processing or manipulation "function," it is intended that the resulting means-plus-function element be construed to cover any, and all, computer implementation(s) ofthe recited "function"; (h) a claim that contains more than one computer-implemented means-plus-function element should not be construed to require that each means-plus-function element must be a structurally distinct entity (such as a particular piece of hardware or block of code); rather, such claim should be construed merely to require that the overall combination of hardware/firmware/software which implements the invention must, as a whole, implement at least the function(s) called for by the claim's means-plus-function element(s); (i) a means-plus-function element should be construed to require only the "function" specifically articulated in the claim, and not in a way that requires additional "functions" which may be described in the specification or performed in the preferred embodiment(s); (j) The existence of method claims that parallel a set of means-plus-function apparatus claims does not mean, or suggest, that the method claims should be construed under 35 U.S.C. §112 (6).

Claims: CLAIMS 1. A nuclear magnetic resonance (NMR) logging tool for conducting measurements of a ground formation surrounding a borehole having an axis, comprising: (a) a permanent magnet producing a static magnetic field in the formation, the direction ofthe magnetic field being substantially peφendicular to the borehole axis; (b) a drill collar made of nonmagnetic metal, said drill collar enclosing the magnet; (c) an antenna mounted on the outside of said non-magnetic drill collar; and (d) one or more ferrite elements installed in proximate relationship with the antenna, said ferrite elements shaping radio frequency (RF) fields generated by the antenna and compensating the magnetic field ofthe permanent magnet as to provide a combined magnetic field the magnitude of which being substantially rotationally symmetric within the measurement volume ofthe tool. 2. The NMR tool of claim 1 further comprising a downhole signal processor for processing NMR signals from said formation. 3. The NMR tool of claim 2 further comprising means for transmitting output signals of said signal processor to the surface. 4. The NMR tool of claim 1 further comprising a drill bit for making NMR measurements while drilling a borehole in said ground formation. 5. The NMR tool of claim 1 wherein at least one of said one or more ferrite elements comprises a plurality of ferrite layers. 6. The NMR tool of claim 1 further comprising motion detection means for generating signals related to motions ofthe tool in space. 7. The NMR tool of claim 6 further comprising a signal processor for processing NMR signals from said formation and signals proportional to the motion ofthe tool in space as to enable collection and processing of said NMR signals based on said signals related to motions ofthe tool in space. 8. The NMR tool of claim 6 wherein said means for generating signals comprises accelerometers generating acceleration signals corresponding to lateral motions ofthe tool. 9. The NMR tool of claim 6 wherein said means for generating signals further comprises a high-pass filter for suppressing gravitational acceleration terms in an inclined orientation ofthe tool. 10. The NMR tool of claim 1 further comprising wear bands for minimizing mechanical wear ofthe tool. 11. The NMR tool of claim 1 wherein the surface ofthe drill collar is highly conductive. 12. The NMR tool of claim 1 further comprising an electrically conductive shield installed between the antenna and the drill collar, and said one or more ferrite elements are installed between the shield and the antenna. 13. The NMR tool of claim 12 wherein the shield is installed onto the drill collar by bonding a thin layer of material capable of suppressing acoustic propagation. 14. The NMR tool of claim 13 wherein said thin layer is made of rubber or lead-filled epoxy. 15. The NMR tool of claim 6 further comprising means for prediction of time windows in which valid NMR measurements can be made based on signals provided by said motion detection means. 16. The NMR tool of claim 15 wherein said means for prediction comprises means for comparing signals provided by said motion detection means to allowable motion criteria. 17. The NMR tool of claim 6 further comprising means for classifying operation ofthe tool into one of several operation modes based on signals from said motion detection means. 18. The NMR tool of claim 1 wherein said permanent magnet comprises two or more magnet segments. 19. The NMR tool of claim 18 wherein said two or more magnet segments are separated axially by magnet spacers. 20. The NMR tool of claim 18*wherein the combined magnetic field is tuned by 0 adjusting individual contributions from said two or more magnet segments. 21. The NMR tool of claim 1 further comprising one or more auxiliary antennas for transmission of reference signals and for reception of signals related to the operation ofthe tool. 22. The NMR tool of claim 1 further comprising means for providing semi-rigid 5 coupling between said antenna and said permanent magnet. 23. The NMR tool of claim 2 further comprising non- volatile memory for storing data relating to processed NMR signals. 24. A method for making NMR logging-while-drilling measurements of a geologic formation surrounding a borehole using a logging tool, the method comprising: monitoring signals related to motions ofthe logging tool within said borehole; collecting NMR signals from said geologic formation; and processing collected NMR signals based on said monitoring signals. „ 25. The method of claim 24 wherein the step of processing comprises the step of applying corrections to the collected NMR signals based on values ofthe signals related to motions ofthe logging tool. 26. The method of claim 24 further comprising the step of processing said NMR signals using a downhole signal processor. 27. The method of claim 26 further comprising the step of storing processed NMR signals in a memory. 28. The method of claim 26 further comprising the step of transmitting output signals of said signal processor to the surface. 29. The method of claim 24 further comprising the step of classifying the operation of the logging tool into one of several operation modes based on the monitored signals related to motions ofthe logging tool. 30. The method of claim 29 further comprising the step of causing a shutdown ofthe operation ofthe tool in case one of said several operation modes is detected. 31. The method of claim 24 wherein said signals related to motions of the logging tool within said borehole are generated by means attached to the tool. 32. The method of claim 31 wherein said signals are generated as acceleration signals corresponding to lateral motions ofthe tool. 33. The method of claim 24 further comprising the step of predicting time windows in which valid NMR measurements can be made based on said monitored signals. 34. The method of claim 33 wherein the step of predicting comprises comparing said monitored signals to allowable motion criteria. 35. The method of claim 24 wherein said collecting occurs during time intervals when said motions ofthe logging tool are within prescribed limits. 36. The method of claim 24 wherein the step of processing comprises the step of deleting collected NMR signals when said motions ofthe logging tool are outside prescribed limits. 37. The method of claim 36 further comprising the step of re-acquiring NMR signals from the geologic formation corresponding to said deleted NMR signals. 38. A system for making NMR logging-while-drilling measurements of a geologic formation surrounding a borehole using a logging tool, comprising: means for monitoring signals related to motions ofthe logging tool within said borehole; means for collecting NMR signals from said geologic formation; and means for processing collected NMR signals based on said monitoring signals.

Inventors: BARTEL ROGER P, CHEN-KANG DAVID C, DUDLEY JAMES H, GOODMAN GEORGE D, JONES DALE A, LARRONDE MICHAEL L, MASAK PETER, MORYS MARIAN, PRAMMER MANFRED G, RODNEY PAUL F, SMAARDYK JOHN E, BARTEL, ROGER, P., CHEN-KANG, DAVID, C., DUDLEY, JAMES, H., GOODMAN, GEORGE, D., JONES, DALE, A., LARRONDE, MICHAEL, L., MASAK, PETER, MORYS, MARIAN, PRAMMER, MANFRED, G., RODNEY, PAUL, F., SMAARDYK, JOHN, E.
Applicants: NUMAR CORP, NUMAR CORPORATION
Application year: 1999
Main classification: G01V3
IPC codes: G01R33, G01V3