System and method for fast magnetometer calibration using a gyroscope

By combining the Kalman filter and the least squares process to utilize gyroscope and magnetometer signals, the problems of interference and complex user operations in magnetometer calibration are solved, fast and accurate magnetometer calibration is achieved, and the orientation accuracy and user experience of electronic devices are improved.

CN114719846BActive Publication Date: 2025-09-26STMICROELECTRONICS(US)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111619220.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-12-28
Filing Date
2021-12-27
Publication Date
2025-09-26
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

When a magnetometer in an electronic device is interfered with by magnetic fields other than the Earth's magnetic field, it can cause inaccurate orientation or heading measurements. The existing calibration process is complex and inconvenient for users to operate.

Method used

The Kalman filter and least squares process are used to combine the gyroscope sensor signals and the magnetometer sensor signals. Multiple calibration techniques are used to enhance each other, generate calibration parameters and verify their consistency, reducing user operations and achieving fast and accurate calibration.

Benefits of technology

This allows for quick and accurate calibration of the magnetometer with little or no user intervention, ensuring the orientation accuracy of the electronic device and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114719846B_ABST
    Figure CN114719846B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a system and method for rapid magnetometer calibration using a gyroscope. An electronic device includes a magnetometer that outputs a magnetometer sensor signal and a gyroscope that outputs a gyroscope sensor signal. The electronic device includes a magnetometer calibration module that calibrates the magnetometer using the gyroscope sensor signal. The electronic device generates first magnetometer calibration parameters based on a Kalman filter process. The electronic device generates second magnetometer calibration parameters based on a least-squares estimation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to electronic devices including magnetometers, and more particularly, to systems and methods for calibrating magnetometers in electronic devices. Background Art

[0002] Many types of electronic devices use sensors to determine the position and orientation of the electronic device. For example, smart phones, smart watches, navigation devices, augmented reality / virtual reality glasses, electronic compasses in cars, and other types of electronic devices use sensors to determine the position and orientation of the electronic device.

[0003] GPS systems are very useful for determining the location of electronic devices on Earth. However, GPS systems are generally unable to determine the orientation or heading of electronic devices. Electronic devices often use magnetometers to help determine the orientation or heading of electronic devices. Magnetometers determine the direction of electronic devices relative to the Earth's magnetic field. However, if there are other magnetic field sources near the electronic device, the magnetometer may provide incorrect orientation or heading. Summary of the Invention

[0004] The principles of the present disclosure provide an electronic device with a sensor module that can quickly and accurately calibrate the sensor module's magnetometer. The calibration process utilizes multiple separate calibration techniques to calibrate the magnetometer. Each calibration technique utilizes gyroscope sensor signals and magnetometer sensor signals to calibrate the magnetometer. The multiple calibration techniques can enhance each other to ensure accurate calibration.

[0005] In some embodiments, the sensor module utilizes both a Kalman filter process and a least squares process to calibrate the magnetometer. The Kalman filter calibration process and the least squares calibration process utilize gyroscope sensor signals and magnetometer sensor signals to generate calibration parameters that help filter out magnetic field sources other than the Earth's magnetic field. The calibration parameters generated by the Kalman filter and the least squares process are checked against each other to ensure that the calibration parameters found by the two processes are aligned with each other.

[0006] The sensor module performs the calibration process with minimal or no interference to the user of the electronic device. In some cases, the user can make some simple gestures to assist the calibration process. In other cases, the sensor module can perform the calibration process without instructing the user to make any additional movements. The result is an effective, efficient, and unobtrusive calibration process. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 is a block diagram of an electronic device according to one embodiment.

[0008] Figure 2is a block diagram of a magnetometer calibration module according to one embodiment.

[0009] Figure 3 is a timeline of multiple instances of a Kalman filter and a least squares process of a magnetometer calibration module according to one embodiment.

[0010] Figure 4 is a block diagram of a Kalman filter module of a magnetometer calibration module according to one embodiment.

[0011] Figure 5 is a block diagram of a verification unit of a magnetometer calibration module according to one embodiment.

[0012] Figure 6 is an illustration of a smartwatch including a sensor module according to one embodiment.

[0013] Figure 7 is an illustration of a virtual reality head mounted device including a sensor module according to one embodiment.

[0014] Figure 8 is a flow chart of a process for operating an electronic device according to one embodiment.

[0015] Figure 9 is a flow chart of a process for operating an electronic device according to one embodiment. DETAILED DESCRIPTION

[0016] In the following description, certain specific details are set forth in order to provide a thorough understanding of the various disclosed embodiments. However, one skilled in the relevant art will recognize that the embodiments can be practiced without one or more of these specific details, or with other methods, components, materials, etc. In other instances, well-known aspects of the electronic devices and sensor modules are not shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.

[0017] Unless the context requires otherwise, throughout the specification and the claims that follow, the word "include" and variations thereof, such as "comprises" and "comprising," should be construed as open ended, i.e., to mean "including but not limited to." Furthermore, the terms "first," "second," and similar ordinal indicators should be construed as interchangeable unless the context clearly dictates otherwise.

