Numerical control machining center motion positioning control system and method with visual identification function
Through the combination of visual recognition module and optimization algorithm, the problems of workpiece feature extraction and motion trajectory optimization in CNC machining centers are solved, and a high-precision, high-efficiency and safe processing process is achieved, which significantly improves the performance of CNC machining centers.
Patent Information
- Application Number
- CN202510604720.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-08-26
AI Technical Summary
The existing CNC machining center cannot accurately extract the contour and edge features of the workpiece, cannot ensure accurate description of the workpiece shape, cannot accurately and quickly solve the spatial position and posture of the workpiece, and cannot effectively optimize the motion trajectory parameters of the machining tool, resulting in low machining accuracy and efficiency, and unsafe processing process.
The visual recognition module is used to collect workpiece images in real time, extract the spatial position and posture information of the workpiece through outline and edge features, and optimize the motion trajectory parameters of the processing tool using optimization algorithms, and combine it with the exception processing module to monitor key operating parameters in real time, trigger early warnings and handle exceptions.
The accuracy and machining accuracy of workpiece shape description are achieved, the machining efficiency is improved, and the safety and accuracy of the machining process are guaranteed, which significantly improves the working efficiency and product quality of the CNC machining center.
Smart Images

Figure CN120540199A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining centers, and more particularly to a motion positioning control system and method for a numerical control machining center with visual recognition. Background Art
[0002] In existing CNC machining centers, motion positioning during the machining process often relies on traditional mechanical positioning devices and preset program control; however, this method has some limitations, such as the inability to perceive the position and status of the workpiece in real time, difficulty in adapting to complex and changing machining environments, and the inability to make adaptive adjustments based on the characteristics of the workpiece.
[0003] Patent application with reference publication number CN116841215A discloses a motion control method and system based on CNC machine tool processing optimization, which obtains materials to be processed on multiple conveyor belts included in the CNC machine tool; identifies the materials to be processed on the conveyor belt to be controlled among the multiple conveyor belts at the conveyor belt entrance control point to determine the entrance to-be-controlled state of the materials to be processed; identifies the materials to be processed on the conveyor belt to be controlled at the conveyor belt exit control point to determine the exit to-be-controlled state of the materials to be processed; determines the middle control point of the conveyor belt based on the changes in the conveyor belt exit control point, the entrance to-be-controlled state, the exit to-be-controlled state and the to-be-controlled state of the conveyor belt to be controlled; identifies the conveyor belt to be controlled at the middle control point of the conveyor belt to control the CNC machine tool components in the conveyor belt to be controlled; the present invention can effectively and precisely control the processing materials of the conveyor belt of the CNC machine tool, and avoid processing defects to the greatest extent possible;
[0004] However, the above-mentioned reference patent identifies the status of the materials to be processed at multiple conveyor entrances and exits of the CNC machine tool, and combines the changes in the conveyor belt control state to decide the central control point to accurately control the CNC machine tool components in the conveyor belt, thereby effectively avoiding processing defects. However, it cannot accurately extract the contour and edge features of the workpiece, cannot guarantee the accurate description of the workpiece shape, cannot accurately and quickly solve the spatial position and posture of the workpiece, and cannot guarantee the processing accuracy and efficiency of the workpiece; at the same time, it cannot effectively optimize the motion trajectory parameters of the processing tool, cannot generate the optimal operation plan for the processing tool, and cannot guarantee the safety and accuracy of the processing process.
[0005] To this end, we propose a motion positioning control system and method for CNC machining centers with visual recognition to address the above problems. Summary of the Invention
[0006] The purpose of the present invention is to provide a motion positioning control system and method for a CNC machining center with visual recognition, which solves the problems that the existing technology cannot accurately extract the contour and edge features of the workpiece, cannot ensure the accurate description of the workpiece shape, cannot accurately and quickly solve the spatial position and posture of the workpiece, and cannot ensure the processing accuracy and efficiency of the workpiece; at the same time, it cannot effectively optimize the motion trajectory parameters of the processing tool, cannot generate the optimal operation plan of the processing tool, and cannot ensure the safety and accuracy of the processing process.
[0007] The purpose of the present invention is achieved through the following technical solutions:
[0008] The motion positioning control system of CNC machining centers with visual recognition is applied to CNC machining management platforms, including:
[0009] A visual acquisition module is used to acquire visual images of workpieces in real time and perform preprocessing operations on the acquired visual images;
[0010] The visual recognition module is used to extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features;
[0011] The motion planning module is used to optimize the motion trajectory parameters of the processing tool based on the spatial position and posture information of the workpiece using an optimization algorithm to generate the best operation plan for the processing tool;
[0012] The exception handling module is used to monitor key operating parameters during the workpiece processing in real time. When an abnormal situation is detected, an early warning is triggered and corresponding measures are taken to handle it.
[0013] As a preferred embodiment of the present invention, the process of extracting the contour features of the workpiece from the preprocessed visual image by the visual recognition module includes:
[0014] The contour of the workpiece is extracted from the visual image through the contour search algorithm. After the extraction is completed, a series of contour point coordinates are returned, and each contour point is represented by (x, y) coordinates;
[0015] From the extracted contour point coordinates, the following contour features can be calculated:
[0016] Area: The area enclosed by the outline, calculated using the integral formula for the outline polygon: Where (x i ,y i ) is the coordinate of the i-th point on the contour, N is the total number of contour points, and (x N ,y N )=(x0,y0);
[0017] Perimeter: The length of the contour, calculated using Euclidean distance between adjacent points and then summed: Where (x i ,y i ) and (x i+1 ,y i+1 ) are continuous contour points;
[0018] Centroid: The geometric center of the contour, calculated using the following formula:
[0019]
[0020] Moment: The shape feature of the contour. The central moment is calculated using the following formula:
[0021] Where p and q are non-negative integers representing the order of the moment, is the centroid coordinate of the contour. Depending on the values of p and q, different second-order central moments can be obtained:
[0022] M 20 Indicates the horizontal dispersion, M 02 Indicates the vertical dispersion, M 11 Indicates the degree or direction of the slope of a shape.
[0023] As a preferred embodiment of the present invention, the process of extracting the edge features of the workpiece from the preprocessed visual image by the visual recognition module includes:
[0024] The edges in the visual image are detected by the Canny algorithm, which extracts edges through the following steps:
[0025] T1: Gaussian blur processing is performed on the visual image;
[0026] T2: Use the Sobel operator to calculate the gradient and obtain the edge strength and direction;
[0027] T3: Eliminate non-edge points and retain local maxima;
[0028] T4: Use high and low thresholds to determine the edge;
[0029] The gradient is calculated using the following formula:
[0030] Where I(x,y) is the input image pixel, * represents the convolution operation;
[0031] From the detected edge pixels, the following edge features are extracted:
[0032] Edge length: The sum of all pixels identified as edge points in the image, calculated using the following formula:
[0033] Where Edge(x i ,y i ) is a binary function;
[0034] Edge direction: The gradient direction of each edge point is calculated using the following formula:
[0035] Among them G x and G y are the gradients of the image in the x and y directions, respectively.
[0036] As a preferred embodiment of the present invention, the process of the visual recognition module calculating the spatial position and posture information of the workpiece based on the extracted contour and edge features includes:
[0037] Obtain the extracted 2D contour features and edge features, obtain a 3D model of a known workpiece, extract feature points on the 3D model of the workpiece, extract 2D feature points corresponding to the feature points of the 3D model in the visual image, use feature descriptors to describe the local features of the feature points, and use a matching algorithm to find matching point pairs;
[0038] The PnP algorithm is used to calculate the spatial position and posture information of the workpiece, which is expressed by the following formula:
[0039]
[0040] Where s is the scale factor, [u,v] represents the pixel coordinates of the two-dimensional feature points in the image, and K is the intrinsic parameter matrix of the camera, including the focal length (f x ,f y ) and principal point coordinates (c x ,c y ), [R|t] is the extrinsic parameter matrix of the camera, R is a 3×3 rotation matrix, t is a 3×1 translation vector, indicating the translation of the camera, and [X, Y, Z] is the coordinate of the feature point in the 3D model;
[0041] By solving the matching point pairs, the PnP algorithm formula is solved in combination with EPnP. The solved R and t are the posture information of the workpiece. R represents the rotation of the workpiece relative to the camera coordinate system, and t represents the translation of the workpiece relative to the camera coordinate system. The position of the camera in the world coordinate system is obtained, and the spatial position P of the workpiece in the world coordinate system is obtained by coordinate transformation. sw .
[0042] As a preferred embodiment of the present invention, the specific process of the motion planning module using the optimization algorithm to optimize the motion trajectory parameters of the machining tool is as follows:
[0043] Obtain the calculated workpiece space position and posture information, the workpiece space position is P sw , the workpiece posture information is R and t;
[0044] The motion trajectory parameters of the machining tool are defined as vector r = [P gj , V gj , J gj ,θ gj ] T , where P gj is the spatial position of the machining tool, V gj is the movement speed of the machining tool, J gj is the motion acceleration of the machining tool, θ gj The posture of the processing tool;
[0045] The optimization algorithm is used to optimize the motion trajectory parameters of the machining tool. The optimization goal is to minimize the machining time JS and maximize the machining accuracy JD while satisfying the motion constraints. The objective function is:
[0046] f(r)=u1·JS(r)+u2·(JD target -JD(r)), where JS(r) is the processing time calculated by inputting the processing tool motion trajectory parameter r, JD(r) is the processing accuracy calculated by inputting the processing tool motion trajectory parameter v, and JD target is the target machining accuracy, u1 and u2 are weight coefficients;
[0047] Constraints:
[0048] where d min is the minimum distance that must be maintained between the machining tool and the workpiece, θ qw is the desired direction of motion of the machining tool.
[0049] As a preferred embodiment of the present invention, the process of the motion planning module solving the objective function and generating the optimal operation plan for the machining tool includes:
[0050] The steps to solve the objective function are as follows:
[0051] S1: Initialization: randomly generate a set of machining tool motion trajectory parameters r;
[0052] S2: Calculate the objective function: calculate f(r) according to the mathematical model;
[0053] S3: Evaluate the constraints: Check whether the motion trajectory parameters of the machining tool meet the motion constraints;
[0054] S4: Update parameters: Use optimization algorithm to update the motion trajectory parameters of the machining tool;
[0055] S5: Iteration: Repeat steps S2-S4 until the convergence condition or the maximum number of iterations is reached;
[0056] By solving the objective function, the optimal machining tool motion trajectory parameter vector r is obtained * =[P gj * , V gj * , J gj * ,θ gj * ] T , according to the optimal machining tool motion trajectory parameter vector r * Generate the best operation plan for machining tools, including:
[0057] The spatial position P of the current processing tool gj Adjust to the optimal spatial position P gj * ;
[0058] The current movement speed of the processing tool V gj Adjust to the optimal movement speed V gj * ;
[0059] The current motion acceleration J of the machining tool gj Adjust to the optimal motion acceleration J gj * ;
[0060] The current posture of the machining tool θ gj Adjust to the optimal posture θ gj * .
[0061] As a preferred embodiment of the present invention, the process of the exception handling module processing key operating parameters during workpiece processing includes:
[0062] Obtain key operating parameters during workpiece machining, including cutting force, vibration acceleration, CNC machining motor current, and spindle temperature, generate a monitoring cycle, and divide the monitoring cycle into multiple monitoring periods;
[0063] Obtain the cutting force imbalance value during the workpiece machining process within the monitoring period and mark the cutting force imbalance value as QXS. The cutting force imbalance value represents the ratio between the portion of the cutting force variation difference greater than the preset cutting force variation difference threshold within each monitoring period and the cutting force variation difference. The cutting force variation difference represents the difference between the maximum and minimum cutting force values.
[0064] Using the method of calculating the cutting force imbalance value QXS, the vibration acceleration imbalance value ZJS, the CNC machining motor current imbalance value DLS and the spindle temperature imbalance value ZWS can be obtained.
[0065] As a preferred embodiment of the present invention, the process of triggering an early warning when the abnormality handling module detects an abnormality includes:
[0066] Obtain the cutting force imbalance value QXS, vibration acceleration imbalance value ZJS, CNC machining motor current imbalance value DLS, and spindle temperature imbalance value ZWS, calculate the workpiece machining abnormality assessment value GYP through the formula, and compare the workpiece machining abnormality assessment value GYP with the preset workpiece machining abnormality assessment value threshold:
[0067] If the workpiece processing abnormality assessment value GYP is less than the preset workpiece processing abnormality assessment value threshold, it indicates that the workpiece processing process is normal;
[0068] If the workpiece machining abnormality assessment value GYP is greater than or equal to the preset workpiece machining abnormality assessment value threshold, it indicates that the workpiece machining process is abnormal, and an early warning signal is generated and sent to the CNC machining management platform;
[0069] After receiving the early warning signal, the CNC machining management platform will immediately send a notification to the relevant management personnel and take appropriate measures to deal with it.
[0070] As a preferred embodiment of the present invention, a motion positioning control method for a CNC machining center with visual recognition includes the following steps:
[0071] Step 1: Collect the visual image of the workpiece in real time and perform preprocessing operations on the collected visual image;
[0072] Step 2: Extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features;
[0073] Step 3: Based on the spatial position and posture information of the workpiece, the optimization algorithm is used to optimize the motion trajectory parameters of the processing tool to generate the optimal operation plan for the processing tool;
[0074] Step 4: Monitor key operating parameters during workpiece processing in real time, trigger an early warning when an abnormal situation is detected, and take appropriate measures to deal with it.
[0075] Compared with the prior art, the advantages of the present invention are:
[0076] (1) In the present invention, the contour and edge features of the workpiece are accurately extracted through the visual recognition module to ensure accurate shape description. The spatial position and posture of the workpiece are quickly solved by combining the three-dimensional model with the two-dimensional image feature point matching. The efficient image processing algorithm and hardware acceleration ensure real-time performance. The world coordinate system position of the workpiece is obtained through coordinate transformation to ensure processing accuracy and efficiency.
[0077] (2) In the present invention, the motion trajectory parameters of the processing tool are optimized through the motion planning module to minimize the processing time and maximize the processing accuracy, while satisfying the constraints such as the minimum safety distance and the desired motion direction. By defining the objective function and combining it with an efficient iterative solution method, the optimal operation plan of the processing tool is generated to ensure the safety and accuracy of the processing process, and significantly improve the processing efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 This is a system block diagram of Embodiment 1 of the present invention;
[0079] Figure 2 A flowchart of the steps of extracting image edges using the Canny algorithm in an embodiment of the present invention;
[0080] Figure 3 Flowchart of the steps for solving the objective function in an embodiment of the present invention;
[0081] Figure 4 The figure is a flow chart of the motion positioning control method of a CNC machining center with visual recognition in the present invention. DETAILED DESCRIPTION
[0082] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work shall fall within the scope of protection of the present invention.
[0083] Example 1: Figure 1 、 Figure 2 and Figure 3 As shown, the motion positioning control system of a CNC machining center with visual recognition proposed by the present invention is applied to a CNC machining management platform and is characterized by including:
[0084] A visual acquisition module is used to acquire visual images of workpieces in real time and perform preprocessing operations on the acquired visual images. The preprocessing operations include but are not limited to grayscale processing, Gaussian filtering denoising and adaptive threshold segmentation;
[0085] The visual acquisition module significantly improves the performance and reliability of the CNC machining center through a series of preprocessing operations; grayscale processing reduces the amount of data, speeds up processing, and simplifies subsequent analysis; Gaussian filtering effectively removes noise while protecting image edges and enhancing the accuracy of contour extraction; adaptive threshold segmentation dynamically adjusts the threshold according to local characteristics, which is particularly suitable for images with uneven lighting or complex backgrounds, improving segmentation accuracy; these preprocessing steps enhance the robustness of the system, enabling it to cope with different lighting conditions and environmental interference, ensuring efficient and precise workpiece processing, and the high-quality preprocessing results also improve the accuracy of subsequent visual recognition tasks (such as contour extraction and feature matching).
[0086] The visual recognition module is used to extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features;
[0087] The process of extracting the workpiece contour features from the preprocessed visual image by the visual recognition module includes:
[0088] The contour of the workpiece is extracted from the visual image through the contour finding algorithm (such as the findContours function of OpenCV). The contour finding algorithm is a mature technology in the existing technology. The specific process is not elaborated in detail here. After the extraction is completed, a series of contour point coordinates are returned. Each contour point is represented by (x, y coordinates). The contour is usually represented as a series of polygons. These points are arranged in order according to the direction of the contour.
[0089] From the extracted contour point coordinates, the following contour features can be calculated:
[0090] Area: The area enclosed by the outline, calculated using the integral formula for the outline polygon: Where (x i ,y i ) is the coordinate of the i-th point on the contour, N is the total number of contour points, and (x N ,y N )=(x0,y0);
[0091] Perimeter: The length of the contour, calculated using Euclidean distance between adjacent points and then summed: Where (x i ,y i ) and (x i+1 ,y i+1 ) are continuous contour points;
[0092] Centroid: The geometric center of the contour, calculated using the following formula:
[0093]
[0094] Moment: The shape feature of the contour. The central moment is calculated using the following formula:
[0095] Where p and q are non-negative integers representing the order of the moment, is the centroid coordinate of the contour. Depending on the values of p and q, different second-order central moments can be obtained:
[0096] M 20 Indicates the horizontal dispersion, M 02 Indicates the vertical dispersion, M 11 Indicates the degree or direction of the shape's tilt;
[0097] The process of extracting workpiece edge features from the preprocessed visual image by the visual recognition module includes:
[0098] The edges in the visual image are detected by the Canny algorithm, which extracts edges through the following steps:
[0099] T1: Perform Gaussian blur processing on the visual image to reduce noise;
[0100] T2: Use the Sobel operator to calculate the gradient and obtain the edge strength and direction;
[0101] T3: Eliminate non-edge points and retain local maxima;
[0102] T4: Use high and low thresholds to determine the edge;
[0103] The gradient is calculated using the following formula:
[0104] Where I(x,y) is the input image pixel, * represents the convolution operation;
[0105] From the detected edge pixels, the following edge features are extracted:
[0106] Edge length: The sum of all pixels identified as edge points in the image, calculated using the following formula:
[0107] Where Edge(x i ,y i ) is a binary function used to determine the point (x i ,y i ) is an edge point:
[0108] If Edge(x i ,y i ) is equal to 1, it means that the point is an edge point;
[0109] If Edge(x i,y i ) is equal to 0, it means that the point is not an edge point;
[0110] Edge direction: The gradient direction of each edge point is calculated using the following formula:
[0111] Among them G x and G y are the gradients of the image in the x and y directions respectively;
[0112] The process by which the visual recognition module calculates the spatial position and posture information of the workpiece based on the extracted contour and edge features includes:
[0113] Obtain the extracted two-dimensional contour features and edge features, obtain a three-dimensional model of a known workpiece, extract feature points (such as corner points and key points) on the three-dimensional model of the workpiece, extract two-dimensional feature points corresponding to the feature points of the three-dimensional model in the visual image, use feature descriptors (such as SIFT, SURF, ORB) to describe the local features of the feature points, and use a matching algorithm (such as nearest neighbor matching) to find matching point pairs. The above-mentioned extraction of feature points on the three-dimensional model and extraction of corresponding two-dimensional feature points in the image are common technical means in the prior art and will not be elaborated on here. The above-mentioned feature descriptors describing the local features of the feature points and the matching algorithm finding matching point pairs are also common technical means in the prior art and will not be elaborated on here.
[0114] Methods for establishing a three-dimensional model of the workpiece: Use software design. If the workpiece is newly designed, use software such as SolidWorks or AutoCAD to directly create a three-dimensional model;
[0115] Use 3D scanning. If the workpiece already exists, use 3D scanning technology to obtain a 3D model of the workpiece;
[0116] Photo modeling, which involves taking photos of the workpiece from multiple angles and using specialized software to convert these photos into a three-dimensional model of the workpiece;
[0117] The PnP algorithm is used to calculate the spatial position and posture information of the workpiece, which is expressed by the following formula:
[0118]
[0119] Where s is the scale factor, which represents the depth information and is a proportional coefficient, [u, v] represents the pixel coordinates of the two-dimensional feature points in the image, and K is the intrinsic parameter matrix of the camera, including the focal length (f x ,f y ) and principal point coordinates (c x ,c y), where the camera is an industrial camera, which is used in industrial vision systems to achieve precise positioning and posture estimation of the workpiece. [R|t] is the camera's extrinsic parameter matrix, R is a 3×3 rotation matrix, and t is a 3×1 translation vector, representing the translation of the camera. [R|t] together describes the posture of the workpiece, and [X, Y, Z] are the coordinates of the feature points in the 3D model.
[0120] By solving the matching point pairs (at least 6), the PnP algorithm formula is solved in combination with EPnP (using EPnP to solve the PnP algorithm formula is a common technical means in the prior art, and the specific solution process is not elaborated here). The solved R and t are the posture information of the workpiece. R represents the rotation of the workpiece relative to the camera coordinate system, and t represents the translation of the workpiece relative to the camera coordinate system. The position of the camera in the world coordinate system is obtained, and the spatial position P of the workpiece in the world coordinate system is obtained by coordinate transformation. sw ;
[0121] The visual recognition module uses contour search and edge detection algorithms to accurately extract the contours and edge features of the workpiece, ensuring accurate shape description; it combines the three-dimensional model with the two-dimensional image feature point matching, and uses optimization algorithms to quickly solve the spatial position and posture of the workpiece, supporting multiple modeling methods; Gaussian filtering and adaptive threshold segmentation enhance the robustness and adaptability of the system; efficient image processing algorithms and hardware acceleration ensure real-time performance; the world coordinate system position of the workpiece is obtained through coordinate transformation to ensure processing accuracy and efficiency; this module provides high-precision, strong robustness and high-efficiency solutions, significantly improving the work efficiency and product quality of CNC machining centers.
[0122] The motion planning module is used to optimize the motion trajectory parameters of the processing tool based on the spatial position and posture information of the workpiece using an optimization algorithm to generate the best operation plan for the processing tool;
[0123] The specific process of the motion planning module using the optimization algorithm to optimize the motion trajectory parameters of the machining tool is as follows:
[0124] Obtain the calculated workpiece space position and posture information, the workpiece space position is P sw , the workpiece posture information is R and t;
[0125] The motion trajectory parameters of the machining tool are defined as vector r = [P gj , V gj , J gj ,θ gj ] T , where P gj is the spatial position of the machining tool, V gj is the movement speed of the machining tool, J gj is the motion acceleration of the machining tool, θgj The posture of the processing tool;
[0126] The optimization algorithm is used to optimize the motion trajectory parameters of the machining tool. The optimization goal is to minimize the machining time JS and maximize the machining accuracy JD while satisfying the motion constraints. The objective function is:
[0127] f(r)=u1·JS(r)+u2·(JD target -JD(r)), where JS(r) is the processing time calculated by inputting the processing tool motion trajectory parameter r, JD(r) is the processing accuracy calculated by inputting the processing tool motion trajectory parameter v, and JD target is the target machining accuracy, u1 and u2 are weight coefficients;
[0128] Constraints:
[0129] where d min The minimum distance that must be maintained between the processing tool and the workpiece is a safety distance pre-set according to the processing requirements. qw The desired direction of motion of the machining tool is the ideal posture pre-set according to the machining requirements;
[0130] The process of the motion planning module solving the objective function and generating the optimal operation plan for the machining tool includes:
[0131] The steps to solve the objective function are as follows:
[0132] S1: Initialization: randomly generate a set of machining tool motion trajectory parameters r;
[0133] S2: Calculate the objective function: calculate f(r) according to the mathematical model;
[0134] S3: Evaluate the constraints: Check whether the motion trajectory parameters of the machining tool meet the motion constraints;
[0135] S4: Update parameters: Use optimization algorithm to update the motion trajectory parameters of the machining tool;
[0136] S5: Iteration: Repeat steps S2-S4 until the convergence condition or the maximum number of iterations is reached;
[0137] By solving the objective function, the optimal machining tool motion trajectory parameter vector r is obtained * =[P gj * , V gj * , J gj * ,θ gj * ] T, according to the optimal machining tool motion trajectory parameter vector r * Generate the best operation plan for machining tools, including:
[0138] The spatial position P of the current processing tool gj Adjust to the optimal spatial position P gj * ;
[0139] The current movement speed of the processing tool V gj Adjust to the optimal movement speed V gj * ;
[0140] The current motion acceleration J of the machining tool gj Adjust to the optimal motion acceleration J gj * ;
[0141] The current posture of the machining tool θ gj Adjust to the optimal posture θ gj * ;
[0142] The motion planning module optimizes the motion trajectory parameters (spatial position, motion speed, motion acceleration and posture) of the processing tool through optimization algorithms to minimize processing time and maximize processing accuracy, while meeting constraints such as minimum safety distance and desired motion direction; by defining the objective function and combining iterative solution methods, it generates the best operation plan to ensure the safety and accuracy of the processing process; this module has the advantages of high-precision optimization, dynamic adjustment capabilities, safety protection, real-time processing and comprehensive quality assurance, which significantly improves processing efficiency and product quality, and ensures the reliability and accuracy of the CNC machining center.
[0143] Embodiment 2: The technical solution of this embodiment of the present invention differs from that of Embodiment 1 in that:
[0144] like Figure 1 As shown, the exception handling module is used to monitor the key operating parameters of the workpiece processing in real time, trigger an early warning when an abnormal situation is detected, and take corresponding measures to deal with it;
[0145] The process of the exception handling module processing key operating parameters during workpiece processing includes:
[0146] Obtain key operating parameters during workpiece machining, including cutting force, vibration acceleration, CNC machining motor current, and spindle temperature, generate a monitoring cycle, and divide the monitoring cycle into multiple monitoring periods;
[0147] Obtain the cutting force imbalance value during the workpiece machining process within the monitoring period and mark the cutting force imbalance value as QXS. The cutting force imbalance value represents the ratio between the portion of the cutting force variation difference greater than the preset cutting force variation difference threshold within each monitoring period and the cutting force variation difference. The cutting force variation difference represents the difference between the maximum and minimum cutting force values.
[0148] Using the method of calculating the cutting force imbalance value QXS, the vibration acceleration imbalance value ZJS, the CNC machining motor current imbalance value DLS and the spindle temperature imbalance value ZWS can be obtained in the same way;
[0149] The process of triggering an alert when the exception handling module detects an abnormal situation includes:
[0150] Obtain the cutting force imbalance value QXS, vibration acceleration imbalance value ZJS, CNC machining motor current imbalance value DLS, and spindle temperature imbalance value ZWS, and calculate the workpiece machining abnormality assessment value GYP using the following formula:
[0151] GYP=h1*QXS+h2*ZJS+h3*DLS+h4*ZWS, where h1, h2, h3 and h4 are weight coefficients. By analyzing historical data, we can understand the influence of weight coefficients h1, h2, h3 and h4 on the workpiece processing process. Based on historical data, we can determine the specific values of h1, h2, h3 and h4 to ensure that the calculated workpiece processing abnormality assessment value GYP can accurately reflect the actual processing status of the workpiece during processing.
[0152] Compare the workpiece processing abnormality assessment value GYP with the preset workpiece processing abnormality assessment value threshold:
[0153] If the workpiece processing abnormality assessment value GYP is less than the preset workpiece processing abnormality assessment value threshold, it indicates that the workpiece processing process is normal;
[0154] If the workpiece machining abnormality assessment value GYP is greater than or equal to the preset workpiece machining abnormality assessment value threshold, it indicates that the workpiece machining process is abnormal, and an early warning signal is generated and sent to the CNC machining management platform;
[0155] After receiving the early warning signal, the CNC machining management platform will immediately send a notification to the relevant management personnel and take appropriate measures to deal with it. The specific handling measures are as follows:
[0156] Stop processing immediately: Pause the current processing task through the CNC system to prevent further damage to the workpiece or equipment;
[0157] Evaluate the cause of the abnormality: Call historical and real-time monitoring data to determine the cause of the abnormality (such as excessive cutting force, excessive temperature, abnormal vibration), check whether the tool is worn or damaged, replace the tool if necessary, and check whether the workpiece has deformation or other quality problems;
[0158] Adjust processing parameters: adjust cutting speed, feed rate and cutting depth according to the abnormal cause to reduce the impact on the tool and workpiece. If the temperature rises abnormally, increase the coolant flow or reduce its temperature to ensure effective heat dissipation;
[0159] Equipment maintenance and calibration: Check whether the key mechanical components of the machine tool (such as the spindle, guide rails, and lead screws) are worn or loose. If the positioning accuracy is found to be reduced, recalibrate the machine tool coordinate system;
[0160] The exception handling module monitors key parameters such as cutting force, vibration acceleration, motor current and spindle temperature in real time. When an anomaly is detected, it generates an early warning signal and takes measures, including suspending processing, evaluating the cause of the anomaly, adjusting parameters and equipment maintenance and calibration. The module uses a multi-dimensional evaluation method to calculate the anomaly assessment value and determines the weight coefficient based on historical data to ensure the accuracy of the evaluation results. It realizes real-time monitoring and rapid response, precise anomaly assessment, multi-level anomaly handling measures and efficient fault prevention and management, significantly improving work efficiency and product quality, and ensuring the reliability and safety of the processing process.
[0161] Embodiment 3: The technical solution of the embodiment of the present invention is different from that of the embodiment 1 and the embodiment 2 in that:
[0162] like Figure 4 As shown, the motion positioning control method of a CNC machining center with visual recognition includes the following steps:
[0163] Step 1: Collect the visual image of the workpiece in real time and perform preprocessing operations on the collected visual image;
[0164] Step 2: Extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features;
[0165] Step 3: Based on the spatial position and posture information of the workpiece, the optimization algorithm is used to optimize the motion trajectory parameters of the processing tool to generate the optimal operation plan for the processing tool;
[0166] Step 4: Real-time monitoring of key operating parameters during workpiece processing. When abnormal conditions are detected, an early warning is triggered and corresponding measures are taken to address them.
[0167] This method uses advanced image processing technology to accurately extract workpiece features, uses PnP and its optimized version EPnP algorithm to achieve high-precision spatial positioning and posture estimation, and optimizes the processing path in real time to take into account both processing time and accuracy; it monitors key operating parameters in real time, detects and responds to potential problems early, and ensures processing safety and stability; Gaussian filtering and adaptive threshold segmentation enhance the system's robustness and adaptability in complex environments, combines historical data analysis to improve anomaly detection accuracy, and continuously monitors data to predict faults in advance and take preventive measures. Multi-level anomaly handling measures improve system reliability and safety.
[0168] The above are only preferred specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes based on the technical solutions and improved concepts of the present invention within the technical scope disclosed by the present invention, and they should be covered by the scope of protection of the present invention.
Claims
1. Motion positioning control system for CNC machining center with visual recognition, applied to CNC machining management platform, characterized by: include: A visual acquisition module is used to acquire visual images of workpieces in real time and perform preprocessing operations on the acquired visual images; The visual recognition module is used to extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features; The motion planning module is used to optimize the motion trajectory parameters of the processing tool based on the spatial position and posture information of the workpiece using an optimization algorithm to generate the best operation plan for the processing tool; The exception handling module is used to monitor key operating parameters during the workpiece processing in real time. When an abnormal situation is detected, an early warning is triggered and corresponding measures are taken to handle it.
2. The motion positioning control system for a CNC machining center with visual recognition according to claim 1 is characterized in that: The process of extracting the workpiece contour features from the pre-processed visual image by the visual recognition module includes: The contour of the workpiece is extracted from the visual image through the contour search algorithm. After the extraction is completed, a series of contour point coordinates are returned, and each contour point is represented by (x, y) coordinates; From the extracted contour point coordinates, the following contour features can be calculated: Area: The area enclosed by the outline, calculated using the integral formula for the outline polygon: Where (x i ,y i ) is the coordinate of the i-th point on the contour, N is the total number of contour points, and (x N ,y N )=(x0,y0); Perimeter: The length of the contour, calculated using Euclidean distance between adjacent points and then summed: Where (x i ,y i ) and (x i+1 ,y i+1 ) are continuous contour points; Centroid: The geometric center of the contour, calculated using the following formula: Moment: The shape feature of the contour. The central moment is calculated using the following formula: Where p and q are non-negative integers representing the order of the moment, is the centroid coordinate of the contour. Depending on the values of p and q, different second-order central moments can be obtained: M 20 Indicates the horizontal dispersion, M 02 Indicates the vertical dispersion, M 11 Indicates the degree or direction of the slope of a shape.
3. The motion positioning control system for a CNC machining center with visual recognition according to claim 2, characterized in that: The process of extracting the edge features of the workpiece from the pre-processed visual image by the visual recognition module includes: The Canny algorithm detects edges in visual images. The Canny algorithm extracts edges through the following steps: T1: Gaussian blur processing is performed on the visual image; T2: Use the Sobel operator to calculate the gradient and obtain the edge strength and direction; T3: Eliminate non-edge points and retain local maxima; T4: Use high and low thresholds to determine the edge; The gradient is calculated using the following formula: Where I(x,y) is the input image pixel, * represents the convolution operation; From the detected edge pixels, the following edge features are extracted: Edge length: The sum of all pixels identified as edge points in the image, calculated using the following formula: Where Edge(x i ,y i ) is a binary function; Edge direction: The gradient direction of each edge point is calculated using the following formula: Among them G x and G y are the gradients of the image in the x and y directions, respectively.
4. The motion positioning control system for a CNC machining center with visual recognition according to claim 3 is characterized in that: The process of the visual recognition module calculating the spatial position and posture information of the workpiece based on the extracted contour and edge features includes: Obtain the extracted 2D contour features and edge features, obtain a 3D model of a known workpiece, extract feature points on the 3D model of the workpiece, extract 2D feature points corresponding to the feature points of the 3D model in the visual image, use feature descriptors to describe the local features of the feature points, and use a matching algorithm to find matching point pairs; The PnP algorithm is used to calculate the spatial position and posture information of the workpiece, which is expressed by the following formula: Where s is the scale factor, [u,v] represents the pixel coordinates of the two-dimensional feature points in the image, and K is the intrinsic parameter matrix of the camera, including the focal length (f x ,f y ) and principal point coordinates (c x ,c y ), [R|t] is the extrinsic parameter matrix of the camera, R is a 3×3 rotation matrix, t is a 3×1 translation vector, indicating the translation of the camera, and [X, Y, Z] is the coordinate of the feature point in the 3D model; By solving the matching point pairs, the PnP algorithm formula is solved in combination with EPnP. The solved R and t are the posture information of the workpiece. R represents the rotation of the workpiece relative to the camera coordinate system, and t represents the translation of the workpiece relative to the camera coordinate system. The position of the camera in the world coordinate system is obtained, and the spatial position P of the workpiece in the world coordinate system is obtained by coordinate transformation. sw .
5. The motion positioning control system for a CNC machining center with visual recognition according to claim 1, characterized in that: The specific process of the motion planning module using the optimization algorithm to optimize the motion trajectory parameters of the machining tool is as follows: Obtain the calculated workpiece space position and posture information, the workpiece space position is P sw , the workpiece posture information is R and t; The motion trajectory parameters of the machining tool are defined as vector r = [P gj , V gj , J gj ,θ gj ] T , where P gj is the spatial position of the machining tool, V gj is the movement speed of the machining tool, J gj is the motion acceleration of the machining tool, θ gj The posture of the processing tool; The optimization algorithm is used to optimize the motion trajectory parameters of the machining tool. The optimization goal is to minimize the machining time JS and maximize the machining accuracy JD while satisfying the motion constraints. The objective function is: f(r)=u1·JS(r)+u2·(JD target -JD(r)), where JS(r) is the processing time calculated by inputting the processing tool motion trajectory parameter r, JD(r) is the processing accuracy calculated by inputting the processing tool motion trajectory parameter v, and JD target is the target machining accuracy, u1 and u2 are weight coefficients; Constraints: where d min is the minimum distance that must be maintained between the machining tool and the workpiece, θ qw is the desired direction of motion of the machining tool.
6. The motion positioning control system for a CNC machining center with visual recognition according to claim 5, characterized in that: The process of the motion planning module solving the objective function and generating the optimal operation plan for the machining tool includes: The steps to solve the objective function are as follows: S1: Initialization: randomly generate a set of machining tool motion trajectory parameters r; S2: Calculate the objective function: calculate f(r) according to the mathematical model; S3: Evaluate the constraints: Check whether the motion trajectory parameters of the machining tool meet the motion constraints; S4: Update parameters: Use optimization algorithm to update the motion trajectory parameters of the machining tool; S5: Iteration: Repeat steps S2-S4 until the convergence condition or the maximum number of iterations is reached; By solving the objective function, the optimal machining tool motion trajectory parameter vector r is obtained * =[P gj * , V gj * , J gj * ,θ gj * ] T , according to the optimal machining tool motion trajectory parameter vector r * Generate the best operation plan for machining tools, including: The spatial position P of the current processing tool gj Adjust to the optimal spatial position P gj * ; The current movement speed of the processing tool V gj Adjust to the optimal movement speed V gj * ; The current motion acceleration J of the machining tool gj Adjust to the optimal motion acceleration J gj * ; The current posture of the machining tool θ gj Adjust to the optimal posture θ gj * .
7. The motion positioning control system for a CNC machining center with visual recognition according to claim 1, characterized in that: The process of the exception handling module processing the key operating parameters during the workpiece processing includes: Obtain key operating parameters during workpiece machining, including cutting force, vibration acceleration, CNC machining motor current, and spindle temperature, generate a monitoring cycle, and divide the monitoring cycle into multiple monitoring periods; Obtain the cutting force imbalance value during the workpiece machining process within the monitoring period and mark the cutting force imbalance value as QXS. The cutting force imbalance value represents the ratio between the portion of the cutting force variation difference greater than the preset cutting force variation difference threshold within each monitoring period and the cutting force variation difference. The cutting force variation difference represents the difference between the maximum and minimum cutting force values. Using the method of calculating the cutting force imbalance value QXS, the vibration acceleration imbalance value ZJS, the CNC machining motor current imbalance value DLS and the spindle temperature imbalance value ZWS can be obtained.
8. The motion positioning control system for a CNC machining center with visual recognition according to claim 7, characterized in that: The process of triggering an early warning when the abnormality handling module detects an abnormality includes: Obtain the cutting force imbalance value QXS, vibration acceleration imbalance value ZJS, CNC machining motor current imbalance value DLS, and spindle temperature imbalance value ZWS, calculate the workpiece machining abnormality assessment value GYP through the formula, and compare the workpiece machining abnormality assessment value GYP with the preset workpiece machining abnormality assessment value threshold: If the workpiece processing abnormality assessment value GYP is less than the preset workpiece processing abnormality assessment value threshold, it indicates that the workpiece processing process is normal; If the workpiece machining abnormality assessment value GYP is greater than or equal to the preset workpiece machining abnormality assessment value threshold, it indicates that the workpiece machining process is abnormal, and an early warning signal is generated and sent to the CNC machining management platform; After receiving the early warning signal, the CNC machining management platform will immediately send a notification to the relevant management personnel and take appropriate measures to deal with it.
9. A motion positioning control method for a CNC machining center with visual recognition, characterized in that: The following steps are involved: Step 1: Collect the visual image of the workpiece in real time and perform preprocessing operations on the collected visual image; Step 2: Extract the contour and edge features of the workpiece from the preprocessed visual image, and calculate the spatial position and posture information of the workpiece based on the extracted contour and edge features; Step 3: Based on the spatial position and posture information of the workpiece, the optimization algorithm is used to optimize the motion trajectory parameters of the processing tool to generate the optimal operation plan for the processing tool; Step 4: Monitor key operating parameters during workpiece processing in real time, trigger an early warning when an abnormal situation is detected, and take appropriate measures to deal with it.
Citation Information
Patent Citations
Motion control method and system based on numerical control machine tool machining optimization
CN116841215A
On-line quality control method and system for machining, and processing machine tool
CN105573250A
Curved surface part numerical control machining positioning method
CN109318051A
Robot grinding track optimization method based on digital twinning and visual communication technology
CN116276328A
Tool clamping device and clamping method based on visual positioning system
CN118478350A
Cited By
Pose error monitoring system for gear cutting machining workpiece
CN121104756A