Magnetometer calibration method and device, electronic equipment and readable storage medium

By establishing an external interference error model of magnetometer and calculating the vehicle angle with the accelerometer data, high-precision calibration of the magnetometer is achieved, solving the problem of poor calibration effect under the influence of external interference in the prior art.

CN120063319APending Publication Date: 2025-05-30CETC SPECIAL MISSION AIRCRAFT SYST ENG
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311624587.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing magnetometer calibration methods fail to effectively consider external interference, resulting in poor calibration results and limited accuracy.

Method used

By establishing an error model based on the external interference of the magnetometer, combining the accelerometer measurement data to calculate the roll angle, pitch angle and yaw angle of the vehicle, and then calibration of the magnetometer is carried out.

Benefits of technology

The calibration accuracy and calibration effect of the magnetometer are improved, effectively eliminating the impact of external interference on magnetometer measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120063319A_ABST
    Figure CN120063319A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetometer calibration method and device, electronic equipment and a computer readable storage medium, which are applied to the technical field of electronic equipment, and are used for solving the problem of low magnetometer calibration accuracy in the prior art, and the method comprises the steps: building a magnetometer error model based on the external interference condition of a magnetometer; calculating a roll angle and a pitch angle of the carrier according to measurement data of the accelerometer; according to the roll angle and the pitch angle, a yaw angle of the carrier is calculated in combination with a magnetometer error model; performing magnetometer calibration according to the roll angle, the pitch angle and the yaw angle; due to the fact that the external interference of the magnetometer is considered in the process of calibrating the magnetometer, the calibration accuracy and the calibration effect of the magnetometer can be improved through the magnetometer calibration method and the magnetometer calibration device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic devices, and particularly to a magnetometer calibration method, device, electronic device, and computer-readable storage medium. Background Art

[0002] A magnetometer is a sensor that obtains attitude information by detecting and measuring the magnetic field intensity, and is widely used in fields such as aerospace, autonomous driving, robot navigation, and virtual reality. In these applications, accurate attitude and position measurements are crucial for system performance; however, due to manufacturing processes, environmental factors, and inherent defects of the sensor itself, the magnetometer has errors and uncertainties, and accurate magnetic field measurement is crucial for sensor fusion and determining heading and direction. Therefore, low-cost MEMS (Micro Electro Mechanical System) magnetometers need to be calibrated to compensate for environmental noise and manufacturing defects before being used for heading calculation. In a combined navigation system, attitude solution often requires the simultaneous use of a three-axis accelerometer and a three-axis magnetometer, where: the accelerometer is responsible for measuring the components of the earth's gravity, and the magnetometer is responsible for measuring the components of the earth's magnetic field (geomagnetic field). Since both the accelerometer and the magnetometer are fixed on a printed circuit board (PCB), the sensor data will vary according to the direction of the PCB. If the PCB remains flat, the heading can be calculated from the arctangent of the ratio of the two horizontal magnetic field components. However, in most application scenarios, the direction of the PCB is not stable; therefore, there will be a large error in directly using the magnetometer to calculate the heading.

[0003] Magnetometer errors are mainly divided into inherent errors and external disturbances. Inherent errors include non-linearity, offset, and temperature drift, while external disturbances involve factors such as magnetic field interference and electromagnetic radiation. The influence of external disturbances is usually not considered in current magnetometer calibration methods, resulting in poor calibration effects.

[0004] In view of this, how to improve the calibration accuracy of the magnetometer is a problem that those skilled in the art need to solve. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a magnetometer calibration method, device, electronic device, and computer-readable storage medium, which improve the calibration accuracy and calibration effect of the magnetometer during use.

[0006] To solve the above technical problems, the embodiments of the present invention provide a magnetometer calibration method, including:

[0007] Establishing a magnetometer error model based on the external disturbance situation of the magnetometer;

[0008] Calculate the roll angle and pitch angle of the vehicle based on the measurement data of the accelerometer;

[0009] Calculate the yaw angle of the vehicle according to the roll angle and the pitch angle, in combination with the magnetometer error model;

[0010] Perform magnetometer calibration according to the roll angle, the pitch angle and the yaw angle.