[0018] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0019] As used in this specification and the appended claims, the singular forms "a," "an," and "the" include plural referents unless the content clearly dictates otherwise. It should also be noted that the term "or" is generally used in its broadest sense, i.e., as "and / or," unless the content clearly dictates otherwise.

[0020] Figure 1 1 is a block diagram of an electronic device 100 according to one embodiment. The electronic device 100 includes a magnetometer 102 and a gyroscope 104. As will be described in more detail below, the electronic device 100 utilizes both signals from the magnetometer 102 and signals from the gyroscope 104 to calibrate the magnetometer 102. In addition, the electronic device 100 utilizes a Kalman filter calibration process and a least squares calibration process that are independent of each other to calibrate the magnetometer 102.

[0021] The electronic device 100 utilizes various sensors to determine position, motion, orientation, and heading in a global reference frame. The electronic device 100 may include one or more of the following: a smartphone, a navigation device, a smartwatch, an augmented reality (AR) / virtual reality (VR) headset, an electronic compass in a car rearview mirror, or other types of electronic devices.

[0022] The magnetometer 102 senses the magnetic field near the electronic device 100. The magnetometer 102 outputs a magnetic sensor signal indicating the strength and direction of the magnetic field at the location of the electronic device 100. The electronic device 100 can use the magnetic sensor signal to help determine the orientation of the electronic device 100. This orientation corresponds to the current orientation of the electronic device 100. In the example where the electronic device 100 is an AR / VR headset, the orientation may indicate the direction the headset is facing. If a user is wearing the headset, the orientation indicates the direction the user is looking.

[0023] The magnetometer 102 may include a multi-axis magnetometer. The multi-axis magnetometer 102 senses the magnitude of the magnetic field in each of the multiple axes. The magnetic sensor signal may include a magnetic field intensity value sensed along each of the multiple axes. In one example, the multi-axis magnetometer 102 is a three-axis magnetometer. These axes are orthogonal to each other and may be labeled as the X, Y, and Z axes. The relative orientation of the axes may be based on the orientation of the magnetometer 102 within the electronic device 100. The magnetometer 102 may be a magnetoresistive sensor, a solid-state Hall effect sensor, an inductive coil-based sensor, or other type of magnetic sensor.

[0024] The electronic device 100 determines its orientation largely based on the Earth's magnetic field. For a given latitude and longitude on the Earth's surface, the Earth's magnetic field is relatively constant in both magnitude and direction. Therefore, the strength and direction of the magnetic field sensed by the magnetometer can provide a strong indication of the orientation of the electronic device 100 relative to the Earth's magnetic field.

[0025] However, the electronic device 100 may be present in magnetic fields other than the Earth's magnetic field. For example, the electronic device 100 may be near a permanent magnet, an electromagnet, or other magnetic field source. The presence of these other magnetic fields can obscure the Earth's magnetic field. If these other magnetic fields are not taken into account, the electronic device 100 may generate an erroneous direction estimate. This may result in improper functioning of the electronic device 100 and a frustrating experience for the user.

[0026] To account for the presence of magnetic fields other than the Earth's magnetic field, the electronic device 100 includes a magnetometer calibration module 106. The magnetometer calibration module 106 receives magnetic sensor signals from the magnetometer 102 and generates one or more calibration parameters. The calibration parameters may include a hard iron offset parameter. The hard iron offset represents the magnitude and direction of a constant magnetic field other than the Earth's magnetic field. The magnetometer calibration module 106 utilizes the hard iron offset parameter or other calibration parameters to filter out other magnetic fields or otherwise isolate the Earth's magnetic field from the magnetic sensor signals from the magnetometer 102.

[0027] The traditional calibration process requires the user of the electronic device to wave the device in a large, sweeping motion in a complex pattern in order to calibrate the magnetometer. This motion is used to expose all axes of the magnetometer to the main components of the Earth's magnetic field vector. For example, the traditional calibration process may require the user to move the electronic device in a large-scale figure-8 pattern. The traditional calibration process may then require the user to repeatedly tilt the electronic device back and forth along multiple axes. This is inconvenient and annoying for the user. This inconvenience is magnified for devices worn by the user, as such devices are even more difficult to perform complex waving and tilting motions.

[0028] The electronic device 100 according to the principles of the present disclosure provides a calibration process that is much less intrusive to the user than traditional calibration processes. For example, the magnetometer calibration process according to the principles of the present disclosure can be performed with little or no user movement required. This is because during the calibration process, the magnetometer calibration module 106 utilizes signals from the magnetometer 102 and the gyroscope 104. In addition, the magnetometer calibration module 106 utilizes multiple independent methods to determine magnetometer calibration parameters and then checks the results of these methods and other conditions to determine whether the magnetometer calibration module 106 has correctly calibrated the magnetometer 102. Because the magnetometer calibration module 106 utilizes multiple types of sensor signals and multiple independent calibration processes to determine the calibration parameters, little or no additional movement by the user is required to calibrate the magnetometer 102.

[0029] The gyroscope 104 senses the angular rotational motion of the electronic device 100. The gyroscope 104 generates a gyroscope sensor signal indicating the rate of angular motion (i.e., rotational motion) of the electronic device 100. The gyroscope 104 provides the gyroscope sensor signal to the magnetometer calibration module 106. The magnetometer calibration module 106 calibrates the magnetometer 102 using the gyroscope sensor signal and the magnetometer sensor signal.

