A dynamic angle compensation method and system for a three-dimensional electronic compass

By evaluating the reliability of acceleration, angular velocity, and geomagnetic vector information from a 3D electronic compass, and dynamically adjusting the parameters of the attitude calculation and heading angle calculation algorithms, the accuracy and reliability issues of the 3D electronic compass under dynamic motion and magnetic field interference are resolved, and the calculation accuracy of attitude and heading angle is improved.

CN120558185BActive Publication Date: 2026-05-15SHENZHEN RUISHU TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN RUISHU TECHNOLOGY CO LTD
Filing Date
2025-06-20
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In the existing technology, the fixed attitude calculation algorithm and heading angle calculation algorithm of the three-dimensional electronic compass cannot effectively adapt to the dynamic motion of the carrier and external magnetic field interference, resulting in a decrease in the accuracy and reliability of attitude information and heading angle calculation.

Method used

By evaluating the reliability of acceleration, angular velocity, and geomagnetic vector information, the key parameter combinations for attitude calculation and heading angle calculation algorithms are dynamically determined to adapt to the acceleration changes and external magnetic field interference of the carrier during motion.

Benefits of technology

It improves the accuracy and reliability of attitude calculation results and heading angle calculation results, and enhances the application performance of the three-dimensional electronic compass in dynamic and complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120558185B_ABST
    Figure CN120558185B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of heading angle calculation, and specifically provides a three-dimensional electronic compass dynamic angle compensation method and system, which comprises the following steps: obtaining acceleration information, angular velocity information and geomagnetic vector information; respectively performing credibility evaluation on the acceleration information, the angular velocity information and the geomagnetic vector information to obtain acceleration credibility, angular velocity credibility and geomagnetic vector credibility; determining a target parameter combination of a posture solution algorithm according to the acceleration credibility and the angular velocity credibility, and then obtaining posture information according to the acceleration information and the angular velocity information by using the posture solution algorithm; determining a target parameter combination of a heading angle calculation algorithm according to the geomagnetic vector credibility, and then obtaining a heading angle according to the posture information and the geomagnetic vector information by using the heading angle calculation algorithm; and the method can make the posture solution algorithm and the heading angle calculation algorithm adapt to acceleration changes, angular velocity changes and external magnetic field interference of a carrier in a motion process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of heading angle calculation technology, and more specifically, to a dynamic angle compensation method and system for a three-dimensional electronic compass. Background Technology

[0002] Existing technologies typically utilize a three-dimensional electronic compass embedded in a carrier (such as a handheld device, a small robot, or a portable measuring instrument) to calculate the heading angle, which characterizes heading information. This process generally includes two main stages: First, a fixed attitude calculation algorithm is used to calculate the carrier's attitude information (such as pitch and roll angles) based on acceleration and angular velocity information collected by accelerometers and gyroscopes; then, a fixed heading angle calculation algorithm is used to calculate the heading angle based on the obtained carrier attitude information and geomagnetic vector information collected by a magnetometer.

[0003] However, in practical applications, the acceleration and angular velocity of the carrier change frequently and drastically during movement. For example, users may tilt or rotate their wrists when using handheld devices, or small robots may need to adjust their posture to avoid obstacles during movement. Since fixed posture calculation algorithms struggle to accurately capture and adapt to the real-time changes in the carrier's acceleration and angular velocity, existing technologies suffer from reduced accuracy and reliability of the calculated posture information due to the use of fixed algorithms. This error in posture information affects subsequent heading angle calculations, leading to inaccurate heading angles. Furthermore, when the carrier passes near magnetic objects (such as steel structures, bridges, or vehicles containing steel), the local magnetic fields generated by these objects interfere with the Earth's magnetic field, causing the geomagnetic vector information collected by the magnetometer to deviate from the true value. Because existing fixed heading angle calculation algorithms cannot detect or effectively handle this external magnetic field interference, they also suffer from the problem of directly introducing the magnetometer's measurement error into the heading angle calculation results. The combined effects of attitude errors and magnetic field interference can lead to insufficient accuracy and reliability of the heading angles calculated by existing technologies, making it difficult for the calculated heading angles to meet the requirements of application scenarios with high heading information accuracy.

[0004] Currently, there is no effective technical solution to the above-mentioned problems. It should be noted that the information disclosed in this section is only for understanding the background of the present invention and therefore may include information that does not constitute prior art. Summary of the Invention

[0005] The purpose of this application is to provide a dynamic angle compensation method and system for a three-dimensional electronic compass, which can effectively solve the problem that the accuracy and reliability of attitude calculation results and heading angle calculation results are reduced because fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters cannot effectively adapt to these dynamic changes and interference environments.

[0006] In a first aspect, this application provides a dynamic angle compensation method for a three-dimensional electronic compass, which includes the following steps:

[0007] S1. Acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer;

[0008] S2. The reliability of the acceleration information, angular velocity information and geomagnetic vector information are evaluated respectively to obtain the reliability of acceleration, angular velocity and geomagnetic vector.

[0009] S3. Determine the target parameter combination of the attitude calculation algorithm based on the acceleration confidence level and angular velocity confidence level, and then use the attitude calculation algorithm to obtain attitude information based on the acceleration information and angular velocity information;

