Magnetometer calibration method, control processing unit and unmanned aerial vehicle

By performing elliptical fitting calibration of the magnetometer in the drone, using the data and geomagnetic induction information under the target coordinate system to select the optimal calibration parameters, the heading error problem caused by magnetic field interference of the magnetometer is solved, and the stable flight of the drone is ensured.

CN120576801AActive Publication Date: 2025-09-02AUTEL ROBOTICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510855909.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-02
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

The magnetometer of the drone is easily disturbed by magnetic field, which causes the global horizontal speed control to diverge after the heading error exceeds a certain angle, causing the drone to lose control.

Method used

By obtaining N sets of data of the magnetometer under the target coordinate system, performing elliptical fit calibration, determining the scale, coupling scale and bias terms of the X-axis, Y-axis, and Z-axis, combining the geomagnetic induction intensity and magnetic inclination angle at the current position, selecting the optimal calibration parameters to calibrate the magnetometer online.

Benefits of technology

High-precision magnetometer calibration is achieved to ensure the accuracy of heading calculations and prevent the drone from getting out of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120576801A_ABST
    Figure CN120576801A_ABST
Patent Text Reader

Abstract

The invention discloses a magnetometer calibration method, a control processing unit and an unmanned aerial vehicle, and the magnetometer calibration method comprises the steps: obtaining N groups of first data of a magnetometer in a target coordinate system, where N is an integer greater than 0; according to the N groups of first data, first parameters for ellipse fitting calibration are determined, and the first parameters comprise the scale of an X axis, the scale of a Y axis, the scale of a Z axis, the coupling scale between the X axis and the Y axis, the coupling scale between the X axis and the Z axis, the coupling scale between the Y axis and the Z axis, an offset item of the X axis, an offset item of the Y axis and an offset item of the Z axis; obtaining a second parameter currently used for calibration and a third parameter obtained by off-line calibration; and calibrating the magnetometer according to one of the first parameter, the second parameter and the third parameter. By means of the mode, online calibration of the magnetometer can be achieved, and the precision is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of magnetometer technology, and in particular to a magnetometer calibration method, a control processing unit, and a drone. Background Art

[0002] For drones, yaw angles are typically determined using magnetometers, which are susceptible to magnetic field interference, potentially leading to heading errors. When the heading error exceeds a certain angle, global horizontal velocity control diverges, causing the drone to lose control. Summary of the Invention

[0003] The embodiments of the present application provide a magnetometer calibration method, a control processing unit, and a drone, which can realize online calibration of the magnetometer with high accuracy.

[0004] In a first aspect, an embodiment of the present application provides a magnetometer calibration method, comprising: obtaining N sets of first data of the magnetometer in a target coordinate system, wherein N is an integer greater than 0; determining first parameters for elliptical fitting calibration based on the N sets of first data, wherein the first parameters include the scale of the X-axis, the scale of the Y-axis, the scale of the Z-axis, the coupling scale between the X-axis and the Y-axis, the coupling scale between the X-axis and the Z-axis, the coupling scale between the Y-axis and the Z-axis, the offset item of the X-axis, the offset item of the Y-axis, and the offset item of the Z-axis; obtaining a second parameter currently used for calibration, and a third parameter obtained by offline calibration; and calibrating the magnetometer based on one of the first parameter, the second parameter, and the third parameter.

[0005] In one or more embodiments, obtaining N groups of first data of the magnetometer in the target coordinate system includes: obtaining a group of second data at intervals of 360 / N degrees, and obtaining N groups of the second data, wherein the second data is data of the magnetometer in the body coordinate system of the device used to set up the magnetometer; and converting the N groups of the second data into N groups of the first data according to the roll angle and the pitch angle.

[0006] In one or more embodiments, determining the first parameters for ellipse fitting calibration based on N groups of first data includes: setting the scale of the Z axis to 1, and setting the coupling scale between the X axis and the Z axis and the coupling scale between the Y axis and the Z axis to 0; determining the scale of the X axis, the scale of the Y axis, the coupling scale between the X axis and the Y axis, the bias item of the X axis, and the bias item of the Y axis based on the N groups of first data and the ellipse formula; and determining the bias item of the Z axis based on the geomagnetic induction intensity and magnetic inclination of the current position.

