Method and apparatus for compensating for current magnetic fields

By collecting and analyzing static and dynamic magnetometer data from UAVs, the direction vector and intensity mapping parameters of the current magnetic field are determined, and the influence of the current magnetic field is compensated in real time. This solves the problem of UAV battery current interfering with the magnetometer and improves the accuracy of heading measurement.

CN122632152BActive Publication Date: 2026-11-20ZHEJIANG HUAFEI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611134308.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-11-20
Estimated Expiration
2046-07-29

AI Technical Summary

Technical Problem

The magnetic field generated by the drone's battery current interferes with the magnetometer data, causing the magnetometer's heading measurement to fail. This phenomenon is more pronounced in small drones, and existing technologies lack effective solutions.

Method used

By controlling the drone to collect magnetometer and current data in both static and dynamic states, the direction vector and intensity mapping parameters of the current magnetic field are determined, the influence of the current magnetic field is compensated in real time, and the magnetometer measurement data is calibrated using calibration parameters.

Benefits of technology

It effectively eliminates interference from electric current and magnetic fields, improves the accuracy of magnetometer heading measurement, is suitable for multi-rotor UAV navigation systems, and does not require physical isolation between the magnetometer and the battery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122632152B_ABST
    Figure CN122632152B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method and device for compensating current magnetic field, comprising: control unmanned aerial vehicle is in stationary state, collect static magnetometer data set and static current data set in stationary state;Control unmanned aerial vehicle executes dynamic load change test, collect dynamic magnetometer data set and dynamic current data set in test process;Determine the direction vector of current magnetic field;Establish target mapping relationship, obtain calibration parameter by fitting;In the working process of unmanned aerial vehicle, obtain working current data, determine working current variation according to working current data and static current data set;Working current variation, direction vector and calibration parameter are used to determine working current magnetometer data variation;According to working current magnetometer data variation, the measurement data of magnetometer is compensated, and the output of magnetometer after compensation is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of unmanned aerial vehicles (UAVs), and more specifically, to a method and apparatus for compensating for the magnetic field of an electric current. Background Technology

[0002] A magnetometer is a magnetic field measurement sensor that accurately measures the strength and direction of a magnetic field. Its applications are very wide, ranging from everyday consumer electronics to cutting-edge scientific research. Navigation systems are a crucial component of unmanned aerial vehicle (UAV) systems and are essential for UAVs. Heading measurement, as a vital parameter of navigation systems, is a necessary condition for achieving high-precision navigation. Magnetometers measure heading by sensing changes in the Earth's magnetic field, enabling their widespread application in the navigation field.

[0003] However, magnetometers are susceptible to interference from the external environment, causing them to include magnetic field information other than the Earth's magnetic field in their measurements, leading to heading measurement failure. In the design of UAV navigation systems, especially small UAVs, the small size makes it difficult to keep the magnetometer away from the battery. This means the magnetic field generated by the battery current easily interferes with the magnetometer data, causing heading measurement failure. This phenomenon becomes even more pronounced during UAV flight due to the constantly changing operating current.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This application provides a method and apparatus for compensating for the magnetic field of a current, so as to at least solve the technical problem in the related art where the magnetic field generated by the battery current of a UAV interferes with the magnetometer data, causing the magnetometer heading measurement to fail.

[0006] According to one aspect of the embodiments of this application, a method for compensating for a current magnetic field is provided, comprising: controlling a drone to be in a stationary state, and collecting a static magnetometer dataset and a static current dataset in the stationary state; controlling the drone to perform a dynamic load change test, and collecting a dynamic magnetometer dataset and a dynamic current dataset during the test; determining a direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset; establishing a target mapping relationship based on the static magnetometer dataset, the static current dataset, the dynamic magnetometer dataset, and the dynamic current dataset, and obtaining calibration parameters by fitting; acquiring operating current data during the operation of the drone, and determining the amount of change in operating current based on the operating current data and the static current dataset; determining the amount of change in operating current magnetometer data using the amount of change in operating current, the direction vector, and the calibration parameters; and compensating the magnetometer measurement data based on the amount of change in operating current magnetometer data to obtain a compensated magnetometer output.