[0010] S4. Determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information.

[0011] This application provides a dynamic angle compensation method for a three-dimensional electronic compass. This method first assesses the reliability of acceleration, angular velocity, and geomagnetic vector information, and then dynamically determines the key parameter combinations for the attitude calculation algorithm and heading angle calculation algorithm based on the reliability assessment results. This allows the attitude calculation algorithm and heading angle calculation algorithm to adapt to changes in acceleration, angular velocity, and external magnetic field interference during the vehicle's motion. Therefore, this application effectively solves the problem of reduced accuracy and reliability of attitude calculation and heading angle calculation results due to the inability of fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters to effectively adapt to these dynamic changes and interference environments. This effectively improves the accuracy and reliability of attitude calculation and heading angle calculation results, thereby enhancing the accuracy and reliability of attitude information and heading angle.

[0012] Secondly, this application also provides a three-dimensional electronic compass dynamic angle compensation system, which includes:

[0013] The information acquisition module is used to acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer.

[0014] The credibility assessment module is used to assess the credibility of acceleration information, angular velocity information and geomagnetic vector information respectively, so as to obtain the credibility of acceleration, angular velocity and geomagnetic vector.

[0015] The attitude information acquisition module is used to determine the target parameter combination of the attitude calculation algorithm based on the acceleration confidence level and the angular velocity confidence level, and then use the attitude calculation algorithm to acquire attitude information based on the acceleration information and angular velocity information.

[0016] The heading angle acquisition module is used to determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information.

[0017] This application provides a three-dimensional electronic compass dynamic angle compensation system. This system first assesses the reliability of acceleration, angular velocity, and geomagnetic vector information, and then dynamically determines the key parameter combinations for the attitude calculation algorithm and heading angle calculation algorithm based on the reliability assessment results. This allows the attitude calculation algorithm and heading angle calculation algorithm to adapt to changes in acceleration, angular velocity, and external magnetic field interference during the vehicle's motion. Therefore, this application effectively solves the problem of reduced accuracy and reliability of attitude calculation and heading angle calculation results due to the inability of fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters to effectively adapt to these dynamic changes and interference environments. This effectively improves the accuracy and reliability of attitude calculation and heading angle calculation results, thereby enhancing the accuracy and reliability of attitude information and heading angle.

[0018] As can be seen from the above, the three-dimensional electronic compass dynamic angle compensation method and system provided in this application can adapt to the changes in acceleration, angular velocity and geomagnetic vector information during the movement of the carrier by first evaluating the reliability of acceleration information, angular velocity information and geomagnetic vector information, and then dynamically determining the key parameter combination of attitude calculation algorithm and heading angle calculation algorithm based on the reliability evaluation results. Therefore, this application can effectively solve the problem that the accuracy and reliability of attitude calculation results and heading angle calculation results are reduced because fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters cannot effectively adapt to these dynamic changes and interference environments. Thus, it can effectively improve the accuracy and reliability of attitude calculation results and heading angle calculation results, thereby effectively improving the accuracy and reliability of attitude information and heading angle. Attached Figure Description

[0019] Figure 1 A flowchart illustrating a dynamic angle compensation method for a three-dimensional electronic compass provided in this application embodiment.

[0020] Figure 2 This is a schematic diagram of the structure of a three-dimensional electronic compass dynamic angle compensation system provided in an embodiment of this application.

[0021] Reference numerals: 1. Information acquisition module; 2. Credibility assessment module; 3. Attitude information acquisition module; 4. Heading angle acquisition module. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0024] In traditional 3D electronic compass technology, fixed attitude calculation algorithms and fixed heading angle calculation algorithms are typically used to determine the attitude information and heading angle of the carrier. However, in practical applications, the carrier is often in a dynamic state, with frequent and drastic changes in acceleration and angular velocity, and is also susceptible to external magnetic field interference. Fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters cannot effectively adapt to these dynamic changes and interference environments, resulting in reduced accuracy and reliability of attitude calculation results and heading angle calculation results.

[0025] For example, suppose a user moves indoors holding a device with a built-in 3D electronic compass. The user may frequently tilt and rotate the device to view the screen or perform operations. During this dynamic movement, accelerometer data will be affected by non-gravitational acceleration, and gyroscope data will accumulate drift. Simultaneously, the device may pass near walls with reinforced concrete structures or large metal objects, which will generate local magnetic field interference and cause the geomagnetic vector information collected by the magnetometer to deviate from the true value. In this scenario, if the parameters of the attitude calculation algorithm and the heading angle calculation algorithm are fixed, attitude error and heading angle error will be introduced.

[0026] If the above problems are not solved, the heading angle calculated from inaccurate attitude information and disturbed geomagnetic vector information will not be able to accurately reflect the actual orientation of the carrier, which will lead to the failure or performance degradation of applications that rely on the heading angle (for example, the navigation system cannot provide correct directional guidance, virtual objects in augmented reality applications cannot be accurately aligned with the real environment, or robots that require precise directional control cannot perform their predetermined tasks). Moreover, the low accuracy and low reliability of the heading angle will severely limit the application scope and performance of the three-dimensional electronic compass in dynamic and complex environments.

