A machine vision-based workpiece size automatic measurement and deviation correction method

By constructing a dedicated feature anchor point reference library and an anchor point weighted multi-parameter coupling self-calibration algorithm, the global spatial coordinate system of the machine tool, camera and workpiece is unified. This solves the problems of unscientific selection of reference anchor points, inconsistent coordinate systems and inaccurate error decoupling in traditional methods, and improves the dimensional accuracy and stability of precision workpiece machining.

CN122335688APending Publication Date: 2026-07-03HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610363873.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-24
Publication Date
2026-07-03

Smart Images

  • Figure CN122335688A_ABST
    Figure CN122335688A_ABST
Patent Text Reader

Abstract

A machine vision-based method for automatic measurement and deviation correction of workpiece dimensions, relating to the field of precision manufacturing technology, comprises the following steps: First, data from multi-process workpieces is collected and preprocessed to form a complete basic dataset; then, a dedicated feature anchor point benchmark library is constructed; next, self-calibration and coordinate unification are performed based on this library; subsequently, error decoupling and weight analysis are conducted to calculate the total deviation and the weights of various errors; finally, errors are corrected based on the relevant results, measurement results are output, a residual optimization model is fed back, the correction accuracy is verified, and the processing accuracy is improved. This invention constructs a dedicated feature anchor point benchmark library, achieving precise correlation and dynamic self-calibration between anchor points and errors, and unifying the coordinate system; through algorithms such as spatiotemporal decoupling of anchor point constraints, the total dimensional deviation across the entire process is accurately decomposed, error separation and correction are completed, and feedback correction is introduced to form a fully closed-loop system, improving the dimensional accuracy and overall stability of precision workpiece processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of precision manufacturing technology, specifically to a method for automatic measurement and deviation correction of workpiece dimensions based on machine vision. Background Technology

[0002] In the development of modern manufacturing, multi-process continuous machining of precision workpieces has become the mainstream processing mode. Various industries have continuously increased their requirements for the machining accuracy, form and position accuracy, and production stability of precision workpieces. Precision control in the field of precision machining has become a core technical point. In the process of multi-process continuous machining, the entire process from blank to finished product is involved. The reference transfer between each process and the coordination between machining and measurement directly affect the final machining quality. At the same time, various machining data and working condition data are generated during the machining process. The effective integration and utilization of these data is the foundation for achieving precision control. Under the trend of intelligent development of precision machining, the dynamic monitoring and parameter calibration of the machining process based on visual measurement technology has become the industry development direction. How to scientifically select machining reference anchor points, realize the coordinate system of machine tools, measuring equipment and workpieces, and accurately handle multi-source errors in the entire link has become the key issue to break through the precision bottleneck of precision machining. The industry urgently needs a systematic process method to achieve precise precision control of the entire process of precision workpiece machining.

[0003] In traditional multi-process continuous machining of precision workpieces, the selection of reference anchor points relies heavily on manual experience, lacking a quantitative evaluation and screening system. This makes it impossible to scientifically determine the stability and accuracy of anchor points as references, and the correlation between anchor points and process errors also lacks a precise mapping method, making it difficult to construct a standardized reference system.

[0004] Traditional calibration methods lack dynamic adaptability, making it impossible to accurately calibrate camera parameters without a calibration plate. They also struggle to incorporate workpiece clamping deviations into the calibration process, resulting in inconsistencies in the coordinate systems of the machine tool, camera, and workpiece. This lack of a unified datum directly leads to deviations in subsequent dimensional calculations and parameter solutions. Furthermore, traditional techniques handle errors across the entire machining and measurement chain in a rather crude manner, failing to achieve precise decoupling of multi-source errors, effectively separating error types from different dimensions, or quantifying the impact of various error sources on the total deviation. Error correction is often a single-dimensional, static operation, lacking spatiotemporal coordinated correction strategies and a fully closed-loop feedback optimization mechanism. Correction residuals cannot feed back into preceding process steps, leading to the continuous accumulation of errors during machining, making it difficult to meet the machining requirements of high-precision workpieces. Summary of the Invention

[0005] To address the technical problems of unscientific selection of traditional process benchmarks, inconsistent coordinate systems, and inaccurate error decoupling, this technical solution provides a machine vision-based automatic measurement and deviation correction method for workpiece dimensions. It constructs a systematic technical framework around precision control throughout the entire machining process. Starting with data acquisition and preprocessing, it proceeds through the construction of a dedicated feature anchor point benchmark library, the establishment of a machine tool camera-workpiece coordinate system, and end-to-end multi-source error decoupling analysis. Finally, it achieves spatiotemporal collaborative error correction and feedback optimization. Through multiple dedicated algorithms, it achieves precise control at each stage, forming a closed-loop error correction and model optimization mechanism. This effectively improves the dimensional accuracy and machining stability of precision workpieces. It can be seamlessly integrated into existing precision machining production lines, adapting to the precision workpiece machining needs of various high-end manufacturing fields. It provides a practical technical solution for the digital and intelligent upgrading of precision machining and effectively solves technical problems.

[0006] This invention is achieved through the following technical solution:

[0007] A machine vision-based method for automatic measurement and deviation correction of workpiece dimensions includes the following steps: data acquisition and preprocessing; construction of a dedicated feature anchor point reference library; self-calibration and coordinate unification; error decoupling and weight analysis; correction and feedback optimization.

[0008] The self-calibration and coordinate unification operation method is as follows: Based on the feature anchor point reference library, the anchor point feature contour is extracted and matched from the current workpiece visual image to obtain the sub-pixel coordinates of the effective anchor points. The anchor point weighted multi-parameter coupling self-calibration algorithm is used to calculate the internal parameters and external attitude parameters of the camera, complete the dynamic self-calibration without calibration plate, and establish a unified global spatial coordinate system for the machine tool, camera and workpiece based on the calculation results.

[0009] The operation method of error decoupling and weight analysis is as follows: Based on the global spatial coordinate system, the error sources of the entire processing and measurement chain are classified, a multi-source error coupling matrix is ​​constructed and the total size deviation of the workpiece is calculated. The anchor point constraint spatiotemporal dual-domain decoupling algorithm is used to decouple the total size deviation into time-varying error that changes with time and spatial error that is distributed with space. The contribution weight of each type of error source to the total deviation is calculated.

[0010] Furthermore, before extracting the anchor point feature contour, the current workpiece visual image needs to be preprocessed with contrast enhancement, reflection suppression, and edge sharpening. The anchor point feature contour extraction adopts a topological constraint sub-pixel edge extraction method to identify geometric contours in the image that conform to the anchor point feature type and remove incomplete contours and pseudo contours. The anchor point feature matching requires rigid matching between the extracted real anchor point contour and the feature anchor point benchmark library, calculating the matching degree and removing anchor points with a matching degree lower than a preset threshold.

[0011] Furthermore, the mathematical expression used in the anchor point weighted multi-parameter coupling self-calibration algorithm is as follows:

[0012] ;

[0013] in: This is the globally optimal solution with all parameters. For the fully coupled calibration parameter vector, For the camera intrinsic parameter matrix, Let be the camera extrinsic rotation matrix. Let be the camera's external translation vector. Let the workpiece clamping deviation vector be . For the first The overall confidence level of each effective anchor point For the first The theoretical absolute coordinates of an effective anchor point in the machine tool world coordinate system For the first Measured sub-pixel coordinates of each effective anchor point It is a fully parametric projection function. It is an L2 norm.