[0007] In one or more embodiments, determining the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, the offset term of the X-axis, and the offset term of the Y-axis based on the N sets of the first data and the ellipse formula includes: the ellipse formula is: ,in, are the ellipse parameters, is the horizontal component of the geomagnetic induction intensity at the current position in the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination angle of the current position; the ellipse parameters can be determined according to the least squares method based on the three-axis components of the N groups of the first data; according to the geometric representation of the ellipse formula, the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, the offset term of the X-axis, and the offset term of the Y-axis are determined.

[0008] In one or more embodiments, determining the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, and the offset term of the X-axis and the offset term of the Y-axis according to the geometric representation of the ellipse formula includes: the geometric representation of the ellipse formula is: , , where X=[xy], X represents a point on the ellipse, , for The eigenvalues ​​of , C represents the center of the circle; according to the geometric representation of the ellipse formula, the following parameters are determined: , , , b1=c x , b2=c y ,in, , A1 is the scale of the X axis, A2 is the scale of the Y axis, A 12 is the coupling scale between the X-axis and the Y-axis, b1 is the bias term of the X-axis, and b2 is the bias term of the Y-axis.

[0009] In one or more embodiments, determining the Z-axis offset item based on the geomagnetic induction intensity and magnetic inclination at the current location includes: the Z-axis offset item is: , , where b3 is the offset term of the Z axis, is the sum of the Z-axis components of N groups of the first data, is the component of the geomagnetic induction intensity at the current position in the vertical direction of the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination of the current location.

[0010] In one or more embodiments, the calibrating the magnetometer according to one of the first parameter, the second parameter and the third parameter includes: correcting N groups of the second data by the calibration parameter, wherein the calibration parameter is the first parameter, the second parameter or the third parameter; obtaining the root mean square error between the modulus of the corrected magnetic induction intensity and the modulus of the geomagnetic induction intensity at the current position, wherein the root mean square error includes a first root mean square error corresponding to the first parameter, a second root mean square error corresponding to the second parameter, and a third root mean square error corresponding to the third parameter; and determining the parameters for calibrating the magnetometer according to the first root mean square error, the second root mean square error, and the third root mean square error.

[0011] In one or more embodiments, determining the parameters for calibrating the magnetometer based on the first root mean square error, the second root mean square error, and the third root mean square error includes: when the third root mean square error is less than or equal to a preset threshold, determining that the parameter for calibrating the magnetometer is the third parameter; when the third root mean square error is greater than the preset threshold, determining that the parameter for calibrating the magnetometer is the minimum value among the first parameter, the second parameter, and the third parameter.

[0012] In a second aspect, an embodiment of the present application provides a control processing unit, comprising: at least one processor and a memory; the memory is coupled to the processor, and the memory is used to store instructions or programs, and when the instructions or programs are executed by the at least one processor, the at least one processor executes the magnetometer calibration method as described above.

[0013] In a third aspect, an embodiment of the present application provides a drone, comprising a magnetometer and the control processing unit as described above.

[0014] The beneficial effects of the present application are as follows: the magnetometer calibration method of the embodiment of the present application determines the first parameter for ellipse fitting calibration through N groups of first data of the magnetometer in the target coordinate system, and obtains the second parameter currently used for calibration and the third parameter obtained by offline calibration. Thereafter, the magnetometer is calibrated according to one of the first parameter, the second parameter and the third parameter, thereby facilitating the online calibration of the magnetometer by selecting the optimal parameter among the first parameter, the second parameter and the third parameter, thereby ensuring high calibration accuracy and ensuring high accuracy of the heading calculated by the magnetometer. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] One or more embodiments are exemplarily described by the figures in the accompanying drawings, which are not intended to limit the embodiments. Elements with the same reference numerals in the drawings represent similar elements.

