A robot motion control method for a numerical control machine tool

By combining image processing and force sensors, the problems of slow response speed and insufficient accuracy of CNC machine tool motion control systems have been solved, enabling rapid classification and stable gripping of workpieces, reducing the risk of slippage and deformation, and improving production efficiency and quality.

CN120095809BActive Publication Date: 2026-11-20SHENZHEN DAJIABANG COMPUTER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510241721.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2026-11-20
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

Existing motion control systems for CNC machine tools and robots suffer from slow response speed, insufficient precision, and complex programming. They are difficult to classify and control by drawing the minimum bounding rectangle of the workpiece, and lack real-time judgment of gripping force and workpiece deformation, making it difficult to detect gripping risks and deformation.

Method used

Workpiece information is acquired using image acquisition equipment, feature points are matched using Harris corner detection and SIFT algorithm, the position of the main axis is determined by least squares line fitting method, the minimum bounding rectangle is drawn and the area threshold is set to distinguish workpieces, the gripping force and the distance between workpiece feature points are calculated, force sensors and 3D modeling are used to judge the risk of slippage and deformation, and a search tree is constructed to plan the gripping path.

Benefits of technology

It enables rapid identification of workpiece size and position, reduces computational complexity, improves gripping accuracy and stability, reduces energy consumption and equipment wear, and improves production efficiency and work quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120095809B_ABST
    Figure CN120095809B_ABST
Patent Text Reader

Abstract

The application discloses a robot motion control method for numerical control machine tools and relates to the technical field of robots, solves the problems that it is difficult to classify workpieces by drawing the minimum circumscribed rectangle of the workpieces, setting different area thresholds, controlling the workpiece grabbing mode of the robot, and lacking the result of comparing the difference between the actual value and the theoretical value of the grabbing strength with the preset threshold to determine whether the workpiece exists the risk of falling, and the result of comparing the distance between the feature points of the workpiece before and after grabbing with the preset threshold to determine whether the workpiece grabbed by the robot is deformed, and comprises the following steps: capturing image information of the workpiece by using an image acquisition device; controlling the workpiece grabbing mode of the robot according to the obtained area category. A search tree is constructed to plan a robot grabbing path; and it is determined whether the robot has the risks of falling and deforming in the grabbing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot control, and specifically relates to a motion control method for a robot used in CNC machine tools. Background Technology

[0002] In modern manufacturing, CNC machine tools are widely used in various precision machining operations. With the improvement of industrial automation, more and more production lines are using robots to assist or replace manual operations in order to improve production efficiency and quality. To this end, a robot motion control method for CNC machine tools has emerged. Based on the calculated area of ​​the workpiece, the robot adjusts its gripping method. Through pre-classification, the robot can identify and grip the target workpiece more quickly, improving the overall efficiency of the production line. During the gripping process, the robot calculates the force and displacement values ​​before and after gripping the workpiece and compares them with the corresponding preset thresholds. Based on the comparison results, different instructions are issued to the robot.

[0003] While existing motion control systems for CNC machine tools and robots have achieved motion control to a certain extent, they often suffer from slow response speed, insufficient accuracy, and complex programming, limiting their application in high-precision applications. They struggle to classify workpieces by drawing the minimum bounding rectangle of the workpiece and setting different area thresholds, and to control the robot's workpiece gripping method. They lack the ability to determine the risk of workpiece slippage by comparing the difference between the actual and theoretical gripping force with a preset threshold, or to determine whether the robot is inspecting the workpiece for deformation by comparing the distance between workpiece feature points before and after gripping with a preset threshold. Furthermore, they lack the ability to issue different motion controls to the robot based on the results of two comparisons. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a motion control method for a robot used in CNC machine tools, which is used to solve the following technical problem: While existing motion control systems for CNC machine tools and robots have achieved motion control to a certain extent, they often suffer from slow response speed, insufficient accuracy, and complex programming, limiting their application in high-precision applications. They struggle to classify workpieces by drawing the minimum bounding rectangle of the workpiece and setting different area thresholds, and to control the robot's workpiece gripping method. They lack the ability to determine the risk of workpiece slippage by comparing the difference between the actual and theoretical gripping force with a preset threshold, or to determine whether the robot is inspecting the workpiece for deformation by comparing the distance between workpiece feature points before and after gripping with a preset threshold. Furthermore, they lack the ability to issue different motion controls to the robot based on the results of two comparisons.