[0014] Furthermore, the error sources in the entire machining and measurement chain are divided into machining stage errors and measurement stage errors. Machining stage errors include machine tool geometric errors, spindle thermal deformation errors, tool wear errors, workpiece clamping deformation errors, and thermal expansion errors caused by environmental temperature changes. Measurement stage errors include camera parameter drift errors, lens optical distortion errors, camera attitude change errors, and workpiece surface imaging errors. The multi-source error coupling matrix is ​​constructed with workpiece feature points as rows and all error sources as columns. The matrix elements are the influence coefficients of the corresponding error sources on the dimensional deviations of the corresponding feature points. The influence coefficients are calculated using a multiple linear regression method. The total dimensional deviation of the workpiece is calculated by the difference between the measured and theoretical dimensions of the workpiece in a unified coordinate system.

[0015] Furthermore, the mathematical expression used in the anchor-constrained spatiotemporal dual-domain decoupling algorithm is as follows:

[0016]

[0017]

[0018] in: For the first The spatial position of the workpieces in a processing batch Total dimensional deviation at the location, For time-varying error components in the time dimension, For spatial dimension distribution error components, The random error residuals are from a Gaussian distribution with zero mean. For the first The overall confidence level of each effective anchor point For the first The first batch The measured total dimensional deviation of each effective anchor point position. For the first The theoretical spatial coordinates of an effective anchor point This is the threshold for anchor point constraints.

[0019] Furthermore, the specific operation method for collecting data and preprocessing data is as follows: collect the inherent attribute data, real-time visual images and processing condition data of precision workpieces processed in multiple continuous processes, and perform standardized preprocessing to form a full basic dataset.

[0020] Furthermore, the inherent attribute data includes full-process machining process documents, a three-dimensional digital twin model with product manufacturing information, design tolerances for each process, geometrical accuracy standards, process datum transfer specifications, CNC machining programs, and also includes historical machining records of 50-200 consecutive batches of the same type of workpiece, dimensional inspection data, and statistical data on the causes of defects; machining condition data includes spindle temperature, ambient temperature and humidity, tool wear, machine tool vibration, guideway running parameters, CNC system machining parameters, and cumulative tool machining time; standardized preprocessing includes format unification conversion, outlier removal, noise filtering, and missing value completion, wherein missing values ​​are completed using compliant data under the same batch and working conditions, and linear interpolation is used to complete when no more than 3 consecutive missing data points are used.

[0021] Furthermore, the specific operation method for constructing the exclusive feature anchor benchmark library is as follows: analyze the accuracy transmission chain based on the full basic dataset, initially screen candidate anchors, calculate the stability and accuracy indicators of each candidate anchor as a benchmark through the anchor confidence quantification algorithm, screen the effective anchors based on the calculation results, map and bind the effective anchors with the processing errors of the corresponding processes, and construct the exclusive feature anchor benchmark library.

[0022] Furthermore, the analysis accuracy transfer chain needs to sort out the processing sequence of the workpiece from blank to finished product, clarify the design datum, process datum, and measurement datum of each process, and clarify the datum transfer relationship between the preceding and following processes; the preliminary screening of candidate anchor points should select processing features that have been processed in the previous process and whose tolerance level is two or more levels higher than the current process to be processed. The selected processing features should be geometrically regular, not easily deformed, and not damaged by secondary processing or obscured by tooling in subsequent processes; the effective anchor point screening should retain candidate anchor points with a comprehensive confidence level of not less than 0.7, and those with a confidence level between 0.6 and 0.7 should be considered as candidate effective anchor points; the mapping and binding should assign a unique identification ID to each effective anchor point, record the theoretical geometric dimensions, theoretical spatial coordinates, and topological relationships of adjacent anchor points, and clarify the correspondence between the anchor point and the corresponding processing error.

[0023] Furthermore, the mathematical expression used in the anchor confidence quantification algorithm is as follows:

[0024] ;

[0025] in: For the first The overall confidence level of each candidate anchor point This is the normalization coefficient for the anchor point tolerance grade. For feature matching degree, The topological consistency coefficient is... The feature integrity coefficient, Anchor point tolerance grade normalization factor The weight represents the contribution of the anchor point's own tolerance level to the validity of the datum. Feature matching degree The weight represents the contribution of the degree of matching between the visual contour and the theoretical contour of the anchor point to the validity of the benchmark. Topological consistency coefficient The weight represents the contribution of the geometric topological relationship between the anchor point and its adjacent anchor points to the effectiveness of the benchmark. Characteristic integrity coefficient The weight represents the contribution of the completeness of the anchor point's visual contour to the validity of the benchmark.

[0026] Furthermore, the operation method of the correction and feedback optimization is as follows: based on the time-varying error, spatial error, self-calibration result and unified coordinate system, the comprehensive correction amount is calculated by using the spatiotemporal collaborative full closed-loop correction algorithm, the time-varying error is pre-corrected by feedforward and the spatial error is dynamically corrected in situ, the final size measurement result is output, the correction residual is fed back to the previous step to optimize the calculation model, and the correction accuracy is verified based on the anchor point measurement residual.

[0027] Furthermore, the mathematical expression of the spatiotemporal collaborative full closed-loop correction algorithm is as follows:

[0028] ;

[0029] in: For the first Spatial position of workpieces in each processing batch Total correction amount at the location, This is the time-domain feedforward pre-correction amount. For the first Batch time-varying error prediction value, For in-situ correction in the spatial domain, The feedback contribution weight of the correction residual to the total correction amount represents the average residual after anchor point correction. The correction strength of the comprehensive correction amount is determined through multiple closed-loop correction experiments based on the dynamic response characteristics of the machining system and the convergence speed requirements of error correction. Adjustments are made according to the differences in error characteristics of different machining processes. The average confidence level of the effective anchor points. For the first The average residual after batch anchor point correction.

[0030] Furthermore, the feedforward pre-correction needs to construct a time-series prediction model based on the time-varying error change law function. The time-series prediction model predicts the estimated time-varying error of the current workpiece processing. Based on the estimated value, the CNC parameters of the computer tool are corrected and sent to the CNC system before workpiece processing. The in-situ dynamic correction needs to perform differentiated correction on the dimensional measurement values ​​of different spatial positions of the workpiece according to the spatial error distribution data, and combine the anchor point measurement with theoretical residual compensation for random errors. The correction residual feedback needs to synchronously feed back the final dimensional measurement result of the current workpiece and the anchor point correction residual to the previous steps, and update the anchor point confidence, calibration parameters, and error decoupling function. The correction accuracy verification uses the anchor point measurement residual as the judgment index. The preset residual threshold is one-tenth of the current process processing tolerance. When the residual exceeds the threshold, the iterative process of anchor point re-selection, self-calibration, and error decoupling is triggered.

[0031] Beneficial effects

[0032] The present invention proposes a machine vision-based automatic measurement and deviation correction method for workpiece dimensions, which has the following advantages compared with existing technologies:

[0033] (1) This invention constructs a dedicated feature anchor point reference library and combines it with the anchor point confidence quantification algorithm to complete the scientific screening and mapping binding of effective anchor points, thereby achieving accurate correlation between anchor points and process processing errors. At the same time, it relies on the anchor point weighted multi-parameter coupling self-calibration algorithm to complete dynamic self-calibration without calibration board, promoting the unification of the global spatial coordinate system of machine tool, camera and workpiece. The anchor point reference library is classified and stored according to workpiece model and processing process, and can receive correction residual data to complete the dynamic update of parameters, ensuring the continuous optimization of processing reference. The workpiece clamping deviation parameter is integrated during self-calibration to achieve rigid alignment of multiple coordinate systems, so that the dimension calculation and parameter solution of the whole link have a unified spatial reference, effectively avoiding various errors caused by inconsistent reference and fixed calibration method, improving the stability and accuracy of reference transfer in multi-process continuous processing, and can flexibly adapt to the actual application needs of different processing conditions.

[0034] (2) This invention achieves accurate decomposition of the total dimensional deviation of the entire processing and measurement chain through the anchor point constraint spatiotemporal dual-domain decoupling algorithm, effectively separates time-varying errors and spatial errors, quantifies the contribution weight of various error sources to the total deviation, and completes the accurate calculation of the comprehensive correction amount based on the spatiotemporal collaborative closed-loop correction algorithm, realizing the feedforward pre-correction of time-varying errors and the in-situ dynamic correction of spatial errors. During the correction process, the average confidence of anchor points and the correction residual are introduced to form feedback correction, and the correction residual is synchronously fed back to the previous steps to complete the iterative update of model parameters. It can also verify the correction accuracy based on the anchor point measurement residual and trigger the iterative optimization process, forming a fully closed-loop error correction and optimization system, effectively solving the industry problem of difficult accurate handling of multi-source error coupling, realizing targeted error correction and continuous optimization, and greatly improving the dimensional accuracy and overall processing stability of precision workpiece processing. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the overall process of the present invention.

[0036] Figure 2 This is a data interaction diagram between the various steps in this invention. Detailed Implementation

[0037] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. The described embodiments are merely some embodiments of the present invention, and not all embodiments. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the design concept of the present invention should fall within the protection scope of the present invention.

[0038] Example 1:

[0039] like Figure 1 and Figure 2 As shown, a machine vision-based method for automatic measurement and deviation correction of workpiece dimensions includes the following steps:

[0040] S1: Data acquisition and preprocessing: Acquire inherent attribute data, real-time visual images, and processing condition data of precision workpieces processed in multiple continuous processes, and perform standardized preprocessing to form a full basic dataset.

[0041] The inherent attribute data includes full-process machining process documents, a 3D digital twin model with product manufacturing information, design tolerances for each process, geometrical accuracy standards, process datum transfer specifications, CNC machining programs, and also includes historical machining records of 50-200 consecutive batches of the same type of workpiece, dimensional inspection data, and statistical data on the causes of defects; machining condition data includes spindle temperature, ambient temperature and humidity, tool wear, machine tool vibration, guideway running parameters, CNC system machining parameters, and cumulative tool machining time; standardized preprocessing includes format unification conversion, outlier removal, noise filtering, and missing value completion, where missing values ​​are completed using compliant data under the same batch and working conditions, and linear interpolation is used to complete when no more than 3 consecutive missing data points are used.

[0042] S2: Construct a dedicated feature anchor benchmark library: Analyze the accuracy transfer chain based on the full basic dataset, initially screen candidate anchors, calculate the stability and accuracy indicators of each candidate anchor as a benchmark through the anchor confidence quantification algorithm, screen effective anchors based on the calculation results, map and bind the effective anchors to the processing errors of the corresponding processes, and construct a dedicated feature anchor benchmark library.

[0043] The dedicated feature anchor point benchmark library contains unique identifiers for effective anchor points, feature type information for effective anchor points, theoretical geometric dimensions of effective anchor points, theoretical spatial coordinates of effective anchor points, geometric topological relationships between adjacent effective anchor points, tolerance levels of effective anchor points, comprehensive confidence scores of effective anchor points, and mapping data between effective anchor points and process errors. The library is categorized and stored according to workpiece model and processing steps. Different processing steps correspond to independent subsets of effective anchor points, which are non-coplanar and non-collinearly distributed in the three-dimensional space of the workpiece. The library receives anchor point measurement residual data transmitted from the calibration and feedback optimization steps and updates the comprehensive confidence scores of the corresponding effective anchor points based on this data. The library also transmits theoretical spatial coordinates and comprehensive confidence scores of effective anchor points to the self-calibration and coordinate unification steps, and mapping data between effective anchor points and processing errors to the error decoupling and weighting analysis steps.

[0044] The analysis accuracy transfer chain needs to trace the processing sequence of the workpiece from blank to finished product, clarify the design datum, process datum, and measurement datum of each process, and clarify the datum transfer relationship between the preceding and following processes. Preliminary screening of candidate anchor points requires selecting processing features that have been completed in the preceding process and whose tolerance level is two or more levels higher than the current process to be processed. The selected processing features should be geometrically regular, not easily deformed, and not damaged by secondary processing or obstructed by tooling in subsequent processes. Effective anchor point screening requires retaining candidate anchor points with a comprehensive confidence level of not less than 0.7, and those with a confidence level between 0.6 and 0.7 as candidate effective anchor points. Mapping and binding requires assigning a unique identification ID to each effective anchor point, recording the anchor point's theoretical geometric dimensions, theoretical spatial coordinates, and topological relationships between adjacent anchor points, and clarifying the correspondence between the anchor point and the corresponding processing error.

[0045] The mathematical expression used in the anchor confidence quantification algorithm is:

[0046] ;

[0047] in: For the first The overall confidence level of each candidate anchor point This is the normalization coefficient for the anchor point tolerance grade. For feature matching degree, The topological consistency coefficient is... The feature integrity coefficient, Anchor point tolerance grade normalization factor The weight represents the contribution of the anchor point's own tolerance level to the validity of the datum. Feature matching degree The weight represents the contribution of the degree of matching between the visual contour and the theoretical contour of the anchor point to the validity of the benchmark. Topological consistency coefficient The weight represents the contribution of the geometric topological relationship between the anchor point and its adjacent anchor points to the effectiveness of the benchmark. Characteristic integrity coefficient The weight represents the contribution of the completeness of the anchor point's visual contour to the validity of the benchmark.

[0048] When calculating the stability and accuracy indices of each candidate anchor point as a benchmark using the anchor point confidence quantification algorithm, the stability index is calculated by the deviation between the measured and theoretical values ​​of the geometric topological relationship between the candidate anchor point and its adjacent candidate anchor points. Specifically, the distance deviation and angle deviation between adjacent candidate anchor points are calculated, and the completeness of the candidate anchor point contour is considered to obtain the overall stability index. The accuracy index is calculated by the difference between the tolerance grade of the candidate anchor point itself and the tolerance grade of the current process, and the degree of matching between the extracted contour of the candidate anchor point and the theoretical contour. Specifically, the tolerance grade normalization result of the candidate anchor point and the similarity data of the contour matching are considered to obtain the overall accuracy index. The two indices together constitute the comprehensive evaluation basis for the candidate anchor point as a benchmark, which is used for the subsequent selection of effective anchor points.

[0049] S3: Self-calibration and coordinate unification: Based on the feature anchor point reference library, the anchor point feature contour is extracted and matched from the current workpiece visual image to obtain the sub-pixel coordinates of the effective anchor points. The anchor point weighted multi-parameter coupling self-calibration algorithm is used to calculate the internal parameters and external attitude parameters of the camera, and complete the dynamic self-calibration without calibration plate. Based on the calculation results, a unified global spatial coordinate system for the machine tool, camera and workpiece is established.