[0016] Figure 1 Schematic diagram of the structure of the drone provided in the embodiment of the present application; Figure 2 is a schematic diagram of the control part of the drone provided in an embodiment of the present application; Figure 3 is a flow chart of the magnetometer calibration method provided in an embodiment of the present application; Figure 4 This embodiment of the present application provides Figure 3 A schematic diagram of an embodiment of step S310 is shown in FIG. Figure 5 This embodiment of the present application provides Figure 3 A schematic diagram of an embodiment of step S320 is shown in FIG. Figure 6 This embodiment of the present application provides Figure 5 A schematic diagram of an embodiment of step S520 is shown in FIG. Figure 7 This embodiment of the present application provides Figure 3 A schematic diagram of an embodiment of step S340 is shown in FIG. Figure 8 This embodiment of the present application provides Figure 7 FIG. 1 is a schematic diagram of an implementation of step S730 shown in FIG. DETAILED DESCRIPTION

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0018] It should be noted that, when an element is described as being “connected to” another element, it may be directly connected to the other element, or one or more intervening elements may exist therebetween.

[0019] In addition, the technical features involved in the various embodiments of the present application described below can be combined with each other as long as there is no structural conflict between them.

[0020] See also Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application, such as Figure 1 As shown, the application scenario includes a UAV 1. The UAV 1 is an unmanned aircraft with a mission payload and controlled by a remote control device or a self-contained program control device.

[0021] The drone 1 includes a body 11, arms 12 connected to the body 11, and a power unit 13 located on each arm 12. The power unit 13 is used to provide flight power to the drone 1. The power unit 13 includes a motor 131 (e.g., a brushless motor) and propellers 132 connected to the motor 131. The illustrated drone 1 is a quadrotor drone with four power units 13. In other possible embodiments, the drone 1 can also be a trirotor drone, a hexacopter drone, or the like.

[0022] Please refer to Figure 2 The drone 1 also includes a magnetometer 14 and a control processing unit 15 .

[0023] The control processing unit 15 may be a microcontroller unit (MCU) or a digital signal processing (DSP) controller.

[0024] The control processing unit 15 includes at least one processor 151 and a memory 152, wherein the memory 152 can be built into the control processing unit 15 or externally located outside the control processing unit 15. The memory 152 can also be a remotely set memory connected to the control processing unit 15 via a network.

[0025] The memory 152 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory 152 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal, etc. In addition, the memory 152 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 152 may optionally include a memory remotely located relative to the processor 151, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0026] The processor 151 performs various functions of the terminal and processes data by running or executing software programs and / or modules stored in the memory 152, and calling data stored in the memory 152, thereby monitoring the terminal as a whole, for example, implementing the magnetometer calibration method in any embodiment of the present application.

[0027] The processor 151 may be one or more, Figure 2In the figure, a processor 151 is used as an example. The processor 151 and the memory 152 may be connected via a bus or other means. The processor 151 may include a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a controller, a field-programmable gate array (FPGA) device, etc. The processor 151 may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0028] Magnetometer 14 is an instrument used to measure the strength and direction of magnetic fields. In drone 1, magnetometer (magnetic sensor) 141 is a key navigation and positioning sensor, primarily used to measure the strength and direction of the Earth's magnetic field, providing a heading reference for the drone. In a specific embodiment, for drone 1 (particularly small drones), magnetometer 14 is used to obtain the yaw angle.

[0029] However, in practical applications, magnetometers are susceptible to magnetic field interference, which can lead to heading errors. When the heading error exceeds a certain angle, the global horizontal velocity control will diverge, causing the drone to lose control.

[0030] Based on this, an embodiment of the present application provides a magnetometer calibration method, which can ensure high calibration accuracy by selecting the optimal parameter from three different calibration parameters to perform online calibration on the magnetometer.