[0005] To address the above problems, a first aspect of the present invention provides a motion control method for a robot used in CNC machine tools, comprising the following steps: S1: Capture image information of the workpiece using image acquisition equipment, perform preprocessing operations on the image, combine Harris corner detection and Shi-Tomasi corner detection to obtain workpiece feature points, and use the SIFT algorithm to match the same feature points in different images; S2: The initial main axis of the workpiece area is obtained by using the least squares linear fitting method. The initial position and rotation center of the horizontal and vertical main axes are determined by the principle of the center of gravity. The main axis is rotated under the constraint of the rotation termination condition. The minimum bounding rectangle is drawn. Different area thresholds are set to distinguish workpieces of different sizes. The workpiece gripping method of the robot is controlled according to the obtained area category. S3: By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are transformed into points in the base coordinate system. A search tree is constructed to plan the robot's grasping path, and the end effector is used to perform the grasping operation based on the information provided by the vision system. S4: After the gripping operation is completed, the robot judges whether there is a risk of the gripped workpiece slipping by comparing the difference between the actual gripping force and the theoretical gripping force with the preset threshold. The robot judges whether the gripped workpiece is deformed by comparing the distance between the feature points of the workpiece before and after gripping with the preset threshold. After confirming that there is no risk of the workpiece slipping and no deformation has occurred, the robot places the gripped workpiece in the designated position.

[0006] As a specific technical solution, step S1 includes the following steps: Image acquisition equipment is used to capture image information of the workpiece. The image is preprocessed, including noise removal and image enhancement. The Canny algorithm is used to extract edge information in the image, and the feature points in the image are enhanced by dilation. Harris corner detection is performed using the `cv2.cornerHarris()` function in OpenCV, and Shi-Tomasi corner detection is performed using the `cv2.goodFeaturesToTrack()` function. The corner coordinates obtained from Shi-Tomasi detection are used as seed points. The point with the largest Harris corner response value in the neighborhood of the seed point is then searched for as the final corner coordinates. Non-maximum suppression is applied to remove duplicate corners. Two 3x3 pixel matrices are convolved with the image to calculate the gradient magnitude of each pixel. The gradient magnitude is compared with a preset threshold; pixels with values ​​greater than the threshold are considered edges. The `cv2.findContours()` function is used to find contours in the image. The list of contours is traversed, and the `cv2.drawContours()` function is used to draw the contours onto the image. Finally, the SIFT algorithm is used to match identical feature points in different images.

[0007] As a specific technical solution, step S1 includes the following steps: The initial principal axes of the workpiece region are obtained using the least squares linear fitting method. The initial positions and rotation centers of the horizontal and vertical principal axes are determined using the centroid principle. The principal axes are rotated under the constraint of the rotation termination condition. The input image is preprocessed, including grayscale conversion and binarization. The findContours function in OpenCV is used to detect contours in the image. For each contour, the minAreaRect function is used to calculate its minimum bounding rectangle. The boxPoints function is used to convert the rotated rectangle into the coordinates of the four vertices. Then, the polylines function is used to draw the bounding rectangle. The center point coordinates, length and width information, rotation angle and area features are extracted from the minimum bounding rectangle. Different area thresholds are set to distinguish workpieces of different sizes. According to the set classification criteria, the workpieces are divided into different categories, including large-area workpieces, medium-area workpieces and small-area workpieces, and different colors are used to mark and record them on the image. The robot's workpiece gripping method is controlled based on the acquired area category.

[0008] As a specific technical solution, the step of converting points in the workpiece coordinate system into points in the base coordinate system by calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system includes the following steps: The base coordinate system is fixed on the robot base, and the origin and the directions of the three orthogonal coordinate axes of the base coordinate system are determined. During the machining process, the center point of the workpiece is selected as the reference point, and the three-dimensional coordinate data of the reference point is obtained using a vision system. Based on the obtained reference point coordinate data, a workpiece coordinate system is established that is fixed to the workpiece. By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are converted into points in the base coordinate system. Conversion calculation formula: in, To convert to the corresponding points in the base coordinate system, For rotation matrix, It is a translation vector. This is a point in the workpiece coordinate system.

[0009] As a specific technical solution, the process of constructing a search tree to plan the robot's grasping path and using an end effector to perform the grasping operation based on information provided by the vision system includes the following steps: In the robot's workspace, the starting position, target position, and obstacles in the workspace are determined. Starting from the starting point, a search tree is constructed through random sampling. Each time, a new configuration point is sampled, and it is checked whether the point collides with a known tree node. If there is no collision, it is added to the tree. A feasible path connecting the starting point and the target point is found in the tree. The path is optimized using the RPT algorithm. Based on the planned path, the end effector performs the grasping operation using information provided by the vision system.

