# Patent

## Title
Apparatus and continuous method for the multistage treatment of finely

## Abstract

A method and apparatus for providing a magnetic compass, and system to accurately calibrate the compass with a rotation of the vessel on which the compass is mounted through a single rotation of 360 degrees. The compass comprises gimballed field sensing elements, and processor to provide a signal which is corrected for compass offsets, for permanent magnetic field anomalies and for induced magnetic field anomalies.

## Background
The present invention relates to compasses, and in particular to magnetic compasses having orthogonal field sensing elements and error correction systems attached thereto.

Magnetic compasses utilize a magnetic device to sense and measure orientation within an ambient magnetic field. In the absence of local magnetic anomalies, the ambient magnetic field is the earth's magnetic field. A pendulous mass is commonly used to retain a vertical compass orientation to avoid contamination by the vertical component of the earth's magnetic field. A freely pivoting magnet will align itself with the ambient magnetic field. The compass bearing, .phi., is determined by measuring the angle between the compass case, which rotates in space, and the pivoting internal magnet, which maintains its alignment with the horizontal component of the earth's magnetic field.

If the compass code wheel is not aligned with the internal magnet, the compass output will be biased. Also, magnetic material (other than the single internal magnet) attached to the code wheel assembly will cause a bias in the compass output.

Magnetic material attached to the compass case will rotate around the internal magnet, causing sinusoidal errors in the compass output. The compass internal magnet aligns itself with the vector sum of the earth's field and the field of the magnetic material. The general expression for multiple pieces of magnetic material is:

where a is the bias error, discussed above, b and c are the sum of the amplitudes of the orthogonal components of the internal magnetic material, .theta. is the actual bearing of the compass case, and .phi. is the compass output heading.

The errors induced by permanently magnetized material are "one cycle" errors (i.e., functions of sin .theta. and cos .theta.) because the permanently magnetized material amplitude does not change as a function of .theta..

Permeable magnetic material will assume and magnify any field with which it is aligned. Therefore, permeable magnetic material attached to the compass case will rotate around the internal magnet, causing a "two cycle" error (i.e., functions of sin (2.theta.) and cos (2.theta.)) that can be expressed as:

where d and e are the sum of the maximum amplitudes of the orthogonal components of the internal permeable material. Note that the bias term, the "one cycle" errors, and the "two cycle" errors are all independent of any of the other errors, and therefore, error corrections or calibrations may be considered separately.

A well known method exists for calibrating and removing the compass deviation errors using five correction coefficients: A,B,C,D, and E, as discussed in the Handbook of Magnetic Compass Adjustment, Publication No. 226, Defense Mapping Agency Office, Stock No. NVPUB226, 1980. The A correction is simply the correction for compass bias or offset. The B and C corrections adjust for permanent magnetic anomalies within the compass, and the D and E corrections adjust for induced magnetic anomalies within the compass. The compass deviation correction for actual magnetic head is:

where .phi. is the compass reading. In order to calculate the deviation coefficients, it is necessary to place the compass on a rotary table with precise angular resolution and a known reference bearing. The compass must be rotated at a constant rate through 360.degree. in each direction while the table bearings and compass bearings are recorded at regular increments and known positions of table bearing.

Another method of data collection is to stop the table at each measurement point and allow the compass gimbal swing to settle out prior to taking data at each point. This alternate procedure is much slower even though only one revolution is required.

When the data is taken on the fly, the method for determining the A, B, C, D, and E coefficients is derived by noting that the average of the differences between the actual compass heading .theta. and the compass reading .phi. is the sum of the average lag and the average deviation:

The overbar indicates the average over all data points. Since the compass is rotated 360.degree. in each direction at the same rate, L=0. Thus,

Since A is constant for all values of .theta., A=.theta.-.phi..

To determine the B coefficient, each of the data points is multiplied by sin .theta.: sin .phi. sin 2.phi.+E sin .phi. cos 2.phi.

The only term on the right side of the equation that is not zero for 360.degree. rotations is

Therefore, B=2(.theta.-.phi.) sin .theta.. The same method can be used for computing the C, D, and E coefficients by multiplying each of the data points by cos .phi., sin 2.phi., and cos 2.phi., respectively. That is,

It should be noted that the A error will change if the compass alignment is not preserved in its final mount. The B, C, D, and E errors will vary if the compass is mounted in a magnetic environment that is different from the one in which the compass was calibrated. Finally, the B and C errors vary with latitude.