[0030] Gyroscope 104 can be a multi-axis gyroscope. In this case, gyroscope 104 senses angular motion around each of the multiple axes. In one example, gyroscope 104 is a three-axis gyroscope that senses angular motion around each of the three axes. These three axes are orthogonal to each other and can be labeled as the X, Y, and Z axes. The X, Y, and Z axes are defined relative to the layout of gyroscope 104 within electronic device 100. The X, Y, and Z axes of gyroscope 104 can correspond to the X, Y, and Z axes of magnetometer 102, so that during calibration of magnetometer 102, the angular motion rate of each axis can be paired with the magnetic field value of that axis.

[0031] Gyroscope 104 may be a microelectromechanical system (MEMS). In this case, gyroscope 104 may be implemented in a silicon-based substrate having structures and components that result in the generation of electrical signals representing angular motion sensed in one or more axes. MEMS gyroscope 104 may include a capacitive sensing configuration, a piezoelectric sensing configuration, a piezoresistive sensing configuration, or other types of sensing configurations.

[0032] Magnetometer calibration module 106 utilizes a first calibration process and a second calibration process. Each calibration process in the first and second calibration processes utilizes magnetic sensor signals and gyroscope sensor signals. Each calibration process in the first and second calibration processes generates one or more calibration parameters. One or more calibration parameters from each process can be verified by comparing them with one or more calibration parameters from the other processes. If the independently generated calibration parameters match each other, this indicates that the one or more calibration parameters are correct and magnetometer 102 is correctly calibrated. If the independently generated one or more calibration parameters do not match each other, this indicates that magnetometer 102 may not have been correctly calibrated.

[0033] In one embodiment, the first calibration method is a Kalman filter method. The Kalman filter method generates a hard iron offset estimate by propagating the magnetometer using gyroscope sensor values ​​and by minimizing the error of constraints on individual components and the total magnetic field. The Kalman filter uses multiple sets of magnetometer and gyroscope sensor values. Each set of values ​​corresponds to a specific time point. In one example, each set of values ​​includes X, Y, and Z values ​​from the magnetometer and gyroscope at a given time. The Kalman filter process includes a linear quadratic estimation algorithm that uses a set of magnetometer and angular motion sensor values ​​to estimate the hard iron offset. The magnetometer and angular motion sensor values ​​include statistical noise and other inaccuracies. The Kalman filter process estimates the hard iron offset by estimating the joint probability distribution over the values ​​of each time frame. Additionally or alternatively, the Kalman filter process can estimate calibration parameters other than the hard iron offset.

[0034] The second calibration method is the least squares method. The least squares method estimates the hard-iron offset by minimizing the error between the first-order derivative of the magnetic field and the bias-corrected gyroscope propagated magnetic field reading. The least squares method is a regression analysis technique. The least squares method uses two magnetic sensor signal values ​​from the gyroscope sensor signal values ​​to estimate the hard-iron offset. Additionally or alternatively, the least squares method can estimate one or more calibration parameters in addition to the hard-iron offset.

[0035] The magnetometer calibration module 106 utilizes a validation process to determine whether the hard-iron offsets estimated by each calibration process are valid. The validation process checks for convergence between the hard-iron offset values ​​generated by the Kalman filter and the hard-iron offset values ​​generated by the least squares method. If the independently generated hard-iron offset values ​​converge, i.e., are identical, the magnetometer calibration module 106 determines that the calibration parameters are valid. In one example, the magnetometer calibration module 106 checks whether the difference between the hard-iron offset values ​​generated by the two processes is less than a threshold. If the difference is less than the threshold, the hard-iron offset values ​​are valid and the calibration process is complete. If the difference is greater than the threshold, the hard-iron offsets are invalid and the calibration process is not complete.

[0036] In one embodiment, the magnetometer calibration module 106 continuously calibrates the magnetometer 102. In this case, the magnetometer calibration module 106 can estimate and verify the calibration parameters multiple times per second. Thus, as the user moves the electronic device 100, the calibration process is repeated frequently so that the magnetometer 102 is calibrated or updated with the latest calibration parameters, thereby helping to ensure that the orientation of the electronic device 100 is always accurate. Alternatively, the calibration process can be performed only once every few hours or even days.

[0037] The magnetometer calibration module 106 may correspond to a software block, a hardware block, or a combination of software and hardware blocks. The Kalman filter and the least squares process may correspond to software processes that perform analysis, calculations, or estimations based on the magnetometer sensor signals and the gyroscope sensor signals. The magnetometer calibration module 106 may also include one or more memories for storing software instructions, sensor signal values, calibration parameter values, and other data. The magnetometer calibration module 106 may also include one or more processors for executing software instructions to generate calibration parameter values.

[0038] In one embodiment, the electronic device 100 includes a sensor processor 108. The sensor processor 108 receives calibration parameters from the magnetometer calibration module 106. The sensor processor 108 may also receive magnetometer sensor signals from the magnetometer 102 or from the magnetometer calibration module 106. The sensor processor 108 processes the magnetometer sensor signals to determine the heading or orientation of the electronic device 100. The sensor processor 108 may include one or more processors and one or more memories. The memories may store software instructions and other types of data related to sensor signal processing. The one or more processors may execute the software instructions. The sensor processor 108 and the magnetometer calibration module 106 may share memory and processing resources.

