Compensation regulation method and system for numerical control machine tool based on industrial vision driving

By constructing an active contour model and applying traction force to the unlocked nodes using locked nodes, the problem of low machining accuracy of CNC machine tools in complex environments is solved, achieving high precision and stable machining results.

CN121386603BActive Publication Date: 2026-04-21东莞金源五金机械有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
东莞金源五金机械有限公司
Filing Date
2025-12-17
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

CNC machine tools have low machining accuracy in complex machining environments. They are affected by environmental interference such as cutting fluid splashing and metal reflection, making it impossible to accurately detect the workpiece contour and perform error compensation and control.

Method used

By acquiring real-time images and position coordinates, an active contour model is constructed. The locked nodes are used to apply traction force to the unlocked nodes, and the model is iteratively evolved to extract the target contour. The spatial compensation component is calculated based on the image deviation to adjust the zero-point offset of the workpiece and overcome environmental noise interference.

Benefits of technology

It achieves high-precision machining and stability in complex environments, effectively overcomes noise interference such as cutting fluid splashing and reflection, and improves the machining accuracy and stability of CNC machine tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121386603B_ABST
    Figure CN121386603B_ABST
Patent Text Reader

Abstract

This application relates to the field of vision control technology, and in particular to a method and system for compensation and control of CNC machine tools based on industrial vision. The method includes: acquiring real-time images and the position coordinates of the CNC machine tool during the machining process; parsing the current machining instructions to reconstruct the theoretical trajectory, and then constructing an initial contour of an active contour model; performing multiple iterative evolutions on the initial contour using the active contour model until a target contour is obtained; calculating spatial compensation components based on the image deviation of the target contour relative to the initial contour; and adjusting the workpiece zero-point offset of the CNC machine tool using the spatial compensation components. The technical solution of this application can effectively improve the machining accuracy and stability of CNC machine tools in complex machining environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vision control technology, and in particular to a method and system for compensation and control of CNC machine tools based on industrial vision drive. Background Technology

[0002] With the rapid development of high-end equipment manufacturing technology, CNC precision machining has been applied in key fields such as aerospace, precision mold making, and automobile manufacturing. As a core component ensuring machining accuracy, real-time monitoring and dynamic compensation of errors caused by factors such as tool wear, thermal deformation, or cutting force deflection during machining are particularly important. Because CNC precision machining often encounters environmental interferences such as vibration, coolant splashing, and metal reflection, accurately detecting workpiece contours in complex industrial environments and adjusting machine tool errors accordingly has become a critical technical problem that urgently needs to be solved in the CNC machining industry.

[0003] Currently, industrial cameras installed inside or around the machine tool are typically used to capture images of the workpiece during the machining process. Traditional edge detection operators are used to extract the edge contour of the workpiece. The extracted actual contour is compared with the preset theoretical design trajectory to calculate the geometric deviation between the two. This deviation is then converted into a position compensation command and sent to the CNC system to adjust the tool path to correct machining errors.

[0004] However, the above methods are greatly affected by environmental interference such as cutting fluid splashing and metal reflection, and cannot distinguish between the real workpiece edge and the false edge generated by environmental noise in complex industrial environments, which leads to low machining accuracy of CNC machine tools in complex machining environments. Summary of the Invention

[0005] To address the technical problem of low machining accuracy of CNC machine tools in complex machining environments, this application provides a CNC machine tool compensation and control method and system based on industrial vision, which can effectively improve the machining accuracy and stability of CNC machine tools in complex machining environments.

[0006] In a first aspect, this application provides a CNC machine tool compensation and control method based on industrial vision. The control method includes: acquiring real-time images and the position coordinates of the CNC machine tool during the machining process; parsing the current machining command to reconstruct the theoretical trajectory; and projecting the theoretical trajectory onto the real-time image plane to construct an initial contour of an active contour model, the initial contour including multiple nodes; performing multiple iterative evolutions on the initial contour using the active contour model until the initial contour converges to obtain a target contour; calculating spatial compensation components based on the image deviation of the target contour relative to the initial contour; and adjusting the workpiece zero-point offset of the CNC machine tool using the spatial compensation components; wherein, in any iteration, nodes are divided into locked nodes and unlocked nodes based on the consistency between the tangent direction of the theoretical trajectory and the image gradient direction at each node, as well as the tool radius; calculating the neighborhood traction force of the locked nodes on the unlocked nodes in the neighborhood, and updating the position of the unlocked nodes using the neighborhood traction force.

