Magnetic compass calibration method

By establishing an ellipsoidal mathematical model and Euler angle rotation matrix transformation, the problems of sensor adaptability and on-site calibration in magnetic compass calibration were solved, achieving high-precision magnetic compass calibration, eliminating hard and soft magnetic interference, and achieving a maximum heading error of less than 2°.

CN121521081APending Publication Date: 2026-02-13SHAANXI AEROSPACE TIMES NAVIGATION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511548231.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing magnetic compass calibration technology does not take into account the compatibility between the sensor and the mounting carrier, making it difficult to achieve efficient on-site calibration on large projectiles and other equipment. Furthermore, traditional methods have large errors in hard magnetic interference environments and cannot accurately reflect the real geomagnetic field signal.

Method used

By collecting magnetic field data from the six faces of a magnetic compass pointing towards the Earth's center, an ellipsoidal mathematical model is established. The ellipsoidal parameters are fitted using the least squares method to eliminate hard and soft magnetic interference. Pitch and roll angles are calculated by combining accelerometer data, and Euler angle rotation matrix transformation and magnetic heading angle correction are performed to achieve calibration without external equipment.

Benefits of technology

It achieves high-precision magnetic compass calibration on projectiles and large projectiles, eliminates hard and soft magnetic interference, and has a maximum heading error of less than 2°, meeting the requirements for high-precision measurement and simplifying the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121521081A_ABST
    Figure CN121521081A_ABST
Patent Text Reader

Abstract

A calibration method for a magnetic compass comprises the steps of collecting data of the magnetic compass, establishing an ellipsoid model, calculating a pitch angle and a roll angle through ellipsoid fitting and a least square method, and finally obtaining a course angle relative to the geographical north according to the pitch angle and the roll angle. The adaptive and operation problems are solved, hard magnetic and soft magnetic interference can be eliminated, magnetic field intensity distortion is avoided, calibration parameters can be rapidly solved, the hardware burden is reduced, the maximum absolute error of the course in the horizontal state after final calibration is smaller than or equal to 2 degrees, and the high-precision measurement requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of magnetic compass, and particularly relates to a calibration method of a magnetic compass. BACKGROUND

[0002] There is a natural vector geomagnetic field on the earth, and a horizontal component of the natural vector geomagnetic field generally points to a geographic north direction. A magnetic compass measures a magnetic azimuth angle by using this characteristic, corrects a geographic north azimuth angle by a magnetic declination, and further provides core data support for body attitude information acquisition, navigation positioning and the like. Existing calibration technologies are mostly aimed at calibrating a magnetic compass or components thereof alone, without considering the adaptability of sensors and installation carriers. In addition, large missiles and rockets are large in size and inconvenient to operate, and traditional calibration needs to rely on special reference equipment, so that it is difficult to realize efficient calibration on site, which seriously limits the application effect of the magnetic compass in engineering practice.

[0003] The current magnetic compass calibration mostly adopts a least square method, which can realize basic error correction, but the algorithm has limitations. After calibration, the measurement value of the magnetic compass cannot be consistent with the local geomagnetic field intensity, so that the subsequent azimuth calculation lacks matching basis of the real geomagnetic field environment, which affects the attitude measurement accuracy. In an environment with strong magnetic interference, the magnetic compass calibrated by the algorithm will have a problem of magnetic field intensity calculation error, and cannot accurately reflect the real geomagnetic field signal characteristics. SUMMARY

[0004] To solve the defects that the existing technologies cannot accurately reflect the real geomagnetic field signal, do not consider the adaptability of sensors and installation carriers, and have difficulty in on-site calibration of large missiles and rockets, the present application provides a calibration method of a magnetic compass.

[0005] The technical solution of the present application is as follows: a calibration method of a magnetic compass, comprising the following steps:

[0006] S1: Collecting magnetic field data of east, west, south and north directions of each face when each of upper, lower, left, right, front and rear six faces of the magnetic compass points to the center of the earth, respectively, to obtain twenty-four groups of coordinate data;