[0027] In this regard, firstly, such as Figure 1 As shown, this application provides a dynamic angle compensation method for a three-dimensional electronic compass, which includes the following steps:

[0028] S1. Acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer;

[0029] S2. The reliability of the acceleration information, angular velocity information and geomagnetic vector information are evaluated respectively to obtain the reliability of acceleration, angular velocity and geomagnetic vector.

[0030] S3. Determine the target parameter combination of the attitude calculation algorithm based on the acceleration confidence level and angular velocity confidence level, and then use the attitude calculation algorithm to obtain attitude information based on the acceleration information and angular velocity information;

[0031] S4. Determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information.

[0032] Step S1 is equivalent to acquiring the basic sensor data required for the three-dimensional electronic compass to calculate the heading angle. This basic sensor data includes acceleration information, angular velocity information, and geomagnetic vector information. Acceleration information refers to the physical quantity of the carrier's acceleration in inertial space, measured by an accelerometer. In this embodiment, existing triaxial accelerometers (such as MEMS accelerometers or piezoelectric accelerometers) can be used to acquire acceleration information, which reflects the carrier's linear acceleration and gravitational acceleration. Angular velocity information refers to the physical quantity of the carrier's angular velocity relative to inertial space, measured by a gyroscope. In this embodiment, existing triaxial gyroscopes (such as MEMS gyroscopes or fiber optic gyroscopes) can be used to acquire angular velocity information, which reflects the carrier's rotational angular rate around each axis. Geomagnetic vector information refers to the vector data of the geomagnetic field vector at the carrier's location, measured by a magnetometer. In this embodiment, existing triaxial magnetometers (such as magnetoresistive magnetometers or Hall effect magnetometers) can be used to acquire geomagnetic field vector information, which reflects the direction and intensity of the geomagnetic field at the carrier's location.

[0033] Step S2, which involves evaluating the reliability of the acceleration, angular velocity, and geomagnetic vector information, refers to determining the degree of reliability or validity of these information. This embodiment can achieve this by analyzing data fluctuations, consistency, and deviations from model predictions, or by incorporating external information. For example, the reliability of acceleration information can be evaluated by calculating the deviation between the magnitude of the acceleration information and gravitational acceleration; the reliability of angular velocity information can be evaluated by analyzing its zero-bias stability; and the reliability of geomagnetic vector information can be evaluated by analyzing the deviation between the magnitude of the geomagnetic vector information and the local theoretical geomagnetic field magnitude, or by analyzing the stability of the geomagnetic vector direction. Step S2 is equivalent to quantifying the reliability of each sensor data point at the current moment by evaluating the reliability of the acceleration, angular velocity, and geomagnetic vector information separately.

[0034] The attitude calculation algorithm in step S3 can employ complementary filtering, Kalman filtering, or variations thereof. The target parameter combination of the attitude calculation algorithm refers to the configuration of relative weights used to control the fusion of different sensor data. This relative weight configuration can be represented by weight coefficients, filter gains, or covariance matrix parameters. Since step S3 determines the target parameter combination of the attitude calculation algorithm based on acceleration and angular velocity reliability, step S3 is equivalent to dynamically adjusting the contribution of acceleration and angular velocity information in the attitude calculation process based on their reliability. For example, when acceleration reliability is low, the contribution of acceleration information in the attitude calculation process is weakened by reducing the weight corresponding to acceleration information; when acceleration reliability is high, the contribution of acceleration information in the attitude calculation process is enhanced by increasing the weight corresponding to acceleration information, so that the attitude calculation algorithm can adaptively adjust its fusion strategy according to the quality of the current sensor data. Since step S3 first dynamically adjusts the contribution of acceleration and angular velocity information in the attitude calculation process based on the reliability of acceleration and angular velocity information, and then uses the attitude calculation algorithm to obtain attitude information based on acceleration and angular velocity information, this embodiment enables the attitude calculation algorithm to accurately capture and adapt to the real-time changes in the vehicle's acceleration and angular velocity. Therefore, this embodiment can effectively improve the accuracy and reliability of attitude information and effectively avoid the introduction of attitude information errors due to the attitude calculation algorithm accurately capturing and adapting to the real-time changes in the vehicle's acceleration and angular velocity. This effectively avoids the situation where attitude information errors affect the subsequent heading angle calculation and cause the heading angle to be inaccurate.

[0035] The heading angle calculation algorithm in step S4 can employ either a method of projecting the geomagnetic vector onto the horizontal plane and calculating its angle with the north direction, or a filtering algorithm that fuses attitude and geomagnetic information. The target parameter combination of the heading angle calculation algorithm refers to the configuration used to control the degree of dependence or processing method of the algorithm on attitude and geomagnetic vector information. This configuration can be represented by weighting coefficients, compensation factors, or model parameters. Since step S4 determines the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, step S4 is equivalent to dynamically adjusting the contribution of the geomagnetic vector information in the heading angle calculation process according to the reliability of the geomagnetic vector information. For example, when the reliability of the geomagnetic vector is low, the contribution of the geomagnetic vector information in the heading angle calculation process is weakened by reducing the weight corresponding to the geomagnetic vector information, thereby increasing the contribution of the attitude information in the heading angle calculation process. When the reliability of the geomagnetic vector is high, the contribution of the geomagnetic vector information in the heading angle calculation process is enhanced by increasing the weight corresponding to the geomagnetic vector information, thereby weakening the contribution of the attitude information in the heading angle calculation process. This allows the heading angle calculation algorithm to adaptively adjust its fusion strategy according to the quality of the current sensor data. Since step S4 first determines the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then uses the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information, this embodiment enables the heading angle calculation algorithm to sense and effectively process external magnetic field interference. Therefore, this embodiment can effectively avoid the situation where the measurement error of the magnetometer is directly introduced into the heading angle calculation result because the fixed heading angle calculation algorithm cannot sense or effectively process such external magnetic field interference.