[0010] As a specific technical solution, the use of an end effector to perform a grasping operation based on information provided by the vision system includes the following steps: Workpiece images are acquired using a vision system. The Canny operator edge detection algorithm is used to extract the workpiece's edge contour. Harris corner detection and Shi-Tomasi corner detection are combined to identify corners in the image as feature points. The workpiece image is then skeletonized to extract the centerline, edges, and connection points. The cv2.contourArea() and cv2.arcLength() functions in OpenCV are used to calculate the area and perimeter of the workpiece contour, as well as the center distance of the contour. The rotating caliper algorithm is used to calculate the minimum convex polygon enclosing the workpiece, and its area and perimeter are extracted. The circularity and rectangularity shape factors are used to describe the roundness or near-rectangularity of the workpiece shape. Based on the calculated geometric features, the center of gravity of the workpiece is calculated, and a grasping operation is performed.

[0011] As a specific technical solution, the robot determines whether there is a risk of the grasped workpiece slipping by comparing the difference between the actual value of the grasping force and the theoretical value of the grasping force with a preset threshold, including the following steps: Force sensors are installed on the robot gripper to monitor force feedback information in real time during the grasping process; The theoretical value of the workpiece gripping force is obtained by determining the workpiece's mass, friction coefficient, and gravitational acceleration. The theoretical value of the gripping force is compared with the actual value of the gripping force obtained in real time by the force sensor installed on the robot gripper. If the difference between the two is greater than a preset threshold, the force change is considered abnormal, indicating that the workpiece is at risk of slipping. If the difference between the two is less than or equal to the preset threshold, it is considered normal. Formula for calculating force change: in, For force changes, To capture the actual force value, The coefficient of friction is a constant in this formula. For the quality of the workpiece, This is the acceleration due to gravity.

[0012] As a specific technical solution, the method of determining whether the workpiece being gripped by the robot is deformed by comparing the distance between feature points of the workpiece before and after gripping with a preset threshold includes the following steps: A 3D model of the workpiece is created using 3D modeling software based on the workpiece's design drawings. Before and after the robot grasps the workpiece, images of the workpiece are captured using an industrial camera and preprocessed, including noise reduction, contrast enhancement, and brightness adjustment. Image processing algorithms are used to extract feature points from the captured images and match the feature points with corresponding feature points in the pre-established 3D model. By comparing the positional changes of the workpiece feature points before and after grasping, the displacement of each feature point is calculated using Euclidean distance. The robot extracts the following sets of feature points before and after grasping the workpiece: and For each feature point , find it in The nearest corresponding feature point Calculate the Euclidean distance between two points; Calculation formula: in, For feature points and The distance between them The dimension of the feature points. and Feature points and In the Dimensional coordinates; A preset threshold is set, and the calculated distance is compared with the preset threshold. If the distance value is greater than the preset threshold, the workpiece is considered to have been displaced and deformed, and the robot performs a workpiece removal operation; otherwise, it is determined that no deformation has occurred, and the robot performs a workpiece retention operation.

[0013] The present invention provides a motion control method for a robot used in CNC machine tools, the advantages of which are as follows: This invention extracts the center point coordinates, length and width information, rotation angle, and area features from the smallest bounding rectangle, enabling rapid identification of the size and position of workpieces. This reduces computational complexity and time consumption. By setting different area thresholds, different workpieces of different sizes can be distinguished. Based on the set classification criteria, workpieces are divided into different categories, accurately differentiating workpieces of different sizes and providing a reliable basis for subsequent grasping operations. Based on the obtained area categories, the robot's grasping method can be flexibly adjusted. Through automated classification and grasping control, the robot's utilization efficiency is optimized, reducing energy consumption and equipment wear. This invention uses Newton's second law and the friction formula to calculate the theoretical value of the gripping force. The difference between the actual and theoretical gripping force values ​​is compared with a preset threshold to determine whether there is a risk of the workpiece slipping. It can monitor the stability of the workpiece in real time during the gripping process and calculate the displacement of each feature point using Euclidean distance. The distance between the feature points of the workpiece before and after gripping is compared with a preset threshold to accurately determine whether the workpiece has deformed during the gripping process. Through automated gripping force control and deformation detection, manual intervention is reduced, and production efficiency and work quality are improved. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart illustrating the implementation process of the method of the present invention. Detailed Implementation

[0016] The following is in conjunction with the appendix Figure 1 The specific embodiments of the present invention will be further described below: Please see Figure 1As shown, the present invention is a motion control method for a robot used in CNC machine tools, comprising the following steps: S1: Capture image information of the workpiece using image acquisition equipment, perform preprocessing operations on the image, combine Harris corner detection and Shi-Tomasi corner detection to obtain workpiece feature points, and use the SIFT algorithm to match the same feature points in different images; S2: The initial main axis of the workpiece area is obtained by using the least squares linear fitting method. The initial position and rotation center of the horizontal and vertical main axes are determined by the principle of the center of gravity. The main axis is rotated under the constraint of the rotation termination condition. The minimum bounding rectangle is drawn. Different area thresholds are set to distinguish workpieces of different sizes. The workpiece gripping method of the robot is controlled according to the obtained area category. S3: By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are transformed into points in the base coordinate system. A search tree is constructed to plan the robot's grasping path, and the end effector is used to perform the grasping operation based on the information provided by the vision system. S4: After the gripping operation is completed, the robot judges whether there is a risk of the gripped workpiece slipping by comparing the difference between the actual gripping force and the theoretical gripping force with the preset threshold. The robot judges whether the gripped workpiece is deformed by comparing the distance between the feature points of the workpiece before and after gripping with the preset threshold. After confirming that there is no risk of the workpiece slipping and no deformation has occurred, the robot places the gripped workpiece in the designated position.