[0011] In one embodiment, establishing the magnetometer error model based on the external interference situation of the magnetometer includes:

[0012] Establish a magnetometer error model based on the hard iron effect of the magnetometer.

[0013] In one embodiment, the magnetometer error model is:

[0014] Wherein,

[0015]

[0016] B p represents the magnetic field intensity of the vehicle, B represents the magnetic field intensity measured by the magnetometer, δ represents the installation angle between the magnetometer and the vehicle, V represents the offset of the magnetometer under the hard iron effect, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V y represents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system, φ represents the roll angle, θ represents the pitch angle, ψ represents the yaw angle.

[0017] In one embodiment, the calculating the roll angle and pitch angle of the vehicle based on the measurement data of the accelerometer includes:

[0018] Calculate the roll angle of the vehicle according to the measurement data of the accelerometer in combination with the roll angle calculation relation; the roll angle calculation relation is:

[0019] Wherein, G py represents the component of the acceleration of the vehicle along the y-axis in the navigation coordinate system, G pz represents the component of the acceleration of the vehicle along the z-axis in the navigation coordinate system;

[0020] Calculate the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle in combination with the pitch angle calculation relation; the pitch angle calculation relation is:

[0021] Wherein, G px represents the component of the acceleration of the vehicle along the x-axis in the navigation coordinate system;

[0022] Then, calculating the yaw angle of the vehicle according to the roll angle and the pitch angle and combining the magnetometer error model includes:

[0023] Calculating the yaw angle of the vehicle according to the roll angle and the pitch angle of the vehicle and combining a first yaw angle calculation relation; the first yaw angle calculation relation is:

[0024] where B px represents the component of the magnetic field intensity of the vehicle along the x-axis in the navigation coordinate system, B py represents the component of the magnetic field intensity of the vehicle along the y-axis in the navigation coordinate system, B pz represents the component of the magnetic field intensity of the vehicle along the z-axis in the navigation coordinate system, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V y represents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system.

[0025] In one embodiment, establishing the magnetometer error model based on the external interference situation of the magnetometer includes:

[0026] Establishing the magnetometer error model based on the soft iron effect and the hard iron effect of the magnetometer.

[0027] In one embodiment, the magnetometer error model is:

[0028] where {W -1 (B p -V)} T W -1 (B p -V) = B 2 ;

[0029]

[0030] W represents the matrix composed of the offsets of the magnetometer under the soft iron effect, B p represents the magnetic field intensity of the vehicle, B represents the magnetic field intensity measured by the magnetometer, V represents the offset of the magnetometer under the hard iron effect, φ represents the roll angle, θ represents the pitch angle, ψ represents the yaw angle, and δ represents the installation angle between the magnetometer and the vehicle.

[0031] In one embodiment, calculating the roll angle and the pitch angle of the vehicle according to the measurement data of the accelerometer includes:

[0032] Calculate the roll angle of the vehicle according to the measurement data of the accelerometer in combination with the roll angle calculation relationship, and the roll angle calculation relationship is:

[0033] where G py represents the component of the vehicle's acceleration along the y-axis in the navigation coordinate system, and G pz represents the component of the vehicle's acceleration along the z-axis in the navigation coordinate system;

[0034] Calculate the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle in combination with the pitch angle calculation relationship, and the pitch angle calculation relationship is:

[0035] where G px represents the component of the vehicle's acceleration along the x-axis in the navigation coordinate system;

[0036] Calculating the yaw angle of the vehicle according to the roll angle and the pitch angle in combination with the magnetometer error model includes:

[0037] According to the roll angle and pitch angle of the vehicle, in combination with the relationship calculate B fy and B fx ; where B fx , B fy and B fz respectively represent the x-axis, y-axis and z-axis components of the magnetometer in the magnetometer coordinate system after being offset by the hard iron effect at the plane position;

[0038] Based on B fy and B fx in combination with the second yaw angle calculation relationship, calculate the yaw angle of the vehicle; the second yaw angle calculation relationship is:

[0039]

[0040] An embodiment of the present invention also provides a magnetometer calibration device, including:

[0041] A building module for building a magnetometer error model based on the external interference situation of the magnetometer;