[0007] In an exemplary embodiment, determining the direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset includes: determining the mean of the static magnetometer dataset to obtain a first mean; determining a set of magnetometer data changes based on the dynamic magnetometer dataset and the first mean; and determining the direction vector of the current magnetic field based on the set of magnetometer data changes.

[0008] In an exemplary embodiment, determining the direction vector of the current magnetic field based on the set of magnetometer data changes includes: normalizing each magnetometer data change in the set of magnetometer data changes to obtain a normalized vector set; determining the sum of the normalized vector set to obtain a first sum; and determining the ratio of the first sum to N as the direction vector of the current magnetic field, wherein N is greater than 0, and the set of magnetometer data changes includes N magnetometer data changes.

[0009] In an exemplary embodiment, establishing a target mapping relationship based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, includes: determining the mean of the static magnetometer dataset to obtain a first mean; determining the mean of the static current dataset to obtain a second mean; determining the magnetometer data variation based on the dynamic magnetometer dataset and the first mean to obtain a magnetometer data variation set, wherein the magnetometer data variation set includes N magnetometer data variations, where N is greater than 0; determining the current variation based on the dynamic current dataset and the second mean to obtain a current variation set, wherein the current variation set includes N current variations; and determining the mapping relationship based on the magnetometer data variation set and the current variation set.

[0010] In an exemplary embodiment, determining the mapping relationship based on the set of magnetometer data changes and the set of current changes includes: determining the magnitude of each of the magnetometer data changes to obtain a set of magnitudes, wherein the set of magnitudes includes N magnitudes; and establishing the mapping relationship as follows:

[0011]

[0012] in, It is the magnitude of the change in the i-th magnetometer data. It is the i-th current change in the set of current changes, K and The calibration parameter i is greater than 0 and less than or equal to N.

[0013] In one exemplary embodiment, determining the change in operating current based on the operating current data and the static current dataset includes: determining the mean of the static current dataset to obtain a second mean; and determining the difference between the operating current data and the second mean as the change in operating current.

[0014] In an exemplary embodiment, determining the change in operating current magnetometer data using the change in operating current, the direction vector, and the calibration parameters includes: calculating the change in operating current magnetometer data using the following formula:

[0015]

[0016] in, It is the change in the operating current magnetometer data, K and These are the calibration parameters. It is the change in operating current, It is the direction vector.

[0017] In one exemplary embodiment, compensating the magnetometer's measurement data based on the change in the working current magnetometer data to obtain a compensated magnetometer output includes: acquiring the original measurement data of the magnetometer; performing elliptic calibration on the original measurement data to obtain calibrated magnetometer data; and subtracting the change in the working current magnetometer data from the calibrated magnetometer data to obtain the compensated magnetometer output.

[0018] According to another aspect of the embodiments of this application, a device for compensating for a current magnetic field is also provided, comprising: a first acquisition module, configured to control a drone to be in a stationary state and acquire a static magnetometer dataset and a static current dataset in the stationary state; a second acquisition module, configured to control the drone to perform a dynamic load change test and acquire a dynamic magnetometer dataset and a dynamic current dataset during the test; a first determination module, configured to determine the direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset; a second determination module, configured to establish a target mapping relationship based on the static magnetometer dataset, the static current dataset, the dynamic magnetometer dataset, and the dynamic current dataset, and obtain calibration parameters by fitting; a third determination module, configured to acquire operating current data during the operation of the drone and determine the amount of change in operating current based on the operating current data and the static current dataset; a fourth determination module, configured to determine the amount of change in operating current magnetometer data using the amount of change in operating current, the direction vector, and the calibration parameters; and a compensation module, configured to compensate the magnetometer measurement data based on the amount of change in operating current magnetometer data to obtain a compensated magnetometer output.

[0019] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.

[0020] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.