[0017] Specifically, image acquisition equipment is used to capture image information of the workpiece. Preprocessing operations are performed on the acquired images, including noise reduction and contrast enhancement. Harris corner detection and Shi-Tomasi corner detection are combined to obtain feature points in the images. The SIFT algorithm is used to match identical feature points in different images to determine the workpiece's posture. Least squares is used to fit straight lines to the feature points of the workpiece region to obtain the initial principal axis of the workpiece region. The initial positions of the horizontal and vertical principal axes and the rotation center are determined using the centroid principle. Based on the optimized principal axis direction and position, the minimum bounding rectangle of the workpiece is drawn. Different area thresholds are set to distinguish different workpiece sizes, and the obtained area categories are analyzed. The robot controls its grasping method. By calculating the rotation matrix and translation variables of the workpiece coordinate system relative to the base coordinate system, points in the workpiece coordinate system are converted into points in the base coordinate system. A search tree is constructed to plan the robot's grasping path. The end effector performs the grasping operation based on the information provided by the vision system. After the grasping operation is completed, the robot compares the difference between the actual and theoretical grasping force values ​​and compares them with a preset threshold to determine whether there is a risk of the workpiece slipping. By calculating the distance changes of feature points before and after grasping and comparing them with a preset threshold, the robot determines whether the workpiece has deformed. After determining that there is no risk of the workpiece slipping and no deformation has occurred, the robot moves the workpiece to the designated position and puts it down.

[0018] In one embodiment of the present invention, step S1 includes the following steps: Image acquisition equipment is used to capture image information of the workpiece. The image is preprocessed, including noise removal and image enhancement. The Canny algorithm is used to extract edge information in the image, and the feature points in the image are enhanced by dilation. Harris corner detection is performed using the `cv2.cornerHarris()` function in OpenCV, and Shi-Tomasi corner detection is performed using the `cv2.goodFeaturesToTrack()` function in OpenCV. The corner coordinates obtained from Shi-Tomasi detection are used as seed points, and the point with the largest Harris corner response value in the neighborhood of the seed point is searched as the final corner coordinate. Non-maximum suppression is then applied to remove duplicate corners. Two 3x3 pixel matrices are convolved with the image to calculate the gradient magnitude of each pixel. The gradient magnitude is compared with a preset threshold; pixels exceeding the threshold are considered edges. Contours in the image are found using the `cv2.findContours()` function in OpenCV. The list of contours is traversed, and the contours are drawn onto the image using the `cv2.drawContours()` function. Finally, the SIFT algorithm is used to match identical feature points in different images.

[0019] Specifically, the `cv2.cornerHarris()` function in OpenCV is used for Harris corner detection, which returns a matrix of the same size as the input image. The `cv2.goodFeaturesToTrack()` function in OpenCV is used for Shi-Tomasi corner detection, which returns a list containing several corner coordinates. Using the corner coordinates obtained from Shi-Tomasi detection as seed points, the point with the largest Harris corner response value in the neighborhood of the seed point is searched as the final corner coordinate. The results are then compared to determine the final corner coordinates. The algorithm calculates the gradient magnitude of each pixel by convolving two 3x3 pixel matrices (one horizontal and one vertical) with the image, retaining the corner points with the largest response values. It then compares these gradient magnitudes with a preset threshold, identifying pixels with values ​​greater than the threshold as edges. Finally, it uses the `cv2.findContours()` function from OpenCV to find contours in the image, which returns a list containing contour information. The algorithm iterates through the list of contours and uses `cv2.drawContours()` to draw them onto the image. Finally, it uses the SIFT algorithm to match identical feature points between different images.

[0020] In one embodiment of the present invention, step S2 includes the following steps: The initial principal axes of the workpiece region are obtained using the least squares linear fitting method. The initial positions and rotation centers of the horizontal and vertical principal axes are determined using the centroid principle. The principal axes are rotated under the constraint of the rotation termination condition. The input image is preprocessed, including grayscale conversion and binarization. The findContours function in OpenCV is used to detect contours in the image. For each contour, the minAreaRect function is used to calculate its minimum bounding rectangle. The boxPoints function is used to convert the rotated rectangle into the coordinates of the four vertices. Then, the polylines function is used to draw the bounding rectangle. The center point coordinates, length and width information, rotation angle and area features are extracted from the minimum bounding rectangle. Different area thresholds are set to distinguish workpieces of different sizes. According to the set classification criteria, the workpieces are divided into different categories, including large-area workpieces, medium-area workpieces and small-area workpieces, and different colors are used to mark and record them on the image. The robot's workpiece gripping method is controlled based on the acquired area category.