[0007] S2: Based on the twenty-four groups of coordinate data collected in step S1, an ellipsoid mathematical model is established by an ellipsoid fitting method to obtain parameters such as the center position and the long and short axis ratio of the ellipsoid, and the standard equation of the ellipsoid surface is:

[0008]

[0009] There are six parameters to be fitted, and x0, y0 and z0 in formula (1) are the center coordinates of the ellipsoid, and A, B and C are the three semi-axis lengths of the ellipsoid;

[0010] The above formula (1) is converted into:

[0011] x2 + ay 2 + bz 2 + cx + dy + ez + f = 0 (2)

[0012] By solving the parameters a, b, c, d, e, f of the ellipsoid equation by using the least square method, the parameters x0, y0, z0 of the center coordinates of the ellipsoid in the standard equation and the parameters A, B, C of the semi-axis length are indirectly solved, so as to compensate the error of the geomagnetic compass;

[0013] Fitting calculation:

[0014]

[0015] Partial derivative of formula (3) is calculated and is 0:

[0016]

[0017] The calculation can obtain that the combinations of x, y, z and each term thereof represent the statistical mean value;

[0018] a(2y 4 )+b(2y 2 z 2 )+c(2xy 2 )+d(2y 3 )+e(2y 2 z)+f(2y 2 )+2x 2 y 2 =0

[0019] a(2y 2 z 2 )+b(2z 4 )+c(2xz 2 )+d(2yz 2 )+e(2z 3 )+f(2z 2 )+2x 2 z 2 =0

[0020] a(2xy 2 )+b(2xz 2 )+c(2x 2 )+d(2xy)+e(2xz)+f(2x)+2x 3 =0

[0021] a(2y 3 )+b(2yz 2 )+c(2xy)+d(2y 2 )+e(2yz)+f(2y)+2x 2 y=0

[0022] a(2y 2 z)+b(2z 3 )+c(2xz)+d(2yz)+e(2z 2 )+f(2z)+2(x 2 z)=0

[0023] a(2y 2 )+b(2z 2 )+c(2x)+d(2y)+e(2z)+f(2)+2x 2 =0

[0024] Solving the equation set by least square method can obtain a, b, c, d, e, f, and then x0, y0, z0, A, B, C can be obtained;

[0025]

[0026] S3: According to the ellipsoid center offset and the semi-axis length ratio obtained by fitting, the original data output by the magnetic compass is compensated;

[0027]

[0028] In formula (5), H are the magnetic field data output by the magnetic compass in three directions, respectively, H x , H y , and H z are the magnetic field data output by the magnetic compass after compensation of hard magnetic interference and soft magnetic interference;

[0029] S4: Obtain the three-axis acceleration data output by the accelerometer matched with the magnetic compass, and calculate the pitch angle θ and the roll angle γ of the device according to the distribution characteristics of the gravity component in the data, and the calculation formula is as follows:

[0030]

[0031] In formula (6), g is the gravity acceleration, A x , A y , and A z are the specific forces output by the three-direction acceleration sensors, respectively, the X-axis is along the length direction of the magnetic compass (the north is positive), the Y-axis is along the right direction of the magnetic compass, and the Z-axis is perpendicular to the downward direction of the magnetic compass;

[0032] S5: Use the pitch angle and the roll angle calculated by formula (6), and use the “north-east-ground 3-2-1” Euler angle rotation matrix transformation relationship to process the three-dimensional magnetic field data output by the magnetic compass, and convert it to the horizontal plane coordinate system to obtain the horizontal component of the magnetic field;

[0033] S6: In the horizontal coordinate system, the magnetic heading angle of the equipment is determined according to the horizontal component of the magnetic field, and corrected by the local magnetic declination ε. The heading angle relative to geographic north is obtained according to formula (7).

[0034]

[0035] Preferably, in step S6, when the sensor is not parallel to the horizontal plane, the sensor coordinate system can be transformed to the reference coordinate system through coordinate transformation:

[0036]

[0037] In formula (8) For reference coordinate system, These are the magnetic field data output from the magnetic compass in three directions, H. x H y H z These are the magnetic field data of the magnetic compasses in three directions after compensation for hard and soft magnetic interference.