[0042] A first calculation module for calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer;

[0043] A second calculation module for calculating the yaw angle of the vehicle according to the roll angle and the pitch angle in combination with the magnetometer error model;

[0044] A calibration module for calibrating the magnetometer according to the roll angle, the pitch angle and the yaw angle.

[0045] An embodiment of the present invention further provides an electronic device, including:

[0046] A memory for storing a computer program;

[0047] A processor for implementing the steps of the magnetometer calibration method as described above when executing the computer program.

[0048] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the magnetometer calibration method as described above are implemented.

[0049] A magnetometer calibration method, device, electronic device and computer-readable storage medium provided in an embodiment of the present invention include: establishing a magnetometer error model based on the external interference situation of the magnetometer; calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer; calculating the yaw angle of the vehicle according to the roll angle and pitch angle in combination with the magnetometer error model; and calibrating the magnetometer according to the roll angle, pitch angle and yaw angle.

[0050] It can be seen that in the embodiment of the present invention, a magnetometer error model is established according to the external interference request of the magnetometer, and the measurement data of the accelerometer simultaneously provided on the vehicle with the magnetometer is obtained. Further, the roll angle and pitch angle of the vehicle are calculated from the measurement data of the accelerometer, and then the yaw angle of the vehicle is calculated according to the roll angle and pitch angle of the vehicle in combination with the magnetometer error model. The magnetometer is calibrated by using the roll angle, pitch angle and yaw angle. Since the external interference of the magnetometer is considered in the process of calibrating the magnetometer in this application, the calibration accuracy and calibration effect of the magnetometer can be improved through this application. Description of the Drawings

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the prior art and the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0052] Figure 1 It is a schematic diagram of an existing hard iron effect;

[0053] Figure 2 It is a schematic diagram of an existing soft iron effect;

[0054] Figure 3 It is a schematic flowchart of a magnetometer calibration method provided in an embodiment of the present invention;

[0055] Figure 4 Schematic diagram of an inertial navigation coordinate system provided by an embodiment of the present invention;

[0056] Figure 5 Schematic diagram of a gravity vector and magnetic field components provided by an embodiment of the present invention;

[0057] Figure 6 Schematic diagram of comparison before and after magnetometer calibration provided by an embodiment of the present invention;

[0058] Figure 7 Another schematic diagram of comparison before and after magnetometer calibration provided by an embodiment of the present invention;

[0059] Figure 8 Schematic diagram of the structure of a magnetometer calibration device provided by an embodiment of the present invention;

[0060] Figure 9 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0061] Figure 10 Schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present invention. Detailed implementation manners

[0062] The embodiments of the present invention provide a magnetometer calibration method, device, electronic device and computer-readable storage medium, which improve the calibration accuracy and calibration effect of the magnetometer during use.

[0063] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0064] It should be noted that the errors of the magnetometer are mainly divided into inherent errors and external interferences. The inherent errors include non-linearity, offset and temperature drift, while the external interferences involve factors such as magnetic field interference and electromagnetic radiation.

[0065] The external interference conditions of the magnetometer include the hard iron effect and the soft iron effect. Among them, the soft iron effect refers to the interference of the magnetometer by the surrounding changing magnetic field; these changing magnetic fields can come from wires through which current flows, electromagnetic waves, etc. Since the magnetometer has a certain response time, when the surrounding magnetic field changes rapidly, it will cause delays and distortions in the output of the magnetometer, thereby introducing errors. These interferences usually come from objects near the sensor, and these objects will distort the surrounding magnetic field and stretch the ideal sphere, and its effect is as Figure 1As shown. Moreover, the hard iron effect is more significant; the magnetometer is interfered by strong magnetic fields from surrounding permanent magnets and the like. These strong magnetic fields will have a significant impact on the measurement results of the magnetometer, causing errors. Its interference sources include nearby magnets, motors, solenoid valves, etc., which will generate static magnetic fields, and the magnetometer is very sensitive to static magnetic fields. These interferences change the origin of the ideal sphere, and its effect is as Figure 2 shown.

[0066] In addition, the errors of MEMS magnetometers mainly come from the following aspects:

[0067] Manufacturing process errors: The manufacturing process of MEMS magnetometers is a complex process, including steps such as photolithography, evaporation, and etching. Each step may introduce errors. For example, in the photolithography process, inaccurate mask alignment or uneven exposure will lead to a decline in the performance of the magnetometer.

[0068] Device non-linearity: There is a non-linear relationship between the output and input magnetic field of MEMS magnetometers. This non-linearity may be caused by factors such as uneven propagation of the magnetic field in the magnetic sensitive layer and the change of the characteristics of the magnetic sensitive layer with the change of the input magnetic field.

[0069] Noise: The output of MEMS magnetometers is also interfered by various types of noise, such as thermal noise, vibration noise, electromagnetic interference, etc. These noises will reduce the sensitivity and accuracy of the magnetometer.

[0070] Temperature effect: Temperature changes will cause changes in the performance of MEMS magnetometers. Temperature changes will cause changes in the characteristics of the magnetic sensitive layer, thereby affecting the output of the magnetometer. In addition, temperature changes will also cause dimensional changes in other components of the magnetometer, further affecting the performance of the magnetometer.

[0071] Non-magnetic field interference: MEMS magnetometers may also be interfered by other non-magnetic field sources, such as electric field interference, gravitational influence, etc. These interferences will mislead the output of the magnetometer, resulting in errors.

[0072] Currently, the magnetometer calibration methods in the prior art usually do not consider the external interference of the magnetometer, resulting in poor calibration effects and limited accuracy. Therefore, in the embodiments of the present invention, a magnetometer calibration method that takes into account the external interference factors of the magnetometer is provided. Specifically, please refer to Figure 3 , Figure 3 which is a schematic flow chart of a magnetometer calibration method provided by an embodiment of the present invention. This magnetometer calibration method includes:

[0073] S110: Establish a magnetometer error model based on the external interference situation of the magnetometer;

[0074] It should be noted that in the embodiments of the present invention, the magnetometer is installed on the vehicle, and an accelerometer is also installed on the vehicle. When calibrating the magnetometer, a magnetometer error model can be established in combination with the external interference situation of the magnetometer.

[0075] S120: Calculate the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer;

[0076] Specifically, during the movement of the vehicle, the accelerometer continuously collects acceleration data, and the roll angle and pitch angle of the vehicle can be calculated according to the measurement data of the accelerometer.

[0077] S130: Calculate the yaw angle of the vehicle according to the roll angle and pitch angle, in combination with the magnetometer error model;

[0078] Specifically, after obtaining the roll angle and pitch angle, the roll angle and pitch angle can be substituted into the magnetometer error model, so that the yaw angle of the vehicle can be calculated.

[0079] S140: Calibrate the magnetometer according to the roll angle, pitch angle and yaw angle.

[0080] Specifically, after obtaining the roll angle, pitch angle and yaw angle of the vehicle, the magnetometer can be calibrated according to the roll angle, pitch angle and yaw angle of the vehicle, so as to realize the precise calibration of the magnetometer.

[0081] It should be noted that in the embodiments of the invention, the NED coordinate system is used to describe the attitude of the rigid body, as Figure 4 shown; generally speaking, the attitude of any rigid body can be obtained by rotating around the three axes of the NED coordinate system. At this starting reference position, the reference data of the accelerometer is G r and the reference data of the magnetometer is B r , specifically as follows:

[0082] and where g represents the gravitational acceleration of the object on the earth's surface, 9.81 m / s 2 , and B represents the magnetic field intensity on the earth's surface (i.e., the magnetic field intensity measured by the magnetometer).

[0083] Specifically, the gravity vector and magnetic field components are as Figure 5 shown.

[0084] In strapdown inertial navigation (also in the navigation coordinate system), the motion acceleration G p of the vehicle and the magnetic field intensity B p are usually the measurement data of the magnetometer rotated three times around the coordinate axes by R x (φ), R y (θ) and R zObtained after (ψ), that is:

[0085]

[0086]

[0087]

[0088]

[0089]

[0090] Among them, φ represents the roll angle, θ represents the pitch angle, and ψ represents the yaw angle.

