A dynamic compensation method for online detection data of an optical displacement sensor
Patent Information
- Application Number
- CN202610924666.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]有鉴于此,本发明旨在提出一种光学位移传感器在线检测数据的动态补偿方法,以解决现有自适应指数平滑滤波算法仅依据残差幅值调节平滑权重,难以区分真实结构性阶跃信号、孤立飞点噪声和缓变漂移信号,导致动态权重误判及过度补偿的问题
[0059]本发明所述的一种光学位移传感器在线检测数据的动态补偿方法,通过在自适应指数平滑滤波的残差权重调节过程中引入局部时序位移形态判别机制,使平滑权重不再仅由当前残差幅值单独驱动,而是同时受到位移方向一致性和梯度能量集中程度的约束。在工业在线扫描过程中,当光学位移传感器受到局部反光干扰产生孤立飞点噪声时,位移数据通常表现为瞬时突增后快速回落,本发明能够利用逆向折返特征对该类异常进行抑制,避免算法因残差突增而错误追踪虚假飞点,从而减少补偿曲线中的虚假凸包突变,提高在线检测数据的稳定性。同时,本发明能够进一步区分真实表面台阶所产生的结构性阶跃信号与光学多次反射、材料渐变等因素引起的缓变漂移信号。对于真实结构性阶跃,位移变化能量集中且方向明确,本发明能够释放合理的追踪权重,保留待测物表面真实台阶轮廓;对于缓变漂移,位移变化能量分散于局部观测窗口内,本发明能够抑制过度补偿,避免漂移形变被误放大。由此,本发明提高了复杂工况下光学位移测量结果的真实还原度,能够为后续表面缺陷识别、尺寸测量和三维形貌重建提供更可靠的数据基础。
Smart Images