[0039] The magnetometer 102 , the gyroscope 104 , the magnetometer calibration module 106 , and the sensor processor 108 are part of a sensor module 109 of the electronic device 100 .

[0040] Figure 2 is a block diagram of the magnetometer calibration module 106 according to one embodiment. The magnetometer calibration module 106 is Figure 1 The magnetometer calibration module 106 includes a gyroscope calibrator 110 , a Kalman filter module 112 , a least squares module 114 , a verification unit 116 , a calibration monitor 118 , and a magnetometer data extractor 120 .

[0041] The gyroscope calibrator 110 is based on the gyroscope 104 (see Figure 1 ) receives an uncalibrated gyro sensor signal. The gyro calibrator 110 performs a calibration process to remove bias from the uncalibrated gyro sensor signal. The gyro calibrator 110 outputs a calibrated gyro sensor signal.

[0042] The gyroscope calibrator 110 can calculate the variance about each axis, the peak-to-peak value within a given time window, and the average value. The gyroscope calibrator 110 can detect state conditions. The gyroscope calibrator 110 can identify whether the device is stationary by checking whether the variance around each axis is less than a threshold variance, whether the average value is within an acceptable level for gyroscope bias, and whether the predicted value is less than a threshold peak-to-peak value. If the calibration monitor 118 detects a stationary condition, the gyroscope calibrator 110 can output the gyroscope calibration parameters as the average of previous values.

[0043] The Kalman filter module 112 receives as input the magnetic sensor signal from the magnetometer sensor 102 and the calibrated gyroscope sensor signal from the gyroscope calibrator 110. Therefore, in one embodiment, the Kalman filter module 112 does not receive the gyroscope signal directly from the gyroscope, but instead receives the gyroscope signal from the gyroscope calibrator 110. Because the Kalman filter module 112 uses the gyroscope sensor signal to calibrate the magnetometer 102, it is beneficial to ensure that the gyroscope sensor signal is calibrated before being received by the Kalman filter module 112. The Kalman filter module 112 performs a Kalman filtering process on the magnetic sensor signal and the gyroscope sensor signal. The Kalman filter module 112 outputs magnetometer calibration parameters. In one example, the magnetometer calibration parameters include a hard iron offset value.

[0044] For the Kalman filter process, the three-dimensional vector can be represented by the following equation:

[0045]

[0046] in Represents the rotation matrix, vb and vn represent vectors in the corresponding frame. Similarly, the magnetic field measured by the magnetic sensor 102 can also be represented in the global frame by the following method:

[0047]

[0048] Among them B n and B s is the magnetic field intensity value on the corresponding axis of the global frame and the sensor frame. Due to the bias in the magnetic field measurement, the equation can be written as

[0049]

[0050] Where HI is the hard iron offset. Due to the magnetic field in the global frame (B n ) is constant for one position, so differentiating the previous equation yields the following:

[0051]

[0052] Rearranging these terms yields the following:

[0053] The derivative of can also be expressed in the following way:

[0054]

[0055] where [ω t ×] is a skew matrix and ω t is the angular velocity. The equation becomes:

[0056] δB s =-[ω t ×](B s -HI)

[0057] Because the Earth's magnetic field is constant at a given location, the following relationship can be used:

[0058]

[0059] as well as

[0060]

[0061] also, Rb can be used instead. n is a constant, and Rb is also a constant. The equation can be expressed in the form of state propagation. Written as:

[0062]

[0063] The z=Hx measurement equation can be expressed in the following form:

[0064]

[0065] In one embodiment, the Kalman filter module 112 utilizes these concepts to estimate the hard iron offset.

[0066] The Kalman filter method is used to estimate the bias in the total magnetic field strength by minimizing the root mean square error between the measurement and prediction. This involves predicting the magnetic field vector by propagating it in angular velocity, predicting the bias and total magnetic field strength (Rb) values, and propagating the error covariance matrix (P). The measurement and correction steps involved include preparing the measurements (magnetometer readings relative to the total amplitude of the field), preparing the noisy measurement matrix (R), and estimating the Kalman filter gain (K) and correcting the predictions using the Kalman filter update equation.

[0067] The least squares module 114 receives as input the magnetic sensor signal from the magnetometer sensor 102 and the calibrated gyroscope sensor signal from the gyroscope calibrator 110. The least squares module 114 performs a least squares process on the magnetic sensor signal and the gyroscope sensor signal. The least squares module 114 outputs magnetometer calibration parameters. In one example, the magnetometer calibration parameters include a hard iron offset value.

[0068] When estimating the hard iron offset using the least squares method, the following relationship can be used:

[0069] δB s +[ω t ×](B s -HI)=0

[0070] The following cost function can be used to estimate the optimal HI value to minimize the loss:

[0071] γ(HI)=∑||δB s (t)+[ω t ×](B s (t)-HI)||

[0072] Differentiating the above equation with respect to HI to its optimal value leads to the following relationship:

[0073]

[0074] In this manner, the least squares module 114 may be used to estimate the hard iron offset.