[0036] As a preferred embodiment, the solution of this application is implemented as follows: First, the raw data streams from the accelerometer, gyroscope, and magnetometer are acquired through sensor interfaces. Then, the reliability of the preprocessed acceleration information, angular velocity information, and geomagnetic vector information is evaluated. Specifically, this embodiment evaluates the reliability of acceleration information by calculating the deviation of its modulus from the standard gravitational acceleration; it evaluates the reliability of angular velocity information by analyzing the zero-bias drift of angular velocity information in a stationary state; and it evaluates the reliability of geomagnetic vector information by detecting whether the modulus of geomagnetic vector information deviates from the local geomagnetic field modulus or analyzing short-term fluctuations in geomagnetic vector information. Based on the acceleration and angular velocity reliability, a pre-established mapping table is consulted. This mapping table associates different combinations of acceleration and angular velocity reliability with the parameters of the attitude calculation algorithm to obtain the target parameter combination for the attitude calculation algorithm. The attitude calculation algorithm with the determined target parameter combination is then used to perform attitude calculation based on the acceleration and angular velocity information to obtain the attitude information of the carrier. Based on the geomagnetic vector confidence level, another mapping table is consulted, which associates the geomagnetic vector confidence level with the parameters of the heading angle calculation algorithm. This allows us to obtain the target parameter combination for the heading angle calculation algorithm and use the heading angle calculation algorithm with the target parameter combination to calculate the heading angle of the carrier based on the attitude information and the geomagnetic vector information.

[0037] This application provides a dynamic angle compensation method for a three-dimensional electronic compass. This method first assesses the reliability of acceleration, angular velocity, and geomagnetic vector information, and then dynamically determines the key parameter combinations for the attitude calculation algorithm and heading angle calculation algorithm based on the reliability assessment results. This allows the attitude calculation algorithm and heading angle calculation algorithm to adapt to changes in acceleration, angular velocity, and external magnetic field interference during the vehicle's motion. Therefore, this application effectively solves the problem of reduced accuracy and reliability of attitude calculation and heading angle calculation results due to the inability of fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters to effectively adapt to these dynamic changes and interference environments. This effectively improves the accuracy and reliability of attitude calculation and heading angle calculation results, thereby enhancing the accuracy and reliability of attitude information and heading angle.

[0038] In some preferred embodiments, step S3 includes:

[0039] S31. Based on the acceleration confidence level and angular velocity confidence level, query the pre-built mapping table of acceleration confidence level, angular velocity confidence level and attitude calculation algorithm parameter combination to determine the first preliminary parameter combination;

[0040] S32. Analyze and obtain the actual motion pattern based on acceleration and angular velocity information;

[0041] S33. Based on the actual motion mode, query the pre-constructed mapping relationship table of motion mode and solution algorithm parameter adjustment coefficient combination to obtain the first adjustment coefficient corresponding to each parameter in the first preliminary parameter combination;

[0042] S34. Adjust the first preliminary parameter combination according to all the first adjustment coefficients to obtain the target parameter combination of the attitude calculation algorithm;

[0043] S35. Use the attitude calculation algorithm to obtain attitude information based on acceleration and angular velocity information.

[0044] The pre-built mapping table of acceleration reliability, angular velocity reliability, and attitude calculation algorithm parameter combinations refers to a lookup table storing attitude calculation algorithm parameter combinations corresponding to different acceleration reliability values ​​and angular velocity reliability values. For example, when the acceleration reliability is high and the angular velocity reliability is low, the attitude calculation algorithm parameter combination tends to rely more on accelerometer data, and vice versa. Actual motion modes can include stationary motion, uniform linear motion, accelerated motion, rotational motion, free fall, etc. This embodiment can analyze the actual motion mode based on the statistical characteristics of acceleration and angular velocity information (e.g., calculating the mean, variance, peak value, or spectral characteristics of acceleration or angular velocity). For example, in a stationary state, the acceleration is close to gravitational acceleration and the angular velocity is close to zero; in uniform motion, the acceleration is close to gravitational acceleration and the angular velocity is close to zero; in accelerated motion, the acceleration amplitude changes significantly; and in rotational motion, the angular velocity amplitude changes significantly. The mapping table for motion mode and algorithm parameter adjustment coefficient combinations stores rules on how to adjust the parameters in the first preliminary parameter combination to optimize the solution effect for different motion modes. For example, during violent acceleration, accelerometer data may contain large non-gravitational accelerations, so it may be necessary to reduce the weight of acceleration information in attitude calculation; during rapid rotation, gyroscope data may be more reliable, so it may be necessary to increase the weight of angular velocity information in attitude calculation. Step S33 can adjust the first preliminary parameter combination according to all the first adjustment coefficients by multiplying each first adjustment coefficient by the corresponding parameter in the first preliminary parameter combination. This embodiment is equivalent to introducing the analysis of the actual motion mode on the basis of obtaining acceleration and angular velocity information and performing reliability assessment. This embodiment can make the attitude calculation algorithm better adapt to the sensor data characteristics of the carrier under different motion states by adjusting the parameters of the attitude calculation algorithm in a targeted manner according to the actual motion mode, thereby effectively improving the accuracy and reliability of attitude information, and further improving the accuracy and reliability of heading angle.