[0050] The global spatial coordinate system has the machine tool spindle center as its origin, with the X-axis set along the machine tool guideway feed direction, the Y-axis set along the horizontal direction perpendicular to the X-axis, and the Z-axis set along the vertical direction perpendicular to the XY plane. The coordinate transformation matrix, calculated using an anchor point weighted multi-parameter coupling self-calibration algorithm, converts the effective anchor point sub-pixel coordinates in the camera pixel coordinate system to coordinates in the machine tool coordinate system. Simultaneously, combined with workpiece clamping deviation parameters, the workpiece design coordinate system is rigidly aligned with the machine tool coordinate system, achieving complete unification of the coordinate systems of the machine tool, camera, and workpiece. The positioning accuracy of the global spatial coordinate system is no less than 0.001mm. All dimensional calculations and parameter solutions in subsequent error decoupling and weight analysis, correction, and feedback optimization steps are completed within this global spatial coordinate system.

[0051] Before extracting the anchor point feature contour, the current workpiece visual image needs to be preprocessed with contrast enhancement, reflection suppression, and edge sharpening. The anchor point feature contour extraction adopts the topological constraint sub-pixel edge extraction method to identify the geometric contours in the image that conform to the anchor point feature type and remove incomplete contours and pseudo contours. The anchor point feature matching requires rigid matching between the extracted real anchor point contours and the feature anchor point benchmark library, calculating the matching degree and removing anchor points with a matching degree lower than the preset threshold.

[0052] The mathematical expression used in the anchor point weighted multi-parameter coupling self-calibration algorithm is:

[0053] ;

[0054] in: This is the globally optimal solution with all parameters. For the fully coupled calibration parameter vector, For the camera intrinsic parameter matrix, Let be the camera extrinsic rotation matrix. Let be the camera's external translation vector. Let the workpiece clamping deviation vector be . For the first The overall confidence level of each effective anchor point For the first The theoretical absolute coordinates of an effective anchor point in the machine tool world coordinate system For the first Measured sub-pixel coordinates of each effective anchor point It is a fully parametric projection function. It is an L2 norm.

[0055] When using the anchor-weighted multi-parameter coupled self-calibration algorithm to calculate the camera's internal and external attitude parameters, the comprehensive confidence of effective anchor points in the feature anchor point reference library is used as the weighting basis. The theoretical spatial coordinates of the effective anchor points and the sub-pixel coordinates extracted from the visual image are used as the calculation input. The internal parameters consisting of the camera focal length, imaging center position, and lens distortion coefficient, as well as the external attitude parameters consisting of the camera's spatial position and rotation angle, are calculated simultaneously. The position offset and attitude deviation parameters formed by workpiece clamping are also incorporated. The optimal solution for all parameters is obtained through iterative optimization.

[0056] S4: Error Decoupling and Weight Analysis: Based on the global spatial coordinate system, the error sources of the entire machining and measurement chain are classified, a multi-source error coupling matrix is ​​constructed, and the total dimensional deviation of the workpiece is calculated. The anchor point constraint spatiotemporal dual-domain decoupling algorithm is used to decouple the total dimensional deviation into time-varying error that changes with time and spatial error that is distributed with space. The contribution weight of each type of error source to the total deviation is calculated.

[0057] The error sources in the entire machining and measurement chain are divided into machining errors and measurement errors. Machining errors include machine tool geometric errors, spindle thermal deformation errors, tool wear errors, workpiece clamping deformation errors, and thermal expansion errors caused by environmental temperature changes. Measurement errors include camera parameter drift errors, lens optical distortion errors, camera attitude change errors, and workpiece surface imaging errors. The multi-source error coupling matrix is ​​constructed with workpiece feature points as rows and all error sources as columns. The matrix elements are the influence coefficients of the corresponding error sources on the dimensional deviations of the corresponding feature points. The influence coefficients are calculated using a multiple linear regression method. The total dimensional deviation of the workpiece is calculated by the difference between the measured and theoretical dimensions of the workpiece in a unified coordinate system.

[0058] The mathematical expression used in the anchor-constrained spatiotemporal dual-domain decoupling algorithm is as follows:

[0059]

[0060]

[0061] in: For the first The spatial position of the workpieces in a processing batch Total dimensional deviation at the location, For time-varying error components in the time dimension, For spatial dimension distribution error components, The random error residuals are from a Gaussian distribution with zero mean. For the first The overall confidence level of each effective anchor point For the first The first batch The measured total dimensional deviation of each effective anchor point position. For the first The theoretical spatial coordinates of an effective anchor point This is the threshold for anchor point constraints.

[0062] The anchor-point constrained spatiotemporal dual-domain decoupling algorithm decouples the total dimensional deviation into time-varying errors that change with time and spatial errors that are distributed with space. When calculating the contribution weights of various error sources to the total deviation, the difference between the measured dimensional deviation and the theoretical dimensional deviation of the effective anchor point is used as a constraint condition to separate the time-varying error component that changes with the processing batch and processing time, as well as the spatial error component that changes with the spatial position distribution of the workpiece. Randomly distributed error components are eliminated. Based on the correspondence between each error source and the feature point of the workpiece in the multi-source error coupling matrix, the deviation values ​​corresponding to each error source in the time-varying error component and the spatial error component are statistically analyzed. The proportion of each type of error source in the total dimensional deviation is determined by numerical comparison, forming the contribution weights of each type of error source to the total deviation.

[0063] S5: Correction and Feedback Optimization: Based on the time-varying error, spatial error, self-calibration results and unified coordinate system, the spatiotemporal collaborative full closed-loop correction algorithm is used to calculate the comprehensive correction amount, the time-varying error is pre-corrected by feedforward and the spatial error is dynamically corrected in situ, the final size measurement result is output, the correction residual is fed back to the previous step to optimize the calculation model, and the correction accuracy is verified based on the anchor point measurement residual.

[0064] The mathematical expression of the spatiotemporal collaborative full closed-loop correction algorithm is:

[0065] ;

[0066] in: For the first Spatial position of workpieces in each processing batch Total correction amount at the location, This is the time-domain feedforward pre-correction amount. For the first Batch time-varying error prediction value, For in-situ correction in the spatial domain, The feedback contribution weight of the correction residual to the total correction amount represents the average residual after anchor point correction. The correction strength of the comprehensive correction amount is determined through multiple closed-loop correction experiments based on the dynamic response characteristics of the machining system and the convergence speed requirements of error correction. Adjustments are made according to the differences in error characteristics of different machining processes. The average confidence level of the effective anchor points. For the first The average residual after batch anchor point correction.

[0067] When calculating the comprehensive correction amount using the spatiotemporal collaborative closed-loop correction algorithm, the variation law of time-varying error, the distribution characteristics of spatial error, the transformation relationship between camera internal parameters and external attitude parameters, and the global spatial coordinate system are combined to determine the feedforward pre-correction value adapted to the time-varying error and the in-situ dynamic correction value adapted to the spatial error. At the same time, the average confidence of effective anchor points and the residual data of anchor points after correction are introduced to form feedback correction values. The feedforward pre-correction value, the in-situ dynamic correction value, and the feedback correction value are superimposed to obtain the comprehensive correction amount of the workpiece corresponding to the processing batch and spatial position.