[0075] The magnetometer data extractor 120 receives a magnetic sensor signal from the magnetometer 102. The magnetometer data extractor 120 extracts a unique data value from the magnetic sensor signal. For example, the magnetometer data extractor 120 extracts a sensor signal value that is different from a previous value. The magnetometer data extractor 120 analyzes each group of sensor signal values ​​(each group includes a value for each measurement axis of the magnetometer 102 at a given point in time). The magnetometer data extractor 120 identifies a single value or an entire group of values ​​that is outside the range of the most recently received sensor signal values. The magnetometer data extractor 120 stores these values ​​in a buffer. The unique value is then provided from the buffer to a verification unit, which will be described in more detail below.

[0076] Extracting unique magnetic field points to assess calibration quality rather than relying on the average of current data or data may be valuable. Averaging can provide equal weight to duplicate points or values. Therefore, it is beneficial to keep only sparse points. Therefore, the magnetometer data extractor 120 checks the unique samples in the current sensor data stream relative to the stored magnetometer data (i.e., the previous magnetic sensor signal value) to obtain a uniform and wide range of data samples. The unique sample is extracted by checking the difference between the most recent previously stored magnetic sensor signal value and the new magnetic sensor signal value. This can include checking the Euclidean or Manhattan distance between the new sensor signal value and all stored sensor signal values. If the new sample is unique, it is stored in a buffer. In one example, sensor signal values ​​older than the threshold are discarded and are not used to identify unique values. In one instance, the threshold time value is between 10 seconds and 20 seconds, but other values ​​can be used without departing from the scope of the present invention.

[0077] The verification unit 116 receives the magnetometer calibration parameter values ​​from the Kalman filter module 112, the magnetometer calibration parameter values ​​from the least squares module 114, and the unique magnetic sensor value from the magnetometer data extractor 120. The verification unit 116 verifies the magnetometer calibration parameter values ​​provided by the Kalman filter module 112 and the least squares module 114.

[0078] The verification unit 116 checks the rotation span of each axis. In one example, it is desired that at least two axes have a rotation of 75°. The verification unit checks the total rotation, which is expected to exceed 180°. The verification unit 116 checks the convergence of the magnetometer calibration parameter values ​​from both methods. If the distance between the two bias vectors is higher than 2μT, the validity flag is set to false and the calibration value will not be output from the verification unit 116. In this example, 2μT is the hard iron bias threshold. For calibration validity, the difference between the hard iron offset values ​​should be less than or equal to 2μT. Other thresholds may be utilized without departing from the scope of this disclosure. If the values ​​converge with a difference less than the threshold, the validity flag is set to true and the verification unit 116 outputs the calibration parameters (e.g., hard iron bias).

[0079] The calibration monitor 118 is used to check the calibration quality and detect anomalies. If the validity flag is true, the calibration monitor 118 receives the calibration parameters from the verification unit 116 as input. The calibration monitor 118 also receives unique magnetic data points from the magnetometer data extractor 120. The calibration monitor 118 outputs a calibration quality status and updated calibration parameters. In one example, the calibration quality status can be poor, passable, good, or unknown. Other types of statuses can be utilized without departing from the scope of this disclosure.

[0080] Calibration monitor 118 updates calibration state based on the time passed since last calibration value and the deviation in the unique magnetic field value array extracted by magnetometer data extractor 120. The threshold time for determining whether to reduce quality can be different according to the most recent state value. For example, the elapsed time of 10 to 15 hours can cause the demotion from good quality to qualified quality. The elapsed time of one day to three days can cause the demotion from qualified quality to poor quality. The elapsed time of 8 to 12 days may cause the demotion from poor to unknown. Without departing from the scope of the present disclosure, other threshold values ​​can be utilized through time threshold values.

[0081] The calibration monitor 118 continuously monitors the total magnetic field deviation calculated at the unique magnetic data point and makes a determination of calibration quality based on the average and variance. In one example, if the deviation is greater than a first threshold deviation, the calibration quality is poor. If the deviation is greater than a second threshold deviation but less than the first deviation, the calibration quality is acceptable. If the deviation is greater than a third threshold deviation but less than the second threshold deviation, the calibration quality is good.

[0082] In one embodiment, the magnetometer calibration module 106 can perform gyroscope calibration, magnetic calibration parameter estimation, unique magnetic value extraction, and verification between 50 and 200 times per second. Calibration quality monitoring can be performed at a much lower frequency. For example, calibration quality monitoring can be performed once per second. Other frequencies can be utilized without departing from the scope of this disclosure.

[0083] Figure 3 FIG. 3 is a timeline 300 illustrating that multiple instances of a Kalman filter and a least squares process may be run simultaneously according to one embodiment. Figure 2 and Figure 3 , the Kalman filter module 112 may initiate multiple overlapping instances of the Kalman filter process. Similarly, the least squares module 114 may initiate multiple overlapping instances of the least squares process. Figure 3 In FIG, overlapping instances of the Kalman filter and the least squares process are labeled 122a-122f. Each instance generates calibration parameters from the Kalman filter process and calibration parameters from the least squares process. The verification unit 116 receives the calibration parameters from each of the instances 122a-122f.

