A magnetic compass can be used to determine a vehicle's heading angle or as part of a vector matching algorithm to determine a vehicles' attitude (roll and pitch angles) and heading angle. Even if the vehicle is tilted by some values of the pitch and roll angles, a three-axis magnetometer measuring all three components of Earth's magnetic field can still be used to determine the heading angle of the vehicle. However, the measurements of a magnetometer can be distorted by various types of magnetic disturbances near the magnetometer. Some types of magnetic disturbances, such as ferromagnetic materials, are referred to as “hard iron” biases and can add to the magnetic field measured by a magnetometer. Other types of magnetic disturbances referred to as “soft iron” biases can vary the magnitude and direction of the magnetic field near a magnetometer.
In one embodiment a system is provided. The system comprises an inertial measurement unit comprising one or more gyroscopes configured to measure angular velocity about a respective one of three independent axes and one or more accelerometers configured to measure specific force along a respective one of the three independent axes; a magnetometer configured to measure strength of a local magnetic field along each of the three independent axes; and a processing device coupled to the inertial measurement unit and the magnetometer; the processing device configured to compute kinematic state data for the system based on measurements received from the magnetometer and the inertial measurement unit. The processing device is further configured to calculate magnetometer measurement calibration parameters using a first technique when position data is unavailable and to calculate magnetometer measurement calibration parameters using a second technique when position data is available.
Understanding that the drawings depict only exemplary embodiments and are not therefore to be considered limiting in scope, the exemplary embodiments will be described with additional specificity and detail through the use of the accompanying drawings, in which:
In accordance with common practice, the various described features are not drawn to scale but are drawn to emphasize specific features relevant to the exemplary embodiments.
In the following detailed description, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of illustration specific illustrative embodiments. However, it is to be understood that other embodiments may be utilized and that logical, mechanical, and electrical changes may be made. Furthermore, the methods presented in the drawing figures and the specification are not to be construed as limiting the order in which the individual steps may be performed. The following detailed description is, therefore, not to be taken in a limiting sense.
In some embodiments, the system 100 also optionally includes one or more aiding sensors 114. Aiding sensors 114 provide additional measurements used to compute the kinematic state of the system 100. Some examples of aiding sensors include, but are not limited to, altimeters, cameras, global navigation satellite system (GNSS) receivers, Light Detection and Ranging (LIDAR) sensors, Radio Detection and Ranging (RADAR) sensors, star trackers, Sun sensors, and true airspeed sensors. Such exemplary aiding sensors are known to one of skill in the art and are not described in more detail herein.
The processing device 106 can include a central processing unit (CPU), microcontroller, microprocessor (e.g., a digital signal processor (DSP)), field programmable gate array (FPGA), application specific integrated circuit (ASIC), and other processing devices. The memory device 112 can include tangible media such as magnetic or optical media. For example, tangible media can include a conventional hard disk, compact disk (e.g., read only or re-writable), volatile or non-volatile media such as random access memory (RAM) including, but not limited to, synchronous dynamic random access memory (SDRAM), double data rate (DDR) RAM, RAMBUS dynamic RAM (RDRAM), static RAM (SRAM), etc.), read only memory (ROM), electrically erasable programmable ROM (EEPROM), and flash memory, etc. For example, in this embodiment, the processing device 106 is implemented as a central processing unit which includes or functions with software programs, firmware or other computer readable instructions stored on memory device 112 for carrying out various methods, process tasks, calculations, and control functions, used for the magnetometer calibration and compensation. For example, stored on memory device 112 in this embodiment are calibration and compensation instructions 116 and filter instructions 118, which are described in more detail below. In addition, in this embodiment memory device 112 includes an Earth Magnetic Field Model (EMFM) 120.
In operation, the IMU 104, the magnetometer 102, and optionally the one or more aiding sensors 114 provide respective measurements to the processing device 106. The processing device 106 executes filter instructions 118 to compute kinematic state data for the system 100, such as velocity, angular orientation, and/or position based on the received measurements. For example, the filter instructions 118 can implement a filter 115 such as a Kalman filter. Operation of a Kalman filter is known to one of skill in the art and not described in more detail herein.
The processing device 106 executes the calibration and compensation instructions 116 to calculate magnetometer compensation parameters based on kinematic state data and to compensate the magnetometer measurements based on the calculated parameters. For purposes of illustration,
In particular, additional details regarding the magnetometer calibration and compensation are discussed below with respect to
If position data is available at block 206, reference magnetic field values are obtained at block 208 from an Earth magnetic field model based on the position data. One such model of the Earth's magnetic field, known as the International Geomagnetic Reference Field (IGRF), is made publicly available by the National Oceanic and Atmospheric Administration (NOAA), for example. At block 210, calibration parameters are computed based on the reference magnetic field values from the EMFM and on the measured magnetic field values from the magnetometer 102. An exemplary method of computing calibration parameters when position information is available is described in more detail below with respect to
If position data is not available at block 206, calibration parameters are computed at block 214 based on the magnetometer measurements without the use of position information. For example, reference magnetic field values are not obtained as position data is unavailable. Thus, the calibration parameters are computed without the reference magnetic field values. An exemplary method of computing the calibration parameters without position data is described in more detail below. After computing the calibration parameters, the magnetometer measurements are compensated at block 212 as described in more detail below.
C
bm
m
m,k
m
=A
MC,k
m
t,k
b
+C
bm
b
m,k
m
+C
bm
n
m,k
m Eq. 1
In equation 1 above, Cbm is the direction cosine matrix from the magnetometer measurement frame to the body frame of the vehicle in which the system resides and mm,km is the magnetometer measurement vector for a time index k. The superscript m indicates that the measurement vector is resolved in the magnetometer measurement frame and the subscript m indicates that it is a measurement vector. Additionally, the quantity AMC,k is a 3×3 matrix representing the soft iron bias, misalignment errors, and scale factor errors for a time index k; mt,kb is a reference or true magnetic field vector resolved in the body frame of the vehicle for the time index k; bm,km is a hard iron bias vector resolved in the magnetometer measurement frame for the time index k; and nm,km is noise measurement vector resolved in the magnetometer measurement frame for the time index k. As used herein the magnetometer measurement frame refers to the orientation of the magnetometer measurement axes. Similarly, the body frame refers to the orientation of the vehicle in which the system 100 is located. The navigation frame, discussed below, is a frame independent of the vehicle and magnetometer orientation, such as the Earth-Centered, Earth-Fixed frame or local-level frame known to one of skill in the art.
The magnetometer measurement model can also be written as:
C
bm
m
m,k
m
=A
MC,k
C
bN,k
m
t,k
N
+C
bm
b
m,k
m
+C
bm
n
m,k
m Eq. 2
In equation 2, CbN,k is the direction cosine matrix from the navigation frame to the body frame; and mt,kN is the reference or true magnetic field vector resolved in the navigation frame. The hard iron bias vector, bm, represents magnetic fields typically generated by ferromagnetic materials with permanent magnetic fields. In this example, the hard iron bias is assumed to be a time-invariant, additive error. The soft iron bias matrix, Asi, represents magnetic fields typically generated by materials excited by externally generated fields or directly from the externally generated fields themselves. Scale factor error matrix, Asf, represents errors due to sensitivity to applied magnetic fields along a measurement axis. Misalignment error matrix, Am, represent errors due to misalignment of the measurement axes with the intended mounting angular orientation. Thus, the matrix, AMC, represents a combination of the soft iron bias, scale factor errors, and misalignment errors (i.e. AMC=AsiAsfAm). Thus, the matrix AMC can be written in matrix form as:
Similarly, the quantities CbN,kmt,kN, Cbmbm,km, and mm,kb can be written as follows:
In addition, in this exemplary embodiment, it is assumed that the noise vector is zero-mean, Gaussian, white noise and that the magnetometer measurement axes are aligned with the vehicles body axes (e.g. Cbm=I). The local true or reference magnetic field vector is selected from an EMFM based on input position data, as discussed above. The direction cosine matrix, CbN, can be calculated from roll, pitch, and heading angles from the data received from either the IMU 104 or filter 115, for example. Based on the above assumptions, equation 1 can be rewritten as:
m
m,k
b
=A
MC
C
bN,k
m
t,k
N
+b
m
b
+n
m,k
b Eq. 3
The measurement model can then be rewritten in batch form as shown in equation 4 below. As used herein, the notation E{ } indicates an expected value of the quantity surrounded by the brackets.
In equation 4, Y is the N×3 magnetometer measurement matrix, M is a N×4 matrix of estimated magnetic field values based on the EMFM, and X is a 4×3 matrix representing values of the AMC matrix and the hard iron bias vector, bm. Thus, solving for the values of the X matrix provides 12 calibration parameters for calibrating the magnetometer measurements.
After formulating the batch measurement model at block 302, a rank test is performed at block 304. In particular, the batch measurement model equation can be rewritten as follows:
Y=MX
M
T
Y=M
T
MX
X=(MTM)−1MTY
X=M
+
Y
where MT is the transpose matrix of M and M+ is the pseudoinverse of M.
Thus, the solution depends on the rank of M. For example, if M has full column rank, then the pseudoinverse M+ exists and all 12 magnetometer calibration parameters can be computed. For example, full column rank indicates that the vehicle has traveled a selected three-dimensional (3D) trajectory which involves sufficient maneuvers to observe all magnetometer modes or calibration parameters. If M does not have full column rank, then the pseudoinverse M+ does not exist. For example, if the selected vehicle trajectories do not permit observing all magnetometer modes or calibration parameters, then M will not have full rank.
However, the embodiments described herein permit the calculation of a subset of parameters even if M does not have full rank. Thus, the magnetometer measurements may still be calibrated even when all magnetometer modes have not been observed. Thus, calibration according to the embodiments described herein requires a reduced amount of maneuvers during calibration as compared to conventional calibration systems. For example, an initial calibration can be done using only heading maneuvers, such as can be performed by an aircraft, for example, while it is taxiing on the ground. Afterward, a few additional 3D maneuvers in the air can complete the calibration process.
To perform the rank test at block 304, a matrix decomposition of M is performed. For example, as described herein, a singular value decomposition is performed. However, it is to be understood that, in other embodiments, other matrix decomposition techniques known to one of skill in the art can be used instead of a singular value decomposition. As known to one of skill in the art, the singular value decomposition can be written as:
M=UΣV
T Eq. 5
The diagonal values of diagonal matrix Σ are the singular values of M. Each of the diagonal values is compared to a pre-determined threshold, ε. Thus, the rank is the number of singular values greater than the user-defined threshold ε. In some embodiments, the user-defined threshold is set equal to the magnitude of the unknown varying magnetic disturbances, due to things like varying magnetic fields from electrical devices, or variable amounts of iron in the soil over which the magnetometer is moving, as established from a priori experiments for example. If each of the diagonal values is greater than the threshold, then the matrix M has full column rank. In particular, in this example, if the rank of the matrix M is equal to 12 at block 304, then the processing device solves for all 12 parameters of a calibration matrix X at block 306 using the singular value decomposition of M and the magnetometer measurements in matrix Y (i.e.
X=VΣ
−1
U
T
Y)
If the rank of the matrix M is less than 12 at block 304, then the processing device applies an affine transformation to X, at block 308, that selects a linear combination of magnetometer calibration parameters. For example, the affine transformation can be expressed as:
X=T
1
X
A
+T
2 Eq. 6
For a two dimensional ground application, for example, an exemplary affine transformation can be written as:
At block 310, the processing device solves for a subset of the calibration parameters using the affine transformation. For example, by substituting in the affine transformation, the batch measurement model can be rewritten as:
Y−MT
2
=MT
1
X
A Eq. 7
The singular value decomposition of MT1 can be written as:
MT
1
=U
rΣrVrT
Solving for XA using the singular value decomposition yields:
E{X
A
}=V
rΣr−1UrT(Y−MT2)
After solving for XA, the processing device solves for X using the affine transformation and values of XA. Thus, method 300 provides computed values for a subset of the calibration parameters whether or not all magnetometer modes have been observed through sufficient maneuvers.
Method 400 presents one exemplary technique of computing such parameters and can be used to implement the computation performed at block 214 in Method 200. At block 402, the magnetometer measurement model is defined in the body frame, as shown in equation 8, for example.
Equation 8 is similar to Equation 3 above, with the addition of ∥mtN∥, which represents the magnitude of the local Earth magnetic field vector in the navigation frame. In addition, although the local Earth magnetic field vector is unknown, it is assumed that it is constant at the respective location of the magnetometer. It is also assumed in this example that the matrix AMC is non-singular and that the estimated direction cosine matrix CbN,k is orthonormal (e.g. it is assumed that equation 9 is true).
At block 404, the magnetometer measurement model is rewritten in a matrix form to separate known quantities from unknown quantities. For example, equation 8 can be approximated as:
Equation 10 can then be rearranged as shown in equation 11.
Multiplying each side of equation 11 by its transpose eliminates the unknown magnetic field unit vector, since
times its transpose is equal to one or the identity matrix. This results in equation 12a below.
(mm,kb−E{bmb})TE{(∥mtN∥AMC)−T}E{(∥mtN∥AMC)−1}(mm,kb−E{bmb})=1 Eq. 12a
Multiplying Eq. 12a by ∥mtN∥2 yields equation 12b.
(mm,kb−E{bmb})TE{(AMC)−T}E{(AMC)−1}(mm,kb−E{bmb})=∥mtN∥2 Eq. 12b
Equation 12b can be rewritten as equation 13.
(mm,kb−E{bmb})TQ(mm,kb−E{bmb})=∥mtN∥2 Eq. 13
In equation 13, Q is a matrix representing the quantity E{(AMC)−T}E{(AMC)−1}. Equation 13 can then be rewritten in matrix form to separate the known quantities from the unknown quantities as shown in equation 14.
The matrix P is a 4×4 matrix representing the unknown magnetometer calibration parameters as shown below.
Thus, Q is a 3×3 matrix represented by the elements P(1:3, 1:3). Additionally, the quantity −QE{bmb} is a vector equal to the first three elements in the 4th column of P (i.e. P(1:3, 4)). The quantity −E{bmbT}Q is a vector equal to the first three elements of the 4th row of P (i.e. P(4, 1:3)). The quantity E{bmbT}QE{bmb}−∥mtN∥2 is a scalar equal to the 4th element of the 4th row in the matrix P (i.e. P(4:4)).
At block 406, a solution for P is found using a least squares approach. For example, P can be rewritten in vector form as shown below.
The matrix Z is an N×10 matrix and is singular. Each kth row of the matrix Z can be represented as
Zk=└m1,k2 2m1,km2,k 2m1,km3,k 2m1,k m2,k2 2m2,km3,k 2m2,k m3,k2 2m3,k 1┘
Similarly, the vector Pvec can be represented as
The singular value decomposition of Z is represented as Z=UZΣZVZT, where UZ is a N×N matrix, ΣZ is an N×10 matrix, and VZ is a 10×10 matrix, as understood by one of skill in the art. The vector Pvec is equal to the tenth column of the VZ matrix (i.e. Pvec=VZ(:,10)). Thus, performing the singular value decomposition of Z provides the values of Pvec. The values of Pvec can then be used to fill in the entries of the P matrix which allows for the computation of an estimate of the hard iron bias E{bmb} at block 408. In particular, as stated above, the matrix Q is equal to P(1:3,1:3)) and −QE{bmb} is equal to P(1:3,4). Therefore, equation 16 can be derived from the above information to find an estimate of the hard iron bias, E{bmb}, in terms of the matrix P.
E{b
m
b
}=−[P(1:3,1:3)]−1P(1:3,4) Eq. 16
Thus, the hard iron bias is calculated based on a singular value decomposition of the matrix Z which contains entries based on the magnetometer measurements. After calculating estimated values of bmb, those values are used together with the magnetometer measurements to solve for an estimate of the 3×3 matrix which represents the soft iron bias, misalignment errors, and scale factor errors (i.e. E{AMC}), at block 410. In particular, a singular value decomposition of E{AMC} can be expressed as βUAΣAVAT. Substituting the singular value decomposition for E{AMC} in an equation for the matrix Q results in equation 17.
Q=(βUAΣAVAT)−T(βUAΣAVAT)−1=β−2UAΣA−TΣA−1UAT=P(1:3,1:3) Eq. 17
Since the matrix AMC cannot be uniquely determined from Q alone, equations 18-20 are identified to solve for VA.
The right hand side of equation 20 can be simplified and rewritten as equation 21.
In equation 21, VA,*1, VA,*2, VA,*3 are the columns of the matrix VA. Based on equation 21, a set of linear equations can be used to solve for VA. An exemplary set of linear equations is shown in matrix form in Eq. 22.
Using the known values discussed above, the set of linear equations can be solved using least squares to determine values of VA and the local Earth magnetic field vector. Substituting βUAΣAVAT for E{AMC} in equation 18 and solving for β results in equation 23.
Using the solution for VA and the local Earth magnetic field vector, a value for β can be computed. Using the values for β and VA, the values for the matrix AMC can be computed. Thus, even without position information and the corresponding data from an Earth magnetic field model, the method 400 provides the ability to calculate the magnetometer calibration parameters.
m
cal,k
b
=E{A
MC
−1}(mm,kb−E{bmb}) Eq. 24
After calibrating the magnetometer measurements, the calibrated measurements are leveled at block 504 to account for orientation of the vehicle. An exemplary equation to level the calibrated measurements is shown in equation 25.
m
cal,k
LL
=E{C
LLb,k
}m
cal,k
b Eq. 25
In equation 25, CLLb,k is a direction cosine matrix which rotates the calibrated measurements from the body frame to the local level frame. A local level frame is a frame for which two axes are in the tangent plane of the Earth. CLLb,k is a function of the estimated roll angle and pitch angle based on data from gyroscopes 108 in the IMU 104 or the filter 115. After leveling the calibrated measurements, the heading angle is computed at block 506 using the leveled measurements as expressed in equation 26.
Thus, based on the calibration parameters, method 500 calibrates the magnetometer measurements and compensates the heading angle derived from the magnetometer measurements.
At block 602, the magnetometer measurements are calibrated, as described above with respect to block 502 in method 500. At block 604, the calibrated magnetometer measurements are combined with measurements from an aiding sensor. For example, the magnetometer measurements are combined with the aiding sensor measurements for the two vectors resolved in the body frame. At block 606, the system position is used to determine the EMFM vector and the second vector resolved in the navigation frame. At block 608, the calibrated magnetometer measurement and the aiding sensor measurement are compared to the EMFM vector and the second vector resolved in the navigation frame to specify the three-dimensional angular orientation of the system.
Example 1 includes a system comprising: an inertial measurement unit comprising one or more gyroscopes configured to measure angular velocity about a respective one of three independent axes and one or more accelerometers configured to measure specific force along a respective one of the three independent axes; a magnetometer configured to measure strength of a local magnetic field along each of the three independent axes; and a processing device coupled to the inertial measurement unit and the magnetometer; the processing device configured to compute kinematic state data for the system based on measurements received from the magnetometer and the inertial measurement unit; wherein the processing device is further configured to calculate magnetometer measurement calibration parameters using a first technique when position data is unavailable and to calculate magnetometer measurement calibration parameters using a second technique when position data is available.
Example 2 includes the system of Example 1, wherein to calculate magnetometer measurement calibration parameters when position data is unavailable, the processing device is configured to: calculate a hard iron bias vector based on a matrix decomposition of a matrix containing entries based on magnetometer measurements; and calculate at least one of a soft iron bias matrix, a scale factor error matrix, and a misalignment error matrix using the magnetometer measurements and the hard iron bias vector.
Example 3 includes the system of Example 1, wherein to calculate magnetometer measurement calibration parameters when position data is available, the processing device is configured to: determine column rank of a matrix containing estimated magnetic field values obtained from an Earth Magnetic Field Map (EMFM) based on the position data; compute all of the magnetometer measurement calibration parameters for a magnetometer measurement model if the matrix has full column rank; and compute a subset of the magnetometer measurement calibration parameters if the matrix does not have full column rank.
Example 4 includes the system of Example 3, wherein to compute all of the magnetometer measurement calibration parameters when the matrix has full column rank, the processing device is configured to compute all of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values and on the magnetometer measurements from the magnetometer.
Example 5 includes the system of any of Examples 3-4, wherein to determine the column rank of the matrix containing estimated magnetic field values, the processing device is configured to: compute a matrix decomposition of the matrix containing estimated magnetic field values; and compare diagonal values in a diagonal matrix to a user selected threshold, the diagonal matrix obtained from the matrix decomposition of the matrix containing estimated magnetic field values; wherein the column rank is the number of diagonal values that are greater than the user selected threshold, the matrix having full column rank when each of the diagonal values is greater than the user selected threshold.
Example 6 includes the system of any of Examples 3-5, wherein to compute a subset of the magnetometer measurement calibration parameters when the matrix does not have full column rank, the processing device is configured to: apply an affine transformation to a calibration matrix containing variables representing the magnetometer measurement calibration parameters, the affine transformation selecting a linear combination of a subset of variables representing the magnetometer measurement calibration parameters; and compute values for the subset of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values, the magnetometer measurements from the magnetometer, and the affine transformation to the calibration matrix.
Example 7 includes the system of any of Examples 1-6, further comprising at least one aiding sensor configured to provide measurements to the processing device for computing the kinematic state data.
Example 8 includes the system of Example 7, wherein the at least one aiding sensor comprises one or more of an altimeter, camera, global navigation satellite system (GNSS) receiver, Light Detection and Ranging (LIDAR) sensor, Radio Detection and Ranging (RADAR) sensor, star tracker, Sun sensor, and true airspeed sensor.
Example 9 includes the system of any of Examples 1-8, wherein the processing device is configured to calibrate the magnetometer measurements based on the calculated calibration parameters; to level the calibrated magnetometer measurements; and to compensate a calculated heading angle based on the leveled magnetometer measurements.
Example 10 includes a method of calibrating magnetometer measurements, the method comprising: receiving magnetometer measurements from a magnetometer; obtaining attitude and heading measurements based on the magnetometer measurements and on measurements from an inertial measurement unit; determining if position data is available, the position data indicating an approximate geographic location of a system in which the magnetometer is located; when position data is not available, determining magnetometer measurement calibration parameters using a first technique without position data; and when position data is available, determining magnetometer measurement calibration parameters using a second technique based on the position data.
Example 11 includes the method of Example 10, wherein determining magnetometer measurement calibration parameters using the first technique comprises: calculating a hard iron bias vector based on a matrix decomposition of a matrix containing entries based on magnetometer measurements; and calculating at least one of a soft iron bias matrix, a scale factor error matrix, and a misalignment error matrix using the magnetometer measurements and the hard iron bias vector.
Example 12 includes the method of Example 10, wherein determining magnetometer measurement calibration parameters using the second technique comprises: obtaining estimated magnetic field values from an Earth Magnetic Field Map (EFMF) based on the position data; determining column rank of a matrix containing the estimated magnetic field values; computing all of the magnetometer measurement calibration parameters for a magnetometer measurement model if the matrix has full column rank; and computing a subset of the magnetometer measurement calibration parameters if the matrix does not have full column rank.
Example 13 includes the method of Example 12, wherein computing all of the magnetometer measurement calibration parameters when the matrix has full column rank comprises computing all of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values and on the magnetometer measurements from the magnetometer.
Example 14 includes the method of any of Examples 12-13, wherein determining the column rank of the matrix containing estimated magnetic field values comprises: computing a matrix decomposition of the matrix containing estimated magnetic field values; and comparing diagonal values in a diagonal matrix to a user selected threshold, the diagonal matrix obtained from the matrix decomposition of the matrix containing estimated magnetic field values; wherein the column rank is the number of diagonal values that are greater than the user selected threshold, the matrix having full column rank when each of the diagonal values is greater than the user selected threshold.
Example 15 includes the method of any of Examples 12-14, wherein computing a subset of the magnetometer measurement calibration parameters when the matrix does not have full column rank comprises: applying an affine transformation to a calibration matrix containing variables representing the magnetometer measurement calibration parameters, the affine transformation selecting a linear combination of a subset of variables representing the magnetometer measurement calibration parameters; and computing values for the subset of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values, the magnetometer measurements from the magnetometer, and the affine transformation to the calibration matrix.
Example 16 includes a program product comprising a processor-readable medium on which program instructions are embodied, wherein the program instructions are configured, when executed by at least one programmable processor, to cause the at least one programmable processor to: obtain attitude and heading measurements based on magnetometer measurements received from a magnetometer and on inertial measurements received from an inertial measurement unit; determine if position data is available, the position data indicating an approximate geographic location of a system in which the magnetometer is located; when position data is not available, determine magnetometer measurement calibration parameters using a first technique without position data; and when position data is available, determine magnetometer measurement calibration parameters using a second technique based on the position data.
Example 17 includes the program product of Example 16, wherein when position data is not available, the program instructions are further configured to cause the at least one programmable processor to: calculate a hard iron bias vector based on a matrix decomposition of a matrix containing entries based on magnetometer measurements; and calculate at least one of a soft iron bias matrix, a scale factor error matrix, and a misalignment error matrix using the magnetometer measurements and the hard iron bias vector.
Example 18 includes the program product of Example 16, wherein when position data is available, the program instructions are further configured to cause the at least one programmable processor to: obtain estimated magnetic field values from an Earth Magnetic Field Map (EFMF) based on the position data; determine column rank of a matrix containing the estimated magnetic field values; compute all of the magnetometer measurement calibration parameters for a magnetometer measurement model if the matrix has full column rank; and compute a subset of the magnetometer measurement calibration parameters if the matrix does not have full column rank.
Example 19 includes the program product of Example 18, wherein the program instructions are further configured to cause the at least one programmable processor to: compute all of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values and on the magnetometer measurements from the magnetometer when the matrix has full column rank; and when the matrix does not have full column rank: apply an affine transformation to a calibration matrix containing variables representing the magnetometer measurement calibration parameters, the affine transformation selecting a linear combination of a subset of variables representing the magnetometer measurement calibration parameters; and compute values for the subset of the magnetometer measurement calibration parameters based on a matrix decomposition of the matrix containing estimated magnetic field values, the magnetometer measurements from the magnetometer, and the affine transformation to the calibration matrix.
Example 20 includes the program product of any of Examples 18-19, wherein to determine the column rank of the matrix containing estimated magnetic field values, the program instructions are further configured to cause the at least one programmable processor to: compute a matrix decomposition of the matrix containing estimated magnetic field values; and compare diagonal values in a diagonal matrix to a user selected threshold, the diagonal matrix obtained from the matrix decomposition of the matrix containing estimated magnetic field values; wherein the column rank is the number of diagonal values that are greater than the user selected threshold, the matrix having full column rank when each of the diagonal values is greater than the user selected threshold.
Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that any arrangement, which is calculated to achieve the same purpose, may be substituted for the specific embodiments shown. For example, the techniques described herein can be used for calibration and compensation of magnetometer measurements in three dimensions or in two dimensions, as will be apparent to one of skill in the art. Therefore, it is manifestly intended that this invention be limited only by the claims and the equivalents thereof