[0007] In the iterative evolution of the active contour model, nodes are divided into locked nodes and unlocked nodes, and the traction force of locked nodes on unlocked nodes in the neighborhood is calculated. This allows nodes in areas with clear textures to be locked first and become anchor points, while a forced pull is applied to unlocked nodes in areas with blur or noise. This overcomes the problem that conventional active contour models are easily attracted by false edges such as cutting fluid reflection, and achieves accurate extraction of target contours under complex working conditions.

[0008] Preferably, the step of parsing the current machining instruction to reconstruct the theoretical trajectory and projecting the theoretical trajectory onto the real-time image plane to construct the initial contour includes: extracting the geometric definition from the machining instruction data stream within the current execution cycle, wherein the geometric definition includes the start point, end point, interpolation type, and radius; reconstructing the theoretical trajectory of the current cutting segment based on the geometric definition; projecting the theoretical trajectory from perspective onto the real-time image plane where the workpiece is located; and generating a discrete point set as the initial contour.

[0009] Because the finishing allowance is usually small, the deviation between the actual workpiece edge and the theoretical trajectory is not large, thus avoiding the large amount of computation and the risk of false convergence that may be caused by the conventional algorithm blindly converging from the image edge, and realizing the accurate initialization of each node in the active contour model.

[0010] Preferably, before constructing the initial contour, the control method further includes: mapping the position coordinates of the CNC machine tool onto the real-time image plane, and creating a rectangular region centered on the mapped position coordinates to obtain the region of interest in the real-time image, wherein the window size of the region of interest is negatively correlated with the real-time feed speed of the CNC machine tool; after performing edge-preserving filtering on the region of interest, constructing a gradient vector field based on gradient information, wherein the gradient vector field is used to provide attraction pointing to the image edge during iterative evolution.

[0011] Shrinking the window during the high-speed roughing stage can reduce the computational load to satisfy the sampling theorem, while expanding the window during the low-speed finishing stage can include more texture information. This balances computational real-time performance with accuracy, minimizes latency, and ensures real-time control.

[0012] Preferably, the step of dividing nodes into locked nodes and unlocked nodes based on the consistency between the tangent direction of the theoretical trajectory and the image gradient direction at each node, as well as the tool radius, includes: calculating the dot product of the image gradient direction at the node and the tangent direction of the theoretical trajectory as the direction consistency; calculating the second-order difference modulus at the node as the local curvature, and defining the reciprocal corresponding to the tool radius as the curvature limit threshold; in response to the direction consistency being greater than the preset consistency threshold and the local curvature being less than the curvature limit threshold, marking the node as a locked node, otherwise marking it as an unlocked node.

[0013] Preferably, the calculation of the neighborhood traction force of the locked node on the unlocked node in the neighborhood includes: for any neighboring node within the neighborhood range of the current node, calculating the position difference vector between the neighboring node and the current node; and performing a weighted summation of each position difference vector to obtain the neighborhood traction force, wherein the weighting weight is related to the locking status identifier of the neighboring node and the stiffness coefficient of the active contour model.

[0014] By transforming locked neighbor nodes into anchor points for applying tension, auxiliary information is provided for the contour evolution process, ensuring that unlocked nodes can utilize the spatial correlation of their neighborhood to approach the correct location.

[0015] Preferably, updating the position of the unlocked node using the neighborhood traction force includes: keeping the position coordinates of the locked node unchanged; calculating the internal smoothing force and external attraction force of the unlocked node in the active contour model; and superimposing the resultant force of the internal smoothing force, external attraction force and neighborhood traction force onto the current position of the unlocked node to obtain the updated position.

[0016] By keeping the locked node position unchanged and superimposing the combined force of internal smoothing force, external gravity and neighborhood traction force onto the unlocked node to update its position, an evolutionary effect similar to zipper closure is achieved, effectively overcoming local breakage and noise interference.

