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.

Description:
FIELD OF THE INVENTION 
     The present invention relates to compasses, and in particular to magnetic compasses having orthogonal field sensing elements and error correction systems attached thereto. 
     BACKGROUND OF THE INVENTION 
     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&#39;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&#39;s magnetic field. A freely pivoting magnet will align itself with the ambient magnetic field. The compass bearing, φ, 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&#39;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&#39;s field and the field of the magnetic material. The general expression for multiple pieces of magnetic material is: 
     
         φ=θ+a+b sin +c cos θ 
    
     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, θ is the actual bearing of the compass case, and φ is the compass output heading. 
     The errors induced by permanently magnetized material are &#34;one cycle&#34; errors (i.e., functions of sin θ and cos θ) because the permanently magnetized material amplitude does not change as a function of θ. 
     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 &#34;two cycle&#34; error (i.e., functions of sin (2θ) and cos (2θ)) that can be expressed as: 
     
         φ=θ+d sin (2θ)+e cos (2θ) 
    
     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 &#34;one cycle&#34; errors, and the &#34;two cycle&#34; 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: 
     
         deviation correction=A+B sin φ+C cos φ+D sin 2φ+E cos 2φ 
    
     where φ 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° 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 θ and the compass reading φ is the sum of the average lag and the average deviation: 
     
         θ-φ=L+A+B sin φ+C cos φ+D sin 2φ+E cos 2φ 
    
     The overbar indicates the average over all data points. Since the compass is rotated 360° in each direction at the same rate, L=0. Thus, 
     
         θ-φ=A+B sin φ+C cos φ+D sin 2φ+E sin 2φ 
    
     Since A is constant for all values of θ, A=θ-φ. 
     To determine the B coefficient, each of the data points is multiplied by sin θ: 
     
         (θ-φ) sin φ=A sin φ+B sin 2φ+C sin φ cos φ+D sin φ sin 2φ+E sin φ cos 2φ 
    
     The only term on the right side of the equation that is not zero for 360° rotations is 
     
         B sin (2φ)=B/2 
    
     Therefore, B=2(θ-φ) sin θ. The same method can be used for computing the C, D, and E coefficients by multiplying each of the data points by cos φ, sin 2φ, and cos 2φ, respectively. That is, 
     
         B=2(θ-φ) sin φ 
    
     
         C=2(θ-φ) cos φ 
    
     
         D=2(θ-φ) sin (2φ 
    
     
         E=2(θ-φ) cos (2φ 
    
     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 &#34;swing ship&#34; 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. 
     SUMMARY OF THE INVENTION 
     The solid state compass according to the present invention comprises two coils capable of measuring the intensity of the earth&#39;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°, 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. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     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. 
    
    
     DETAILED DESCRIPTION OF THE 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: 
     
         y coil=H sin θ 
    
     
         x coil=H cos θ 
    
     The compass heading θ is calculated by θ=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 
     
         φ=a+θ 
    
     where a is the alignment error and θ 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 γ. The coil outputs are 
     
         X coil=H cos θ+Hp cos γ 
    
     
         Y coil=H sin θ+Hp sin γ 
    
     Note that the values of Hp cos γ and Hp sin γ 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: 
     
         X coil=H cos θ+Hp.sub.1 cos γ.sub.1 +Hp.sub.2 cos γ.sub.2 +. . . Hp.sub.n cos γ.sub.n 
    
     
         Y coil=H sin θ+Hp.sub.1 sin γ.sub.1 +Hp.sub.2 sin γ.sub.2 +. . . Hp.sub.n sin γ.sub.n 
    
     Since Hpi sin γi and Hpi cos γi are a set of constants for i=1 to n, the coil outputs may be expressed in general as: 
     
         X coil=H cos θ+Px 
    
     
         Y coil=H sin θ+Py 
    
     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 (|Px|&lt;&lt;H) will create a B-type deviation error with B≃-Px/H. Also, a small y coil bias (|Py|&lt;&lt;H) will create a C-type deviation error with C Py/H. Therefore, for errors due to permanent magnetism of less than 15°, 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 φ. 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&#39;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 γ. The magnitude of the field induced by the earth&#39;s field is a function of earth&#39;s field strength (H) and compass orientation (θ): 
     
         Hs=lH cos (θ+γ) 
    
     where Hs is the induced field strength, l is the ratio of induced field strength to earth&#39;s field strength when the bar is aligned with the earth&#39;s field, θ is the actual compass bearing, and γ 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&#39;s field in the x and y coil outputs: 
     
         X coil=H cos θ+Hs cos γ=H cos θ+lH cos γ cos (θ+γ) 
    
     
         Y coil=H sin θ+Hs sin γ=H sin θ+lH sin γ cos (θ+γ) 
    
     Noting that cos (θ+γ)= cos γ cos θ- sin γ sin θ and substituting it into the above expression yields: 
     
         X coil=H(1+lH cos γ) cos θ-lH sin γ sin θ 
    
     
         Y coil=H(1-lH sin γ) sin θ+lH cos γ cos θ 
    
     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 γ and Hs sin γ may be replaced by 
     
         Hs.sub.x =Hs.sub.1 cos γ.sub.1 +Hs.sub.2 cos γ.sub.2 +. . . +Hs.sub.n cos γ.sub.n 
    
     and 
     
         Hsy=Hs1 sin γ1+Hs2 sin γ2+. . . Hsn sin γn 
    
     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 
     
         X coil=D.sub.x H cos (θ+γ.sub.x) 
    
     
         Y coil =D.sub.y H sin (θ+γ.sub.y) 
    
     where: 
     
         γ.sub.x =-cotan.sup.-1 {[1+lH cos γ]/l sin γ} 
    
     
         γ.sub.y =tan.sup.-1 {[-l cos γ]/[1-lH sin γ]} 
    
     
         D.sub.x =(1+lH cos γ) cos (γ.sub.x)-l sin γ sin (γ.sub.x) 
    
     
         D.sub.y =(1-lH sin γ) sin (γy+90)+l cos γ cos (γ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. 
     
         sin (φ-θ)=[(D.sub.y -1) sin (2θ)]/{SQR(2)SQR[(1+D.sub.y.sup.2)+(1-D.sub.y.sup.2) cos 2θ]} 
    
     For D&lt;10, 
     
         φ-θ≃[(D.sub.y -1)(sin 2θ)]/{SQR(2)[SQR(1+D.sup.2.sub.y)]} 
    
     
         φ≃θ+[D.sub.y -1]/[SQR(2)SQR(1+D.sub.y.sup.2)] sin (2θ) 
    
     If the phase shifts in the X and Y coils are equal in magnitude and opposite in sign (γ=γ y  =-γ x ), then 
     
         sin (φ-θ)=(sin γ cos 2θ)/{SQR[ cos.sup.2 (θ-γ)+sin.sup.2 (θ+γ)]} 
    
     For small values of γ: 
     
         φ-θ≃γ cos 2θ 
    
     or 
     
         φ=θ+γ cos 2θ 
    
     If the phase shifts in the x and y coils are not equal and opposite in sign, it is equivalent to phase shifting φ 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, 
     
         X coil=H[ cos θ cos P+sin P cos R]+z[ sin P cos R] 
    
     
         Y coil=H[ cos θ cos R+sin R cos P]+z[ cos P sin R] 
    
     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: 
     1. Remove the bias errors from each coil; 
     2. Remove the vertical field component from each coil; 
     3. Remove the gain mismatch between the two coils; 
     4. Remove the phase error between the two coils; and 
     5. Correct for misalignment between the x coil axis and the lubber&#39;s line 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°, 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&#39;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: 
     
         X=X.sub.coil -X.sub.bias ##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. 
     
         φ=arctan (Y/X)-A 
    
     or 
     
         φ=A+arctan (Y/X) 
    
     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≃A 
    
     
         B≃ sin.sup.-1 (X bias/H) 
    
     
         C≃-sin.sup.-1 (Y bias/H) 
    
     
         D≃tan.sup.-1 (Y scale)-45° 
    
     
         E≃sin.sup.-1 (S phase)/2 
    
     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° 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 θ and θ R  is determined at step 118 relative to an incremental value, initially 1°. If the value of the angle is less than the reference θ R  plus the increment, the difference between the reference and the measured angle is compared to 370° at step 120. If the magnitude is greater than 370°, 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 θ 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°, 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 phase  parameter is calculated. The phase error is thereafter calculated at step 146, and finally the C 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.