[0031] Please refer to Figure 3 , Figure 3 This is a flow chart of the magnetometer calibration method provided in the embodiment of the present application. Figure 3 As shown, the magnetometer calibration method includes the following steps S310 to S340: Step S310: Acquire N sets of first data of the magnetometer in the target coordinate system.

[0032] Where N is an integer greater than 0. The target coordinate system is a coordinate system aligned with the horizontal plane. In other words, the target coordinate system is a coordinate system that eliminates the influence of the aircraft's attitude tilt, thereby reducing the influence of the aircraft's attitude on the magnetic field measurement and making the magnetometer data closer to the true direction of the Earth's magnetic field.

[0033] In some embodiments, as Figure 4 As shown, the specific implementation process of step S310 includes the following steps S410 to S420: Step S410: acquiring a set of second data at intervals of 360 / N degrees, and acquiring N sets of second data, wherein the second data is data of the magnetometer in the body coordinate system of the device used to set the magnetometer.

[0034] Specifically, the total rotation angle is set to 360° and evenly divided into N parts. Then, the angular interval of each rotation is 360° / N. At the same time, at each rotation position, the measurement value of the magnetometer in the body coordinate system is recorded. This measurement value is a set of second data. At N rotation positions, N measurement values ​​can be recorded, i.e., N sets of second data.

[0035] Step S420: Convert the N sets of second data into N sets of first data according to the roll angle and the pitch angle.

[0036] Specifically, each set of second data can be converted into a set of first data by the following formula: .

[0037] Among them, M B is a set of second data, M C is a set of first data, is the pitch angle, is the roll angle. Each of the N sets of second data is converted into first data using the above formula, resulting in N sets of first data. In the above formula, the matrix associated with the pitch angle represents the rotation angle around the Y-axis (lateral axis) of the aircraft coordinate system. Its function is to eliminate the aircraft's pitch (forward and backward tilt) and align the aircraft's X-axis and Z-axis in the horizontal plane. The matrix associated with the roll angle represents the rotation angle around the X-axis (longitudinal axis) of the aircraft coordinate system. Its function is to eliminate the aircraft's roll (left and right tilt) and align the aircraft's Y-axis and Z-axis in the horizontal plane. Therefore, the N sets of first data in the target coordinate system are magnetometer data after roll and pitch angle corrections. This also means that the N sets of first data are expressed in a coordinate system (i.e., the target coordinate system) after the aircraft's attitude tilt has been corrected.

[0038] Step S320: determining first parameters for ellipse fitting calibration according to the N groups of first data.

[0039] The first parameter includes the X-axis scale, Y-axis scale, Z-axis scale, coupling scale between the X and Y axes, coupling scale between the X and Z axes, coupling scale between the Y and Z axes, X-axis offset, Y-axis offset, and Z-axis offset. The scale of each axis (including the X, Y, and Z axes) represents the sensitivity scaling factor of each axis, indicating the proportional relationship between the sensor's measured value and the true value on each axis. The coupling scale represents the cross-sensitivity or rotational error between two axes, indicating the influence of the measured value of one axis on the other axes. The offset of each axis represents the zero offset of each axis, that is, the non-zero reading of each axis when the magnetometer is not input.

[0040] Ellipse fitting calibration is a method that parametrically fits the magnetometer output data by establishing an ellipse model, thereby eliminating systematic errors (such as offset, scale inconsistency, and cross-coupling) and making the measurement results closer to the true value. The core concept is to use optimization algorithms such as the least squares method to fit the magnetometer's non-ideal measurement data (errors caused by environmental interference, hardware defects, etc.) into an ellipse equation. By solving the ellipse's geometric parameters (such as the center coordinates), the calibration parameters are deduced, ultimately achieving correction of the magnetometer output.

[0041] In some embodiments, as Figure 5 As shown, the specific implementation process of step S320 includes the following steps S510 to S530: Step S510: setting the scale of the Z axis to 1, and setting the coupling scale between the X axis and the Z axis and the coupling scale between the Y axis and the Z axis to 0.