[0017] Preferably, before calculating the spatial compensation component, the control method further includes: calculating the ratio of the number of locked nodes in the target contour to the total number of nodes to obtain the locking rate; in response to the locking rate being less than the safety circuit breaker threshold, determining that the current visual measurement result is interfered with and failing, discarding the current calculation result and keeping the compensation value of the previous moment unchanged; in response to the locking rate being not less than the safety circuit breaker threshold, performing the spatial compensation component calculation step.

[0018] Preferably, the step of calculating the spatial compensation component based on the image deviation of the target contour relative to the initial contour includes: calculating the two-dimensional image plane deviation vector of each node on the target contour relative to the corresponding node on the initial contour; constructing the directional constraint of the spatial compensation component using the normal vector of the workpiece surface; and using the pseudo-inverse matrix of the perspective projection matrix to solve the two-dimensional image plane deviation vector into a spatial compensation component distributed along the direction of the normal vector.

[0019] Preferably, adjusting the workpiece zero-point offset of the CNC machine tool using the spatial compensation component includes: obtaining the spatial compensation component at the previous moment; performing a weighted summation of the spatial compensation component obtained in the current calculation and the spatial compensation component at the previous moment to obtain the final compensation command, wherein the weighting coefficient of the spatial compensation component obtained in the current calculation is a smoothing gain coefficient.

[0020] In a second aspect, this application also provides a CNC machine tool compensation and control system based on industrial vision, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the CNC machine tool compensation and control method based on industrial vision according to the first aspect of this application.

[0021] The technical solution of this application has the following beneficial technical effects:

[0022] By acquiring real-time images and position coordinates during the machining process, the machining instructions are analyzed to reconstruct the theoretical trajectory as the initial contour of the active contour model. During the iterative evolution of the model, nodes are divided into locked nodes and unlocked nodes based on physical characteristics such as tangent direction and tool radius during the cutting process. Locked nodes are used to guide unlocked nodes, and locked clear area nodes are used to drag unlocked blurry area nodes to converge. This effectively overcomes strong noise interference such as cutting fluid splashing and reflection, and achieves precise contour closure. As a result, spatial compensation components can be calculated and workpiece zero-point offset can be adjusted based on high-precision visual feedback, which significantly improves the machining accuracy and stability of CNC machine tools in complex machining environments. Attached Figure Description

[0023] Figure 1 This is a flowchart of a CNC machine tool compensation and control method based on industrial vision drive according to an embodiment of this application.

[0024] Figure 2 This is a schematic diagram of locked and unlocked nodes during the iterative evolution of the active contour model according to the embodiments of this application.

[0025] Figure 3 This is a structural block diagram of a CNC machine tool compensation and control system based on industrial vision according to an embodiment of this application. Detailed Implementation

[0026] According to a first aspect of this application, this application provides a CNC machine tool compensation and control method based on industrial vision. Figure 1 This is a flowchart of a CNC machine tool compensation and control method based on industrial vision drive, according to an embodiment of this application. Figure 1 As shown, the CNC machine tool compensation and control method based on industrial vision includes steps S101 to S103, which are described in detail below.

[0027] S101, acquire real-time images and position coordinates of the CNC machine tool during the processing, parse the current processing command to reconstruct the theoretical trajectory, and project the theoretical trajectory onto the real-time image plane to construct the initial contour of the active contour model, wherein the initial contour includes multiple nodes.

[0028] In one embodiment, when the CNC machine tool is in interpolation motion mode, the high-speed I / O signal of the position encoder triggers the shutter of the industrial camera to take a picture, and saves the mechanical coordinates of each axis at the moment the exposure ends; this ensures that the acquisition time of the image frame is the same as the acquisition time of the mechanical coordinates of each axis, achieving data alignment and providing a data foundation for high-precision measurement. The interpolation motion mode refers to the state in which the CNC machine tool's controller is executing the interpolation function, driving the tool to move continuously along the theoretical trajectory set in the program.

[0029] At this moment, each moment corresponds to a real-time image and the position coordinates of the CNC machine tool.

[0030] In this embodiment, parsing the current machining command to reconstruct the theoretical trajectory and projecting the theoretical trajectory onto the real-time image plane to construct the initial contour includes: extracting the geometric definitions from the machining command data stream within the current execution cycle, wherein the geometric definitions include a start point, an end point, an interpolation type, and a radius; reconstructing the theoretical trajectory of the current cutting segment based on the geometric definitions; and projecting the theoretical trajectory from a perspective onto the real-time image plane where the workpiece is located to generate a discrete point set as the initial contour. The interpolation type includes linear interpolation and circular interpolation.