[0038] The beneficial effects of this invention are as follows: This invention does not require external reference equipment and can be directly calibrated on-site for projectiles and large projectiles, solving the problems of adaptation and operation. It can eliminate hard magnetic and soft magnetic interference, avoid magnetic field strength distortion, and quickly solve calibration parameters, reducing hardware burden. After final calibration, the maximum absolute error of the horizontal heading is ≤2°, meeting the requirements of high-precision measurement. Attached Figure Description

[0039] Figure 1 This is a magnetic compass direction indicator diagram;

[0040] Figure 2 This is a diagram of the horizontal component of the magnetic field. Detailed Implementation

[0041] To better understand the concept of this invention, the technical solution of this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] The technical solution of this invention is as follows: A method for calibrating a magnetic compass, comprising the following steps:

[0043] S1: As Figure 1 As shown, magnetic field data in the four directions of east, west, south, and north were collected for each of the six faces of the magnetic compass (up, down, left, right, front, and back) when they pointed to the center of the earth, resulting in a total of twenty-four sets of coordinate data.

[0044] Six faces: "up" is the negative direction of the Z axis, the sensor is placed upward, "down" is the positive direction of the Z axis, the sensor is placed downward, "left" is the negative direction of the Y axis, the sensor is placed leftward, "right" is the positive direction of the Y axis, the sensor is placed rightward, "front" is the positive direction of the X axis, the sensor is placed forward, "back" is the negative direction of the X axis, the sensor is placed backward;

[0045] Four directions: each face needs to be aligned with the geographical directions of "east, west, south, north", when the "right face" is rightward, the sensor needs to be rotated to make the X axis point to east, west, south and north respectively, to ensure that each direction covers the geographical direction;

[0046] S2: In an ideal interference-free state, the distribution of the geomagnetic field in three-dimensional space is "spherical", but due to the influence of hard magnetic interference and soft magnetic interference of the projectile body, the actual magnetic field distribution will be distorted to "ellipsoidal", therefore, based on the 24 sets of coordinate data collected in step S1, an ellipsoid mathematical model is established by an ellipsoid fitting method, to obtain the center position, long-short axis ratio and other parameters of the ellipsoid, and the standard equation of the ellipsoid surface is:

[0047]

[0048] There are six parameters to be fitted, x0, y0, z0 in formula (1) are the center coordinates of the ellipsoid, and A, B, C are the three semi-axis lengths of the ellipsoid;

[0049] The above formula (1) is converted to:

[0050] x 2 +ay 2 +bz 2 +cx+dy+ez+f=0 (2)

[0051] By solving the parameters a, b, c, d, e, f of the ellipsoid equation by the least square method, the ellipsoid center coordinate parameters x0, y0, z0 and the semi-axis length parameters A, B, C in the standard equation are indirectly solved, to compensate for the errors of the geomagnetic compass;

[0052] Fitting calculation:

[0053]

[0054] Take the partial derivative of formula (3) and set it to 0:

[0055]

[0056] The calculation can obtain that x, y, z and their combinations of orders represent their statistical mean values;

[0057] a(2y 4 )+b(2y 2 z 2 )+c(2xy2 )+d(2y 3 )+e(2y 2 z)+f(2y 2 )+2x 2 y 2 =0

[0058] a(2y 2 z 2 )+b(2z 4 )+c(2xz 2 )+d(2yz 2 )+e(2z 3 )+f(2z 2 )+2x 2 z 2 =0

[0059] a(2xy 2 )+b(2xz 2 )+c(2x 2 )+d(2xy)+e(2xz)+f(2x)+2x 3 =0

[0060] a(2y 3 )+b(2yz 2 )+c(2xy)+d(2y 2 )+e(2yz)+f(2y)+2x 2 y=0

[0061] a(2y 2 z)+b(2z 3 )+c(2xz)+d(2yz)+e(2z 2 )+f(2z)+2(x 2 z)=0

[0062] a(2y 2 )+b(2z 2 )+c(2x)+d(2y)+e(2z)+f(2)+2x 2 =0

[0063] Solving the equation set by least square method can obtain a, b, c, d, e, f, and then x0, y0, z0, A, B, C can be obtained;