[0045] In some preferred embodiments, step S34 includes:

[0046] S341. Obtain the fluctuation range of acceleration information within a preset time window;

[0047] S342. Based on the fluctuation amplitude, query the pre-constructed mapping relationship table of acceleration fluctuation amplitude and solution algorithm parameter adjustment coefficient combination to obtain the second adjustment coefficient corresponding to each parameter in the first preliminary parameter combination;

[0048] S343. Adjust the first preliminary parameter combination according to all the first adjustment coefficients and all the second adjustment coefficients to obtain the target parameter combination of the attitude calculation algorithm.

[0049] Step S341 can obtain the fluctuation amplitude of acceleration information within a preset time window by calculating the standard deviation, variance, or peak-to-peak value of the acceleration information within the preset time window. The size of the preset time window can be set according to the actual application scenario and the motion characteristics of the carrier. For example, it can be set to 0.1 seconds to 1 second. It should be understood that since the acceleration of the carrier will fluctuate when the carrier is subjected to vibration or impact, and the degree of acceleration fluctuation is related to the intensity of the vibration or impact, step S341 can quantify the intensity of the vibration or impact environment in which the carrier is currently located by obtaining the fluctuation amplitude of acceleration information within the preset time window. The mapping table for acceleration fluctuation amplitude and solution algorithm parameter adjustment coefficient combinations records the relationship between different acceleration fluctuation amplitude ranges and corresponding solution algorithm parameter adjustment coefficient combinations. For example, when the fluctuation amplitude is in a low range, it indicates that the intensity of vibration or impact is low, and the impact of vibration or impact is limited. The adjustment coefficients corresponding to each parameter in the first preliminary parameter combination are close to 1, meaning that the adjustment amplitude of each parameter in the first preliminary parameter combination is small. When the fluctuation amplitude is in a high range, it indicates that the intensity of vibration or impact is high, and the impact of vibration or impact is large. The adjustment coefficients corresponding to each parameter in the first preliminary parameter combination deviate from 1, meaning that the adjustment amplitude of each parameter in the first preliminary parameter combination is large. Step S343 can be implemented by multiplying each parameter in the first preliminary parameter combination by the corresponding first adjustment coefficient and second adjustment coefficient, respectively, to adjust the first preliminary parameter combination based on all first adjustment coefficients and all second adjustment coefficients. Step S343 can also be implemented by using a weighted average method to adjust the first preliminary parameter combination based on all first adjustment coefficients and all second adjustment coefficients. This embodiment, based on the initial adjustment of the attitude calculation algorithm parameters according to the motion mode, further considers the impact of vibration or impact on the parameters. Specifically, this embodiment quantifies the intensity of vibration or impact by obtaining the fluctuation amplitude of acceleration information within a preset time window. This embodiment obtains a second adjustment coefficient reflecting the impact of vibration or impact by first querying a pre-built mapping table based on the fluctuation amplitude, and then combines these second adjustment coefficients with the first adjustment coefficient obtained according to the motion mode to adjust the first preliminary parameter combination, thereby obtaining a target parameter combination of the attitude calculation algorithm that can adapt to the current motion mode and vibration / impact environment. Therefore, this embodiment can effectively avoid the situation where the calculation of attitude information is affected by the vibration or impact of the carrier, thereby further improving the accuracy and reliability of attitude information, and further improving the accuracy and reliability of heading angle.

[0050] In some preferred embodiments, step S343 includes:

[0051] A1. Obtain the first cumulative runtime and first historical runtime dataset of the accelerometer, and the second cumulative runtime and second historical runtime dataset of the gyroscope;

[0052] A2. The aging degree of the accelerometer is evaluated based on the first cumulative running time and the first historical running dataset to obtain a first aging score, and the aging degree of the gyroscope is evaluated based on the second cumulative running time and the second historical running dataset to obtain a second aging score.

[0053] A3. Based on the first aging score and the second aging score, query the pre-constructed mapping table of accelerometer aging score, gyroscope aging score and solution algorithm parameter adjustment coefficient combination to obtain the third adjustment coefficient corresponding to each parameter in the first preliminary parameter combination.

[0054] A4. Adjust the first preliminary parameter combination according to all first adjustment coefficients, all second adjustment coefficients and all third adjustment coefficients to obtain the target parameter combination of the attitude calculation algorithm.