[0042] In actual applications, drones lack large pitch and roll angles when flying in the air, so it is difficult to collect sufficient Z-axis data. Based on this, this application sets the scale of the Z-axis to 1, the coupling scale between the X-axis and the Z-axis to 0, and the coupling scale between the Y-axis and the Z-axis to 0. This not only improves the accuracy of fitting, but also effectively reduces the risk of local overfitting.

[0043] Step S520: Determine the scale of the X axis, the scale of the Y axis, the coupling scale between the X axis and the Y axis, the offset term of the X axis, and the offset term of the Y axis according to the N sets of first data and the ellipse formula.

[0044] Specifically, by substituting N groups of first data into the elliptic formula with unknown coefficients, N elliptic formulas can be obtained. Then, according to algorithms such as the least squares method, the coefficients of the elliptic formula can be determined, thereby determining the elliptic formula. Then, by solving the elliptic formula, the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, the offset term of the X-axis, and the offset term of the Y-axis can be obtained.

[0045] In some embodiments, as Figure 6 As shown, the specific implementation process of step S520 includes the following steps S610 to S630: Step S610: Set the ellipse formula to: ,in, are the ellipse parameters, is the horizontal component of the geomagnetic induction intensity at the current position in the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination of the current location.

[0046] in, It can be obtained from the International Geomagnetic Reference Field (IGRF) model or other geomagnetic models. For a specific location and time point, it can be obtained by querying relevant databases or using corresponding software tools. and The specific acquisition process is common knowledge in this field and will not be described here.

[0047] Step S620: Determine ellipse parameters according to the three-axis components of the N groups of first data.

[0048] Each set of first data has three-axis components: an X-axis component, a Y-axis component, and a Z-axis component. Therefore, N sets of first data include N sets of three-axis components, i.e., N X-axis components, N Y-axis components, and N Z-axis components. Substituting the X-axis component corresponding to each set of first data into the x-value of the ellipse formula, the Y-axis component into the y-value of the ellipse formula, and the Z-axis component into the z-value of the ellipse formula, the N sets of first data are substituted into the ellipse formula to obtain N ellipse formulas having ellipse parameters a1 to a5 (corresponding to the coefficients described above). Subsequently, the ellipse parameters a1 to a5 can be obtained using the least squares method. The specific solution process is common knowledge to those skilled in the art and will not be elaborated here.

[0049] Step S630: Determine the scale of the X axis, the scale of the Y axis, the coupling scale between the X axis and the Y axis, and the offset term of the X axis and the offset term of the Y axis according to the geometric representation of the ellipse formula.

[0050] In a specific embodiment, the geometric expression of the above ellipse formula is: , , where X=[xy], X represents a point on the ellipse, , for The eigenvalues ​​of , C represents the center of the circle.

[0051] According to the geometric representation of the ellipse formula, the following parameters are determined: , , , b1=c x , b2=c y ,in, , A1 is the scale of the X axis, A2 is the scale of the Y axis, A 12 is the coupling scale between the X-axis and the Y-axis, b1 is the bias term of the X-axis, and b2 is the bias term of the Y-axis.

[0052] According to the relationship between H, C and ellipse parameters, we can get The relationship between the parameters of the ellipse and A1, A2, A 12 , b1, b2 and the relationship between the ellipse parameters.

[0053] Step S530: Determine the Z-axis offset item according to the geomagnetic induction intensity and magnetic inclination angle at the current position.

[0054] In a specific embodiment, the offset term of the Z axis is: , , where b3 is the offset term of the Z axis, is the sum of the Z-axis components of N groups of first data. For N groups of first data, each group of first data contains three components: X-axis, Y-axis, and Z-axis. is the average value of the Z-axis component, is the component of the geomagnetic induction intensity at the current position in the vertical direction of the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination of the current location.

[0055] In summary, the process of determining the first parameter is implemented. In this process, by determining the scale of each axis, the measurement results of different axes can be proportionally adjusted to ensure that they can accurately reflect the actual physical quantity. By determining the bias term of each axis, the fixed deviation of the magnetometer in the static state can be compensated, making the magnetometer output closer to the true value. By determining the coupling scale between the two axes, possible cross-coupling errors (i.e., errors caused by the output of one axis being affected by the input of another axis) can be identified and corrected, thereby improving the overall measurement accuracy.

