The present inventions generally relate to apparatuses and methods for calibrating (i.e., determining) a complete set of attitude-independent parameters (scale, non-orthogonality/skew/cross-coupling, offset) of a three-axis magnetometer (TAM). Accuracy of the attitude-independent parameters is also calculated.
The increasingly popular and widespread mobile devices frequently include so-called nine-axis sensors which consist of a 3-axis (3-D) gyroscope, a 3-axis (3-D) accelerometer and a 3-axis (3-D) magnetometer. The 3-D gyroscope measures angular velocities. The 3-D accelerometer measures linear acceleration. The 3-D magnetometer measures a local magnetic field vector (or a deviation thereof). In spite of their popularity, the foreseeable capabilities of these nine-axis sensors are not fully exploited due to the difficulty of calibrating and removing undesirable effects from the magnetometer measurements on one hand, and the practical impossibility to make a reliable estimate of the yaw angle using only the gyroscopes and the accelerometer.
A rigid body's (i.e., by rigid body designating any device to which the magnetometer and motion sensors are attached) 3-D angular position with respect to an Earth-fixed gravitational orthogonal reference system is uniquely defined. When a magnetometer and an accelerometer are used, it is convenient to define the gravitational reference system as having the positive Z-axis along gravity, the positive X-axis pointing to magnetic North and the positive Y-axis pointing East. The accelerometer senses gravity defining the z-axis, and the magnetometer measurement is used to infer the magnetic North based on the Earth's magnetic field (noting here that it is known that the angle between the Earth's magnetic field and gravity is may be different from)90°). This manner of defining the axis of a gravitational reference system is not intended to be limiting. Other definitions of an orthogonal right-hand reference system may be derived based on the two known directions, gravity and the magnetic North.
Based on Euler's theorem, the body reference system and the gravitational reference system (as two orthogonal right-hand coordinate systems) can be related by a sequence of rotations (not more than three) about coordinate axes, where successive rotations are about different axis. A sequence of such rotations is known as an Euler angle-axis sequence. Such a reference rotation sequence is illustrated in
A 3-D magnetometer measures a 3-D magnetic field representing an overlap of a 3-D static magnetic field (e.g., Earth's magnetic field), hard- and soft-iron effects, and a 3-D dynamic near field due to external time dependent electro-magnetic fields. The measured magnetic field depends on the actual orientation of the magnetometer. If the hard-iron effects, soft-iron effects and dynamic near fields were zero, the locus of the measured magnetic field (as the magnetometer is oriented in different directions) would be a sphere of radius equal to the magnitude of the Earth's magnetic field. The non-zero hard- and soft-iron effects render the locus of the measured magnetic field to be an ellipsoid offset from origin.
Hard-iron effect is produced by materials that exhibit a constant magnetic field with respect to the magnetometer's body frame overlapping the Earth's magnetic field, thereby generating constant offsets of the components of the measured magnetic field. As long as the orientation and position of the sources of magnetic field resulting in the hard-iron effects relative to the magnetometer is not changing, the corresponding offsets are also constant.
Unlike the hard-iron effect that yields a constant magnetic field in the magnetometer's body frame, the soft-iron effect is the result of material that influences, or distorts, a magnetic field (such as, iron and nickel), but does not necessarily generate a magnetic field itself. Therefore, the soft-iron effect is a distortion of the measured field depending upon the location and characteristics of the material causing the effect relative to the magnetometer and to the Earth's magnetic field. Thus, soft-iron effects cannot be compensated with simple offsets, requiring a more complicated procedure.
Conventional methods (e.g., J. F. Vasconcelos et al., A Geometric Approach to Strapdown Magnetometer Calibration in Sensor Frame, Proceeding of IFAC Workshop on Navigation, Guidance, and Control of Underwater Vehicles (NGCUV), Killaloe, Ireland, Volume 2, 2008, and R. Alonso and M. D. Shuster. Complete linear attitude-independent magnetometer calibration, The Journal of the Astronautical Sciences, 50(4):477-490, October-December 2002) use nonlinear least square fit techniques to determine the attitude-independent parameters. These methods may diverge or converge to a local minimum instead of a global minimum issue, require iterations and two steps to determine a solution.
Another known method (D. Gebre-Egziabher et al., Calibration of Strapdown Magnetometers in Magnetic Field Domain. ASCE Journal of Aerospace Engineering, 19(2):1-16, April 2006) determines some of the attitude-independent parameters analytically but yields an incomplete solution which does not account for skew, and, therefore, determining only 6 of the total 9 parameters based on the assumption that the skew is zero.
Therefore, it would be desirable to provide devices, systems and methods that enable real-time reliable use of a magnetometer together with other motion sensors attached to a device for determining orientation of the device (i.e., angular positions including a yaw angle), while avoiding the afore-described problems and drawbacks.
Devices, systems and methods use a three-axis magnetometer (TAM) alone to determine its complete set of attitude-independent parameters (scale, non-orthogonality/skew/cross-coupling, offset) for calibrating its own manufacture error and those equivalent resulting from embedded hard-iron and soft-iron effects and to calculate accuracy of the determined attitude-independent parameters.
According to one exemplary embodiment, a method for calibrating attitude-independent parameters of a 3-D magnetometer is provided. The method includes storing and updating data related to a N×9 matrix T and a N×1 matrix U extended for each measurement with an additional row and an additional element, respectively, the additional row and the additional element being calculated based values measured by the 3-D magnetometer for the respective measurement. The method further includes calculating analytically (1) a symmetric non-orthogonal 3×3 matrix D representing scaling and skew of the 3-D magnetometer measured values and (2) a vector b representing bias of the 3-D magnetometer measured values, using the stored data and a singular value decomposition (SVD) method.
According to another exemplary embodiment, an apparatus configured to perform a calibration of attitude-independent parameters of a 3-D magnetometer includes an interface configured to receive field values measured on three axes by the 3-D magnetometer and a data processing unit. The data processing unit is configured (i) to store and update data related to a N×9 matrix T and a N×1 matrix U representing N measurements, after each measurement making the data correspond to an additional row of matrix T and an additional element of matrix U calculated using the received field values, and (ii) to calculate analytically (1) a symmetric non-orthogonal 3×3 matrix D representing scaling and skew of the 3-D magnetometer measured values and (2) a vector b representing bias of the 3-D magnetometer measured values, using the stored data and a singular value decomposition (SVD) method.
According to another exemplary embodiment, a computer readable medium storing executable codes which when executed by a processor make the processor execute a method for calibrating attitude-independent parameters of a 3-D magnetometer is provided. The method includes storing and updating data related to a N×9 matrix T and a N×1 matrix U extended for each measurement with an additional row and an additional element, respectively, the additional row and the additional element being calculated based values measured by the 3-D magnetometer for the respective measurement. The method further includes calculating analytically (1) a symmetric non-orthogonal 3×3 matrix D representing scaling and skew of the 3-D magnetometer measured values and (2) a vector b representing bias of the 3-D magnetometer measured values, using the stored data and a singular value decomposition (SVD) method.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate one or more embodiments and, together with the description, explain these embodiments. In the drawings:
The following description of the exemplary embodiments refers to the accompanying drawings. The same reference numbers in different drawings identify the same or similar elements. The following detailed description does not limit the invention. Instead, the scope of the invention is defined by the appended claims. The following embodiments are discussed, for simplicity, with regard to the terminology and structure of a sensing unit including a magnetometer attached to a rigid 3-D body (“the device”). However, the embodiments to be discussed next are not limited to these systems but may be used in other systems including a 3-D magnetometer or other sensor with similar properties.
Reference throughout the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of the present invention. Thus, the appearance of the phrases “in one embodiment” or “in an embodiment” in various places throughout the specification is not necessarily all referring to the same embodiment. Further, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
According to an exemplary embodiment illustrated in
A body coordinate system may be defined relative to the device's body 101 (see, e.g.,
Methods of calibrating the attitude-independent parameters that may be performed in the system 100 are described below. The data processing 130 may be connected to a computer readable medium 135 storing executable codes which, when executed, make the system 100 to perform calibration of the attitude-independent parameters. A method of calibrating the attitude-independent parameters may be performed for each data set of measurements received from the magnetometer but it is not required.
In the methods for calibrating attitude-independent parameters (scale, non-orthogonality/skew/cross-coupling, offset) of a three-axis magnetometer described below, the attitude-independent parameters are obtained as an analytical solution in a mathematical closed form (i.e., analytically), so that no divergence or convergence to a local minimum occurs. Moreover, no iterative computation is required, while the method can be performed in real time. Estimation accuracy of the parameters may be used to determine whether the calibration needs to be repeated for another measurement from the magnetometer at the same or different orientation or the current parameter values meet a desired accuracy criterion.
A system 300 used for collecting data to be used to calibrate the attitude-independent parameters is illustrated in
The sensor elements 310 output noisy and distorted signals representing sensed magnetic field values. The data collection block 320 prepares for parameter determination by accumulating the sensor data, sample-by-sample (e.g., measurement by measurement, for each time step). The parameter determination unit 330 computes the attitude-independent parameters to calibrate the sensor elements to provide a measurement of constant amplitude. The accuracy estimation unit 340 computes the error of the computed attitude-independent parameters, which indicates whether a pre-determined desired accuracy has been achieved.
The following Table 1 is a list of notations used to explain the algorithms related to the method for calibrating the attitude-independent parameters.
E
BR
−1
T
The signals detected by the sensing elements of the magnetometer are distorted by the presence of ferromagnetic elements in their proximity. For example, the signals are distorted by the interference between the magnetic field and the surrounding installation materials, by local permanently magnetized materials, by the sensor's own scaling, cross-coupling, bias, and by technological limitations of the sensor, etc. The type and effect of magnetic distortions and sensing errors are described in many publicly available references such as W. Denne, Magnetic Compass Deviation and Correction, 3rd ed. Sheridan House Inc, 1979.
The three-axis magnetometer reading (i.e., the 3-D measured magnetic field) has been modeled in the reference “A Geometric Approach to Strapdown Magnetometer Calibration in Sensor Frame” by J. F. Vasconcelos et al., Proceeding of IFAC Workshop on Navigation, Guidance, and Control of Underwater Vehicles (NGCUV), Killaloe, Ireland, Volume 2, 2008, as
{right arrow over (B)}k=SM×CNO×(CSI×EBRk×E{right arrow over (H)}+{right arrow over (b)}HI)+{right arrow over (b)}M+{right arrow over (n)}Mk. Equation 1
A more practical formulation from the reference “Complete linear attitude-independent magnetometer calibration” in The Journal of the Astronautical Sciences, 50(4):477-490, October-December 2002 by R. Alonso and M. D. Shuster and without loss of generality is:
Bk=(I3×3+D)−1×(O×Ak×H+b+nk) Equation 2
where D combines scaling and skew from both sensor contribution and soft-iron effects, O is the misalignment matrix combining both soft-iron effects and sensor's internal alignment error with respect to the Earth-fixed gravitational reference system, b is the bias due to both hard-iron effects and sensor's intrinsic contribution, n is the transformed sensor measurement noise vector with zero mean and constant standard deviation of σ.
Since both O and Ak only change the direction of the vector, the magnitude of O×Ak×H is a constant invariant of the orientation of magnetometer with respect to the Earth-fixed body reference system. Given that the points O×Ak×H are constrained to the sphere, the magnetometer reading Bk lies on an ellipsoid.
For any set of Bk, i.e. any portion of the ellipsoid, method of determining D and b simultaneously, analytically, with mathematical closed form are provided. Equation 2 is rewritten as
(I3×3+D)×Bk−b=O×Ak×H+nk Equation 3
The magnitude square on both side of Equation 3 are also equal which yields
|(I3×3+D)×Bk−b|2=|O×Ak×H|2+|nk|2+2·(O×Ak×H)T×nk Equation 4
Since |O×Ak×H|2=|H|2, Equation 4 can be rewritten as
|(I3×3+D)×Bk−b|2−|H|2|=|nk|2+2·(O×Ak×H)T×nk Equation 5
The right side of Equation 5 being a noise term, the solution to the Equation 5 can be a least square fit of |(I3×3+D)×Bk−b|2 to |H|2 as
However, since Equation 6 is a highly nonlinear function of D and b, there is no straightforward linear analytical solution.
Further, by using the definitions
ignoring the noise in Equation 5, and
|pD×Bk−b|2=|H|2 Equation 9
expanding equation 9, the following relation is obtained
To simplify Equation 10, Q elements are defined as follows:
Then, based on Equation 8, E is
Matrix pD can be determined using a singular value decomposition (SVD) method
u×s×v′=svd(E) equation 13
where s is a 3×3 diagonal matrix. Then applying square root on each element of S, one obtains another 3×3 diagonal matrix w and then pD as:
w=sqrt(s) Equation 14
pD=u×w×v′ Equation 15
Offset b is calculated as
In order to determine Q, an average over the three magnitudes of Q(1), Q(2), and Q(3) is defined as
Using a new parameter vector K
Equation 10 becomes
[Bx2+By2−2Bz2 Bx2−2By2+Bz2 2Bx·By 2Bx·Bz 2·By·Bz −2Bx −2By −2Bz 1]×K=−(Bx2+By2+Bz2) Equation 19
Let's define an N×9 matrix T and an N×1 vector U
With this notation, for N sample measurements Equation 19 becomes
T×K=U Equation 22
and can be solved by
K=(TT×T)−1×TT×U. Equation 23
Then from Equations 18 and 12, E may be written as
Let's define
Matrix G is then determined in the same manner as pD using Equations 13-15
pD=sqrt(co)·G Equation 26
Vector b is calculated by combining Equations 16, 18 and 26
b=sqrt(co)·G−1×[K(6) K(7) K(8)]T Equation 27
Substituting the definition of K(9) in Equation 18 and Equation 27 into Equation 11, co is calculated as follows
Finally, substituting Equation 28 into Equations 26 and 27, and then into Eq. 7, D and b are completely determined.
|H|2 can be referred to be the square of the local geomagnetic field strength. Even if the strength has an unknown value, it can be preset to be any arbitrary constant, the only difference for the solution being a constant scale difference on all computed 9 elements (3 scale, 3 skew, and 3 offset) of all three axes.
Based on the above-explained formalism, in a real-time exemplary implementation, for each time step, the data collection engine 320 stores two variable matrices: one 9×9 fixed-size matrix named L is used to accumulate TT×T, and the other fixed-size 9×1 matrix variable named M is used to accumulate TT×U. At time step n+1, the matrices are updated according to the following equations
Ln+1=Ln+(Tn+1T×Tn−1) Equation 29
Mn+1=Mn+(Tn+1T×Un+1) Equation 30
Tn+1, which is the element at n+1 row of T, and Un+1, which is the element at n+1 row of U, are functions of only magnetometer sample measurement at current time step. Then, based on Equation 23, K is determined and then, G is determined using Equations 13-15. A temporary variable b is calculated as
{tilde over (b)}=G−1×[K(6) K(7) K(8)]T Equation 31
The value of co is obtained by using this {tilde over (b)} into Equation 28 with a substitution of Equation 25. In addition, Equation 31 is substituted into Equation 27, and the calculated co is applied into Equations 26-27, and then, using Equation 7, D and b (i.e., the complete calibration set of attitude-independent parameters) are obtained.
The following algorithm may be applied to determine the accuracy of determining D and b. The error covariance matrix for the estimate of K is given by
PKK=σz2·(L)−1 Equation 32
where
σz2=12·|H|2·σ2+6·σ4 Equation 33
The Jacobian matrix of K with respect to the determined parameters
J=[bx by bz pD11 pD22 pD33 pD12 pD13 pD23]T Equation 34
is given as follows
Thus, the error covariance matrix of the estimate of J is given by
and the error of the estimate J is
εJ=sqrt(diag(PJJ)) Equation 39
The methods for calibrating attitude-independent parameters according to the above-detailed formalism can be applied to calibrate any sensor which measures a constant physical quality vector in the earth-fixed reference system, such as accelerometer measuring the earth gravity.
These methods can be applied to compute the complete parameter set to fit any ellipsoid to a sphere, where the ellipsoid can be offset from the origin and/or can be skewed. The methods provide a complete solution for all attitude-independent magnetometer calibration parameters analytically, i.e., a closed-form solution, which renders the calibration faster and avoids the divergence issue other existing methods face.
The methods can be used for dynamic time-varying |H|2as well as long as |H|2is known for each sample measurement.
The manner of defining co may be different from Equation 17, for example, other linear combinations of Q(1), Q(2), and Q(3) leading to similar or even better results. The general form of such linear combination is:
co=a1·Q(1)+a2·Q(2)+a3·Q(3) Equation 40
where the sum of those coefficients is 1, i.e., :
a1+a2+a3=1 Equation 41
The equations 20 and 21 can be extended to take measurement noise in different samples into account, the extended equations using the inverse of noise variances as weights:
Other functions of measurement error can also serve as weights for T and U in a similar manner.
A flow diagram of a method 400 for calibrating attitude-independent parameters of a 3-D magnetometer is illustrated in
The disclosed exemplary embodiments provide methods that may be part of a toolkit useable when a magnetometer is used in combination with other sensors to determine orientation of a device, and systems capable to use the toolkit. The methods may be embodied in a computer program product. It should be understood that this description is not intended to limit the invention. On the contrary, the exemplary embodiments are intended to cover alternatives, modifications and equivalents, which are included in the spirit and scope of the invention as defined by the appended claims. Further, in the detailed description of the exemplary embodiments, numerous specific details are set forth in order to provide a comprehensive understanding of the claimed invention. However, one skilled in the art would understand that various embodiments may be practiced without such specific details.
Exemplary embodiments may take the form of an entirely hardware embodiment or an embodiment combining hardware and software aspects. Further, the exemplary embodiments may take the form of a computer program product stored on a computer-readable storage medium having computer-readable instructions embodied in the medium. Any suitable computer readable medium may be utilized including hard disks, CD-ROMs, digital versatile disc (DVD), optical storage devices, or magnetic storage devices such a floppy disk or magnetic tape. Other non-limiting examples of computer readable media include flash-type memories or other known memories.
Although the features and elements of the present exemplary embodiments are described in the embodiments in particular combinations, each feature or element can be used alone without the other features and elements of the embodiments or in various combinations with or without other features and elements disclosed herein. The methods or flow charts provided in the present application may be implemented in a computer program, software, or firmware tangibly embodied in a computer-readable storage medium for execution by a specifically programmed computer or processor.
This application is a 371 U.S. National Stage entry of PCT Application No. PCT/US2011/061168, filed Nov. 17, 2011, which is related to, and claims priority from, U.S. Provisional Patent Application Ser. No. 61/414,570, entitled “Magnetometer Attitude Independent Parameter Calibration In Closed Form”, filed on Nov. 17, 2010, the disclosure of which is incorporated here by reference.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/US2011/061168 | 11/17/2011 | WO | 00 | 5/14/2013 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2012/068362 | 5/24/2012 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6577976 | Hoff | Jun 2003 | B1 |
6765383 | Barringer | Jul 2004 | B1 |
7451549 | Sodhi | Nov 2008 | B1 |
7930148 | Figaro | Apr 2011 | B1 |
20020100178 | Smith | Aug 2002 | A1 |
20040123474 | Manfred et al. | Jul 2004 | A1 |
20060066295 | Tamura | Mar 2006 | A1 |
20080222675 | Moshiri et al. | Sep 2008 | A1 |
20110077889 | Vogt | Mar 2011 | A1 |
20110106477 | Brunner | May 2011 | A1 |
Entry |
---|
Gebre-Egziabher, “Magnetometer Autocalibration Leveraging Measurement Locus Constraints”, 2007, Journal of Aircraft, vol. 44, No. 4, Jul.-Aug. 2007. |
Bonnet et al., “Calibration methods for inertial and magnetic sensors”, 2009, Sensors and Actuators A 156 (2009) 302-311. |
Vasconcelos Et Al., “Geometric Approach to Strapdown Magnetometer Calibration in Sensor Frame”, 2011, Ieee Transactions on Aerospace and Electronic Systems vol. 47, No. 2 Apr. 2011. |
International Preliminary Report on Patentability issued in corresponding International application No. PCT/US2011/061168, dated May 30, 2013. |
Thomas Bak; “Spacecraft Attitude Determination—a Magnetometer Approach”; Ph.D. Thesis, Department of Control Engineering, Aalborg University; ISBN 87-90664-03-5; Aug. 1999; pp. 1-192; Denmark. |
D. A. Turner, et al.; “An algorithm for fitting an ellipsoid to data”; University of Huddersfield, Queensgate, Huddersfield, HD1 3DH, UK; National Physical Laboratory; Dec. 1, 1999; pp. 1-12; Teddington, Middlesex, UK. |
International Search Report issued in corresponding International application No. PCT/US2011/061168, dated May 17, 2012. |
Alonso, R. et al., “Complete Linear Attitude-Independent Magnetometer Calibration,” The Journal of Astronautical Sciences, 50(4), pp. 477-490, Oct.-Dec. 2002. |
D. Gebre-Egziabher,et al.; “Calibration of Strapdown Magnetometers in Magnetic Field Doman”; Journal of Aerospace Engineering, ASCE; Apr. 2006; pp. 87-102. |
Number | Date | Country | |
---|---|---|---|
20130238268 A1 | Sep 2013 | US |
Number | Date | Country | |
---|---|---|---|
61414570 | Nov 2010 | US |