[0021] Specifically, the best-fit line is determined by minimizing the sum of squared distances from the point set to the line, thus finding the initial principal axis of the workpiece. The initial bounding rectangle of the target is determined based on the horizontal principal axis. Within the acute-angle region formed by the horizontal and vertical principal axes, the bounding rectangle is rotated to find the bounding rectangle with the smallest area. The principal axis is rotated under the constraint of a rotation termination condition to quickly determine the workpiece deflection angle and its minimum bounding rectangle. The purpose of rotation is to minimize the area of ​​the bounding rectangle, which corresponds to the minimum bounding rectangle. The rotation angle typically ranges from -90 degrees to 0 degrees, returning to -90 degrees when the rectangle is horizontal or vertical. Preprocessing operations are performed on the input image, including grayscale conversion and binarization. The `findContours` function in OpenCV is used to detect contours in the image, and `minAreaR` is used... The `ect` function calculates the minimum bounding rectangle. The `boxPoints` function converts the rotated rectangle into four vertex coordinates. Then, the `polylines` function draws the bounding rectangle. To ensure that integer pixel coordinates are drawn, the vertex coordinates need to be rounded. The center point coordinates, length and width information, rotation angle, and area features are extracted from the minimum bounding rectangle. Different area thresholds are set. Three area thresholds are set: small, medium, and large. Small is defined as less than 50 square centimeters, medium is defined as between 50 and 150 square centimeters, and large is defined as greater than 150 square centimeters. Workpieces of different sizes are distinguished. According to the set classification criteria, the workpieces are divided into different categories and marked with different colors on the image. The robot's workpiece grasping method is controlled according to the obtained area category. For large-area workpieces, choose the multi-point gripping method; for medium-area workpieces, choose the two-point gripping method; for small-area workpieces, choose gripping using environmental constraints.

[0022] In one embodiment of the present invention, the step of converting points in the workpiece coordinate system into points in the base coordinate system by calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system includes the following steps: The base coordinate system is fixed on the robot base, and the origin and the directions of the three orthogonal coordinate axes of the base coordinate system are determined. During the machining process, the center point of the workpiece is selected as the reference point, and the three-dimensional coordinate data of the reference point is obtained using a vision system. Based on the obtained reference point coordinate data, a workpiece coordinate system is established that is fixed to the workpiece. By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are converted into points in the base coordinate system. Conversion calculation formula: in, To convert to the corresponding points in the base coordinate system, Let be a rotation matrix. It is a translation vector. This is a point in the workpiece coordinate system.

[0023] Specifically, the robot manufacturer determines the origin of the base coordinate system and the directions of the three orthogonal coordinate axes according to the system stipulated by international standards. The vision system extracts the feature quantities of the reference points, including area, centroid, length, and position, and calculates their two-dimensional coordinates in the image. Combined with the camera's intrinsic and extrinsic parameter data, these coordinates are converted into three-dimensional coordinates. Based on the obtained reference point coordinate data, a workpiece coordinate system fixed to the workpiece is established. The origin of this coordinate system is set at a certain reference point on the workpiece, and the directions of the coordinate axes are determined according to the shape of the workpiece and the processing requirements. By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are converted into points in the base coordinate system.

[0024] In one embodiment of the present invention, the step of constructing a search tree to plan the robot's grasping path and using an end effector to perform the grasping operation based on information provided by the vision system includes the following steps: In the robot's workspace, the starting position, target position, and obstacles in the workspace are determined. Starting from the starting point, a search tree is constructed through random sampling. Each time, a new configuration point is sampled, and it is checked whether the point collides with a known tree node. If there is no collision, it is added to the tree. A feasible path connecting the starting point and the target point is found in the tree. The path is optimized using the RPT algorithm. Based on the planned path, the end effector performs the grasping operation using information provided by the vision system.

[0025] Specifically, the starting position, target position, and obstacles in the robot's workspace are determined. Starting from the starting point, a point is randomly sampled from the space, and the algorithm calculates the connection between it and the nearest point in the current tree. If the connection is feasible, i.e., it does not collide with obstacles, the new point is added to the tree to build a search tree. Each time a new configuration point is sampled, it is checked whether the point collides with known tree nodes. If there is no collision, it is added to the tree. The algorithm continuously repeats the steps of random sampling and local planning, gradually building a path from the starting point to the ending point. The RPT algorithm is used to reduce the path cost by reselecting parent nodes and rewire the random tree, making the path smoother and closer to the optimal path. Based on the planned path, the end effector performs the grasping operation based on the information provided by the vision system. In this process, obstacles in the workspace are defined by determining the coordinates of the four vertices of a rectangular region. Random points are generated within the rectangular region as obstacle points, and the obstacle points are plotted on a graph using MATLAB's plot function. A function is written to check whether a given point is within the rectangular obstacle.