[0031] It should be noted that the machining instruction data stream is usually a G-code data stream. By parsing the G-code, the system can determine the ideal path the tool should take, i.e., the theoretical trajectory. Since the finishing allowance is usually small, such as 0.1 mm, during normal machining, the actual workpiece edge will be distributed within the neighborhood of the theoretical trajectory. That is, the actual workpiece edge will not deviate too much from the theoretical trajectory. Therefore, the theoretical trajectory is projected onto a discrete point set generated on a 2D image using the camera's perspective projection matrix. Each node in the discrete point set is directly used as the initial contour of the active contour model, thus achieving precise setting of the initial contour in the active contour model.

[0032] In this embodiment, before constructing the initial contour, the control method further includes: mapping the position coordinates of the CNC machine tool onto the real-time image plane, and creating a rectangular region centered on the mapped position coordinates to obtain the region of interest in the real-time image. The window size of the region of interest is negatively correlated with the real-time feed speed of the CNC machine tool. After performing edge-preserving filtering on the region of interest, a gradient vector field is constructed based on gradient information. The gradient vector field is used to provide attraction pointing to the image edge during iterative evolution.

[0033] The region of interest (ROI) is the key area for subsequent compensation control, and its size directly determines the real-time performance of the compensation control. Therefore, to balance computational real-time performance and field of view, the window size of the ROI is negatively correlated with the machine tool's real-time feed rate. When the feed rate is greater than a set threshold, it indicates that the CNC machine tool is in a high-speed roughing stage, and the window size is automatically shrunk to a smaller neighborhood of the theoretical trajectory to reduce the computational load of subsequent gradient vector fields and iterations. When the feed rate is less than or equal to the set threshold, it indicates that the CNC machine tool is in a low-speed finishing stage, and the window size is expanded to include more background texture constraints. Specifically, the window size of the ROI... Satisfying the relation:

[0034] ;in, and These are the maximum and minimum allowed window sizes for the region of interest, respectively. The attenuation coefficient is... This refers to the real-time feed speed of the machine tool.

[0035] Construct a gradient vector field, which contains the external energy value of each pixel within the region of interest. external energy value Satisfying the relation:

[0036] In the formula, For pixels The magnitude of the gradient.

[0037] In this way, a high-precision initial contour was constructed by parsing the instructions, laying the data foundation for subsequent accurate measurements.

[0038] S102, the initial contour is iterated and evolved multiple times using an active contour model until the initial contour converges to obtain the target contour.

[0039] In one embodiment, the initial contour is iterated and evolved multiple times using an active contour model. In any iteration, the nodes are divided into locked nodes and unlocked nodes based on the consistency between the tangent direction of the theoretical trajectory and the image gradient direction at each node, as well as the tool radius. The neighborhood traction force of the locked nodes on the unlocked nodes in the neighborhood is calculated, and the position of the unlocked nodes is updated using the neighborhood traction force.

[0040] In traditional active contour models, all nodes need to update their positions during iterative evolution, meaning each node participates in the same number of iterations. However, in reality, due to the different positions of each node in the image and the different local features at each node's position, some nodes find their optimal position after only 5 iterations, while others require more iterations to find their optimal position. Therefore, this application introduces a node locking status flag to determine which nodes are locked and no longer update their positions during any iteration.

[0041] Specifically, the step of dividing nodes into locked nodes and unlocked nodes based on the consistency between the tangent direction of the theoretical trajectory and the image gradient direction at each node, as well as the tool radius, includes: calculating the dot product of the image gradient direction at the node and the tangent direction of the theoretical trajectory as the direction consistency; calculating the second-order difference modulus at the node as the local curvature, and defining the reciprocal corresponding to the tool radius as the curvature limit threshold; in response to the direction consistency being greater than the preset consistency threshold and the local curvature being less than the curvature limit threshold, marking the node as a locked node, otherwise marking it as an unlocked node.

[0042] In this system, locked nodes are identified by a lock status of 1, while unlocked nodes are identified by a lock status of 0. (Node) Lock status indicator Satisfying the relation:

[0043] ;

[0044] Where H is the unit step function, which outputs 1 when the input is greater than or equal to zero, and 0 otherwise; The image gradient direction at the node; The tangent direction of the trajectory is processed for the node; and The dot product is the orientation consistency, which is used to measure whether the observed texture in the real-time image matches the theoretical cutting texture in the theoretical trajectory; A preset consistency threshold can be set, for example, to 0.9. When the directional consistency is greater than the preset consistency threshold, The value of is 1; The local curvature at the node; The curvature limit threshold is equal to the reciprocal of the tool radius. When the local curvature is less than the curvature limit threshold, The value is 1.

[0045] Therefore, a node is considered to have captured the real workpiece surface only when the observed texture direction at any node conforms to the machinability expectation and the local curvature is within the curvature limit threshold. The node is then marked as a locked node, i.e., the status is marked as 1. Otherwise, it is considered to be disturbed and marked as an unlocked node, i.e., the status is marked as 0.

[0046] Locked nodes have accurately grasped the actual workpiece surface. Therefore, for unlocked nodes, an auxiliary force can be applied using locked nodes to accelerate their convergence speed. Specifically, calculating the neighborhood traction force of locked nodes on unlocked nodes within their neighborhood includes: for any neighboring node within the current node's neighborhood, calculating the position difference vector between the neighboring node and the current node; and performing a weighted summation of each position difference vector to obtain the neighborhood traction force, wherein the weighting weights are related to the locking status identifier of the neighboring nodes and the stiffness coefficient of the active contour model.

[0047] Specifically, the current node Neighborhood traction Satisfying the relation:

[0048] ;

[0049] In the formula, For the current node The set of neighboring nodes; and Each is the current node and neighboring nodes Position coordinates; Neighboring nodes The lock status indicator; This is the stiffness coefficient. Thus, if neighboring nodes... Successfully locked; it will serve as an anchor point, using stiffness coefficients to connect to the currently locked node. Apply strong pulling force to force it to move closer to the confirmed true outline.

[0050] After calculating the traction force, it can be added to the energy function in the active contour model to update the position of the unlocked node. Specifically, updating the position of the unlocked node using the neighborhood traction force includes: keeping the position coordinates of the locked node unchanged; calculating the internal smoothing force and external attraction force of the unlocked node in the active contour model; and superimposing the resultant force of the internal smoothing force, external attraction force, and neighborhood traction force onto the current position of the unlocked node to obtain the updated position.

[0051] Among them, with nodes As an example, its updated position satisfies the following relation:

[0052] ;

[0053] In the formula, and They are nodes The positions before and after the update; For time step; For nodes In position Internal smoothing force at the location; The gradient vector field is the node. In position External gravity provided by the location; External weighting coefficients; This indicates the current node's lock status. For nodes The neighborhood traction force. Wherein, the time step is 1, and the external weight coefficient is 0.6.

[0054] This ensures that the position of locked nodes remains constant, preventing oscillations, while for unlocked nodes, The value of is 1. Neighborhood traction ensures that even in areas with weak gradient fields or chaotic fuzzy regions, unlocked nodes can be forcibly dragged to the correct contour line by their locked neighbors. See also... Figure 2 This is a schematic diagram of locked and unlocked nodes during the iterative evolution of the active contour model according to the embodiments of this application.

[0055] It should be noted that the internal smoothing force, external gravity, and external weighting coefficient are all well-known techniques in active contour models, and will not be elaborated upon here.

[0056] Thus, during the iterative evolution of the active contour model, the nodes in the clear region close and lock first, and then drive the nodes in the adjacent blurred region to close, effectively overcoming local breaks and noise interference, and achieving robust convergence under harsh conditions.

[0057] S103, calculate the spatial compensation component based on the image deviation of the target contour relative to the initial contour, and adjust the workpiece zero-point offset of the CNC machine tool using the spatial compensation component.

[0058] In one embodiment, before calculating the spatial compensation component, the control method further includes: calculating the ratio of the number of locked nodes in the target contour to the total number of nodes to obtain the locking rate; in response to the locking rate being less than a safety circuit breaker threshold, determining that the current visual measurement result is affected by interference and failing, discarding the current calculation result and keeping the compensation value of the previous moment unchanged; in response to the locking rate being not less than the safety circuit breaker threshold, performing the spatial compensation component calculation step.