[0091] The following will elaborate on the technical solution for different external interference situations:

[0092] In one embodiment, for the external interference situation of the magnetometer in S110 above, a magnetometer error model is established, including:

[0093] Establish a magnetometer error model based on the hard iron effect of the magnetometer.

[0094] It should be noted that in the embodiment of the present invention, considering the influence of the hard iron effect on the magnetometer, a magnetometer error model is established according to the influence of the hard iron effect on the magnetometer.

[0095] Specifically, the specific form of this magnetometer error model can be:

[0096]

[0097] Among them:

[0098]

[0099] B p represents the magnetic field strength of the vehicle, B represents the magnetic field strength measured by the magnetometer, δ represents the installation angle between the magnetometer and the vehicle, V represents the offset of the magnetometer under the hard iron effect, and this offset is a fixed magnetic offset, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V y represents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system, φ represents the roll angle, θ represents the pitch angle, and ψ represents the yaw angle.

[0100] Specifically, for the relational expression The inverse matrix of roll and pitch rotation can be multiplied, and then the roll angle and pitch angle are calculated based on the accelerometer:

[0101] Wherein:

[0102]

[0103]

[0104] Therefore, the tangent functions of the roll angle φ and the pitch angle θ can be calculated as follows:

[0105]

[0106]

[0107] Therefore, in the embodiment of the present invention, the process of calculating the roll angle and the pitch angle of the vehicle according to the measurement data of the accelerometer in S120 above may include:

[0108] Calculating the roll angle of the vehicle according to the measurement data of the accelerometer in combination with the roll angle calculation relationship; the roll angle calculation relationship is:

[0109] Wherein, G py represents the component of the acceleration of the vehicle along the y-axis in the navigation coordinate system, and G pz represents the component of the acceleration of the vehicle along the z-axis in the navigation coordinate system;

[0110] Calculating the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle in combination with the pitch angle calculation relationship; the pitch angle calculation relationship is:

[0111] Wherein, G px represents the component of the acceleration of the vehicle along the x-axis in the navigation coordinate system;

[0112] Then, the process of calculating the yaw angle of the vehicle according to the roll angle and the pitch angle in combination with the magnetometer error model in S130 above may specifically include:

[0113] Calculating the yaw angle of the vehicle according to the roll angle and the pitch angle of the vehicle in combination with the first yaw angle calculation relationship; the first yaw angle calculation relationship is:

[0114] Wherein, B px represents the component of the magnetic field intensity of the vehicle along the x-axis in the navigation coordinate system, B py represents the component of the magnetic field intensity of the vehicle along the y-axis in the navigation coordinate system, B pz represents the component of the magnetic field intensity of the vehicle along the z-axis in the navigation coordinate system, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V yrepresents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system.

[0115] It should be noted that based on and After calculating the roll angle φ and pitch angle θ, the roll angle φ and pitch angle θ can be further substituted into equation (1.8) to correct the vehicle orientation:

[0116]

[0117]

[0118] Further, according to the above equation (1.15), we can obtain:

[0119] cosψBcosδ = B fx (1.16)

[0120] sinψBcosδ = -B fy (1.17)

[0121]

[0122] Therefore, based on the above first yaw angle calculation relationship (0.1), the yaw angle ψ can be calculated, so as to calibrate the magnetometer based on the roll angle, pitch angle and yaw angle to eliminate the influence of the hard iron effect on the magnetometer.

[0123] It should also be noted that in practical applications, due to equations (1.12), (1.13) and (1.18) having infinite solutions at multiples of 360°; therefore, in navigation, the angles of roll, pitch and yaw are usually restricted within the range of -180° to 180°. Usually, the pitch angle is further restricted to the range of -90° to 90°, which ensures a unique solution for the heading angle.

[0124] It should also be noted that the hard iron offset is the sum of the inherent offset within the magnetometer sensor itself plus the permanent magnetic field within the PCB generated by the magnetized material. In the absence of any hard iron effect, the trajectory change of the magnetometer output is located on the surface of a sphere with B px 、B py and B pz as the origin, and the radius is equal to the magnitude B of the geomagnetic field. In the presence of the hard iron effect, the measured value of the magnetic field trajectory is simply displaced by the hard iron vector V, making the origin of the sphere equal to the hard iron offset V x 、V y and V z .