[0026] In one embodiment of the present invention, the grasping operation using an end effector based on information provided by a vision system includes the following steps: Workpiece images are acquired using a vision system. The Canny operator edge detection algorithm is used to extract the workpiece's edge contour. Harris corner detection and Shi-Tomasi corner detection are combined to identify corners in the image as feature points. The workpiece image is then skeletonized to extract the centerline, edges, and connection points. The cv2.contourArea() and cv2.arcLength() functions in OpenCV are used to calculate the area and perimeter of the workpiece contour, as well as the center distance of the contour. The rotating caliper algorithm is used to calculate the minimum convex polygon enclosing the workpiece, and its area and perimeter are extracted. The circularity and rectangularity shape factors are used to describe the roundness or near-rectangularity of the workpiece shape. Based on the calculated geometric features, the center of gravity of the workpiece is calculated, and a grasping operation is performed.

[0027] Specifically, workpiece images are acquired through a vision system. The Canny operator edge detection algorithm is used to extract the workpiece's edge contour from the image. Harris corner detection and Shi-Tomasi corner detection are used to identify corner points in the workpiece image as feature points. The workpiece image is then skeletonized to extract the main structure of the workpiece, including the center line, edges, and connection points. Based on the extracted contour, the geometric features of the workpiece, including area and perimeter, are calculated using cv.2contourArea and cv2.arcLength in OpenCV. The center distance of the workpiece contour is calculated, and the area and perimeter of the smallest convex polygon enclosing the workpiece are extracted. Circularity and rectangularity shape factors are used to describe the roundness or near-rectangularity of the workpiece shape. Combining the extracted feature points and geometric features, a pose estimation algorithm is used to calculate the camera's pose relative to known 3D points. After calculating all relevant geometric features, the center of gravity of the workpiece is calculated, and it is then grasped.

[0028] In one embodiment of the present invention, the robot determines whether there is a risk of the grasped workpiece slipping by comparing the difference between the actual value of the grasping force and the theoretical value of the grasping force with a preset threshold, including the following steps: Force sensors are installed on the robot gripper to monitor force feedback information in real time during the grasping process; The theoretical value of the workpiece gripping force is obtained by determining the workpiece's mass, friction coefficient, and gravitational acceleration. The theoretical value of the gripping force is compared with the actual value of the gripping force obtained in real time by the force sensor installed on the robot gripper. If the difference between the two is greater than a preset threshold, the force change is considered abnormal, indicating that the workpiece is at risk of slipping. If the difference between the two is less than or equal to the preset threshold, it is considered normal. Formula for calculating force change: in, For force changes, To capture the actual value of the force, The coefficient of friction is a constant in this formula. For the quality of the workpiece, This is the acceleration due to gravity.

[0029] Specifically, the mass of the workpiece is measured using weighing equipment, and the coefficient of friction is obtained by consulting the properties of the relevant materials. Let gravitational acceleration be 9.8 m / s². Based on Newton's second law and the friction formula, the minimum gripping force required to keep the workpiece stationary without external force can be calculated. This force is equal to the product of the workpiece's weight and its coefficient of friction, i.e., _____. Force sensors are installed on the robot gripper to monitor the actual value of the gripping force. The theoretical value of the gripping force is compared with the actual value monitored by the force sensor. If the difference between the two is greater than a preset threshold, the force change is considered abnormal, which may indicate that the workpiece is at risk of slipping. If the difference is less than or equal to the preset threshold, the gripping force is considered normal and the workpiece is stable. Based on the comparison results, the robot adjusts its gripping strategy, such as by increasing the gripping force or changing the gripping method.

[0030] In one embodiment of the present invention, the step of determining whether the workpiece being gripped by the robot is deformed by comparing the distance between feature points of the workpiece before and after gripping with a preset threshold includes the following steps: A 3D model of the workpiece is created using 3D modeling software based on the workpiece's design drawings. Before and after the robot grasps the workpiece, images of the workpiece are captured using an industrial camera and preprocessed, including noise reduction, contrast enhancement, and brightness adjustment. Image processing algorithms are used to extract feature points from the captured images and match the feature points with corresponding feature points in the pre-established 3D model. By comparing the positional changes of the workpiece feature points before and after grasping, the displacement of each feature point is calculated using Euclidean distance. The robot extracts the following sets of feature points before and after grasping the workpiece: and For each feature point , find it in The nearest corresponding feature point Calculate the Euclidean distance between two points; Calculation formula: in, For feature points and The distance between them The dimension of the feature points. and Feature points and In the Dimensional coordinates; A preset threshold is set, and the calculated distance is compared with the preset threshold. If the distance value is greater than the preset threshold, the workpiece is considered to have been displaced and deformed, and the robot performs a workpiece removal operation; otherwise, it is determined that no deformation has occurred, and the robot performs a workpiece retention operation.