[0056] Step S330: Acquire the second parameter currently used for calibration and the third parameter obtained by offline calibration.

[0057] Among them, since after executing step S330, only the first parameter, the second parameter, and the third parameter are determined, and the magnetometer is not calibrated, the second parameter currently used for calibration refers to the parameter used to calibrate the magnetometer after executing step S340 in the previous calibration cycle. It can be understood that in the embodiment of the present application, after collecting N sets of first data, a calibration process is performed (i.e., the process of executing steps S310 to S340), which is a calibration cycle; after the end of a calibration cycle, N sets of first data are recollected, and the calibration process is performed again... and so on, the calibration cycle is repeated continuously to calibrate the magnetometer. In the M+1th calibration cycle, the second parameter in step S330 is the parameter used to calibrate the magnetometer at the end of the Mth calibration cycle, where M is an integer greater than or equal to 1.

[0058] For a drone's magnetometer, the third parameter obtained through offline calibration refers to a calibration parameter determined through a series of pre-set operations and data collection while the drone is not in flight, thereby correcting for various errors in the magnetometer readings. In some embodiments, offline calibration employs ellipsoid fitting calibration. The specific implementation process is readily understood by those skilled in the art and is not further described here.

[0059] Step S340: calibrate the magnetometer according to one of the first parameter, the second parameter, and the third parameter.

[0060] After determining the first parameter, the second parameter and the third parameter, according to a preset selection method, the optimal parameter can be selected from the first parameter, the second parameter and the third parameter to perform online calibration on the magnetometer, thereby ensuring high calibration accuracy.

[0061] In some embodiments, as Figure 7 As shown, the specific implementation process of step S340 includes the following steps S710 to S730: Step S710: calibrating the N sets of second data using a calibration parameter, wherein the calibration parameter is the first parameter, the second parameter, or the third parameter.

[0062] Step S720: Obtain the root mean square error between the modulus of the corrected magnetic induction intensity and the modulus of the geomagnetic induction intensity at the current position, wherein the root mean square error includes a first root mean square error corresponding to the first parameter, a second root mean square error corresponding to the second parameter, and a third root mean square error corresponding to the third parameter.

[0063] Specifically, the N groups of second data are corrected by the first parameter, and the root mean square error between the corrected magnetic induction intensity modulus and the geomagnetic induction intensity modulus at the current position is obtained, which is the first root mean square error; the N groups of second data are corrected by the second parameter, and the root mean square error between the corrected magnetic induction intensity modulus and the geomagnetic induction intensity modulus at the current position is obtained, which is the second root mean square error; the N groups of second data are corrected by the third parameter, and the root mean square error between the corrected magnetic induction intensity modulus and the geomagnetic induction intensity modulus at the current position is obtained, which is the third root mean square error.

[0064] Taking the first parameter as an example, the first root mean square error is calculated as follows: .

[0065] in, is the first root mean square error; is an array consisting of the scale of the X axis, the scale of the Y axis, the scale of the Z axis, the coupling scale between the X axis and the Y axis, the coupling scale between the X axis and the Z axis, and the coupling scale between the Y axis and the Z axis. , , A1 is the scale of the X axis, A2 is the scale of the Y axis, A3 is the scale of the Z axis, A 12 With A 21 is the coupling scale between the X-axis and the Y-axis, A 13 With A 31 is the coupling scale between the X-axis and the Z-axis, A 23 With A 32 is the coupling scale between the Y axis and the Z axis; is the second parameter of group i; is an array consisting of the X-axis offset, the Y-axis offset, and the Z-axis offset. , b1 is the bias term of the X axis, b2 is the bias term of the Y axis, and b3 is the bias term of the Z axis; It represents the magnetic induction intensity after correction. is the geomagnetic induction intensity of the current location, Indicates the error between the corrected magnetic induction intensity and the geomagnetic induction intensity at the current location. Indicates the error between the modulus of the corrected magnetic induction intensity and the modulus of the geomagnetic induction intensity at the current location.

