CALIBRATION OF MAGNETIC COMPASSES

Abstract: Magnetic compasses may be affected by local dis­ turbances in the magnetic field in their vicinity. These dis­ turbances may be caused by the addition or removal of a metal article concerned with a vehicle in which the compass is mounted, and may also be due to local variations in the Earth's magnetic field. The system described herein com­ pensates for such disturbances in the magnetic field to main­ tain the accuracy of the magnetic compass.

Description: This invention relates to the calibration of magnetic compasses to compensate for local disturbance of the magnetic field caused by the structure of the vehicle within which the compass is mounted. The ideal non-disturbed locus of a vector representing the magnitude of x,y and z signals output by a 3 axis magnetometer is a sphere centred on the origin of the x,y and z axes; however due to disturbances caused by the ferromagnetic structure of the vehicle carrying the magnetometer, the locus is transformed from a sphere to an ellipsoid offset from the origin of the x,y and z axes. In order therefore to take account of the transformation and offset of the locus and thus to obtain compensated x,y and z data it is necessary to apply a compensation which reverts the offset ellipsoid locus to the sphere located at the origin of the body axes. As a first step in this method, it is necessary to derive data which defines the ellipsoid representing the disturbed field. In published U.K. Application 2,128,749A the vehicle is moved through a setting routine to obtain 9 calibration points to allow determination of the coefficients of x,y and z in the equation:- ax²+by²+cz²+2fyz+2gzx+2hxy+2ux+2vy+2wz = d² Where x is the magnetic field sensed in the x direction y is the magnetic field sensed in the y direction z is the magnetic field sensed in the z direction This method involves finding the inverse of a 9 x 9 matrix and as such requires considerable computing power. In addition, it is found that with some selections of calibration points the above equation does not converge to an ellipsoid but instead fits the points to a non-ellipsoidal shape thus preventing implementation of valid compensation. In U.K. Application 2,128,749A, once the coefficients have been determined they are used to determine the translation needed to bring the ellipsoidal locus to the origin of the x, y and z axes, the amount of rotation to bring the major axis of the ellipsoid into coincidence with the y axis, the amount of scaling of the x, y and z axes to bring the ellipsoid into a sphere, and the amount of rotation to return the sphere back to its original position. U.S. Specification No. 4,414,753 also discloses a similar form of magnetic compass calibration. According to this invention, there is provided a magnetic compass for a vehicle adapted to enable the output of the compass to be compensated for disturbance to the magnetic field caused by said vehicle, and including: (i) three magnetic sensors for producing data representative of respective magnetic field components along respective nominally orthogonal body axes of the vehicle; (ii) data storage means for storing data produced by said sensors during a setting manoeuvre of the vehicle; and (iii) data processing means for using the stored data to determine a calibration function for adjusting data values produced by said magnetic sensors so that the locus of the adjusted values is a spheroid centred on the origin of the body axes, and for implementing said calibration function with respect to data received from the sensors thereby to obtain signals corresponding to orthogonal components of the magnetic field in which said disturbance has been compensated, characterised in that the said data processing means processes data stored in said data storage means to fit a generalised reduced quadric equation which defines an ellipsoid representing the locus of values of said signals and which is of the form: ax²+by²+½(a+b)z²+2hxy+2px+2qy+2sz-1 = 0 where x, y and z are values representing the magnetic field in the x, y and z directions, and determine the coefficients a, b, h, p, q and s, said calibration function being derived from these coefficients. By this arrangement it will be appreciated that the number of coefficients in the equation defining the ellipsoid has been reduced by three to six as compared with the arrangements disclosed in published Application No. 2,128,749A. This has the clear advantage that computing load is reduced, for in a "one shot" case the solution of the general quadric equation to find the values of the coefficients involves finding the inverse of a 6 x 6 matrix rather than the inverse of a 9 x 9 matrix. In addition, further work has shown that in fitting the sampled x, y and z data to the full model having 9 states, it is possible that the coefficients obtained will produce a non-ellipsoid fit; with the reduced 6 state model it is found that in all cases the surface generated will be an ellipsoid. Furthermore, there is excellent convergence. In one arrangement, referred to herein as the "one-shot" algorithm, data from the magnetic sensors is stored during a setting routine at the end of which the stored data is employed to derive the coefficients a, b, h, p, q and s. In this instance the data processing means employs a least squares method to fit the x, y, z data to the 6 state quadric equation. This gives rise to an equation of the form: a = A⁻¹ v where a is a 6 x 1 vector comprising the coefficients a, b, h, p, q and s; A is a 6 x 6 accumulation matrix array containing products of x, y and z data, and v is a 6 x 1 accumulation vector containing products of x, y and z data. By this arrangement, the variations in disturbance in the magnetic field, due for example to changes in the magnetic signature of the vehicle caused by addition or removal of metal articles, can be compensated, and the speed with which the adaptation is made can be controlled dependent on whether the error is a slow drift or a sudden, discrete change in the magnetic signature of the vehicle. In addition, as the vehicle travels across the earth's surface, the change in the magnetic field may be compensated. Also, an irregular data rate may be used. Certain specific embodiments of magnetic compass will now be described by way of example only, reference being made to the accompanying drawings, in which:- Figure 1 is a block diagram showing the processes involved in a magnetic compass incorporating a one shot, reduced model algorithm for calibration; Figure 2 is a block diagram showing the processes involved in a magnetic compass incorporating an adaptive calibration technique, and Figure 3 is a block diagram illustrating an embodiment of calibration apparatus for a magnetic compass. Initial studies were carried out in which a full general quadric of the form ax²+by²+cz²+2hxy+2fxz+2gyz+2px+2qy+2sz-1 = 0 (equation I) was fitted to x,y and z data received from the x,y and z axis magnetometers. The model worked well when adequate excursions were performed during the calibration manoeuvre, but when such excursions were not available the model's performance suffered and in particular in the z axis. In fact, in these cases the classical characteristic of parameter unobservability was seen: two z axis parameters 'fighting' each other, grossly mis-identified, yet compensating for each other's error. In many practical applications where the algorithm is require to run continuously, adequate manoeuvre for a full 3D calibration is unlikely for the majority of the time. In addition, solving the equations to determine the 9 parameters requires substantial computing power and places a high workload on the CPU. The inventors have proposed a reduced form of equation I in which by constraining the z axis parameters only 6 known parameters are involved. Two constraints are used:- (1) The z axis shape coefficient 'c' is constrained to lie between 'a' and 'b'. A general constraint of this form would give a least squares problem that would difficult to solve. Instead a more rigid constraint is applied: c = (a+b)/2 (2) The elimination of the modelling of rotations of the ellipsoid z axis about x or y. This is equivalent to setting f = g = ⊘ These constraints have the effect of limiting the model's accuracy to soft iron components in the z axis. Hard iron effects are modelled (by coefficient 's'), but the existence of soft iron effects will be absorbed by 's'. The reduced model now becomes ax²+by²+½(a+b)z²+2hxy+2px+2qy+2sz-1 = 0 (equation II) Applying the least squares fit technique to magnetometer data using this model gives the symmetric system of the form or A a = v (equation IV) In this expression λ = (x²+z²/2) µ = (y²+z²/2) In equation IV, A is an accumulation matrix comprising products of x,y,z, data up to the fourth order; a is a vector of model parameters; and v is an accumulation vector comprising products of x,y,z data up to the second power. A one shot algorithm is typically solved in this equation by Gaussian elimination - effectively finding the inverse of A. The benefits of the reduced model are: (1) A smaller model (6 states), which therefore represents a smaller processor work-load (and memory requirement). This benefit is useful because the difference is significant: work load is proportinal to N cubed in some places within the algorithm. (2) A guarantee of convergence if adequate fading excursions are performed. In the x-y plane the model is as good as a 2D model, and, provided at least half of an orbit is achieved, the x,y parameters will converge to an ellipse. When excursions in the z direction are achieved the z axis coefficients will begin to 'soak up' z axis errors. A number of simulation runs have been performed using this model. Figure-of-eight manoeuvres and pitch excursions were used in all occasions regions of varying magnetic dip. Convergence was achieved on and the error in the identified parameters in the x-y plane gave rise to small equivalent heading errors. The error in the z axis parameters is heavily dependent on the validity of the assumption that the z axis shape coefficient lies between the x and y axes shape coefficient. With data compatible with this assumption z axis errors are small; data that are not compatible with this assumption give rise to equivalent errors in the identified parameters. Once the parameters of the reduced model have been determined using the above method, the calibration coefficients - that is the translation of the ellipsoid to the origin of the x,y and z axes and its transformation into a sphere - are determined. The calibration coefficients are then applied to all subsequent data output by the magnetometers. The determination of the calibration coefficients is discussed in detail below. Referring to Figure 1, the compass includes three magnetic sensors aligned with the x,y and z body axes of the vehicle on which the compass is mounted. The sensors supply x,y and z data which is initially processed in accumulation processor 10 to accumulate the x,y and z data - that is to compute and store the 42 values constituting the A accumulation matrix and the v accumulation vector of equation IV. The values of A and v are then further processed in model coefficient determinator 11 effectively to find the inverse of A so as to find a in the equation a = A⁻¹ v where a , the vector representing the 6 model coefficients is then used to determine in a calibration coefficient processor 12 the calibration coefficients required to translate and transform the ellipsoidal locus of raw xyz into a spherical locus centred on (0,0,0). In order to allow the compass quickly to react to changes in magnetic signature or magnetic field, a second embodiment of magnetic compass incorporates an adaptive algorithm which continually updates a previous coefficient vector a . Equation IV may be re-written in a way that reflects a recursive approach: a n+1 = (A n +ΔA)⁻¹ ( v n +Δ v ) (equation V) where A n and v n are the accumulation arrays before the n+1 the update, and ΔA and Δ v are the increments to be made to the accumulators at the n+1 th update. It should be noted from inspection of equation III that the increment on the A matrix, ΔA can be formed from Δ v : A = Δ v Δ v T The matrix inversion lemma can be applied to the inverse to obtain a recursive expression in A⁻¹. The result is: It should be noted that in this expression the denominator term is scalar and we have avoided a matrix inverse; a modification term is added to the previous iteration's calculation of A⁻¹ to obtain the new value. In order to avoid potential problems caused by matrix multiplications and additions, it is proposed to employ a 'UD' (Upper Diagonal) method developed by Bierman known as Bierman's UD update algorithm. The method relies on a factorisation of matrix of the following form: A n ⁻¹ = UDU T where U is upper triangular with unit diagonals and D is diagonal. This factorisation is only possible if the inverse of A is symmetric; this is so in our case. With the inverse of A expressed in this form an update algorithm can be produced. It appears to be extremely complicated, but in practice lends itself to a computer implementation very well. Such an algorithm has been developed by Bierman, and details may be found in "Factorization Methods for Discrete Sequential Estimation" by G.J. Bierman (Academic Press 1972). The above recursive form requires an initial matrix inverse, A o ⁻¹, and vector, v o , to start it off. In general these can be of any value, but the way in which the solution will converge on the true solution will be dependent on these starting conditions. With no additional information, the best starting condition is probably one where A o ⁻¹ and v o are chosen to give the parameter vector a values representing a spheroid. Alternatively, if a one shot calibration can be carried out then the resultant A and v can be used. This second suggestion is not ideal; it would be undesireable to have both the one shot algorithm and the recursive algorithm in the computer. For this reason the former synthesised initial condition is used. Since the UD algorithm works on arrays U and D, and not A⁻¹, in the implementation U o and D o are actually required. So far the part of the recursive algorithm that computes the inverse of A has been discussed. To complete the process additional computation is necessary. A block diagram of a magnetic compass incorporating a complete recursive algorithm is given in Figure 2. This shows the first block 13 where the formulation of v and increments in v takes place. The second block 14 performs the UD update and the third stage 15 involves using the inverse matrix factors, U and D, and the accumulation vector v , to derive the model parameters a . Finally, the parameters are used in block 16 to form the calibration coefficients, details of which will be given later. The above defined algorithm has been tested; the tests were aimed at showing the following: (1) That synthetic initial conditions can be used to start the recursive algorithm. (2) The recursive algorithm is able to track a changing signature. (3) That different rates of convergence are possible by selection of the synthetic initial conditions. The tests were carried out using a figure-of-eight profile with pitch excursions in a north direction; noise of 0.5% in each axis and 600 data points . A number of different runs (different angles of dip and manoeuvre excursions) were used and on all occasions the recursive algorithm results maintained the correct solution. Variation in the identified calibration coefficients did occur due to noise and manoeuvre. The magnitude of this variation was less than 0.05% for the x and y coefficients and 0.15% for the z coefficients. The first test showed the algorithm can track changes in the magnetic signature. New data were then created with different model parameters and these were fed to the algorithm. All the model parameters slowly change values, converging towards those expected for the new model. Once a has been found in either of the above methods, the values of a,b,h,p,q and s are used to determine the calibration coefficients which translate and transform the raw x,y and z data. The origin of the fitted ellipsoid is formed by forming a symmetric matrix: This is reduced to a 3 x 3 matrix by setting (noting that f=g=0) and letting a'= a/cc b' = b/cc c' = c/cc = ½(a+b)/cc h' = h/cc where cc = 1-ax o ²-by o ²-cz o ²-2hx o y o -2px o -2qy o -2sz o The deflated matrix is now The calibration coefficients transformation calibration matrix is found by factorising B to give a diagonal matrix D: L T BL = D where L is lower triangular. Then the calibration matrix C is given by C = D -½ L where D(i,i) = 1/ d ii Then the magnetic field vector H and is given by where C is a 3 x 3 calibration matrix. is a vector representing the raw magnetic data. This vector is then adjusted to allow for attitude of the vehicle to obtain a converted vector H b H b = [dcm] [ H ] where [dcm] is the directional cosine matrix. The magnetic heading ψ is then obtained from the equation A discussion of various modifications to the above two embodiments now follows. AGE WEIGHTING In the recursive algorithm however, age-weighting is an important consideration. Firstly, the aim for the recursive algorithm is that it may adapt to vehicle magnetic signature changes. Secondly, because it will run continuously, without age-weighting the accumulators will overflow or underflow. The means by which age-weighting is achieved is straightforward: accumulator data are periodically weighted by a factor less than unity. The choice of value for this factor is dependent on sampling rate, and certain operation factors. If an irregular data rate is used (as in the case where prolonged straight and level flight data are excluded), it is not possible to deduce a time-constant as such. In this case it is necessary to think of the weighting constant in terms of number of samples accumulated: K = 2 m ... Fast Adaptation When there is a need for the algorithm to adapt quickly to a change in magnetic signature the age-weighting mechanism can be used to achieve this. A discrete input to the algorithm is necessary to initiate a weighting. The actual weight used to perform this function will be more severe than those suggested for continuous age-weighting. The value chosen will determine the degree of authority that is given to historic data compared with subsequent data. For example, if the value of G is chosen to be 0.5 then data collected up to the time of performing the weighting will be given half the authority compared with that given to data collected after the event. This will have the effect of halving the number of samples necessary to counteract those previously collected, thus shortening the time for the algorithm to converge to a new situation. Clearly, weighting factors between say 0.2 and 0.5 are likely to be used. The actual value chosen is dependent on the expected change of magnetic signature when stores are released. EARTH'S FIELD ESTIMATION A prerequisite of the recursive algorithm is the ability of being able to estimate the intensity of the earth's magnetic field. Intensity is important, because it effectively defines the 'size' of the ellipsoidal model. Spatial changes that cause intensity changes demand that the model adapts in sympathy. Direction of the earth's magnetic vector does not require identification. Direct Estimates The principle of direct estimation of the earth's field intensity relies on being able to process calibrated data. These data can be root-sum-squared to find the intensity. This is then used to normalise incoming data, thus compensating for field changes. The main difficulty with this principle is hew to handle the data when initially a full calibration is not available. We propose overcoming this difficulty as follows: (1) Initially, the calibration process will take place using some arbitrary normalisation. In this mode the initial calibration manoeuvre will take place in a locality. (2) This is followed by a period of field intensity estimation in the locality. (3) Stored data are normalised by the newly estimated intensity in a one-shot process. (4) Recursive calibration continues using current estates of intensity for normalisation. These four stages require triggering. The first is triggered by a discrete input that initiates the calibration. This must continue until sufficient manoeuvre has occurred, and when this has occurred the second stage can take place. This stage can be allowed to continue for a predetermined time or a number of samples. At the end of this period the third stage of the one-shot normalisation takes place. After this the algorithm operates in its normal running mode. Referring now to Figure 3, there is illustrated a specific embodiment of compass calibration device 20. Signals M x ,M y and M z from the x,y and z magnetometers are supplied from a pre-processing device 21 to a data accumulation store 22 together with initialisation data from an E² PROM device 23. The data from accumulation store 22 (corresponding to V ) is supplied to an UD update processor 24 where the values of v are used to update the UD matrix which is held in the E² PROM device 23 and which corresponds to A⁻¹ mentioned earlier. The UD matrix is then processed at 25 for UD separation and vector formation. The offsets are then calculated at 26 which identify the offset of the centre of the ellipsoidal locus from the origin of the x,y and z axes. The calibration matrix is calculated at 27 to determine the shaping matrix which converts the ellipsoidal locus into a spheroid. The offset data and the calibration matrix are applied to raw data in the sensor compensation device 28 to obtain compensated magnetic components H b x ,H b y and H b z . The calibration matrix and the offsets are also stored in the E² PROM device 23. An intensity estimator 29 receiving compensated signals from the sensor compensation is operable in response to a discrete input to estimate the intensity of the magnetic field and this data may be used thereafter to normalise the incoming data. Age weighting of the data is effected at 30.