[0084] At time T1, the first instance 122a of the Kalman filter and least squares process is initiated by the Kalman filter module 112 and the least squares module 114. In practice, the Kalman filter module 112 and the least squares module 114 can be implemented in a single module that generates each instance 122a of the Kalman filter and least squares process. At time T2, while instance 122a is still running, instance 122b of the Kalman filter and least squares process is initiated. At time T3, while instances 122a and 122b are still running, instance 122c of the Kalman filter and least squares process is initiated. At time T4, instance 122d of the Kalman filter initiates the least squares process while instances 122a-122c are still running. Between times T4 and T5, instance 122a has completed generating calibration parameters and has provided the calibration parameters to the validation unit 116. At time T5, while instances 122b-122d are still running, instance 122e of the Kalman filter and least squares process is initiated. Between times T5 and T6, instance 122b has completed generation of calibration parameters and has provided the calibration parameters to the verification unit 116. At time T6, while instances 122c-122e are still running, instance 122f of the Kalman filter and least squares process is started.

[0085] exist Figure 3 , the downward pointing arrows indicate that corresponding instances of the Kalman filter and the least squares process have provided calibration parameters to the verification unit 116. However, the placement of the downward pointing arrows in time does not necessarily correspond to the actual time at which the calibration parameters are provided to the verification unit 116. In practice, the calibration parameters are provided from the instances of the Kalman filter and the least squares process at the end of the Kalman filter and the least squares process.

[0086] Each instance of the Kalman filter and least squares process estimates calibration parameters based on a set of values ​​of the sensor signal across a specific time window. The time window can overlap with other Kalman filter and least squares instances. Therefore, certain value sets used by the Kalman filter and least squares process are used by other instances of the Kalman filter and least squares process. The size of the window can be selected to balance between capturing the calibration motion and minimizing the possibility of external magnetic interference.

[0087] The validation unit 116 may output a validity flag for each pair of calibration parameters provided from an instance of the Kalman filter and the least squares process. Alternatively, the validation unit 116 may output a validity flag only after analyzing calibration parameters from several instances of the Kalman filter and the least squares process.

[0088] Figure 4 is a block diagram of the Kalman filter module 112 according to one embodiment. Figure 4The Kalman filter module 112 is combined with Figure 1 - Figure 3 An example of a Kalman filter module 112 is described. Kalman filter module 112 includes a measurement and correction unit 130, a prediction unit 132, and a propagation unit 134. Propagation unit 134 receives gyroscope sensor signals for all three gyroscope axes X, Y, and Z. The propagation unit uses the angular velocity values ​​from the gyroscope sensor signals to propagate magnetic field and total intensity values ​​to prediction unit 132. Prediction unit 132 receives the propagated magnetic field and total intensity values ​​from propagation unit 134. The prediction unit predicts the bias and noise matrices (R) and propagates the error covariance matrix (P). Measurement and correction unit 130 receives magnetic sensor signals associated with each sensing axis X, Y, and Z of magnetometer 102. Measurement and correction unit 130 also receives noise matrices and error covariance predictions from prediction unit 132. Measurement and correction unit 130 prepares measurements of the noise matrix (R) and estimates the Kalman filter countermeasure (K), and corrects the predictions from prediction unit 132 using Kalman filter updates. The correction values ​​are provided to the prediction unit 132 and the output unit 136. The output unit 136 generates hard iron offset / bias values ​​and a noise matrix (R) and outputs them to the verification unit 116.

[0089] Figure 5 is a block diagram of the verification unit 116 according to one embodiment. Figure 5 The verification unit 116 is about Figure 2 An example of a validation unit described in

[15] . The validation unit is responsible for determining when to overwrite or update calibration parameters. The inputs are calibration parameters from various Kalman filter and least squares instances, as well as magnetometer sensor values.

[0090] For each instance 122 of the Kalman filter and least squares process, the validation unit 116 initiates a validity check process. Each validity check process receives unique magnetic sensor signal data from the data buffer 138. The data buffer 138 stores the data generated by Figure 2 The unique magnetic sensor signal value extracted by the magnetometer data extractor 120 is obtained from the calibration parameters. Each validity check process 140a-140d receives the hard iron offset value and the calculated total magnetic field strength from the corresponding Kalman filter and least squares instance 122 (not shown). Each validity check process 140a-d checks whether the validity flag is true and whether the total magnetic field is within a valid range (e.g., 25-60 μT). Each validity check process 140a-d calculates the total magnetic field and the unique magnetic data point with calibration parameters, checks that the total deviation is not greater than a threshold deviation (e.g., 5-7 μT) and that the average magnetic field is within a selected threshold (e.g., 4-6 μT). If the calibration parameters meet these criteria, the calibration parameters have valid values ​​and are passed to the calculate validity measurement process 142.

[0091] The calculated validity measurement process 142 is responsible for calculating the appropriate weight for each valid calibration parameter. This can be performed by calculating the total deviation from the true magnetic field. Lower deviations will receive higher weights. The calculated validity measurement process 142 also checks for consistency with other instances of the calibration output. If a calibration parameter is far from the rest of the calibration parameters, it will be assigned a zero weight. If the deviation from the most recent calibration parameter is lower than the most recently successful calibration parameter, the weight will be increased.