[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.

[0022] This application controls a drone to remain stationary and collects static magnetometer and static current datasets under stationary conditions; controls the drone to perform dynamic load change tests and collects dynamic magnetometer and dynamic current datasets during the test process; determines the direction vector of the current magnetic field based on the static and dynamic magnetometer datasets; establishes a target mapping relationship based on the static and dynamic magnetometer datasets and the dynamic and dynamic current datasets, and obtains calibration parameters through fitting.

[0023] During UAV operation, operating current data is acquired, and the change in operating current is determined based on the operating current data and static current dataset. Using the change in operating current, direction vector, and calibration parameters, the change in magnetometer data is determined. The magnetometer's measurement data is then compensated based on this change in magnetometer data to obtain the compensated magnetometer output. This process compensates for the magnetometer's measurement data, thus resolving the problem of magnetic field interference from the UAV's battery current causing magnetometer heading measurement failure, and ultimately improving the accuracy of magnetometer heading measurements. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating a method for compensating for a current magnetic field according to an embodiment of this application.

[0025] Figure 2 This is a schematic flowchart of an optional method for determining the direction vector of a current magnetic field according to an embodiment of this application;

[0026] Figure 3 This is a schematic diagram of an optional process for establishing a target mapping relationship according to an embodiment of this application;

[0027] Figure 4 This is a structural block diagram of an optional device for compensating for a current magnetic field according to an embodiment of this application;

[0028] Figure 5 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] According to one aspect of the embodiments of this application, a method for compensating for the magnetic field of a current is provided. Optionally, in this embodiment, the above-described method for compensating for the magnetic field of a current can be applied to, but is not limited to, unmanned aerial vehicles (UAVs).

[0032] This embodiment proposes a method for compensating for current-magnetic field errors in a UAV magnetometer, primarily applied to multi-rotor UAV navigation systems. This method dynamically compensates for errors based on real-time current changes by determining the direction vector and intensity mapping parameters of the current-magnetic field.

[0033] Taking the method of compensating for the magnetic field of the current in this embodiment, which is executed by the flight control computer (or main control processor / embedded control system) of the UAV, as an example, Figure 1 This is a schematic flowchart of an optional method for compensating for a current magnetic field according to an embodiment of this application. As shown in the figure, the method may include the following steps:

[0034] Step S102: Control the drone to be stationary and collect static magnetometer data and static current data in the stationary state.

[0035] Secure the drone on a flat surface, ensuring it is level and stationary (i.e., without sticking out). Activate the drone system and, once stable, collect static magnetometer data in this stationary state. and static current dataset Where N is the number of sampling points, the specific value of which can be determined according to the actual situation, such as 100, 200, 1000, etc.

[0036] The aforementioned magnetometer can be a triaxial magnetometer. Triaxial magnetometer data includes components in three directions; that is, each magnetometer data point in the static magnetometer dataset can be represented as:

[0037]

[0038] This is the i-th static magnetometer data. , , It is the component of the i-th static magnetometer data in the three axes of the magnetometer.

[0039] The mean of the static magnetometer dataset is determined to obtain the first mean:

[0040]

[0041] The mean of the static current dataset is determined to obtain the second mean:

[0042]

[0043] This is the i-th static current data. It is the second mean, which serves as the reference current for subsequent calculations of current changes.

[0044] Step S104: Control the UAV to perform dynamic load change test and collect dynamic magnetometer data and dynamic current data during the test process;

[0045] Control the drone to perform dynamic load change tests (i.e., stick test). During the test, input non-zero control commands (such as pushing the throttle, pushing or pulling the pitch / roll stick) through the remote controller or ground station to cause dynamic changes in the drone's motor speed and total current.

[0046] During this period, dynamic magnetometer datasets are collected in real time:

[0047] ;

[0048] Collect dynamic current dataset:

[0049] ;

[0050] Where N is the number of sampling points in the dynamic process.

[0051] Step S106: Determine the direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset;

[0052] In one exemplary embodiment, the direction vector of the current magnetic field is determined based on the static magnetometer dataset and the dynamic magnetometer dataset, such as... Figure 2 The flowchart shown includes the following steps:

[0053] Step S202: Determine the mean of the static magnetometer dataset to obtain the first mean;

[0054] The first mean value is calculated using the above embodiments. .

[0055] Step S204: Determine the set of magnetometer data changes based on the dynamic magnetometer dataset and the first mean;

[0056] For each data point in the dynamic magnetometer dataset, calculate the change in magnetometer data relative to the mean (first mean) of the static magnetometer dataset:

[0057]

[0058] This yields the set of magnetometer data changes: .

[0059] Step S206: Normalize the changes in each magnetometer data in the set of magnetometer data changes to obtain a normalized vector set.

[0060] For a triaxial magnetometer, the data includes components in three directions. The changes in the magnetometer data can be expressed as follows:

[0061]

[0062] The magnetometer data variation is normalized using the following formula to obtain a normalized vector:

[0063]

[0064]

[0065]

[0066]

[0067] It is the unit direction vector in the carrier coordinate system at the current moment in the direction of the current magnetic field. It is the component of change in the three axes of the magnetometer.

[0068] This yields the normalized vector set. .

[0069] Step S208: Determine the sum of the normalized vector set to obtain a first sum; determine the ratio of the first sum to N as the direction vector of the current magnetic field, where N is greater than 0, and the set of magnetometer data changes includes N magnetometer data changes.

[0070] Taking the mean of the normalized vector set yields the direction vector of the current magnetic field:

[0071]

[0072] Step S108: Establish a target mapping relationship based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, and obtain calibration parameters by fitting.

[0073] like Figure 3 The flowchart shown includes the following steps:

[0074] Step S302: Determine the mean of the static magnetometer dataset to obtain the first mean;

[0075] The first mean value is calculated using the above embodiments. .

[0076] Step S304: Determine the mean of the static current dataset to obtain the second mean;

[0077] The second mean was obtained through the above embodiments. .

[0078] Step S306: Determine the magnetometer data change amount based on the dynamic magnetometer dataset and the first mean to obtain a magnetometer data change amount set, wherein the magnetometer data change amount set includes N magnetometer data change amounts, where N is greater than 0;

[0079] The magnetometer data change set was calculated using the above embodiments:

[0080]

[0081] Step S308: Determine the current change amount based on the dynamic current dataset and the second mean to obtain a current change amount set, wherein the current change amount set includes N current changes.

[0082] For each data point in the dynamic current dataset, calculate the change in current relative to the mean (second mean) of the static current dataset:

[0083]

[0084] in, It is the i-th current data in the dynamic current dataset. It is the second mean. It is the change in current of the i-th current data relative to the second mean.

[0085] Thus, the set of current changes is obtained. .

[0086] Step S310: Determine the mapping relationship based on the set of changes in magnetometer data and the set of changes in current.

[0087] In an exemplary embodiment, determining the mapping relationship based on the set of magnetometer data changes and the set of current changes includes: determining the magnitude of each of the magnetometer data changes to obtain a set of magnitudes, wherein the set of magnitudes includes N magnitudes; and establishing the mapping relationship as follows:

[0088]

[0089] in, It is the magnitude of the change in the i-th magnetometer data. It is the i-th current change in the set of current changes, K and The calibration parameter i is greater than 0 and less than or equal to N.

[0090]

[0091] Assumption:

[0092] in,

[0093]

[0094]

[0095] Then we have: The calibration parameters K and can be obtained through calculation. .

[0096] Step S110: During the operation of the UAV, acquire operating current data, and determine the change in operating current based on the operating current data and the static current dataset;

[0097] In one exemplary embodiment, determining the change in operating current based on the operating current data and the static current dataset includes: determining the mean of the static current dataset to obtain a second mean; and determining the difference between the operating current data and the second mean as the change in operating current.

[0098] During the operation of the drone, the current operating current data of the drone is acquired in real time. The change in operating current can be calculated using the following formula:

[0099]

[0100] Step S112: Determine the change in working current magnetometer data using the change in working current, the direction vector, and the calibration parameters;

[0101] In an exemplary embodiment, determining the change in operating current magnetometer data using the change in operating current, the direction vector, and the calibration parameters includes:

[0102] The change in the operating current magnetometer data is calculated using the following formula:

[0103]

[0104] in, It is the change in the operating current magnetometer data, K and These are the calibration parameters. It is the change in operating current, It is the direction vector.

[0105] Step S114: Compensate the magnetometer measurement data based on the change in the working current magnetometer data to obtain the compensated magnetometer output.

[0106] In one exemplary embodiment, compensating the magnetometer's measurement data based on the change in the working current magnetometer data to obtain a compensated magnetometer output includes: acquiring the original measurement data of the magnetometer; performing elliptic calibration on the original measurement data to obtain calibrated magnetometer data; and subtracting the change in the working current magnetometer data from the calibrated magnetometer data to obtain the compensated magnetometer output.

[0107] Without using the lever, the magnetometer is calibrated using common magnetometer calibration methods such as elliptic calibration, based on the original output data. The calibration scheme is not detailed here. The calibration parameters are as follows:

[0108]

[0109] in, This is the raw output data of the magnetometer. is the zero bias of the triaxial magnetometer, and A is the scaling factor and non-orthogonal coefficient matrix of the triaxial magnetometer. This is the data from the calibrated magnetometer.

[0110] During the operation of a drone, the change in current superimposed on the magnetic field of the current results in the original triaxial magnetometer data output by the magnetometer containing a component of the current magnetic field. Therefore, this part needs to be compensated in the output to ensure the accuracy of the magnetometer data. The compensation principle is as follows:

[0111]

[0112] in, Let be the change in current magnetometer data caused by the change in current, and we have:

[0113]

[0114] Thus obtained This refers to the magnetometer output that compensates for the magnetic field of the current.

[0115] The above embodiments illustrate that this method is not limited to drones. It can be applied to any device containing a magnetometer and a variable current load (such as a robot with a robotic arm, a vehicle navigation system, etc.) as long as the following conditions are met: there is a relatively fixed magnetometer installation location; the system operating current dynamically changes with the load; and both magnetometer data and current data can be collected simultaneously. The above embodiments enable online compensation of the internal current magnetic field of the system.

[0116] This application eliminates the need for physical isolation, using software algorithms to cancel out the influence of current and magnetic fields in real time, thus solving the problem of limited space for physical shielding in small UAVs. By dynamically testing and calculating the direction vector and establishing a linear mapping between current and magnetic field strength, it can accurately reflect magnetic field fluctuations caused by changes in current. The calibration process only requires the UAV to be stationary and undergo simple dynamic load changes, making it easy to operate. Furthermore, the solution can be extended to other electromagnetically sensitive magnetic navigation systems.

[0117] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0119] According to another aspect of the embodiments of this application, an apparatus for compensating for a current magnetic field is also provided. This apparatus can be used to implement the method for compensating for a current magnetic field provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0120] Figure 4 This is a structural block diagram of an optional device for compensating for a current magnetic field according to an embodiment of this application, such as... Figure 4 As shown, the device for compensating for the magnetic field of the current includes:

[0121] The first acquisition module 40 is used to control the UAV to be stationary and to acquire static magnetometer data and static current data in the stationary state.

[0122] The second acquisition module 41 is used to control the UAV to perform dynamic load change test and acquire dynamic magnetometer data and dynamic current data during the test process.

[0123] The first determining module 42 is used to determine the direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset;

[0124] The second determining module 43 is used to establish a target mapping relationship based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, and to obtain calibration parameters through fitting.

[0125] The third determining module 44 is used to acquire operating current data during the operation of the UAV, and determine the change in operating current based on the operating current data and the static current dataset.

[0126] The fourth determining module 45 is used to determine the change in the working current magnetometer data using the change in the working current, the direction vector, and the calibration parameters.

[0127] The compensation module 46 is used to compensate the magnetometer's measurement data based on the change in the working current magnetometer data, so as to obtain the compensated magnetometer output.