The requirement of an absolute reference and a precise rotation renders field calibration impractical for most compass applications. Gyro compasses aboard ships have been used for years as a reference for "swing ship" calibrations of magnetic compasses, but gyro errors during maneuvering situations prevent precise calibrations in most cases. Therefore, a simple, accurate, and rapid field calibration apparatus and technique for magnetic compasses are necessary, but not heretofore available.

The solid state compass according to the present invention comprises two coils capable of measuring the intensity of the earth's magnetic field, mounted orthogonally and concentrically in the horizontal plane, so that the center of each coil coincides with rotation of the gimbal system. The system according to the present invention then calculates the average signal from the field sensing coils, which is the offset or bias. The field sensing coils are rotated through a fixed earth field to provide a sampled sinusoidal signal through a minimum of 360.degree., and sampled at approximately equally spaced intervals, using the uncorrected compass output as a reference. Thereafter, the phase error is estimated and corrected. As a result, the present invention provides five separate error signals that are then used to provide a correct magnetic angle without extensive testing or complex and expensive equipment. The amplitude of each coil is further compensated to provide a normalized peak-to-peak signal from which the corrected angle may be determined.

These and other features according to the present invention will be better understood by reading the following detailed description, taken together with the drawing, wherein:

FIG. 1 is a schematic diagram showing the orientation of two field sensing coils; and

FIGS. 2-4 comprise a flow diagram sequence detailing the process according to the present invention.

The arrangement 50 of the two coils 52, 54 is shown in FIG. 1. The x coil 52 is parallel to the compass housing 56 so that when the compass is pointed north, the x coil 52 reads the magnitude of the horizontal magnetic field (H) and the y coil reads zero. Thus:

The compass heading .theta. is calculated by .theta.=arctan [Y/X]. The coil cruciform is symmetrical and fixed with respect to the compass case and contains no moving parts. It may be gimballed to provide a horizontal reference, or strapped down. The output signals from the coils 52 and 54 are sampled by respective signal samples 62 and 64 which provide a signal to the processor 60 for calculation of the bearing angle and to provide error correction. The errors are corrected during a calibration process, described below, when a calibration switch 66 enables the process. The samples 62 and 64 and the processor 60 may be analog, digital, or a combination thereof.

Any misalignment of the longitudinal axis of the x coil 52 and the lubber line 58 of the compass case 56 causes a bias error in the solid state compass that is identical to that of the optical compass, so that the compass output bearing is

where a is the alignment error and .theta. is the actual compass bearing.

Any permanent magnetic material attached to the compass case may be modelled as a bias term in each of the coil outputs. Consider a permanent magnet with field strength Hp that is oriented so that the angle between the x coil axis and the axis of the permanent magnet is .gamma.. The coil outputs are

Note that the values of Hp cos .gamma. and Hp sin .gamma. are constant because the permanent magnet is fixed with respect to the x and y coils and rotates with the compass case. If there were n permanent magnets within the case, then: +. . . Hp.sub.n cos .gamma..sub.n +. . . Hp.sub.n sin .gamma..sub.n

Since Hpi sin .gamma.i and Hpi cos .gamma.i are a set of constants for i=1 to n, the coil outputs may be expressed in general as:

where Px and Py are the summed effects of permanent magnetisum on the x coil and the y coil respectively. Therefore, any permanent magnetic material (not shown) with the compass or in the vehicle within which the compass is mounted creates a fixed DC level shift (bias) in each of the coil outputs. A small x coil bias (.vertline.Px.vertline.<<H) will create a B-type deviation error with B.perspectiveto.-Px/H. Also, a small y coil bias (.vertline.Py.vertline.<<H) will create a C-type deviation error with C Py/H. Therefore, for errors due to permanent magnetism of less than 15.degree., the solid state compass output is similar to that of the optical units. The errors may be corrected by removing the x and y coil bias prior to calculating the compass output azimuth .phi.. The bias removal is the preferable means of calibration, since the bias correction is latitude independent.

Any soft iron or permeable material will have some field induced within it by the presence of the earth's field. The soft iron effect may be modelled by a bar of permeable material (not shown) oriented so that the angle from the x coil axis to the bar axis is .gamma.. The magnitude of the field induced by the earth's field is a function of earth's field strength (H) and compass orientation (.theta.):

