Sensor Error Compensation Method, System and Storage Medium Based on Function Simulation
By testing the distance error in the laser ranging sensor, a suitable quadratic polynomial and Gaussian process regression error compensation model is constructed, which solves the problem that the laser ranging sensor is not reasonable enough under different length conditions, and achieves a more efficient error compensation effect.
Patent Information
- Application Number
- CN202510378876.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The existing laser ranging sensor error compensation technology cannot effectively reduce ranging errors under different length conditions, resulting in the laser ranging results that cannot effectively reduce errors within a certain length range.
By testing the distance error between the output distance and the real distance of the laser ranging sensor at different distances, the distance range applicable to the quadratic polynomial model is determined, and a quadratic polynomial error compensation model is constructed; for the distance range that does not apply to the quadratic polynomial model, Gaussian process regression is used to construct the error compensation model.
It improves the accuracy and comprehensiveness of the error compensation of laser ranging sensors, and can more effectively reduce the ranging error under different length conditions, and improves the accuracy and stability of measurement.
Smart Images

Figure CN119881851B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser ranging sensor error compensation, and specifically to a sensor error compensation method, system and storage medium based on function simulation. Background Art
[0002] The laser ranging sensor error compensation technology refers to a technology that actively identifies and corrects the deviation between the output value of the laser ranging sensor and the true distance through mathematical modeling, algorithm design or hardware adjustment. Its core goal is to eliminate or reduce the systematic errors caused by the characteristics of the sensor itself, environmental interference or measurement conditions, so as to improve the accuracy, stability and reliability of the measurement.
[0003] The existing laser ranging sensor error compensation technologies usually adopt traditional linear correction compensation or other methods to compensate the ranging results of the full length. However, when the laser ranging sensor is at a short distance, due to problems such as laser spot distortion and nonlinear response of the receiver, the traditional linear correction compensation fails, and the error distribution of ranging is also different under different lengths. It is impossible to correct the ranging results to the correct length through a unified compensation model. For example, in the patent application with the publication number CN108226942A, "a ranging method and an electronic laser ranging module for determining the distance to a target object" is disclosed. This solution compensates the error of the laser ranging result through a single error compensation method. However, under different length conditions, the error distribution of laser ranging has different laws, and a single model cannot effectively reduce the ranging error in the full scenario. The existing laser ranging sensor error compensation technologies also have the problem that the error compensation methods for different length conditions are not reasonable enough, resulting in the inability to effectively reduce the error of the laser ranging result within a certain length range. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems in the prior art to some extent. By testing the distance error between the output distance and the true distance of the laser ranging sensor at different distances, then determining the distance range applicable to the quadratic polynomial model and constructing a quadratic polynomial error compensation model, and then using Gaussian process regression to perform regression on the distance range not applicable to the quadratic polynomial model to construct a Gaussian process regression error compensation model, and finally verifying whether the error compensation model is effective, so as to solve the problem that the existing laser ranging sensor error compensation technologies have unreasonable error compensation methods for different length conditions, resulting in the inability to effectively reduce the error of the laser ranging result within a certain length range.
[0005] To achieve the above object, in the first aspect, the present application provides a sensor error compensation method based on function simulation, including the following steps:
[0006] Test the distance error between the output distance and the true distance of the laser ranging sensor at different distances;
[0007] Compensate different distances with different error compensation models based on the distance error;
[0008] Verify whether the error compensation model is effective.
[0009] Furthermore, testing the distance error between the output distance and the true distance of the laser ranging sensor at different distances includes the following sub-steps:
[0010] Set up a high-precision guide rail platform to control the distance between the laser ranging sensor and the baffle;
[0011] Set the starting distance and the ending distance, and at the same time set the interval step size. Control the distance between the laser ranging sensor and the baffle to be equal to the starting distance, obtain the output data of the laser ranging sensor, name it the output distance, and at the same time name the distance between the laser ranging sensor and the baffle the true distance;
[0012] Increase the true distance by the interval step size and record the output distance again. Repeat the increase until the true distance is equal to the ending distance, and then stop increasing after recording the output distance;
[0013] Mark the true distances in ascending order as DT n and mark the corresponding output distances as DR n where n is a positive integer and n is the serial number of DT and DR;
[0014] Calculate DT n - DR n and name the calculation result the distance error, marked as DE n .
[0015] Furthermore, compensating different distances with different error compensation models based on the distance error includes the following sub-steps:
[0016] Determine the distance range applicable to the quadratic polynomial model and construct a quadratic polynomial error compensation model;
[0017] Use Gaussian process regression to perform regression on the distance range not applicable to the quadratic polynomial model and construct a Gaussian process regression error compensation model.
[0018] Furthermore, determining the distance range applicable to the quadratic polynomial model and constructing a quadratic polynomial error compensation model includes the following sub-steps:
[0019] Take n as the X-axis and DE n as the Y-axis to establish a plane rectangular coordinate system, named the quadratic polynomial error regression graph;
[0020] Set the isolation number, denoted as m, where m is a positive integer and is initially set to 2. Mark the range [1, m] as i;
[0021] Enter DE i into the quadratic polynomial error regression graph according to n. Among them, DE i is the DE when n = i n ;
[0022] Perform quadratic polynomial regression on the quadratic polynomial error regression graph. Name the regression - obtained function as the quadratic polynomial error regression function, and obtain the standard deviation of the quadratic polynomial error regression function;
[0023] Increment m by one and analyze the quadratic polynomial error regression function and the standard deviation again. Repeat the execution until m = max(n), where max() is the maximum operator;
[0024] Sort and number the standard deviations in ascending order of m, denoted by the symbol S j . Among them, j is a positive integer and is the serial number of S. When j = 1, it corresponds to m = 2, and the value range of j is 1 ≤ j ≤ max(n) - 1;
[0025] Based on the calculated different standard deviations, analyze the applicable distance range of the quadratic polynomial model and construct a quadratic polynomial error compensation model.
[0026] Furthermore, based on the calculated different standard deviations, analyzing the applicable distance range of the quadratic polynomial model and constructing a quadratic polynomial error compensation model includes the following sub - steps:
[0027] Starting from j = 2, calculate |S j -S j-1 |, mark the calculation result as H j , then increment j by 1 and recalculate H j , repeat the execution until j = max(j);
[0028] Set the value q, where q is initially 3. Starting from j ≤ q, obtain the value range of H j , mark it as the fluctuation range, obtain the difference between the maximum value and the minimum value in the fluctuation range, mark it as the fluctuation value, denoted by the symbol G1. Obtain the number of H j within the fluctuation range, mark it as the fluctuation quantity, denoted by the symbol G2. Calculate G2 / G1, and mark the calculation result as the fluctuation density, denoted by the symbol F q ;
[0029] Increment q by 1 and recalculate F q , until q = max(j) - 1, and search for Fq The maximum value in Q is marked as the maximum fluctuation density, and the value of q for the maximum fluctuation density is obtained and marked as Q. At this time, S Q The corresponding standard deviation is the best standard deviation of the quadratic polynomial error compensation model, where S j corresponding to j = Q. S
[0030] Obtain DT M and mark it as the maximum applicable value, where DT M represents DT when n = M n The distance range less than or equal to the maximum applicable value is marked as the applicable range, and the quadratic polynomial error regression function calculated when i is in [1, M] is marked as the quadratic polynomial error compensation model.
[0031] Furthermore, Gaussian process regression is used to perform regression on the distance range that does not apply to the quadratic polynomial model, and constructing the Gaussian process regression error compensation model includes the following sub-steps:
[0032] The distance range greater than the applicable range and less than or equal to the termination distance is named the Gaussian range;
[0033] Construct a Gaussian process regression error compensation model, and use the Matern5 / 2 kernel to perform model training on DT n and DR n within the Gaussian range.
[0034] Furthermore, verifying whether the error compensation model is effective includes the following sub-steps:
[0035] Randomly collect the test distances of the first test quantity between the starting distance and the termination distance, and record the test actual distances corresponding to the test distances at the same time;
[0036] Find the distance interval to which the test distance belongs. If the test distance is within the applicable range, use the quadratic polynomial error compensation model to perform error compensation on the test distance, otherwise use the Gaussian process regression error compensation model to perform error compensation on the test distance;
[0037] If the quadratic polynomial error compensation model is used to perform error compensation on the test distance, then substitute DE n equal to the test distance into the quadratic polynomial error compensation model, and add the test distance to the result output by the quadratic polynomial error compensation model to obtain the predicted compensation distance;
[0038] If the Gaussian process regression error compensation model is used to perform error compensation on the test distance, then use DR nSubstitute the test distance into the Gaussian process regression error compensation model to obtain the result output by the Gaussian process regression error compensation model, and obtain the predicted compensation distance;
[0039] Use the traditional linear correction compensation technology to compensate the error of the test distance, and mark the compensated result as the traditional compensation distance;
[0040] Based on the traditional compensation distance, the predicted compensation distance, and the actual test distance, verify the effectiveness of the error compensation model.
[0041] Further, based on the traditional compensation distance, the predicted compensation distance, and the actual test distance, verifying the effectiveness of the error compensation model includes the following sub-steps:
[0042] Calculate the absolute value of the difference between the predicted compensation distance and the actual test distance, and mark it as the post-compensation error;
[0043] Calculate the absolute value of the difference between the traditional compensation distance and the actual test distance, and mark it as the traditional compensation error;
[0044] Calculate the average value of the post-compensation error, name it the post-compensation average error, calculate the average value of the traditional compensation error, and name it the traditional compensation average error;
[0045] Mark the post-compensation average error as W1, mark the traditional compensation average error as W2, compare W1 with W2, if W1 is less than W2, then output a compensation valid signal, otherwise output a compensation invalid signal;
[0046] Calculate W1 / W2, and name the calculation result as the performance improvement percentage.
[0047] In a second aspect, the present application provides a sensor error compensation system based on function simulation, including an error test module, an error compensation module, and a validity verification module; the error test module and the validity verification module are respectively connected to the error compensation module for data connection;
[0048] The error test module is used to test the distance error between the output distance and the true distance of the laser ranging sensor at different distances;
[0049] The error compensation module is used to compensate different distances with different error compensation models based on the distance error;
[0050] The validity verification module is used to verify whether the error compensation model is effective.
[0051] In a third aspect, the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, it runs the steps in the above method.
[0052] Advantages of the present invention: By testing the distance error between the output distance and the true distance of the laser ranging sensor at different distances, the present invention determines the distance range applicable to the quadratic polynomial model and constructs a quadratic polynomial error compensation model. Then, Gaussian process regression is used to perform regression on the distance range not applicable to the quadratic polynomial model to construct a Gaussian process regression error compensation model. The advantage is that through multiple tests, it is found that at close distances, the error of laser ranging first shows a quadratic polynomial distribution and then exhibits complex fluctuations, making it difficult to compensate with conventional methods. Therefore, it is particularly important to find the boundary between these two distributions. Only by correctly finding the boundary between them can different distance ranges be correctly distinguished, so as to configure different error compensation models for different distance ranges, improving the accuracy and comprehensiveness of the error compensation of the laser ranging sensor;
[0053] After configuring the error compensation model, the present invention verifies whether the error compensation model is effective. The advantage is that by comparing the error compensation at close distances with the traditional linear error correction compensation model, it is verified whether the error compensation model is effective, and at the same time, the improvement amplitude of the error compensation performance is calculated, which can more intuitively show the effectiveness of the error compensation model, improving the accuracy and effectiveness of the error compensation of the laser ranging sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a schematic block diagram of the system of the present invention;
[0055] Figure 2 is a quadratic polynomial error regression diagram of the present invention;
[0056] Figure 3 is a step flow chart of the method of the present invention;
[0057] Figure 4 is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to 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 of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0059] Embodiment 1. Please refer to Figure 1 As shown, the present application provides a sensor error compensation system based on function simulation, including an error testing module, an error compensation module, and a validity verification module; the error testing module and the validity verification module are respectively connected to the error compensation module for data connection;
[0060] The error test module is used to test the distance error between the output distance and the true distance of the laser ranging sensor at different distances;
[0061] The error test module is configured with an error test strategy, and the error test strategy includes:
[0062] Set up a high-precision guide rail platform to control the distance between the laser ranging sensor and the baffle;
[0063] Set the starting distance and the ending distance, and at the same time set the interval step size. Control the distance between the laser ranging sensor and the baffle to be equal to the starting distance, obtain the output data of the laser ranging sensor, name it the output distance, and at the same time name the distance between the laser ranging sensor and the baffle the true distance;
[0064] Increase the true distance by the interval step size and record the output distance again. Repeat the increase until the true distance is equal to the ending distance, then stop increasing after recording the output distance;
[0065] Mark the true distance in ascending order as DT n , mark the corresponding output distance as DR n , where n is a positive integer and n is the serial number of DT and DR;
[0066] Calculate DT n - DR n , name the calculation result the distance error, and mark it as DE n ;
[0067] In practical applications, an existing high-precision guide rail platform is used to control the distance between the laser ranging sensor and the baffle. It is found in multiple tests that when it is less than one meter, due to problems such as laser spot distortion and non-linear response of the receiver, the output value of the sensor and the actual distance show a significant non-linear relationship, and the traditional linear calibration method cannot effectively compensate. A high-order non-linear model needs to be adopted. Therefore, the ending distance is set to 1m, the starting distance is set to 0.1m, and the interval step size is set to 0.01m. There are a total of 90 sampling points, and DT n and DR n are obtained, where 1 ≤ n ≤ 90, and 90 copies of DE n are also obtained; due to the excessive amount of data, the specific data is not shown in this embodiment.
[0068] The error compensation module is used to compensate different distances with different error compensation models based on the distance error; the error compensation module includes a boundary determination unit and a Gaussian process regression unit;
[0069] The boundary determination unit is used to determine the distance range applicable to the quadratic polynomial model and construct a quadratic polynomial error compensation model;
[0070] The boundary determination unit is configured with a boundary determination strategy, and the boundary determination strategy includes:
[0071] Please refer to Figure 2 As shown, taking n as the X-axis and DE n as the Y-axis, establish a plane rectangular coordinate system, named the quadratic polynomial error regression graph;
[0072] Set the isolation number, marked as m, where m is a positive integer, initially set to 2, and mark the range [1, m] as i;
[0073] Input DE i into the quadratic polynomial error regression graph according to n. Among them, DE i is the DE when n = i n ;
[0074] Perform quadratic polynomial regression on the quadratic polynomial error regression graph, name the regression function obtained as the quadratic polynomial error regression function, and obtain the standard deviation of the quadratic polynomial error regression function;
[0075] Add 1 to m and analyze the quadratic polynomial error regression function and the standard deviation again, and repeat the execution until m = max(n), where max() is the maximum operator;
[0076] Sort and number the standard deviations in ascending order of m, represented by the symbol S j . Among them, j is a positive integer and j is the serial number of S. When j = 1, it corresponds to m = 2, and the value range of j is 1 ≤ j ≤ max(n) - 1;
[0077] In practical applications, for example, when m = 31, i is [1, 31], input DE1 to DE 31 into the quadratic polynomial error regression graph to obtain Figure 2 . At this time, perform quadratic polynomial regression on Figure 2 to obtain the quadratic polynomial error regression function, and obtain its standard deviation as 0.006. Analyze each value of m to obtain 89 standard deviations, which correspond to the analysis results under the value conditions of m from 2 to 90 in sequence. Sort and number to obtain S j , 1 ≤ j ≤ 89;
[0078] Based on the calculated different standard deviations, analyze the applicable distance range of the quadratic polynomial model and construct a quadratic polynomial error compensation model;
[0079] Starting from j = 2, calculate |S j - S j-1 |, mark the calculation result as H j , then increment j by 1 and recalculate Hj , repeat the execution until j = max(j);
[0080] Set the value of q, with q initially being 3. Starting from j ≤ q, obtain the j range of values of H, mark it as the fluctuation range, obtain the difference between the maximum and minimum values in the fluctuation range, mark it as the fluctuation value, represented by the symbol G1, and obtain the number of H j within the fluctuation range, mark it as the fluctuation quantity, represented by the symbol G2, calculate G2 / G1, and mark the calculation result as the fluctuation density, represented by the symbol F q ;
[0081] In practical applications, for example, S 30 is 0.0058, and S 31 is 0.006. When j = 31, the calculated value of H 31 is 0.0002. For H j , with 2 ≤ j ≤ 89, a total of 88 data points. Starting with q = 3 is to ensure that there are at least two H j to form a range interval. Within the distance interval where the error conforms to the quadratic polynomial regression, the standard deviation of the regression function has a small fluctuation, and the density shown within a certain interval must be the largest. However, beyond the applicable range, the standard deviation will change significantly, causing the fluctuation density to decrease. Therefore, when the fluctuation density is the largest, the boundary between two different error compensation models can be found; for example, when q = 51, the obtained fluctuation range is [0.00003, 0.00032], the calculated fluctuation G1 = 0.00029, the fluctuation quantity G2 = 50, and the calculated fluctuation density F 51 = 50 / 0.00029 = 172414, and the calculation result is rounded to an integer;
[0082] Increment q by one and recalculate F q , until q = max(j) - 1. Search for the maximum value in F q , mark it as the maximum fluctuation density, obtain the value of q corresponding to the maximum fluctuation density, mark it as Q. At this time, S Q corresponding standard deviation is the best standard deviation of the quadratic polynomial error compensation model. Among them, S Q corresponding to j = Q of S j , add Q + 1 to obtain the best value of m, mark it as the best isolation number, represented by the symbol M;
[0083] Obtain DT M and mark it as the maximum applicable value. Among them, DT M represents DT when n = M n, mark the distance range less than or equal to the maximum applicable value as the applicable range, and mark the quadratic polynomial error regression function calculated when i is in [1, M] as the quadratic polynomial error compensation model;
[0084] In practical applications, calculate for each value of q until q = 88, and find the maximum value in F q , and obtain the corresponding Q as 51. At this time, S 51 is the optimal standard deviation, j = Q = 51, m is 1 greater than j, and the optimal isolation number M is obtained as 52. Further obtain DT 52 as the maximum applicable value, DT 52 is 0.62, and mark the quadratic polynomial error regression function calculated when i is in [1, 52] as the quadratic polynomial error compensation model;
[0085] The Gaussian process regression unit is used to perform regression on the distance range that does not apply to the quadratic polynomial model by using Gaussian process regression, and construct a Gaussian process regression error compensation model;
[0086] The Gaussian process regression unit is configured with a Gaussian process regression strategy, and the Gaussian process regression strategy includes:
[0087] Name the distance range greater than the applicable range and less than or equal to the termination distance as the Gaussian range;
[0088] Construct a Gaussian process regression error compensation model, and use the Matern5 / 2 kernel to perform model training on DT n and DR n within the Gaussian range;
[0089] In practical applications, Gaussian process regression is an existing regression method. Gaussian process regression can convert the distribution of discrete points into the distribution of a function. In the range between (0.62, 1], the error distribution between the distance output by the laser range finder and the actual value shows a complex distribution, which is difficult to integrate through conventional function regression. Therefore, Gaussian process regression is adopted. Gaussian process regression can capture complex non-linear relationships and provide uncertainty estimates. The Matern5 / 2 kernel used in Gaussian process regression is suitable for smooth but not infinitely differentiable functions. The Gaussian process regression adopted in this embodiment is exactly the same as the existing Gaussian process regression model. Therefore, it will not be specifically described in this embodiment. The purpose of this embodiment is to find the boundary between two different error compensation models, so as to provide a clear and accurate applicable range for the two different error compensation models. In the case of more than one meter, the traditional linear compensation method is still used to complete the error correction.
[0090] The effectiveness verification module is used to verify whether the error compensation model is effective; the effectiveness verification module includes a compensation verification unit and a compensation comparison unit;
[0091] The compensation verification unit is configured with a compensation verification strategy, and the compensation verification strategy includes:
[0092] Randomly collect the test distances of the first test quantity between the starting distance and the ending distance, and record the corresponding test actual distances of the test distances at the same time;
[0093] Find the distance interval to which the test distance belongs. If the test distance is within the applicable range, use the quadratic polynomial error compensation model to compensate the error of the test distance; otherwise, use the Gaussian process regression error compensation model to compensate the error of the test distance;
[0094] If the quadratic polynomial error compensation model is used to compensate the error of the test distance, then set DE n equal to the test distance and substitute it into the quadratic polynomial error compensation model, and add the test distance to the result output by the quadratic polynomial error compensation model to obtain the predicted compensation distance;
[0095] If the Gaussian process regression error compensation model is used to compensate the error of the test distance, then set DR n equal to the test distance and substitute it into the Gaussian process regression error compensation model, and obtain the result output by the Gaussian process regression error compensation model to get the predicted compensation distance;
[0096] Use the traditional linear correction compensation technology to compensate the error of the test distance, and mark the compensated result as the traditional compensation distance;
[0097] In practical applications, there is no limit to the setting of the first test quantity. In this embodiment, the first test quantity is set to 10. Randomly select 10 different test actual distances from the range interval of 0.1m to 1m, then set the test actual distances through a high-precision guide rail platform, and then read the measurement results of the laser range finder to obtain the test distances. For example, when the test actual distance is 0.322m, the test distance is 0.3278. The test distance is within the applicable range. Use the quadratic polynomial error compensation model to compensate the error of the test distance. Substitute 0.3278 into the quadratic polynomial error compensation model. The compensation result of the quadratic polynomial error compensation model is -0.0054. Add the test distance 0.3278 to -0.0054 to obtain the predicted compensation distance of 0.3224. When using the traditional linear correction compensation technology to compensate the test distance 0.3278, the compensated traditional compensation distance is 0.3096;
[0098] The compensation comparison unit is used to verify the effectiveness of the error compensation model based on the traditional compensation distance, the predicted compensation distance, and the test actual distance;
[0099] The compensation comparison unit is configured with a compensation comparison strategy, and the compensation comparison strategy includes:
[0100] Calculate the absolute value of the difference between the predicted compensation distance and the actual measured distance during testing, and label it as the error after compensation;
[0101] Calculate the absolute value of the difference between the traditional compensation distance and the actual measured distance during testing, and label it as the traditional compensation error;
[0102] Calculate the average value of the error after compensation, name it the average error after compensation, calculate the average value of the traditional compensation error, and name it the average traditional compensation error;
[0103] Label the average error after compensation as W1, label the average traditional compensation error as W2, compare W1 and W2. If W1 is less than W2, output a compensation valid signal; otherwise, output a compensation invalid signal;
[0104] Calculate 1 - W1 / W2, and name the calculation result the performance improvement percentage;
[0105] In practical applications, the error after compensation is calculated to be 0.0004m, while the average traditional compensation error is 0.0124m. Further calculation shows that the average error after compensation W1 is 0.0006m, and the average traditional compensation error W2 is 0.0152m. By comparison, it is found that W1 is much less than W2, so a compensation valid signal is output. Calculate W1 / W2 to obtain a performance improvement percentage of 96.77%. The calculation results are presented in percentage form and rounded to two decimal places.
[0106] Example 2, please refer to Figure 3 As shown, the present application provides a sensor error compensation method based on function simulation, including the following steps:
[0107] Step S1, measure the distance error between the output distance and the true distance of the laser ranging sensor at different distances; Step S1 includes the following sub-steps:
[0108] Step S101, set up a high-precision guide rail platform to control the distance between the laser ranging sensor and the baffle;
[0109] Step S102, set the starting distance and the ending distance, and at the same time set the interval step size. Control the distance between the laser ranging sensor and the baffle to be equal to the starting distance, obtain the output data of the laser ranging sensor, name it the output distance, and at the same time name the distance between the laser ranging sensor and the baffle the true distance;
[0110] Step S103, increase the true distance by the interval step size and record the output distance again. Repeat the increase until the true distance is equal to the ending distance, then record the output distance and stop the increase;
[0111] Step S104: Mark the true distances in ascending order as DT n , and mark the corresponding output distances as DR n , where n is a positive integer and the sequence numbers of DT and DR;
[0112] Step S105: Calculate DT n - DR n , name the calculation result as distance error and mark it as DE n ;
[0113] Step S2: Based on the distance error, perform compensation on different distances using different error compensation models; Step S2 includes the following sub-steps:
[0114] Step S201: Determine the distance range applicable to the quadratic polynomial model and construct a quadratic polynomial error compensation model;
[0115] Step S201 includes the following sub-steps:
[0116] Step S201.1: Establish a plane rectangular coordinate system with n as the X-axis and DE n as the Y-axis, and name it the quadratic polynomial error regression graph;
[0117] Step S201.2: Set the isolation number, marked as m, m is a positive integer, initially set m to 2, and mark the range [1, m] as i;
[0118] Step S201.3: Enter DE i into the quadratic polynomial error regression graph according to n, where DE i is the DE when n = i n ;
[0119] Step S201.4: Perform quadratic polynomial regression on the quadratic polynomial error regression graph, name the regression function as the quadratic polynomial error regression function, and obtain the standard deviation of the quadratic polynomial error regression function;
[0120] Step S201.5: Add 1 to m and analyze the quadratic polynomial error regression function and the standard deviation again, and repeat the execution until m = max(n), where max() is the maximum operator;
[0121] Step S201.6: Sort and number the standard deviations in ascending order of m, represented by the symbol S j , where j is a positive integer and the sequence number of S. When j = 1, it corresponds to m = 2, and the value range of j is 1 ≤ j ≤ max(n) - 1;
[0122] Step S201.7: Analyze the applicable distance range of the quadratic polynomial model based on the calculated different standard deviations and construct a quadratic polynomial error compensation model;
[0123] Step S201.7 includes the following sub-steps:
[0124] Step S201.7.a: Starting from j = 2, calculate |S j -S j-1 |, mark the calculation result as H j , then increment j by 1 and recalculate H j , and repeat the execution until j = max(j);
[0125] Step S201.7.b: Set the value of q, with the initial value of q being 3. Starting from j ≤ q, obtain the value range of H j , mark it as the fluctuation range, obtain the difference between the maximum value and the minimum value in the fluctuation range, mark it as the fluctuation value, represented by the symbol G1, obtain the number of H j within the fluctuation range, mark it as the fluctuation quantity, represented by the symbol G2, calculate G2 / G1, and mark the calculation result as the fluctuation density, represented by the symbol F q ;
[0126] Step S201.7.c: Increment q by 1 and recalculate F q , until q = max(j) - 1, find the maximum value in F q , mark it as the maximum fluctuation density, obtain the value of q corresponding to the maximum fluctuation density, mark it as Q. At this time, the standard deviation corresponding to S Q is the best standard deviation of the quadratic polynomial error compensation model, where S Q corresponds to S j when j = Q, add Q + 1 to obtain the best value of m, mark it as the best isolation number, represented by the symbol M;
[0127] Step S201.7.d: Obtain DT M and mark it as the maximum applicable value, where DT M represents DT n when n = M. Mark the distance range less than or equal to the maximum applicable value as the applicable range, and mark the quadratic polynomial error regression function calculated when i is [1, M] as the quadratic polynomial error compensation model;
[0128] Step S202: Use Gaussian process regression to perform regression on the distance range where the quadratic polynomial model is not applicable and construct a Gaussian process regression error compensation model;
[0129] Step S202 includes the following sub-steps:
[0130] Step S202.1: Name the distance range greater than the applicable range and less than or equal to the termination distance as the Gaussian range;
[0131] Step S202.2: Construct a Gaussian process regression error compensation model, and use the Matern5 / 2 kernel to perform model training on DT n and DR n within the Gaussian range;
[0132] Step S3: Verify whether the error compensation model is effective. Step S3 includes the following sub-steps:
[0133] Step S301: Randomly collect the first test quantity of test distances between the starting distance and the termination distance, and record the test actual distances corresponding to the test distances at the same time;
[0134] Step S302: Find the distance interval to which the test distance belongs. If the test distance is within the applicable range, use the quadratic polynomial error compensation model to perform error compensation on the test distance; otherwise, use the Gaussian process regression error compensation model to perform error compensation on the test distance;
[0135] Step S303: If the quadratic polynomial error compensation model is used to perform error compensation on the test distance, substitute DE n equal to the test distance into the quadratic polynomial error compensation model, and add the test distance to the result output by the quadratic polynomial error compensation model to obtain the predicted compensation distance;
[0136] Step S304: If the Gaussian process regression error compensation model is used to perform error compensation on the test distance, substitute DR n equal to the test distance into the Gaussian process regression error compensation model, and obtain the result output by the Gaussian process regression error compensation model to get the predicted compensation distance;
[0137] Step S305: Use the traditional linear calibration compensation technique to perform error compensation on the test distance, and mark the compensated result as the traditional compensation distance;
[0138] Step S306: Verify the effectiveness of the error compensation model based on the traditional compensation distance, the predicted compensation distance, and the test actual distance;
[0139] Step S306 includes the following sub-steps:
[0140] Step S306.1: Calculate the absolute value of the difference between the predicted compensation distance and the test actual distance, and mark it as the error after compensation;
[0141] Step S306.2: Calculate the absolute value of the difference between the traditional compensation distance and the test actual distance, and mark it as the traditional compensation error;
[0142] Step S306.3: Calculate the average value of the compensated error, named the average compensated error, and calculate the average value of the traditional compensation error, named the average traditional compensation error;
[0143] Step S306.4: Mark the average compensated error as W1, mark the average traditional compensation error as W2, compare W1 with W2. If W1 is less than W2, output a compensation valid signal; otherwise, output a compensation invalid signal;
[0144] Step S306.5: Calculate W1 / W2, and name the calculation result the performance improvement percentage.
[0145] Example 3, please refer to Figure 4 as shown in Figure 4 which exemplifies a schematic structural diagram of an electronic device. The electronic device may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in the sensor error compensation method based on function simulation are run to achieve the following functions: testing the distance error between the output distance and the true distance of the laser ranging sensor at different distances; compensating different distances with different error compensation models based on the distance error; verifying whether the error compensation model is effective.
[0146] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0147] Example 4. The present application also provides a computer-readable storage medium. The present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned sensor error compensation method based on function simulation are run to achieve the following functions: testing the distance error between the output distance and the true distance of the laser ranging sensor at different distances; compensating different distances with different error compensation models based on the distance error; and verifying whether the error compensation model is effective.
[0148] Through the description of the above embodiments, the embodiments of the present invention can be provided as a method, a system or a computer program product. Based on such an understanding, the above technical solution essentially or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0149] In the embodiments provided by the present application, it should be understood that the disclosed system or method can be implemented in other ways. The above-described embodiments are merely illustrative. For example, the division of modules or units is only a logical function division, and there can be other division methods in actual implementation. For another example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces. The indirect coupling or communication connection of systems, modules and units can be in an electrical, mechanical or other form.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A sensor error compensation method based on function simulation, characterized in that: The steps include: Test the distance error between the output distance and the actual distance of the laser distance measuring sensor at different distances; Based on the distance error, different error compensation models are used to compensate for different distances; Verify whether the error compensation model is effective; Testing the distance error between the output distance and the actual distance of the laser distance measuring sensor at different distances includes the following sub-steps: A high-precision guide rail platform is provided to control the distance between the laser ranging sensor and the baffle; Set the starting distance and the ending distance, and set the interval step length, control the distance between the laser distance sensor and the baffle to be equal to the starting distance, obtain the output data of the laser distance sensor, name it as the output distance, and name the distance between the laser distance sensor and the baffle as the real distance; Increase the actual distance by the interval step and record the output distance again, repeat the increase until the actual distance equals the end distance, record the output distance and stop increasing; The actual distances are marked as DT in ascending order. n , and mark the corresponding output distance as DR n , where n is a positive integer and n is the serial number of DT and DR; Calculate DT n -DR n , and name the calculated result as distance error, marked as DE n ; Using different error compensation models to compensate for different distances based on distance error includes the following sub-steps: Determine the distance range in which the quadratic polynomial model is applicable and construct a quadratic polynomial error compensation model; Gaussian process regression is used to regress the distance range that is not suitable for the quadratic polynomial model, and a Gaussian process regression error compensation model is constructed; Determining the distance range for which the quadratic polynomial model is applicable and constructing the quadratic polynomial error compensation model includes the following sub-steps: With n as the X-axis, DE n Establish a plane rectangular coordinate system for the Y axis and name it as the quadratic polynomial error regression graph; Set the isolation number, marked as m, where m is a positive integer and is initially set to 2. Mark the range [1,m] as i; Will DE i Enter the quadratic polynomial error regression graph according to n, where DE i That is, DE for n=i n ; Performing quadratic polynomial regression on the quadratic polynomial error regression graph, naming the function obtained by regression as the quadratic polynomial error regression function, and obtaining the standard deviation of the quadratic polynomial error regression function; Add 1 to m and analyze the quadratic polynomial error regression function and standard deviation again, repeating until m=max(n), where max() is the maximum value operator; The standard deviations are sorted and numbered in ascending order of m, using the symbol S j Indicates, where j is a positive integer and j is the serial number of S. When j=1, corresponding to m=2, the value range of j is 1≤j≤max(n)-1; Based on the different calculated standard deviations, the distance range applicable to the quadratic polynomial model is analyzed and a quadratic polynomial error compensation model is constructed; Based on the different calculated standard deviations, analyzing the distance range applicable to the quadratic polynomial model and constructing a quadratic polynomial error compensation model includes the following sub-steps: Starting with j=2, calculate |S j -S j-1 |, mark the result as H j , then add j+1 and recalculate H j , repeat until j=max(j); Set the value q, which is initially 3, and start with j≤q to obtain H j The value range of is marked as the fluctuation range, and the difference between the maximum and minimum values in the fluctuation range is obtained, which is marked as the fluctuation value and represented by the symbol G1. j The number of fluctuations is marked as the fluctuation number and represented by the symbol G2. G2 / G1 is calculated and the result is marked as the fluctuation density and represented by the symbol F. q express; Increase q by one and recalculate F q , until q=max(j)-1, find F q The maximum value in is marked as the maximum fluctuation density. The value of q of the maximum fluctuation density is obtained and marked as Q. At this time, S Q The corresponding standard deviation is the optimal standard deviation of the quadratic polynomial error compensation model, where S Q S corresponding to j=Q j , Q+1 is used to obtain the best value of m, which is marked as the optimal isolation number and represented by the symbol M; Get DT M and marked as the maximum applicable value, where DT M DT for n=M n , the distance range that is less than or equal to the maximum applicable value is marked as the applicable range, and the quadratic polynomial error regression function calculated when i is [1,M] is marked as the quadratic polynomial error compensation model.
2. The sensor error compensation method based on function simulation according to claim 1, characterized in that: Gaussian process regression is used to regress the distance range that is not suitable for the quadratic polynomial model. The construction of the Gaussian process regression error compensation model includes the following sub-steps: The distance range that is greater than the applicable range and less than or equal to the end distance is named Gaussian range; Construct a Gaussian process regression error compensation model and use Matern5 / 2 to check the DT within the Gaussian range. n and DR n Perform model training.
3. The sensor error compensation method based on function simulation according to claim 2, characterized in that: Verifying whether the error compensation model is effective includes the following sub-steps: Randomly collect the test distances of the first test quantity between the starting distance and the ending distance, and record the actual test distances corresponding to the test distances; Find the distance interval to which the test distance belongs. If the test distance is within the applicable range, use the quadratic polynomial error compensation model to compensate for the test distance error. Otherwise, use the Gaussian process regression error compensation model to compensate for the test distance error. If the quadratic polynomial error compensation model is used to compensate the test distance error, DE n Substituting the test distance into the quadratic polynomial error compensation model, adding the test distance to the output of the quadratic polynomial error compensation model to obtain the predicted compensation distance; If the Gaussian process regression error compensation model is used to compensate the test distance error, then DR n Substitute the test distance into the Gaussian process regression error compensation model, obtain the output result of the Gaussian process regression error compensation model, and obtain the predicted compensation distance; The traditional linear correction compensation technology is used to compensate the error of the test distance, and the compensation result is marked as the traditional compensation distance; The effectiveness of the error compensation model is verified based on the traditional compensation distance, predicted compensation distance and actual test distance.
4. The sensor error compensation method based on function simulation according to claim 3 is characterized in that: Based on the traditional compensation distance, the predicted compensation distance, and the actual distance tested, the effectiveness of the error compensation model is verified, including the following sub-steps: Calculate the absolute value of the difference between the predicted compensation distance and the actual test distance, marked as the error after compensation; Calculate the absolute value of the difference between the traditional compensation distance and the actual test distance, and mark it as the traditional compensation error; The average value of the compensated error is calculated and named as the compensated average error, and the average value of the traditional compensated error is calculated and named as the traditional compensated average error; The average error after compensation is marked as W1, and the average error of traditional compensation is marked as W2. W1 is compared with W2. If W1 is less than W2, a compensation valid signal is output, otherwise a compensation invalid signal is output; Calculate 1-W1 / W2 and name the result as the performance improvement percentage.
5. A sensor error compensation system based on function simulation, used to implement the sensor error compensation method based on function simulation according to any one of claims 1 to 4, characterized in that: It includes an error testing module, an error compensation module and a validity verification module; the error testing module and the validity verification module are respectively data-connected with the error compensation module; The error testing module is used to test the distance error between the output distance and the actual distance of the laser distance measuring sensor at different distances; The error compensation module is used to compensate for different distances using different error compensation models based on the distance error; The validity verification module is used to verify whether the error compensation model is valid.
6. A 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 4 are executed.
Citation Information
Patent Citations
Laser distance measuring module with INL error compensation
CN108226942A
Distance correction method for TOF camera based on Gaussian process regression
CN109035345A
Laser ranging energy compensation calculation method and device, equipment and storage medium
CN119556293A