[0125] In one embodiment, based on the external interference situation of the magnetometer, a magnetometer error model is established, including:

[0126] Establish a magnetometer error model based on the soft iron effect and hard iron effect of the magnetometer.

[0127] It should be noted that in the embodiments of the present invention, considering that the magnetometer is affected by both the hard iron effect and the soft iron effect, a magnetometer error model is established according to the effects of the hard iron effect and the soft iron effect on the magnetometer.

[0128] Among them, the soft iron effect is the interference magnetic field generated by the geomagnetic field on the normally unmagnetized ferromagnetic components on the PCB. Assume that the induced soft iron field is linearly correlated with the measured geomagnetic field through a 3×3 matrix W soft The magnetometer usually has approximately equal proportional gains in three axes; any other differences in the proportional gains can be modeled by a diagonal gain matrix W gain . In addition, W NonOrthog represents the orthogonal error between the measurement coordinate system of the magnetometer sensor and the carrier coordinate system. Based on this, these three matrices can be combined into a 3×3 soft iron matrix W, that is, W = W NonOrthog W gain W soft , and W can be obtained by solving based on the least square principle . Among them, W is a matrix composed of offsets. For example, if the three-axis (x, y, z) offsets are 1.04, 1.55, 0.62, then this W is:

[0129] Of course, the specific values of each element in W can be obtained by solving according to the above formula {W -1 (B p -V)} T W -1 (B p -V) = B 2 .

[0130] Based on this, the above relational formula (1.8) can be rewritten as: That is, a magnetometer error model established based on the soft iron effect and hard iron effect of the magnetometer is obtained. The magnetometer error model is:

[0131] Among them, {W -1 (B p -V)} T W -1 (B p -V) = B 2 ;

[0132]

[0133] W represents the matrix composed of the offsets of the magnetometer under the soft iron effect, B p represents the magnetic field intensity of the vehicle, B represents the magnetic field intensity measured by the magnetometer, V represents the offset of the magnetometer under the hard iron effect, φ represents the roll angle, θ represents the pitch angle, ψ represents the yaw angle, and δ represents the installation angle between the magnetometer and the vehicle.

[0134] Specifically, for the relational expression The inverse matrices of roll and pitch rotations can be multiplied, and then the roll angle and pitch angle can be calculated based on the accelerometer:

[0135] Where:

[0136]

[0137]

[0138] Thus, the tangent functions of the roll angle φ and the pitch angle θ can be calculated as follows:

[0139]

[0140]

[0141] In one embodiment, calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer in S120 above includes:

[0142] Calculating the roll angle of the vehicle according to the measurement data of the accelerometer combined with the roll angle calculation relational expression. The roll angle calculation relational expression is:

[0143] Where, G py represents the component of the acceleration of the vehicle along the y-axis in the navigation coordinate system, G pz represents the component of the acceleration of the vehicle along the z-axis in the navigation coordinate system;

[0144] Calculating the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle combined with the pitch angle calculation relational expression. The pitch angle calculation relational expression is:

[0145] Where, G px represents the component of the acceleration of the vehicle along the x-axis in the navigation coordinate system;

[0146] Then, correspondingly, calculating the yaw angle of the vehicle according to the roll angle and pitch angle, combined with the magnetometer error model, includes:

[0147] According to the roll angle and pitch angle of the vehicle, combined with the relational expression calculate B fy and B fx; where B fx , B fy and B fz respectively represent the components of the x-axis, y-axis, and z-axis of the magnetometer in the magnetometer coordinate system after the offset of the hard iron effect at the planar position;

[0148] Based on B fy and B fx and combining with the second yaw angle calculation relationship, the yaw angle of the vehicle is calculated; the second yaw angle calculation relationship is:

[0149]

[0150] It should be noted that after calculating the roll angle φ and pitch angle θ based on and , the roll angle φ and pitch angle θ can be further substituted into Equation to obtain:

[0151] Further, according to cosψBcosδ = B fx and sinψBcosδ = -B fy we get:

[0152] Since the right sides of the equations are all known parameters, the specific values of B fx , B fy and B fz can be solved. Further, by combining with the second yaw angle calculation relationship the yaw angle can be solved, so as to calibrate the magnetometer based on the roll angle, pitch angle, and yaw angle to eliminate the influence of the soft iron effect and hard iron effect on the magnetometer.

[0153] Specifically, please refer to Figure 6 and Figure 7 for the comparison schematic diagrams of the magnetometer before and after calibration.

[0154] It can be seen that in the embodiments of the present invention, a magnetometer error model is established according to the external interference request of the magnetometer, and the measurement data of the accelerometer set on the vehicle at the same time as the magnetometer is obtained. Further, the roll angle and pitch angle of the vehicle are calculated from the measurement data of the accelerometer, and then the yaw angle of the vehicle is calculated according to the roll angle and pitch angle of the vehicle in combination with the magnetometer error model. The magnetometer is calibrated using the roll angle, pitch angle, and yaw angle. Since the external interference of the magnetometer is considered in the process of calibrating the magnetometer in this application, the calibration accuracy and calibration effect of the magnetometer can be improved through this application.

[0155] Based on the above embodiments, an embodiment of the present invention further provides a magnetometer calibration device. Specifically, please refer to Figure 8, the device includes:

[0156] A building module 11, configured to build a magnetometer error model based on the external interference condition of the magnetometer;

[0157] A first calculation module 12, configured to calculate the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer;

[0158] A second calculation module 13, configured to calculate the yaw angle of the vehicle according to the roll angle and pitch angle in combination with the magnetometer error model;

[0159] A calibration module 14, configured to calibrate the magnetometer according to the roll angle, pitch angle and yaw angle.

[0160] It should be noted that the magnetometer calibration device provided in the embodiments of the present invention has the same beneficial effects as the magnetometer calibration method provided in the above embodiments, and for the specific introduction of the magnetometer calibration method involved in the embodiments of the present invention, please refer to the above embodiments, and this application will not repeat them here.

[0161] Figure 9 It is a structural diagram of an electronic device provided in an embodiment of the present application, as Figure 9 shown, the electronic device includes: a memory 20, configured to store a computer program;

[0162] A processor 21, configured to implement the steps of the magnetometer calibration method as in the above embodiments when executing the computer program.

[0163] The electronic device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer or a desktop computer, etc.

[0164] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0165] The memory 20 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 20 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the magnetometer calibration method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, set offsets, etc.

[0166] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0167] Those skilled in the art can understand that Figure 9 the structure shown in

[0168] It can be understood that if the magnetometer calibration method in the above embodiments is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), electrically erasable programmable ROMs, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical discs.

[0169] Based on this, as Figure 10 shown, an embodiment of the present invention further provides a computer-readable storage medium. A computer program 31 is stored on the computer-readable storage medium 30. When the computer program 31 is executed by a processor, the steps of the magnetometer calibration method as described above are implemented.

[0170] In this specification, the various embodiments are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0171] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0172] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A magnetometer calibration method, characterized in that, it includes: Based on the external interference situation of the magnetometer, establish a magnetometer error model; According to the measurement data of the accelerometer, calculate the roll angle and pitch angle of the vehicle; According to the roll angle and the pitch angle, combined with the magnetometer error model, calculate the yaw angle of the vehicle; Perform magnetometer calibration according to the roll angle, the pitch angle and the yaw angle.

2. The magnetometer calibration method according to claim 1, characterized in that, the establishing a magnetometer error model based on the external interference situation of the magnetometer includes: Establish a magnetometer error model based on the hard iron effect of the magnetometer.

3. The magnetometer calibration method according to claim 2, characterized in that, the magnetometer error model is: Among them, B p represents the magnetic field intensity of the vehicle, B represents the magnetic field intensity measured by the magnetometer, δ represents the installation angle between the magnetometer and the vehicle, V represents the offset of the magnetometer under the influence of hard iron effect, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V y represents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system, φ represents the roll angle, θ represents the pitch angle, and ψ represents the yaw angle.