[0068] The feedforward pre-correction requires the construction of a time-series prediction model based on the time-varying error change law function. The time-series prediction model predicts the estimated time-varying error of the current workpiece processing. Based on the estimated value, the CNC parameters of the computer tool are corrected and sent to the CNC system before workpiece processing. The in-situ dynamic correction requires differential correction of the dimensional measurement values ​​of different spatial positions of the workpiece based on the spatial error distribution data, and combines the actual measurement of anchor points with theoretical residuals to compensate for random errors. The correction residual feedback requires the synchronous feedback of the final dimensional measurement results of the current workpiece and the anchor point correction residuals to the previous steps, updating the anchor point confidence, calibration parameters, and error decoupling function. The correction accuracy verification uses the anchor point measurement residual as the judgment index. The preset residual threshold is one-tenth of the current process processing tolerance. When the residual exceeds the threshold, the iterative process of anchor point re-selection, self-calibration, and error decoupling is triggered.

[0069] The mathematical expression for the time-varying error variation law function is:

[0070]

[0071] in: For the first Time-varying error corresponding to each processing batch This is the batch number. The linear trend coefficient characterizes the linear change in time-varying error as the number of processing batches increases. , The exponential decay trend coefficient represents the magnitude of the exponential decay of time-varying errors as the number of processing batches increases. , The periodic fluctuation trend coefficient represents the periodic fluctuation amplitude of time-varying error as the number of machining batches increases. When constructing the time-series prediction model based on the time-varying error change law function, the multi-batch time-varying error data and machining condition data obtained from the error decoupling and weight analysis steps are used as the model input data. Historical time-varying error data of 50-100 consecutive machining batches, spindle temperature data, cumulative tool machining time data, and environmental temperature and humidity data are selected as model training data. The internal parameters of the model are optimized through data fitting and multi-round iterative training, so that the model can accurately capture the changing trend of time-varying error with machining batches, machining time, and working condition parameters. After the model training is completed, the working condition parameters of the current machining batch are input, and the estimated value of the time-varying error of the current machining batch can be output, providing data support for the calculation of CNC parameter correction amount for feedforward pre-correction.

[0072] To verify the practicality, effectiveness, and superiority of the method of the present invention, the inventors have provided specific examples; the examples are as follows:

[0073] Case 1:

[0074] Example of error correction in multi-process machining of precision titanium alloy shaft workpieces for aerospace applications.

[0075] This embodiment focuses on the application of precision titanium alloy shafts in the aerospace field. These workpieces require sequential machining processes including turning, milling, grinding, and polishing. Each process has a tolerance grade of IT4-IT5, demanding stringent dimensional and positional accuracy. The machining process is susceptible to errors caused by factors such as machine tool thermal deformation, tool wear, and fluctuations in ambient temperature and humidity. This invention utilizes a process method to achieve error detection, decoupling, and closed-loop correction across the entire machining and measurement chain. Specific implementation steps are as follows: Figure 1 As shown:

[0076] S1. Data Acquisition and Preprocessing: Collect the machining process documents for the entire process of turning, milling, grinding, and polishing of the titanium alloy precision shaft workpiece, a 3D digital twin model with product manufacturing information, design tolerances for each process, geometrical accuracy standards, process datum transfer specifications, and CNC machining programs. At the same time, collect historical machining records, dimensional inspection data, and defective product cause statistics for 150 consecutive batches of the same model workpiece as inherent attribute data. Collect the spindle temperature, ambient temperature and humidity, tool wear, machine tool vibration, guideway running parameters, CNC system machining parameters, and cumulative tool machining time during the machining process as machining condition data. Perform standardized preprocessing on the above two types of data, and sequentially complete the format unification conversion, outlier removal, noise filtering, and missing value completion operations. For missing values, priority is given to using compliant data from the same batch under the same working conditions to complete them. For the case of two consecutive missing data points, linear interpolation is used to complete them. Finally, a full basic dataset specific to this shaft workpiece is formed.

[0077] S2, Anchor Point Reference Library Construction: Based on the full basic dataset, the processing sequence of this type of shaft workpiece from blank to finished product is sorted out, the design reference, process reference, and measurement reference of each process of turning, milling, grinding, and polishing are clarified, and the reference transfer relationship between the preceding and following processes is clarified to complete the accuracy transfer chain analysis; preliminary screening of candidate anchor points is carried out, selecting machining features such as journals and locating keyways that have been processed in the previous process and whose tolerance level is two or more levels higher than the current process to be processed. These features are geometrically regular, not easily deformed, and will not be damaged by secondary processing or obscured by tooling in subsequent processing processes; the stability and accuracy index of each candidate anchor point as a reference is calculated by the anchor point confidence quantification algorithm.

[0078] Based on the calculation results, valid anchor points are selected, and candidate anchor points with a comprehensive confidence level of not less than 0.7 are retained. Keyway side features with a confidence level between 0.6 and 0.7 are used as candidate valid anchor points. A unique identification ID is assigned to each valid anchor point, and the valid anchor points are mapped and bound to the processing errors of the corresponding processes. Core information such as the theoretical geometric dimensions, theoretical spatial coordinates, and topological relationships of adjacent anchor points are entered to construct a dedicated feature anchor point benchmark library for this titanium alloy precision shaft workpiece. This benchmark library is stored according to workpiece model and each processing process. Different processes correspond to independent subsets of valid anchor points. The valid anchor points in the subsets are distributed in a non-coplanar and non-collinear manner in the three-dimensional space of the workpiece. At the same time, this benchmark library can receive anchor point measurement residual data transmitted in subsequent correction and feedback optimization steps to update the comprehensive confidence level value of the corresponding valid anchor points.

[0079] S3, Self-calibration and Coordinate Unification: Based on the constructed dedicated feature anchor point benchmark library, the visual image of the current titanium alloy precision shaft workpiece is first preprocessed with contrast enhancement, reflection suppression, and edge sharpening. Then, the anchor point feature contour is extracted using a topological constraint sub-pixel edge extraction method. The geometric contours in the image that conform to the anchor point feature type are identified, and incomplete contours and pseudo contours are removed. The extracted real anchor point contours are rigidly matched with the feature anchor point benchmark library. The matching degree is calculated and anchor points with matching degrees lower than a preset threshold are removed to obtain the sub-pixel coordinates of the effective anchor points. The internal parameters and external attitude parameters of the camera are calculated through the anchor point weighted multi-parameter coupling self-calibration algorithm to complete the dynamic self-calibration without a calibration plate.

[0080] Based on the calculation results, a global spatial coordinate system is established with the machine tool spindle center as the origin, the X-axis along the machine tool guideway feed direction, the Y-axis along the horizontal direction perpendicular to the X-axis, and the Z-axis along the vertical direction perpendicular to the XY plane. The positioning accuracy of this coordinate system reaches 0.0009mm, meeting the accuracy requirement of not less than 0.001mm. The coordinate transformation matrix calculated by this algorithm converts the effective anchor point sub-pixel coordinates in the camera pixel coordinate system into coordinates in the machine tool coordinate system. At the same time, combined with the workpiece clamping deviation parameters, the workpiece design coordinate system and the machine tool coordinate system are rigidly aligned, realizing the complete unification of the coordinate systems of the machine tool, camera, and workpiece. All dimension calculations and parameter solutions in the subsequent error decoupling and weight analysis, correction and feedback optimization steps are completed in this global spatial coordinate system.