[0055] The first and second cumulative runtimes record the total operating time of the accelerometer and gyroscope since they were put into use. This embodiment can use an internal counter or system log to record and accumulate the total operating time of the accelerometer and gyroscope since they were put into use. The first and second historical operating datasets store data collected by the accelerometer and gyroscope in the past or performance indicators (such as zero bias, scale factor error, noise level, drift characteristics, etc.) extracted from this data. The first and second historical operating datasets are preferentially stored in the data storage module. Aging degree assessment refers to the process of quantifying the degree of sensor performance degradation based on the cumulative runtime and historical operating dataset of the sensor (accelerometer and gyroscope) using a specific algorithm or model. This embodiment can use a preset function or machine learning model to analyze the sensor noise level, zero bias drift, sensitivity change, and other indicators based on the historical operating dataset, and combine this with the cumulative runtime to achieve aging degree assessment. The aging score is a numerical value that quantifies the degree of sensor aging. This value intuitively reflects the degree of sensor performance degradation. The aging score can be a floating-point number between 0 and 1 or a discrete level value. The mapping table for accelerometer aging scores, gyroscope aging scores, and adjustment coefficients of the attitude calculation algorithm parameters refers to a lookup table that stores the relationship between different combinations of accelerometer and gyroscope aging scores and corresponding combinations of attitude calculation algorithm parameter adjustment coefficients. For example, when the accelerometer aging score is high, the corresponding third adjustment coefficient may indicate a reduction in the weight of acceleration information in attitude calculation; when gyroscope drift increases, the corresponding third adjustment coefficient may indicate an adjustment of filtering parameters to suppress drift. This embodiment determines the third adjustment coefficients corresponding to each parameter in the first preliminary parameter combination based on the actual aging degree of the accelerometer and gyroscope, and then adjusts the first preliminary parameter combination based on all the third adjustment coefficients. This allows the attitude calculation algorithm parameters to more accurately reflect the current actual performance state of the sensors. Even if the sensors age over time, the attitude calculation algorithm can make corresponding adaptive adjustments to effectively compensate for data errors caused by sensor aging and ensure that the three-dimensional electronic compass maintains a high performance level after long-term use, thereby further improving the accuracy and reliability of attitude information, and further improving the accuracy and reliability of the heading angle.

[0056] In some preferred embodiments, step S4 includes:

[0057] S41. Based on the geomagnetic vector confidence level, query the pre-constructed mapping table of geomagnetic vector confidence level and heading angle calculation algorithm parameter combination to determine the second preliminary parameter combination;

[0058] S42. Obtain the type and intensity of external magnetic field interference;

[0059] S43. Based on the type and intensity of external magnetic field interference, query the pre-constructed mapping table of magnetic field interference type, magnetic field interference intensity and calculation algorithm adjustment coefficient combination to obtain the fourth adjustment coefficient corresponding to each parameter in the second preliminary parameter combination;

[0060] S44. Adjust the second preliminary parameter combination according to all the fourth adjustment coefficients to obtain the target parameter combination of the heading angle calculation algorithm;

[0061] S45. Obtain the heading angle based on attitude information and geomagnetic vector information using the heading angle calculation algorithm.

[0062] The mapping table for the geomagnetic vector confidence level and the heading angle calculation algorithm parameter combination is preferably a lookup table that stores the correspondence between different geomagnetic vector confidence levels and the corresponding preliminary parameter combinations of the heading angle calculation algorithm. The second preliminary parameter combination refers to the initial parameter settings of the heading angle calculation algorithm obtained from the mapping table based on the geomagnetic vector confidence level. Obtaining the type and intensity of external magnetic field interference refers to identifying the nature and strength of the external magnetic field interference present in the current environment. This embodiment can achieve the acquisition of the type and intensity of external magnetic field interference by analyzing the deviation between the magnetometer measurement value and the expected geomagnetic field model value, analyzing the spectral characteristics of the magnetic field measurement value, or using an additional magnetic field sensor array to measure the spatial magnetic field gradient. Specifically, the type of external magnetic field interference can include hard magnetic interference, soft magnetic interference, AC magnetic field interference, etc. The mapping table for magnetic field interference type, magnetic field interference intensity, and calculation algorithm adjustment coefficient combination refers to a lookup table that stores the correspondence between different external magnetic field interference types and intensities and the corresponding heading angle calculation algorithm parameter adjustment coefficients. For example, when strong AC magnetic field interference is detected (external magnetic field interference type is AC magnetic field interference and external magnetic field interference intensity is high), the corresponding fourth adjustment coefficient indicates a significant reduction in the weight of geomagnetic vector information. Step S44 can be implemented by multiplying each parameter in the second preliminary parameter combination by the corresponding fourth adjustment coefficient to adjust the second preliminary parameter combination according to all the fourth adjustment coefficients. This embodiment is equivalent to understanding the external magnetic field interference situation by sensing the external magnetic field interference type and intensity, and dynamically adjusting the parameter combination of the heading angle calculation algorithm according to the external magnetic field interference situation, so that the heading angle calculation algorithm can better adapt to complex magnetic field environments and reduce the impact of external magnetic field interference on the accuracy of heading angle calculation, thereby further improving the accuracy and reliability of heading angle calculation.

[0063] In some preferred embodiments, step S1 includes:

[0064] S11. Acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer;

[0065] S12. Preprocess the acceleration information, angular velocity information, and geomagnetic vector information.

