Geomagnetic sensor calibration method and device and electronic equipment
By detecting and calculating parameters such as the yaw angle of the geomagnetic sensor of the electronic device, the three-axis magnetic field deviation value is determined, which solves the problem of inaccurate navigation caused by magnetic interference in the geomagnetic sensor, and the calibration without shaking equipment is achieved, which improves convenience and accuracy.
Patent Information
- Application Number
- CN202411123681.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Geomagnetic sensors are susceptible to magnetic interference in electronic devices, resulting in inaccurate navigation directions. The prior art requires users to calibrate by shaking the device, which makes the operation cumbersome.
By detecting whether the geomagnetic sensor of an electronic device is subject to magnetic interference, obtaining yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength, calculate standard three-axis magnetic field data, determine the three-axis magnetic field deviation value, and use this to map the ground. The sensor is calibrated.
The calibration of the geomagnetic sensor can be achieved without the user shaking the device, which improves the convenience and accuracy of calibration and simplifies the operation process.
Smart Images

Figure CN119148252A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a geomagnetic sensor calibration method, device and electronic equipment. Background Art
[0002] With the rapid development of mobile Internet technology and the upgrade of electronic equipment hardware configuration, electronic equipment has become more and more functional. Compass, map navigation and other functions of electronic equipment are widely used in users' daily lives, bringing great convenience to users' travel. The confirmation of the current position in the navigation function and the electronic compass both use the measurement data of the geomagnetic sensor. For example, the navigation direction provided for users' walking navigation is calculated based on the fusion of the measurement data of the geomagnetic sensor, gyroscope sensor and acceleration sensor. Therefore, it is very important to ensure the accuracy of the measurement data of the geomagnetic sensor.
[0003] However, geomagnetic sensors are easily affected by magnetic interference in daily life. For example, when multiple electronic devices are placed together, the navigation direction provided will be inaccurate. In the related art, when the geomagnetic sensor of an electronic device is affected by magnetic interference, if the user wants to obtain accurate navigation direction, the electronic device needs to be repaired as follows: Figure 1 The shaking of the trajectory shown, the starting point of the trajectory is point A, and the end point is point B. The electronic device is shaken multiple times along the above trajectory to calibrate the geomagnetic sensor of the electronic device, and the operation is relatively cumbersome. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a geomagnetic sensor calibration method, device and electronic device, which can improve the convenience of geomagnetic sensor calibration in electronic equipment.
[0005] In a first aspect, an embodiment of the present application provides a geomagnetic sensor calibration method, the method comprising:
[0006] When it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, obtaining the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device;
[0007] Determining current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength;
[0008] Determining a three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data;
[0009] The geomagnetic sensor is calibrated based on the three-axis magnetic field deviation value.
[0010] In a second aspect, an embodiment of the present application provides a geomagnetic sensor calibration device, the device comprising:
[0011] An acquisition module, used to acquire the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference;
[0012] A first determination module is used to determine the current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength;
[0013] A second determination module is used to determine the three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data;
[0014] The first calibration module is used to calibrate the geomagnetic sensor based on the three-axis magnetic field deviation value.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the geomagnetic sensor calibration method described in the first aspect are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the geomagnetic sensor calibration method as described in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0019] In an embodiment of the present application, when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device are obtained; the current standard three-axis magnetic field data of the electronic device is determined based on the yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength; the three-axis magnetic field deviation value of the geomagnetic sensor is determined based on the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data; based on the three-axis magnetic field deviation value, the geomagnetic sensor is calibrated, so that the geomagnetic sensor can be calibrated without the user shaking the electronic device, thereby improving the convenience of geomagnetic sensor calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is an example diagram of a geomagnetic sensor calibration method in the related art;
[0021] Figure 2 is an example diagram of a north-east coordinate system provided in an embodiment of the present application;
[0022] Figure 3 This is one of the flow charts of a geomagnetic sensor calibration method provided in an embodiment of the present application;
[0023] Figure 4 This is the second flowchart of a geomagnetic sensor calibration method provided in an embodiment of the present application;
[0024] Figure 5 is a structural block diagram of a geomagnetic sensor calibration device provided in an embodiment of the present application;
[0025] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0026] Figure 7 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] First, some concepts and application scenarios involved in the embodiments of this application are introduced.
[0030] 1. Concept
[0031] The geomagnetic sensor is a sensor that measures the earth's magnetic force, also known as an "electronic compass". The measurement data of the geomagnetic sensor includes: three-axis magnetic field data, which are the magnetic strength values of the three axes of the X-axis, Y-axis and Z-axis in the body coordinate system, where the X-axis direction refers to the horizontal direction from left to right along the short side of the body's screen; the Y-axis direction refers to the vertical direction from the lower left corner of the body's screen to the top of the screen; the Z-axis direction refers to the direction pointing to the sky when the body is placed horizontally.
[0032] An accelerometer is a sensor that measures acceleration. The measurement data of the accelerometer includes three-axis acceleration data, which are acceleration values in the three axes of X-axis, Y-axis and Z-axis in the body coordinate system.
[0033] The gyroscope sensor is a sensor that measures angular velocity. The measurement data of the gyroscope sensor includes: three-axis angular velocity data, which are the angular velocity values of the three axes of the X-axis, Y-axis and Z-axis in the body coordinate system.
[0034] Euler angles are three angles (yaw, pitch, roll) introduced by Leonhard_Euler. They are used to describe the direction of a rigid body relative to a fixed coordinate system. They can also represent the direction of a moving reference system in physics or the direction of a basis in three-dimensional linear algebra. Among them, the yaw angle (yaw) refers to the angle of rotation around the Z axis, the pitch angle (pitch) refers to the angle of rotation around the Y axis, and the roll angle (roll) refers to the angle of rotation around the X axis. These three angles can be used to control the rotation of an object and determine its orientation.
[0035] The Northeastern Universe (ENU) coordinate system refers to a coordinate system with the positive directions of the three axes being due east, due north, and directly above the ground. The ENU coordinate system is also called the station center coordinate system or the site coordinate system.
[0036] The North East Earth (NED) coordinate system refers to a coordinate system that uses the north, east, and down of the origin as the positive directions of the three axes. The NED coordinate system and the ENU coordinate system are essentially two sides of the same coin. Figure 2 As shown, in the NED coordinate system, the X-axis represents geographic north, the Y-axis represents geographic east, and the Z-axis is perpendicular to the horizontal plane of the earth, and its direction points to the center of the earth; B represents the earth's magnetic field, and its angle with the horizontal plane XOY is the magnetic inclination, which is represented by β.
[0037] 2. Application Scenarios
[0038] At present, the compass, map navigation and other functions of electronic devices are widely used in users' daily lives, bringing great convenience to users' travel. The confirmation of the current position in the navigation function and the electronic compass both use the measurement data of the geomagnetic sensor. For example, the navigation direction provided for users' walking navigation is calculated by integrating the measurement data of the geomagnetic sensor, gyroscope sensor and acceleration sensor.
[0039] Users are accustomed to using electronic devices with magnetic materials in their daily lives, such as Bluetooth headsets, magnetic device cases, near-field communication devices, etc. These materials can easily cause magnetic interference to the geomagnetic sensor of the electronic device. When the geomagnetic sensor of an electronic device is subject to magnetic interference, the geomagnetic sensor of the electronic device cannot accurately obtain the three-axis magnetic field data of the earth's magnetic field. In this case, if the user uses the map navigation function, the navigation direction will be randomly pointed, resulting in incorrect navigation. In the related art, when the geomagnetic sensor of an electronic device is subject to magnetic interference, if the user wants to obtain the accurate navigation direction, the electronic device needs to be shaken multiple times to calibrate the geomagnetic sensor. The trajectory of the user shaking the electronic device is as follows: Figure 1 As shown, the operation is rather complicated.
[0040] In order to solve the above technical problems, the embodiments of the present application provide a geomagnetic sensor calibration method, device and electronic device.
[0041] The geomagnetic sensor calibration method provided in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0042] It should be noted that the geomagnetic sensor calibration method provided in the embodiment of the present application is applicable to electronic devices. In practical applications, the electronic devices may include: smart phones, tablet computers and other terminals, which are not limited in the embodiment of the present application.
[0043] Figure 3 is one of the flow charts of a geomagnetic sensor calibration method provided in an embodiment of the present application, such as Figure 3 As shown, the method may include the following steps: step 301, step 302, step 303 and step 304;
[0044] In step 301, when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device are obtained.
[0045] In an embodiment of the present application, it is possible to detect in real time whether the geomagnetic sensor of an electronic device is subject to magnetic interference. If magnetic interference is detected, five parameters of the electronic device, including the current yaw angle (yaw), pitch angle (pitch), rotation angle (roll), magnetic inclination angle (β) and earth magnetic field strength (B), are obtained.
[0046] In an embodiment of the present application, when detecting whether the geomagnetic sensor of an electronic device is subject to magnetic interference, the following detection steps can be used: obtaining measurement data of the geomagnetic sensor of the electronic device, the measurement data including: the magnetic intensity value of the X-axis, the magnetic intensity value of the Y-axis and the magnetic intensity value of the Z-axis, calculating the current comprehensive magnetic intensity value based on the above measurement data, and if the comprehensive magnetic intensity value is greater than a reference intensity value, determining that the electronic device is subject to magnetic interference, wherein the reference intensity value can be determined based on the current geographic location information of the electronic device, or can be determined based on the recent comprehensive magnetic intensity value of the electronic device, and the embodiment of the present application is not limited to this.
[0047] In some embodiments, considering that the measurement data of the gyro sensor is accurate when the gyro sensor has just been calibrated, the measurement data of the gyro sensor and the measurement data of the acceleration sensor can accurately calculate the Euler angle (yaw angle, pitch angle, rotation angle), and accordingly, the above step 301 may include the following steps: step 3011, step 3012 and step 3013;
[0048] In step 3011, a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated is obtained.
[0049] In the embodiment of the present application, the first duration is the duration difference between the second moment and the first moment.
[0050] In the embodiment of the present application, considering that the gyro sensor has zero bias errors such as temperature drift, and as time goes by, the error will accumulate and become larger. If you want to obtain accurate measurement data of the gyro sensor, you need to calibrate the gyro sensor at regular intervals. The calibrated gyro sensor can output accurate three-axis angular velocity data in a short time after calibration. The accurate yaw angle, pitch angle and rotation angle of the electronic device require the accurate measurement data of the gyro sensor and the measurement data of the acceleration sensor to be combined and determined. Therefore, it is necessary to calculate the time difference between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyro sensor of the electronic device is last calibrated. The time difference is used to determine whether the measurement data of the gyro sensor is accurate. If the time difference is less than the first threshold, it means that the gyro sensor has just been calibrated for a short time, and the measurement data output by the gyro sensor is accurate. If the time difference is greater than or equal to the first threshold, it means that the gyro sensor has accumulated some errors, and the measurement data output by the gyro sensor is likely to be inaccurate. The first threshold is a pre-set time threshold.
[0051] In an embodiment of the present application, the most recent calibration of the gyroscope sensor of the electronic device may be achieved based on the user shaking the electronic device, or may be achieved through other means, for example, calibration may be performed through measurement data of a calibrated geomagnetic sensor and measurement data of an acceleration sensor, which is not limited in the embodiment of the present application.
[0052] In step 3012, when the first time duration is less than the first threshold, the yaw angle, the pitch angle, and the rotation angle are determined according to the measurement data of the gyroscope sensor and the measurement data of the acceleration sensor of the electronic device.
[0053] In the embodiment of the present application, if the first duration is less than the first threshold value, it means that the gyro sensor has just been calibrated not long ago, and the measurement data output by the gyro sensor is accurate. According to the measurement data of the gyro sensor and the measurement data of the acceleration sensor, the current yaw angle, pitch angle and rotation angle of the electronic device can be accurately determined. In practical applications, any algorithm in the relevant technology can be used to determine the yaw angle, pitch angle and rotation angle of the electronic device in combination with the measurement data of the gyro sensor and the measurement data of the acceleration sensor, and the embodiment of the present application does not limit this.
[0054] In step 3013, the magnetic inclination angle and the strength of the earth's magnetic field are determined according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
[0055] In the embodiment of the present application, in order to reduce the complexity of calculation, the magnetic inclination angle and the earth's magnetic field strength can be estimated separately through the measurement data of the geomagnetic sensor. Alternatively, in order to ensure the accuracy of the calculation result, the magnetic inclination angle and the earth's magnetic field strength can also be estimated by combining the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor. In this case, the measurement data of the gyroscope sensor needs to be accurate measurement data, so as to ensure that the calculated magnetic inclination angle and the earth's magnetic field strength are relatively accurate.
[0056] It should be noted that although the geomagnetic sensor has been affected by magnetic interference, when using inaccurate measurement data from the geomagnetic sensor to estimate the magnetic inclination angle and the Earth's magnetic field strength, the estimation may fail and the magnetic inclination angle and the Earth's magnetic field strength may not be obtained. If the estimation is successful, the magnetic inclination angle and the Earth's magnetic field strength will be obtained. At this time, the magnetic inclination angle and the Earth's magnetic field strength are considered to be relatively accurate.
[0057] In the embodiment of the present application, if the first duration is less than the first threshold value, it means that the gyro sensor has just been calibrated not long ago, and the measurement data output by the gyro sensor is accurate. According to the measurement data of the geomagnetic sensor and the measurement data of the gyro sensor, the current magnetic inclination angle and the earth's magnetic field strength of the electronic device can be estimated relatively accurately. In practical applications, any algorithm in the relevant technology can be used to estimate the current magnetic inclination angle and the earth's magnetic field strength of the electronic device in combination with the measurement data of the geomagnetic sensor and the measurement data of the gyro sensor, and the embodiment of the present application does not limit this.
[0058] It can be seen that in the embodiment of the present application, in the current calibration process, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device can be obtained when the electronic device is in a stationary state without shaking the electronic device.
[0059] In other embodiments, considering that when the gyro sensor is not calibrated, the measurement data of the gyro is inaccurate, but the measurement data of the acceleration sensor is accurate, and the measurement data of the acceleration sensor can accurately determine the pitch angle and the rotation angle, accordingly, the above step 301 may include the following steps: step 3014, step 3015, step 3016 and step 3017;
[0060] In step 3014, a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated is obtained.
[0061] In step 3015, when the first time duration is greater than or equal to the first threshold, the angle input by the user is determined as the yaw angle.
[0062] In the embodiment of the present application, if the first time length is greater than or equal to the first threshold, it means that the gyro sensor has accumulated some errors, and the measurement data output by the gyro sensor is likely to be inaccurate. Considering the influence of the error of the gyro sensor, if the user knows the true yaw angle of the electronic device by other means, the true yaw angle can be input into the electronic device, and the electronic device determines the yaw angle input by the user as the current yaw angle of the electronic device.
[0063] In step 3016, the pitch angle and the rotation angle are determined according to the measurement data of the acceleration sensor of the electronic device.
[0064] In the embodiment of the present application, considering that the pitch angle and the rotation angle can be calculated by combining the measurement data of the acceleration sensor and the measurement data of the gyroscope sensor, or can be calculated by the measurement data of the acceleration sensor alone, when it is impossible to determine whether the measurement data of the gyroscope sensor is accurate, in order to ensure the accuracy of the calculation result, the current pitch angle and rotation angle of the electronic device are determined according to the measurement data of the acceleration sensor of the electronic device. In practical applications, any algorithm in the relevant technology can be used to determine the current pitch angle and rotation angle of the electronic device according to the measurement data of the acceleration sensor, and the embodiment of the present application does not limit this.
[0065] In step 3017, the magnetic inclination angle and the strength of the earth's magnetic field are determined based on the measurement data of the geomagnetic sensor.
[0066] In the embodiment of the present application, considering that the magnetic inclination angle and the earth's magnetic field strength can be estimated by combining the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor, or can be estimated by the measurement data of the geomagnetic sensor alone, when it is impossible to determine whether the measurement data of the gyroscope sensor is accurate, in order to ensure the accuracy of the calculation result, the current magnetic inclination angle and the earth's magnetic field strength of the electronic device are estimated based on the measurement data of the geomagnetic sensor. In practical applications, any algorithm in the relevant technology can be used to estimate the current magnetic inclination angle and the earth's magnetic field strength of the electronic device based on the measurement data of the geomagnetic sensor, and the embodiment of the present application does not limit this.
[0067] It can be seen that in the embodiment of the present application, in the current calibration process, when the measurement data of the gyroscope sensor is inaccurate and the electronic device is in a stationary state, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device can be determined without the user shaking the electronic device.
[0068] In step 302, current standard three-axis magnetic field data of the electronic device is determined according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength.
[0069] In the embodiment of the present application, the measurement data of the geomagnetic sensor is also three-axis magnetic field data, but due to magnetic interference, the measurement data of the geomagnetic sensor is inaccurate three-axis magnetic field data.
[0070] In the embodiment of the present application, a relatively accurate three-axis magnetic field data, namely, standard three-axis magnetic field data, can be estimated based on the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device.
[0071] In some embodiments, the above step 302 may include the following steps: step 3021, step 3022, step 3023 and step 3024;
[0072] In step 3021, three-axis magnetic field data in a first reference coordinate system is determined according to the yaw angle, the magnetic inclination angle and the earth's magnetic field strength, wherein the first reference coordinate system is a north-east coordinate system.
[0073] For example, the yaw angle is recorded as θ, the magnetic inclination angle is recorded as β, and the earth's magnetic field strength is recorded as B. According to formula (1), the three-axis magnetic field data in the north-east coordinate system can be calculated as follows: in, The upper left script "NED" indicates the North-East coordinate system, the lower right script "x" indicates the magnetic field value in the X-axis direction, and the upper right script "n" indicates that it is consistent with the North-East coordinate system.
[0074]
[0075] In step 3022, three-axis magnetic field data of the electronic device in the first reference coordinate system is determined according to the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system.
[0076] For example, the pitch angle is recorded as ρ, the rotation angle is recorded as γ, and the three-axis magnetic field data in the north-east coordinate system is According to formula (2), the three-axis magnetic field data of the electronic device in the north-east coordinate system can be calculated:
[0077]
[0078] In step 3023, based on the coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, the three-axis magnetic field data of the electronic device in the second reference coordinate system is determined, wherein the second reference coordinate system is the northeast celestial coordinate system.
[0079] In the embodiment of the present application, considering that the three-axis magnetic field data calculated in step 3022 is in the north-east earth coordinate system, and the electronic device uses the northeast celestial coordinate system, the two need to be converted through a rotation matrix.
[0080] Exemplarily, the three-axis magnetic field data of the electronic device in the first reference coordinate system is: The rotation matrix is recorded as By using formula (3), the three-axis magnetic field data of the electronic device in the second reference coordinate system can be calculated: in, The upper left script "ENU" indicates the northeast celestial coordinate system, and the lower right script "x" indicates the magnetic field value in the X-axis direction.
[0081]
[0082] In step 3024, the three-axis magnetic field data of the electronic device in the second reference coordinate system is determined as the current standard three-axis magnetic field data of the electronic device.
[0083] It can be seen that in the embodiment of the present application, only simple coordinate system conversion and matrix calculation are required to determine the current standard three-axis magnetic field data of the electronic device based on the yaw angle, pitch angle, rotation angle, magnetic inclination angle and the earth's magnetic field strength. The calculation process is relatively simple and the calculation speed is fast, thereby reducing the amount of computing resources occupied by the electronic device during the calibration process and improving the calibration speed.
[0084] In step 303, the three-axis magnetic field deviation value of the geomagnetic sensor is determined according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data.
[0085] In the embodiment of the present application, the three-axis magnetic field deviation value of the geomagnetic sensor refers to the value of the magnetic interference.
[0086] In the embodiment of the present application, the estimated relatively accurate standard three-axis magnetic field data is subtracted from the inaccurate measurement data of the geomagnetic sensor to calculate the three-axis magnetic field deviation value of the geomagnetic sensor.
[0087] For example, the three-axis magnetic intensity value in the measurement data of the geomagnetic sensor is recorded as (uncaliMag x ,uncaliMag y ,uncaliMag z ), the standard three-axis magnetic field data is recorded as According to formula (4), the three-axis magnetic field deviation value (magOffset x ,magOffset y,magOffset z ).
[0088]
[0089] In step 304, the geomagnetic sensor is calibrated based on the three-axis magnetic field deviation value.
[0090] For example, in the subsequent use process, the three-axis magnetic strength value obtained by the real-time measurement of the geomagnetic sensor is (uncaliMag x ,uncaliMag y ,uncaliMag z ), the three-axis magnetic field deviation value of the geomagnetic sensor (magOffset x ,magOffset y ,magOffset z ), according to formula (5), the three-axis magnetic intensity value after the geomagnetic sensor is calibrated can be calculated as (caliMag x ,caliMag y and caliMag z ).
[0091]
[0092] It can be seen from the above embodiments that in this embodiment, when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device are obtained; based on the yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength, the current standard three-axis magnetic field data of the electronic device is determined; based on the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data, the three-axis magnetic field deviation value of the geomagnetic sensor is determined; based on the three-axis magnetic field deviation value, the geomagnetic sensor is calibrated, so that the geomagnetic sensor can be calibrated without the user shaking the electronic device, thereby improving the convenience of geomagnetic sensor calibration.
[0093] Figure 4 This is a second flow chart of a geomagnetic sensor calibration method provided in an embodiment of the present application. Figure 4 As shown, the method may include the following steps: step 401, step 402, step 403, step 404 and step 405;
[0094] In step 401, when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, a first time duration between a first moment when the geomagnetic sensor is subject to magnetic interference and a second moment when the gyroscope sensor of the electronic device was last calibrated is obtained; if the first time duration is less than a first threshold, the yaw angle, pitch angle and rotation angle are determined according to the measurement data of the gyroscope sensor and the measurement data of the acceleration sensor of the electronic device; the magnetic inclination angle and the strength of the earth's magnetic field are determined according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
[0095] In step 402, current standard three-axis magnetic field data of the electronic device is determined according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength.
[0096] In step 403, the three-axis magnetic field deviation value of the geomagnetic sensor is determined according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data.
[0097] In step 404, the geomagnetic sensor is calibrated based on the three-axis magnetic field deviation value.
[0098] The contents of steps 401 to 404 in the embodiment of the present application are Figure 1 The contents of steps 301 to 304 in the illustrated embodiment are similar and will not be described in detail herein.
[0099] In step 405, when the second time length between the current moment and the second moment is equal to the first threshold, the gyroscope sensor is calibrated based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor.
[0100] In an embodiment of the present application, if the second time length between the current moment and the second moment is equal to the first threshold, it means that the error of the gyroscope sensor has accumulated to a certain extent, and the measurement data of the gyroscope sensor has become inaccurate. At this time, in order to ensure the accuracy of the measurement data of the gyroscope sensor, the gyroscope sensor is calibrated based on the measurement data of the calibrated geomagnetic sensor and the measurement data of the acceleration sensor.
[0101] In the embodiment of the present application, an accurate yaw angle can be calculated based on the measurement data of the calibrated geomagnetic sensor, and the accurate pitch angle and rotation angle of the electronic device in a stationary state can be calculated based on the measurement data of the acceleration sensor. The gyroscope sensor is calibrated by the calculated accurate yaw angle, pitch angle and rotation angle.
[0102] It can be seen that in the embodiments of the present application, the gyroscope sensor can be calibrated by using the calibrated geomagnetic sensor measurement data and the acceleration sensor measurement data to eliminate the error of the gyroscope sensor, so that the gyroscope sensor outputs accurate measurement data, and the geomagnetic sensor is further calibrated based on the accurate measurement data of the gyroscope sensor. When the electronic device is stationary, dynamic mutual calibration of the geomagnetic sensor and the gyroscope sensor is formed, thereby improving the convenience of calibration of the geomagnetic sensor and the gyroscope sensor.
[0103] In some other embodiments provided in the present application, before the first moment when the geomagnetic sensor is subjected to magnetic interference, the gyroscope sensor can be calibrated according to a first action of the user shaking the electronic device.
[0104] In an embodiment of the present application, in the initial situation, that is, when the gyroscope sensor is calibrated for the first time, the user can manually shake the electronic device to complete the calibration of the gyroscope sensor, and then the geomagnetic sensor and the gyroscope sensor are calibrated with each other through cooperation.
[0105] It can be seen that in the embodiment of the present application, the process of calibrating the geomagnetic sensor can be entered by shaking the electronic device only once, which reduces the number of times the device is shaken and improves the convenience of geomagnetic sensor calibration.
[0106] The geomagnetic sensor calibration method provided in the embodiment of the present application can be executed by a geomagnetic sensor calibration device. In the embodiment of the present application, the geomagnetic sensor calibration method executed by the geomagnetic sensor calibration device is taken as an example to illustrate the geomagnetic sensor calibration method provided in the embodiment of the present application.
[0107] Figure 5 is a structural block diagram of a geomagnetic sensor calibration device provided in an embodiment of the present application, such as Figure 5 As shown, the geomagnetic sensor calibration device 500 may include the following modules: an acquisition module 501, a first determination module 502, a second determination module 503 and a first calibration module 504;
[0108] The acquisition module 501 is used to acquire the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference;
[0109] A first determination module 502 is used to determine the current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength;
[0110] A second determination module 503 is used to determine the three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data;
[0111] The first calibration module 504 is configured to calibrate the geomagnetic sensor based on the three-axis magnetic field deviation value.
[0112] It can be seen from the above embodiments that in this embodiment, when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device are obtained; based on the yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength, the current standard three-axis magnetic field data of the electronic device is determined; based on the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data, the three-axis magnetic field deviation value of the geomagnetic sensor is determined; based on the three-axis magnetic field deviation value, the geomagnetic sensor is calibrated, so that the geomagnetic sensor can be calibrated without the user shaking the electronic device, thereby improving the convenience of geomagnetic sensor calibration.
[0113] Optionally, as an embodiment, the acquisition module 501 may include:
[0114] A first acquisition submodule, used to acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated;
[0115] a first determining submodule, configured to determine the yaw angle, the pitch angle, and the rotation angle according to measurement data of the gyroscope sensor and measurement data of the acceleration sensor of the electronic device when the first duration is less than a first threshold;
[0116] The second determination submodule is used to determine the magnetic inclination angle and the earth's magnetic field strength according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
[0117] Optionally, as an embodiment, the geomagnetic sensor calibration device 500 may further include:
[0118] The second calibration module is used to calibrate the gyroscope sensor based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor when a second time length between the current moment and the second moment is equal to the first threshold.
[0119] Optionally, as an embodiment, the geomagnetic sensor calibration device 500 may further include:
[0120] The third calibration module is used to calibrate the gyroscope sensor according to a first action of a user shaking the electronic device before the first moment.
[0121] Optionally, as an embodiment, the acquisition module 501 may include:
[0122] A second acquisition submodule, used to acquire a first time length between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated;
[0123] A third determining submodule, configured to determine the angle input by the user as the yaw angle when the first time duration is greater than or equal to a first threshold;
[0124] a fourth determination submodule, configured to determine the pitch angle and the rotation angle according to measurement data of an acceleration sensor of the electronic device;
[0125] The fifth determination submodule is used to determine the magnetic inclination angle and the Earth's magnetic field strength according to the measurement data of the geomagnetic sensor.
[0126] Optionally, as an embodiment, the first determining module 502 may include:
[0127] a sixth determination submodule, configured to determine three-axis magnetic field data in a first reference coordinate system according to the yaw angle, the magnetic inclination angle and the earth's magnetic field strength, wherein the first reference coordinate system is a north-east coordinate system;
[0128] a seventh determination submodule, configured to determine the three-axis magnetic field data of the electronic device in the first reference coordinate system according to the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system;
[0129] an eighth determination submodule, configured to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system according to a coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is a northeast celestial coordinate system;
[0130] The ninth determining submodule is used to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system as the current standard three-axis magnetic field data of the electronic device.
[0131] The geomagnetic sensor calibration device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, a super mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (Television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0132] The geomagnetic sensor calibration device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0133] The geomagnetic sensor calibration device provided in the embodiment of the present application can achieve Figure 3 or Figure 4 To avoid repetition, the various processes implemented in the illustrated method embodiment will not be described again here.
[0134] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores programs or instructions that can be executed on the processor 601, and when the program or instructions are executed by the processor 601, the various steps of the above-mentioned geomagnetic sensor calibration method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0135] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0136] Figure 7 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application.
[0137] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0138] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0139] Processor 710 is used to obtain the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth's magnetic field strength of the electronic device when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference; determine the current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength; determine the three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data; and calibrate the geomagnetic sensor based on the three-axis magnetic field deviation value.
[0140] It can be seen that in the embodiment of the present application, the geomagnetic sensor can be calibrated without the user shaking the electronic device, which improves the convenience of geomagnetic sensor calibration.
[0141] Optionally, as an embodiment, the processor 710 is specifically configured to obtain a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated;
[0142] When the first time length is less than a first threshold, the yaw angle, the pitch angle and the rotation angle are determined according to the measurement data of the gyroscope sensor and the measurement data of the acceleration sensor of the electronic device; the magnetic inclination angle and the strength of the earth's magnetic field are determined according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
[0143] Optionally, as an embodiment, the processor 710 is also used to calibrate the gyroscope sensor based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor when a second time length between the current moment and the second moment is equal to the first threshold.
[0144] Optionally, as an embodiment, the processor 710 is further used to calibrate the gyroscope sensor according to a first action of the user shaking the electronic device before the first moment.
[0145] Optionally, as an embodiment, the processor 710 is specifically configured to obtain a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated;
[0146] When the first time length is greater than or equal to a first threshold, the angle input by the user is determined as the yaw angle; the pitch angle and the rotation angle are determined based on the measurement data of the acceleration sensor of the electronic device; and the magnetic inclination angle and the strength of the earth's magnetic field are determined based on the measurement data of the geomagnetic sensor.
[0147] Optionally, as an embodiment, the processor 710 is specifically configured to determine three-axis magnetic field data in a first reference coordinate system according to the yaw angle, the magnetic inclination angle and the earth's magnetic field strength, wherein the first reference coordinate system is a north-east coordinate system;
[0148] Determining the three-axis magnetic field data of the electronic device in the first reference coordinate system according to the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system;
[0149] Determine the three-axis magnetic field data of the electronic device in the second reference coordinate system according to the coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is the northeast celestial coordinate system;
[0150] The three-axis magnetic field data of the electronic device in the second reference coordinate system is determined as current standard three-axis magnetic field data of the electronic device.
[0151] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0152] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0153] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.
[0154] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned geomagnetic sensor calibration method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0156] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned geomagnetic sensor calibration method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0157] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0158] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned geomagnetic sensor calibration method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0159] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A geomagnetic sensor calibration method, characterized in that: The method comprises: When it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference, obtaining the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device; Determining current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength; Determining a three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data; The geomagnetic sensor is calibrated based on the three-axis magnetic field deviation value.
2. The method according to claim 1, characterized in that The obtaining of the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device includes: Acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated; When the first time length is less than a first threshold, the yaw angle, the pitch angle and the rotation angle are determined according to the measurement data of the gyroscope sensor and the measurement data of the acceleration sensor of the electronic device; the magnetic inclination angle and the strength of the earth's magnetic field are determined according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
3. The method according to claim 2, characterized in that After the step of calibrating the geomagnetic sensor based on the three-axis magnetic field deviation value, the method further includes: When a second time length between the current moment and the second moment is equal to the first threshold, the gyro sensor is calibrated based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor.
4. The method according to claim 2, characterized in that: The method further comprises: Before the first moment, the gyro sensor is calibrated according to a first action of a user shaking the electronic device.
5. The method according to claim 1, characterized in that The obtaining of the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device includes: Acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated; When the first time length is greater than or equal to a first threshold, the angle input by the user is determined as the yaw angle; the pitch angle and the rotation angle are determined based on the measurement data of the acceleration sensor of the electronic device; and the magnetic inclination angle and the strength of the earth's magnetic field are determined based on the measurement data of the geomagnetic sensor.
6. The method according to any one of claims 1 to 5, characterized in that: The step of determining the current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength includes: Determine three-axis magnetic field data in a first reference coordinate system according to the yaw angle, the magnetic inclination angle and the earth's magnetic field strength, wherein the first reference coordinate system is a north-east coordinate system; Determining the three-axis magnetic field data of the electronic device in the first reference coordinate system according to the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system; Determine the three-axis magnetic field data of the electronic device in the second reference coordinate system according to the coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is the northeast celestial coordinate system; The three-axis magnetic field data of the electronic device in the second reference coordinate system is determined as current standard three-axis magnetic field data of the electronic device.
7. A geomagnetic sensor calibration device, characterized in that: The device comprises: An acquisition module, used to acquire the current yaw angle, pitch angle, rotation angle, magnetic inclination angle and earth magnetic field strength of the electronic device when it is detected that the geomagnetic sensor of the electronic device is subject to magnetic interference; A first determination module is used to determine the current standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the rotation angle, the magnetic inclination angle and the earth's magnetic field strength; A second determination module is used to determine the three-axis magnetic field deviation value of the geomagnetic sensor according to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data; The first calibration module is used to calibrate the geomagnetic sensor based on the three-axis magnetic field deviation value.
8. The device according to claim 7, characterized in that The acquisition module comprises: A first acquisition submodule, used to acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated; a first determining submodule, configured to determine the yaw angle, the pitch angle, and the rotation angle according to measurement data of the gyroscope sensor and measurement data of the acceleration sensor of the electronic device when the first duration is less than a first threshold; The second determination submodule is used to determine the magnetic inclination angle and the earth's magnetic field strength according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
9. The device according to claim 8, characterized in that The device also includes: The second calibration module is used to calibrate the gyroscope sensor based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor when a second time length between the current moment and the second moment is equal to the first threshold.
10. The device according to claim 8, characterized in that The device also includes: The third calibration module is used to calibrate the gyroscope sensor according to a first action of a user shaking the electronic device before the first moment.
11. The device according to claim 7, characterized in that The acquisition module comprises: A second acquisition submodule, used to acquire a first time length between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device is last calibrated; A third determining submodule, configured to determine the angle input by the user as the yaw angle when the first time duration is greater than or equal to a first threshold; a fourth determination submodule, configured to determine the pitch angle and the rotation angle according to measurement data of an acceleration sensor of the electronic device; The fifth determination submodule is used to determine the magnetic inclination angle and the Earth's magnetic field strength according to the measurement data of the geomagnetic sensor.
12. The device according to any one of claims 7 to 11, characterized in that: The first determining module comprises: a sixth determination submodule, configured to determine three-axis magnetic field data in a first reference coordinate system according to the yaw angle, the magnetic inclination angle and the earth's magnetic field strength, wherein the first reference coordinate system is a north-east coordinate system; a seventh determination submodule, configured to determine the three-axis magnetic field data of the electronic device in the first reference coordinate system according to the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system; an eighth determination submodule, configured to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system according to a coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is a northeast celestial coordinate system; The ninth determining submodule is used to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system as the current standard three-axis magnetic field data of the electronic device.
13. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the geomagnetic sensor calibration method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Geomagnetic vector measurement error calibration method with combination of element restriction and summation restriction
CN105785477A
Interference-resistant method for heading attitude resolving and compass calibration
CN109238262A
Automatic calibration method and system for geomagnetic sensor, medium and computer
CN118209134A
System and method for portable electronic device that detect attitude and angular velocity using magnetic sensor and accelerometer
JP2013029512A
Apparatus and method for calibrating offset ofgeomagnetic sensor
KR100799877B1
