A high-precision grating encoding contact displacement measurement sensor calibration method
By dividing and clustering the workpiece surface into grids and combining them with a deep learning model to predict contact force and error, the problem of low measurement accuracy of traditional sensors on complex surfaces is solved, and high-precision workpiece height measurement is achieved.
Patent Information
- Application Number
- CN202511047776.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-07-29
AI Technical Summary
Traditional grating-encoded contact displacement sensors cannot meet the requirements for high-precision detection because the differences in surface features in different areas of complex workpieces lead to measurement deviations.
By dividing the workpiece surface into a mesh, identifying and clustering the surface roughness and curvature of the mesh regions, and combining the material characteristics of the workpiece and the contact head, a deep learning model is used to predict the contact force and measurement error, and to perform error analysis and compensation.
It significantly improves the measurement accuracy and stability of workpieces with complex surfaces, accurately reflects the height of the workpiece, and meets the requirements of high-precision inspection.
Smart Images

Figure CN120668034B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of metrology, in particular to a high-precision grating encoding contact displacement measurement sensor calibration method. BACKGROUND
[0002] In industrial detection, grating displacement sensors are often used for workpiece surface height detection. For complex irregular surface workpieces such as special-shaped parts and mold cavities, there are significant regional differences in surface roughness and curvature. When the sensor contact head contacts the workpiece surface, the surface features of different regions will cause changes in contact force, thereby causing measurement value deviations and affecting the accuracy of the final detection results. The traditional calibration method does not consider the feature differences of different regions of the workpiece surface, and uses a unified calibration method, which cannot accurately predict and compensate errors, resulting in low measurement result accuracy and failing to meet the needs of high-precision detection. SUMMARY
[0003] The present application provides a high-precision grating encoding contact displacement measurement sensor calibration method to solve the problem of low measurement result accuracy of grating encoding contact displacement measurement sensors in the prior art, which cannot meet the needs of high-precision detection.
[0004] The technical solution of the present application to solve the above technical problems is as follows:
[0005] In a first aspect, the present application provides a high-precision grating encoding contact displacement measurement sensor calibration method, comprising: dividing the workpiece surface according to a preset grid size, obtaining a plurality of surface roughnesses of a plurality of grid regions according to workpiece surface image recognition, and obtaining a plurality of surface curvatures of the plurality of grid regions; clustering the plurality of grid regions based on the plurality of surface roughnesses and the plurality of surface curvatures to obtain a plurality of homogeneous grid region sets, wherein each homogeneous grid region set has a surface roughness identifier and a surface curvature identifier; predicting the measurement contact force according to the surface roughness identifier and the surface curvature identifier based on the workpiece material properties, the contact head material properties, and the contact head surface features, and analyzing the height measurement error according to a plurality of predicted contact forces to output a plurality of predicted height measurement errors; measuring the height of the plurality of grid regions of the workpiece surface by a high-precision grating encoding contact displacement measurement sensor, mapping and compensating a plurality of region height measurement values based on the plurality of homogeneous grid region sets according to the plurality of predicted height measurement errors, and outputting the workpiece height measurement result.
[0006] Optionally, dividing the workpiece surface according to a preset grid size, and obtaining a plurality of surface roughnesses of a plurality of grid regions according to workpiece surface image recognition, comprises:
[0007] The workpiece surface is divided into several grid regions according to a preset grid size. Images of the workpiece surface are acquired using a CCD image sensor, and the images are segmented according to the several grid regions to obtain several surface images of the regions. After grayscale processing of the several surface images of the regions, the coefficient of variation of the pixel grayscale values in each region is calculated, and the several coefficients of variation are normalized to obtain several surface roughnesses. The coefficient of variation is the ratio of the standard deviation to the mean of the pixel grayscale values in the region.
[0008] Optionally, based on the plurality of surface roughnesses and the plurality of surface curvatures, the plurality of grid regions are clustered to obtain multiple sets of similar grid regions, including: obtaining the expected error ratio of workpiece height measurement, setting the ratio of the expected error ratio to the standard error ratio of similar workpieces as a step size adjustment coefficient; adjusting the preset clustering step size according to the step size adjustment coefficient to obtain an adapted clustering step size, wherein the adapted clustering step size includes an adapted surface roughness step size and an adapted surface curvature step size; clustering the plurality of grid regions according to the adapted surface roughness step size and the adapted surface curvature step size based on the plurality of surface roughnesses and the plurality of surface curvatures to obtain multiple sets of similar grid regions, wherein the surface roughness deviation of the grid regions in the set of similar grid regions is less than or equal to the adapted surface roughness step size and the surface curvature deviation is less than or equal to the adapted surface curvature step size.
[0009] Specifically, the average surface roughness and surface curvature of multiple grid regions within the same type of grid region are calculated, and the average surface roughness of the same type of grid region is set as the surface roughness identifier, and the average surface curvature is set as the surface curvature identifier.
[0010] Optionally, based on the workpiece material properties, contact head material properties, and contact head surface features, the measured contact force is predicted according to the surface roughness identifier and surface curvature identifier. This includes: using the workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, collecting a set of sample workpiece surface roughness and a set of sample workpiece surface curvature, and obtaining the historical contact force deviation ratio under different sample workpiece surface roughness and surface curvature, setting it as the sample contact force deviation coefficient, and obtaining a set of sample contact force deviation coefficients; using the set of sample workpiece surface roughness and the set of sample workpiece surface curvature as input, and using the set of sample contact force deviation coefficients as supervision, training a deep learning model until convergence to obtain a contact force deviation analyzer; using the contact force deviation analyzer, analyzing according to the surface roughness identifier and surface curvature identifier to obtain multiple predicted contact force deviation coefficients, adjusting the preset contact force of the sensor, and outputting multiple predicted contact forces.
[0011] Optionally, height measurement error analysis is performed based on multiple predicted contact forces to output multiple predicted height measurement errors. This includes: collecting a sample measurement contact force set using workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, and obtaining historical height measurement errors under different sample measurement contact forces to obtain a sample measurement error set; training a deep learning model to convergence using the sample measurement contact force set and the sample measurement error set to obtain a measurement error predictor; performing height measurement error analysis on the multiple predicted contact forces to output multiple predicted height measurement errors.
[0012] Optionally, based on the multiple sets of similar grid regions, the height measurement values of several regions are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement result is output. This includes: establishing a compensation mapping relationship between the predicted height measurement errors and the grid regions based on the multiple sets of similar grid regions and the multiple predicted height measurement errors; according to the compensation mapping relationship, the height measurement values of several regions are mapped and compensated according to the multiple predicted height measurement errors, and the height measurement values of several compensated regions are output and stitched together to obtain the workpiece height measurement result.
[0013] By implementing this invention, it is possible to divide the workpiece surface according to a preset grid size, obtain several surface roughnesses of several grid regions based on workpiece surface image recognition, and obtain several surface curvatures of the several grid regions. This decomposes the complex workpiece surface into multiple grid units that can be analyzed individually, accurately captures the surface features of different local areas, and achieves automated and objective acquisition of surface roughness and curvature through image recognition and quantitative calculation, avoiding the subjectivity of manual measurement and providing reliable basic data for subsequent calibration work.
[0014] By implementing this invention, it is possible to cluster several grid regions based on several surface roughnesses and several surface curvatures to obtain multiple sets of similar grid regions. Each set of similar grid regions has a surface roughness identifier and a surface curvature identifier, grouping grid regions with similar surface features into one category, reducing the complexity of subsequent processing and improving calibration efficiency. The dynamically adjusted clustering step size can adapt to the accuracy requirements of actual measurements, making the clustering results more consistent with the actual situation. The identifier of the similar region set provides a clear basis for unified analysis and processing of this type of region.
[0015] By implementing this invention, it is possible to predict the contact force based on the workpiece material properties, contact head material properties, and contact head surface characteristics, according to the surface roughness and surface curvature indicators. Furthermore, height measurement error analysis is performed based on multiple predicted contact forces, outputting multiple predicted height measurement errors. This fully considers the influence of key factors such as material on the contact force. By using a deep learning model and historical data for prediction, the contact force and corresponding height measurement errors in different areas can be accurately obtained, achieving a forward-looking analysis of the errors and providing a precise quantitative reference for subsequent compensation.
[0016] By implementing this invention, it is possible to measure the height of several grid regions on the surface of a workpiece using a high-precision grating-coded contact displacement sensor. Based on the multiple sets of similar grid regions, the height measurement values of several regions are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement result is output. Targeted error compensation is performed for different types of grid regions, which can effectively correct measurement deviations caused by differences in surface features, significantly improve the overall measurement accuracy, and the stitched result can completely and accurately reflect the height of the workpiece surface, meeting the measurement needs of complex workpieces.
[0017] In summary, by implementing this invention, the measurement error caused by contact force fluctuations due to differences in workpiece surface roughness and curvature can be effectively eliminated, and the height measurement accuracy and stability of high-precision grating-encoded contact displacement measurement sensors for complex surface workpieces can be significantly improved. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a calibration method for a high-precision grating-encoded contact displacement measurement sensor provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0021] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.
[0022] Example 1, as Figure 1 As shown, this embodiment of the invention provides a calibration method for a high-precision grating-coded contact displacement measurement sensor, comprising:
[0023] S100: Divide the workpiece surface according to the preset grid size, obtain several surface roughnesses of several grid regions based on the workpiece surface image recognition, and obtain several surface curvatures of the several grid regions.
[0024] S200: Based on the aforementioned surface roughness and surface curvature, the aforementioned mesh regions are clustered to obtain multiple sets of mesh regions of the same type, wherein each set of mesh regions of the same type has a surface roughness identifier and a surface curvature identifier.
[0025] S300: Based on the workpiece material properties, contact head material properties, and contact head surface characteristics, the contact force is predicted according to the surface roughness mark and surface curvature mark, and the height measurement error is analyzed based on multiple predicted contact forces, and multiple predicted height measurement errors are output.
[0026] S400: The height of several grid areas on the surface of the workpiece is measured by a high-precision grating-encoded contact displacement measurement sensor. Based on the multiple sets of similar grid areas, the height measurement values of several areas are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement result is output.
[0027] In step S100 of this embodiment, the workpiece surface is divided according to a preset grid size, and several surface roughnesses of several grid regions are obtained based on the workpiece surface image recognition, including:
[0028] The workpiece surface is divided according to the preset grid size to generate several grid regions;
[0029] The workpiece surface is imaged using a CCD image sensor, and the image is segmented according to the aforementioned grid regions to obtain surface images of several regions.
[0030] After performing grayscale processing on the surface images of the several regions, the coefficient of variation of the pixel grayscale values in each region is calculated, and the coefficients of variation are normalized to obtain several surface roughnesses. The coefficient of variation is the ratio of the standard deviation to the mean of the pixel grayscale values in the region.
[0031] The purpose of step S100 in this embodiment is to transform the complex workpiece surface into quantifiable and analyzable local units and accurately acquire the surface roughness data of each unit, providing a basis for subsequent calibration and compensation based on surface features. Specifically, the workpiece surface needs to be decomposed into multiple small grid regions through mesh generation to avoid ignoring local feature differences due to overall analysis; then, image recognition technology is used to achieve automated and objective measurement of surface roughness, ensuring the accuracy and consistency of roughness data in different regions, thereby supporting the subsequent accurate analysis of contact force and measurement errors.
[0032] In the implementation process, firstly, the workpiece surface needs to be uniformly or adaptively divided according to a preset grid size, i.e., specific length and width parameters. This divides the entire workpiece surface into several independent grid regions, transforming the complex surface into multiple locally analyzable units. For example, consider an irregularly curved metal workpiece with a surface size of 100mm × 100mm. This workpiece surface has multiple areas with varying roughness and curvature. The preset grid size can be 5mm × 5mm, dividing the entire workpiece surface into 400 grid regions. Each region becomes an independent analysis unit; for example, the upper left region is denoted as A1, the adjacent right region as A2, and so on, assigning numbers to all 20*20 regions.
[0033] Then, a CCD image sensor is used to acquire a complete image of the workpiece surface, with a resolution of 1024×1024 pixels. The overall image is then segmented according to the previously defined grid boundaries, for example, into 400 surface images, resulting in a surface image corresponding to each grid region. This ensures that the image features of each local region can be extracted individually. For example, assuming 1mm corresponds to 5.12 pixels, the surface image of region A1 corresponds to a 51×51 pixel sub-image in the upper left corner of the image, and the surface image of region A2 corresponds to its adjacent 51×51 pixel sub-image to the right.
[0034] Furthermore, it is necessary to calculate several surface roughness values for several regions. Optionally, the surface image of each segmented region can be processed into grayscale first, converting the color or complex image into an image containing only grayscale information, simplifying subsequent calculations. For example, the color sub-image of region A1 can be converted into a grayscale image, with pixel grayscale values ranging from 0 (black) to 255 (white). The unevenness of the workpiece surface will exhibit different grayscale values; for example, the reflection is stronger at protrusions, resulting in higher grayscale values, while the grayscale values are lower at depressions. This can be used as a basis for judging the surface roughness of the workpiece.
[0035] Next, for the grayscale processed surface image of the region, the coefficient of variation of all pixel grayscale values within that region is calculated. This coefficient effectively reflects the irregularity of the surface texture and indirectly characterizes the surface roughness. Specifically, it can be calculated as the ratio of the standard deviation to the mean of the pixel grayscale values within the region. Assuming the mean of the pixel grayscale values in region A1 is 120 and the standard deviation is 30, then the coefficient of variation = 30 / 120 = 0.25; for another region A2, the mean of the pixel grayscale values is 150 and the standard deviation is 22.5, then the corresponding coefficient of variation = 22.5 / 150 = 0.15.
[0036] Finally, the coefficients of variation of all surface images are normalized to eliminate numerical differences caused by lighting, shooting conditions, etc., resulting in standardized surface roughness data for comparability across different regions. If the coefficients of variation for all regions range from 0.1 to 0.5, a normalization formula, such as y = (x - 0.1) / (0.5 - 0.1), is used, where x is the coefficient of variation for a region and y is the normalized roughness value. This formula transforms the coefficient of variation of 0.25 in region A1 into a roughness value of 0.375, and the coefficient of variation of 0.15 in region A2 into a roughness value of 0.125, yielding standardized surface roughness values that can be directly used for subsequent cluster analysis. For example, a roughness of 0.375 in region A1 can be defined as representing medium roughness, and a roughness of 0.125 in region A2 can be defined as representing relatively smoothness.
[0037] Furthermore, in step S100 of this application embodiment, it is also necessary to obtain several surface curvatures of the several grid regions.
[0038] Obtaining several surface curvatures of several grid regions also provides key surface feature parameters for subsequent grid region clustering, contact force prediction, and height measurement error analysis.
[0039] In the specific implementation process, after acquiring the surface image of the workpiece through the CCD image sensor and segmenting the surface image of each grid area, the Canny operator and other algorithms can be used to perform edge detection on the grayscale processed surface image to identify the contour lines of the surface area.
[0040] For the extracted region contour lines, curve fitting algorithms such as the least squares method are used to fit the curves to obtain the surface curve equations of the region, such as circular arcs or quadratic curves. Then, based on the fitted curve equations, the radius of curvature is calculated. Finally, the surface curvature of the grid region is determined by the correspondence between the radius of curvature and the surface radii, such as for a circular arc contour, surface radii = 1 / radius of curvature.
[0041] For example, if the surface contour of a certain grid region is determined to be an arc with a radius of 100mm after edge detection and curve fitting, then the surface curvature of this region is 1 / 100mm-1, or 0.01mm-1. After standardization, it can be used to compare and cluster the surface curvature of other regions.
[0042] The standardization method for surface curvature can be as follows: collect the original surface curvature values calculated from all grid regions, denoted as R1, R2, ..., Rn, where n is the total number of grid regions. Then, calculate the minimum value Rmin and the maximum value Rmax among these original surface curvature values to clarify the range of surface curvature data distribution.
[0043] Next, the original surface radian value of each grid region is transformed using a linear normalization formula. The specific formula can be: surface radian Ri′=(Ri-Rmin) / Rmax-Rmin). Here, Ri is the original surface radian value of the i-th grid region among n grid regions, and Ri′ is the normalized surface radian value of the i-th grid region, with the value range mapped to the interval [0,1].
[0044] Through the standardization steps described above, the surface radians of all grid regions are expressed as relative values, where 0 represents the minimum radian and 1 represents the maximum radian, eliminating numerical differences caused by different units and region sizes in the original measurements. For example, if the original radian of region A is 0.01 mm⁻¹ and the original radian of region B is 0.05 mm⁻¹, and if Rmin = 0.005 mm⁻¹ and Rmax = 0.055 mm⁻¹ for all regions, then after standardization: RA′ = (0.01 − 0.005) / (0.055 − 0.005) = 0.1.
[0045] In step S200 of this application embodiment, based on the plurality of surface roughnesses and the plurality of surface curvatures, the plurality of mesh regions are clustered to obtain multiple sets of mesh regions of the same type, including:
[0046] Obtain the expected error ratio of the workpiece height measurement, and set the ratio of the expected error ratio to the standard error ratio of similar workpieces as the step size adjustment coefficient.
[0047] The preset clustering step size is adjusted according to the step size adjustment coefficient to obtain the adaptive clustering step size, wherein the adaptive clustering step size includes the adaptive surface roughness step size and the adaptive surface curvature step size.
[0048] Based on the aforementioned surface roughness and surface curvature, the aforementioned mesh regions are clustered according to the adapted surface roughness step size and the adapted surface curvature step size to obtain multiple sets of similar mesh regions. Among them, the surface roughness deviation and surface curvature deviation of the mesh regions in the set of similar mesh regions are less than or equal to the adapted surface roughness step size and the adapted surface curvature step size, respectively.
[0049] In this embodiment, the core purpose of this step is to classify grid regions with similar surface features, namely surface roughness and surface curvature, into a set of similar grid regions. This lays the foundation for subsequent unified analysis of contact force and height measurement errors and targeted compensation. By dynamically adjusting the clustering step size, the clustering results are adapted to the accuracy requirements of actual measurements. That is, when there is a difference between the expected error ratio and the standard error ratio, the step size adjustment ensures that the division of similar regions is neither too coarse, leading to excessive feature differences and affecting compensation accuracy, nor too fine, thus increasing computational load and reducing efficiency. Ultimately, this achieves a precise match between the clustering results and the error control target.
[0050] First, it's necessary to set the expected error ratio required for calculating the step size adjustment coefficient, which is the proportion of the maximum acceptable error to the measured value in actual testing, for example, requiring the error to not exceed 0.5%. Next, it's necessary to obtain the standard error ratio of similar workpieces, specifically the typical error ratio of such workpieces in industry or historical data, such as 1%. The ratio of the expected error ratio to the standard error ratio of similar workpieces is set as the step size adjustment coefficient, such as 0.5% / 1% = 0.5. This step size adjustment coefficient reflects the difference between the actual accuracy requirements and the standard conditions, providing a quantitative basis for step size adjustment.
[0051] Then, the preset clustering step size needs to be adjusted according to the step size adjustment coefficient to obtain the suitable clustering step size. The preset clustering step size includes a preset surface roughness step size and a preset surface curvature step size. The preset surface roughness step size, such as 0.2, represents the maximum difference in surface roughness between two grid regions allowed to be classified as the same type before dynamic adjustment. The preset surface curvature step size, such as 0.1, represents the maximum difference in surface curvature between two grid regions allowed to be classified as the same type before dynamic adjustment.
[0052] Next, the step size adjustment factor is multiplied by the preset surface roughness step size and the preset surface curvature step size respectively to obtain the adaptive clustering step size. For example, when the step size adjustment factor is 0.5, the adaptive surface roughness step size = 0.2 × 0.5 = 0.1, and the adaptive surface curvature step size = 0.1 × 0.5 = 0.05. At this time, the adaptive step size is smaller than the preset step size, which means that the clustering is more refined and can meet higher accuracy requirements.
[0053] Finally, the various mesh regions need to be clustered according to the adapted surface roughness step size and the adapted surface curvature step size. Specifically, for all mesh regions, clustering is performed based on their standardized surface roughness and surface curvature: for any two regions, if the difference in surface roughness is ≤ the adapted surface roughness step size and the difference in curvature is ≤ the adapted curvature step size, then they are grouped into the same category. This process is repeated until all mesh regions have been grouped, ultimately resulting in multiple sets of mesh regions of the same category.
[0054] For example, if the surface roughness step size of a fitted surface is 0.1 and the surface curvature step size is 0.05, and the surface roughness difference between region A and region B is 0.05 (≤0.1) and the surface curvature difference is 0.03 (≤0.05), then they are grouped into the same set; while the surface roughness difference between region C and region A is 0.2 (>0.1), so they belong to different sets. This ultimately results in multiple sets of similar mesh regions.
[0055] In step S200 of this application embodiment, it is also necessary to calculate the average surface roughness and surface curvature of the multiple grid regions in the multiple similar grid regions, set the average surface roughness of the similar grid regions as the surface roughness identifier, and set the average surface curvature as the surface curvature identifier.
[0056] The core objective of step S200 in this application embodiment is to generate a unified feature identifier, namely a surface roughness identifier and a surface curvature identifier, for each set of similar mesh regions, so as to simplify the feature representation of similar regions and provide standardized input parameters for subsequent contact force prediction and error analysis.
[0057] Then, by calculating the average roughness and radian of similar regions as identifiers, it can represent the overall surface characteristics of such regions, reduce data dimensionality, eliminate the need to process the individual characteristics of each grid, improve the efficiency and accuracy of subsequent model calculations, and ensure that similar regions adopt consistent analysis standards in subsequent calibration processes.
[0058] For example, a set of similar mesh regions contains three mesh regions with surface roughnesses of 0.3, 0.35, and 0.4, and surface curvatures of 0.2, 0.22, and 0.25, respectively. Then, we need to calculate the average surface roughness of this set, such as (0.3 + 0.35 + 0.4) / 3 = 0.35, and set this as the surface roughness identifier for this set of similar mesh regions; we also need to calculate the average surface curvature, such as (0.2 + 0.22 + 0.25) / 3 ≈ 0.223, and set this as the surface curvature identifier.
[0059] In step S300 of this application embodiment, based on the workpiece material properties, contact head material properties, and contact head surface characteristics, the contact force is predicted according to the surface roughness indicator and surface curvature indicator, including:
[0060] Using workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, we collect sample workpiece surface roughness sets and sample workpiece surface curvature sets, and obtain the historical contact force deviation ratios under different sample workpiece surface roughness and sample workpiece surface curvatures, which are set as sample contact force deviation coefficients, and obtain sample contact force deviation coefficient sets.
[0061] Using the sample workpiece surface roughness set and sample workpiece surface curvature set as inputs, and the sample contact force deviation coefficient set as supervision, a deep learning model is trained until convergence to obtain a contact force deviation analyzer.
[0062] The contact force deviation analyzer analyzes the surface roughness and surface curvature indicators to obtain multiple predicted contact force deviation coefficients, adjusts the preset contact force of the sensor, and outputs multiple predicted contact forces.
[0063] In this embodiment, the purpose of the above steps is to accurately predict the contact force of similar grid regions during measurement, providing a basis for subsequent analysis of height measurement errors. By combining key factors such as the material of the workpiece and the contact head, and the surface characteristics of the contact head, a deep learning model is used to establish the correlation between surface features and contact force deviation, thereby achieving targeted prediction of the contact force. This solves the problem of contact force fluctuation caused by differences in surface features in different regions, laying the foundation for subsequent error compensation.
[0064] Specifically, constraints can be set by the material properties of workpieces (metals, plastics, etc.), the material properties of contact heads (ceramics, alloys, etc.), and the surface characteristics of contact heads (smoothness, hardness, etc.). Matching sample workpiece data can be selected from historical measurement data, and the surface roughness and surface curvature sets of these sample workpieces can be collected. For example, a set of constraints could be "aluminum alloy workpiece + ceramic contact head + contact head surface roughness Ra0.1μm" or "stainless steel workpiece + cemented carbide contact head + contact head surface roughness Ra0.2μm", etc.
[0065] Simultaneously, the historical contact force deviation ratio of the corresponding sample workpiece under different surface roughness and surface curvature is recorded, that is, the deviation ratio between the actual contact force and the preset contact force, which is set as the sample contact force deviation coefficient, forming a sample contact force deviation coefficient set. Specifically, it is necessary to record the preset contact force of the sensor, such as fixed values like 5N, 10N, etc., and at the same time, the actual contact force when the contact head contacts the surface of the sample workpiece is collected in real time by the force sensor. The deviation ratio between the actual contact force and the preset contact force is calculated, i.e., (actual contact force - preset contact force) / preset contact force × 100%), which is used as the contact force deviation coefficient of the sample.
[0066] For example, when the workpiece is an aluminum alloy, the contact head is ceramic and has a smooth surface, collect the contact force deviation coefficients corresponding to different surface roughnesses such as 0.2 and 0.3, and surface curvatures such as 0.1 and 0.2, such as 5% and 3%.
[0067] Then, the sample surface roughness, sample surface curvature, and corresponding sample contact force deviation coefficient under each set of constraints are associated and stored to form a structured historical database. For example, under the constraint of "aluminum alloy + ceramic contact head + contact head surface roughness Ra0.1μm", if the surface roughness of a certain sample area is 0.3 and the surface curvature is 0.2, the corresponding contact force deviation coefficient is +3%, that is, the actual contact force is 3% greater than the preset value. Then, (0.3, 0.2, 3%) is stored as a data record in the dataset corresponding to this constraint.
[0068] Furthermore, a contact force deviation analyzer needs to be built to obtain multiple predicted contact force deviation coefficients based on the surface roughness and surface curvature indicators under specific constraints.
[0069] Considering the task type of the contact force deviation analyzer, a multilayer perceptron can be selected for construction. The contact force deviation analyzer consists of three parts: an input layer, a hidden layer, and an output layer. The input layer has two neurons, corresponding to the input surface roughness and surface curvature labels; the hidden layer has three layers, with 64, 32, and 16 neurons per layer, all using the ReLU activation function; the output layer has one neuron, outputting the predicted contact force deviation coefficient.
[0070] For the contact force deviation analyzer parameter settings, the Adam optimizer was used with a learning rate of 0.001. The mean squared error (MSE) loss function was used to measure the difference between the predicted contact force deviation coefficient and the sample contact force deviation coefficient. The batch size was 32, meaning 32 sets of sample data were input for each training iteration.
[0071] The training data is obtained by using the sample data obtained in the aforementioned steps. 1000 sets of sample data are collected under each set of constraints. The initial maximum number of training rounds is set to 200 rounds. When the validation set loss is less than 0.0001 for 10 consecutive rounds, the model is considered to have converged, training is stopped, and the contact force deviation analyzer is obtained.
[0072] Then, the surface roughness and surface curvature identifiers of the same type of grid region set obtained in the previous steps are input into the contact force deviation analyzer. The contact force deviation analyzer outputs the corresponding predicted contact force deviation coefficient, such as 4%. The predicted contact force is then obtained by multiplying the sensor's preset contact force by (1 + prediction deviation coefficient). For example, if the initial preset contact force is 5N, the adjusted predicted contact force is 5N × (1 + 4%) = 5.2N, which is the predicted contact force of this type of region during measurement.
[0073] In step S300 of this application embodiment, height measurement error analysis is performed based on multiple predicted contact forces, and multiple predicted height measurement errors are output, including:
[0074] Using workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, a sample measurement contact force set is collected, and the historical height measurement error under different sample measurement contact forces is obtained to obtain a sample measurement error set.
[0075] The deep learning model is trained to convergence using the sample contact force set and the sample measurement error set to obtain a measurement error predictor. The height measurement error is analyzed on the multiple predicted contact forces, and multiple predicted height measurement errors are output.
[0076] In this embodiment, the purpose of the above steps is to establish the correlation between the predicted contact force and the height measurement error, thereby accurately obtaining the height measurement error corresponding to the same set of grid regions, providing a basis for subsequent mapping compensation of the measured values. By combining constraints such as the material of the workpiece and the contact head, and the surface features of the contact head, a deep learning model is used to predict the contact force to the measurement error, solving the problem that the height measurement error is difficult to quantify due to fluctuations in contact force, and ensuring the pertinence and accuracy of error compensation.
[0077] First, sample data needs to be collected. This involves using workpiece material properties, contact head material properties, and contact head surface characteristics as search and comparison constraints to select matching samples from historical measurement data. The measured contact force data of these samples is then collected to form a sample measured contact force set. Simultaneously, the historical height measurement errors of the corresponding samples under different contact forces are recorded, i.e., the deviation between the actual measured value and the true value, forming a sample measurement error set. For example, when the workpiece is aluminum alloy and the contact head is ceramic with a smooth surface, the height measurement errors corresponding to different contact forces under this combination are collected, such as 0.01mm and 0.012mm for 5N and 5.2N respectively.
[0078] Next, the sample measurement contact force set is used as input data, and the sample measurement error set is used as supervision signal to train the deep learning model. By continuously iterating and optimizing the model parameters, the model converges when the difference between the model output measurement error and the actual sample error stabilizes within a preset range, thus obtaining a measurement error predictor that can map the relationship between contact force and height measurement error.
[0079] The construction and training method of this measurement error predictor is the same as that of the aforementioned contact force deviation analyzer. Only the training data needs to be changed to a sample measurement error set and the parameters fine-tuned, such as adjusting the input layer to a single neuron, corresponding to the predicted contact force. Therefore, the specific training process of the measurement error predictor will not be elaborated here.
[0080] Finally, the multiple predicted contact forces obtained in the aforementioned steps, such as 5N and 5.2N, are input into the trained measurement error predictor. The model outputs the height measurement error corresponding to each predicted contact force, thus obtaining multiple predicted height measurement errors, such as 0.01mm and 0.012mm, which provide a quantitative basis for subsequent compensation of the height measurement values of the grid area.
[0081] In step S400 of this embodiment, based on the multiple sets of similar grid regions, the height measurement values of several regions are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement result is output, including:
[0082] Based on the multiple sets of similar grid regions and multiple predicted height measurement errors, a compensation mapping relationship between the predicted height measurement error and the grid region is established.
[0083] According to the compensation mapping relationship, the height measurement values of several regions are mapped and compensated based on the multiple predicted height measurement errors, and the height measurement values of several compensated regions are output and spliced together to obtain the workpiece height measurement result.
[0084] The purpose of step S400 in this embodiment is to establish a compensation mapping relationship and use the predicted height measurement error to specifically correct the original height measurement value of each grid region, ultimately obtaining an accurate workpiece height measurement result. Furthermore, by associating similar grid region sets with corresponding predicted height measurement errors, differentiated compensation for different surface feature regions is achieved, eliminating measurement deviations caused by contact force fluctuations and ensuring high accuracy of the overall measurement result.
[0085] In the implementation process, the first step is to establish the aforementioned compensation mapping relationship. Specifically, based on the multiple sets of similar grid regions obtained in step S200 and the multiple predicted height measurement errors obtained in step S300, all grid regions in each set of similar grid regions are associated with the predicted height measurement error corresponding to that set, forming a one-to-one compensation mapping relationship. For example, if a set of similar grid regions contains grids A1, A2, and A3, and its corresponding predicted height measurement error is 0.02mm, then a mapping relationship of "A1 corresponds to 0.02mm, A2 corresponds to 0.02mm, and A3 corresponds to 0.02mm" is established, clarifying the compensation error value to be used for each grid region.
[0086] Then, according to the compensation mapping relationship, the height measurement values of several regions are mapped and compensated based on the multiple predicted height measurement errors. Specifically, a high-precision grating-coded contact displacement sensor can be used to measure the height of several grid regions on the workpiece surface to obtain the original height measurement value of each region. According to the compensation mapping relationship established above, the original height measurement value of each grid region is compensated and corrected. If the predicted height measurement error is positive, the error is subtracted from the original height measurement value; if the predicted height measurement error is negative, the error is added to the original height measurement value to obtain the compensated height measurement value of each region. For example, the original height measurement value of grid A1 is 5.00 mm, and the corresponding predicted height error is 0.02 mm. Then, the compensated height measurement value is 5.00 - 0.02 = 4.98 mm.
[0087] Finally, the compensated height measurements of all grid regions are stitched together according to their actual positions on the workpiece surface to restore the overall height distribution of the workpiece surface, and finally output the complete workpiece height measurement result, realizing high-precision measurement of workpieces with complex surfaces.
[0088] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0089] Those skilled in the art will understand that embodiments of the present invention can provide methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0093] Although preferred embodiments of the invention have been described, those skilled in the art, once they have learned the basic inventive concept, can make other changes and modifications to these embodiments.
[0094] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of this invention and its equivalents, this invention also intends to include these modifications and variations.
Claims
1. A calibration method for a high-precision grating-encoded contact displacement measurement sensor, characterized in that, The methods include: The workpiece surface is divided according to a preset grid size. Several surface roughnesses of several grid regions are obtained based on the workpiece surface image recognition, and several surface curvatures of the several grid regions are obtained. Based on the aforementioned surface roughness and surface curvature, the aforementioned mesh regions are clustered to obtain multiple sets of mesh regions of the same type, wherein each set of mesh regions of the same type has a surface roughness identifier and a surface curvature identifier. Based on the workpiece material properties, contact head material properties, and contact head surface characteristics, the contact force is predicted according to the surface roughness mark and surface curvature mark. Based on the multiple predicted contact forces, the height measurement error is analyzed, and multiple predicted height measurement errors are output. The height of several grid areas on the workpiece surface is measured by a high-precision grating-coded contact displacement measurement sensor. Based on the multiple sets of similar grid areas, the height measurement values of several areas are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement result is output.
2. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 1, characterized in that, The workpiece surface is divided according to a preset grid size, and several surface roughnesses of several grid regions are obtained based on the workpiece surface image recognition, including: The workpiece surface is divided according to the preset grid size to generate several grid regions; The workpiece surface is imaged using a CCD image sensor, and the image is segmented according to the aforementioned grid regions to obtain surface images of several regions. After performing grayscale processing on the surface images of the several regions, the coefficient of variation of the pixel grayscale values in each region is calculated, and the coefficients of variation are normalized to obtain several surface roughnesses. The coefficient of variation is the ratio of the standard deviation to the mean of the pixel grayscale values in the region.
3. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 1, characterized in that, Based on the aforementioned surface roughness and surface curvature, the aforementioned mesh regions are clustered to obtain multiple sets of similar mesh regions, including: Obtain the expected error ratio of the workpiece height measurement, and set the ratio of the expected error ratio to the standard error ratio of similar workpieces as the step size adjustment coefficient. The preset clustering step size is adjusted according to the step size adjustment coefficient to obtain the adaptive clustering step size, wherein the adaptive clustering step size includes the adaptive surface roughness step size and the adaptive surface curvature step size. Based on the aforementioned surface roughness and surface curvature, the aforementioned mesh regions are clustered according to the adapted surface roughness step size and the adapted surface curvature step size to obtain multiple sets of similar mesh regions. Among them, the surface roughness deviation and surface curvature deviation of the mesh regions in the set of similar mesh regions are less than or equal to the adapted surface roughness step size and the adapted surface curvature step size, respectively.
4. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 3, characterized in that, The average surface roughness and surface curvature of the multiple grid regions in the same grid region set are calculated respectively. The average surface roughness of the same grid region set is set as the surface roughness identifier, and the average surface curvature is set as the surface curvature identifier.
5. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 1, characterized in that, Based on the workpiece material properties, contact head material properties, and contact head surface characteristics, the contact force is predicted according to the surface roughness and surface curvature indicators, including: Using workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, we collect sample workpiece surface roughness sets and sample workpiece surface curvature sets, and obtain the historical contact force deviation ratios under different sample workpiece surface roughness and sample workpiece surface curvatures, which are set as sample contact force deviation coefficients, and obtain sample contact force deviation coefficient sets. Using the sample workpiece surface roughness set and sample workpiece surface curvature set as inputs, and the sample contact force deviation coefficient set as supervision, a deep learning model is trained until convergence to obtain a contact force deviation analyzer. The contact force deviation analyzer analyzes the surface roughness and surface curvature indicators to obtain multiple predicted contact force deviation coefficients, adjusts the preset contact force of the sensor, and outputs multiple predicted contact forces.
6. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 1, characterized in that, Based on multiple predicted contact forces, height measurement error analysis is performed, and multiple predicted height measurement errors are output, including: Using workpiece material properties, contact head material properties, and contact head surface features as retrieval and comparison constraints, a sample measurement contact force set is collected, and the historical height measurement error under different sample measurement contact forces is obtained to obtain a sample measurement error set. The deep learning model is trained to convergence using the sample contact force set and the sample measurement error set to obtain a measurement error predictor. The height measurement error is analyzed on the multiple predicted contact forces, and multiple predicted height measurement errors are output.
7. The calibration method for a high-precision grating-encoded contact displacement measurement sensor according to claim 1, characterized in that, Based on the multiple sets of similar grid regions, the height measurement values of several regions are mapped and compensated according to the multiple predicted height measurement errors, and the workpiece height measurement results are output, including: Based on the multiple sets of similar grid regions and multiple predicted height measurement errors, a compensation mapping relationship between the predicted height measurement error and the grid region is established. According to the compensation mapping relationship, the height measurement values of several regions are mapped and compensated based on the multiple predicted height measurement errors, and the height measurement values of several compensated regions are output and spliced together to obtain the workpiece height measurement result.
Citation Information
Patent Citations
3D rock structural surface roughness intelligent extraction system and method
CN111709924A
Three-dimensional rough surface contact model construction method based on Fourier interpolation
CN112699508A