[0031] Specifically, 3D modeling software is used to create a 3D model of the workpiece based on its design drawings. Before and after the robot grasps the workpiece, industrial cameras are used to capture images of the workpiece. The captured images undergo preprocessing operations such as noise reduction, contrast enhancement, and brightness adjustment to improve image quality. Feature points are extracted from the preprocessed images by combining Harris corner detection and Shi-Tomasi corner detection. The extracted feature points are matched with corresponding feature points in the pre-established 3D model. By comparing the positional changes of the workpiece feature points before and after grasping, the displacement of each feature point is calculated using Euclidean distance. Based on historical data and experience, a preset threshold is determined. According to the calculated displacement, if the distance value of any feature point is greater than the preset threshold, it is determined that the workpiece has been deformed, and the robot removes the workpiece; otherwise, it is determined that no deformation has occurred, and the robot retains the workpiece.

[0032] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A method for controlling the motion of a robot in a CNC machine tool, characterized in that, Includes the following steps: S1: Capture image information of the workpiece using image acquisition equipment, perform preprocessing operations on the image, combine Harris corner detection and Shi-Tomasi corner detection to obtain workpiece feature points, and use the SIFT algorithm to match the same feature points in different images; S2: The initial main axis of the workpiece area is obtained by using the least squares linear fitting method. The initial position and rotation center of the horizontal and vertical main axes are determined by the principle of the center of gravity. The main axis is rotated under the constraint of the rotation termination condition. The minimum bounding rectangle is drawn. Different area thresholds are set to distinguish workpieces of different sizes. The workpiece gripping method of the robot is controlled according to the obtained area category. S3: By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are transformed into points in the base coordinate system. A search tree is constructed to plan the robot's grasping path, and the end effector is used to perform the grasping operation based on the information provided by the vision system. S4: After the gripping operation is completed, the robot judges whether there is a risk of the gripped workpiece slipping by comparing the difference between the actual gripping force and the theoretical gripping force with the preset threshold. The robot judges whether the gripped workpiece is deformed by comparing the distance between the feature points of the workpiece before and after gripping with the preset threshold. After confirming that there is no risk of the workpiece slipping and no deformation has occurred, the robot places the gripped workpiece in the designated position. The process of constructing a search tree to plan the robot's grasping path and using the end effector to perform the grasping operation based on information provided by the vision system includes the following steps: In the robot's workspace, the starting position, target position, and obstacles in the workspace are determined. Starting from the starting point, a search tree is constructed through random sampling. Each time, a new configuration point is sampled, and it is checked whether the point collides with a known tree node. If there is no collision, it is added to the tree. A feasible path connecting the starting point and the target point is found in the tree. The path is optimized using the RPT algorithm. Based on the planned path, the end effector performs the grasping operation using the information provided by the vision system. The process of using an end effector to perform a grasping operation based on information provided by the vision system includes the following steps: Workpiece images are acquired using a vision system. The Canny operator edge detection algorithm is used to extract the workpiece's edge contour. Harris corner detection and Shi-Tomasi corner detection are combined to identify corners in the image as feature points. The workpiece image is then skeletonized to extract the centerline, edges, and connection points. The cv2.contourArea() and cv2.arcLength() functions in OpenCV are used to calculate the area and perimeter of the workpiece contour, as well as the center distance of the contour. The rotating caliper algorithm is used to calculate the minimum convex polygon enclosing the workpiece, and its area and perimeter are extracted. The circularity and rectangularity shape factors are used to describe the roundness or near-rectangularity of the workpiece shape. Based on the calculated geometric features, the center of gravity of the workpiece is calculated, and a grasping operation is performed.

2. The motion control method for a robot in a CNC machine tool according to claim 1, characterized in that, Step S1 includes the following steps: Image acquisition equipment is used to capture image information of the workpiece. The image is preprocessed, including noise removal and image enhancement. The Canny algorithm is used to extract edge information in the image, and the feature points in the image are enhanced by dilation. Harris corner detection is performed using the `cv2.cornerHarris()` function in OpenCV, and Shi-Tomasi corner detection is performed using the `cv2.goodFeaturesToTrack()` function in OpenCV. The corner coordinates obtained from Shi-Tomasi detection are used as seed points, and the point with the largest Harris corner response value in the neighborhood of the seed point is searched as the final corner coordinate. Non-maximum suppression is then applied to remove duplicate corners. Two 3x3 pixel matrices are convolved with the image to calculate the gradient magnitude of each pixel. The gradient magnitude is compared with a preset threshold; pixels exceeding the threshold are considered edges. Contours in the image are found using the `cv2.findContours()` function in OpenCV. The list of contours is traversed, and the contours are drawn onto the image using the `cv2.drawContours()` function. Finally, the SIFT algorithm is used to match identical feature points in different images.