Claims: A magnetic compass for a vehicle adapted to enable the output of the compass to be compensated for disturbance to the magnetic field caused by said vehicle, and including: (i) three magnetic sensors for producing data representative of respective magnetic field components along respective nominally orthogonal body axes of the vehicle; (ii) data storage means for storing data produced by said sensors during a setting manoeuvre of the vehicle; and (iii) data processing means for using the stored data to determine a calibration function for adjusting data values produced by said magnetic sensors so that the locus of the adjusted values is a spheroid centred on the origin of the body axes, and for implementing said calibration function with respect to data received from the sensors thereby to obtain signals corresponding to orthogonal components of the magnetic field in which said disturbance has been compensated, characterised in that the said data processing means processes data stored in said data storage means to fit a generalised reduced quadric equation which defines an ellipsoid representing the locus of values of said signals and which is of the form: ax²+by²+½(a+b)z²+2hxy+2px+2qy+2sz-1 = 0 where x, y and z are values representing the magnetic field in the x, y and z directions, and determine the coefficients a, b, h, p, q and s, said calibration function being derived from these coefficients. A compass according to claim 1, wherein the data from the magnetic sensors is stored during a setting routine at the end of which the stored data is employed to derive the coefficients a, b, h, p, q and s. A compass according to claim 2, wherein the data processing means employ a least squares method to fit the x, y, z data to the 6 state quadric equation giving rise to an equation of the form: a = A⁻¹ v where a is a 6 x 1 vector comprising the coefficients a, b, h, p, q and s; A is a 6 x 6 accumulation matrix array containing products of x, y and z data, and v is a 6 x 1 accumulation vector containing products of x, y and z data.

Inventors: FORTUNE, DAVID JOHN, MAXWELL, DAVID JAMES BRITISH AEROSPACE PLC, TRETHEWEY, MICHAEL LESLIE, WORCESTER, PAUL LIONEL ALBERT BRITISH AEROSP. PLC
Applicants: BRITISH AEROSPACE PUBLIC LIMITED COMPANY
Application year: 1986
Main classification: G01C17
IPC codes: G01C17