[0066] Then, the result after calibrating the magnetometer using the first parameter is: .

[0067] in, is the result after calibration.

[0068] Similarly, for the second parameter 、 , the second root mean square error can be obtained by the same calculation method as the first parameter ; For the third parameter 、 , the third root mean square error can be obtained by the same calculation method as the first parameter .

[0069] Step S730: Determine parameters for calibrating the magnetometer according to the first root mean square error, the second root mean square error, and the third root mean square error.

[0070] Specifically, according to the first root mean square error, the second root mean square error and the third root mean square error, the optimal parameter among the first parameter, the second parameter and the third parameter can be determined, and then the magnetometer can be calibrated based on the optimal parameter.

[0071] In some embodiments, as Figure 8 As shown, the specific implementation process of step S730 includes the following steps S810 to S820.

[0072] Step S810: When the third root mean square error is less than or equal to a preset threshold, determining that the parameter for calibrating the magnetometer is a third parameter.

[0073] Step S820: When the third root mean square error is greater than a preset threshold, determining that the parameter for calibrating the magnetometer is the minimum value among the first parameter, the second parameter, and the third parameter.

[0074] Among them, the preset threshold is a pre-set threshold, which can be set based on the actual application scenario, and the embodiment of the present application does not impose any specific restrictions on this.

[0075] Specifically, because offline calibration uses ellipsoid fitting, the collected data is more three-dimensional and therefore generally more accurate. Therefore, when the third root mean square error is less than or equal to a preset threshold, the third parameter is preferentially selected for magnetometer calibration, ensuring higher calibration accuracy. When the third root mean square error is greater than the preset threshold, the minimum value of the first, second, and third parameters is selected for magnetometer calibration. Selecting the optimal parameters for online magnetometer calibration helps ensure higher calibration accuracy.

[0076] Furthermore, the ability to achieve highly accurate online magnetometer calibration effectively adapts to magnetic interference from the aircraft, ensuring high accuracy in the magnetometer-calculated heading. Furthermore, the ability to select multiple sets of calibration parameters ensures that the calibrated parameters are always optimal and stable under the current circumstances, further ensuring the accuracy of online magnetometer calibration.

[0077] The above description is merely an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

[0078] The above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them. Based on the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, and the steps may be implemented in any order. A person skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features may be replaced by equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A magnetometer calibration method, characterized in that: include: Acquire N sets of first data of the magnetometer in a target coordinate system, where N is an integer greater than 0; Determining first parameters for ellipse fitting calibration based on the N sets of first data, wherein the first parameters include an X-axis scale, a Y-axis scale, a Z-axis scale, a coupling scale between the X-axis and the Y-axis, a coupling scale between the X-axis and the Z-axis, a coupling scale between the Y-axis and the Z-axis, an X-axis offset, a Y-axis offset, and a Z-axis offset. Obtaining a second parameter currently used for calibration and a third parameter obtained by offline calibration; The magnetometer is calibrated according to one of the first parameter, the second parameter, and the third parameter.

2. The method according to claim 1, characterized in that The obtaining of N sets of first data of the magnetometer in the target coordinate system includes: Acquire a set of second data at intervals of 360 / N degrees, and acquire N sets of second data, wherein the second data is data of the magnetometer in a body coordinate system of a device used to set the magnetometer; N groups of the second data are converted into N groups of the first data according to the roll angle and the pitch angle.

3. The method according to claim 1, characterized in that Determining first parameters for ellipse fitting calibration according to the N groups of the first data includes: Set the scale of the Z axis to 1, and set the coupling scale between the X axis and the Z axis and the coupling scale between the Y axis and the Z axis to 0; Determining, based on the N groups of the first data and the ellipse formula, the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, and the offset term of the X-axis and the offset term of the Y-axis; Determine the Z-axis offset based on the geomagnetic induction intensity and magnetic inclination at the current location.