[0081] S4, Error Decoupling and Weighting Analysis: Under a unified global spatial coordinate system, the error sources of the entire machining and measurement chain of this type of workpiece are classified into machining errors and measurement errors. Machining errors include machine tool geometric errors, spindle thermal deformation errors, tool wear errors, workpiece clamping deformation errors, and thermal expansion errors caused by environmental temperature changes. Measurement errors include camera parameter drift errors, lens optical distortion errors, camera attitude change errors, and workpiece surface imaging errors. A multi-source error coupling matrix is ​​constructed with workpiece feature points as rows and all error sources as columns. The influence coefficients of the corresponding error sources on the dimensional deviations of the corresponding feature points in the matrix are calculated using a multiple linear regression method. At the same time, the total dimensional deviation of the workpiece is calculated by the difference between the measured and theoretical dimensions of the workpiece under a unified coordinate system. An anchor-constrained spatiotemporal dual-domain decoupling algorithm is used to decouple the total dimensional deviation into time-varying errors that change with time and spatial errors that are distributed with space.

[0082] After removing the random error residuals with zero mean Gaussian distribution, and based on the correspondence between each error source and the workpiece feature point in the multi-source error coupling matrix, the deviation values ​​corresponding to each error source in the time-varying error component and the spatial error component are statistically analyzed. By comparing the values, the proportion of each type of error source in the total dimensional deviation is determined, and the contribution weight of each type of error source to the total deviation is calculated. It is found that in the machining process of this type of shaft workpiece, tool wear error and spindle thermal deformation error are the main contributing error sources to the total dimensional deviation.

[0083] S5, Correction and Feedback Optimization: Based on the time-varying error and spatial error obtained from decoupling, as well as the self-calibration results and the unified global spatial coordinate system, the comprehensive correction amount of the shaft-type workpiece is calculated using a spatiotemporal collaborative full closed-loop correction algorithm.

[0084] Feedforward pre-correction is performed on time-varying errors. A time-series prediction model is constructed based on the time-varying error variation law function. Historical time-varying error data, spindle temperature data, cumulative tool processing time data, and ambient temperature and humidity data for 70 consecutive batches of machining of the shaft workpiece are selected as model training data. The internal parameters of the model are optimized through data fitting and multiple rounds of iterative training. After inputting the working condition parameters of the current machining batch, the estimated time-varying error value is obtained. The correction amount of the CNC parameters of the computer tool is calculated based on the estimated value, and the correction amount is sent to the CNC system before the workpiece is machined. In-situ dynamic correction is performed on spatial errors. Based on the spatial error distribution data, the corrections are applied to different spatial components such as the workpiece journal and locating keyway. The dimensional measurements of the location are differentially corrected, and random errors are compensated by combining actual anchor point measurements with theoretical residuals. After the correction is completed, the final dimensional measurement results of the shaft workpiece are output. The correction residuals are fed back to all steps such as previous data acquisition and preprocessing, anchor point reference library construction, etc., to update anchor point confidence, calibration parameters, and error decoupling functions. At the same time, the correction accuracy is verified based on the anchor point measurement residuals. The preset anchor point measurement residual threshold is one-tenth of the current grinding process tolerance. After testing, the anchor point measurement residuals of this correction do not exceed the threshold, and the correction accuracy meets the process requirements. If the residuals exceed the threshold, it will trigger the iterative process of anchor point re-selection, self-calibration, and error decoupling.

[0085] In summary, this embodiment applies the process to multi-process machining of precision titanium alloy shaft workpieces for aerospace applications. The operation follows a five-step process, including data acquisition and preprocessing, and anchor point reference library construction. A dedicated feature anchor point reference library was built to meet the IT4-IT5 tolerance requirements of the workpiece, achieving precise unification of the coordinate systems of the machine tool, camera, and workpiece, with a positioning accuracy of 0.0009 mm. Through an anchor point constraint spatiotemporal dual-domain decoupling algorithm, tool wear and spindle thermal deformation were identified as the main error sources. Error correction was completed using a spatiotemporal collaborative closed-loop correction algorithm, and the correction residual did not exceed the threshold, effectively compensating for errors throughout the machining process. This meets the machining accuracy requirements of precision shaft workpieces for aerospace applications and verifies the adaptability and practicality of the process in high-end shaft workpiece machining.

[0086] Case 2:

[0087] Example of error correction for multi-process machining of precision injection mold cavity workpiece.

[0088] This embodiment focuses on the application of precision injection mold cavity workpieces for plastic parts molding. These workpieces require sequential processing through multiple steps: roughing, semi-finishing, finishing, and electrical discharge machining (EDM). The dimensional accuracy of the cavity surface contour is required to be within 0.002 mm. During processing, factors such as machine tool guideway deviation, electrode wear, environmental temperature changes, and camera posture variations can cause machining errors. The process method of this invention achieves accurate detection, decoupling, and full closed-loop correction of machining errors. Specific implementation steps are as follows: Figure 2 As shown:

[0089] S1. Data Acquisition and Preprocessing: Collect the machining process documents for the entire process of roughing, semi-finishing, finishing, and EDM of the precision injection mold cavity workpiece, a 3D digital twin model with product manufacturing information, design tolerances for each process, geometrical accuracy standards, process datum transfer specifications, and CNC machining programs. Simultaneously, collect historical machining records, dimensional inspection data, and defective product cause statistics for 180 consecutive batches of the same model workpiece as inherent attribute data. Collect the spindle temperature, ambient temperature and humidity, electrode wear, machine tool vibration, guide rail operating parameters, CNC system machining parameters, and cumulative electrode machining time during the machining process as machining condition data. Perform standardized preprocessing on the above two types of data, sequentially completing format unification conversion, outlier removal, noise filtering, and missing value completion operations. For missing values, priority is given to using compliant data from the same batch under the same working conditions for completion. For cases with three consecutive missing data points, linear interpolation is used for completion. Finally, a full basic dataset specific to the mold cavity workpiece is formed.

[0090] S2, Anchor Point Reference Library Construction: Based on the full basic dataset, the processing sequence of the mold cavity workpiece from blank to finished product is sorted out, and the design reference, process reference, and measurement reference of each process of roughing, semi-finishing, finishing, and EDM are clarified. The reference transfer relationship between the preceding and following processes is clarified to complete the accuracy transfer chain analysis. Candidate anchor points are initially screened, and machining features such as cavity positioning holes, reference platforms, and outer edge step surfaces of the cavity that have been processed in the previous process and whose tolerance level is two or more levels higher than that of the current process to be processed are selected. These features are geometrically regular, not easily deformed, and will not be damaged by secondary processing or obscured by tooling in subsequent processing processes. The stability and accuracy index of each candidate anchor point as a reference are calculated by the anchor point confidence quantification algorithm.

[0091] Based on the calculation results, valid anchor points are selected, and candidate anchor points with a comprehensive confidence level of not less than 0.7 are retained. The chamfer features of positioning holes with a confidence level between 0.6 and 0.7 are used as candidate valid anchor points. A unique identification ID is assigned to each valid anchor point, and the valid anchor points are mapped and bound to the processing errors of the corresponding processes. Core information such as the theoretical geometric dimensions, theoretical spatial coordinates, and topological relationships of adjacent anchor points are entered to construct a dedicated feature anchor point benchmark library for the precision injection mold cavity workpiece. This benchmark library is stored according to workpiece model and each processing process. Different processes correspond to independent subsets of valid anchor points. The valid anchor points in the subsets are distributed in a non-coplanar and non-collinear manner in the three-dimensional space of the workpiece. At the same time, this benchmark library can receive anchor point measurement residual data transmitted in subsequent correction and feedback optimization steps to update the comprehensive confidence level value of the corresponding valid anchor points.