[0092] The calculated final result process 144 calculates the weighted sum of all valid calibration parameters from all instances. The output contains the current time, calibration parameters, and calibration quality based on the deviation from the true magnetic field. The calculated final result process 144 outputs the calibration parameters and quality status.

[0093] Figure 6 is a diagram of a smart watch 600 according to one embodiment. Figure 1 An example of an electronic device 100. The smart watch 600 includes a sensor module 109. The sensor module 109 includes Figure 1 1 . The smartwatch 600 includes the gyroscope 104, magnetometer 102, magnetometer calibration module 106, and sensor processor 108 described herein. To perform calibration of the magnetometer 102, the smartwatch 600 can prompt the user to make some small movements with the wrist to which the smartwatch 600 is connected. The smartwatch 600 can perform the calibration as previously described based on the gyroscope and magnetometer sensor signals generated during the prescribed movements. Due to the effectiveness of the calibration process described herein, the prescribed movements are relatively small compared to traditional methods. In some cases, the smartwatch 600 can perform calibration without requiring any movement at all. After the calibration is performed, the sensor processor 108 can calculate the heading orientation of the smartwatch 600 based on the magnetometer and gyroscope sensor signals.

[0094] Figure 7 is a diagram of a VR head mounted device 700 according to one embodiment. Figure 1 An example of an electronic device 100 of a VR headset 700 includes a sensor module 109. The sensor module 109 includes Figure 1The gyroscope 104, magnetometer 102, magnetometer calibration module 106 and sensor processor 108 described herein. When calibration of the magnetometer 102 is to be performed, the VR headset 700 may prompt the user to make some small movements with their head. The VR headset 700 may perform the calibration as previously described based on the gyroscope and magnetometer sensor signals generated during the prescribed movement. Due to the effectiveness of the calibration process described herein, the prescribed movement is smaller compared to traditional methods. In some cases, the VR headset 700 may perform calibration without requesting any movement at all. After the calibration is performed, the sensor processor 108 may calculate the heading orientation of the VR headset 700 based on the magnetometer and gyroscope sensor signals.

[0095] Figure 8 8 is a flow chart of a method 800 for operating an electronic device according to one embodiment. At 802, method 800 includes generating a gyroscope sensor signal using a gyroscope of the electronic device. At 804, method 800 includes generating a magnetometer sensor signal using a magnetometer of the electronic device. At 806, method 800 includes estimating first magnetometer calibration parameters by performing a Kalman filter process using the gyroscope sensor signal and the magnetometer sensor signal. At 808, method 800 includes estimating second magnetometer calibration parameters by performing a least squares process on the gyroscope sensor signal and the magnetometer sensor signal. At 810, method 800 includes validating the first magnetometer calibration parameters and the second magnetometer calibration parameters by analyzing convergence between the first magnetometer calibration parameters and the second magnetometer calibration parameters.

[0096] Figure 9 9 is a flow chart of a method 900 for operating an electronic device according to one embodiment. At 902, the method 900 includes generating first magnetometer calibration parameters by performing a Kalman filter process on a gyroscope sensor signal and a magnetometer sensor signal. At 904, the method 900 includes generating second magnetometer calibration parameters by performing a least squares process on the gyroscope sensor signal and the magnetometer sensor signal. At 906, the method 906 includes verifying the first magnetometer calibration parameter and the second magnetometer calibration parameter by comparing the first magnetometer calibration parameter and the second magnetometer calibration parameter. At 908, the method 900 includes determining an orientation of the electronic device based on the magnetometer sensor signal and a combination of the first magnetometer calibration parameter and the second magnetometer calibration parameter.

[0097] In one embodiment, a method includes generating a gyroscope sensor signal using a gyroscope of an electronic device, generating a magnetometer sensor signal using a magnetometer of the electronic device, and estimating a first magnetometer calibration parameter by performing a Kalman filter process using the gyroscope sensor signal and the magnetometer sensor signal. The method also includes estimating a second magnetometer calibration parameter by performing a least squares process on the gyroscope sensor signal and the magnetometer sensor signal, and verifying the first magnetometer calibration parameter and the second magnetometer calibration parameter by analyzing convergence between the first magnetometer calibration parameter and the second magnetometer calibration parameter.

[0098] In one embodiment, an electronic device includes a gyroscope configured to output a gyroscope sensor signal, a magnetometer configured to output a magnetometer sensor signal, and a magnetometer calibration module. The magnetometer calibration module is configured to receive the gyroscope sensor signal and the magnetometer sensor signal and generate first magnetometer calibration parameters using a Kalman filter process with the gyroscope sensor signal and the magnetometer sensor signal. The magnetometer calibration module is configured to generate second magnetometer calibration parameters based on a least square error reduction process of the gyroscope sensor signal and the magnetometer sensor signal.

[0099] In one embodiment, a method includes generating a first magnetometer calibration parameter by performing a Kalman filter process on a gyroscope sensor signal and a magnetometer sensor signal; and generating a second magnetometer calibration parameter by performing a least squares process on the gyroscope sensor signal and the magnetometer sensor signal. The method includes validating the first and second magnetometer calibration parameters by comparing the first and second magnetometer calibration parameters. The method includes determining an orientation of an electronic device based on the magnetometer sensor signal and a combination of the first magnetometer calibration parameter and the second magnetometer calibration parameter.