[0128] In an exemplary embodiment, the above-described apparatus is further configured to determine the mean of the static magnetometer dataset to obtain a first mean; determine a set of magnetometer data changes based on the dynamic magnetometer dataset and the first mean; and determine the direction vector of the current magnetic field based on the set of magnetometer data changes.

[0129] In an exemplary embodiment, the above-described apparatus is further configured to normalize each magnetometer data change in the magnetometer data change set to obtain a normalized vector set; determine the sum of the normalized vector set to obtain a first sum; and determine the ratio of the first sum to N as the direction vector of the current magnetic field, wherein N is greater than 0, and the magnetometer data change set includes N magnetometer data changes.

[0130] In an exemplary embodiment, the above-described apparatus is further configured to: determine the mean of the static magnetometer dataset to obtain a first mean; determine the mean of the static current dataset to obtain a second mean; determine the magnetometer data variation based on the dynamic magnetometer dataset and the first mean to obtain a magnetometer data variation set, wherein the magnetometer data variation set includes N magnetometer data variations, where N is greater than 0; determine the current variation based on the dynamic current dataset and the second mean to obtain a current variation set, wherein the current variation set includes N current variations; and determine the mapping relationship based on the magnetometer data variation set and the current variation set.

[0131] In an exemplary embodiment, the above-described apparatus is further configured to determine the modulus of each of the magnetometer data changes, thereby obtaining a modulus set, wherein M is greater than 0, and the modulus set includes N modulus values; the mapping relationship is established as follows:

[0132]

[0133] in, It is the magnitude of the change in the i-th magnetometer data. It is the i-th current change in the set of current changes, K and The calibration parameter i is greater than 0 and less than or equal to N.

[0134] In an exemplary embodiment, the above-described apparatus is further configured to determine the mean of the static current dataset to obtain a second mean; and to determine the difference between the operating current data and the second mean as the change in operating current.

[0135] In one exemplary embodiment, the above-described apparatus is further configured to calculate the change in the operating current magnetometer data using the following formula:

[0136]

[0137] in, It is the change in the operating current magnetometer data, K and These are the calibration parameters. It is the change in operating current, It is the direction vector.

[0138] In an exemplary embodiment, the above-described apparatus is further configured to acquire raw measurement data of a magnetometer; perform elliptic calibration on the raw measurement data to obtain calibrated magnetometer data; and subtract the change in the operating current magnetometer data from the calibrated magnetometer data to obtain the compensated magnetometer output.

[0139] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0140] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.

[0141] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0142] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0143] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0144] According to another aspect of the embodiments of this application, a computer program product is also provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0145] Figure 5 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 5As shown, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in ROM 502 or programs loaded into RAM 503 from storage section 508. Random access memory 503 also stores various programs and data required for system operation. The CPU 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0146] The following components are connected to I / O interface 505: input section 506 including keyboard, mouse, etc.; output section 507 including cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; storage section 508 including hard disk, etc.; and communication section 509 including network interface card, modem, etc. Communication section 509 performs communication processing via a network such as the Internet. Drive 510 is also connected to I / O interface 505 as needed. Removable media 511, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 510 as needed so that computer programs read from them can be installed into storage section 508 as needed.

[0147] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions defined in the system of this application.

[0148] It should be noted that, Figure 5 The computer system 500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0149] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0150] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for compensating for the magnetic field of a current, characterized in that, include: The system controls the drone to remain stationary and collects static magnetometer and static current datasets under stationary conditions. It then controls the drone to perform a dynamic load change test, collecting dynamic magnetometer and dynamic current datasets during the test. The system determines the mean of the static magnetometer dataset to obtain a first mean. Based on the dynamic magnetometer dataset and the first mean, it determines a set of magnetometer data changes. Finally, it normalizes each magnetometer data change in the set of magnetometer data changes to obtain a normalized vector set. The sum of the normalized vector set is determined to obtain a first sum; the ratio of the first sum to N is determined as the direction vector of the current magnetic field, where N is greater than 0, and the set of magnetometer data changes includes N magnetometer data changes; a target mapping relationship is established based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, and calibration parameters are obtained by fitting. During the operation of the UAV, operating current data is acquired, and the change in operating current is determined based on the operating current data and the static current dataset. The change in operating current magnetometer data is determined using the change in operating current, the direction vector, and the calibration parameters. The magnetometer measurement data is compensated based on the change in operating current magnetometer data to obtain the compensated magnetometer output. The change in the operating current magnetometer data is calculated using the following formula: , in, It is the change in the operating current magnetometer data, K and These are the calibration parameters. It is the change in operating current, It is the direction vector.