[0059] Understandably, the lock-in rate directly reflects the quality of the real-time image of the current frame. If the lock-in rate is less than the safety fuse threshold, which is 0.3, it means that most nodes have failed to find the accurate edge. This is most likely due to environmental interference such as severe cutting fluid splashing or abnormal lighting, which causes visual measurement failure and triggers the fuse mechanism to prevent erroneous measurement values ​​from being input into the machine tool control system, thus ensuring machining safety.

[0060] When the lock-in rate meets the requirements, the spatial compensation component is calculated based on the image deviation of the target contour relative to the initial contour. Specifically, this includes: calculating the two-dimensional image plane deviation vector of each node on the target contour relative to the corresponding node on the initial contour; constructing the directional constraint of the spatial compensation component using the normal vector of the workpiece surface; and using the pseudo-inverse matrix of the perspective projection matrix to solve the two-dimensional image plane deviation vector into a spatial compensation component distributed along the direction of the normal vector.

[0061] It should be noted that there are uncertainties in directly resolving three-dimensional coordinates from a two-dimensional image. In this scenario, due to the influence of cutting force and thermal expansion, the dimensional error of finishing is mainly generated along the normal direction of the workpiece surface. The compensation control of the CNC machine tool is also defined along the normal direction of the workpiece surface. Therefore, the normal vector of the workpiece surface is used as the directional constraint of the spatial compensation component to improve the accuracy of resolving three-dimensional coordinates from a two-dimensional image, and then the two-dimensional deviation is accurately resolved into a three-dimensional compensation vector in the machine tool coordinate system.

[0062] Three-dimensional compensation vector in machine tool coordinate system Satisfying the relation:

[0063] ;

[0064] in, The observed two-dimensional image plane deviation vector; This is the unit three-dimensional normal vector of the workpiece surface; The Jacobian matrix of the perspective projection model can be obtained through camera calibration. Represents the projection of a 3D normal vector onto the imaging plane; superscript This is the Moore-Penrose pseudoinverse operation.

[0065] In this embodiment, adjusting the workpiece zero-point offset of the CNC machine tool using the spatial compensation component includes: obtaining the spatial compensation component at the previous moment; performing a weighted summation of the spatial compensation component obtained in this calculation and the spatial compensation component at the previous moment to obtain the final compensation command, wherein the weight coefficient of the spatial compensation component obtained in this calculation is the smoothing gain coefficient.

[0066] Specifically, the compensation command finally output to the CNC machine tool is calculated as follows:

[0067] In the formula, This refers to the spatial compensation component obtained in this solution; The spatial compensation component is the one from the previous time step; K is the smoothing gain coefficient, which is 0.3 for example. By constructing a first-order low-pass filter, the final compensation command exhibits smooth characteristics in time, avoiding abrupt changes in the final compensation command.

[0068] In this way, the safety of the CNC machine tool control process is ensured by the fuse mechanism. By using the normal vector of the workpiece surface as the directional constraint, the two-dimensional deviation is accurately solved into a three-dimensional compensation vector in the machine tool coordinate system. The sudden change of the final compensation command is avoided by the first-order low-pass filter, thus ensuring the dynamic stability of the machine tool processing process.

[0069] According to a second aspect of this application, this application also provides a CNC machine tool compensation and control system based on industrial vision. Figure 3 This is a structural block diagram of a CNC machine tool compensation and control system based on industrial vision-driven embodiments of this application. Figure 3 As shown, the system 50 includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the CNC machine tool compensation and control method based on industrial vision drive according to the first aspect of this application. The system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface. Their configuration and functions are known in the art and will not be described further here.

[0070] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the scope of protection of this application.

Claims