[0100] The various embodiments described above can be combined to provide further embodiments. These and other changes can be made to the embodiments in light of the above detailed description. Generally, in the following claims, the terms used should not be interpreted as limiting the claims to the specific embodiments disclosed in the specification and claims, but should be interpreted to include all possible embodiments and the full range of equivalents to which such claims are entitled. Therefore, the claims are not limited by this disclosure.

Claims

1. A method for calibrating a magnetometer, comprising: generating a gyroscope sensor signal using a gyroscope of an electronic device; generating a magnetometer sensor signal using a magnetometer of the electronic device; estimating first magnetometer calibration parameters by performing a Kalman filtering process using the gyroscope sensor signal and the magnetometer sensor signal; estimating second magnetometer calibration parameters by performing a least squares process using the gyroscope sensor signal and the magnetometer sensor signal; validating the first magnetometer calibration parameters and the second magnetometer calibration parameters by analyzing convergence between the first magnetometer calibration parameters and the second magnetometer calibration parameters; as well as Operating multiple instances of a Kalman filter process and a least squares process simultaneously, wherein the multiple instances of the Kalman filter process and the least squares process are offset in time from one another, wherein operating the multiple instances of the Kalman filter process and the least squares process simultaneously includes continuously calibrating the magnetometer. 2 . The method of claim 1 , wherein estimating the first magnetometer calibration parameter comprises determining a hard iron offset. 3 . The method of claim 2 , wherein estimating the hard iron offset comprises minimizing an error constraint on a total magnetic field based in part on the gyroscope sensor signal. The method of claim 1 , wherein estimating the second magnetometer calibration comprises determining a hard iron offset. The method of claim 4 , wherein estimating the hard iron offset comprises minimizing an error between a first derivative of a magnetic field and a magnetic field propagated by a gyroscope. The method of claim 1 , wherein verifying the first and second magnetometer calibration parameters comprises determining a difference between the first and second magnetometer calibration parameters. 7 . The method of claim 1 , further comprising determining an orientation of the electronic device based on the first magnetometer calibration parameter and the second magnetometer calibration parameter.

8. An electronic device for calibrating a magnetometer, comprising: a gyroscope configured to output a gyroscope sensor signal; a magnetometer configured to output a magnetometer sensor signal; a magnetometer calibration module configured to receive the gyroscope sensor signal and the magnetometer sensor signal, and to generate first magnetometer calibration parameters using the gyroscope sensor signal and the magnetometer sensor signal through a Kalman filter process, and to generate second magnetometer calibration parameters based on a least squares process using the gyroscope sensor signal and the magnetometer sensor signal; wherein the magnetometer calibration module is further configured to verify the first magnetometer calibration parameter and the second magnetometer calibration parameter based on convergence of the first magnetometer calibration parameter and the second magnetometer calibration parameter, and to simultaneously implement multiple instances of the Kalman filter process and the least squares process to continuously calibrate the magnetometer, wherein the multiple instances of the Kalman filter process and the least squares process are offset in time from each other.

9. The electronic device of claim 8, further comprising a sensor processor configured to receive at least one of the first magnetometer calibration parameter and the second magnetometer calibration parameter, and to determine the orientation of the magnetometer based on the at least one of the first magnetometer calibration parameter and the second magnetometer calibration parameter. 10 . The electronic device of claim 8 , wherein the magnetometer calibration module is configured to determine a first hard-iron offset using the Kalman filter process. 11 . The electronic device of claim 8 , wherein the magnetometer calibration module is configured to determine a second hard-iron offset using the least squares process.

12. The electronic device according to claim 8, further comprising: at least one memory configured to store software instructions; as well as At least one processor is configured to execute the software instructions, wherein the magnetometer calibration module is a software module implemented by executing the software instructions using the at least one processor.

13. A method for calibrating a magnetometer, comprising: generating first magnetometer calibration parameters by performing a Kalman filtering process on the gyroscope sensor signal and the magnetometer sensor signal; generating second magnetometer calibration parameters by performing a least squares process on the gyroscope sensor signal and the magnetometer sensor signal; verifying the first magnetometer calibration parameter and the second magnetometer calibration parameter by comparing the first magnetometer calibration parameter and the second magnetometer calibration parameter; as well as determining an orientation of the electronic device based on the magnetometer sensor signal and at least one magnetometer calibration parameter of the first magnetometer calibration parameter and the second magnetometer calibration parameter; The magnetometer sensor is calibrated by simultaneously implementing multiple instances of a Kalman filter process and a least squares process, wherein the multiple instances of the Kalman filter process and the least squares process are offset in time from one another. 14 . The method of claim 13 , further comprising determining an orientation of the electronic device based on the magnetometer sensor signal and at least one of the first magnetometer calibration parameter and the second magnetometer calibration parameter.

15. The method of claim 13, wherein the electronic device is a virtual reality head mounted device or an augmented reality head mounted device.

Citation Information

Patent Citations

  • Validating Calibrated Magnetometer Data

    US20140361763A1

  • System and method for magnetometer calibration and compensation

    US20150019159A1