[0064]

[0065] S3: According to the ellipsoid center offset and the semi-axis length ratio obtained by fitting, the original data output by the magnetic compass is compensated;

[0066]

[0067] In formula (5), are the magnetic field data output by the three-direction magnetic compass respectively, and H x , H y , and H z are the magnetic field data of the three-direction magnetic compass after hard magnetic interference and soft magnetic interference compensation respectively;

[0068] The original data is subtracted by the ellipsoid center coordinates to eliminate the overall magnetic field offset, and the compensated data is divided by the semi-axis length of the corresponding axis to correct the distorted ellipsoidal surface magnetic field into a spherical magnetic field close to the ideal geomagnetic field;

[0069] S4: Obtain the three-axis acceleration data output by the accelerometer supporting the magnetic compass, and calculate the pitch angle θ and roll angle γ of the device according to the distribution characteristics of the gravity components in this data. The calculation formulas are as follows:

[0070]

[0071] In formula (6), g is the acceleration due to gravity, and A x , A y , and A z are the specific forces output by the three-direction acceleration sensors respectively. The X-axis is along the length direction of the magnetic compass (north is positive), the Y-axis is along the right side direction of the magnetic compass towards the positive direction of the magnetic compass, and the Z-axis is perpendicular to the ground towards the positive direction of the magnetic compass;

[0072] S5: Use the pitch angle and roll angle calculated by formula (6), and adopt the "north-east-earth 3-2-1" Euler angle rotation matrix transformation relationship to process the three-dimensional magnetic field data output by the magnetic compass, and convert it to the horizontal plane coordinate system to obtain the horizontal magnetic field component;

[0073] S6: In the horizontal plane coordinate system, determine the magnetic heading angle of the device according to the horizontal magnetic field component, and correct it in combination with the local magnetic declination ε. The heading angle relative to the true north is obtained according to formula (7) As Figure 2 shown;

[0074]

[0075] In step S6, when the sensor is not parallel to the horizontal plane, through coordinate transformation, the sensor coordinate system can be transformed into the reference coordinate system:

[0076]

[0077] In formula (8) is the reference coordinate system, are the magnetic field data output by the three-direction magnetic compass respectively, and H x , H y , and H zThe magnetic field data of the three-direction magnetic compass after hard magnetic interference and soft magnetic interference compensation.

[0078] In order to verify the above steps, the heading theoretical values are set as 4°, 274°, 184° and 94°, and the heading values at the front, right, rear and left positions on the horizontal plane of the magnetic compass are verified, which are recorded as w1_1, w2_2, w3_3 and w4_4 respectively.

[0079] The magnetic compass is placed in a Helmholtz cage to collect data in sections, that is, the magnetic field data of each of the east, west, south and north directions of each of the six surfaces of the magnetic compass, i.e., the upper, lower, left, right, front and rear surfaces, when pointing to the earth's center, are collected, and a total of twenty-four groups of coordinate data are obtained; the collected data are simulated, the collected sensor data are simulated, and specifically, data calculation and fitting are performed through Matlab software, a calibration process is simulated and simulated, the above operation is repeated, a total of three groups of independent 24 groups of calibrated data are collected to reduce accidental errors, and the 24 groups of data of the three groups after calibration are substituted into the ellipsoid fitting model respectively, and the calibration parameters corresponding to each group of data are solved through the least square method.

[0080] The absolute values of the simulated heading values and the theoretical values in each verification are calculated to obtain the heading error, and the simulation results are shown in Tables 1, 2 and 3.

[0081] Table 1: Calibration verification of the first group

[0082]

[0083] Table 2: Calibration verification of the second group

[0084]

[0085] Table 3: Calibration verification of the third group

[0086]

[0087] It can be known from the results in Tables 1, 2 and 3 that the errors between the actually measured heading values and the theoretical values are all within 2°, the entire calibration process does not need to rely on external direction reference equipment, the operation process is simple and convenient, and the flexibility is high, and the actual application requirements in engineering scenes such as projectile attitude measurement and navigation positioning can be fully met.

[0088] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application is included in the protection scope of the present application.

Claims

