Automatic calibration method, system, medium and computer for geomagnetic sensor
By identifying the characteristic point of the domain curve of the pitch angle of the geomagnetic sensor, calculate the variable volume of magnetic fields and calculate the new bias value, solve the problem that the geomagnetic sensor cannot be automatically calibrated in the existing technology, and achieve higher data accuracy and more more data accuracy and more Low computing resource requirements.
Patent Information
- Application Number
- CN202410092846.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-01-23
AI Technical Summary
The calibration methods of existing geomagnetic sensors require manual activation and cannot be adjusted automatically in real time, especially when magnetic field interferes.
By obtaining the domain curve of the pitch angle data of the geomagnetic sensor, the identification feature point is identified to calculate the amount of magnetic field change, judge the effectiveness of the magnetic field bias, and replace the new bias value based on the strength of the magnetic field.
The automatic real -time calibration of the geomagnetic sensor is realized without manual activation, which improves the accuracy of the data and reduces the needs of computing resources.
Smart Images

Figure CN117928598B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sensor calibration, and more specifically, to a method, system, medium and computer for automatic calibration of a geomagnetic sensor. Background Art
[0002] Geomagnetic sensors are widely used in various electronic products such as mobile phones, watches, toys and virtual reality. They are mainly used in conjunction with accelerometer and gyroscope chips for spatial positioning to achieve navigation, gesture and posture recognition.
[0003] The working principle of the geomagnetic sensor is to determine the direction and angle of the product based on the difference in the magnetic flux components of the earth's magnetic field in different directions of the geomagnetic sensor. Therefore, in electronic products, the magnetic flux components of the earth's magnetic field in different directions of the geomagnetic sensor need to be accurately written into the product in order to determine the standard state of the product.
[0004] Currently, the commonly used calibration methods for geomagnetic sensors are plane calibration method and three-dimensional eight-shaped calibration method. These two methods mainly rely on the earth's own magnetic field to allow the product to rotate in a plane or three-dimensional space to determine the initial position and angle of the product. The disadvantages of these two methods are that they require manual activation of the calibration switch and cannot be automatically adjusted in real time when interfered by the magnetic field. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method, system, medium and computer for automatic calibration of geomagnetic sensors to overcome the disadvantage that the geomagnetic sensors in the prior art cannot be automatically calibrated.
[0006] The above technical objectives of the present invention are achieved through the following technical solutions: A geomagnetic sensor automatic calibration method, comprising:
[0007] Acquire the pitch angle data of the geomagnetic sensor, and draw a pitch angle time domain curve corresponding to the pitch angle data;
[0008] Acquire all characteristic points on the pitch angle time domain curve, record the second to last characteristic point as the first characteristic point, and record the last characteristic point as the second characteristic point;
[0009] Obtain a first magnetic field strength corresponding to a first moment where a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment where a second characteristic point is located; and calculate a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength;
[0010] Whether the current first magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the second magnetic field bias is calculated according to the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
[0011] Optionally, the acquiring all characteristic points on the pitch angle time domain curve includes:
[0012] According to a predetermined frequency, a plurality of sampling points are set on the pitch angle time domain curve;
[0013] All two adjacent sampling points are recorded as sampling point pairs; according to the time sequence of the sampling points, the two sampling points in each sampling point pair are recorded as the first sampling point and the second sampling point respectively;
[0014] Obtaining a first-order derivative corresponding to the first sampling point, recorded as a first derivative d1; obtaining a first-order derivative corresponding to the second sampling point, recorded as a second derivative d2;
[0015] It is determined whether the first derivative d1 and the second derivative d2 satisfy d1≤0 and d2>0. If so, the first sampling point is recorded as a feature point; if not, it is determined whether the first derivative d1 and the second derivative d2 satisfy d1<0 and d2≥0. If so, the second sampling point is recorded as a feature point.
[0016] Optionally, the obtaining of a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, obtaining a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculating a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength include:
[0017] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0018] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0019] According to the first magnetic field strength X m1 and the second magnetic field strength X m2 Corresponding calculation of the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz :
[0020] D mx =m x2 -m x1 ;
[0021] D my =m y2 -m y1 ;
[0022] D mz =m z2 -m z1 .
[0023] Optionally, judging whether the current first magnetic field bias of the geomagnetic sensor is valid according to the magnetic field change amount includes:
[0024] Get the first heading angle A1 corresponding to the first feature point yaw And the second heading angle A2 corresponding to the second feature point yaw ; According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz:
[0025] Δz=A2 yaw -A1 yaw ;
[0026] Determine the heading angle change Δz and the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz Whether it meets:
[0027] (Δz>10°)∩(|D mx |≥M T ∪|D my |≥M T ∪|D mz |≥M T );
[0028] If yes, it is determined that the current first magnetic field bias of the geomagnetic sensor is invalid;
[0029] Among them, M T is the preset magnetic field strength change threshold.
[0030] Optionally, the calculating the second magnetic field bias according to the first magnetic field strength and the second magnetic field strength includes:
[0031] Get the first rolling angle A1 corresponding to the first feature point roll 、First pitch angle A1 pitc h and the first heading angle A1 yaw ; Get the second rolling angle A2 corresponding to the second feature point roll 、Second pitch angle A2 pitch And the second heading angle A2 yaw ;
[0032] According to the first rolling angle A1 roll And the second rolling angle A2 roll Calculate the roll angle change Δx:
[0033] Δx=A2 roll -A1 roll ;
[0034] According to the first pitch angle A1 pitch and the second pitch angle A2 pitch Calculate the pitch angle change Δy:
[0035] Δy=A2 pitch -A1 pitch ;
[0036] According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz:
[0037] Δz=A2 yaw -A1 yaw ;
[0038] The spatial position corresponding to the first feature point is used as the reference point to construct the first coordinate system n, and the spatial position of the second feature point is used as the reference point to construct the second coordinate system b. The attitude rotation direction cosine matrix is constructed according to the first coordinate system n and the second coordinate system b.
[0039]
[0040] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0041] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0042] According to the first magnetic field strength X m1 , the second magnetic field strength X m2 And the attitude rotation direction cosine matrix Calculate the second magnetic field bias X m0 :
[0043]
[0044] in, I is the identity matrix:
[0045] Optionally, it also includes: using the second magnetic field bias to compensate for the magnetic field intensity data detected by the geomagnetic sensor to obtain corresponding actual magnetic field intensity data.
[0046] The geomagnetic sensor automatic calibration system includes:
[0047] A time domain curve generating module is used to obtain the pitch angle data of the geomagnetic sensor and to draw a pitch angle time domain curve corresponding to the pitch angle data;
[0048] A feature point calculation module is used to obtain all feature points on the pitch angle time domain curve, record the second to last feature point as the first feature point, and record the last feature point as the second feature point;
[0049] A magnetic field variation calculation module is used to obtain a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculate a magnetic field variation according to the first magnetic field strength and the second magnetic field strength.
[0050] Magnetic field bias calibration module: used to determine whether the current first magnetic field bias of the geomagnetic sensor is valid based on the magnetic field change. If invalid, the second magnetic field bias is calculated based on the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
[0051] The automatic calibration method of the geomagnetic sensor comprises:
[0052] Acquire roll angle data of the geomagnetic sensor, and draw a roll angle time domain curve corresponding to the roll angle data;
[0053] Obtain all characteristic points on the roll angle time domain curve, record the second to last characteristic point as the third characteristic point, and record the last characteristic point as the fourth characteristic point;
[0054] Obtaining a third magnetic field strength corresponding to a third moment at which a third characteristic point is located, and obtaining a fourth magnetic field strength corresponding to a fourth moment at which a fourth characteristic point is located; and calculating a magnetic field variation amount according to the third magnetic field strength and the fourth magnetic field strength;
[0055] Whether the current third magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the fourth magnetic field bias is calculated according to the third magnetic field strength and the fourth magnetic field strength, and the third magnetic field bias is replaced by the fourth magnetic field bias.
[0056] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0057] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0058] In summary, the present invention has the following beneficial effects: This application proposes a method for automatic calibration of geomagnetic sensors, which does not require manual activation and can automatically and real-time calibrate the zero bias parameters of geomagnetic sensors. The implementation method is simple, the calculation amount is low, and it does not require excessive computing resources, which can effectively improve the accuracy of geomagnetic sensor data. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 This is a flow chart of the automatic calibration method of the geomagnetic sensor of the present invention;
[0060] Figure 2 It is a structural diagram of the geomagnetic sensor automatic calibration system of the present invention;
[0061] Figure 3 1 is a diagram showing the internal structure of a computer device in an embodiment of the present invention.
[0062] In the figure: 1. Time domain curve generation module; 2. Feature point calculation module; 3. Magnetic field change calculation module; 4. Magnetic field bias calibration module. DETAILED DESCRIPTION
[0063] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0064] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0065] In the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Moreover, the first feature being "above", "above" and "above" the second feature includes the first feature being directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature includes the first feature being directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature. The terms "vertical", "horizontal", "left", "right", "above", "below" and similar expressions are for illustrative purposes only, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0066] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0067] The present invention provides a method for automatically calibrating a geomagnetic sensor, such as Figure 1 As shown, including:
[0068] Acquire the pitch angle data of the geomagnetic sensor, and draw a pitch angle time domain curve corresponding to the pitch angle data;
[0069] Acquire all characteristic points on the pitch angle time domain curve, record the second to last characteristic point as the first characteristic point, and record the last characteristic point as the second characteristic point;
[0070] Obtain a first magnetic field strength corresponding to a first moment where a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment where a second characteristic point is located; and calculate a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength;
[0071] Whether the current first magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the second magnetic field bias is calculated according to the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
[0072] Specifically, for the attitude solution of the geomagnetic sensor, not only the pitch angle can be monitored, but also the roll angle. However, the heading angle in the attitude solution is affected by the magnetic field, so it is not used for monitoring. The pitch angle time domain curve is drawn corresponding to the pitch angle data, and the horizontal coordinate of the curve is the time change, and the vertical coordinate of the curve is the angle of the pitch angle. Similarly, when the roll angle is monitored, the drawn curve is the roll angle time domain curve, and its horizontal coordinate is the time change, and the vertical coordinate is the roll angle. The present application proposes an automatic calibration method for geomagnetic sensors. The method does not require manual activation, and can automatically and real-time calibrate the zero bias parameters of the geomagnetic sensor. The implementation method is simple, the calculation amount is low, and it does not require excessive computing resources. It can effectively improve the accuracy of geomagnetic sensor data.
[0073] Further, the obtaining of all characteristic points on the pitch angle time domain curve includes:
[0074] According to a predetermined frequency, a plurality of sampling points are set on the pitch angle time domain curve;
[0075] All two adjacent sampling points are recorded as sampling point pairs; according to the time sequence of the sampling points, the two sampling points in each sampling point pair are recorded as the first sampling point and the second sampling point respectively;
[0076] Obtaining a first-order derivative corresponding to the first sampling point, recorded as a first derivative d1; obtaining a first-order derivative corresponding to the second sampling point, recorded as a second derivative d2;
[0077] It is determined whether the first derivative d1 and the second derivative d2 satisfy d1≤0 and d2>0. If so, the first sampling point is recorded as a feature point; if not, it is determined whether the first derivative d1 and the second derivative d2 satisfy d1<0 and d2≥0. If so, the second sampling point is recorded as a feature point.
[0078] In practical applications, the characteristic points in this application use valley points on the curve as characteristic points, and correspondingly, peak points on the curve can also be used as characteristic points. The values corresponding to valley points and peak points have first-order derivatives of 0, so it is also necessary to determine whether each point with a first-order derivative of 0 is a valley point or a peak point according to actual needs.
[0079] Taking this embodiment as an example, a valley point is used as a feature point. Then, it is also necessary to determine whether the first-order derivative of the sampling point on the right side of the sampling point whose first-order derivative is 0 is greater than 0. If it is greater than 0, it means that the sampling point is a valley point, or determine whether the first-order derivative of the sampling point on the left side of the sampling point whose first-order derivative is 0 is less than 0. If it is less than 0, it means that the sampling point is a valley point.
[0080] Taking an example to illustrate the establishment of sampling point pairs, six sampling points are set on the pitch angle time domain curve, namely, P1, P2, P3, P4, P5, and P6; all two adjacent sampling points are recorded as sampling point pairs; then five sampling point pairs are generated: P1P2, P2P3, P3P4, P4P5, and P5P6.
[0081] In this application, the pitch angle time domain curve is a curve obtained by fitting the sampling points of the digital signal, and the characteristic point, that is, the minimum point within a certain range, must correspond to a certain sampling point. Therefore, in the actual judgment process, it is only necessary to judge whether the first-order derivative of a certain sampling point is 0 and according to the sign in front of the derivative of another sampling point, it can be judged whether the point where the derivative is 0 is a valley point or a vertex.
[0082] Furthermore, the obtaining of a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, obtaining a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculating a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength include:
[0083] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0084] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0085] According to the first magnetic field strength X m1 and the second magnetic field strength X m2 Corresponding calculation of the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz :
[0086] D mx =m x2 -m x1 ;
[0087] D my =m y2 -m y1 ;
[0088] D mz =m z2 -m z1 .
[0089] In practical applications, the magnetic field strength detected by the geomagnetic sensor includes all the X-axis magnetic field strength m xn , Y-axis magnetic field strength m yn , Z-axis magnetic field strength m zn Therefore, in the process of calculating the change in magnetic field, the components in the same direction can be directly subtracted to obtain the change in magnetic field in the corresponding direction.
[0090] Further, judging whether the current first magnetic field bias of the geomagnetic sensor is valid according to the magnetic field change amount includes:
[0091] Get the first heading angle A1 corresponding to the first feature point yaw And the second heading angle A2 corresponding to the second feature point yaw ; According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz:
[0092] Δz=A2 yaw -A1 yaw ;
[0093] Determine the heading angle change Δz and the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz Whether it meets:
[0094] (Δz>10°)∩(|D mx |≥M T ∪|D my |≥M T ∪|D mz |≥M T);
[0095] If yes, it is determined that the current first magnetic field bias of the geomagnetic sensor is invalid;
[0096] Among them, M T is the preset magnetic field strength change threshold.
[0097] In practical applications, because the heading angle changes with the magnetic field in attitude solution, its change is monitored to control the frequency of automatic calibration so that the data does not fluctuate frequently. Therefore, only the heading angle is used as a judgment here. T is the preset magnetic field strength change threshold, which is 0.2 Gauss. The above judgment process can be described as follows: when the heading angle change is greater than 10° and the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz When any of the magnetic field changes is greater than a preset threshold, it can be determined that the current magnetic field bias has failed and the magnetic field bias needs to be recalculated.
[0098] Further, the calculating the second magnetic field bias according to the first magnetic field strength and the second magnetic field strength includes:
[0099] Get the first rolling angle A1 corresponding to the first feature point roll 、First pitch angle A1 pitc h and the first heading angle A1 yaw ;
[0100] Get the second rolling angle A2 corresponding to the second feature point roll 、Second pitch angle A2 pitc h and the second heading angle A2 yaw ;
[0101] According to the first rolling angle A1 roll And the second rolling angle A2 roll Calculate the roll angle change Δx:
[0102] Δx=A2 roll -A1 roll ;
[0103] According to the first pitch angle A1 pitc h and the second pitch angle A2 pitc h calculates the pitch angle change Δy:
[0104] Δy=A2 pitc h-A1 pitc h;
[0105] According to the first heading angle A1 yaw And the second heading angle A2 yawCalculate the heading angle change Δz:
[0106] Δz=A2 yaw -A1 yaw ;
[0107] The spatial position corresponding to the first feature point is used as the reference point to construct the first coordinate system n, and the spatial position of the second feature point is used as the reference point to construct the second coordinate system b. The attitude rotation direction cosine matrix is constructed according to the first coordinate system n and the second coordinate system b.
[0108]
[0109] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0110] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0111] According to the first magnetic field strength X m1 , the second magnetic field strength X m2 And the attitude rotation direction cosine matrix Calculate the second magnetic field bias X m0 :
[0112]
[0113] in, I is the identity matrix:
[0114] In practical applications, let the magnetic field bias be X m0 , then when the geomagnetic sensor moves from point n to point b, there is an attitude rotation relationship:
[0115]
[0116] According to the above attitude rotation relationship, the current magnetic field bias should be:
[0117]
[0118] Furthermore, it also includes: using the second magnetic field bias to compensate for the magnetic field intensity data detected by the geomagnetic sensor to obtain corresponding actual magnetic field intensity data.
[0119] In practical applications, the magnetic field strength detected by the geomagnetic sensor includes all the X-axis magnetic field strength m xn , Y-axis magnetic field strength m yn , Z-axis magnetic field strength m zn , then the actual magnetic field strength X mIt should be:
[0120]
[0121] like Figure 2 As shown, the present invention also provides a geomagnetic sensor automatic calibration system, comprising:
[0122] A time domain curve generating module is used to obtain the pitch angle data of the geomagnetic sensor and to draw a pitch angle time domain curve corresponding to the pitch angle data;
[0123] A feature point calculation module is used to obtain all feature points on the pitch angle time domain curve, record the second to last feature point as the first feature point, and record the last feature point as the second feature point;
[0124] A magnetic field variation calculation module is used to obtain a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculate a magnetic field variation according to the first magnetic field strength and the second magnetic field strength.
[0125] Magnetic field bias calibration module: used to determine whether the current first magnetic field bias of the geomagnetic sensor is valid based on the magnetic field change. If invalid, the second magnetic field bias is calculated based on the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
[0126] For the specific definition of the geomagnetic sensor automatic calibration system, please refer to the definition of the geomagnetic sensor automatic calibration method above, which will not be repeated here. Each module in the above-mentioned geomagnetic sensor automatic calibration system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0127] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the automatic calibration method of the geomagnetic sensor is implemented.
[0128] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0130] Acquire the pitch angle data of the geomagnetic sensor, and draw a pitch angle time domain curve corresponding to the pitch angle data;
[0131] Acquire all characteristic points on the pitch angle time domain curve, record the second to last characteristic point as the first characteristic point, and record the last characteristic point as the second characteristic point;
[0132] Obtain a first magnetic field strength corresponding to a first moment where a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment where a second characteristic point is located; and calculate a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength;
[0133] Whether the current first magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the second magnetic field bias is calculated according to the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
[0134] In one embodiment, the acquiring all characteristic points on the pitch angle time domain curve includes:
[0135] According to a predetermined frequency, a plurality of sampling points are set on the pitch angle time domain curve;
[0136] All two adjacent sampling points are recorded as sampling point pairs; according to the time sequence of the sampling points, the two sampling points in each sampling point pair are recorded as the first sampling point and the second sampling point respectively;
[0137] Obtaining a first-order derivative corresponding to the first sampling point, recorded as a first derivative d1; obtaining a first-order derivative corresponding to the second sampling point, recorded as a second derivative d2;
[0138] It is determined whether the first derivative d1 and the second derivative d2 satisfy d1≤0 and d2>0. If so, the first sampling point is recorded as a feature point; if not, it is determined whether the first derivative d1 and the second derivative d2 satisfy d1<0 and d2≥0. If so, the second sampling point is recorded as a feature point.
[0139] In one embodiment, the step of obtaining a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, obtaining a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculating a magnetic field variation amount according to the first magnetic field strength and the second magnetic field strength, includes:
[0140] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0141] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0142] According to the first magnetic field strength X m1 and the second magnetic field strength X m2 Corresponding calculation of the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz :
[0143] D mx =m x2 -m x1 ;
[0144] D my =m y2 -m y1 ;
[0145] D mz =m z2 -m z1 .
[0146] In one embodiment, judging whether the current first magnetic field bias of the geomagnetic sensor is valid according to the magnetic field variation includes:
[0147] Get the first heading angle A1 corresponding to the first feature point yaw And the second heading angle A2 corresponding to the second feature point yaw ; According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz:
[0148] Δz=A2 yaw -A1 yaw ;
[0149] Determine the heading angle change Δz and the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz Whether it meets:
[0150] (Δz>10°)∩(|D mx |≥MT ∪|D my |≥M T ∪|D mz |≥M T );
[0151] If yes, it is determined that the current first magnetic field bias of the geomagnetic sensor is invalid;
[0152] Among them, M T is the preset magnetic field strength change threshold.
[0153] In one embodiment, the calculating the second magnetic field bias according to the first magnetic field strength and the second magnetic field strength includes:
[0154] Get the first rolling angle A1 corresponding to the first feature point roll 、First pitch angle A1 pitch And the first heading angle A1 yaw ; Get the second rolling angle A2 corresponding to the second feature point roll 、Second pitch angle A2 pitch And the second heading angle A2 yaw ;
[0155] According to the first rolling angle A1 roll And the second rolling angle A2 roll Calculate the roll angle change Δx:
[0156] Δx=A2 roll -A1 roll ;
[0157] According to the first pitch angle A1 pitch and the second pitch angle A2 pitch Calculate the pitch angle change Δy:
[0158] Δy=A2 pitch -A1 pitch ;
[0159] According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz:
[0160] Δz=A2 yaw -A1 yaw ;
[0161] The spatial position corresponding to the first feature point is used as the reference point to construct the first coordinate system n, and the spatial position of the second feature point is used as the reference point to construct the second coordinate system b. The attitude rotation direction cosine matrix is constructed according to the first coordinate system n and the second coordinate system b.
[0162]
[0163] Get the first magnetic field strength of the geomagnetic sensor at the first time point
[0164] Obtain the second magnetic field strength of the geomagnetic sensor at the second time point
[0165] According to the first magnetic field strength X m1 , the second magnetic field strength X m2 And the attitude rotation direction cosine matrix Calculate the second magnetic field bias X m0 :
[0166]
[0167] in, I is the identity matrix:
[0168] In one embodiment, the method further includes: using the second magnetic field bias to compensate for the magnetic field intensity data detected by the geomagnetic sensor to obtain corresponding actual magnetic field intensity data.
[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0170] Example 2
[0171] A geomagnetic sensor automatic calibration method, comprising:
[0172] Acquire roll angle data of the geomagnetic sensor, and draw a roll angle time domain curve corresponding to the roll angle data;
[0173] Obtain all characteristic points on the roll angle time domain curve, record the second to last characteristic point as the third characteristic point, and record the last characteristic point as the fourth characteristic point;
[0174] Obtaining a third magnetic field strength corresponding to a third moment at which a third characteristic point is located, and obtaining a fourth magnetic field strength corresponding to a fourth moment at which a fourth characteristic point is located; and calculating a magnetic field variation amount according to the third magnetic field strength and the fourth magnetic field strength;
[0175] Determine whether the third magnetic field bias of the geomagnetic sensor is valid according to the magnetic field change amount; if not, calculate the fourth magnetic field bias according to the third magnetic field strength and the fourth magnetic field strength, and use the fourth magnetic field bias to replace the third magnetic field bias
[0176] Specifically, in this embodiment, the roll angle data of the geomagnetic sensor is monitored and a roll angle time domain curve is drawn. After subsequent judgment steps, the bias data in the geomagnetic sensor can also be calibrated so that the geomagnetic sensor can accurately obtain the current geomagnetic data. For specific subsequent judgment steps, please refer to Example 1.
[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for automatic calibration of a geomagnetic sensor, characterized in that: include: Acquire the pitch angle data of the geomagnetic sensor, and draw a pitch angle time domain curve corresponding to the pitch angle data; Acquire all characteristic points on the pitch angle time domain curve, record the second to last characteristic point as the first characteristic point, and record the last characteristic point as the second characteristic point; Obtain a first magnetic field strength corresponding to a first moment where a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment where a second characteristic point is located; Calculating the magnetic field variation according to the first magnetic field strength and the second magnetic field strength; Whether the current first magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the second magnetic field bias is calculated according to the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
2. The automatic calibration method of geomagnetic sensor according to claim 1, characterized in that: The obtaining of all characteristic points on the pitch angle time domain curve comprises: According to a predetermined frequency, a plurality of sampling points are set on the pitch angle time domain curve; All two adjacent sampling points are recorded as sampling point pairs; according to the time sequence of the sampling points, the two sampling points in each sampling point pair are recorded as the first sampling point and the second sampling point respectively; Obtaining a first-order derivative corresponding to the first sampling point, recorded as a first derivative d1; obtaining a first-order derivative corresponding to the second sampling point, recorded as a second derivative d2; It is determined whether the first derivative d1 and the second derivative d2 satisfy d1≤0 and d2>0. If so, the first sampling point is recorded as a feature point; if not, it is determined whether the first derivative d1 and the second derivative d2 satisfy d1<0 and d2≥0. If so, the second sampling point is recorded as a feature point.
3. The automatic calibration method of geomagnetic sensor according to claim 2, characterized in that: The method comprises obtaining a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, and obtaining a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; Calculating the magnetic field variation according to the first magnetic field strength and the second magnetic field strength includes: Get the first magnetic field strength of the geomagnetic sensor at the first time point Among them, m x1 Indicates the X-axis magnetic field strength at the first moment; m y1 Indicates the Y-axis magnetic field strength at the first moment; m z1 Indicates the magnetic field strength on the Z axis at the first moment; Obtain the second magnetic field strength of the geomagnetic sensor at the second time point m x2 Indicates the X-axis magnetic field strength at the second time point; m y2 Indicates the Y-axis magnetic field strength at the second time point; m z2 Indicates the magnetic field strength along the Z axis at the second time point; According to the first magnetic field strength X m1 and the second magnetic field strength X m2 Corresponding calculation of the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz : D mx =m x2 -m x1 ; D my =m y2 -m y1 ; D mz =m z2 -m z1 。 4. The automatic calibration method of geomagnetic sensor according to claim 3, characterized in that: The step of judging whether the current first magnetic field bias of the geomagnetic sensor is valid according to the magnetic field variation includes: Get the first heading angle A1 corresponding to the first feature point yaw And the second heading angle A2 corresponding to the second feature point yaw ; According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz: <h2 style=";text-align:left;direction:ltr">Δz = A2<h2 style=";text-align:left;direction:ltr"> yaw <h2 style=";text-align:left;direction:ltr"> -A1<h2 style=";text-align:left;direction:ltr"> yaw <h2 style=";text-align:left;direction:ltr"> ; Determine the heading angle change Δz and the X-axis magnetic field change D mx , Y-axis magnetic field change D my , Z-axis magnetic field change D mz Whether it meets: (Δz>10°)∩(|D mx |≥M T ∪|D my |≥M T ∪|D mz |≥M T ); If yes, it is determined that the current first magnetic field bias of the geomagnetic sensor is invalid; Among them, M T is the preset magnetic field strength change threshold.
5. The automatic calibration method of geomagnetic sensor according to claim 1, characterized in that: The calculating the second magnetic field bias according to the first magnetic field strength and the second magnetic field strength comprises: Get the first rolling angle A1 corresponding to the first feature point roll 、First pitch angle A1 pitch And the first heading angle A1 yaw ; Get the second rolling angle A2 corresponding to the second feature point roll 、Second pitch angle A2 pitch And the second heading angle A2 yaw ; According to the first rolling angle A1 roll And the second roll angle A2 roll Calculate the roll angle change Δx: Δx=A2 roll -A1 roll ; According to the first pitch angle A1 pitch and the second pitch angle A2 pitch Calculate the pitch angle change Δy: Δy=A2 pitch -A1 pitch ; According to the first heading angle A1 yaw And the second heading angle A2 yaw Calculate the heading angle change Δz: <h2 style=";text-align:left;direction:ltr">Δz = A2<h2 style=";text-align:left;direction:ltr"> yaw <h2 style=";text-align:left;direction:ltr"> -A1<h2 style=";text-align:left;direction:ltr"> yaw <h2 style=";text-align:left;direction:ltr"> ; The spatial position corresponding to the first feature point is used as the reference point to construct the first coordinate system n, and the spatial position of the second feature point is used as the reference point to construct the second coordinate system b. The attitude rotation direction cosine matrix is constructed according to the first coordinate system n and the second coordinate system b. Get the first magnetic field strength of the geomagnetic sensor at the first time point Obtain the second magnetic field strength of the geomagnetic sensor at the second time point According to the first magnetic field strength X m1 , the second magnetic field strength X m2 And the attitude rotation direction cosine matrix Calculate the second magnetic field bias X m0 : in, I is the identity matrix: m x0 Indicates the X-axis magnetic field strength at the initial time point; m y0 Indicates the Y-axis magnetic field strength at the initial time point; m z0 Indicates the Z-axis magnetic field strength at the initial time point.
6. The automatic calibration method of geomagnetic sensor according to claim 1, characterized in that: Also includes: The magnetic field intensity data detected by the geomagnetic sensor is compensated by using the second magnetic field bias to obtain corresponding actual magnetic field intensity data.
7. The geomagnetic sensor automatic calibration system is characterized by: include: A time domain curve generating module is used to obtain the pitch angle data of the geomagnetic sensor and to draw a pitch angle time domain curve corresponding to the pitch angle data; A feature point calculation module is used to obtain all feature points on the pitch angle time domain curve, record the second to last feature point as the first feature point, and record the last feature point as the second feature point; A magnetic field variation calculation module is used to obtain a first magnetic field strength corresponding to a first moment at which a first characteristic point is located, and obtain a second magnetic field strength corresponding to a second moment at which a second characteristic point is located; and calculate a magnetic field variation according to the first magnetic field strength and the second magnetic field strength. Magnetic field bias calibration module: used to determine whether the current first magnetic field bias of the geomagnetic sensor is valid based on the magnetic field change. If invalid, the second magnetic field bias is calculated based on the first magnetic field strength and the second magnetic field strength, and the first magnetic field bias is replaced by the second magnetic field bias.
8. A method for automatic calibration of a geomagnetic sensor, characterized in that: include: Acquire roll angle data of the geomagnetic sensor, and draw a roll angle time domain curve corresponding to the roll angle data; Obtain all characteristic points on the roll angle time domain curve, record the second to last characteristic point as the third characteristic point, and record the last characteristic point as the fourth characteristic point; Obtain a third magnetic field strength corresponding to a third moment where the third characteristic point is located, and obtain a fourth magnetic field strength corresponding to a fourth moment where the fourth characteristic point is located; Calculating the magnetic field variation according to the third magnetic field strength and the fourth magnetic field strength; Whether the current third magnetic field bias of the geomagnetic sensor is valid is determined according to the magnetic field change amount. If invalid, the fourth magnetic field bias is calculated according to the third magnetic field strength and the fourth magnetic field strength, and the third magnetic field bias is replaced by the fourth magnetic field bias.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 or 8 are implemented.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 or 8 are implemented.
Citation Information
Patent Citations
Electronic compass
CN102197277A
Interference-resistant method for heading attitude resolving and compass calibration
CN109238262A