A Multi-Sensor Data Fusion Method for Hollow Magnetic Encoders
By setting up multiple magnetic sensors on the hollow magnetic encoder, the original data is periodically acquired and processed, and data fusion is fusion using the average value and calibration steps, the problem of multi-sensor data fusion is solved, and the angle output with higher accuracy is achieved.
Patent Information
- Application Number
- CN202410651281.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-05-24
AI Technical Summary
How to fuse multiple magnetic sensor raw data with general accuracy and linearity into a hollow magnetic encoder output data with higher accuracy and linearity to solve the problem of multi-sensor data fusion.
By setting up multiple magnetic sensors on the hollow magnetic encoder, the original single-turn absolute value angle data is periodically obtained, the initial difference and data change amount are calculated, the data is fused using the average value and calibration steps, and the accurate angle value is finally output.
The effective fusion of multi-magnetic sensor data is realized, the angle output accuracy of the hollow magnetic encoder is improved, data error is reduced, the algorithm process is simplified, and computing resource consumption is reduced.
Smart Images

Figure CN118585951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data fusion, and particularly relates to a multi-sensor data fusion method for a hollow magnetic encoder. Background Art
[0002] A hollow magnetic encoder is a high-precision rotary encoder that can accurately detect and measure the rotation angle and speed of a control device, and is widely used in industrial automation, machinery manufacturing, industrial robots, humanoid robots and leg robot joints, numerical control machine tools, wind turbines, aerospace and other fields. At the same time, it can also remotely transmit the current orientation and convert the motion speed, which is particularly important for the use of equipment such as frequency converters and stepping motors. At the same time, the hollow encoder also has the advantages of convenience, safety, and long life on-site, which can reduce the trouble of mechanical devices and avoid being damaged, high temperature, water vapor, etc.
[0003] To ensure the overall accuracy of the hollow magnetic encoder, multiple magnetic sensors are generally arranged at equal intervals around the ring magnet, and more accurate position information is obtained by fusing the data of multiple sensors. However, in actual situations, although multiple sensors can improve the overall accuracy of the magnetic encoder, they also bring problems of multi-sensor data fusion. Therefore, how to fuse the original data of multiple sensors with general accuracy and linearity into the output data of a hollow magnetic encoder with higher accuracy and linearity has become an urgent problem to be solved. Summary of the Invention
[0004] The purpose of the present invention is to provide a multi-sensor data fusion method for a hollow magnetic encoder to solve the above technical problems.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A multi-sensor data fusion method for a hollow magnetic encoder includes the following steps:
[0007] S1: Set n magnetic sensors on the hollow magnetic encoder at a preset fixed distance interval, where n is a preset value, and after the hollow magnetic encoder is powered on, obtain the original single-turn absolute value angle data of the magnetic sensors, and calculate the angle value of the magnetic sensors \(A_n = A_n(0)\pm(n - 1)*(360 / n)\), where \(A_n\) represents the angle value of the hollow magnetic encoder calculated by the nth magnetic sensor, \(A_n\) represents the original single-turn absolute value angle data of the nth magnetic sensor, and perform a calibration step to obtain an initial vector;
[0008] Execute the first calibration step to obtain an angle calibration value, and calculate the initial angle value of the hollow magnetic encoder \(A(0)=(A_1'+A_2'+…+A_n') / n\), where \(A_n'\) represents the angle calibration value of the nth magnetic sensor;
[0009] S2: Periodically obtain the original single-turn absolute angle data of the magnetic sensor, and calculate the initial difference DAn(i) = An(i) - An(i - 1), where DAn(i) represents the initial difference of the nth magnetic sensor when the original single-turn absolute angle data of the magnetic sensor is obtained for the ith time, An(i) represents the original single-turn absolute angle data of the nth magnetic sensor obtained for the ith time, and perform a preset second calibration step to obtain the data change amount;
[0010] S3: Calculate the final output angle A(i) of the hollow magnetic encoder when the original single-turn absolute angle data of the magnetic sensor is obtained for the ith time, A(i) = A(i - 1) + ((DA1(i)' + DA2(i)' + … + DAn(i)') / n), where DAn(i)' represents the data change amount of the nth magnetic sensor.
[0011] As a further solution of the present invention: in the step S1, the calibration step specifically includes:
[0012] Slowly adjust the angle of the hollow magnetic encoder from 0 at a preset speed, record the angle values of the magnetic sensor at each angle, and generate an n-dimensional vector Dα = (A_1α, A_2α, …, A_nα) at each angle, denoted as the initial vector, where A_nα represents the angle value of the nth magnetic sensor when the angle of the hollow magnetic encoder is α.
[0013] As a further solution of the present invention: the first calibration step specifically includes:
[0014] When A_n - A_1 > 180°, then A_n' = A_n - 360°;
[0015] When A_n - A_1 < -180°, then A_n' = A_n + 360°;
[0016] Except for the above two cases, A_n' = A_n.
[0017] As a further solution of the present invention: the second calibration step specifically includes:
[0018] When DAn(i) > 180°, then DAn(i)' = DAn(i) - 360°, where DAn(i)' represents the data change amount of the nth magnetic sensor;
[0019] When DAn(i) < -180°, then DAn(i)' = DAn(i) + 360°;
[0020] Except for the above two cases, DAn(i)' = DAn(i).
[0021] As a further solution of the present invention: in the step S3, the following steps are further included:
[0022] When A(i) > 360°, let A(i) = A(i) - 360°;
[0023] When A(i) < 0°, let A(i) = A(i) + 360°.
[0024] As a further solution of the present invention: in the step S3, the following steps are further included:
[0025] Obtain the angle values of each magnetic sensor, generate an n-dimensional vector as a comparison vector, determine the initial vector corresponding to the final output angle of the hollow magnetic encoder as a reference vector, and calculate the cosine value of the angle between the initial vector and the reference vector through the cosine formula of the included angle;
[0026] When the cosine value of the included angle is less than or equal to the preset cosine value threshold, calculate the cosine value of the angle between the reference vector and the initial vector through the cosine formula of the included angle, and obtain the angle of the hollow magnetic encoder corresponding to when the cosine value is 1 as the final output angle obtained in the i-th time.
[0027] As a further solution of the present invention: when there is no cosine value of 1 between the reference vector and the initial vector, obtain the maximum value of the cosine value, and use the angle of the hollow magnetic encoder corresponding to the maximum value as the final output angle obtained in the i-th time.
[0028] As a further solution of the present invention: when the maximum value of the cosine value is less than the preset cosine value threshold, send a warning message for error reporting.
[0029] The beneficial effects of the present invention: In the solution of the present invention, the data fusion effect is obvious, and the original data of multiple magnetic sensors can be fully fused. Utilize its uniform distribution characteristics in space to cancel out some non-linear errors of magnetic sensors with each other. At the same time, use multiple magnetic sensors to improve the angle output accuracy of the hollow magnetic encoder and reduce data errors; by calculating the angle change value between the previous and next cycles of the magnetic sensor, convert the absolute angle information into a relative change amount, and average the relative change amounts of multiple sensors to obtain the angle change value of the hollow magnetic encoder; obtain the final angle output value through the summation of the angle change values and the angle range constraint; convert the absolute value data of the magnetic sensor into incremental value processing, and the subsequent algorithm process is simple, without the need to frequently process the problem of the absolute angle value of the original magnetic sensor crossing the circle, with small consumption of computing resources and low application cost of the algorithm. The present invention can fuse the original data of multiple sensors with general accuracy and linearity to improve the measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described below with reference to the accompanying drawings.
[0031] Figure 1 It is a schematic flow diagram of a multi-sensor data fusion method for a hollow magnetic encoder according to the present invention. Specific embodiments
[0032] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0033] Please refer to Figure 1 As shown, the present invention is a multi-sensor data fusion method for a hollow magnetic encoder, including the following steps:
[0034] S1: Set n magnetic sensors on the hollow magnetic encoder at a preset fixed distance interval, where n is a preset value. After the hollow magnetic encoder is powered on, obtain the original single-turn absolute value angle data of the magnetic sensors, and calculate the angle value of the magnetic sensors A_n = An(0) ± (n - 1) * (360 / n), where A_n represents the angle value of the hollow magnetic encoder calculated by the nth magnetic sensor, An represents the original single-turn absolute value angle data of the nth magnetic sensor, and perform a calibration step to obtain an initial vector;
[0035] Perform a first calibration step to obtain an angle calibration value, and calculate the initial angle value A(0) of the hollow magnetic encoder = (A_1' + A_2' +... + A_n') / n, where A_n' represents the angle calibration value of the nth magnetic sensor;
[0036] S2: Periodically obtain the original single-turn absolute value angle data of the magnetic sensors, and calculate the initial difference DAn(i) = An(i) - An(i - 1), where DAn(i) represents the initial difference of the nth magnetic sensor when the original single-turn absolute value angle data of the magnetic sensors is obtained for the i-th time, An(i) represents the original single-turn absolute value angle data of the nth magnetic sensor obtained for the i-th time, and perform a preset second calibration step to obtain a data change amount;
[0037] S3: Calculate the final output angle A(i) of the hollow magnetic encoder when the original single-turn absolute value angle data of the magnetic sensors is obtained for the i-th time = A(i - 1) + ((DA1(i)' + DA2(i)' +... + DAn(i)') / n), where DAn(i)' represents the data change amount of the nth magnetic sensor.
[0038] It should be noted that in the solution of the present invention, the data fusion effect is obvious, and the original data of multiple magnetic sensors can be fully fused. By using the uniform distribution characteristic in space, the partial non-linear errors of the magnetic sensors can be mutually cancelled. At the same time, the angle output accuracy of the hollow magnetic encoder is improved by using multiple magnetic sensors, and the data error is reduced. By calculating the angle change value of the magnetic sensor in the previous and subsequent two cycles, the absolute angle information is converted into a relative change amount, and the relative change amounts of multiple sensors are averaged to obtain the angle change value of the hollow magnetic encoder. The final angle output value is obtained after summing the angle change values and restricting the angle range. The absolute value data of the magnetic sensor is converted into an incremental value for processing, and the subsequent algorithm process is simple. There is no need to frequently process the problem of the absolute angle value of the original magnetic sensor crossing the circle band, the consumption of computing resources is small, and the application cost of the algorithm is low.
[0039] In another preferred embodiment of the present invention, in the step S1, the calibration step specifically includes:
[0040] Slowly adjust the angle of the hollow magnetic encoder from 0 at a preset speed, record the angle values of the magnetic sensors at each angle, and generate an n-dimensional vector Dα=(A_1α, A_2α,..., A_nα) at each angle, denoted as the initial vector, where A_nα represents the angle value of the nth magnetic sensor when the angle of the hollow magnetic encoder is α.
[0041] In another preferred embodiment of the present invention, the first calibration step specifically includes:
[0042] When A_n - A_1 > 180°, then A_n' = A_n - 360°;
[0043] When A_n - A_1 < -180°, then A_n' = A_n + 360°;
[0044] In addition to the above two cases, A_n' = A_n.
[0045] In another preferred embodiment of the present invention, the second calibration step specifically includes:
[0046] When DAn(i) > 180°, then DAn(i)' = DAn(i) - 360°, where DAn(i)' represents the data change amount of the nth magnetic sensor;
[0047] When DAn(i) < -180°, then DAn(i)' = DAn(i) + 360°;
[0048] In addition to the above two cases, DAn(i)' = DAn(i).
[0049] In another preferred embodiment of the present invention, in the step S3, the following steps are further included:
[0050] When A(i) > 360°, let A(i) = A(i) - 360°;
[0051] When A(i) < 0°, let A(i) = A(i) + 360°.
[0052] In another preferred embodiment of the present invention, in step S3, the following steps are further included:
[0053] Obtain the angular values of each magnetic sensor, generate an n-dimensional vector as a comparison vector, determine the initial vector corresponding to the final output angle of the hollow magnetic encoder as a reference vector, and calculate the cosine value of the angle between the initial vector and the reference vector through the cosine formula of the included angle;
[0054] When the cosine value of the included angle is less than or equal to the preset cosine value threshold, calculate the cosine value of the angle between the reference vector and the initial vector through the cosine formula of the included angle, and obtain the angle of the hollow magnetic encoder corresponding to when the cosine value is 1 as the final output angle obtained for the i-th time.
[0055] It can be understood that when the cosine value of the included angle is less than or equal to the preset cosine value threshold, it indicates that there is a large deviation between the calculated final output angle and the theoretical value. Therefore, the calculated final output angle is adjusted to the angle of the hollow magnetic encoder corresponding to when the cosine value is 1 to ensure the accuracy of the measurement.
[0056] In another preferred embodiment of the present invention, when there is no cosine value of 1 between the reference vector and the initial vector, obtain the maximum value of the cosine value, and use the angle of the hollow magnetic encoder corresponding to the maximum value as the final output angle obtained for the i-th time.
[0057] In another preferred embodiment of the present invention, when the maximum value of the cosine value is less than the preset cosine value threshold, send a warning message for error reporting.
[0058] It should be noted that at this time, it indicates that the initial vectors corresponding to the hollow magnetic encoder at all angles are different from the comparison vector corresponding to the calculated final output angle, which may be caused by a malfunction of the magnetic sensor, etc. Therefore, error reporting is required.
[0059] The above has described a detailed description of an embodiment of the present invention, but the content described above is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. Any equal changes and improvements made within the scope of the application of the present invention should still fall within the scope covered by the patent of the present invention.
Claims
1. A hollow magnetic encoder multi-sensor data fusion method, characterized in that: The following steps are involved: S1: n magnetic sensors are arranged on the hollow magnetic encoder at a preset fixed distance interval, where n is a preset value, and the original single-turn absolute angle data of the magnetic sensor is obtained after the hollow magnetic encoder is powered on, and the angle value A_n = An(0)±(n-1) *(360 / n) of the magnetic sensor is calculated, where A_n represents the angle value of the hollow magnetic encoder calculated by the nth magnetic sensor, and An represents the original single-turn absolute angle data of the nth magnetic sensor, and a calibration step is performed to obtain an initial vector; Perform the first calibration step to obtain an angle calibration value, and calculate the initial angle value A(0) of the hollow magnetic encoder = (A_1'+A_2'+…+A_n') / n, where A_n' represents the angle calibration value of the nth magnetic sensor; S2: periodically obtain the original single-turn absolute angle data of the magnetic sensor, and calculate the initial difference DAn(i)=An(i)-An(i-1), wherein DAn(i) represents the initial difference of the nth magnetic sensor when the original single-turn absolute angle data of the magnetic sensor is obtained for the i-th time, and An(i) represents the original single-turn absolute angle data of the nth magnetic sensor obtained for the i-th time, and execute the preset second calibration step to obtain the data change; S3: Calculate the final output angle A(i) of the hollow magnetic encoder when the original single-turn absolute angle data of the magnetic sensor is obtained for the i-th time, which is A(i-1)+((DA1(i)'+DA2(i)'+…+DAn(i)') / n), where DAn(i)' represents the data change of the n-th magnetic sensor; The first calibration step specifically includes: When A_n -A_1>180°, then A_n'= A_n-360°; When A_n -A_1<-180°, then A_n'=A_n+360°; Except for the above two cases, A_n'=A_n; The second calibration step specifically includes: When DAn(i)>180°, DAn(i)'=DAn(i)-360°, and DAn(i)' represents the data change of the nth magnetic sensor; When DAn(i)<-180°, then DAn(i)'=DAn(i)+360°; Except for the above two cases, DAn(i)'=DAn(i).
2. A hollow magnetic encoder multi-sensor data fusion method according to claim 1, characterized in that: In the step S1, the calibration step specifically includes: The angle of the hollow magnetic encoder is slowly adjusted from 0 at a preset speed, and the angle value of the magnetic sensor at each angle is recorded, and an n-dimensional vector Dα=(A_1α, A_2α, …, A_nα) is generated at each angle, recorded as an initial vector, where A_nα represents the angle value of the nth magnetic sensor when the angle of the hollow magnetic encoder is α.
3. The hollow magnetic encoder multi-sensor data fusion method according to claim 1 is characterized in that: The step S3 further includes the following steps: When A(i)>360°, let A(i)=A(i)-360°; When A(i)<0°, let A(i)=A(i)+360°.
4. The hollow magnetic encoder multi-sensor data fusion method according to claim 1 is characterized in that: The step S3 further includes the following steps: Obtain the angle value of each magnetic sensor and generate an n-dimensional vector as a comparison vector, determine an initial vector corresponding to the final output angle of the hollow magnetic encoder as a reference vector, and calculate the cosine value of the angle between the initial vector and the reference vector by using the angle cosine formula; When the cosine value of the angle is less than or equal to the preset cosine value threshold, the cosine value of the angle between the reference vector and the initial vector is calculated using the angle cosine formula, and the angle of the hollow magnetic encoder corresponding to the cosine value of 1 is obtained as the final output angle obtained for the i-th time.
5. A hollow magnetic encoder multi-sensor data fusion method according to claim 4, characterized in that: When there is no cosine value of 1 between the reference vector and the initial vector, the maximum value of the cosine value is obtained, and the angle of the hollow magnetic encoder corresponding to the maximum value is used as the final output angle obtained for the i-th time.
6. A hollow magnetic encoder multi-sensor data fusion method according to claim 5, characterized in that: When the maximum value of the cosine value is less than a preset cosine value threshold, an early warning message is sent to report an error.
Citation Information
Patent Citations
Magnetic encoder, calibration method and device for magnetic encoder, motor and unmanned aerial vehicle
CN109655083A