3. The motion control method for a robot in a CNC machine tool according to claim 1, characterized in that, Step S2 includes the following steps: The initial principal axes of the workpiece region are obtained using the least squares linear fitting method. The initial positions and rotation centers of the horizontal and vertical principal axes are determined using the centroid principle. The principal axes are rotated under the constraint of the rotation termination condition. The input image is preprocessed, including grayscale conversion and binarization. The findContours function in OpenCV is used to detect contours in the image. For each contour, the minAreaRect function is used to calculate its minimum bounding rectangle. The boxPoints function is used to convert the rotated rectangle into the coordinates of the four vertices. Then, the polylines function is used to draw the bounding rectangle. The center point coordinates, length and width information, rotation angle and area features are extracted from the minimum bounding rectangle. Different area thresholds are set to distinguish workpieces of different sizes. According to the set classification criteria, the workpieces are divided into different categories, including large-area workpieces, medium-area workpieces and small-area workpieces, and different colors are used to mark and record them on the image. The robot's workpiece gripping method is controlled based on the acquired area category.

4. The motion control method for a robot in a CNC machine tool according to claim 1, characterized in that, The process of converting points in the workpiece coordinate system into points in the base coordinate system by calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system includes the following steps: The base coordinate system is fixed on the robot base, and the origin and the directions of the three orthogonal coordinate axes of the base coordinate system are determined. During the machining process, the center point of the workpiece is selected as the reference point, and the three-dimensional coordinate data of the reference point is obtained using a vision system. Based on the obtained reference point coordinate data, a workpiece coordinate system is established that is fixed to the workpiece. By calculating the rotation matrix and translation vector of the workpiece coordinate system relative to the base coordinate system, the points in the workpiece coordinate system are converted into points in the base coordinate system. Conversion calculation formula: in, To convert to the corresponding points in the base coordinate system, Let be a rotation matrix. It is a translation vector. This is a point in the workpiece coordinate system.

5. The motion control method for a robot in a CNC machine tool according to claim 1, characterized in that, The robot determines whether there is a risk of the gripped workpiece slipping by comparing the difference between the actual gripping force and the theoretical gripping force with a preset threshold, including the following steps: Force sensors are installed on the robot gripper to monitor force feedback information in real time during the grasping process; The theoretical value of the workpiece gripping force is obtained by determining the workpiece's mass, friction coefficient, and gravitational acceleration. The theoretical value of the gripping force is compared with the actual value of the gripping force obtained in real time by the force sensor installed on the robot gripper. If the difference between the two is greater than a preset threshold, the force change is considered abnormal, indicating that the workpiece is at risk of slipping. If the difference between the two is less than or equal to the preset threshold, it is considered normal. Formula for calculating force change: in, For force changes, To capture the actual value of the force, The coefficient of friction is a constant in this formula. For the quality of the workpiece, This is the acceleration due to gravity.

6. The motion control method for a robot in a CNC machine tool according to claim 1, characterized in that, The process of determining whether the workpiece being gripped by the robot is deformed by comparing the distance between feature points of the workpiece before and after gripping with a preset threshold includes the following steps: A 3D model of the workpiece is created using 3D modeling software based on the workpiece's design drawings. Before and after the robot grasps the workpiece, images of the workpiece are captured using an industrial camera and preprocessed, including noise reduction, contrast enhancement, and brightness adjustment. Image processing algorithms are used to extract feature points from the captured images and match the feature points with corresponding feature points in the pre-established 3D model. By comparing the positional changes of the workpiece feature points before and after grasping, the displacement of each feature point is calculated using Euclidean distance. The robot extracts the following sets of feature points before and after grasping the workpiece: and For each feature point , find it in The nearest corresponding feature point Calculate the Euclidean distance between two points; Calculation formula: in, For feature points and The distance between them The dimension of the feature points. and Feature points and In the Dimensional coordinates; A preset threshold is set, and the calculated distance is compared with the preset threshold. If the distance value is greater than the preset threshold, the workpiece is considered to have been displaced and deformed, and the robot performs a workpiece removal operation; otherwise, it is determined that no deformation has occurred, and the robot performs a workpiece retention operation.

Citation Information

Patent Citations

  • Mechanical arm visual servo target recognition method based on local contour

    CN110766750A

  • Image alignment method and apparatus, and computer device and storage medium

    WO2023098045A1