1. A CNC machine tool compensation and control method based on industrial vision, characterized in that, The control method includes: acquiring real-time images and position coordinates of the CNC machine tool during the processing, parsing the current processing instructions to reconstruct the theoretical trajectory, and projecting the theoretical trajectory onto the real-time image plane to construct the initial contour of the active contour model, which includes multiple nodes; The initial contour is iterated and evolved multiple times using an active contour model until the initial contour converges to obtain the target contour. The spatial compensation component is calculated based on the image deviation of the target contour relative to the initial contour, and the workpiece zero point offset of the CNC machine tool is adjusted using the spatial compensation component. In any iteration of evolution, nodes are divided into locked nodes and unlocked nodes based on the consistency between the tangent direction of the theoretical trajectory and the image gradient direction at each node, as well as the tool radius. The dot product of the image gradient direction and the tangent direction of the theoretical trajectory at the node is used as the direction consistency; the second-order difference modulus at the node is used as the local curvature, and the reciprocal of the tool radius is defined as the curvature limit threshold. If the directional consistency is greater than a preset consistency threshold and the local curvature is less than the curvature limit threshold, the node is marked as a locked node; otherwise, it is marked as an unlocked node. Calculate the neighborhood traction force of locked nodes on unlocked nodes within their neighborhood, including: For any neighboring node within the current node's neighborhood, calculate the position difference vector between the neighboring node and the current node; The neighborhood traction force is obtained by weighted summation of the position difference vectors. The weighting weights are related to the locking status indicators of the neighboring nodes and the stiffness coefficients of the active contour model. It also uses neighborhood traction to update the position of the uncracked nodes.

2. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, The step of parsing the current processing command to reconstruct the theoretical trajectory and projecting the theoretical trajectory onto the real-time image plane to construct an initial contour includes: Extract the geometric definition from the processing instruction data stream within the current execution cycle. The geometric definition includes the start point, end point, interpolation type, and radius. The theoretical trajectory of the current cutting segment is reconstructed based on the geometric definition, and the theoretical trajectory is projected from perspective onto the real-time image plane where the workpiece is located to generate a discrete point set as the initial contour.

3. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, Before constructing the initial contour, the control method further includes: The position coordinates of the CNC machine tool are mapped onto the real-time image plane, and a rectangular region is created with the mapped position coordinates as the center to obtain the region of interest in the real-time image. The window size of the region of interest is negatively correlated with the real-time feed speed of the CNC machine tool. After performing edge-preserving filtering on the region of interest, a gradient vector field is constructed based on the gradient information. The gradient vector field is used to provide attraction pointing to the image edge during iterative evolution.

4. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, The step of updating the position of the unlocked node using the neighborhood traction force includes: Keep the position coordinates of the locked nodes unchanged; Calculate the internal smoothing force and external attraction of the unlocked node in the active contour model; The combined force of the internal smoothing force, external gravity, and neighborhood traction force is superimposed on the current position of the unlocked node to obtain the updated position.

5. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, Before solving the spatial compensation component, the control method further includes: The locking rate is obtained by calculating the proportion of locked nodes in the target contour to the total number of nodes. If the locking rate is less than the safety circuit breaker threshold, the current visual measurement result is determined to be invalid due to interference. The result of this calculation is discarded and the compensation value of the previous moment remains unchanged. In response to the lockout rate being not less than the safety circuit breaker threshold, the spatial compensation component is calculated.

6. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, The step of calculating the spatial compensation component based on the image deviation of the target contour relative to the initial contour includes: Calculate the two-dimensional image plane deviation vector of each node on the target contour relative to the corresponding node on the initial contour; The directional constraints of the spatial compensation components are constructed using the normal vector of the workpiece surface. The pseudo-inverse matrix of the perspective projection matrix is ​​used to solve the two-dimensional image plane deviation vector into spatial compensation components distributed along the direction of the normal vector.

7. The CNC machine tool compensation and control method based on industrial vision drive according to claim 1, characterized in that, The method of adjusting the workpiece zero-point offset of the CNC machine tool using the spatial compensation component includes: Obtain the spatial compensation component from the previous time step; The spatial compensation component obtained in this calculation is weighted and summed with the spatial compensation component from the previous time step to obtain the final compensation command. The weighting coefficient of the spatial compensation component obtained in this calculation is the smoothing gain coefficient.

8. A CNC machine tool compensation and control system based on industrial vision, characterized in that, It includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement the CNC machine tool compensation and control method based on industrial vision drive according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Following error prediction method of numerical control machining equipment

    CN115576268A

  • Automatic machining method, device and equipment for arc-shaped workpiece and storage medium

    CN118938805A