4. The magnetometer calibration method according to claim 3, characterized in that, the calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer includes: Calculate the roll angle of the vehicle according to the measurement data of the accelerometer combined with the roll angle calculation relation; the roll angle calculation relation is: where G py represents the component of the vehicle's acceleration along the y-axis in the navigation coordinate system, and G pz represents the component of the vehicle's acceleration along the z-axis in the navigation coordinate system; Calculate the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle combined with the pitch angle calculation relation; the pitch angle calculation relation is: Wherein, G px represents the component of the acceleration of the vehicle along the x-axis in the navigation coordinate system; Then, the calculating the yaw angle of the vehicle according to the roll angle and the pitch angle, combined with the magnetometer error model, includes: Calculate the yaw angle of the vehicle according to the roll angle and pitch angle of the vehicle combined with the first yaw angle calculation relation; the first yaw angle calculation relation is: Among them, B px represents the component of the magnetic field intensity of the vehicle along the x-axis in the navigation coordinate system, B py represents the component of the magnetic field intensity of the vehicle along the y-axis in the navigation coordinate system, B pz represents the component of the magnetic field intensity of the vehicle along the z-axis in the navigation coordinate system, V x represents the component of the offset along the x-axis in the magnetometer coordinate system, V y represents the component of the offset along the y-axis in the magnetometer coordinate system, V z represents the component of the offset along the z-axis in the magnetometer coordinate system.

5. The magnetometer calibration method according to claim 1, characterized in that, the establishing a magnetometer error model based on the external interference situation of the magnetometer includes: Establish a magnetometer error model based on the soft iron effect and hard iron effect of the magnetometer.

6. The magnetometer calibration method according to claim 5, characterized in that, the magnetometer error model is: Among them, {W -1 (B p -V)} T W -1 (B p -V) = B 2 ; $W$ represents the matrix composed of the offsets of the magnetometer under the soft iron effect, $B$ p represents the magnetic field intensity of the vehicle, $B$ represents the magnetic field intensity measured by the magnetometer, $V$ represents the offset of the magnetometer under the hard iron effect, $\varphi$ represents the roll angle, $\theta$ represents the pitch angle, $\psi$ represents the yaw angle, and $\delta$ represents the installation angle between the magnetometer and the vehicle.

7. The magnetometer calibration method according to claim 5, characterized in that, the calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer includes: Calculate the roll angle of the vehicle according to the measurement data of the accelerometer combined with the roll angle calculation relation, the roll angle calculation relation is: Among them, G py represents the component of the vehicle's acceleration along the y-axis in the navigation coordinate system, and G pz represents the component of the vehicle's acceleration along the z-axis in the navigation coordinate system; Calculate the pitch angle of the vehicle according to the measurement data of the accelerometer, the roll angle of the vehicle combined with the pitch angle calculation relation, the pitch angle calculation relation is: Among them, G px represents the component of the vehicle's acceleration along the x-axis in the navigation coordinate system; The calculating the yaw angle of the vehicle according to the roll angle and the pitch angle, combined with the magnetometer error model, includes: Based on the roll angle and pitch angle of the vehicle, combined with the relational expression calculate B fy and B fx ; where B fx , B fy and B fz respectively represent the x-axis, y-axis and z-axis components of the magnetometer in the magnetometer coordinate system after being offset by the hard iron effect at the planar position. Based on B fy and B fx Combined with the second yaw angle calculation relation, calculate the yaw angle of the vehicle; the second yaw angle calculation relation is:

8. A magnetometer calibration device, characterized in that, it includes: An establishment module for establishing a magnetometer error model based on the external interference situation of the magnetometer; A first calculation module for calculating the roll angle and pitch angle of the vehicle according to the measurement data of the accelerometer; A second calculation module for calculating the yaw angle of the vehicle according to the roll angle and the pitch angle, combined with the magnetometer error model; A calibration module for performing magnetometer calibration according to the roll angle, the pitch angle and the yaw angle.

9. An electronic device, characterized in that, it includes: A memory for storing a computer program; A processor for implementing the steps of the magnetometer calibration method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the magnetometer calibration method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Magnetic azimuth angle correction method and device of measurement-while-drilling system and computing equipment

    CN121382171A