[0066] Preprocessing refers to processing the raw sensor data (accelerometer data, angular velocity data, and magnetometer data) to remove or reduce noise, biases, and other adverse factors. This embodiment can employ techniques such as filtering or data calibration to preprocess the acceleration, angular velocity, and magnetometer data. By adding a preprocessing step after acquiring the raw sensor data, this embodiment effectively removes or reduces noise and biases in the raw data. Therefore, it effectively improves the quality of the acceleration, angular velocity, and magnetometer data, providing a more accurate basis for subsequent attitude and heading angle calculations, thereby significantly improving the accuracy and reliability of attitude and heading information.

[0067] In some preferred embodiments, preprocessing includes noise filtering and calibration compensation. Noise filtering refers to the process of suppressing or removing random fluctuations in the raw sensor data. This embodiment can employ existing digital filters (mean filtering, median filtering, Kalman filtering, or wavelet filtering techniques) to achieve noise filtering. Calibration compensation refers to the process of correcting systematic errors in the sensor. This embodiment can employ pre-determined calibration parameters (e.g., accelerometer bias and scaling factor, gyroscope bias and scaling factor, and magnetometer bias, scaling factor, and cross-axis error parameters) to achieve calibration compensation.

[0068] In some preferred embodiments, the target parameter combination of the attitude calculation algorithm includes acceleration information weights and angular velocity information weights. Acceleration information weights refer to the quantitative representation of the contribution or confidence level of acceleration information to attitude information when the attitude calculation algorithm fuses acceleration information. These acceleration information weights can be represented using a scaling factor, gain coefficient, or corresponding elements in the covariance matrix. Angular velocity information weights refer to the quantitative representation of the contribution or confidence level of angular velocity information to attitude information when the attitude calculation algorithm fuses angular velocity information. These angular velocity information weights can also be represented using a scaling factor, gain coefficient, or corresponding elements in the covariance matrix.

[0069] In some preferred embodiments, the target parameter combination of the heading angle calculation algorithm includes attitude information weights and geomagnetic vector information weights. Attitude information weights are a quantitative representation of the contribution or confidence level of attitude information to the heading angle during the calculation process; these weights can be represented using a scaling factor, gain coefficient, or corresponding elements in the covariance matrix. Geomagnetic vector information weights are a quantitative representation of the contribution or confidence level of geomagnetic vector information to the heading angle during the calculation process; these weights can also be represented using a scaling factor, gain coefficient, or corresponding elements in the covariance matrix.

[0070] As can be seen from the above, the three-dimensional electronic compass dynamic angle compensation method provided in this application can adapt to the changes in acceleration, angular velocity, and geomagnetic vector information during the movement of the carrier by first evaluating the reliability of acceleration information, angular velocity information, and geomagnetic vector information, and then dynamically determining the key parameter combination of attitude calculation algorithm and heading angle calculation algorithm based on the reliability evaluation results. Therefore, this application can effectively solve the problem that the accuracy and reliability of attitude calculation results and heading angle calculation results are reduced because fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters cannot effectively adapt to these dynamic changes and interference environments. Thus, it can effectively improve the accuracy and reliability of attitude calculation results and heading angle calculation results, thereby effectively improving the accuracy and reliability of attitude information and heading angle.

[0071] Secondly, such as Figure 2 As shown, this application also provides a three-dimensional electronic compass dynamic angle compensation system, which includes:

[0072] Information acquisition module 1 is used to acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer;

[0073] The credibility assessment module 2 is used to assess the credibility of acceleration information, angular velocity information and geomagnetic vector information respectively, so as to obtain the credibility of acceleration, angular velocity and geomagnetic vector.

[0074] The attitude information acquisition module 3 is used to determine the target parameter combination of the attitude calculation algorithm based on the acceleration confidence level and the angular velocity confidence level, and then use the attitude calculation algorithm to obtain attitude information based on the acceleration information and angular velocity information.

[0075] The heading angle acquisition module 4 is used to determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and the geomagnetic vector information.

[0076] This application provides a three-dimensional electronic compass dynamic angle compensation system, which includes an information acquisition module 1, a reliability assessment module 2, an attitude information acquisition module 3, and a heading angle acquisition module 4. The three-dimensional electronic compass dynamic angle compensation system provided in this embodiment is used to perform the steps in the three-dimensional electronic compass dynamic angle compensation method provided in the first aspect above. The principle of the three-dimensional electronic compass dynamic angle compensation system provided in this embodiment is the same as the principle of the three-dimensional electronic compass dynamic angle compensation method provided in the first aspect above, and will not be discussed in detail here.

[0077] As can be seen from the above, the three-dimensional electronic compass dynamic angle compensation method and system provided in this application can adapt to the changes in acceleration, angular velocity and geomagnetic vector information during the movement of the carrier by first evaluating the reliability of acceleration information, angular velocity information and geomagnetic vector information, and then dynamically determining the key parameter combination of attitude calculation algorithm and heading angle calculation algorithm based on the reliability evaluation results. Therefore, this application can effectively solve the problem that the accuracy and reliability of attitude calculation results and heading angle calculation results are reduced because fixed attitude calculation algorithm parameters and heading angle calculation algorithm parameters cannot effectively adapt to these dynamic changes and interference environments. Thus, it can effectively improve the accuracy and reliability of attitude calculation results and heading angle calculation results, thereby effectively improving the accuracy and reliability of attitude information and heading angle.