where Hs is the induced field strength, l is the ratio of induced field strength to earth's field strength when the bar is aligned with the earth's field, .theta. is the actual compass bearing, and .gamma. is the angle measured from the longitudinal axis of the x coil to the longitudinal axis of the permeable material.

The induced field sums vectorially with the earth's field in the x and y coil outputs: (.theta.+.gamma.) (.theta.+.gamma.)

Noting that cos (.theta.+.gamma.)= cos .gamma. cos .theta.- sin .gamma. sin .theta. and substituting it into the above expression yields:

As in the case of the level bias model, it is trivial to show that for N pieces of soft iron, the values of Hs cos .gamma. and Hs sin .gamma. may be replaced by +Hs.sub.n cos .gamma..sub.n

and

respectively. However, to demonstrate the physical process involved, the discussion will be continued using the single piece of soft iron as a model.

It is clear that the sinusoidal error term added to each coil causes an amplitude and phase shift in each of the coil outputs. The outputs may be written as

where: (.gamma..sub.x) (.gamma.y+90)

Since the precise value of the H-field is unimportant for compass applications, it may be assumed, without loss of generality, that Dx=1 and that the x coil is the reference coil. (2.theta.)]/{SQR(2)SQR[(1+D.sub.y.sup.2)+(1-D.sub.y.sup.2) cos 2.theta.]}

For D<10, 2.theta.)]/{SQR(2)[SQR(1+D.sup.2.sub.y)]} (2.theta.)

If the phase shifts in the X and Y coils are equal in magnitude and opposite in sign (.gamma.=.gamma..sub.y =-.gamma..sub.x), then (.theta.-.gamma.)+sin.sup.2 (.theta.+.gamma.)]}

For small values of .gamma.:

or

If the phase shifts in the x and y coils are not equal and opposite in sign, it is equivalent to phase shifting .phi. until the coil phase shifts are equal in magnitude and opposite in sign. In other words, the phase shift errors may be modelled as an A-type error and an E-type error.

The soft iron errors may be corrected by removing the gain mismatch and phase error between the coils. The removal of gain mismatch and phase error is the preferable means of calibration, since they are latitude independent corrections.

If the compass cruciform is not horizontal, then some of the horizontal field strength will be lost and some vertical component will be added. Specifically,

where P is the pitch angle, R is the roll angle, and z is the vertical field strength.

In order to calibrate a solid state compass, it is necessary to: of the compass.

In a controlled laboratory environment, the coil bias values may be measured by: (1) averaging data that is sampled at regular intervals around the compass, or by (2) identifying the minimum and maximum values for each coil and calculating the center value, or by (3) placing the compass in a mu-metal container and measuring the output in the absence of a magnetic field. For a field calibration, the second method is the simplest, i.e., to turn the compass through 360.degree., identify the minimum and the maximum points, and calculate the bias.

In a controlled laboratory environment, the coil gain mismatch may be measured by (1) averaging the squares of data that is sampled at regular intervals around the compass, or by (2) identifying the minimum and maximum values for each coil and forming a ratio, or by (3) inducing a known field in each coil, measuring its value, and forming a ratio. Again, for field calibration, use the second method.

The phase error between coils may be calculated from any ordered pair of x coil and y coil outputs, so that any data collected for steps 1 and 2 may be used in step 3. The preferred method is to select the phase error that minimizes the orthogonality errors between the pairs of coil outputs in the least-squares sense. The phase error may then be used to adjust the phase of the y coil output.

Any of the above calibration coefficients may be calculated using data collected during one or more compass revolution. The x coil absolute reference may be found by ensuring that the x coil reading is zero when placed at right angles to the lines of flux of the earth's magnetic field. The gimbals must be balanced so that the solid state coils do not pick up any components of the vertical field, or the vertical field may be measured by a third coil and the output signal may be used to remove the effect of vertical field bias in each coil output signal. If the gimbals are not properly balanced (with x,y coils horizontal) and the coil output signals are not corrected for the vertical field adjustment, the calibration procedure is still valid but only for the magnetic latitude where the calibration was conducted.

The calibration procedure may be alternately performed in part in the laboratory, wherein the following equations are computed: ##EQU1##

Using the corrected compass outputs after determining the above information, the next step is completed by measuring the difference between known headings and compass output headings. The result at any heading should be a fixed A, which is subtracted from the heading output as the final correction step.

or

