Indoor calibration method and calibration system of magnetometer
The solenoid coil generates a differential magnetic field, calculates the error matrix and rotation matrix, and realizes the alignment of the three-axis magnetometer and accelerometer coordinate systems. This solves the problem of low magnetometer calibration accuracy in indoor environments and improves measurement accuracy.
Patent Information
- Application Number
- CN202411114539.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-14
AI Technical Summary
In the existing magnetometer calibration method, the geomagnetic field is disturbed due to the interference of ferromagnetic substances in the indoor environment, resulting in uneven magnetic field distribution and reducing the reliability and accuracy of the calibration.
The differential magnetic field generated by the solenoid coil is used as the calibration reference. The magnetic field intensity value is obtained by inputting zero current and fixed current. The error matrix and rotation matrix are calculated to realize the alignment of the three-axis magnetometer and accelerometer coordinate systems, and perform calibration based on the error parameters. .
It eliminates the influence of external magnetic fields, improves measurement accuracy, ensures effective calibration under uneven magnetic field disturbances, and ensures the accuracy of magnetometer measurement results in indoor environments.
Smart Images

Figure CN118640938B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of measuring instrument calibration, and in particular to an indoor calibration method and a calibration system for a magnetometer. Background Art
[0002] With the widespread use of smart devices in daily life and industrial applications, three-axis magnetometers play an important role as key auxiliary sensors in the fields of compasses, smartphones, navigation and attitude detection. When combined with accelerometers, it can provide accurate direction and attitude information. However, the traditional magnetometer calibration method relies on the geomagnetic field as a reference, but the presence of ferromagnetic materials in indoor environments will interfere with the geomagnetic field, making the calibration results inaccurate. This calibration method that relies on the geomagnetic field often fails to achieve the desired effect in indoor environments. In addition, the calibration method based on the geomagnetic field cannot ensure that the coordinate system of the magnetometer after calibration is aligned with the coordinate system of the accelerometer, thereby introducing alignment errors. Therefore, a magnetometer calibration method suitable for indoor environments is needed.
[0003] Defects and deficiencies of the prior art: At present, the calibration references of the three-axis magnetometer before use mainly include two reference standards: vector magnetic field and scalar magnetic field. Various calibration methods have been proposed based on different reference standards. For the vector magnetic field reference, the calibration method is to use a system containing two coils, a small three-axis coil system is located inside a large three-axis coil system, the small coil system is used to compensate for the external magnetic field, and the large coil system is used to generate a known three-axis magnetic field. Ales et al. improved the method by adding a proton magnetometer inside the larger coil to reduce the external magnetic field zeroing system. The advantages of this method are high accuracy and high efficiency. However, these improved methods require expensive three-axis coil systems, which limits their application in commercial-grade magnetometer calibration. For the scalar magnetic field reference, the most commonly used is the geomagnetic field, which can be regarded as a time-invariant uniform magnetic field. The output norm of the magnetometer when rotating in the geomagnetic field should be constant, so the error parameter can be estimated by calibrating the magnetometer output to a constant. Based on these criteria, many estimators have been proposed, including linear least squares (LS) estimator, recursive least squares (RLS) estimator, unscented Kalman filter (UFK) estimator, extended Kalman filter (EKF) estimator, genetic algorithm (GA) estimator, and differential evolution (DE) estimator. The advantage of the above methods is that they do not require any external equipment to generate the magnetic field reference, which is more convenient than the methods based on vector magnetic field reference. However, it is computationally inefficient and will cause alignment errors with the coordinate axis direction of the accelerometer because the scalar magnetic field reference has no fixed actual physical coordinate system. To address this issue, several proposed methods further align the magnetometer coordinate system with the accelerometer coordinate system after the magnetometer itself is calibrated. The most advanced calibration method is to use the geomagnetic inclination. During static period, the accelerometer measures gravity, while the magnetometer measures the geomagnetic field. The angle between the accelerometer and magnetometer outputs should be equal to the geomagnetic inclination.
[0004] However, most of the existing methods are suitable for outdoor environments. When applied to indoor environments, the geomagnetic field is often disturbed due to the presence of ferromagnetic interference from indoor steel building materials and furniture, resulting in uneven magnetic field distribution, which greatly reduces the reliability and accuracy of these calibration methods.
[0005] Therefore, it is necessary to provide an indoor calibration method and calibration system for a magnetometer to solve the above problems. Summary of the invention
[0006] The present invention provides an indoor calibration method and a calibration system for a magnetometer, so as to solve the problem that most existing methods are suitable for outdoor environments. When applied to indoor environments, the geomagnetic field is often disturbed due to the presence of ferromagnetic interference from indoor steel building materials and furniture, resulting in uneven magnetic field distribution, which greatly reduces the reliability and accuracy of these calibration methods.
[0007] The indoor calibration method of a magnetometer of the present invention adopts the following technical solution, including:
[0008] placing an inertial detection unit including a three-axis magnetometer and a three-axis accelerometer along the central axis of the solenoid coil;
[0009] The magnetic field strength measurement values of the three-axis magnetometer are obtained multiple times when two preset currents are passed through the same position in the room, one of the preset currents is 0, and the magnetic field strength measurement values corresponding to each current are differentiated to obtain differential magnetic field strength values, and an error matrix is obtained according to the differential magnetic field strength values and the magnetic field strength values of the solenoid coil at the position in the room, and a first error parameter of the three-axis magnetometer is obtained according to a diagonal matrix formed by eigenvalues of the error matrix;
[0010] According to the differential magnetic field strength value of the three-axis magnetometer and the acceleration value output by the accelerometer at the same position indoors, a rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system is obtained, and according to the rotation matrix, the coordinate system of the three-axis magnetometer after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned is obtained, and the coordinate system is used as the first coordinate system;
[0011] Respectively obtain the magnetic field strength value of each axis of the first coordinate system when the inertia detection unit is placed upward and downward; according to the magnetic field strength value of each axis of the first coordinate system when the inertia detection unit is placed upward and downward, obtain the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward and downward;
[0012] Obtaining a second error parameter according to a conversion matrix corresponding to when the inertial detection unit is placed upward and downward and a magnetic field intensity value corresponding to each axial direction;
[0013] The three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
[0014] Preferably, the expression of the magnetic field strength value of the three-axis magnetometer when two preset currents are passed at the same position in the room is:
[0015]
[0016] In the formula, Indicates the magnetic field strength value of the three-axis magnetometer when the preset current is 0;
[0017] Indicates the magnetic field strength value of the three-axis magnetometer when the preset current is non-zero;
[0018] represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter;
[0019] represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter;
[0020] Represents the external magnetic field, including the Earth's magnetic field and the fixed magnetic field generated by ferromagnetic objects in the surrounding environment;
[0021] Indicates the magnetic field strength value generated by the coil when a preset current other than 0 is passed through;
[0022] It indicates the measurement noise when the preset current is 0.
[0023] It represents the measurement noise when the preset current is not zero.
[0024] Preferably, the step of obtaining the error matrix according to the differential magnetic field strength value and the magnetic field strength value of the solenoid coil at the position in the room is:
[0025]
[0026] In the formula, represents the error matrix;
[0027] Indicates the magnetic field strength value generated by the coil when a preset current other than 0 is passed through;
[0028] represents the transpose of the differential magnetic field intensity value;
[0029] represents the Kroc inner product;
[0030] represents a vectorized operator;
[0031] Indicates taking the minimum value;
[0032] Express the constraint that the transpose of the error matrix is equal to the error matrix.
[0033] Preferably, the expression of the first error parameter of the three-axis magnetometer is:
[0034]
[0035]
[0036] In the formula, represents the first error parameter;
[0037] represents the error matrix;
[0038] represents the diagonal matrix consisting of the eigenvalues of the error matrix;
[0039] represents an orthogonal matrix.
[0040] Preferably, the expression of the rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system is:
[0041]
[0042]
[0043] In the formula, Represents the rotation matrix from the magnetometer coordinate system to the accelerometer coordinate system;
[0044] represents the transpose of the differential magnetic field intensity value;
[0045] Represents the transpose of the acceleration value output by the accelerometer;
[0046] represents the Kroc inner product;
[0047] represents a vectorized operator;
[0048] represents the proportionality coefficient;
[0049] represents one of the non-zero solutions;
[0050] Represents the 3x3 identity matrix.
[0051] Preferably, the expression of the magnetic field intensity value in each axial direction of the first coordinate system when the inertial detection unit is placed upward and downward is:
[0052]
[0053] In the formula, Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed upward;
[0054] Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed downward;
[0055] represents the external magnetic field in the j-th axial direction of the first coordinate system;
[0056] represents the external magnetic field along the j-th axis in the global coordinate system;
[0057] represents the second error parameter along the j-th axis of the first coordinate system.
[0058] Preferably, when the inertial detection unit is placed upward and downward, the expression of the transformation matrix corresponding to the global coordinate system to the first coordinate system is:
[0059]
[0060]
[0061] In the formula, represents a conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward, wherein the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed downward is the same as the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward;
[0062] Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0063] Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0064] Indicates the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0065] represents the local gravitational acceleration;
[0066] Indicates the pitch angle;
[0067] represents the roll angle;
[0068] Indicates the yaw angle.
[0069] Preferably, the expression of the second error parameter is:
[0070]
[0071] In the formula, represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter;
[0072] Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward;
[0073] Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward;
[0074] Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward;
[0075] Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward;
[0076] Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward;
[0077] Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward;
[0078] Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0079] Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0080] Indicates the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward;
[0081] Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed downward;
[0082] Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed downward;
[0083] Indicates the magnetic field strength value along the z-axis of the first coordinate system when the inertial detection unit is placed downward.
[0084] Preferably, the expression of the calibrated three-axis magnetometer is:
[0085]
[0086] In the formula, Represents the actual value of the magnetic field strength measured by the calibrated three-axis magnetometer;
[0087] Represents the magnetic field strength measurement value of the three-axis magnetometer;
[0088] represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter;
[0089] represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter;
[0090] represents the measurement noise.
[0091] An indoor calibration system for a magnetometer, comprising:
[0092] A first error parameter acquisition module is used to place an inertial detection unit including a three-axis magnetometer and a three-axis accelerometer along the central axis of the solenoid coil; obtain the magnetic field strength measurement values of the three-axis magnetometer when two preset currents are passed through the same position in the room for multiple times, wherein one preset current is 0, and perform differential magnetic field strength measurement on the magnetic field strength measurement values corresponding to each current obtained each time to obtain differential magnetic field strength values, obtain an error matrix according to the differential magnetic field strength values and the magnetic field strength values of the solenoid coil at the position in the room, and obtain the first error parameter of the three-axis magnetometer according to a diagonal matrix formed by eigenvalues of the error matrix;
[0093] A coordinate system alignment module is used to obtain a rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system according to the differential magnetic field strength value of the three-axis magnetometer and the acceleration value output by the accelerometer at the same position indoors, and obtain the coordinate system of the three-axis magnetometer after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned according to the rotation matrix, and use it as the first coordinate system;
[0094] The conversion matrix acquisition module is used to respectively obtain the magnetic field strength value of each axis of the first coordinate system when the inertia detection unit is placed upward and downward; according to the magnetic field strength value of each axis of the first coordinate system when the inertia detection unit is placed upward and downward, obtain the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward and downward;
[0095] The calibration module is used to obtain a second error parameter according to a conversion matrix corresponding to when the inertial detection unit is placed upward and downward and a magnetic field intensity value corresponding to each axial direction; and calibrate the three-axis magnetometer based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
[0096] The beneficial effects of the present invention are:
[0097] The differential magnetic field generated by the coil of the solenoid is used instead of the geomagnetic field as a calibration reference. By inputting zero current and fixed current into the solenoid coil, the magnetic field intensity value corresponding to the three-axis magnetometer is obtained, and the two magnetic field intensity values are differentially calculated to determine the first error parameter to eliminate the influence of the external magnetic field. Then, based on the principle that the magnetic field in the gravity direction collected by the three-axis accelerometer and the magnetic field in the coil magnetic field direction collected by the three-axis magnetometer are perpendicular, a rotation matrix from the three-axis magnetometer to the three-axis accelerometer is constructed, and the calibrated first coordinate system is obtained based on the rotation matrix, that is, the misalignment between the three-axis magnetometer and the three-axis accelerometer is calibrated using the magnetic field direction of the solenoid coil. The alignment of the two sensor coordinate systems is achieved, and the measurement accuracy of the overall system is improved. Finally, the accurate second error parameter can be obtained based on the first coordinate system. The three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain the calibrated three-axis magnetometer, thereby ensuring that the measurement value of the calibrated three-axis magnetometer is closer to the actual value of the magnetic field intensity, achieving effective calibration of the magnetometer under the conditions of non-uniform magnetic field disturbance and geomagnetic inclination disturbance, and ensuring the accuracy of the measurement results of the three-axis magnetometer in indoor environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0099] Figure 1 A schematic diagram of a flow chart of an indoor calibration method of a magnetometer according to the present invention;
[0100] Figure 2 A diagram of the solenoid coil configuration used in the present invention;
[0101] Figure 3 This is a schematic diagram comparing the differential magnetic field strength of the coil before and after calibration of the present invention;
[0102] Figure 4 This is a measurement schematic diagram of placing the inertial detection unit horizontally upwards according to the present invention;
[0103] Figure 5 This is a measurement schematic diagram of placing the inertial detection unit horizontally downward according to the present invention;
[0104] Figure 6 Schematic diagram of the distribution of magnetic field strength measurement values before and after calibration of the present invention. DETAILED DESCRIPTION
[0105] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0106] An embodiment of an indoor calibration method of a magnetometer of the present invention, in this embodiment, firstly defines a measurement model of a three-axis magnetometer, that is, the magnetic field strength value measured by the three-axis magnetometer after being subjected to various interferences It can be expressed as:
[0107] (1)
[0108] in, is the gain error parameter, is the non-orthogonality error parameter, is the soft iron effect error parameter, is the zero offset error parameter, is the hard iron effect error parameter, is the measurement error parameter, is the real magnetic field strength value, which is also the magnetic field strength value to be obtained after calibration of the three magnetometers in this embodiment; , , Multiply to get the first error parameter ,Will and Add and get the second error parameter , then the measurement model of the magnetometer can be simplified as: , since the measurement noise is very small, it can be directly ignored The value of the part.
[0109] Therefore, according to the above analysis, this embodiment only needs to consider the first error parameter and the second error parameter Specifically, this embodiment uses a differential measurement method to calculate the first error parameter Solve the problem and use the accelerometer's measurement data to calculate the magnetometer's tilt angle to help the three-axis magnetometer calibrate the tilt error, that is, solve the second error parameter .
[0110] like Figure 1 As shown, the calibration steps of this embodiment specifically include:
[0111] S1. Obtain the first error parameter of the three-axis magnetometer:
[0112] Specifically, an inertial detection unit including a three-axis magnetometer and a three-axis accelerometer is placed along the central axis of the solenoid coil, and the magnetic field strength measurement values of the three-axis magnetometer are obtained multiple times when two preset currents are passed through the same position in the room, one of the preset currents is 0, and the magnetic field strength measurement values corresponding to each current are differentiated each time to obtain a differential magnetic field strength value, and an error matrix is obtained according to the differential magnetic field strength value and the magnetic field strength value of the solenoid coil at the position in the room, and the first error parameter of the three-axis magnetometer is obtained according to a diagonal matrix formed by the eigenvalues of the error matrix.
[0113] Step 11: Place the inertial detection unit including the three-axis magnetometer and the three-axis accelerometer along the central axis of the solenoid coil:
[0114] When the magnetic field generated by the solenoid coil is used to replace the geomagnetic field reference, the uniformity of the magnetic field generated by the solenoid coil is not as good as that of the geomagnetic field. Therefore, it should be analyzed before use. Figure 2 As shown, the solenoid coil consists of The individual coils are combined together. represents the center of the solenoid coil, represents the magnetic field in the horizontal direction, Represents the magnetic field strength value in the vertical direction. Specifically, the magnetic field generated by the solenoid coil is defined as follows (2):
[0115] (2)
[0116] In the formula, Represents the solenoid The coil in The magnetic field strength value generated at Indicates the solenoid The coils are in position Generated The magnetic field strength value in the direction; Indicates the solenoid The coils are in position Generated The magnetic field strength value in the direction; Represents the solenoid The coil in Generated The magnetic field strength value in the direction; Represents the solenoid The coil in Generated The magnetic field strength value in the direction; is the number of turns of the solenoid; when the solenoid coil has sufficient length and number of turns, it is easy to obtain a central area with a nearly uniform magnetic field, which can be used as a reference magnetic field for the three-axis calibration magnetometer.
[0117] Therefore, in this embodiment, the three-axis magnetometer and the three-axis accelerometer are placed along the central axis of the solenoid coil, that is, the central area of the solenoid is used as the reference magnetic field for calibrating the magnetometer.
[0118] Step 12: Obtain the magnetic field strength measurement value of the three-axis magnetometer when two preset currents are passed through the same position in the room:
[0119] The true magnetic field strength value at a certain point Split into and During the experiment, a three-axis magnetometer and a three-axis accelerometer were placed in the center of the solenoid coil. Indicates the current applied to the coil When the magnetic field value generated by the solenoid coil is Represents the external magnetic field, which includes the Earth's magnetic field and the fixed magnetic field generated by ferromagnetic objects in the surrounding environment; is the measurement noise, then the measurement model of the three-axis magnetometer is To overcome the influence of the external magnetic field, two different currents are provided to the solenoid coil each time a measurement is made, namely, a current value of 0 and a current value of non-zero. ; When the current value of the solenoid coil is 0, the solenoid coil does not generate a magnetic field, and the value measured by the magnetometer does not include ; When current is passed through the solenoid coil When the coil generates a magnetic field value of Therefore, the expression of the magnetic field strength measurement value of the three-axis magnetometer when two preset currents are passed at the same position in the room is:
[0120] (3)
[0121] In the formula, Indicates the magnetic field strength value of the three-axis magnetometer when the preset current is 0; Indicates that the preset current is The magnetic field strength value of the three-axis magnetometer at time (non-zero time); represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter; represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; Represents the external magnetic field, including the Earth's magnetic field and the fixed magnetic field generated by ferromagnetic objects in the surrounding environment; Indicates that the preset current is The magnetic field strength value generated by the coil when It indicates the measurement noise when the preset current is 0. Indicates that the preset current is The measurement noise at the time
[0122] It should be noted that in order to obtain sufficient data for the error matrix To solve the problem, the inertial measurement unit is randomly changed in direction and the measurement is repeated. During each measurement, the same current is applied and .
[0123] Step 13: Differentiate the magnetic field strength measurement value corresponding to each current each time to obtain a differential magnetic field strength value, and obtain the error matrix according to the differential magnetic field strength value and the magnetic field strength value of the solenoid coil at the position in the room:
[0124] Among them, the differential magnetic field strength value The expression is:
[0125] (4)
[0126] in, represents the first error parameter; Indicates that the preset current is The measurement noise when , at this point, the external magnetic field has been eliminated and the second error parameter ; is the difference between the two measurement noises, which can be ignored due to its small value. At this time, the measurement model can be expressed as:
[0127] (5)
[0128] Multiply both sides of equation (5) by , the formula is:
[0129] (6)
[0130] Multiplying both sides of equation (6) by its own transpose yields:
[0131] (7)
[0132] Transpose equation (7) to obtain:
[0133] (8)
[0134] make , substitute into the above formula (8), and then apply the Crocker inner product transformation formula and vectorized operator operations , then we get the following formula:
[0135] (9)
[0136] In the formula, represents the error matrix; represents the transpose of the differential magnetic field intensity value; represents the Kroc inner product; represents a vectorized operator; Indicates that the preset current is The coil generates a magnetic field value.
[0137] Move the right side of equation (9) to the left side and construct the minimization optimization formula, which is expressed as follows (10) when satisfying When the constraints are met, we can solve the error matrix :
[0138] (10)
[0139] In the formula, represents the error matrix; represents the transpose of the differential magnetic field intensity value; represents the Kroc inner product; represents a vectorized operator; Indicates that the preset current is The coil generates a magnetic field strength value when
[0140] make , represents the differential magnetic field intensity value obtained after multiple measurements; let , represents the magnetic field strength value generated by the coil obtained during multiple measurements, and then a linear formula (11) can be obtained to solve the error matrix The value of is:
[0141] (11)
[0142] Multiply both sides of equation (11) by , then:
[0143] (12)
[0144] Because the error matrix is a real symmetric matrix, it is further decomposed into:
[0145] (13)
[0146] (14)
[0147] in, represents the first error parameter; represents the error matrix; represents the diagonal matrix consisting of the eigenvalues of the error matrix; represents an orthogonal matrix; represents the transpose of the orthogonal matrix. Since the direction of the eigenvector can be chosen arbitrarily, it only needs to satisfy the orthogonality. Therefore, the error parameter matrix There are countless solutions. In order to make the solution unique, some constraints need to be added, for example, the first error parameter The matrix is symmetrical or upper triangular; the differential magnetic field strength values before and after calibration are shown in the attached figure. Figure 3 As shown, Figure 3 The asterisk in the middle indicates before calibration, the circle indicates after calibration, and the dotted line indicates the reference value from the solenoid coil. Figure 3 It can be seen that the calibrated differential magnetic field is getting closer and closer to the reference magnetic field generated by the coil. Any solution is acceptable.
[0148] At this point, the first error parameter can be obtained .
[0149] S2. Obtain the first coordinate system after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned:
[0150] Specifically, according to the differential magnetic field strength value of the three-axis magnetometer and the acceleration value output by the accelerometer at the same position indoors, the rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system is obtained, and the first coordinate system after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned is obtained according to the rotation matrix.
[0151] Step 21: Obtain the rotation matrix from the magnetometer coordinate system to the accelerometer coordinate system:
[0152] Since the outputs of the three-axis magnetometer and the three-axis accelerometer should be in the same frame, however, the three-axis magnetometer and the three-axis accelerometer have their own coordinate systems in the inertial detection unit, and the three-axis magnetometer coordinate system and the three-axis accelerometer coordinate system will not completely overlap, and there is a certain deviation, which results in the data measured by the three-axis magnetometer and the three-axis accelerometer being output in their respective coordinate systems, and the alignment between the three-axis magnetometer coordinate system and the three-axis accelerometer coordinate system needs to be completed before use; therefore, in this embodiment, the three-axis magnetometer coordinate system and the three-axis accelerometer coordinate system need to be aligned to the same frame, and since the three-axis accelerometer is not affected by the indoor environment, the calibration parameters are aligned with the frame of the three-axis accelerometer.
[0153] Based on this, is the magnetic field strength value of the three-axis magnetometer in the three-axis magnetometer coordinate system before alignment, For the magnetic field strength value of the three-axis magnetometer in the first coordinate system, establish a rotation matrix that converts the data in the magnetometer coordinate system to the accelerometer coordinate system , satisfying the relationship (15):
[0154] (15)
[0155] Under ideal conditions, the coil of the solenoid is placed horizontally, and the magnetic field generated in the center area of the coil can be considered to be perpendicular to the gravity measured by the triaxial accelerometer. The data measured by the triaxial accelerometer is consistent with the differential magnetic field strength value. Multiplying them equals 0, that is:
[0156] (16)
[0157] However, in reality, due to the error between the three-axis magnetometer coordinate system and the three-axis accelerometer coordinate system, ; So the rotation matrix Add formula (16) to perform error calibration (replace the formula The value of is infinitely close to 0), and we get , using the formula To reduce the error as much as possible, minimize the value of the formula and make it infinitely close to 0, where, is the output of the three-axis accelerometer in its own independent coordinate system. yes The transpose of is the rotation matrix from the three-axis magnetometer to the three-axis accelerometer; the Crocker inner product and vectorization operator operations are applied in the solution process to further transform it into a linear equation, and we get Obviously, the zero vector is A solution, but it is not the solution required in this embodiment; therefore, the singular value decomposition (SVD) method is used to avoid zero solutions, and the eigenvector corresponding to the minimum singular value is the solution required in this embodiment; assuming is an estimated solution, then is also a solution; is the proportionality coefficient, in order to estimate the parameter , this embodiment uses a constraint , thus achieving The solution of represents one of the non-zero solutions; Represents the 3x3 identity matrix.
[0158] It should be noted that the calibrated three-axis magnetometer coordinate system is aligned with the three-axis accelerometer coordinate system to obtain the aligned three-axis magnetometer coordinate system, and the aligned three-axis magnetometer coordinate system is used as the first coordinate system.
[0159] S3. Obtain the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward:
[0160] Specifically, the magnetic field strength value of each axis in the first coordinate system when the inertial detection unit is placed upward and downward is obtained respectively; according to the magnetic field strength value of each axis in the first coordinate system when the inertial detection unit is placed upward and downward, the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward is obtained.
[0161] Step 31, the step of obtaining the magnetic field strength value in each axial direction of the first coordinate system when the inertial detection unit is placed upward and downward is:
[0162] The second error parameter b is solved when no current flows through the solenoid coil. At this time, the solenoid coil does not generate a magnetic field. , Only external magnetic field , the specific meaning of the global coordinate system in this embodiment is the earth's magnetic field coordinate system, Represents the first coordinate system, which specifically means the first coordinate system after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned. Represents the rotation matrix from the global coordinate system to the first coordinate system.
[0163] According to the measurement model of the three-axis magnetometer , due to the measurement noise value is very small and can be ignored. The first error parameter is solved. Now it is known that multiply both sides of the measurement model formula by ,get:
[0164] (17)
[0165] use Substituting the left side of the equation, the measurement model can be expressed as: ; In order to distinguish the measurement data output in the first coordinate system from the measurement data output in the global earth coordinate system, use It represents the external magnetic field measured by the three-axis magnetometer in the first coordinate system. represents the external magnetic field of the three-axis magnetometer in the global earth coordinate system; Figure 4As shown, the inertial detection unit including the three-axis magnetometer and the three-axis accelerometer is placed horizontally upward, as shown in FIG. Figure 5 As shown, the inertial detection unit including the magnetometer and the accelerometer is placed horizontally downward; Figure 4 and Figure 5 As shown in , it is an ideal state that the inertial detection unit is placed completely horizontally, and there is no tilt angle with the ground. At this time, the first coordinate system completely coincides with the global coordinate system, that is, When the inertial detection unit is placed upward and downward, the magnetic field strength value output by the three-axis magnetometer in the j-th axis of the inertial detection unit can be expressed as:
[0166] (18)
[0167] in, is the magnetometer output, Indicates the direction of the output shaft, represents the inertial detection unit placed upward or downward; specifically, in formula (18), Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the j-th axis of the first coordinate system when the inertial detection unit is placed downward; represents the external magnetic field in the j-th axial direction of the first coordinate system; represents the external magnetic field along the j-th axis in the global coordinate system; represents the second error parameter along the j-th axis of the first coordinate system; adding the two equations in equation (18) can eliminate the influence of the external magnetic field, thereby estimating the second error parameter at the j-th axis. axial components, among which the The second error parameter in the axial direction Based on this, we can use ,get Second error parameter in the axis direction , Second error parameter in the axis direction as well as Second error parameter in the axis direction .
[0168] Step 32, the step of obtaining the magnetic field strength value in each axial direction of the first coordinate system when the inertial detection unit is placed upward and downward is:
[0169] Since manual placement of the inertial detection unit may cause tilt errors in the three-axis magnetometer, the transformation matrix from the global coordinate system to the first coordinate system is used. To calibrate this error, the rotation matrix is solved by the data measured by the three-axis accelerometer , that is, in general, when the inertial detection unit is placed upward and downward, the three-axis magnetometer is in the first coordinate system. The expression of the magnetic field strength value in each axis is:
[0170] (19)
[0171] In the formula, Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the j-th axis of the first coordinate system when the inertial detection unit is placed downward; represents the j-th axial transformation matrix from the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; represents the j-th axial transformation matrix from the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; represents the external magnetic field along the j-th axis in the global coordinate system; represents the second error parameter along the j-th axis of the first coordinate system.
[0172] The rotation matrix can be calculated from the output data of the three-axis accelerometer. For example, when the inertial detection unit is placed upright and stationary, the acceleration in the x-axis and y-axis directions in the global coordinate system is 0, and the acceleration in the z-axis direction is -g. is the acceleration value output in the first coordinate system when the inertial detection unit is placed upward, so, Equal to the rotation matrix Multiply it by the value of acceleration in the global coordinate system, that is , is the local gravitational acceleration .
[0173] The transformation matrix can be used in flight dynamics (pitch angle), (roll angle), (Yaw angle) represents the transformation matrix obtained by rotating the three axes x, y, and z of the global coordinate system in sequence. The transformation matrix can be expressed as:
[0174] (20)
[0175] In the formula, represents a conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward, wherein the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward is the same as the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed downward; represents the local gravitational acceleration; Indicates the pitch angle; represents the roll angle; Indicates the yaw angle.
[0176] Among them, the pitch angle and roll angle for:
[0177] (twenty one)
[0178] In the formula, Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward; Represents the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward; rotation matrix It can be expressed as a matrix consisting of column vectors in three different axis directions of the global coordinate system, that is, ; Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; by matching the two representations of the rotation matrix, the column vector in the z-axis direction can be obtained .
[0179] S4. Obtain the second error parameter:
[0180] Specifically, the second error parameter is obtained according to the conversion matrix corresponding to when the inertial detection unit is placed upward and downward and the magnetic field intensity value corresponding to each axial direction.
[0181] Will represents the transformation matrix from the global coordinate system to the first coordinate system in the z-axis direction, is the transformation matrix from the first coordinate system to the global coordinate system in the z-axis direction; the transformation relationship between the two matrices is ; The formula Multiply each element by ,get , and then the transformation relationship between the two matrices Substitution get ; At this time, the relationship between the magnetometer output corrected by the rotation matrix and the second error parameter can be expressed as: , when the inertial detection unit moves along When the axis is placed downward, the following formula can be obtained:
[0182] (twenty two)
[0183] Adding the two equations for the IMU placed in the same axis upward and downward eliminates the external magnetic field and estimates the offset error:
[0184] (twenty three)
[0185] A second error parameter representing the x-axis direction of the first coordinate system; A second error parameter representing the y-axis direction of the first coordinate system; represents the second error parameter along the z-axis direction of the first coordinate system; combining the equations of the three directions in equation (23), the second error parameter can be estimated as ,in, and It is expressed as follows:
[0186] (twenty four)
[0187] (25)
[0188] That is:
[0189] (26)
[0190] In the formula, represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value along the z-axis of the first coordinate system when the inertial detection unit is placed downward.
[0191] At this point, the second error parameter is completed. Calculation.
[0192] S5. Get the calibrated three-axis magnetometer:
[0193] Specifically, the three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
[0194] Among them, the expression of the calibrated three-axis magnetometer is:
[0195] (27)
[0196] In the formula, Represents the actual value of the magnetic field strength measured by the calibrated three-axis magnetometer; Represents the magnetic field strength measurement value of the three-axis magnetometer; represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter; represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; represents the measurement noise.
[0197] An indoor calibration system for a magnetometer comprises: a first error parameter acquisition module, a coordinate system alignment module, a conversion matrix acquisition module and a calibration module; the first error parameter acquisition module is used to place an inertial detection unit including a three-axis magnetometer and a three-axis accelerometer along the central axis of a solenoid coil; the magnetic field strength measurement values of the three-axis magnetometer when two preset currents are passed through the same position indoors are obtained multiple times, one of the preset currents is 0, and the magnetic field strength measurement values corresponding to each current are differentiated to obtain differential magnetic field strength values, an error matrix is obtained according to the differential magnetic field strength values and the magnetic field strength values of the solenoid coil at the position indoors, and a first error parameter of the three-axis magnetometer is obtained according to a diagonal matrix formed by eigenvalues of the error matrix; the coordinate system alignment module is used to obtain the first error parameter of the three-axis magnetometer according to the differential magnetic field strength values of the three-axis magnetometer at the same position indoors and the accelerometer input The acceleration value obtained is used to obtain a rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system, and the coordinate system of the three-axis magnetometer and the three-axis accelerometer is obtained according to the rotation matrix, and the coordinate system is used as the first coordinate system; the conversion matrix acquisition module is used to respectively obtain the magnetic field intensity value of each axis of the first coordinate system when the inertial detection unit is placed upward and downward; according to the magnetic field intensity value of each axis of the first coordinate system when the inertial detection unit is placed upward and downward, the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward is obtained; the calibration module is used to obtain a second error parameter according to the corresponding conversion matrix when the inertial detection unit is placed upward and downward and the magnetic field intensity value corresponding to each axis; the three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
[0198] The present embodiment is described below in conjunction with experiments:
[0199] Experimental setup: The experiment was conducted indoors. The coil of the solenoid was an electromagnetic coil. The MPU9250 inertial detection unit was selected. The MPU9250 inertial detection unit includes a three-axis magnetometer and a three-axis accelerometer. The sampling frequency of the magnetometer and accelerometer is 100Hz. All data is collected by the main microcontroller and then transferred to the personal computer through a USB connection. Before the experiment, the accelerometer was calibrated according to the local gravity. It was selected as a DC current source. During the experiment, the current Set to An iron coin is placed near the three-axis magnetometer to act as interference from the carrier, including soft iron interference and hard iron interference. The number of turns of the single-layer electromagnetic coil is 300 and the wire diameter is 0.1 cm.
[0200] The experimental steps are as follows: (1) Turn on the system and preheat for 5 minutes; (2) Place the inertial detection unit at the center of the coil and keep it still for 10 seconds; (3) Output 0.4A DC power, wait for 10 seconds, and stop output; (4) Change the direction of the inertial detection unit and repeat steps (2)-(3) 20 times. The distribution diagram of the magnetic field strength measurement values before and after calibration is shown in the figure below. Figure 6 As shown, Figure 6 In the figure, the asterisks represent the measurement data before calibration, the circles represent the measurement data after calibration, and the lines represent the reference magnetic field generated by the solenoid coil. It can be seen that most of the measured magnetic field before calibration is inside the sphere, while most of the measured magnetic field after calibration is closely distributed on the sphere. Therefore, the measured magnetic field after calibration is closer to the reference magnetic field, making the measurement results of the calibrated three-axis magnetometer more accurate.
[0201] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for indoor calibration of a magnetometer, It is characterized in that include: An inertial detection unit including a three-axis magnetometer and a three-axis accelerometer is placed along the central axis of the solenoid coil; The magnetic field strength measurement values of the three-axis magnetometer are obtained multiple times when two preset currents are passed through the same position in the room, one of the preset currents is 0, and the magnetic field strength measurement values corresponding to each current are differentiated to obtain differential magnetic field strength values, and an error matrix is obtained according to the differential magnetic field strength values and the magnetic field strength values of the solenoid coil at the position in the room, and a first error parameter of the three-axis magnetometer is obtained according to a diagonal matrix formed by eigenvalues of the error matrix; According to the differential magnetic field strength value of the three-axis magnetometer and the acceleration value output by the accelerometer at the same position indoors, a rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system is obtained, and according to the rotation matrix, a coordinate system of the three-axis magnetometer after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned is obtained, and the coordinate system is used as the first coordinate system; Respectively obtain the magnetic field strength value of each axial direction of the first coordinate system when the inertial detection unit is placed upward and downward; According to the magnetic field strength value of each axis of the first coordinate system when the inertial detection unit is placed upward and downward, obtaining a conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward; Obtaining a second error parameter according to a conversion matrix corresponding to when the inertial detection unit is placed upward and downward and a magnetic field intensity value corresponding to each axial direction; The three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
2. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the magnetic field strength value of the three-axis magnetometer when two preset currents are passed through the same position in the room is: In the formula, Indicates the magnetic field strength value of the three-axis magnetometer when the preset current is 0; Indicates the magnetic field strength value of the three-axis magnetometer when the preset current is non-zero; represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter; represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; Represents the external magnetic field, including the Earth's magnetic field and the fixed magnetic field generated by ferromagnetic objects in the surrounding environment; Indicates the magnetic field strength value generated by the coil when a preset current other than 0 is passed through; It indicates the measurement noise when the preset current is 0. It represents the measurement noise when the preset current is not zero.
3. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The steps of obtaining the error matrix according to the differential magnetic field strength value and the magnetic field strength value of the solenoid coil at the position in the room are: In the formula, represents the error matrix; Indicates the magnetic field strength value generated by the coil when a preset current other than 0 is passed through; represents the transpose of the differential magnetic field intensity value; represents the Kroc inner product; represents a vectorized operator; Indicates taking the minimum value; Express the constraint that the transpose of the error matrix is equal to the error matrix.
4. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the first error parameter of the three-axis magnetometer is: In the formula, represents the first error parameter; represents the error matrix; represents the diagonal matrix consisting of the eigenvalues of the error matrix; represents an orthogonal matrix.
5. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the rotation matrix from the magnetometer coordinate system to the accelerometer coordinate system is: In the formula, Represents the rotation matrix from the magnetometer coordinate system to the accelerometer coordinate system; represents the transpose of the differential magnetic field intensity value; Represents the transpose of the acceleration value output by the accelerometer; represents the Kroc inner product; represents a vectorized operator; represents the proportionality coefficient; represents one of the non-zero solutions; Represents the 3x3 identity matrix.
6. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the magnetic field strength value in each axis of the first coordinate system when the inertial detection unit is placed upward and downward is: In the formula, Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the j-th axial direction of the first coordinate system when the inertial detection unit is placed downward; represents the external magnetic field in the j-th axial direction of the first coordinate system; represents the external magnetic field along the j-th axis in the global coordinate system; represents the second error parameter along the j-th axis of the first coordinate system.
7. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the transformation matrix from the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward is: In the formula, represents a conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward, wherein the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed downward is the same as the conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertia detection unit is placed upward; Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward; represents the local gravitational acceleration; Indicates the pitch angle; represents the roll angle; Indicates the yaw angle.
8. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the second error parameter is: In the formula, represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward; Represents the column vector in the x-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Represents the column vector in the y-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Represents the column vector in the z-axis direction of the transformation matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the z-axis direction of the first coordinate system when the inertial detection unit is placed upward; Indicates the magnetic field strength value in the x-axis direction of the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value in the y-axis direction of the first coordinate system when the inertial detection unit is placed downward; Indicates the magnetic field strength value along the z-axis of the first coordinate system when the inertial detection unit is placed downward.
9. The indoor calibration method of a magnetometer according to claim 1, It is characterized in that The expression of the calibrated three-axis magnetometer is: In the formula, Represents the actual value of the magnetic field strength measured by the calibrated three-axis magnetometer; Represents the magnetic field strength measurement value of the three-axis magnetometer; represents a first error parameter, which is the product of a gain error parameter, a non-orthogonality error parameter, and a soft iron effect error parameter; represents a second error parameter, which is the sum of a zero point offset error parameter and a hard iron effect error parameter; represents the measurement noise.
10. An indoor calibration system for a magnetometer, It is characterized in that include: A first error parameter acquisition module is used to place an inertial detection unit including a three-axis magnetometer and a three-axis accelerometer along the central axis of the solenoid coil; The magnetic field strength measurement values of the three-axis magnetometer are obtained multiple times when two preset currents are passed through the same position in the room, one of the preset currents is 0, and the magnetic field strength measurement values corresponding to each current are differentiated to obtain differential magnetic field strength values, and an error matrix is obtained according to the differential magnetic field strength values and the magnetic field strength values of the solenoid coil at the position in the room, and a first error parameter of the three-axis magnetometer is obtained according to a diagonal matrix formed by eigenvalues of the error matrix; A coordinate system alignment module is used to obtain a rotation matrix converted from the magnetometer coordinate system to the accelerometer coordinate system according to the differential magnetic field strength value of the three-axis magnetometer and the acceleration value output by the accelerometer at the same position indoors, and obtain the coordinate system of the three-axis magnetometer after the coordinate systems of the three-axis magnetometer and the three-axis accelerometer are aligned according to the rotation matrix, and use the coordinate system as the first coordinate system; A conversion matrix acquisition module, used to respectively acquire the magnetic field intensity value of each axial direction of the first coordinate system when the inertial detection unit is placed upward and downward; According to the magnetic field strength value of each axis of the first coordinate system when the inertial detection unit is placed upward and downward, obtaining a conversion matrix corresponding to the global coordinate system to the first coordinate system when the inertial detection unit is placed upward and downward; A calibration module, used to obtain a second error parameter according to a conversion matrix corresponding to when the inertial detection unit is placed upward and downward and a magnetic field intensity value corresponding to each axial direction; The three-axis magnetometer is calibrated based on the second error parameter, the first error parameter, and the measurement noise to obtain a calibrated three-axis magnetometer.