Figure CN122813656A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical displacement measurement data processing technology, and in particular to a dynamic compensation method for online detection data of an optical displacement sensor. Background Technology
[0002] Optical displacement sensors, characterized by non-contact operation, fast response, and high measurement accuracy, are widely used in online inspection scenarios such as industrial precision manufacturing, surface quality inspection, dimensional measurement, and 3D topography reconstruction. In practical applications, optical displacement sensors typically perform continuous scanning of the relatively moving surface of the object under test at a set sampling frequency, acquiring a sequence of raw displacement data arranged in chronological order, and then reconstructing the contour changes of the object's surface based on this raw displacement data sequence. Due to interference factors in industrial inspection environments, such as localized reflections, multiple optical reflections, gradual changes in material surfaces, equipment vibrations, and communication anomalies, the raw displacement data is prone to being contaminated with isolated flying point noise, slowly varying drift signals, and other abnormal disturbances. Therefore, smoothing filtering and dynamic compensation processing are usually required for the raw displacement data.
[0003] In existing technologies, adaptive exponential smoothing filtering algorithms are commonly used to dynamically compensate online detection data from optical displacement sensors. These algorithms typically adjust the tracking weight of the current original displacement data based on the residual amplitude between the original displacement data at the current sampling time and the compensated output value at the previous sampling time. When the residual amplitude is small, the algorithm maintains a low smoothing weight to suppress random noise; when the residual amplitude increases, the algorithm increases the smoothing weight to quickly track possible surface displacement changes. However, during continuous scanning of complex surfaces, structural step signals generated by real surface steps, isolated flying point noise from local reflections, and slowly varying drift signals from multiple optical reflections or gradual material changes may all initially manifest as increased residual amplitudes. This makes it difficult for existing algorithms to accurately determine whether to release a higher tracking weight based solely on the residual amplitude.
[0004] Because existing adaptive exponential smoothing filtering algorithms lack the ability to analyze the deformation trajectory characteristics within local temporal displacement data, they are prone to mistracking spurious abrupt changes when encountering isolated flying point noise, and overcompensating when encountering slowly varying drift signals. Furthermore, reducing the overall tracking weight to suppress noise may weaken the response to real structural step signals, thus affecting the accuracy of surface contour reconstruction and the stability of online detection results. Therefore, accurately distinguishing between real structural step signals, isolated flying point noise, and slowly varying drift signals during online detection data compensation from optical displacement sensors, and accordingly achieving reasonable dynamic adjustment of the smoothing weight, has become a pressing problem in this field. Summary of the Invention
[0005] In view of this, the present invention aims to propose a dynamic compensation method for online detection data of optical displacement sensors, in order to solve the problem that the existing adaptive exponential smoothing filtering algorithm adjusts the smoothing weight only based on the residual amplitude, which makes it difficult to distinguish between real structural step signals, isolated flying point noise and slowly varying drift signals, resulting in misjudgment and overcompensation of dynamic weights.
[0006] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0007] A method for dynamic compensation of online detection data from an optical displacement sensor, the method comprising:
[0008] Step S1: Obtain the original displacement data generated by the online continuous scanning of the surface of the object under test by the optical displacement sensor, and perform data preprocessing and algorithm parameter initialization to obtain the original displacement data sequence and initialize the algorithm parameters;
[0009] Step S2: By performing net displacement ratio analysis and reverse return energy attenuation processing on the time-series displacement data within the local observation window in the original displacement data sequence, the displacement direction consistency factor is obtained;
[0010] Step S3: Obtain the gradient energy concentration factor by performing maximum gradient proportion analysis and residual energy decay processing on the time-series displacement data within the local observation window in the original displacement data sequence;
[0011] Step S4: By coupling the displacement direction consistency factor and the gradient energy concentration factor to the residual mapping mechanism of the adaptive exponential smoothing filter algorithm, the dynamic compensation displacement data sequence is obtained;
[0012] Step S5: Obtain the dynamic compensation result of the online detection data of the optical displacement sensor by restoring the surface contour data of the dynamic compensation displacement data sequence.
[0013] Furthermore, the step of acquiring the raw displacement data generated by the online continuous scanning of the surface of the object under test by the optical displacement sensor and performing data preprocessing and algorithm parameter initialization to obtain the raw displacement data sequence and initialize the algorithm parameters includes:
[0014] An optical displacement sensor is deployed at the industrial online inspection site, with the detection end of the optical displacement sensor facing the surface of the object to be measured; the sampling frequency of the optical displacement sensor is set, and the surface of the object to be measured is continuously scanned online during the relative movement process according to the set sampling frequency to obtain the original displacement data corresponding to each sampling time, and the original displacement data are arranged according to the order of the sampling time to obtain the initial displacement data sequence.
[0015] The initial displacement data sequence is processed by removing abnormal and invalid values and filling in missing sampling points. The original displacement data that exceeds the preset effective displacement range is removed, and the original displacement data corresponding to the missing sampling points is filled in by linear interpolation to obtain the original displacement data sequence.
[0016] Set the basic smoothing coefficient for the adaptive exponential smoothing filter algorithm, take the first original displacement data in the original displacement data sequence as the initial compensation output value, and set the local observation window length and the minimum normal number to prevent the denominator from being zero. Use the basic smoothing coefficient, the initial compensation output value, the local observation window length, and the minimum normal number as the initialization algorithm parameters.
[0017] Furthermore, the process of obtaining a displacement direction consistency factor by performing net displacement proportion analysis and reverse return energy attenuation processing on the time-series displacement data within a local observation window in the original displacement data sequence includes:
[0018] By performing start-end displacement difference analysis and first-order difference statistical processing on the time-series displacement data within a local observation window in the original displacement data sequence, the characteristic data of window displacement change are obtained.
[0019] By analyzing the net displacement ratio, identifying the dominant trend direction, and mapping the reverse return energy attenuation of the window displacement change characteristic data, the displacement direction consistency factor is obtained.
[0020] Furthermore, the step of obtaining window displacement change characteristic data by performing start-end displacement difference analysis and first-order difference statistical processing on the time-series displacement data within a local observation window in the original displacement data sequence includes:
[0021] For any target sampling time, the local observation window length is obtained from the initialization algorithm parameters, and the temporal displacement data within the local observation window with the target sampling time as the end point is extracted from the original displacement data sequence based on the local observation window length.
[0022] The original displacement data corresponding to the end point of the window within the local observation window is used as the original displacement data of the end point of the window. The original displacement data corresponding to the start point of the window within the local observation window is used as the original displacement data of the start point of the window. The difference between the original displacement data of the end point of the window and the original displacement data of the start point of the window is used as the directed net displacement data of the window. The absolute value of the directed net displacement data of the window is used as the net displacement evaluation of the window.
[0023] For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the next sampling time and the original displacement data corresponding to the previous sampling time is taken as the first-order differential gradient data of the corresponding adjacent sampling time, and the absolute value of each first-order differential gradient data is taken to obtain the corresponding gradient absolute value data.
[0024] The absolute values of all gradients within the local observation window are summed to obtain the window gradient path length assessment. The original displacement data at the window start point, the original displacement data at the window end point, the directed net displacement data of the window, the net displacement assessment of the window, the first-order difference gradient data, the absolute value data of the gradients, and the window gradient path length assessment are used as the window displacement change characteristic data.
[0025] Furthermore, the process of obtaining a displacement direction consistency factor by performing net displacement proportion analysis, dominant trend direction identification, and reverse return energy attenuation mapping on the window displacement change characteristic data includes:
[0026] For any target sampling time, extract the net window displacement assessment and window gradient path length assessment corresponding to the target sampling time from the window displacement change feature data, and extract the minimum normal number from the initialization algorithm parameters; use the net window displacement assessment as the numerator, add the window gradient path length assessment and the minimum normal number as the denominator, and use the corresponding fraction as the net displacement ratio assessment corresponding to the target sampling time.
[0027] Extract the directed net displacement data of the window corresponding to the target sampling time from the window displacement change feature data. When the directed net displacement data of the window is greater than the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant 1; when the directed net displacement data of the window is less than the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant -1; when the directed net displacement data of the window is equal to the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant 0.
[0028] For any first-order differential gradient data within the local observation window, multiply the dominant trend direction indicator corresponding to the target sampling time with the first-order differential gradient data to obtain the corresponding consistent direction gradient evaluation; use the negative of the consistent direction gradient evaluation as the back-curved candidate gradient evaluation; when the back-curved candidate gradient evaluation is less than a constant 0, set the inverse back-curved gradient data of the corresponding first-order differential gradient data to a constant 0; when the back-curved candidate gradient evaluation is greater than or equal to a constant 0, use the back-curved candidate gradient evaluation as the inverse back-curved gradient data of the corresponding first-order differential gradient data.
[0029] The reverse return gradient data within the local observation window are summed to obtain the reverse return energy assessment. The reverse return energy assessment is used as the numerator, and the result of adding the window net displacement assessment and the minimum normal number is used as the denominator. The corresponding fraction is used as the reverse return energy proportion assessment. The negative of the reverse return energy proportion assessment is subjected to an exponential mapping with the natural constant as the base to obtain the reverse return energy decay assessment.
[0030] The net displacement percentage assessment is multiplied by the reverse return energy attenuation assessment to obtain the displacement direction consistency factor corresponding to the target sampling time.
[0031] Furthermore, the step of obtaining the gradient energy concentration factor by performing maximum gradient proportion analysis and residual energy decay processing on the temporal displacement data within a local observation window in the original displacement data sequence includes:
[0032] By performing first-order differential gradient extraction on the temporal displacement data within a local observation window in the original displacement data sequence, the window gradient change feature data is obtained.
[0033] By performing gradient magnitude statistics and maximum gradient identification on the window gradient change feature data, the maximum gradient proportion feature data is obtained.
[0034] The gradient energy concentration factor is obtained by performing residual gradient energy decay mapping on the maximum gradient proportion feature data and the window gradient change feature data.
[0035] Furthermore, the step of extracting window gradient feature data by performing first-order difference gradient extraction on the temporal displacement data within a local observation window in the original displacement data sequence includes:
[0036] For any target sampling time, the local observation window length is obtained from the initialization algorithm parameters, and the temporal displacement data within the local observation window with the target sampling time as the end point is extracted from the original displacement data sequence based on the local observation window length.
[0037] For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the later sampling time and the original displacement data corresponding to the previous sampling time is taken as the first-order difference gradient data of the corresponding adjacent sampling time.
[0038] Take the absolute value of each first-order difference gradient data within the local observation window to obtain the corresponding absolute gradient data, and add up all the absolute gradient data within the local observation window to obtain the total gradient energy assessment of the window.
[0039] The temporal displacement data, first-order differential gradient data, absolute gradient value data, and total energy assessment of the window gradient within the local observation window are used as the window gradient change characteristic data corresponding to the target sampling time.
[0040] Furthermore, the step of obtaining maximum gradient proportion feature data by performing gradient magnitude statistics and maximum gradient identification processing on the window gradient change feature data includes:
[0041] For any target sampling time, extract the absolute value of the gradient and the total energy of the window gradient corresponding to the target sampling time from the window gradient change feature data, and extract the minimum normal number from the initialization algorithm parameters.
[0042] Numerical comparison is performed on all gradient absolute value data within the local observation window, and the gradient absolute value data with the largest value is used as the maximum gradient evaluation corresponding to the target sampling time.
[0043] The maximum gradient assessment is used as the numerator, the total energy assessment of the window gradient is added to the minimum normal number as the denominator, and the corresponding fraction is used as the assessment of the maximum gradient proportion at the target sampling time.
[0044] The maximum gradient evaluation and maximum gradient proportion evaluation corresponding to the target sampling time are used as the maximum gradient proportion feature data.
[0045] Furthermore, the step of obtaining the gradient energy concentration factor by performing residual gradient energy decay mapping processing on the maximum gradient proportion feature data and the window gradient change feature data includes:
[0046] For any target sampling time, extract the maximum gradient evaluation and maximum gradient proportion evaluation corresponding to the target sampling time from the maximum gradient proportion feature data, and extract the total energy evaluation of the window gradient corresponding to the target sampling time from the window gradient change feature data.
[0047] The difference between the total energy assessment of the window gradient and the maximum gradient assessment is used as the residual gradient energy assessment at the target sampling time.
[0048] Extract the minimum normal number from the initialization algorithm parameters, use the residual gradient energy evaluation as the numerator, use the calculation result of adding the maximum gradient evaluation and the minimum normal number as the denominator, and use the corresponding fraction as the residual gradient energy ratio evaluation at the target sampling time.
[0049] The negative of the residual gradient energy percentage assessment is subjected to an exponential mapping with the natural constant as the base, to obtain the residual gradient energy decay assessment corresponding to the target sampling time.
[0050] Multiply the maximum gradient proportion assessment by the residual gradient energy decay assessment to obtain the gradient energy concentration factor corresponding to the target sampling time.
[0051] Furthermore, the step of obtaining the dynamically compensated displacement data sequence by coupling the displacement direction consistency factor and the gradient energy concentration factor to the residual mapping mechanism of the adaptive exponential smoothing filter algorithm includes:
[0052] For any target sampling time, extract the original displacement data corresponding to the target sampling time from the original displacement data sequence, and obtain the dynamic compensation output value corresponding to the previous sampling time of the target sampling time; use the absolute value of the difference between the original displacement data corresponding to the target sampling time and the dynamic compensation output value corresponding to the previous sampling time as the original observation residual evaluation corresponding to the target sampling time.
[0053] Define the maximum allowable additional tracking weight and residual mapping sensitivity coefficient in the adaptive exponential smoothing filter algorithm; perform an exponential mapping with the natural constant as the base of the result of multiplying the residual mapping sensitivity coefficient by the original observation residual evaluation to obtain the residual decay mapping evaluation; use the difference between the constant 1 and the residual decay mapping evaluation as the residual saturation growth evaluation; use the result of multiplying the maximum allowable additional tracking weight by the residual saturation growth evaluation as the basic residual mapping weight corresponding to the target sampling time.
[0054] Obtain the displacement direction consistency factor and gradient energy concentration factor corresponding to the target sampling time. Multiply the displacement direction consistency factor and gradient energy concentration factor to obtain the composite dynamic gating adjustment amount corresponding to the target sampling time. Multiply the composite dynamic gating adjustment amount and the basic residual mapping weight to obtain the additional tracking weight corresponding to the target sampling time.
[0055] Extract the basic smoothing coefficient from the initialization algorithm parameters, add the basic smoothing coefficient to the additional tracking weight, and obtain the composite adaptive smoothing weight corresponding to the target sampling time.
[0056] Multiply the composite adaptive smoothing weights with the original displacement data corresponding to the target sampling time to obtain the current observation weighted data corresponding to the target sampling time; use the difference between the constant 1 and the composite adaptive smoothing weights as the historical compensation retention weights, and multiply the historical compensation retention weights with the dynamic compensation output value corresponding to the previous sampling time to obtain the historical compensation weighted data corresponding to the target sampling time; add the current observation weighted data with the historical compensation weighted data to obtain the dynamic compensation output value corresponding to the target sampling time.
[0057] The dynamic compensation output values corresponding to each sampling time are arranged in chronological order to obtain the dynamic compensation displacement data sequence.
[0058] Compared with the prior art, the present invention has the following advantages:
[0059] This invention discloses a dynamic compensation method for online detection data of an optical displacement sensor. By introducing a local temporal displacement morphology discrimination mechanism during the residual weight adjustment process of adaptive exponential smoothing filtering, the smoothing weight is no longer driven solely by the current residual amplitude, but is simultaneously constrained by the consistency of displacement direction and the concentration of gradient energy. During industrial online scanning, when the optical displacement sensor experiences isolated flying point noise due to local reflection interference, the displacement data typically exhibits a sudden increase followed by a rapid decrease. This invention can suppress such anomalies using inverse foldback characteristics, preventing the algorithm from erroneously tracking false flying points due to residual surges, thereby reducing false convex hull abrupt changes in the compensation curve and improving the stability of online detection data. Simultaneously, this invention can further distinguish between structural step signals generated by real surface steps and slowly varying drift signals caused by multiple optical reflections, material gradients, etc. For real structural steps, the displacement change energy is concentrated and directional; this invention can release reasonable tracking weights, preserving the true step contour of the measured object's surface. For slowly varying drifts, the displacement change energy is dispersed within a local observation window; this invention can suppress overcompensation, preventing the drift deformation from being mistakenly amplified. Therefore, this invention improves the accuracy of optical displacement measurement results under complex working conditions, and can provide a more reliable data foundation for subsequent surface defect identification, size measurement and three-dimensional morphology reconstruction. Attached Figure Description
[0060] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0061] Figure 1 This is a flowchart illustrating a dynamic compensation method for online detection data of an optical displacement sensor according to an embodiment of the present invention. Detailed Implementation
[0062] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0063] See Figure 1 This is a flowchart of a dynamic compensation method for online detection data of an optical displacement sensor provided in Embodiment 1 of the present invention. Figure 1 As shown, a dynamic compensation method for online detection data of an optical displacement sensor may include:
[0064] Step S1: Obtain the original displacement data generated by the online continuous scanning of the surface of the object under test by the optical displacement sensor, and perform data preprocessing and algorithm parameter initialization to obtain the original displacement data sequence and initialize the algorithm parameters.
[0065] First, an optical displacement sensor is deployed at the industrial online inspection site, with its detection end facing the surface of the object to be measured. The sampling frequency of the optical displacement sensor is set, and the surface of the object to be measured is continuously scanned online during relative movement according to the set sampling frequency. The raw displacement data corresponding to each sampling moment is acquired, and the raw displacement data are arranged in chronological order of the sampling moments to obtain an initial displacement data sequence. It should be noted that in this embodiment of the invention, the sampling frequency is set to 10kHz.
[0066] The initial displacement data sequence is processed by removing invalid values and filling in missing sampling points. The original displacement data that exceeds the preset effective displacement range is removed, and the original displacement data corresponding to the missing sampling points is filled in by linear interpolation to obtain the original displacement data sequence.
[0067] A basic smoothing coefficient is set for the adaptive exponential smoothing filtering algorithm. The first original displacement data in the original displacement data sequence is used as the initial compensation output value. The local observation window length and a minimum positive constant to prevent the denominator from being zero are also set. The basic smoothing coefficient, the initial compensation output value, the local observation window length, and the minimum positive constant are used as initialization algorithm parameters. In this embodiment of the invention, the basic smoothing coefficient is set. Set the initial compensation output value to the first original displacement data of the preprocessed sequence; set the local observation window length to 10; set the minimum constant to... .
[0068] This completes the process of acquiring raw displacement data generated by online continuous scanning of the surface of the object under test using an optical displacement sensor, performing data preprocessing and algorithm parameter initialization, obtaining the raw displacement data sequence, and initializing the algorithm parameters.
[0069] Step S2: By performing net displacement ratio analysis and reverse return energy attenuation processing on the time-series displacement data within the local observation window in the original displacement data sequence, the displacement direction consistency factor is obtained.
[0070] Optical displacement sensors are susceptible to isolated flying point noise due to localized reflection interference during continuous scanning. This noise manifests in the time domain as a sudden increase and rapid decrease in residuals. Existing adaptive exponential smoothing filtering algorithms only proportionally amplify the smoothing weights based on the increase in the absolute magnitude of the residuals, thus incorrectly tracking these spurious isolated flying points. Analysis of the deformation characteristics of time-series displacement trajectories reveals that the fundamental difference between genuine structural step signals and isolated flying point noise lies in the consistency of their deformation trajectory directions. Genuine structural step signals maintain their position on the new displacement reference plane after a jump, with the first-order differential gradients of adjacent sampling points having the same direction of action; that is, the entire jump process does not contain reverse back-reversal features. In contrast, isolated flying point noise, due to the rapid data decline, has its first-order differential gradient sequence mixed with reverse back-reversal gradient energy. Therefore, to prevent the algorithm from incorrectly releasing weights for isolated flying point noise, a global screening of trajectory direction consistency and suppression of reverse back-reversal energy need to be introduced into the algorithm's adjustment mechanism. By obtaining the net displacement percentage of the displacement trajectory within the local observation window and simultaneously extracting the inverse gradient energy that is opposite to the global trend and applying it to an exponential constraint, the isolation of isolated flying point noise is achieved, while retaining the effective jump signal with monotonic direction.
[0071] In summary, this invention first obtains window displacement change characteristic data by performing start-end displacement difference analysis and first-order difference statistical processing on the temporal displacement data within a local observation window in the original displacement data sequence. Specifically, for any target sampling time, the length of the local observation window is obtained from the initialization algorithm parameters, and based on the local observation window length, temporal displacement data within the local observation window with the target sampling time as the window endpoint is extracted from the original displacement data sequence. The original displacement data corresponding to the window endpoint within the local observation window is taken as the window endpoint original displacement data, and the original displacement data corresponding to the window start point within the local observation window is taken as the window start point original displacement data. The difference between the window endpoint original displacement data and the window start point original displacement data is taken as the window directed net displacement data, and the absolute value of the window directed net displacement data is taken as the window net displacement evaluation. For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the later sampling time and the original displacement data corresponding to the previous sampling time is taken as the first-order difference gradient data of the corresponding adjacent sampling time, and the absolute value of each first-order difference gradient data is taken to obtain the corresponding gradient absolute value data. All gradient absolute value data within the local observation window are added together to obtain the window gradient path length evaluation. The original displacement data at the start of the window, the original displacement data at the end of the window, the directional net displacement data of the window, the net displacement evaluation of the window, the first-order difference gradient data, the absolute value of the gradient data, and the evaluation of the gradient path length of the window are used as the characteristic data of window displacement change.
[0072] After obtaining the window displacement change feature data, the net displacement proportion analysis, dominant trend direction identification, and reverse foldback energy attenuation mapping are performed on the window displacement change feature data to obtain the displacement direction consistency factor. Specifically, for any target sampling time, the window net displacement assessment and window gradient path length assessment corresponding to the target sampling time are extracted from the window displacement change feature data, and the minimum positive constant is extracted from the initial algorithm parameters. The window net displacement assessment is used as the numerator, and the result of adding the window gradient path length assessment and the minimum positive constant is used as the denominator. The corresponding fraction is used as the net displacement proportion assessment corresponding to the target sampling time. The directed net displacement data of the window corresponding to the target sampling time is extracted from the window displacement change feature data. When the directed net displacement data of the window is greater than the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant 1; when the directed net displacement data of the window is less than the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant -1; when the directed net displacement data of the window is equal to the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant 0. For any first-order differential gradient data within the local observation window, multiply the dominant trend direction indicator corresponding to the target sampling time with the first-order differential gradient data to obtain the corresponding consistent direction gradient assessment. The negative of the consistent direction gradient assessment is used as the candidate gradient assessment for backtracking. When the candidate gradient assessment is less than a constant 0, the inverse backtracking gradient data of the corresponding first-order differential gradient data is set to a constant 0. When the candidate gradient assessment is greater than or equal to a constant 0, the candidate gradient assessment is used as the inverse backtracking gradient data of the corresponding first-order differential gradient data. All inverse backtracking gradient data within the local observation window are summed to obtain the inverse backtracking energy assessment. The inverse backtracking energy assessment is used as the numerator, and the result of adding the window net displacement assessment to the minimum normal number is used as the denominator. The resulting fraction is used as the inverse backtracking energy proportion assessment. The negative of the inverse backtracking energy proportion assessment is subjected to an exponential mapping with the natural constant as the base to obtain the inverse backtracking energy decay assessment. The net displacement proportion assessment is multiplied by the inverse backtracking energy decay assessment to obtain the displacement direction consistency factor corresponding to the target sampling time.
[0073] In one implementation, it is assumed that the local observation window length is... ;No. The original displacement data at each sampling time is ;No. The first-order difference gradient data at each time step are: The global trend sign function is: ;No. The original displacement data of the local observation window starting point at each time point are: Then the first The expression for calculating the displacement direction consistency factor at time is:
[0074]
[0075] in, Indicates the first The consistency factor of displacement direction at each moment; Indicates the first The original displacement data at each sampling time; Indicates the first The original displacement data of the local observation window starting point corresponding to each time point; Indicates the first The first-order difference gradient data at each time step; Represents a minimal constant; Represents the absolute value function; Represents an exponential function with the natural constant as its base; The global trend sign function is defined as follows: when the net directed displacement of the window is greater than the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant 1; when the net directed displacement of the window is less than the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant -1; and when the net directed displacement of the window is equal to the constant 0, the dominant trend direction identifier corresponding to the target sampling time is set to the constant 0. This represents the maximum value function.
[0076] It should be noted that, in order to separate isolated flying point noise from abrupt changes in the initial residual, the displacement direction consistency factor of this invention... This invention employs a combination of a net displacement ratio term and a reverse foldback attenuation term. Existing residual judgment mechanisms primarily rely on the deviation at the current moment, making it difficult to identify the fallback process after data jumps. Therefore, this invention constructs a first part, the net displacement ratio term, which characterizes the trajectory features by calculating the ratio of the absolute value of the linear net displacement from the start to the end of the observation window to the sum of the absolute values of all first-order differential gradients within the window. When the sensor sweeps across a local reflective area, generating isolated flying point noise, the displacement data will exhibit a rise followed by a fall. At this time, the linear net displacement between the start and end points is relatively small, while the denominator accumulates all displacement change paths during the rise and fall process, making the ratio smaller, thus limiting the algorithm's tracking response to flying point noise in the initial stage. Considering that if there are continuous small flying point jumps or irregular reflections on the surface of the object under test, the linear net displacement within the window may not be zero, making the net displacement ratio term insufficient to suppress noise. Therefore, this invention further constructs a second part, the reverse foldback attenuation term, to supplement the constraint. This attenuation term first uses a global trend sign function. Determine the dominant direction of displacement change within the current window, and then use the maximum value function. The first-order differential gradient opposite to the dominant direction is extracted point-by-point within the window. Isolated flying point noise inevitably generates inverse return gradients during the fallback phase. These inverse gradients are extracted and accumulated, and then nonlinearly decayed using an exponential function. Under this combined design, when the sensor scans the real structural step surface, since the displacement data is monotonically changing and there are no inverse return gradients, the calculated result of the exponential decay term is 1, and the net displacement proportion term is also at a high level. This makes... This allows for the preservation of amplification of the basic weights, ensuring the algorithm tracks the true step contours in a timely manner. However, when isolated flying point noise is mixed into the data, the accumulation of the inverse foldback gradient triggers the decay effect of the exponential function. Combined with the calculation result of the net displacement proportion term, this influences the displacement direction consistency factor. This reduces the noise level, thereby blocking the adaptive exponential smoothing filter algorithm from erroneously tracking flying point noise.
[0077] Thus, the process of obtaining the displacement direction consistency factor by performing net displacement ratio analysis and reverse return energy attenuation processing on the time-series displacement data within a local observation window in the original displacement data sequence was completed.
[0078] Step S3: By performing maximum gradient proportion analysis and residual energy decay processing on the time-series displacement data within the local observation window in the original displacement data sequence, the gradient energy concentration factor is obtained.
[0079] After processing in step S2, the displacement direction consistency factor effectively filters out isolated flying point noise containing reflection characteristics, preserving signals with monotonic variation trends. However, in actual online optical detection, in addition to the real structural step signal, the sensor also collects slowly varying drift signals due to multiple optical reflections or gradual changes in the surface material of the test object. Both of these signals exhibit monotonic changes in the same direction within the observation window, making the existing residual judgment mechanism prone to erroneously amplifying the smoothing weight when encountering continuous slowly varying drift, due to the accumulation of residuals, leading to over-tracking and deformation in the compensation results. Further analysis reveals that the difference between the two lies in the distribution characteristics of their displacement jump energy in the time domain. The displacement change of the real structural step signal usually occurs instantaneously, and its first-order differential gradient energy is highly concentrated on one or two sampling points, while the displacement change of the slowly varying drift signal is relatively uniformly distributed throughout the entire observation window. Therefore, in order to further pinpoint the true structural step signal, it is necessary to construct a gradient energy concentration factor. By extracting the proportion of the maximum jump gradient in the total gradient and imposing attenuation constraints on uniformly distributed non-extreme energy, we can accurately distinguish and filter out slowly drifting signals in monotonically changing signals.
[0080] In summary, this invention first extracts the window gradient change feature data by performing first-order differential gradient extraction on the temporal displacement data within a local observation window in the original displacement data sequence. Specifically, for any target sampling time, the length of the local observation window is obtained from the initialization algorithm parameters, and temporal displacement data within the local observation window, with the target sampling time as the window endpoint, is extracted from the original displacement data sequence based on the local observation window length. For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the later sampling time and the original displacement data corresponding to the previous sampling time is used as the first-order differential gradient data for the corresponding adjacent sampling time. The absolute value of each first-order differential gradient data within the local observation window is taken to obtain the corresponding absolute gradient value data, and all absolute gradient values within the local observation window are summed to obtain the total gradient energy assessment of the window. The temporal displacement data, first-order differential gradient data, absolute gradient value data, and total gradient energy assessment of the window within the local observation window are used as the window gradient change feature data corresponding to the target sampling time.
[0081] After obtaining the window gradient change feature data, further processing is performed on the window gradient change feature data to obtain the maximum gradient proportion feature data. Specifically, for any target sampling time, the absolute gradient value data and the total gradient energy assessment of the target sampling time are extracted from the window gradient change feature data, and the minimum normal number is extracted from the initial algorithm parameters. All absolute gradient values within the local observation window are numerically compared, and the gradient absolute value with the largest value is taken as the maximum gradient assessment corresponding to the target sampling time. The maximum gradient assessment is used as the numerator, and the result of adding the total gradient energy assessment of the window and the minimum normal number is used as the denominator. The resulting fraction is taken as the maximum gradient proportion assessment corresponding to the target sampling time. The maximum gradient assessment and the maximum gradient proportion assessment corresponding to the target sampling time are used as the maximum gradient proportion feature data.
[0082] After obtaining the maximum gradient proportion feature data, the gradient energy concentration factor is obtained by performing residual gradient energy decay mapping on the maximum gradient proportion feature data and the window gradient change feature data. Specifically, for any target sampling time, the maximum gradient assessment and maximum gradient proportion assessment corresponding to the target sampling time are extracted from the maximum gradient proportion feature data, and the total window gradient energy assessment corresponding to the target sampling time is extracted from the window gradient change feature data. The difference between the total window gradient energy assessment and the maximum gradient assessment is used as the residual gradient energy assessment corresponding to the target sampling time. The minimum positive constant is extracted from the initial algorithm parameters. The residual gradient energy assessment is used as the numerator, and the result of adding the maximum gradient assessment and the minimum positive constant is used as the denominator. The resulting fraction is used as the residual gradient energy proportion assessment corresponding to the target sampling time. The negative of the residual gradient energy proportion assessment is subjected to exponential mapping with the natural constant as the base to obtain the residual gradient energy decay assessment corresponding to the target sampling time. The maximum gradient proportion assessment and the residual gradient energy decay assessment are multiplied to obtain the gradient energy concentration factor corresponding to the target sampling time.
[0083] In one embodiment, the first The expression for calculating the gradient energy concentration factor at time is:
[0084]
[0085] in, Indicates the first Gradient energy concentration factor at each moment; Indicates the first The first-order difference gradient data at each time step.
[0086] It should be noted that, in order to accurately filter out slowly drifting signals from signals with consistent direction, the gradient energy concentration factor of this invention... The method employs a maximum gradient proportion term and a residual energy decay term. Existing residual mechanisms lack an assessment of the data distribution within the window. Therefore, this invention constructs a first part, the maximum gradient proportion term, which initially quantifies the concentration of jump energy by calculating the ratio of the absolute value of the maximum gradient to the sum of the absolute values of all gradients within the observation window. When the sensor experiences gradual drift due to multiple optical reflections, the displacement data exhibits a relatively uniform rise or fall within the window. At this time, the differences between the gradient values within the window are small, and the proportion of the maximum gradient in the total gradient is low. Consequently, the calculated result of this proportion term decreases, initially limiting the tracking weight of the gradually drifting signal. Considering that a shorter observation window may reduce the discriminative power of the maximum gradient proportion term, this invention further constructs a second part, the residual energy decay term, for deeper constraints. This term extracts the residual distributed energy other than the dominant jump gradient by calculating the difference between the absolute value of the total gradient and the absolute value of the maximum gradient. For slowly varying drift signals, the residual energy within the window is relatively large due to their relatively uniform change. However, for real structural step signals, almost all displacement changes are concentrated at the instant of the step, and the residual energy within the window is close to zero. This residual energy is compared with the maximum gradient and then nonlinearly mapped using an exponential function. Under this combined design, when encountering slowly varying drift signals, the proportion of the first part is low, and the large residual energy triggers the decay effect of the exponential function. Both factors contribute to... To maintain a low level and prevent overcompensation, when encountering a real structural step signal, the maximum gradient dominates within the window, with the first part accounting for a high proportion, and the remaining distributed energy approaching zero. The calculated result of the exponential decay term is close to 1, thus making the gradient energy concentration factor... Maintain a high value. Combining the results of step S2, the algorithm can finally lock the true step contour and release reasonable tracking weights.
[0087] Thus, the gradient energy concentration factor was obtained by performing maximum gradient proportion analysis and residual energy decay processing on the temporal displacement data within the local observation window of the original displacement data sequence.
[0088] Step S4: By coupling the displacement direction consistency factor and the gradient energy concentration factor to the residual mapping mechanism of the adaptive exponential smoothing filter algorithm, a dynamic compensation displacement data sequence is obtained.
[0089] After obtaining the displacement direction consistency factor and gradient energy concentration factor constructed in the aforementioned steps, these are used as dynamic adjustment multipliers and integrated into the residual mapping mechanism of the existing adaptive exponential smoothing filter algorithm. Existing algorithms convert the current observation residual into additional weights through a residual mapping function, but a single residual mapping is highly susceptible to misjudgments due to different types of noise. This invention multiplies the displacement direction consistency factor and the gradient energy concentration factor to form a joint dynamic gating adjustment, which directly affects the residual mapping result of the original algorithm.
[0090] The overall algorithm's execution logic is as follows: At the current moment, the algorithm first calculates the absolute residual between the current original displacement data and the compensation output value of the previous moment, and substitutes it into the basic residual mapping function to obtain the initial tracking weight. Subsequently, the algorithm calls the joint dynamic gating adjustment constructed in this embodiment to multiply and correct this initial weight. Only when the data trajectory is determined to be a real structural step signal will the joint adjustment output a value close to 1, allowing the release of additional tracking weights; when facing isolated flying points or gradual drift, the joint adjustment rapidly decays to zero, blocking the amplification instruction of the initial weight. Next, the algorithm uses the corrected composite adaptive smoothing weight to perform a weighted summation of the current original displacement data and the compensation output value of the previous moment to calculate the final compensation output value at the current moment. After completing the data compensation calculation at the current moment, let the sampling time... Simultaneously, the local observation window is moved forward by one sampling step along the time axis, the original displacement data for the next moment is read in, and the calculation and data compensation process of the above-mentioned composite dynamic compensation adjustment is continuously iterated. When the online scanning task is completed and the entire original displacement data sequence is processed, the iterative calculation ends, and the system summarizes and outputs the complete dynamic compensation displacement data sequence.
[0091] Specifically, for any target sampling time, the original displacement data corresponding to the target sampling time is extracted from the original displacement data sequence, and the dynamic compensation output value corresponding to the previous sampling time is obtained; the absolute value of the difference between the original displacement data corresponding to the target sampling time and the dynamic compensation output value corresponding to the previous sampling time is used as the original observation residual evaluation corresponding to the target sampling time.
[0092] In this embodiment of the invention, the maximum permissible additional tracking weight and residual mapping sensitivity coefficient are set in the adaptive exponential smoothing filtering algorithm. The maximum permissible additional tracking weight is set to 0.8, and the residual mapping sensitivity coefficient is set to 0.05. The negative of the result of multiplying the residual mapping sensitivity coefficient by the original observation residual assessment is exponentially mapped to the base of the natural constant to obtain the residual decay mapping assessment. The difference between the constant 1 and the residual decay mapping assessment is used as the residual saturation growth assessment; the result of multiplying the maximum permissible additional tracking weight by the residual saturation growth assessment is used as the basic residual mapping weight corresponding to the target sampling time. The displacement direction consistency factor and gradient energy concentration factor corresponding to the target sampling time are obtained. The displacement direction consistency factor and gradient energy concentration factor are multiplied to obtain the composite dynamic gating adjustment amount corresponding to the target sampling time. The composite dynamic gating adjustment amount is multiplied by the basic residual mapping weight to obtain the additional tracking weight corresponding to the target sampling time.
[0093] The basic smoothing coefficient is extracted from the initialization algorithm parameters. This basic smoothing coefficient is then added to the additional tracking weights to obtain the composite adaptive smoothing weights corresponding to the target sampling time. These composite adaptive smoothing weights are multiplied by the original displacement data corresponding to the target sampling time to obtain the current observation weighted data for that time. The difference between the constant 1 and the composite adaptive smoothing weights is used as the historical compensation retention weight. This historical compensation retention weight is then multiplied by the dynamic compensation output value corresponding to the previous sampling time to obtain the historical compensation weighted data for the target sampling time. The current observation weighted data is then added to the historical compensation weighted data to obtain the dynamic compensation output value for the target sampling time. Finally, the dynamic compensation output values for each sampling time are arranged according to their chronological order to obtain the dynamic compensation displacement data sequence.
[0094] Thus, the residual mapping mechanism, which couples the displacement direction consistency factor and the gradient energy concentration factor to the adaptive exponential smoothing filter algorithm, is completed, and the dynamically compensated displacement data sequence is obtained.
[0095] Step S5: By restoring the surface contour data from the dynamic compensation displacement data sequence, the dynamic compensation result of the online detection data of the optical displacement sensor is obtained.
[0096] After completing the iterative calculation in step S4, the system summarizes the dynamic compensation output values corresponding to each sampling time in chronological order, forming a complete dynamic compensation displacement data sequence. Since the dynamic compensation displacement data sequence has incorporated the joint constraints of the displacement direction consistency factor and the gradient energy concentration factor during the adaptive exponential smoothing filtering process, it can retain the true structural step signal while suppressing the interference of isolated flying point noise and slowly varying drift signals on the compensation output values.
[0097] Furthermore, the dynamically compensated displacement data sequence is used as the data basis for reconstructing the surface contour of the object under test. Based on the scanning direction and sampling frequency of the optical displacement sensor, as well as the relative motion velocity between the object under test and the optical displacement sensor, the dynamically compensated output value corresponding to each sampling moment is mapped to the corresponding scanning position on the surface of the object under test, thus obtaining the compensated contour data of the object's surface. This compensated contour data is used to characterize the actual displacement change state of the object's surface along the scanning path and serves as the dynamic compensation result of the online detection data from the optical displacement sensor.
[0098] In practical applications, the dynamic compensation results of online detection data from optical displacement sensors can be transmitted to a host computer or online detection and analysis module for subsequent surface defect identification, dimensional measurement, or 3D morphology reconstruction. Through this processing, false convex hull abrupt changes caused by localized reflection interference in the original displacement data can be reduced, and the amplification of gradual drift deformation caused by multiple optical reflections or material gradients can be suppressed. Simultaneously, the structural step characteristics at the actual surface steps of the object under test are preserved, thereby improving the accuracy of surface contour reconstruction and the stability of online detection results under complex industrial inspection conditions.
[0099] Thus, the dynamic compensation results of the online detection data of the optical displacement sensor are obtained by restoring the surface contour data from the dynamic compensation displacement data sequence.
[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for dynamic compensation of online detection data from an optical displacement sensor, characterized in that, The method includes: Step S1: Obtain the original displacement data generated by the online continuous scanning of the surface of the object under test by the optical displacement sensor, and perform data preprocessing and algorithm parameter initialization to obtain the original displacement data sequence and initialize the algorithm parameters; Step S2: By performing net displacement ratio analysis and reverse return energy attenuation processing on the time-series displacement data within the local observation window in the original displacement data sequence, the displacement direction consistency factor is obtained; Step S3: Obtain the gradient energy concentration factor by performing maximum gradient proportion analysis and residual energy decay processing on the time-series displacement data within the local observation window in the original displacement data sequence; Step S4: By coupling the displacement direction consistency factor and the gradient energy concentration factor to the residual mapping mechanism of the adaptive exponential smoothing filter algorithm, the dynamic compensation displacement data sequence is obtained; Step S5: Obtain the dynamic compensation result of the online detection data of the optical displacement sensor by restoring the surface contour data of the dynamic compensation displacement data sequence.
2. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 1, characterized in that, The process involves acquiring raw displacement data generated by online continuous scanning of the surface of the object under test using an optical displacement sensor, performing data preprocessing and algorithm parameter initialization, and obtaining the raw displacement data sequence and initializing the algorithm parameters, including: An optical displacement sensor is deployed at the industrial online inspection site, with the detection end of the optical displacement sensor facing the surface of the object to be measured; the sampling frequency of the optical displacement sensor is set, and the surface of the object to be measured is continuously scanned online during the relative movement process according to the set sampling frequency to obtain the original displacement data corresponding to each sampling time, and the original displacement data are arranged according to the order of the sampling time to obtain the initial displacement data sequence. The initial displacement data sequence is processed by removing abnormal and invalid values and filling in missing sampling points. The original displacement data that exceeds the preset effective displacement range is removed, and the original displacement data corresponding to the missing sampling points is filled in by linear interpolation to obtain the original displacement data sequence. Set the basic smoothing coefficient for the adaptive exponential smoothing filter algorithm, take the first original displacement data in the original displacement data sequence as the initial compensation output value, and set the local observation window length and the minimum normal number to prevent the denominator from being zero. Use the basic smoothing coefficient, the initial compensation output value, the local observation window length, and the minimum normal number as the initialization algorithm parameters.
3. The dynamic compensation method for online detection data of an optical displacement sensor according to claim 1, characterized in that, The process involves analyzing the net displacement proportion and performing reverse foldback energy attenuation processing on the temporal displacement data within a local observation window of the original displacement data sequence to obtain a displacement direction consistency factor, including: By performing start-end displacement difference analysis and first-order difference statistical processing on the time-series displacement data within a local observation window in the original displacement data sequence, the characteristic data of window displacement change are obtained. By analyzing the net displacement ratio, identifying the dominant trend direction, and mapping the reverse return energy attenuation of the window displacement change characteristic data, the displacement direction consistency factor is obtained.
4. The dynamic compensation method for online detection data of an optical displacement sensor according to claim 3, characterized in that, The process involves performing start-end displacement difference analysis and first-order difference statistical processing on the time-series displacement data within a local observation window in the original displacement data sequence to obtain window displacement change characteristic data, including: For any target sampling time, the local observation window length is obtained from the initialization algorithm parameters, and the temporal displacement data within the local observation window with the target sampling time as the end point is extracted from the original displacement data sequence based on the local observation window length. The original displacement data corresponding to the end point of the window within the local observation window is used as the original displacement data of the end point of the window. The original displacement data corresponding to the start point of the window within the local observation window is used as the original displacement data of the start point of the window. The difference between the original displacement data of the end point of the window and the original displacement data of the start point of the window is used as the directed net displacement data of the window. The absolute value of the directed net displacement data of the window is used as the net displacement evaluation of the window. For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the next sampling time and the original displacement data corresponding to the previous sampling time is taken as the first-order differential gradient data of the corresponding adjacent sampling time, and the absolute value of each first-order differential gradient data is taken to obtain the corresponding gradient absolute value data. The absolute values of all gradients within the local observation window are summed to obtain the window gradient path length assessment. The original displacement data at the window start point, the original displacement data at the window end point, the directed net displacement data of the window, the net displacement assessment of the window, the first-order difference gradient data, the absolute value data of the gradients, and the window gradient path length assessment are used as the window displacement change characteristic data.
5. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 3, characterized in that, The process involves analyzing the net displacement percentage, identifying the dominant trend direction, and mapping the reverse return energy decay to obtain a displacement direction consistency factor, including: For any target sampling time, extract the net window displacement assessment and window gradient path length assessment corresponding to the target sampling time from the window displacement change feature data, and extract the minimum normal number from the initialization algorithm parameters; use the net window displacement assessment as the numerator, add the window gradient path length assessment and the minimum normal number as the denominator, and use the corresponding fraction as the net displacement ratio assessment corresponding to the target sampling time. Extract the directed net displacement data of the window corresponding to the target sampling time from the window displacement change feature data. When the directed net displacement data of the window is greater than the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant 1; when the directed net displacement data of the window is less than the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant -1; when the directed net displacement data of the window is equal to the constant 0, set the dominant trend direction identifier corresponding to the target sampling time to the constant 0. For any first-order differential gradient data within the local observation window, multiply the dominant trend direction indicator corresponding to the target sampling time with the first-order differential gradient data to obtain the corresponding consistent direction gradient evaluation; use the negative of the consistent direction gradient evaluation as the back-curved candidate gradient evaluation; when the back-curved candidate gradient evaluation is less than a constant 0, set the inverse back-curved gradient data of the corresponding first-order differential gradient data to a constant 0; when the back-curved candidate gradient evaluation is greater than or equal to a constant 0, use the back-curved candidate gradient evaluation as the inverse back-curved gradient data of the corresponding first-order differential gradient data. The reverse return gradient data within the local observation window are summed to obtain the reverse return energy assessment. The reverse return energy assessment is used as the numerator, and the result of adding the window net displacement assessment and the minimum normal number is used as the denominator. The corresponding fraction is used as the reverse return energy proportion assessment. The negative of the reverse return energy proportion assessment is subjected to an exponential mapping with the natural constant as the base to obtain the reverse return energy decay assessment. The net displacement percentage assessment is multiplied by the reverse return energy attenuation assessment to obtain the displacement direction consistency factor corresponding to the target sampling time.
6. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 1, characterized in that, The step involves performing maximum gradient proportion analysis and residual energy decay processing on the temporal displacement data within a local observation window in the original displacement data sequence to obtain the gradient energy concentration factor, including: By performing first-order differential gradient extraction on the temporal displacement data within a local observation window in the original displacement data sequence, the window gradient change feature data is obtained. By performing gradient magnitude statistics and maximum gradient identification on the window gradient change feature data, the maximum gradient proportion feature data is obtained. The gradient energy concentration factor is obtained by performing residual gradient energy decay mapping on the maximum gradient proportion feature data and the window gradient change feature data.
7. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 6, characterized in that, The process involves extracting the first-order differential gradient from the temporal displacement data within a local observation window in the original displacement data sequence to obtain window gradient change feature data, including: For any target sampling time, the local observation window length is obtained from the initialization algorithm parameters, and the temporal displacement data within the local observation window with the target sampling time as the end point is extracted from the original displacement data sequence based on the local observation window length. For any adjacent sampling time within the local observation window, the difference between the original displacement data corresponding to the later sampling time and the original displacement data corresponding to the previous sampling time is taken as the first-order difference gradient data of the corresponding adjacent sampling time. Take the absolute value of each first-order difference gradient data within the local observation window to obtain the corresponding absolute gradient data, and add up all the absolute gradient data within the local observation window to obtain the total gradient energy assessment of the window. The temporal displacement data, first-order differential gradient data, absolute gradient value data, and total energy assessment of the window gradient within the local observation window are used as the window gradient change characteristic data corresponding to the target sampling time.
8. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 6, characterized in that, The process of obtaining maximum gradient proportion feature data by performing gradient magnitude statistics and maximum gradient identification on the window gradient change feature data includes: For any target sampling time, extract the absolute value of the gradient corresponding to the target sampling time and the total energy evaluation of the window gradient from the window gradient change feature data, and extract the minimum normal number from the initialization algorithm parameters; Numerical comparison is performed on all gradient absolute value data within the local observation window, and the gradient absolute value data with the largest value is used as the maximum gradient evaluation corresponding to the target sampling time. The maximum gradient assessment is used as the numerator, the total energy assessment of the window gradient is added to the minimum normal number as the denominator, and the corresponding fraction is used as the assessment of the maximum gradient proportion at the target sampling time. The maximum gradient evaluation and maximum gradient proportion evaluation corresponding to the target sampling time are used as the maximum gradient proportion feature data.
9. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 6, characterized in that, The step of obtaining the gradient energy concentration factor by performing residual gradient energy decay mapping processing on the maximum gradient proportion feature data and the window gradient change feature data includes: For any target sampling time, extract the maximum gradient evaluation and maximum gradient proportion evaluation corresponding to the target sampling time from the maximum gradient proportion feature data, and extract the total energy evaluation of the window gradient corresponding to the target sampling time from the window gradient change feature data. The difference between the total energy assessment of the window gradient and the maximum gradient assessment is used as the residual gradient energy assessment at the target sampling time. Extract the minimum positive constant from the initialization algorithm parameters, use the residual gradient energy evaluation as the numerator, use the calculation result of adding the maximum gradient evaluation and the minimum positive constant as the denominator, and use the corresponding fraction as the residual gradient energy ratio evaluation at the target sampling time. The negative of the residual gradient energy percentage assessment is subjected to an exponential mapping with the natural constant as the base, to obtain the residual gradient energy decay assessment corresponding to the target sampling time. Multiply the maximum gradient proportion assessment by the residual gradient energy decay assessment to obtain the gradient energy concentration factor corresponding to the target sampling time.
10. The method for dynamic compensation of online detection data of an optical displacement sensor according to claim 1, characterized in that, The method of obtaining a dynamically compensated displacement data sequence by coupling the displacement direction consistency factor and the gradient energy concentration factor to the residual mapping mechanism of the adaptive exponential smoothing filter algorithm includes: For any target sampling time, extract the original displacement data corresponding to the target sampling time from the original displacement data sequence, and obtain the dynamic compensation output value corresponding to the previous sampling time of the target sampling time; use the absolute value of the difference between the original displacement data corresponding to the target sampling time and the dynamic compensation output value corresponding to the previous sampling time as the original observation residual evaluation corresponding to the target sampling time. Define the maximum allowable additional tracking weight and residual mapping sensitivity coefficient in the adaptive exponential smoothing filter algorithm; perform an exponential mapping with the natural constant as the base of the result of multiplying the residual mapping sensitivity coefficient by the original observation residual evaluation to obtain the residual decay mapping evaluation; use the difference between the constant 1 and the residual decay mapping evaluation as the residual saturation growth evaluation; use the result of multiplying the maximum allowable additional tracking weight by the residual saturation growth evaluation as the basic residual mapping weight corresponding to the target sampling time. Obtain the displacement direction consistency factor and gradient energy concentration factor corresponding to the target sampling time. Multiply the displacement direction consistency factor and gradient energy concentration factor to obtain the composite dynamic gating adjustment amount corresponding to the target sampling time. Multiply the composite dynamic gating adjustment amount and the basic residual mapping weight to obtain the additional tracking weight corresponding to the target sampling time. Extract the basic smoothing coefficient from the initialization algorithm parameters, add the basic smoothing coefficient to the additional tracking weight, and obtain the composite adaptive smoothing weight corresponding to the target sampling time. Multiply the composite adaptive smoothing weights with the original displacement data corresponding to the target sampling time to obtain the current observation weighted data corresponding to the target sampling time; use the difference between the constant 1 and the composite adaptive smoothing weights as the historical compensation retention weights, and multiply the historical compensation retention weights with the dynamic compensation output value corresponding to the previous sampling time to obtain the historical compensation weighted data corresponding to the target sampling time; add the current observation weighted data with the historical compensation weighted data to obtain the dynamic compensation output value corresponding to the target sampling time. The dynamic compensation output values corresponding to each sampling time are arranged in chronological order to obtain the dynamic compensation displacement data sequence.