2. The method according to claim 1, characterized in that, Establishing a target mapping relationship based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, includes: Determine the mean of the static magnetometer dataset to obtain the first mean; Determine the mean of the static current dataset to obtain a second mean; The magnetometer data change is determined based on the dynamic magnetometer dataset and the first mean, resulting in a magnetometer data change set, wherein the magnetometer data change set includes N magnetometer data changes, where N is greater than 0; The current change is determined based on the dynamic current dataset and the second mean, resulting in a current change set, wherein the current change set includes N current changes. The mapping relationship is determined based on the set of changes in magnetometer data and the set of changes in current.

3. The method according to claim 2, characterized in that, Determining the mapping relationship based on the set of changes in magnetometer data and the set of changes in current includes: Determine the magnitude of each of the magnetometer data changes to obtain a magnitude set, wherein the magnitude set includes N magnitudes; The mapping relationship is established as follows: , in, It is the magnitude of the change in the i-th magnetometer data. It is the i-th current change in the set of current changes, K and The calibration parameter i is greater than 0 and less than or equal to N.

4. The method according to claim 1, characterized in that, The operating current variation is determined based on the operating current data and the quiescent current dataset, including: Determine the mean of the static current dataset to obtain a second mean; The difference between the operating current data and the second mean is determined as the change in operating current.

5. The method according to claim 1, characterized in that, The magnetometer's measurement data is compensated based on the change in the operating current magnetometer data to obtain the compensated magnetometer output, including: Obtain the raw measurement data from the magnetometer; The original measurement data is elliptic calibrated to obtain calibrated magnetometer data; The calibrated magnetometer data is subtracted from the change in the operating current magnetometer data to obtain the compensated magnetometer output.

6. A device for compensating for the magnetic field of a current, characterized in that, include: The first acquisition module is used to control the UAV to be stationary and to acquire static magnetometer data and static current data in the stationary state. The second acquisition module is used to control the UAV to perform dynamic load change tests and acquire dynamic magnetometer data and dynamic current data during the test process. The first determining module is used to determine the direction vector of the current magnetic field based on the static magnetometer dataset and the dynamic magnetometer dataset; The second determining module is used to establish a target mapping relationship based on the static magnetometer dataset and the static current dataset, as well as the dynamic magnetometer dataset and the dynamic current dataset, and to obtain calibration parameters through fitting. The third determining module is used to acquire operating current data during the operation of the UAV, and determine the change in operating current based on the operating current data and the static current dataset. The fourth determining module is used to determine the change in the working current magnetometer data using the change in the working current, the direction vector, and the calibration parameters. The compensation module is used to compensate the magnetometer's measurement data based on the change in the working current magnetometer data, and obtain the compensated magnetometer output. The device is further configured to determine the mean of the static magnetometer dataset to obtain a first mean; determine a set of magnetometer data changes based on the dynamic magnetometer dataset and the first mean; and perform normalization processing on each magnetometer data change in the set of magnetometer data changes to obtain a normalized vector set. The sum of the normalized vector set is determined to obtain a first sum; the ratio of the first sum to N is determined as the direction vector of the current magnetic field, where N is greater than 0, and the set of magnetometer data changes includes N magnetometer data changes. The device is also used to calculate the change in the operating current magnetometer data using the following formula: , in, It is the change in the operating current magnetometer data, K and These are the calibration parameters. It is the change in operating current, It is the direction vector.

7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Electronic compass active compensation method and system in strong magnetic interference environment

    CN114674301A

  • Interference compensation method and device for magnetic compass, equipment and storage medium

    CN117232488A