1. A method for calibrating a magnetic compass, characterized in that, It includes the following steps: S1: Collect the magnetic field data of the east, west, south, and north directions of each of the six faces (top, bottom, left, right, front, and back) of the magnetic compass when pointing to the earth's center, obtaining a total of 24 groups of coordinate data. S2: Based on the 24 groups of coordinate data collected in step S1, establish an ellipsoid mathematical model through the ellipsoid fitting method to obtain parameters such as the center position of the ellipsoid and the ratio of the major and minor axes. The standard equation of the ellipsoid surface is: There are six parameters to be fitted. In formula (1), x0, y0, and z0 are the center coordinates of the ellipsoid, and A, B, and C are the lengths of the three semi-axes of the ellipsoid. Convert the equation (1) above to: x 2 +month 2 +bz 2 +cx+dy+ez+f=0 (2) By using the least squares method to solve the parameters a, b, c, d, e, and f of the ellipsoid equation, indirectly obtain the ellipsoid center coordinate parameters x0, y0, z0 and the semi-axis length parameters A, B, C in the standard equation to compensate for the error of the magnetic compass. Fitting calculation: Take the partial derivatives of equation (3) and set them to 0: It can be calculated that the combinations of x, y, z and their various terms represent their statistical means. a(2y 4 )+b(2y 2 z 2 )+c(2xy 2 )+d(2y 3 )+e(2y 2 z)+f(2y 2 )+2x 2 y 2 =0 a(2y 2 z 2 )+b(2z 4 +c(2xz) 2 )+d(2yz 2 )+e(2z 3 )+f(2z 2 +2x 2 z 2 =0 a(2xy 2 )+b(2xz 2 )+c(2x 2 )+d(2xy)+e(2xz)+f(2x)+2x 3 =0 a(2y 3 )+b(2yz 2 )+c(2xy)+d(2y 2 )+e(2yz)+f(2y)+2x 2 y=0 a(2y 2 z)+b(2z 3 )+c(2xz)+d(2yz)+e(2z 2 )+f(2z)+2(x 2 z)=0 a(2y 2 )+b(2z 2 + c(2x) + d(2y) + e(2z) + f(2) + 2x 2 =0 Using the least squares method to solve the system of equations, we can obtain a, b, c, d, e, f, and further obtain x0, y0, z0, A, B, C. S3: According to the ellipsoid center offset and semi-axis length ratio obtained by fitting, compensate the original data output by the magnetic compass. In formula (5), These are the magnetic field data output from the magnetic compass in three directions, H. x H y H z These are the magnetic field data of the magnetic compasses in three directions after compensation for hard and soft magnetic interference; S4: Obtain the three-axis acceleration data output by the accelerometer supporting the magnetic compass. According to the distribution characteristics of the gravity components in this data, calculate the pitch angle θ and roll angle γ of the device. The calculation formulas are as follows: In formula (6), g is the acceleration due to gravity, and A x A y A z These are the specific forces output by the accelerometers in three directions: the X-axis along the length of the magnetic compass (north is positive), the Y-axis along the right side of the magnetic compass in the positive direction, and the Z-axis perpendicularly downwards in the positive direction of the magnetic compass. S5: Using the pitch angle and roll angle calculated by formula (6), adopt the "North-East-Earth 3-2-1" Euler angle rotation matrix transformation relationship to process the three-dimensional magnetic field data output by the magnetic compass, and convert it to the horizontal plane coordinate system to obtain the horizontal magnetic field component. S6: In the horizontal coordinate system, the magnetic heading angle of the equipment is determined according to the horizontal component of the magnetic field, and corrected by the local magnetic declination ε. The heading angle relative to geographic north is obtained according to formula (7).

2. The method for calibrating a magnetic compass according to claim 1, characterized in that: In step S6, when the sensor is not parallel to the horizontal plane, through coordinate transformation, the sensor coordinate system can be transformed into the reference coordinate system: In formula (8) For reference coordinate system, These are the magnetic field data output from the magnetic compass in three directions, H. x H y H z These are the magnetic field data of the magnetic compasses in three directions after compensation for hard and soft magnetic interference.