[0078] In the embodiments provided in this application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of the above units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another robot, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0079] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0080] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0081] The above are merely embodiments of this application and are not intended to limit the scope of protection of 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 spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for dynamic angle compensation of a three-dimensional electronic compass, characterized in that, It includes the following steps: S1. Obtain acceleration information, angular velocity information, and geomagnetic vector information; S2. The reliability of the acceleration information, angular velocity information and geomagnetic vector information are evaluated respectively to obtain the reliability of acceleration, angular velocity and geomagnetic vector. S3 specifically includes: S31. Based on the acceleration confidence level and angular velocity confidence level, query the pre-built mapping table of acceleration confidence level, angular velocity confidence level and attitude calculation algorithm parameter combination to determine the first preliminary parameter combination; S32. Analyze and obtain the actual motion pattern based on acceleration and angular velocity information; S33. Based on the actual motion mode, query the pre-constructed mapping relationship table of motion mode and solution algorithm parameter adjustment coefficient combination to obtain the first adjustment coefficient corresponding to each parameter in the first preliminary parameter combination; S34 specifically includes: S341. Obtain the fluctuation range of acceleration information within a preset time window; S342. Based on the fluctuation amplitude, query the pre-constructed mapping table of acceleration fluctuation amplitude and solution algorithm parameter adjustment coefficient combinations to obtain the second adjustment coefficients corresponding to each parameter in the first preliminary parameter combination; S343 specifically includes: A1. Obtain the first cumulative runtime and first historical runtime dataset of the accelerometer, and the second cumulative runtime and second historical runtime dataset of the gyroscope; A2. The aging degree of the accelerometer is evaluated based on the first cumulative running time and the first historical running dataset, and the aging degree of the gyroscope is evaluated based on the second cumulative running time and the second historical running dataset to obtain the first and second aging scores. A3. Based on the first and second aging scores, query the pre-constructed mapping table of accelerometer aging scores, gyroscope aging scores and solution algorithm parameter adjustment coefficient combinations to obtain the third adjustment coefficient corresponding to each parameter in the first preliminary parameter combination. A4. Adjust the first preliminary parameter combination according to all the first, second and third adjustment coefficients to obtain the target parameter combination of the attitude calculation algorithm; S35. Use attitude calculation algorithms to obtain attitude information based on acceleration and angular velocity information; S4. Determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information.

2. The three-dimensional electronic compass dynamic angle compensation method according to claim 1, characterized in that, Step S4 includes: S41. Based on the geomagnetic vector confidence level, query the pre-constructed mapping table of geomagnetic vector confidence level and heading angle calculation algorithm parameter combination to determine the second preliminary parameter combination; S42. Obtain the type and intensity of external magnetic field interference; S43. Based on the type and intensity of external magnetic field interference, query the pre-constructed mapping table of magnetic field interference type, magnetic field interference intensity and calculation algorithm adjustment coefficient combination to obtain the fourth adjustment coefficient corresponding to each parameter in the second preliminary parameter combination; S44. Adjust the second preliminary parameter combination according to all the fourth adjustment coefficients to obtain the target parameter combination of the heading angle calculation algorithm; S45. Obtain the heading angle based on attitude information and geomagnetic vector information using the heading angle calculation algorithm.

3. The three-dimensional electronic compass dynamic angle compensation method according to claim 1, characterized in that, Step S1 includes: S11. Acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer; S12. Preprocess the acceleration information, angular velocity information, and geomagnetic vector information.

4. The three-dimensional electronic compass dynamic angle compensation method according to claim 3, characterized in that, Preprocessing includes noise filtering and calibration compensation.

5. The three-dimensional electronic compass dynamic angle compensation method according to claim 1, characterized in that, The target parameter combination of the attitude calculation algorithm includes acceleration information weights and angular velocity information weights.

6. The three-dimensional electronic compass dynamic angle compensation method according to claim 1, characterized in that, The target parameter combination of the heading angle calculation algorithm includes attitude information weights and geomagnetic vector information weights.

7. A three-dimensional electronic compass dynamic angle compensation system, characterized in that, The three-dimensional electronic compass dynamic angle compensation system is used to perform the steps of the three-dimensional electronic compass dynamic angle compensation method as claimed in any one of claims 1-6, wherein the three-dimensional electronic compass dynamic angle compensation system comprises: The information acquisition module is used to acquire acceleration information collected by the accelerometer, angular velocity information collected by the gyroscope, and geomagnetic vector information collected by the magnetometer. The credibility assessment module is used to assess the credibility of acceleration information, angular velocity information and geomagnetic vector information respectively, so as to obtain the credibility of acceleration, angular velocity and geomagnetic vector. The attitude information acquisition module is used to determine the target parameter combination of the attitude calculation algorithm based on the acceleration confidence level and the angular velocity confidence level, and then use the attitude calculation algorithm to acquire attitude information based on the acceleration information and angular velocity information. The heading angle acquisition module is used to determine the target parameter combination of the heading angle calculation algorithm based on the reliability of the geomagnetic vector, and then use the heading angle calculation algorithm to obtain the heading angle based on the attitude information and geomagnetic vector information.