[0092] S3, Self-calibration and Coordinate Unification: Based on the constructed dedicated feature anchor point benchmark library, the visual image of the current precision injection mold cavity workpiece is first preprocessed with contrast enhancement, reflection suppression, and edge sharpening. Then, the anchor point feature contour is extracted using a topological constraint sub-pixel edge extraction method. Geometric contours in the image that conform to the anchor point feature type are identified, and incomplete contours and pseudo-contours are removed. The extracted real anchor point contours are rigidly matched with the feature anchor point benchmark library. The matching degree is calculated and anchor points with matching degrees lower than a preset threshold are removed to obtain the sub-pixel coordinates of the effective anchor points. The internal parameters and external attitude parameters of the camera are calculated through the anchor point weighted multi-parameter coupling self-calibration algorithm to complete the dynamic self-calibration without a calibration plate.

[0093] Based on the calculation results, a global spatial coordinate system is established with the machine tool spindle center as the origin, the X-axis along the machine tool guideway feed direction, the Y-axis along the horizontal direction perpendicular to the X-axis, and the Z-axis along the vertical direction perpendicular to the XY plane. The positioning accuracy of this coordinate system reaches 0.0008mm, meeting the accuracy requirement of not less than 0.001mm. The coordinate transformation matrix calculated by this algorithm converts the effective anchor point sub-pixel coordinates in the camera pixel coordinate system into coordinates in the machine tool coordinate system. At the same time, combined with the workpiece clamping deviation parameters, the workpiece design coordinate system and the machine tool coordinate system are rigidly aligned, realizing the complete unification of the coordinate systems of the machine tool, camera, and workpiece. All dimension calculations and parameter solutions in the subsequent error decoupling and weight analysis, correction and feedback optimization steps are completed in this global spatial coordinate system.

[0094] S4, Error Decoupling and Weighting Analysis: Under a unified global spatial coordinate system, the error sources of the entire machining and measurement chain of the mold cavity workpiece are classified into machining errors and measurement errors. Machining errors include machine tool geometric errors, spindle thermal deformation errors, electrode wear errors, workpiece clamping deformation errors, and thermal expansion errors caused by environmental temperature changes. Measurement errors include camera parameter drift errors, lens optical distortion errors, camera attitude change errors, and workpiece surface imaging errors. A multi-source error coupling matrix is ​​constructed with workpiece feature points as rows and all error sources as columns. The influence coefficients of the corresponding error sources on the dimensional deviations of the corresponding feature points in the matrix are calculated using a multiple linear regression method. At the same time, the total dimensional deviation of the workpiece is calculated by the difference between the measured and theoretical dimensions of the workpiece under a unified coordinate system. An anchor-constrained spatiotemporal dual-domain decoupling algorithm is used to decouple the total dimensional deviation into time-varying errors that change with time and spatial errors that are distributed with space.

[0095] After removing the random error residuals with zero mean Gaussian distribution, and based on the correspondence between each error source and the feature points of the workpiece in the multi-source error coupling matrix, the deviation values ​​corresponding to each error source in the time-varying error component and the spatial error component are statistically analyzed. By comparing the values, the proportion of each type of error source in the total dimensional deviation is determined, and the contribution weight of each type of error source to the total deviation is calculated. It is found that during the machining of the mold cavity workpiece, the machine tool geometric error and the camera parameter drift error are the main contributing error sources to the total dimensional deviation.

[0096] S5, Correction and Feedback Optimization: Based on the time-varying error and spatial error obtained from decoupling, as well as the self-calibration results and the unified global spatial coordinate system, the comprehensive correction amount of the mold cavity workpiece is calculated using a spatiotemporal collaborative full closed-loop correction algorithm.

[0097] To characterize the periodic fluctuation amplitude of time-varying error with increasing machining batches, historical time-varying error data, spindle temperature data, cumulative electrode machining time data, and ambient temperature and humidity data from 90 consecutive machining batches of the mold cavity workpiece were selected as model training data. The model's internal parameters were optimized through data fitting and multiple rounds of iterative training. After inputting the working condition parameters of the current machining batch, a time-varying error prediction was obtained. Based on this prediction, the CNC parameters of the computer tool were corrected, and the correction was sent to the CNC system before workpiece machining. In-situ dynamic correction was performed on spatial errors. Based on the spatial error distribution data, corrections were made to different spatial locations such as the mold cavity positioning holes, reference platform, and curved surface contours. The dimensional measurements are differentially corrected, and random errors are compensated by combining actual anchor point measurements with theoretical residuals. After the correction is completed, the final dimensional measurement results of the mold cavity workpiece are output. The correction residuals are fed back to all steps such as previous data acquisition and preprocessing, anchor point benchmark library construction, etc., to update anchor point confidence, calibration parameters, and error decoupling functions. At the same time, the correction accuracy is verified based on the anchor point measurement residuals. The preset anchor point measurement residual threshold is one-tenth of the current finishing process tolerance. After testing, the anchor point measurement residuals of this correction do not exceed the threshold, and the correction accuracy meets the process requirements. If the residuals exceed the threshold, it will trigger the iterative process of anchor point re-selection, self-calibration, and error decoupling.

[0098] In summary, this embodiment applies the process to multi-stage machining of precision injection mold cavity workpieces. Following the core process steps of the invention, the entire operation is completed. For the cavity surface accuracy requirement within 0.002mm, a dedicated anchor point reference library for the mold cavity was successfully constructed, achieving a unified coordinate system across the three components and a positioning accuracy of 0.0008mm. Through error decoupling, machine tool geometry and camera parameter drift were identified as the main error sources. Based on a spatiotemporal collaborative closed-loop correction algorithm, time-varying error feedforward pre-correction and spatial error in-situ dynamic correction were completed. The correction residuals meet preset standards, effectively controlling machining and measurement errors, meeting the high-precision machining requirements of mold cavities, and verifying the effectiveness and accuracy of the process in machining complex curved surface molds.

[0099] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered by the present invention.

Claims

1. A method for automatic measurement and deviation correction of workpiece dimensions based on machine vision, characterized in that, The method includes the following steps: data acquisition and preprocessing; construction of a dedicated feature anchor point benchmark library; self-calibration and coordinate unification; error decoupling and weight analysis; correction and feedback optimization. The self-calibration and coordinate unification operation method is as follows: Based on the feature anchor point reference library, the anchor point feature contour is extracted and matched from the current workpiece visual image to obtain the sub-pixel coordinates of the effective anchor points. The anchor point weighted multi-parameter coupling self-calibration algorithm is used to calculate the internal parameters and external attitude parameters of the camera, complete the dynamic self-calibration without calibration plate, and establish a unified global spatial coordinate system for the machine tool, camera and workpiece based on the calculation results. The operation method of error decoupling and weight analysis is as follows: Based on the global spatial coordinate system, the error sources of the entire processing and measurement chain are classified, a multi-source error coupling matrix is ​​constructed and the total size deviation of the workpiece is calculated. The anchor point constraint spatiotemporal dual-domain decoupling algorithm is used to decouple the total size deviation into time-varying error that changes with time and spatial error that is distributed with space. The contribution weight of each type of error source to the total deviation is calculated.

2. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: Before extracting the anchor point feature contour, the current workpiece visual image needs to be preprocessed with contrast enhancement, reflection suppression, and edge sharpening. The anchor point feature contour extraction adopts the topological constraint sub-pixel edge extraction method to identify geometric contours in the image that conform to the anchor point feature type and remove incomplete contours and pseudo contours. The anchor point feature matching requires rigid matching between the extracted real anchor point contour and the feature anchor point benchmark library, calculating the matching degree and removing anchor points with a matching degree lower than a preset threshold.

3. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The mathematical expression used in the anchor point weighted multi-parameter coupling self-calibration algorithm is: ; in: This is the globally optimal solution with all parameters. For fully coupled calibration parameter vectors, For the camera intrinsic parameter matrix, Let the rotation matrix be the camera's extrinsic parameters. Let be the camera's external translation vector. Let the workpiece clamping deviation vector be . For the first The overall confidence level of each effective anchor point For the first The theoretical absolute coordinates of an effective anchor point in the machine tool world coordinate system For the first Measured sub-pixel coordinates of each effective anchor point It is a fully parametric projection function. It is an L2 norm.

4. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The error sources in the entire machining and measurement chain are divided into machining errors and measurement errors. Machining errors include machine tool geometric errors, spindle thermal deformation errors, tool wear errors, workpiece clamping deformation errors, and thermal expansion errors caused by environmental temperature changes. Measurement errors include camera parameter drift errors, lens optical distortion errors, camera attitude change errors, and workpiece surface imaging errors. The multi-source error coupling matrix is ​​constructed with workpiece feature points as rows and all error sources as columns. The matrix elements are the influence coefficients of the corresponding error sources on the dimensional deviations of the corresponding feature points. The influence coefficients are calculated using a multiple linear regression method. The total dimensional deviation of the workpiece is calculated by the difference between the measured and theoretical dimensions of the workpiece in a unified coordinate system.

5. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The mathematical expression used in the anchor-constrained spatiotemporal dual-domain decoupling algorithm is as follows: ; ; in: For the first The spatial position of the workpieces in a processing batch Total dimensional deviation at the location, For time-varying error components in the time dimension, For spatial dimension distribution error components, The random error residuals are from a Gaussian distribution with zero mean. For the first The overall confidence level of each effective anchor point For the first The first batch The measured total dimensional deviation of each effective anchor point position. For the first The theoretical spatial coordinates of an effective anchor point This is the threshold for anchor point constraints.

6. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The specific operation method for collecting data and preprocessing data is as follows: collect the inherent attribute data, real-time visual images and processing condition data of precision workpieces processed in multiple continuous processes, and perform standardized preprocessing to form a full basic dataset. The inherent attribute data includes full-process machining process documents, a 3D digital twin model with product manufacturing information, design tolerances for each process, geometrical accuracy standards, process datum transfer specifications, CNC machining programs, and also includes historical machining records of 50-200 consecutive batches of the same type of workpiece, dimensional inspection data, and statistical data on the causes of defects; machining condition data includes spindle temperature, ambient temperature and humidity, tool wear, machine tool vibration, guideway running parameters, CNC system machining parameters, and cumulative tool machining time; standardized preprocessing includes format unification conversion, outlier removal, noise filtering, and missing value completion, where missing values ​​are completed using compliant data under the same batch and working conditions, and linear interpolation is used to complete when no more than 3 consecutive missing data points are used.

7. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The specific operation method for constructing the exclusive feature anchor benchmark library is as follows: analyze the accuracy transmission chain based on the full basic dataset, initially screen candidate anchors, calculate the stability and accuracy indicators of each candidate anchor as a benchmark through the anchor confidence quantification algorithm, screen the effective anchors based on the calculation results, map and bind the effective anchors with the processing errors of the corresponding processes, and construct the exclusive feature anchor benchmark library. The analysis accuracy transfer chain needs to trace the processing sequence of the workpiece from blank to finished product, clarify the design datum, process datum, and measurement datum of each process, and clarify the datum transfer relationship between the preceding and following processes. Preliminary screening of candidate anchor points requires selecting processing features that have been completed in the preceding process and whose tolerance level is two or more levels higher than the current process to be processed. The selected processing features should be geometrically regular, not easily deformed, and not damaged by secondary processing or obstructed by tooling in subsequent processes. Effective anchor point screening requires retaining candidate anchor points with a comprehensive confidence level of not less than 0.7, and those with a confidence level between 0.6 and 0.7 as candidate effective anchor points. Mapping and binding requires assigning a unique identification ID to each effective anchor point, recording the anchor point's theoretical geometric dimensions, theoretical spatial coordinates, and topological relationships between adjacent anchor points, and clarifying the correspondence between the anchor point and the corresponding processing error.

8. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The mathematical expression used in the anchor confidence quantification algorithm is: ; in: For the first The overall confidence level of each candidate anchor point This is the normalization coefficient for the anchor point tolerance grade. For feature matching degree, The topological consistency coefficient is... The feature integrity coefficient, Anchor point tolerance grade normalization factor The weight represents the contribution of the anchor point's own tolerance level to the validity of the datum. Feature matching degree The weight represents the contribution of the degree of matching between the visual contour and the theoretical contour of the anchor point to the validity of the benchmark. Topological consistency coefficient The weight represents the contribution of the geometric topological relationship between the anchor point and its adjacent anchor points to the effectiveness of the benchmark. Characteristic integrity coefficient The weight represents the contribution of the completeness of the anchor point's visual contour to the validity of the benchmark.

9. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The operation method of the correction and feedback optimization is as follows: based on the time-varying error, spatial error, self-calibration result and unified coordinate system, the comprehensive correction amount is calculated by using the spatiotemporal collaborative full closed-loop correction algorithm, the time-varying error is pre-corrected by feedforward and the spatial error is dynamically corrected in situ, the final size measurement result is output, the correction residual is fed back to the previous step to optimize the calculation model, and the correction accuracy is verified based on the anchor point measurement residual. The mathematical expression of the spatiotemporal collaborative full closed-loop correction algorithm is: ; in: For the first Spatial position of workpieces in each processing batch Total correction amount at the location, This is the time-domain feedforward pre-correction amount. For the first Batch time-varying error prediction value, This is the in-situ correction value in the spatial domain. The feedback contribution weight of the correction residual to the total correction amount represents the average residual after anchor point correction. The correction strength of the comprehensive correction amount is determined through multiple closed-loop correction experiments based on the dynamic response characteristics of the machining system and the convergence speed requirements of error correction. Adjustments are made according to the differences in error characteristics of different machining processes. The average confidence level of the effective anchor points. For the first The average residual after batch anchor point correction.

10. The method for automatic measurement and deviation correction of workpiece dimensions based on machine vision according to claim 1, characterized in that: The feedforward pre-correction requires the construction of a time-series prediction model based on the time-varying error change law function. The time-series prediction model predicts the estimated time-varying error of the current workpiece processing. Based on the estimated value, the CNC parameters of the computer tool are corrected and sent to the CNC system before workpiece processing. The in-situ dynamic correction requires differential correction of the dimensional measurement values ​​of different spatial positions of the workpiece based on the spatial error distribution data, and combines the actual measurement of anchor points with theoretical residuals to compensate for random errors. The correction residual feedback requires the synchronous feedback of the final dimensional measurement results of the current workpiece and the anchor point correction residuals to the previous steps, updating the anchor point confidence, calibration parameters, and error decoupling function. The correction accuracy verification uses the anchor point measurement residual as the judgment index. The preset residual threshold is one-tenth of the current process processing tolerance. When the residual exceeds the threshold, the iterative process of anchor point re-selection, self-calibration, and error decoupling is triggered.