Method and device for polishing a casting, electronic device and storage medium
By using 3D line scanning camera scanning and RT matrix correction, the grinding path of the casting and the posture of the robotic arm are automatically calculated, which solves the high cost and safety hazards caused by manual operation and realizes efficient and safe casting grinding.
Patent Information
- Application Number
- CN202310391298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-04-12
AI Technical Summary
The current casting grinding process requires manual operation of robotic arms, resulting in high labor costs, training costs, unstable production efficiency and safety hazards, and the grinding accuracy is difficult to guarantee.
By scanning the point cloud image of the casting with a 3D line scan camera, correcting the distortion with an RT matrix, selecting the area to be polished and fitting a reference surface, calculating the polishing path and the posture of the robotic arm, automated polishing is achieved.
The process of grinding castings has been automated, improving production efficiency and safety, and ensuring a smooth transition between the grinding area and the base surface area.
Smart Images

Figure CN116652698B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of casting processing, and more specifically, to a casting grinding method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, during the processing of castings, it is necessary to cut and grind the castings according to the process requirements. In the grinding process, the existing solution is basically to load the cut castings onto a grinding machine, and then manually operate the grinding wheel to use different grinding wheels for different areas (areas to be ground) for grinding.
[0003] It is evident that current casting grinding requires manual operation, i.e., a person operates a robotic arm to control the grinding wheel to grind the casting. However, due to the complexity of robotic arm operation and the requirements for grinding precision of different castings, the labor cost and training cost will be very high. In addition, human labor is subject to problems such as individual condition, differences in production process stability, unstable production efficiency, and safety hazards. Summary of the Invention
[0004] The purpose of this application is to provide a casting grinding method, apparatus, electronic device, and storage medium to achieve automated grinding of castings and improve grinding effect.
[0005] In a first aspect, the present invention provides a method for grinding castings, the method comprising:
[0006] The process parameters, feed rate, and point cloud images of the casting to be ground are acquired, wherein the point cloud images of the casting to be ground are obtained by scanning with a 3D line scan camera.
[0007] The distortion correction processing of the point cloud image of the casting to be ground is performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method;
[0008] Select the area to be polished in the casting to be polished, and select the area around the area to be polished as the reference surface area for surface fitting.
[0009] The fitting plane is determined based on the reference surface region, and the surface vector is obtained;
[0010] Calculate the distance from all points in the area to be polished to the fitted plane, and obtain a distance list;
[0011] Determine whether the maximum distance in the distance list reaches the preset process accuracy;
[0012] When the maximum distance in the distance list reaches the preset process accuracy, the number of grinding operations is calculated based on the maximum distance in the distance list and the process parameter feed rate.
[0013] Based on the number of grinding passes and the feed rate of the process parameters, the coordinates of the path points in the grinding path are calculated;
[0014] The corrected robotic arm posture is calculated based on the surface vectors.
[0015] Based on the corrected robotic arm posture and the coordinates of the path points in the grinding path, the casting to be ground is ground.
[0016] In the first aspect of the application, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, and the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0017] Compared with existing technologies, this application has achieved the complete automation of the entire process from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0018] In an optional implementation, determining the fitting plane based on the reference surface region and obtaining the surface vector includes:
[0019] Repeat the first preset step 20 times to obtain a first vector set, wherein the first preset step includes: randomly downsampling the reference plane region to obtain downsampled points, fitting the downsampled points based on the least squares method to obtain the feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set;
[0020] Repeat the second preset step 10 times to obtain a second vector set. The second preset step includes: calculating the vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element in the first vector set that has the greatest Euclidean distance.
[0021] Calculate the mean of the second vector set, and use the mean of the second vector set as the surface vector.
[0022] In an optional implementation, calculating the distance from all points in the area to be polished to the fitted plane includes:
[0023] The distance from all points in the area to be polished to the fitted plane is calculated based on the Lagrange multiplier method.
[0024] In an optional implementation, calculating the corrected robotic arm posture based on the surface vector includes:
[0025] The highest point plane is determined based on the maximum distance in the distance list and the fitted plane;
[0026] The first reference point is determined based on the original position of the center point of the grinding wheel and the plane of its highest point.
[0027] Based on the included angle of the fitted plane and the radius of the grinding wheel, calculate the distance between the current position of the center point of the grinding wheel and the first reference point;
[0028] Based on the included angle of the fitted plane and the maximum distance in the distance list, calculate the distance between the original position of the first reference point and the center point of the grinding wheel;
[0029] Based on the distance between the first reference point and the original position of the center point of the grinding wheel, and the distance between the current position of the center point of the grinding wheel and the first reference point, the coordinates of the current position of the center point of the grinding wheel are calculated.
[0030] The corrected robotic arm posture is calculated based on the coordinates of the current position of the center point of the grinding wheel and the surface vector.
[0031] In an optional implementation, calculating the corrected robotic arm posture based on the coordinates of the current position of the center point of the grinding wheel and the surface vector includes:
[0032] Based on the coordinates of the current position of the center point of the grinding wheel and the surface vector, calculate the normal vector from the current position of the center point of the grinding wheel to the fitting plane, and use the normal vector as the z-axis after the robot arm posture correction;
[0033] The y-axis of the robotic arm after posture correction is determined based on the motion direction of the grinding path.
[0034] Based on the y-axis and z-axis of the robotic arm after posture correction, the x-axis of the robotic arm after posture correction is calculated.
[0035] Based on the y-axis, z-axis, and x-axis of the robotic arm after posture correction, determine the y-axis unit vector, z-axis unit vector, and x-axis unit vector, and calculate the quaternion of the robotic arm posture based on the y-axis unit vector, z-axis unit vector, and x-axis unit vector.
[0036] In a second aspect, the present invention provides a casting grinding apparatus, the apparatus comprising:
[0037] The acquisition module is used to acquire process parameters, feed rate, and point cloud images of the casting to be ground, wherein the point cloud images of the casting to be ground are obtained by scanning with a 3D line scan camera.
[0038] The correction processing module is used to perform distortion correction processing on the point cloud image of the casting to be polished based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method;
[0039] The selection module is used to select the area to be polished in the casting to be polished, and to select the surrounding area of the area to be polished as the reference surface area for surface fitting.
[0040] The fitting module is used to determine the fitting plane based on the reference surface region and obtain the surface vector;
[0041] The first calculation module is used to calculate the distance from all points in the area to be polished to the fitting plane, and obtain a distance list;
[0042] The judgment module is used to determine whether the maximum distance in the distance list reaches the preset process accuracy;
[0043] The second calculation module is used to calculate the number of grinding operations based on the maximum distance in the distance list and the feed rate of the process parameter when the maximum distance in the distance list reaches the preset process accuracy.
[0044] The third calculation module is used to calculate the coordinates of the path points in the grinding path based on the number of grinding cycles and the feed rate of the process parameters.
[0045] The fourth calculation module is used to calculate the corrected robotic arm posture based on the surface vector;
[0046] The grinding control module is used to grind the casting to be ground based on the corrected posture of the robotic arm and the coordinates of the path points in the grinding path.
[0047] In the first aspect of the application, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, and the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0048] Compared with existing technologies, this application has achieved the complete automation of the entire process from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0049] In an optional implementation, the fitting module includes:
[0050] The first calculation submodule is used to repeatedly execute the first preset step 20 times to obtain a first vector set. The first preset step includes: randomly downsampling the reference plane region to obtain downsampled points, fitting the downsampled points based on the least squares method to obtain the feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set.
[0051] The second calculation submodule is used to repeatedly execute the second preset step 10 times to obtain the second vector set. The second preset step includes: calculating the vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element in the first vector set that has the farthest Euclidean distance.
[0052] Calculate the mean of the second vector set, and use the mean of the second vector set as the surface vector.
[0053] In an optional implementation, the first computing module includes:
[0054] The third calculation submodule is used to calculate the distance from all points in the area to be polished to the fitted plane based on the Lagrange multiplier method.
[0055] Thirdly, the present invention provides an electronic device, comprising:
[0056] Processor; and
[0057] The memory is configured to store machine-readable instructions that, when executed by the processor, perform the casting grinding method as described in any of the foregoing embodiments.
[0058] In the first aspect of the application, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, and the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0059] Compared with existing technologies, this application has achieved the complete automation of the entire process from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0060] Fourthly, the present invention provides a storage medium storing a computer program, the computer program being executed by a processor as described in any of the foregoing embodiments of the casting grinding method.
[0061] In the first aspect of the application, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, and the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0062] Compared with existing technologies, this application has achieved the complete automation of the entire process from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect. Attached Figure Description
[0063] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0064] Figure 1 This is a schematic flowchart of a casting grinding method disclosed in an embodiment of this application;
[0065] Figure 2 This is a schematic diagram of the equation of a downsampling fitting plane provided in an embodiment of this application;
[0066] Figure 3 This is a schematic diagram of another downsampling fitting plane equation provided in an embodiment of this application;
[0067] Figure 4 This is a schematic diagram of coordinate compensation in the z-direction of a robotic arm provided in an embodiment of this application;
[0068] Figure 5 This is a schematic diagram of the structure of a casting grinding device disclosed in an embodiment of this application;
[0069] Figure 6 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0070] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0071] Example 1
[0072] Please see Figure 1 , Figure 1 This is a schematic flowchart of a casting grinding method disclosed in an embodiment of this application, as shown below. Figure 1 As shown, the method in this application embodiment includes the following steps:
[0073] 101. Obtain the process parameters, feed rate, and point cloud image of the casting to be ground. The point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera.
[0074] 102. Distortion correction processing of point cloud images of castings to be ground based on RT matrix, wherein the RT matrix is calibrated by spherical calibration method;
[0075] 103. Select the area to be ground in the casting to be ground, and select the area around the area to be ground as the reference surface area for surface fitting.
[0076] 104. Determine the fitting plane based on the reference plane region and obtain the surface vector;
[0077] 105. Calculate the distance from all points in the area to be polished to the fitted plane, and obtain a list of distances;
[0078] 106. Determine whether the maximum distance in the distance list meets the preset process accuracy;
[0079] 107. When the maximum distance in the distance list reaches the preset process accuracy, calculate the number of grinding operations based on the maximum distance in the distance list and the process parameter feed rate;
[0080] 108. Calculate the coordinates of the path points in the grinding path based on the number of grinding passes and the feed rate of the process parameters;
[0081] 109. Calculate the corrected robot arm posture based on the surface vectors;
[0082] 110. Grind the casting to be ground based on the corrected posture of the robotic arm and the coordinates of the path points in the grinding path.
[0083] In this embodiment, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, so that the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0084] Compared with the prior art, the embodiments of this application realize the complete automation from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0085] In this embodiment of the application, for step 101, the process parameter feed amount refers to the displacement of the grinding wheel relative to the casting in the feed motion direction. For example, assuming that the casting needs to be ground by 10mm, the process parameter feed amount can be 10mm.
[0086] In this embodiment of the application, for step 101, the 3D line scan camera can emit a laser to scan the casting to be polished, thereby generating a point cloud image. For details on point cloud images, please refer to the prior art; this embodiment of the application will not elaborate on them.
[0087] In this embodiment of the application, regarding step 102, for the RT matrix and spherical calibration method, please refer to the prior art; this embodiment of the application does not limit this.
[0088] In this embodiment of the application, as an example, the feed rate j is configured in the process parameters, and a point cloud image, denoted as pcloud.pcd, is obtained from a 3D line scan camera. Then, the distortion correction processing of pcloud.pcd is performed using the spherical calibration method [the RT matrix obtained from the calibration]. Then, the area to be polished, B, is selected, and the area A surrounding area B is selected as the reference surface area for surface fitting. Then, based on the reference surface area A, the equation of the fitting plane can be determined as f = ax² + by² + cz² + dxy + eyz + fzx + gx + hy + jz + k, and the surface vector is calculated, where the surface vector is [a, b, c, d, e, f, g, h, j, k]. Then, by calculating all points poin in the area to be polished, the process is completed. The distance from ts to the surface equation f is calculated, and d_list is obtained. Then, it is determined whether the maximum distance d_list_maxh in the distance list d_list meets the process accuracy requirements. Then, the maximum distance d_list_maxh in step 6 and the required process parameter feed amount j are used to calculate the number of polishing steps n_polish. Then, based on the number of polishing steps n_polish and the feed amount j, the coordinates (x, y, z) of a point on the polishing path are calculated. Then, based on the surface vector [a, b, c, d, e, f, g, h, j, k], the corrected robot arm posture [q1, q2, 3, q4] is calculated. Then, the calculated result is route[[x, y, z, q1, q2, q3, q4]…[x n y n , z n ,q1n,q2 n ,q3 n ,q4 n The message is passed to the robot.
[0089] In this embodiment of the application, as an optional implementation, step 104: determining the fitting plane based on the reference plane region to obtain the surface vector includes the following sub-steps:
[0090] Repeat the first preset step 20 times to obtain a first vector set. The first preset step includes: randomly downsampling the reference plane region to obtain downsampled points, fitting the downsampled points based on the least squares method to obtain the feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set.
[0091] Repeat the second preset step 10 times to obtain a second vector set. The second preset step includes: calculating the vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element in the first vector set that has the greatest Euclidean distance.
[0092] Calculate the mean of the second vector set and use the mean of the second vector set as the surface vector.
[0093] In this optional implementation, a second vector set can be calculated from the first vector set, and the mean of the second vector set can be used as a surface vector.
[0094] In this optional implementation, for example, please refer to Figure 2 , Figure 2 This is a schematic diagram of a downsampling fitting plane provided in an embodiment of this application. For example... Figure 2 As shown, assuming the surface equation is: ax² + by² + cz² + dxy + eyz + fzx + gx + hy + jz + k, then during the first execution of the first preset step, if... Figure 3 As shown, the downsampled points obtained from sampling 1 are fitted to surface equation 1 to obtain feature vector 1, which is V1 = [a1, b1, c1, d1, e1, f1, g1, h1, k1]. For another example, please refer to 3. Figure 3 , Figure 3 This is a schematic diagram of another downsampling fitting plane equation provided in an embodiment of this application. For example... Figure 3 As shown, when the first preset step is executed for the second time, the downsampled points obtained from sampling 20 are fitted with the surface equation 20 to obtain the feature vector 20, which is V. 20 =[a 20 b 20 c 20 d 20 e 20 f 20 g 20 h 20 k 20 In this way, after repeating the first preset step 20 times, 20 feature vectors can be obtained, which constitute the first vector set.
[0095] In this embodiment of the application, as an optional implementation, step 105: calculating the distance from all points in the area to be polished to the fitted plane includes the following sub-steps:
[0096] The distance from all points in the area to be polished to the fitted plane is calculated using the Lagrange multiplier method.
[0097] In this optional implementation, the distance from all points in the area to be polished to the fitting plane can be calculated using the Lagrange multiplier method.
[0098] In this optional implementation, please refer to the prior art for information on the Lagrange multiplier method; this application will not elaborate on this aspect in the embodiments.
[0099] In this embodiment of the application, as an optional implementation, step 109: calculating the corrected robotic arm posture based on the surface vector includes:
[0100] The highest point plane is determined based on the maximum distance in the distance list and the fitted plane;
[0101] The first reference point is determined based on the original position of the center point of the grinding wheel and the plane of its highest point.
[0102] Based on the angle between the fitted plane and the radius of the grinding wheel, calculate the distance between the current position of the center point of the grinding wheel and the first reference point;
[0103] Based on the angle between the fitted planes and the maximum distance in the distance list, calculate the distance between the original position of the first reference point and the center point of the grinding wheel;
[0104] Based on the distance between the original position of the first reference point and the center point of the grinding wheel, and the distance between the current position of the center point of the grinding wheel and the first reference point, the coordinates of the current position of the center point of the grinding wheel are calculated.
[0105] The corrected robotic arm posture is calculated based on the coordinates of the current position of the center point of the grinding wheel and the surface vector.
[0106] In this optional implementation, more specifically, a particular method for calculating the corrected robotic arm posture based on the coordinates of the current position of the grinding wheel's center point and the surface vector is as follows:
[0107] Based on the coordinates of the current position of the center point of the grinding wheel and the surface vector, calculate the normal vector from the current position of the center point of the grinding wheel to the fitting plane, and use the normal vector as the z-axis after the robot arm's posture is corrected;
[0108] The y-axis of the robotic arm after posture correction is determined based on the motion direction of the grinding path.
[0109] Based on the y-axis and z-axis of the robotic arm after posture correction, the x-axis of the robotic arm after posture correction is calculated.
[0110] Based on the corrected y-axis, z-axis, and x-axis of the robotic arm posture, determine the unit vectors of the y-axis, z-axis, and x-axis, and calculate the quaternion of the robotic arm posture based on the unit vectors of the y-axis, z-axis, and x-axis.
[0111] In the above optional embodiments, the grinding wheel typically begins grinding along the bottom of the casting to be ground, and then proceeds from bottom to top according to a preset grinding path, for example, as... Figure 4As shown, the grinding wheel uses the fitted plane f as the grinding path, grinding the casting from bottom to top. During this process, if the grinding wheel needs to be ground at the next moment, the height of the grinding wheel needs to be increased so that the bottom of the grinding wheel is aligned with the highest point of the casting to be ground. Therefore, it is necessary to calculate the coordinates of the grinding wheel after it is raised. The coordinates of the grinding wheel after it is raised refer to the coordinates of the center point of the grinding wheel. Specifically, as shown... Figure 4 As shown, assuming the center point of the grinding wheel is point A, the coordinates of point A can be calculated using the following steps:
[0112] First, assume that at the current moment, the center point of the grinding wheel is at... Figure 4 Since the center point of the grinding wheel changes from point C to point A, only the z-coordinate changes, while the x and y coordinates remain the same. Therefore, the x and y coordinates of point C can be used as the x and y coordinates of point A. Finally, to calculate the complete coordinates of point A, only the z-coordinate of point A needs to be calculated.
[0113] Secondly, the z-coordinate of point A can be calculated using the straight-line distance between point A and point C and the z-coordinate of point C. Furthermore, based on the fitted plane f and d_list_maxh( Figure 4 The plane of the highest point can be calculated using maxh. The line AC intersects the plane of the highest point at point B. The x and y coordinates of point B are the same as those of point C. Thus, the line AC = AB + BC.
[0114] Furthermore, such as Figure 4 As shown, the angle between the fitting plane f and the horizontal line z = 0 of the Base coordinate system is a. Since the highest point plane is parallel to the fitting plane f, we know that BC = d_list_maxh / cosa. Similarly, AB = R / cosa. Therefore, we have AC = AB + BC = R / cosa + d_list_maxh / cosa. Thus, we can calculate the z coordinate of point A. Finally, the complete coordinates of point A can be expressed as f(x, y) + d_list_maxh / cosa + R / cosa.
[0115] Accordingly, after calculating the complete coordinates of the grinding wheel center point at point A, the normal vector from point A to the fitting plane f can be calculated based on the complete coordinates of point A, and this normal vector is used as the z-axis after the robot arm is calibrated. Simultaneously, the motion direction of the preset grinding path is used as the y-axis after the robot arm's posture is calibrated; for example, the y-axis of point A can be used as the y-axis after the robot arm's posture is calibrated. Then, based on the y-axis and z-axis after the robot arm's posture is calibrated, the x-axis is calculated. Thus, based on the y-axis, the unit vectors on the x-axis, y-axis, and z-axis, the robot arm's posture quaternion can be obtained. Finally, the robot arm's posture quaternion can be obtained based on the unit vectors on the x-axis, y-axis, and z-axis. It should be noted that for information on quaternions and how to obtain the robot arm's posture quaternion based on the unit vectors on the x-axis, y-axis, and z-axis, please refer to the prior art; this application's embodiments will not elaborate on this.
[0116] Example 2
[0117] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a casting grinding device disclosed in an embodiment of this application, as shown below. Figure 5 As shown, the apparatus in this embodiment includes the following functional modules:
[0118] The acquisition module 201 is used to acquire the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera.
[0119] The correction processing module 202 is used for distortion correction processing of the point cloud image of the casting to be polished based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method;
[0120] Select module 203 to select the area to be ground in the casting to be ground, and select the surrounding area of the area to be ground as the reference surface area for surface fitting.
[0121] The fitting module 204 is used to determine the fitting plane based on the reference plane region to obtain the surface vector;
[0122] The first calculation module 205 is used to calculate the distance from all points in the area to be polished to the fitting plane and obtain a distance list;
[0123] The judgment module 206 is used to determine whether the maximum distance in the distance list reaches the preset process accuracy;
[0124] The second calculation module 207 is used to calculate the number of grinding operations based on the maximum distance in the distance list and the feed rate of the process parameters when the maximum distance in the distance list reaches the preset process accuracy.
[0125] The third calculation module 208 is used to calculate the coordinates of the path points in the grinding path based on the number of grinding cycles and the feed rate of the process parameters.
[0126] The fourth calculation module 209 is used to calculate the corrected posture of the robotic arm based on the surface vector;
[0127] The grinding control module 210 is used to grind the casting to be ground based on the corrected posture of the robotic arm and the coordinates of the path points in the grinding path.
[0128] In this embodiment, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, so that the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0129] Compared with the prior art, the embodiments of this application realize the complete automation from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0130] In this application embodiment, as an optional implementation, the fitting module includes:
[0131] The first calculation submodule is used to repeatedly execute the first preset step 20 times to obtain the first vector set. The first preset step includes: randomly downsampling the reference plane region to obtain downsampled points, fitting the downsampled points based on the least squares method to obtain the feature vector of the fitting plane, and the feature vector of the fitting plane is the element in the first vector set.
[0132] The second calculation submodule is used to repeatedly execute the second preset step 10 times to obtain the second vector set. The second preset step includes: calculating the vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element in the first vector set that has the farthest Euclidean distance.
[0133] Calculate the mean of the second vector set and use the mean of the second vector set as the surface vector.
[0134] In this embodiment of the application, as an optional implementation, the first computing module includes:
[0135] The third calculation submodule is used to calculate the distance from all points in the area to be polished to the fitted plane based on the Lagrange multiplier method.
[0136] It should be noted that for other detailed descriptions of the apparatus in the embodiments of this application, please refer to the relevant description in Embodiment 1 of this application, which will not be repeated in the embodiments of this application.
[0137] Example 3
[0138] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application, such as... Figure 6 As shown, the electronic device in this application embodiment includes:
[0139] Processor 301; and
[0140] The memory 302 is configured to store machine-readable instructions that, when executed by the processor 301, perform the casting grinding method provided in Embodiment 1 of this application.
[0141] In this embodiment, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, so that the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0142] Compared with the prior art, the embodiments of this application realize the complete automation from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0143] Example 4
[0144] This application provides a storage medium storing a computer program, which is executed by a processor as the casting grinding method provided in the first embodiment of this application.
[0145] In this embodiment, by acquiring the process parameter feed rate and the point cloud image of the casting to be ground, wherein the point cloud image of the casting to be ground is obtained by scanning with a 3D line scan camera, distortion correction processing of the point cloud image of the casting to be ground can be performed based on the RT matrix, wherein the RT matrix is calibrated by the spherical calibration method. Then, by selecting the area to be ground in the casting and selecting the surrounding area of the area to be ground as the reference surface area, the fitting plane can be determined based on the reference surface area, and the surface vector can be obtained. Then, the distance from all points in the area to be ground to the fitting plane can be calculated, and a distance list can be obtained. Then, by determining whether the maximum distance in the distance list reaches the preset process accuracy, the number of grinding times can be calculated based on the maximum distance in the distance list and the process parameter feed rate. Then, the coordinates of the path points in the grinding path can be calculated based on the number of grinding times and the process parameter feed rate. Then, the posture of the corrected robotic arm can be calculated based on the surface vector, so that the casting to be ground can be ground based on the posture of the corrected robotic arm and the coordinates of the path points in the grinding path.
[0146] Compared with the prior art, the embodiments of this application realize the complete automation from 3D camera scanning to calculating the grinding path of the grinding wheel. In this process, no human intervention or operation is required, which greatly improves the efficiency and safety of grinding castings. In addition, according to the coordinates of the path points in the calculated grinding path, grinding can be carried out according to the curvature of the workpiece surface (base surface), so that the grinding area and the base surface area have a better transition and a better grinding effect.
[0147] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0148] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0150] It should be noted that if a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0151] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0152] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method of casting finish, characterized by, The method comprises: acquiring a process parameter feed amount and a point cloud image of a casting to be polished, wherein the point cloud image of the casting to be polished is obtained by scanning with a 3D line scanning camera; based on an RT matrix, performing distortion correction processing on the point cloud image of the casting to be polished, wherein the RT matrix is calibrated by a spherical calibration method; selecting a polishing area in the casting to be polished, and selecting a surrounding area of the polishing area as a reference surface area for surface fitting; determining a fitting plane according to the reference surface area, and obtaining a surface vector; calculating distances from all points in the polishing area to the fitting plane to obtain a distance list; determining whether the maximum distance in the distance list reaches a preset process accuracy; when the maximum distance in the distance list reaches the preset process accuracy, calculating a polishing frequency based on the maximum distance in the distance list and the process parameter feed amount; calculating path point coordinates in a polishing path according to the polishing frequency and the process parameter feed amount; calculating a corrected mechanical arm posture according to the surface vector; polishing the casting to be polished based on the corrected mechanical arm posture and the path point coordinates in the polishing path; and the method of determining a fitting plane according to the reference surface area and obtaining a surface vector comprises: repeating a first preset step 20 times to obtain a first vector set, wherein the first preset step comprises: randomly down-sampling the reference surface area to obtain down-sampled points, fitting the down-sampled points based on a least squares method to obtain a feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set; repeating a second preset step 10 times to obtain a second vector set, wherein the second preset step comprises: calculating a vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element with the farthest Euclidean distance in the first vector set; calculating a vector mean of the second vector set, and taking the vector mean of the second vector set as the surface vector; and the method of calculating a corrected mechanical arm posture according to the surface vector comprises: determining a highest point plane based on the maximum distance in the distance list and the fitting plane; determining a first reference point based on the original position of the center point of the grinding wheel and the highest point plane; calculating the distance between the current position of the center point of the grinding wheel and the first reference point based on the included angle of the fitting plane and the radius of the grinding wheel; calculating the distance between the first reference point and the original position of the center point of the grinding wheel based on the included angle of the fitting plane and the maximum distance in the distance list; calculating the coordinates of the current position of the center point of the grinding wheel based on the distance between the first reference point and the original position of the center point of the grinding wheel, and the distance between the current position of the center point of the grinding wheel and the first reference point; calculating the corrected mechanical arm posture based on the coordinates of the current position of the center point of the grinding wheel and the surface vector; And, the correcting the mechanical arm pose based on the coordinates and the surface vector of the current position of the center point of the grinding wheel comprises: calculating a normal vector of the current position of the center point of the grinding wheel to the fitting plane based on the coordinates and the surface vector of the current position of the center point of the grinding wheel, and taking the normal vector as a z-axis of the corrected mechanical arm pose; determining a y-axis of the corrected mechanical arm pose based on the motion direction of the grinding path; calculating an x-axis of the corrected mechanical arm pose based on the y-axis of the corrected mechanical arm pose and the z-axis of the corrected mechanical arm pose; determining a y-axis unit vector, a z-axis unit vector and an x-axis unit vector based on the y-axis of the corrected mechanical arm pose, the z-axis of the corrected mechanical arm pose and the x-axis of the corrected mechanical arm pose, and calculating a quaternion of the mechanical arm pose based on the y-axis unit vector, the z-axis unit vector and the x-axis unit vector.
2. The method of claim 1, wherein, The calculating the distances of all points in the area to be polished to the fitting plane comprises: calculating the distances of all points in the area to be polished to the fitting plane based on a Lagrange multiplier method.
3. A cast finishing apparatus characterized by, The device comprises: an acquisition module configured to acquire a process parameter feed amount and a point cloud image of a casting to be polished, wherein the point cloud image of the casting to be polished is scanned by a 3D line scanning camera; a correction processing module configured to perform distortion correction processing on the point cloud image of the casting to be polished based on an RT matrix, wherein the RT matrix is calibrated by a spherical calibration method; a selection module configured to select an area to be polished in the casting to be polished, and select a surrounding area of the area to be polished as a reference surface area for surface fitting; a fitting module configured to determine a fitting plane according to the reference surface area, and obtain a surface vector; a first calculation module configured to calculate distances of all points in the area to be polished to the fitting plane, and obtain a distance list; a judgment module configured to determine whether a maximum distance in the distance list reaches a preset process precision; a second calculation module configured to, when the maximum distance in the distance list reaches the preset process precision, calculate a polishing frequency based on the maximum distance in the distance list and the process parameter feed amount; a third calculation module configured to calculate path point coordinates in a polishing path according to the polishing frequency and the process parameter feed amount; a fourth calculation module configured to calculate a corrected mechanical arm pose according to the surface vector; a polishing control module configured to polish the casting to be polished based on the corrected mechanical arm pose and the path point coordinates in the polishing path. And, the determining the fitting plane according to the reference surface area, and obtaining the surface vector, comprises: repeating a first preset step 20 times to obtain a first vector set, wherein the first preset step comprises: randomly down-sampling the reference surface area to obtain down-sampled points, fitting the down-sampled points based on a least square method to obtain a feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set. The second preset step is repeatedly performed 10 times to obtain a second vector set, wherein the second preset step comprises: calculating a vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element with the farthest Euclidean distance in the first vector set; The vector mean of the second vector set is calculated, and the vector mean of the second vector set is taken as the curved surface vector; And the corrected mechanical arm posture is calculated according to the curved surface vector, comprising: Determine the highest point plane based on the maximum distance in the distance list and the fitting plane; Determine the first reference point based on the original position of the center point of the grinding wheel and the highest point plane; Based on the angle of the fitting plane and the radius of the grinding wheel, the distance between the current position of the center point of the grinding wheel and the first reference point is calculated; Based on the angle of the fitting plane and the maximum distance in the distance list, the distance between the first reference point and the original position of the center point of the grinding wheel is calculated; Based on the distance between the first reference point and the original position of the center point of the grinding wheel, the distance between the current position of the center point of the grinding wheel and the first reference point, the coordinates of the current position of the center point of the grinding wheel are calculated; Based on the coordinates of the current position of the center point of the grinding wheel and the curved surface vector, the corrected mechanical arm posture is calculated; And the corrected mechanical arm posture is calculated based on the coordinates of the current position of the center point of the grinding wheel and the curved surface vector, comprising: The normal vector of the current position of the center point of the grinding wheel to the fitting plane is calculated based on the coordinates of the current position of the center point of the grinding wheel and the curved surface vector, and the normal vector is taken as the z-axis of the corrected mechanical arm posture; Determine the y-axis of the corrected mechanical arm posture based on the motion direction of the polishing path; The x-axis of the corrected mechanical arm posture is calculated based on the y-axis of the corrected mechanical arm posture, the z-axis of the corrected mechanical arm posture; Determine the y-axis unit vector, the z-axis unit vector and the x-axis unit vector based on the y-axis of the corrected mechanical arm posture, the z-axis of the corrected mechanical arm posture and the x-axis of the corrected mechanical arm posture, and calculate the quaternion of the mechanical arm posture based on the y-axis unit vector, the z-axis unit vector and the x-axis unit vector.
4. The apparatus of claim 3, wherein, The fitting module comprises: The first calculation submodule is used for repeatedly performing the first preset step 20 times to obtain a first vector set, wherein the first preset step comprises: randomly down-sampling the reference surface area to obtain down-sampled points, fitting the down-sampled points based on the least square method to obtain the feature vector of the fitting plane, and the feature vector of the fitting plane is an element in the first vector set; A second calculating submodule is configured to repeatedly perform a second preset step for 10 times to obtain a second vector set, wherein the second preset step comprises: calculating a vector mean of the first vector set, calculating the Euclidean distance between each element in the first vector set and the vector mean of the first vector set, and deleting the element with the farthest Euclidean distance in the first vector set; calculating a vector mean of the second vector set, and taking the vector mean of the second vector set as the surface vector.
5. The apparatus of claim 3, wherein, The first calculating module comprises: A third calculating submodule is configured to calculate the distance from all points in the area to be polished to the fitting plane based on the Lagrange multiplier method.
6. An electronic device, comprising: It comprises: a processor; and a memory configured to store machine-readable instructions, which, when executed by the processor, perform the casting polishing method according to any one of claims 1-2.
7. A storage medium, characterized by The storage medium stores a computer program, and the computer program is executed by the processor to perform the casting polishing method according to any one of claims 1-2.
Citation Information
Patent Citations
Point cloud splicing method and system of 3D line scanning camera and readable storage medium
CN114820307A
Visual positioning method and system of robot for polishing local discontinuous area
CN114913229A
Grinding algorithm and device based on three-dimensional scanner
CN115592564A