Repeat the first step in a field to calibrate out the magnetic effects of the final housing for the sensor.

For small angle errors, (less than 15 degrees), the relationship between the optical compass correction values and the solid state compass corrections are as follows:

A calibration method has been developed to provide a simple procedure for field calibrating solid state compasses. The calibration technique requires only a slow rotation of the compass through at least 360.degree. and a digital computer for parameter calculations.

The process according to the present invention and implemented in the processor 60, described above, includes the process 100 steps illustrated by the flowchart comprising FIGS. 2-4. In FIG. 2, the process 100 is initialized at step 102, wherein the data point index I and other parameters are initialized and the coil values are read from the samplers at step 104. The signals read are processed to provide an angle from an arc tangent, which is also stored in step 106, which then issues instructions to indicate that the calibration turn may be begun at step 108. The signals from the orthogonal sensing coils are read at step 110, and smoothed angle estimates are provided at step 112. The step 114 provides the minimum/maximum routine after which a new value of angle is calculated at step 116 from the arctangent of the estimated signal values.

The process 100 continues on FIG. 3, wherein the relative magnitude of the angles .theta. and .theta..sub.R is determined at step 118 relative to an incremental value, initially 1.degree.. If the value of the angle is less than the reference .theta..sub.R plus the increment, the difference between the reference and the measured angle is compared to 370.degree. at step 120. If the magnitude is greater than 370.degree., the value K (maximum sample index number) is set to the value of index I, and index I is reset to zero, indicating that the calibration data is complete at step 122. Thereafter, the X and Y bias coefficients are determined at step 124 as well as determining the Y scale coefficient at step 126. If in step 118 the angle is not less than the reference angle plus an incremental value, the system begins step 128, calculating a .theta..sub.K, and storing a value at step 130, thereafter incrementing the index I by 1 at step 132 to resume the process beginning with step 120, discussed above. If the angle difference measured in step 120 is not greater than 370.degree., the system then jumps to step 110, to thereafter repeat the above-described sequence.

After computing the Y scale factor in step 126, the process 100 continues on FIG. 4, wherein the corrected signals are calculated at step 134. Afterwards, the I parameter is incremented by 1 at step 136. The sin value is calculated at step 138, whereafter the step 140 provides a sum of the calculated signals. At step 142, the index I is compared to the maximum data point index K, and if equal, the process continues at step 144, wherein the S.sub.phase parameter is calculated. The phase error is thereafter calculated at step 146, and finally the C.sub.phase value is calculated at step 148. Afterwards, the initialization and calibration program returns, and the compass may now produce precise angle readings according to the method according to the present invention.

Modifications and substitutions made by one skilled in the art according to the present invention are within the scope of the present invention, which is not to be limited except by the claims which follow.

## Claims

1. A method of providing a corrected compass bearing, comprising the steps of: including at least an X and a Y magnetic field sensor; each said X and said Y magnetic field sensors over all signals; signal; angle; signal components, respectively, therefrom; magnetic field sensor output signals; sensor; peak amplitudes of each magnetic field sensor and to measure a sinusoidal signal of each said magnetic field sensor; error signals of the magnetic field sensor signals; and the corresponding reference table output angle; .phi.+D sin 2.phi.+E cos 2.phi.; and

2. The method of claim 1, further including the step of correcting for vertical magnetic field components.

3. The method of claim 2, wherein the step of correcting for vertical magnetic field components includes at least one of: magnetic field.

4. A magnetic compass, comprising: magnetic field sensing means and a y magnetic field sensing means; output of each said magnetic field sensing means, wherein said uncorrected compass angle includes an average offset error, single cycle errors, and double cycle errors, said angle detection means having: angle; angle for permanent magnet anomalies; angle for induced magnetic anomalies; and errors between the phase angle of the X and Y magnetic field sensing means.

5. The magnetic compass of claim 4, further including field sensors and providing the sampled output signals to said angle detection means.

6. A magnetic compass, comprising: magnetic field sensing means and a y magnetic field sensing means; outpaut of each said magnetic field sensing means, wherein said uncorrected compass angle includes an average offset error, single cycle errors, and double cycle errors, said angle detection means having: angle; angle for permanent magnet anomalies; and angle for induced magnetic anomalies, wherein at least one of said means for correcting the average offset error, said single cycle error correction means, and said double cycle error correction means includes: a corrected angle output according to said uncorrected compass angle and said table data.