4. The method according to claim 3, characterized in that The determining, based on the N groups of the first data and the ellipse formula, the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, and the offset term of the X-axis and the offset term of the Y-axis includes: The ellipse formula is: ,in, are the ellipse parameters, is the horizontal component of the geomagnetic induction intensity at the current location in the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination of the current position; Determine the ellipse parameters according to the three-axis components of N groups of the first data; According to the geometric representation of the ellipse formula, the scale of the X axis, the scale of the Y axis, the coupling scale between the X axis and the Y axis, the offset term of the X axis, and the offset term of the Y axis are determined.

5. The method according to claim 4, characterized in that Determining the scale of the X-axis, the scale of the Y-axis, the coupling scale between the X-axis and the Y-axis, and the offset term of the X-axis and the offset term of the Y-axis according to the geometric representation of the ellipse formula includes: The geometric representation of the ellipse formula is: , , where X=[xy], X represents a point on the ellipse, , for The eigenvalues ​​of , C represents the center of the circle; According to the geometric representation of the ellipse formula, the following parameters are determined: , , , b1=c x , b2=c y ,in, , A1 is the scale of the X axis, A2 is the scale of the Y axis, A 12 is the coupling scale between the X-axis and the Y-axis, b1 is the bias term of the X-axis, and b2 is the bias term of the Y-axis.

6. The method according to claim 3, characterized in that Determining the Z-axis offset item according to the geomagnetic induction intensity and magnetic inclination of the current position includes: The offset term for the Z axis is: , , where b3 is the offset term of the Z axis, is the sum of the Z-axis components of N groups of the first data, is the component of the geomagnetic induction intensity at the current position in the vertical direction of the geodetic coordinate system, is the modulus of the geomagnetic induction intensity at the current location, is the magnetic inclination of the current location.

7. The method according to claim 2, characterized in that The calibrating the magnetometer according to one of the first parameter, the second parameter, and the third parameter includes: Correcting the N sets of the second data using a calibration parameter, wherein the calibration parameter is the first parameter, the second parameter, or the third parameter; Obtaining a root mean square error between the modulus of the corrected magnetic induction intensity and the modulus of the geomagnetic induction intensity at the current location, wherein the root mean square error includes a first root mean square error corresponding to the first parameter, a second root mean square error corresponding to the second parameter, and a third root mean square error corresponding to the third parameter; Parameters for calibrating the magnetometer are determined according to the first root mean square error, the second root mean square error, and the third root mean square error.

8. The method according to claim 7, characterized in that Determining parameters for calibrating the magnetometer according to the first root mean square error, the second root mean square error, and the third root mean square error includes: When the third root mean square error is less than or equal to a preset threshold, determining that the parameter for calibrating the magnetometer is the third parameter; When the third root mean square error is greater than the preset threshold, the parameter for calibrating the magnetometer is determined to be a minimum value among the first parameter, the second parameter and the third parameter.

9. A control processing unit, characterized in that: include: at least one processor and memory; The memory is coupled to the processor, and is used to store instructions or programs. When the instructions or programs are executed by the at least one processor, the at least one processor is enabled to perform the magnetometer calibration method according to any one of claims 1 to 8.

10. A drone, characterized in that: The device comprises a magnetometer and a control processing unit as claimed in claim 9.

Citation Information

Patent Citations

  • Magnetometer calibration method and device

    CN107607899A

  • Three-axis magnetic sensor calibration method based on magnetic course angle and least square method

    CN112833917A

  • Magnetometer calibration method of unmanned aerial vehicle, unmanned aerial vehicle and storage medium

    CN115014390A

  • Method for calibration of magnetic sensor

    US20170176546A1

  • Methods and apparatus for planar magnetometer calibration, heading determination, gyroscope assisted magnetometer amplitude calibration, magnetometer amplitude and alignment calibration, magnetometer mapping, and sensor fusion

    US20210095966A1