Workpiece positioning method and device, tapping system, equipment and medium

By obtaining the position information of the first positioning element of the workpiece and the second positioning element of the three-dimensional model, and using the least squares method to calculate the target conversion coefficient, the problems of low efficiency and high cost of small batch or batch workpieces are solved, and automated positioning and high precision processing are realized.

CN120286791APending Publication Date: 2025-07-11杨锦琪
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510654935.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In the prior art, the positioning method of small batch or unbatch workpieces has problems such as low production efficiency, poor processing quality and high cost. In particular, the visual positioning method of template matching technology has too high time or capital cost to make templates in small batch or unbatch products and cannot be applied.

Method used

By obtaining the position information of the first positioning element of the workpiece and the second positioning element of the three-dimensional model, the target conversion coefficient is calculated using the least squares method to realize the automatic positioning of the actual positioning points on the workpiece, including image acquisition, position information processing and calculation of the conversion coefficient.

Benefits of technology

It realizes automatic positioning of workpieces, improves production efficiency, ensures positioning accuracy and processing quality, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120286791A_ABST
    Figure CN120286791A_ABST
Patent Text Reader

Abstract

The invention provides a workpiece positioning method and device, a tapping system, equipment and a medium. The positioning method comprises the steps that first position information corresponding to a first positioning element is obtained; obtaining a three-dimensional model corresponding to the workpiece, wherein the three-dimensional model comprises a target positioning point and a second positioning element corresponding to the first positioning element; acquiring a first position information set; obtaining a target conversion coefficient between the first position information and the second position information based on the first position information set; and obtaining actual position information of an actual positioning point on the workpiece corresponding to the target positioning point based on the target conversion coefficient and the target position information corresponding to the target positioning point. The target conversion coefficient is obtained through the first position information of the workpiece and the second position information of the three-dimensional model of the workpiece, then the actual position information of the actual positioning point on the workpiece is obtained, automatic positioning of the workpiece is achieved, the production efficiency is improved, the positioning precision and the machining quality of the workpiece are guaranteed, and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of positioning, and particularly to a positioning method, device, tapping system, equipment and medium for a workpiece. Background Art

[0002] In current manufacturing, it is difficult to achieve automated and efficient production for "small batch" or "no batch" and "customized" products. Basically, they are all manually or semi-automatically produced, resulting in low output, poor quality and high cost of such products. One of the main reasons for the inability to automate production is the inability to accurately position such workpieces. Without positioning, the workpieces cannot be processed. The current workpiece positioning method is mainly visual positioning based on the "template matching" technology. However, for "small batch" or "no batch" products, the time or capital cost of making templates is greater than that of manual positioning, so it is not applicable.

[0003] Currently, for the positioning of "small batch" or "no batch" workpieces, generally, a coordinate measuring machine is used to manually measure the position of the workpiece, or a 3D (Three-Dimensional) vision camera is used to perform point cloud scanning on the workpiece and then match it with the point cloud digital model, resulting in problems such as low production efficiency, poor processing quality and high cost. Summary of the Invention

[0004] The technical problem to be solved by the present disclosure is to overcome the defects of low production efficiency, poor processing quality, high cost, etc. in the prior art for the positioning and production methods of "small batch" or "no batch" workpieces, and to provide a positioning method, device, tapping system, equipment and medium for a workpiece.

[0005] The present disclosure solves the above technical problems through the following technical solutions:

[0006] The present disclosure provides a positioning method for a workpiece, where the workpiece includes a plurality of first positioning elements, and the positioning method includes:

[0007] Obtain first position information corresponding to the first positioning elements;

[0008] Obtain a three-dimensional model corresponding to the workpiece, where the three-dimensional model includes target positioning points and second positioning elements corresponding to the first positioning elements;

[0009] Obtain a first position information set;

[0010] Wherein, the first position information set includes a plurality of groups of first position information pairs, and each group of first position information pairs includes the first position information and second position information corresponding to the second positioning elements;

[0011] Based on the first position information set, obtain the target conversion coefficient between the first position information and the second position information;

[0012] Based on the target conversion coefficient and the target position information corresponding to the target positioning point, obtain the actual position information of the actual positioning point on the workpiece corresponding to the target positioning point.

[0013] Optionally, before the step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set, the following steps are further included:

[0014] Modify the first position information set;

[0015] The step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set includes:

[0016] Based on the modified first position information set, obtain the target conversion coefficient.

[0017] Optionally, the step of modifying the first position information set includes:

[0018] Based on the first position information set, obtain the first initial conversion coefficient for converting from the second position information to the first position information;

[0019] Based on the first initial conversion coefficient, obtain the third position information corresponding to the second position information in several groups of the first position information pairs;

[0020] Obtain the first actual distance between the third position information and the corresponding first position information;

[0021] Based on the first actual distance, modify the first position information set.

[0022] Optionally, the step of modifying the first position information set includes:

[0023] Based on the first position information set, obtain the second initial conversion coefficient for converting from the first position information to the second position information;

[0024] Based on the second initial conversion coefficient, obtain the fourth position information corresponding to the first position information in several groups of the first position information pairs;

[0025] Obtain the second actual distance between the second position information and the corresponding fourth position information;

[0026] Based on the second actual distance, modify the first position information set.

[0027] Optionally, the step of changing the first position information set based on the first actual distance includes:

[0028] In response to the first actual distance being greater than a preset distance, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set.

[0029] Optionally, the step of changing the first position information set based on the first actual distance includes:

[0030] Obtain the target quantity of the second position information pairs in the second position information set;

[0031] Wherein, the second position information set includes several groups of second position information pairs, each group of the second position information pairs includes the third position information and the corresponding first position information, and the target quantity is the quantity of the second position information pairs where the first actual distance between the third position information and the first position information is greater than the preset distance;

[0032] Change the first position information set based on the target quantity.

[0033] Optionally, the step of changing the first position information set based on the target quantity includes:

[0034] In response to the target quantity being less than a preset quantity, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set;

[0035] In response to the target quantity being not less than the preset quantity, determine that the workpiece does not match the three-dimensional model, and obtain a new three-dimensional model to change the first position information set.

[0036] Optionally, the step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set includes:

[0037] Adopt the least squares method based on the first position information set to obtain the target conversion coefficient.

[0038] Optionally, the target conversion coefficient includes a target rotation coefficient and a target translation coefficient, and the calculation formula corresponding to the step of adopting the least squares method based on the first position information set to obtain the target conversion coefficient is as follows:

[0039] ;

[0040] Wherein, represents a preset error value between the first position information and the second position information, N represents the actual number of the first position information pairs in the first position information set, d i represents the i-th first position information, m i represents the i-th second position information, R represents the target rotation coefficient, and P represents the target translation coefficient.

[0041] Optionally, the step of obtaining the first position information corresponding to the first positioning element includes:

[0042] Based on the second position information, driving an image acquisition device to acquire a target image corresponding to the first positioning element;

[0043] Based on the target image, obtaining the first position information.

[0044] Optionally, the first position information includes target height information, and the step of obtaining the first position information based on the target image includes:

[0045] Obtaining a pixel ratio between the target image and a reference image;

[0046] wherein the reference image is an image corresponding to a reference positioning element acquired by the image acquisition device;

[0047] Based on the pixel ratio and the reference height information corresponding to the reference image, obtaining the target height information;

[0048] and / or,

[0049] The first positioning element includes a positioning hole.

[0050] The present disclosure further provides a positioning device for a workpiece. The workpiece includes a plurality of first positioning elements, and the positioning device includes:

[0051] A first position acquisition module for acquiring first position information corresponding to the first positioning element;

[0052] A model acquisition module for acquiring a three-dimensional model corresponding to the workpiece. The three-dimensional model includes target positioning points and second positioning elements corresponding to the first positioning elements;

[0053] An information set acquisition module for acquiring a first position information set;

[0054] wherein the first position information set includes a plurality of groups of first position information pairs, and each group of the first position information pairs includes the first position information and the second position information corresponding to the second positioning element;

[0055] A coefficient acquisition module, configured to obtain a target conversion coefficient between the first position information and the second position information based on the first position information set;

[0056] A second position acquisition module, configured to obtain actual position information of an actual positioning point on the workpiece corresponding to the target positioning point based on the target conversion coefficient and the target position information corresponding to the target positioning point.

[0057] Optionally, the positioning device further includes an information set modification module;

[0058] The information set modification module is configured to modify the first position information set;

[0059] The coefficient acquisition module is further configured to obtain the target conversion coefficient based on the modified first position information set.

[0060] Optionally, the information set modification module includes:

[0061] A first coefficient acquisition unit, configured to obtain a first initial conversion coefficient for converting from the second position information to the first position information based on the first position information set;

[0062] A first position acquisition unit, configured to obtain third position information corresponding to the second position information in several groups of the first position information pairs based on the first initial conversion coefficient;

[0063] A first distance acquisition unit, configured to acquire a first actual distance between the third position information and the corresponding first position information;

[0064] A first modification unit, configured to modify the first position information set based on the first actual distance.

[0065] Optionally, the information set modification module includes:

[0066] A second coefficient acquisition unit, configured to obtain a second initial conversion coefficient for converting from the first position information to the second position information based on the first position information set;

[0067] A second position acquisition unit, configured to obtain fourth position information corresponding to the first position information in several groups of the first position information pairs based on the second initial conversion coefficient;

[0068] A second distance acquisition unit, configured to acquire a second actual distance between the second position information and the corresponding fourth position information;

[0069] A second modification unit, configured to modify the first position information set based on the second actual distance.

[0070] Optionally, the first change unit is further configured to, in response to the first actual distance being greater than a preset distance, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set.

[0071] Optionally, the first change unit includes:

[0072] A quantity acquisition subunit, configured to acquire the target quantity of the second position information pairs in the second position information set;

[0073] Wherein, the second position information set includes several groups of second position information pairs, each group of the second position information pairs includes the third position information and the corresponding first position information, and the target quantity is the quantity of the second position information pairs where the first actual distance between the third position information and the first position information is greater than the preset distance;

[0074] A change subunit, configured to change the first position information set based on the target quantity.

[0075] Optionally, the change subunit is further configured to, in response to the target quantity being less than a preset quantity, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set;

[0076] In response to the target quantity being not less than the preset quantity, determine that the workpiece does not match the three-dimensional model, and acquire a new three-dimensional model to change the first position information set.

[0077] Optionally, the coefficient acquisition module is further configured to use the least squares method based on the first position information set to obtain the target conversion coefficient.

[0078] Optionally, the target conversion coefficient includes a target rotation coefficient and a target translation coefficient, and the calculation formula used by the coefficient acquisition module is as follows:

[0079] ;

[0080] Wherein, represents the preset error value between the first position information and the second position information, N represents the actual quantity of the first position information pairs in the first position information set, d i represents the i-th first position information, m i represents the i-th second position information, R represents the target rotation coefficient, and P represents the target translation coefficient.

[0081] Optionally, the first position acquisition module includes:

[0082] A target image acquisition unit, configured to drive an image acquisition device to acquire a target image corresponding to the first positioning element based on the second position information;

[0083] A third position acquisition unit, configured to obtain the first position information based on the target image.

[0084] Optionally, the third position acquisition unit includes:

[0085] A ratio acquisition subunit, configured to acquire a pixel ratio between the target image and a reference image;

[0086] Wherein, the reference image is an image corresponding to a reference positioning element acquired by the image acquisition device;

[0087] A height acquisition subunit, configured to obtain the target height information based on the pixel ratio and the reference height information corresponding to the reference image;

[0088] And / or

[0089] The first positioning element includes a positioning hole.

[0090] The present disclosure further provides a tapping system, where the tapping system includes the positioning device of the workpiece as described above;

[0091] The tapping system further includes a host computer, an image acquisition module, a robot, and a tapping gun;

[0092] The host computer is respectively communicatively connected to the image acquisition module, the robot, and the tapping gun;

[0093] The image acquisition module is communicatively connected to the positioning device;

[0094] The tapping gun is fixedly arranged on the robot;

[0095] The image acquisition module is configured to acquire a target image of a workpiece to be tapped and send the target image to the positioning device;

[0096] The positioning device is configured to output the actual position information to the host computer based on the target image;

[0097] The host computer is configured to send a driving instruction to the robot based on the actual position information to drive the robot to drive the tapping gun to perform tapping.

[0098] Optionally, the tapping system includes one image acquisition module;

[0099] The image acquisition module is fixedly arranged on the robot.

[0100] Optionally, the tapping system includes a plurality of the image acquisition modules;

[0101] The tapping system further includes a bracket structure;

[0102] The image acquisition module is fixedly arranged on the bracket structure.

[0103] Optionally, the tapping gun includes a sliding sleeve, a propulsion shaft, a servo motor and a tap;

[0104] The sliding sleeve is fixedly arranged on the robot, and the tap is fixedly arranged on the propulsion shaft;

[0105] The servo motor is used to drive the propulsion shaft to move along the sliding sleeve so as to drive the tap to perform tapping.

[0106] Optionally, the tapping system further includes a tap magazine;

[0107] The tapping gun further includes a clamping mechanism;

[0108] The clamping mechanism is used to clamp the tap to the tap magazine and clamp a new tap from the tap magazine.

[0109] Optionally, the tapping system further includes a track;

[0110] The robot is used to move along the track.

[0111] Optionally, the tapping system further includes a brake;

[0112] The brake is used to fix the robot on the track.

[0113] Optionally, the brake includes a clamping mechanism.

[0114] Optionally, the tapping system further includes a laser ranging module;

[0115] The laser ranging module is used to collect the tapping height information of the workpiece.

[0116] Optionally, the image acquisition module includes a 2D (Two-Dimensional) camera.

[0117] The present disclosure further provides an electronic device, including a memory, a processor and a computer program stored on the memory and used for running on the processor, where when the processor executes the computer program, the positioning method of the workpiece described above is implemented.

[0118] The present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the positioning method of the workpiece described above is implemented.

[0119] The present disclosure also provides a computer program product, including a computer program which, when executed by a processor, implements the positioning method of the workpiece as described above.

[0120] Based on common general knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred embodiments of the present disclosure.

[0121] The positive and progressive effects of the present disclosure are as follows:

[0122] The present disclosure obtains a target conversion coefficient through the first position information corresponding to the first positioning element of the workpiece and the second position information corresponding to the second positioning element in the three-dimensional model of the workpiece, and further obtains the actual position information of the actual positioning point on the workpiece, realizing the automatic positioning of the workpiece, improving production efficiency, ensuring the positioning accuracy and machining quality of the workpiece, and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0123] Figure 1 It is the first flowchart of the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0124] Figure 2 It is a specific example diagram of the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0125] Figure 3 It is the flowchart of step S11 in the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0126] Figure 4 It is the flowchart of step S112 in the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0127] Figure 5 It is the second flowchart of the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0128] Figure 6 It is the first flowchart of step S141 in the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0129] Figure 7 It is the second flowchart of step S141 in the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0130] Figure 8 It is the flowchart of step S1414 in the positioning method of the workpiece according to Embodiment 1 of the present disclosure;

[0131] Figure 9 It is the first module schematic diagram of the positioning device of the workpiece according to Embodiment 2 of the present disclosure;

[0132] Figure 10 It is the second module schematic diagram of the positioning device of the workpiece according to Embodiment 2 of the present disclosure;

[0133] Figure 11 Schematic diagram of the first module of the tapping system according to Embodiment 3 of the present disclosure;

[0134] Figure 12 Schematic diagram of the first position of the image acquisition module in the tapping system according to Embodiment 3 of the present disclosure;

[0135] Figure 13 Schematic diagram of the second position of the image acquisition module in the tapping system according to Embodiment 3 of the present disclosure;

[0136] Figure 14 Schematic diagram of the second module of the tapping system according to Embodiment 3 of the present disclosure;

[0137] Figure 15 Schematic diagram of the first position of the propulsion shaft and the sliding sleeve in the tapping system according to Embodiment 3 of the present disclosure;

[0138] Figure 16 Schematic diagram of the second position of the propulsion shaft and the sliding sleeve in the tapping system according to Embodiment 3 of the present disclosure;

[0139] Figure 17 Schematic diagram of the tapping chuck releasing the tap in the tapping system according to Embodiment 3 of the present disclosure;

[0140] Figure 18 Schematic diagram of the position of the robot and the track in the tapping system according to Embodiment 3 of the present disclosure;

[0141] Figure 19 Schematic diagram of the position of the brake member in the tapping system according to Embodiment 3 of the present disclosure;

[0142] Figure 20 Schematic diagram of the structure of the tapping system according to Embodiment 3 of the present disclosure;

[0143] Figure 21 Schematic diagram of the structure of the electronic device according to Embodiment 4 of the present disclosure. Detailed implementation manners

[0144] The present disclosure will be further described below by way of embodiments, but the present disclosure is not limited to the scope of the described embodiments.

[0145] In the embodiments of the present disclosure, prefix words such as "first" and "second" are used only to distinguish different described objects, and have no restrictive effect on the position, order, priority, quantity, content, etc. of the described objects. In the embodiments of the present disclosure, the use of prefix words such as ordinal numbers to distinguish described objects does not constitute a restriction on the described objects. For the description of the described objects, refer to the description in the claims or the context of the embodiments. It should not constitute an unnecessary restriction because of the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, "a plurality of" means two or more.

[0146] Embodiment 1

[0147] This embodiment provides a positioning method for a workpiece. The workpiece includes a number of first positioning elements, such as Figure 1 as shown, the positioning method includes:

[0148] S11. Obtain the first position information corresponding to the first positioning element;

[0149] S12. Obtain the three-dimensional model corresponding to the workpiece. The three-dimensional model includes a target positioning point and a second positioning element corresponding to the first positioning element;

[0150] S13. Obtain the first position information set;

[0151] Wherein, the first position information set includes a number of groups of first position information pairs. Each group of first position information pairs includes the first position information and the second position information corresponding to the second positioning element;

[0152] S14. Based on the first position information set, obtain the target conversion coefficient between the first position information and the second position information;

[0153] S15. Based on the target conversion coefficient and the target position information corresponding to the target positioning point, obtain the actual position information of the actual positioning point on the workpiece corresponding to the target positioning point.

[0154] Specifically, as Figure 2 shown, the first positioning element d of workpiece A includes a positioning hole, which is, for example, a round hole. Workpiece A is placed on the platform and can be placed in the preset area B. A first coordinate system is established in the real space where workpiece A is located. The first coordinate system can be adjusted or set according to the actual situation. For example, taking the center of the round hole of the first positioning element d as the coordinate origin of the first coordinate system, the X-axis and Y-axis of the first coordinate system are set on the plane parallel to the platform where workpiece A is located, and the Z-axis is established perpendicular to this plane. The coordinate representation of the first position information of the first positioning element d is (X, Y, Z). X, Y, and Z respectively represent the coordinates of the first positioning element d on different coordinate axes in the first coordinate system.

[0155] The three-dimensional model C is a model in computer software. A second coordinate system can be established in the computer software where the three-dimensional model C is located. The second coordinate system can be established based on the correspondence between the three-dimensional model C and the workpiece A, and can be established according to the actual situation of the software in the computer D. The coordinate representation of the second position information of the second positioning element m of the three-dimensional model C is (a, b, c). a, b, and c respectively represent the coordinates of the second positioning element m on different coordinate axes in the second coordinate system.

[0156] Obtain the first position information and the second position information of multiple mutually corresponding first positioning elements d and second positioning elements m respectively. A pair of first position information and second position information is used as a pair of first position information pairs, and multiple pairs of first position information pairs are used as a first position information set.

[0157] Obtain the target conversion coefficient for converting from the second position information to the first position information based on the first position information set. The essence of the target conversion coefficient is to convert the coordinates of a point in the second coordinate system to the coordinates of a point in the first coordinate system.

[0158] Convert the target position information of the target positioning point r in the three-dimensional model C in the second coordinate system to the actual position information of the actual positioning point s on the workpiece A in the first coordinate system.

[0159] In this solution, the target conversion coefficient is obtained through the first position information corresponding to the first positioning element of the workpiece and the second position information corresponding to the second positioning element in the three-dimensional model of the workpiece, and then the actual position information of the actual positioning point on the workpiece is obtained, realizing the automatic positioning of the workpiece, improving the production efficiency, ensuring the positioning accuracy and machining quality of the workpiece, and reducing the cost.

[0160] In an implementable solution, as Figure 3 shown, step S11 includes:

[0161] S111. Based on the second position information, drive the image acquisition device to acquire the target image corresponding to the first positioning element;

[0162] S112. Based on the target image, obtain the first position information.

[0163] Specifically, the image acquisition device can be fixedly installed on the robot and drive the robot to run near the first positioning element of the workpiece according to the second position information. The image acquisition device takes pictures one by one in the defined area near the first positioning element, searches for the first positioning element through the matching function. Once the first positioning element is found, the position of the robot is continuously adjusted through the positive feedback technology of the pixel value of the image acquisition device to obtain the planar position of the first positioning element with sub-pixel accuracy. When the first positioning element appears in the field of view of the image acquisition device, the position of the first positioning element can be obtained according to the target image of the first positioning element, that is, the first position information. When the first positioning element appears at the edge of the target image, the error of the first position information is large; when the first positioning element appears in the middle position of the target image, the first position information is the most accurate and the error is the smallest. The position of the first positioning element in the target image is adjusted through the positive feedback technology of the pixel value to obtain more accurate first position information.

[0164] The image acquisition device can be a 2D camera, and the 2D camera takes a 2D image of the first positioning element m, that is, the target image. Through the geometric relationship between the pixel size in the 2D image and the focal length of the camera, the planar position of the first positioning element in the camera coordinate system is calculated. The planar position is represented by the coordinate point (X, Y), where X represents the abscissa and Y represents the ordinate. The camera coordinate system can be a coordinate system established with the optical center of the camera (i.e., the optical center of the lens) as the coordinate origin and a right-handed system in the real space where the camera and the workpiece are located. The camera coordinate system can be adjusted or set according to the actual situation. The camera coordinate system here can be used as the first coordinate system.

[0165] Based on the target image of the first positioning element, the formula for obtaining the first position information of the first positioning element is as follows:

[0166] k = f * L / w;

[0167] X = (u - c x ) * k / f;

[0168] Y = (v - c y ) * k / f;

[0169] Among them, f represents the focal length of the camera, L represents the actual size of the first positioning element. For example, if the first positioning element is a round hole, the actual size is the diameter of the circle. w represents the pixel size of the first positioning element in the target image, k represents the distance from the first positioning element to the camera, u and v represent the pixel coordinates of the center of the first positioning element in the target image, and c x、 c y represents the center coordinate of the target image.

[0170] The above provides a method for obtaining the first position information of the first positioning element through the target image of the first positioning element. There are other methods in the prior art, which will not be elaborated here.

[0171] In this solution, the second position information of the second positioning element in the three-dimensional model is used to drive the image acquisition device to collect the target image corresponding to the first positioning element, and then the first position information is obtained, ensuring the convenience and effectiveness of obtaining the first position information.

[0172] In an implementable solution, the first position information includes target height information. For example, Figure 4 As shown, step S112 includes:

[0173] S1121. Obtain the pixel ratio between the target image and the reference image;

[0174] Among them, the reference image is the image corresponding to the reference positioning element collected by the image acquisition device;

[0175] S1122. Based on the pixel ratio and the reference height information corresponding to the reference image, obtain the target height information.

[0176] Specifically, the image acquisition device is a 2D camera, and the reference height information of the reference positioning element is the height information in the camera coordinate system, represented by the vertical coordinate in the camera coordinate system. This reference height information can be obtained through pre-calibration. The actual size of the reference positioning element can be the same as the actual size of the first positioning element. The target height information Z of the first positioning element can be obtained through the pixel ratio between the target image of the first positioning element and the reference image of the reference positioning element, and the reference height information corresponding to the reference image. For example, if the reference positioning element is a round hole, the pixel ratio can be the ratio between the pixel size of the diameter of the first positioning element in the target image and the pixel size of the diameter of the reference positioning element in the reference image.

[0177] In this solution, the target height information of the first positioning element is obtained through the pixel ratio between the target image and the reference image, realizing the effective and reliable acquisition of the target height information.

[0178] Through the above method, the coordinates (X, Y, Z) of the first position information of the first positioning element d in the camera coordinate system can be obtained.

[0179] In an implementable solution, the target conversion coefficient includes a target rotation coefficient and a target translation coefficient. Step S14 includes:

[0180] Using the least squares method, based on the first position information set, to obtain the target conversion coefficient.

[0181] The corresponding calculation formula is as follows:

[0182] ;

[0183] wherein, represents a preset error value between the first position information and the second position information, N represents the actual number of first position information pairs in the first position information set, d i represents the i-th first position information, m i represents the i-th second position information, R represents the target rotation coefficient, and P represents the target translation coefficient.

[0184] Specifically, d i is the first position information of the i-th first positioning element in the camera coordinate system, and is represented by the coordinates (X i , Y i , Z i ). T . X i , Y i , Z i respectively represent the abscissa, ordinate, and vertical coordinate of the i-th first positioning element in the camera coordinate system. The acquisition method of (X i , Y i , Z i ) is similar to the acquisition method of the coordinates (X, Y, Z) of the aforementioned first position information, and will not be elaborated here. m i is the second position information of the i-th second positioning element in the second coordinate system where the three-dimensional model is located, and is represented by the coordinates (a i , b i , c i ). T , a i , b i , c i respectively represent the abscissa, ordinate, and vertical coordinate of the i-th second positioning element in the three-dimensional model coordinate system. T represents the transpose. i = 1, 2, 3... N.

[0185] The relationship between the first position information and the second position information is:

[0186] d i = Rm i + P;

[0187] wherein, R is a 3*3 matrix, and P is a 3*1 vector. The least squares method is used to solve the optimal transformation [R P] that maps m i to d i .

[0188] Set , , , ;

[0189] Among them, represents the average value of N first position information d i , d ci represents the difference between the i-th first position information d i and ; represents the average value of N second position information m i , m ci represents the difference between the i-th second position information m i and ;

[0190] can be simplified to ;

[0191] When is closer to zero, d ci and Rm ci are closer. Assume , at this time, the obtained R is the target rotation coefficient for the conversion between the first position information and the second position information, and it is the conversion coefficient for converting from the second position information to the first position information.

[0192] The calculation formula corresponding to the target translation coefficient is as follows:

[0193] ;

[0194] For a three-dimensional model, by selecting different coordinate centers, that is, different coordinate origins, different second position information will be obtained, and the target translation coefficient P will also be different.

[0195] In this solution, the least squares method is adopted based on the first position information set to obtain the target conversion coefficient, ensuring the accuracy and reliability of the target conversion coefficient.

[0196] In an implementable solution, as Figure 5 shown, before step S14, it further includes:

[0197] S141. Modify the first position information set;

[0198] Step S14 includes:

[0199] S142. Based on the modified first position information set, obtain the target conversion coefficient.

[0200] Specifically, the method of obtaining the target conversion coefficient based on the modified first position information set is similar to the method of using the least squares method based on the first position information set to obtain the target conversion coefficient, and will not be elaborated here.

[0201] In this solution, by changing the first position information set and obtaining the target conversion coefficient based on the changed first position information set, the accuracy and reliability of the target conversion coefficient are ensured.

[0202] In an implementable solution, as Figure 6 shown, step S141 includes:

[0203] S1411. Based on the first position information set, obtain the first initial conversion coefficient for converting from the second position information to the first position information;

[0204] Specifically, the method for obtaining the first initial conversion coefficient is similar to the method for obtaining the target conversion coefficient using the least squares method described above, and will not be elaborated here.

[0205] S1412. Based on the first initial conversion coefficient, obtain the third position information corresponding to the second position information in several groups of first position information pairs;

[0206] Specifically, the first initial conversion coefficient includes a first rotation coefficient and a first translation coefficient. The calculation formula for converting the second position information to obtain the third position information is as follows:

[0207] e i =R1m i +P1;

[0208] where R1 represents the first rotation coefficient, P1 represents the first translation coefficient, m i represents the i-th second position information, and e i represents the i-th third position information.

[0209] S1413. Obtain the first actual distance between the third position information and the corresponding first position information;

[0210] S1414. Based on the first actual distance, change the first position information set.

[0211] In this solution, the second position information is converted using the obtained first initial conversion coefficient to obtain the third position information. The first position information set is changed according to the first actual distance between the third position information and the corresponding first position information, ensuring the accuracy and reliability of the first position information set, and thus ensuring the accuracy and reliability of the target conversion coefficient.

[0212] In another implementable solution, as Figure 7 shown, step S141 includes:

[0213] S1415. Based on the first position information set, obtain the second initial conversion coefficient for converting from the first position information to the second position information;

[0214] Specifically, the second initial conversion coefficient includes a second rotation coefficient and a second translation coefficient. The method for obtaining the second initial conversion coefficient is similar to the method for obtaining the target conversion coefficient using the least squares method described above. The difference is that the first position information and the second position information in obtaining the target conversion coefficient are interchanged here. The corresponding calculation formula here is as follows:

[0215] ;

[0216] Among them, represents the preset error value between the second position information and the first position information, R2 represents the second rotation coefficient, and P2 represents the second translation coefficient.

[0217] S1416. Based on the second initial conversion coefficient, obtain the fourth position information corresponding to the first position information in several groups of first position information pairs;

[0218] Specifically, the calculation formula for converting the first position information to obtain the fourth position information is as follows:

[0219] g i =R2d i +P2;

[0220] Among them, d i represents the i-th first position information, and g i represents the i-th fourth position information.

[0221] S1417. Obtain the second actual distance between the second position information and the corresponding fourth position information;

[0222] S1418. Based on the second actual distance, modify the first position information set.

[0223] In this solution, the first position information is converted using the obtained second initial conversion coefficient to obtain the fourth position information. The first position information set is modified according to the second actual distance between the second position information and the corresponding fourth position information, ensuring the accuracy and reliability of the first position information set, and thus ensuring the accuracy and reliability of the target conversion coefficient.

[0224] In an implementable solution, step S1414 includes:

[0225] In response to the first actual distance being greater than the preset distance, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set.

[0226] Specifically, the first actual distance is used to measure the deviation between the third position information and the corresponding first position information, and the first position information pairs with large deviations are deleted.

[0227] In this solution, the first position information pair where the first actual distance corresponding to the first position information is greater than the preset distance is deleted from the first position information set, realizing the change of the first position information set, ensuring the accuracy and reliability of the first position information set, and further ensuring the accuracy and reliability of the target conversion coefficient.

[0228] In another feasible solution, as Figure 8 shown, step S1414 includes:

[0229] S14141. Obtain the target quantity of the second position information pairs in the second position information set;

[0230] Among them, the second position information set includes several groups of second position information pairs, each group of second position information pairs includes the third position information and the corresponding first position information, and the target quantity is the quantity of the second position information pairs where the first actual distance between the third position information and the first position information is greater than the preset distance;

[0231] S14142. Modify the first position information set based on the target quantity.

[0232] Specifically, calculate the deviation of multiple pairs of second position information pairs in the second position information set, and the deviation is measured by the first actual distance between the third position information and the corresponding first position information. Count the quantity of the second position information pairs where the first actual distance is greater than the preset distance, that is, the target quantity. Modify the first position information set according to the target quantity.

[0233] In this solution, the first position information set is changed to obtain a new first position information set through the quantity of the second position information pairs where the first actual distance between the third position information and the first position information is greater than the preset distance, ensuring the accuracy and reliability of the first position information set, and further ensuring the accuracy and reliability of the target conversion coefficient.

[0234] In a feasible solution, step S14142 includes:

[0235] In response to the target quantity being less than the preset quantity, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set;

[0236] In response to the target quantity being not less than the preset quantity, determine that the workpiece does not match the three-dimensional model, and obtain a new three-dimensional model to change the first position information set.

[0237] Specifically, if the target quantity is less than the preset quantity, it indicates that there is a large deviation between the third position information and the corresponding first position information of only a few second position information pairs in the second position information set. The corresponding first position information pairs are deleted from the first position information set to obtain a new first position information set, and a new and more accurate position conversion coefficient, that is, the target conversion coefficient, is recalculated.

[0238] If the target quantity is not less than the preset quantity, it indicates that there is a large deviation between the third position information and the corresponding first position information of a large number of second position information pairs in the second position information set, and the three-dimensional model of the workpiece does not match the workpiece in reality. The identification of the workpiece is realized, and a new three-dimensional model needs to be selected again to obtain new second positioning elements, new second position information, and then a new first position information set, so as to realize the change of the first position information set.

[0239] In this solution, according to the different size relationships between the target quantity and the preset quantity, different methods are used to change the first position information set, which ensures the accuracy and reliability of the first position information set, and further ensures the accuracy and reliability of the target conversion coefficient.

[0240] In addition, the method of changing the first position information set based on the second actual distance in step S1418 is similar to the method in step S1414, and will not be elaborated here.

[0241] The working principle of the positioning method of the workpiece in this embodiment will be described below with specific examples:

[0242] As Figure 2 shown, before positioning, workpiece A is placed on the platform, and the orientation and position of the corresponding three-dimensional model C of the workpiece are similar to the orientation and position of workpiece A on the platform. The specific allowable deviation range is determined according to the effective area that the image acquisition device, that is, camera E, can capture.

[0243] Obtain the second positioning element m in the three-dimensional model C corresponding to workpiece A and the second position information of the second positioning element m in the second coordinate system. m i represents the i-th second position information. When only 2D positioning is required, at least 2 second positioning elements are required; when 3D positioning is performed, at least 3 second positioning elements are required. The more second positioning elements there are, the more accurate the positioning of the workpiece is, and the more accurate the identification of the workpiece is.

[0244] According to the second position information, the robot F drives the camera E to collect the target image corresponding to the first positioning element d of workpiece A. According to the target image, the first position information of the first positioning element d of workpiece A in the first coordinate system is obtained. d iRepresents the i-th first position information. The first position information includes target height information, which is obtained based on the pixel ratio between the target image and the reference image. The first coordinate system can adopt the camera coordinate system, and the positional relationship between the robot and the camera is determined by performing hand-eye calibration on the camera using a camera calibration kit.

[0245] Using the least squares method, obtain the first initial conversion coefficients between the first position information and the second position information, namely the first rotation coefficient R1 and the first translation coefficient P1.

[0246] According to the rotation coefficient R1 and the translation coefficient P1, transform the second position information m i to obtain the third position information. The corresponding formula is as follows:

[0247] e i = R1m i + P1;

[0248] e i represents the i-th third position information;

[0249] The second position information pair includes the third position information and the corresponding first position information. Calculate the first actual distance between the third position information e i and the first position information d i , and count the number of second position information pairs where the first actual distance is greater than the preset distance, which is the target number.

[0250] When the target number is less than the preset number, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set to obtain a new first position information set. The first position information set includes several groups of first position information pairs, and each group of first position information pairs includes the first position information and the corresponding second position information.

[0251] When the target number is not less than the preset number, determine that the workpiece does not match the 3D model, and obtain a new 3D model to change the first position information set.

[0252] Based on the changed first position information set, obtain the target conversion coefficients.

[0253] Based on the target conversion coefficients and the target position information corresponding to the target positioning point r in the 3D model, obtain the actual position information of the actual positioning point s on the workpiece. The corresponding calculation formula is as follows:

[0254] d’ = Rm’ + P;

[0255] Where, R represents the target rotation coefficient, P represents the target translation coefficient, m’ represents the target position information of the target positioning point r, and d’ represents the actual position information of the actual positioning point s.

[0256] The target rotation coefficient and the target translation coefficient in the target conversion coefficient can be converted into Euler angles, which is convenient for use in the computer simulation software where the three-dimensional model is located or the program of the robot with a fixed image acquisition device.

[0257] Taking the right-hand rule rotation of the X-Z-X fixed angle as an example, the target rotation coefficient is:

[0258] X1Z2X3 = ;

[0259] Then the Euler angles are:

[0260] ;

[0261] ;

[0262] ;

[0263] Among them, R 31 represents the number in the first column of the third row in the matrix of the rotation coefficient, and the meanings represented by R 21 , R 11 , R 13 , R 12 are similar to the meaning represented by R 31 , and will not be elaborated here.

[0264] In this embodiment, through the first position information corresponding to the first positioning element of the workpiece and the second position information corresponding to the second positioning element in the three-dimensional model of the workpiece, the target conversion coefficient is obtained, and then the actual position information of the actual positioning point on the workpiece is obtained, realizing the automatic positioning of the workpiece, improving the production efficiency, ensuring the positioning accuracy and processing quality of the workpiece, and reducing the cost.

[0265] Embodiment 2

[0266] Corresponding to the foregoing embodiment of the positioning method of the workpiece, the present disclosure also provides an embodiment of a positioning device for the workpiece.

[0267] The workpiece includes a plurality of first positioning elements. As Figure 9 shown, the positioning device includes:

[0268] A first position acquisition module 11, configured to acquire first position information corresponding to the first positioning element;

[0269] A model acquisition module 12, configured to acquire a three-dimensional model corresponding to the workpiece, and the three-dimensional model includes a target positioning point and a second positioning element corresponding to the first positioning element;

[0270] An information set acquisition module 13, configured to acquire a first position information set;

[0271] Among them, the first position information set includes several groups of first position information pairs, and each group of first position information pairs includes first position information and second position information corresponding to a second positioning element;

[0272] The coefficient acquisition module 14 is configured to obtain a target conversion coefficient between the first position information and the second position information based on the first position information set;

[0273] The second position acquisition module 15 is configured to obtain the actual position information of the actual positioning point on the workpiece corresponding to the target positioning point based on the target conversion coefficient and the target position information corresponding to the target positioning point.

[0274] In an implementable solution, as Figure 10 shown, the positioning device further includes an information set modification module 16;

[0275] The information set modification module 16 is configured to modify the first position information set;

[0276] The coefficient acquisition module 12 is further configured to obtain a target conversion coefficient based on the modified first position information set.

[0277] In an implementable solution, the information set modification module 16 includes:

[0278] The first coefficient acquisition unit 161 is configured to obtain a first initial conversion coefficient for converting from the second position information to the first position information based on the first position information set;

[0279] The first position acquisition unit 162 is configured to obtain third position information corresponding to the second position information in several groups of first position information pairs based on the first initial conversion coefficient;

[0280] The first distance acquisition unit 163 is configured to acquire a first actual distance between the third position information and the corresponding first position information;

[0281] The first modification unit 164 is configured to modify the first position information set based on the first actual distance.

[0282] In an implementable solution, the information set modification module 16 includes:

[0283] The second coefficient acquisition unit 165 is configured to obtain a second initial conversion coefficient for converting from the first position information to the second position information based on the first position information set;

[0284] The second position acquisition unit 166 is configured to obtain fourth position information corresponding to the first position information in several groups of first position information pairs based on the second initial conversion coefficient;

[0285] The second distance acquisition unit 167 is configured to acquire a second actual distance between the second position information and the corresponding fourth position information;

[0286] The second change unit 168 is configured to change the first position information set based on the second actual distance.

[0287] In an implementable solution, the first change unit 164 is further configured to, in response to the first actual distance being greater than a preset distance, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set.

[0288] In an implementable solution, the first change unit 164 includes:

[0289] The quantity acquisition subunit 1641 is configured to acquire a target quantity of second position information pairs in the second position information set;

[0290] Wherein, the second position information set includes several groups of second position information pairs, each group of second position information pairs includes third position information and the corresponding first position information, and the target quantity is the quantity of second position information pairs where the first actual distance between the third position information and the first position information is greater than the preset distance;

[0291] The change subunit 1642 is configured to change the first position information set based on the target quantity.

[0292] In an implementable solution, the change subunit 1642 is further configured to, in response to the target quantity being less than a preset quantity, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set;

[0293] In response to the target quantity being not less than the preset quantity, it is determined that the workpiece does not match the three-dimensional model, and a new three-dimensional model is acquired to change the first position information set.

[0294] In an implementable solution, the coefficient acquisition module 14 is further configured to use the least squares method based on the first position information set to obtain a target conversion coefficient.

[0295] In an implementable solution, the target conversion coefficient includes a target rotation coefficient and a target translation coefficient, and the calculation formula adopted by the coefficient acquisition module is as follows:

[0296] ;

[0297] Wherein, represents a preset error value between the first position information and the second position information, N represents the actual quantity of first position information pairs in the first position information set, d i represents the i-th first position information, m iIndicates the i-th second position information, R represents the target rotation coefficient, and P represents the target translation coefficient.

[0298] In an implementable solution, the first position acquisition module 11 includes:

[0299] A target image acquisition unit 111, configured to drive an image acquisition device to acquire a target image corresponding to a first positioning element based on the second position information;

[0300] A third position acquisition unit 112, configured to obtain first position information based on the target image.

[0301] In an implementable solution, the third position acquisition unit 112 includes:

[0302] A ratio acquisition subunit 1121, configured to acquire the pixel ratio between the target image and the reference image;

[0303] Wherein, the reference image is an image corresponding to a reference positioning element acquired by the image acquisition device;

[0304] A height acquisition subunit 1122, configured to obtain target height information based on the pixel ratio and the reference height information corresponding to the reference image;

[0305] And / or

[0306] The first positioning element includes a positioning hole.

[0307] In this embodiment, through the first position information corresponding to the first positioning element of the workpiece and the second position information corresponding to the second positioning element in the three-dimensional model of the workpiece, the target conversion coefficient is obtained, and then the actual position information of the actual positioning point on the workpiece is obtained, realizing the automatic positioning of the workpiece, improving the production efficiency, ensuring the positioning accuracy and machining quality of the workpiece, and reducing the cost.

[0308] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The system embodiment described above is only illustrative, and the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution.

[0309] Embodiment 3

[0310] This embodiment provides a tapping system, as Figure 11 shown, the tapping system includes a positioning device 80 of the workpiece as in Embodiment 2;

[0311] The tapping system further includes a host computer 81, an image acquisition module 82, a robot 83, and a tapping gun 84;

[0312] The host computer 81 is communicatively connected to the image acquisition module 82, the robot 83, and the tapping gun 84 respectively;

[0313] The image acquisition module 82 is communicatively connected to the positioning device 80;

[0314] The tapping gun 84 is fixedly arranged on the robot 83;

[0315] The image acquisition module 82 is used to acquire a target image of the workpiece to be tapped and send the target image to the positioning device 80;

[0316] The positioning device 80 is used to output actual position information to the host computer 81 based on the target image;

[0317] The host computer 81 is used to send a driving instruction to the robot 83 based on the actual position information to drive the robot 83 to drive the tapping gun 84 to perform tapping.

[0318] Specifically, the workpiece includes an automotive body panel die. The tapping gun is installed on the end flange of the robot. A workpiece placement platform is provided, and an allowable placement area for the workpiece is set on the platform. The area size is the reachable photographing range of the image acquisition module, and the platform does not need to be leveled. Before tapping, the worker places the workpiece to be tapped on the working area. As long as it does not exceed the allowable placement area, the workpiece can be placed arbitrarily within a certain angle range. The image acquisition module photographs the positioning holes on the workpiece, obtains the target image and sends it to the positioning device. The positioning device outputs the actual position information to the host computer based on the target image. The host computer generates a driving instruction based on the actual position information, that is, the tapping position information, and sends the driving instruction to the robot to drive the robot to drive the tapping gun to perform tapping.

[0319] In this solution, the target image of the workpiece to be tapped is acquired by the image acquisition module, and then the tapping position information is obtained and sent to the host computer, so that the host computer sends a driving instruction to the robot to drive the robot to drive the tapping gun to perform tapping, realizing the automatic positioning of the workpiece, improving the production efficiency, ensuring the positioning accuracy and processing quality of the workpiece, and reducing the cost.

[0320] In an implementable solution, the tapping system includes an image acquisition module 82;

[0321] The image acquisition module 82 is fixedly arranged on the robot 83.

[0322] Specifically, the image acquisition module is installed on the end flange of the robot. As Figure 12 and Figure 13As shown in the figure, the tapping gun is fixedly installed on the end flange of the robot, and the image acquisition module is fastened to the tapping gun through the positioning slot and positioning bolts using a bracket. The upper computer drives the robot to move, so as to drive the image acquisition module to acquire the target image. When the workpiece size is small, the robot can be not used.

[0323] In this solution, an image acquisition module fixedly installed on the robot is set, which ensures the effective acquisition of the target image.

[0324] In another implementable solution, the tapping system includes multiple image acquisition modules 82;

[0325] As Figure 14 shown in the figure, the tapping system further includes a bracket structure 85;

[0326] The image acquisition module 82 is fixedly installed on the bracket structure 85.

[0327] Specifically, the number of image acquisition modules is set according to the size of the workpiece to be recognized and whether the camera is fixed at the end of the robot. When the image acquisition module takes pictures within the accuracy range, it can cover a certain area, that is, the effective area. When the workpiece size is large and far exceeds the effective area photographed by the image acquisition module, multiple image acquisition modules can be used. The multiple image acquisition modules are positioned through pin holes and fastened with bolts on the bracket structure, and the bracket structure can be a solid bracket and is immovable.

[0328] In this solution, multiple image acquisition modules fixedly installed on the bracket structure are set, which ensures the effective acquisition of the target image.

[0329] In an implementable solution, the tapping gun 84 includes a sliding sleeve 841, a propulsion shaft 842, a servo motor 843 and a tap 844;

[0330] The sliding sleeve 841 is fixedly installed on the robot 83, and the tap 844 is fixedly installed on the propulsion shaft 842;

[0331] The servo motor 843 is used to drive the propulsion shaft 842 to move along the sliding sleeve 841, so as to drive the tap 844 to perform tapping.

[0332] Specifically, the propulsion shaft of the tapping gun held by the robot is fixed in a linear sliding sleeve and is driven by a servo motor. The positioning accuracy and movement coaxiality are much higher than the movement of the robot. When tapping, the robot moves above the hole position, the propulsion shaft of the tapping gun coincides with the axis of the hole position, the servo motor drives the propulsion shaft to slide along the sliding sleeve, and the rotating shaft of the tapping gun moves in coordination with the propulsion shaft to complete the tapping work. As Figure 15 shown in the figure, the propulsion shaft does not extend out of the sliding sleeve; as Figure 16As shown, the propulsion shaft extends out of the sliding sleeve. During tapping, the robot is only responsible for accurately positioning the tapping point. After that, the six-axis brake locks, and only the propulsion shaft completes the pressing-down action, eliminating the multi-axis linkage error of the robot. This can not only avoid the breakage of the tap, but also make the tapped thread more precise, and it is easier to control the pressing force and depth.

[0333] In this solution, the propulsion shaft is driven by a servo motor to move along the sliding sleeve to drive the tap for tapping, ensuring the safety of the tap and improving the accuracy and quality of tapping.

[0334] In an implementable solution, the tapping system further includes a tap magazine 86;

[0335] The tapping gun 84 further includes a clamping mechanism 845;

[0336] The clamping mechanism 845 is used to clamp the tap 844 to the tap magazine 86 and clamp a new tap from the tap magazine 86.

[0337] Specifically, after tapping a hole in the workpiece, the host computer determines whether a new tap is needed for the next hole. When a new tap is needed, the clamping mechanism replaces the tap from the tap magazine to complete the tapping of the next hole. This process is repeated to complete the tapping of the entire workpiece. The clamping mechanism adopts the design of a pneumatic pull stud for machine tools, with firm clamping, reliable structure, automatic centering, and rapid and reliable clamping and loosening of the tap. As Figure 17 shown, it is a schematic diagram of the clamping mechanism loosening the tap.

[0338] In this solution, by clamping the tap to the tap magazine with the clamping mechanism and clamping a new tap from the tap magazine, the flexible replacement of the tap is ensured, which can meet the tapping requirements for different diameters and depths. Only by replacing the taps in the tap magazine can the tapping requirements for different types of workpieces be met.

[0339] In an implementable solution, the tapping system further includes a track 87;

[0340] The robot 83 is used to move along the track 87.

[0341] Specifically, as Figure 18 shown, the track 87 is driven by a gear and rack. The robot 83 is installed on the slider 831, and the track 87 is installed on the track base 871. The slider 831 slides on the track 87 to make the robot 83 move along the track.

[0342] In this solution, by equipping the robot with a track, the reach range of the robot can be expanded, and at the same time, problems such as robot attitude limit or interference of the pipeline package can be avoided, meeting the tapping requirements for workpieces of different sizes, shapes, and tapping positions.

[0343] In an implementable solution, the tapping system further includes a brake 88;

[0344] The braking member 88 is used to fix the robot to the track 87.

[0345] In this solution, by setting the braking member, the robot can be prevented from moving during operation, ensuring the tapping accuracy.

[0346] In an implementable solution, the braking member 88 includes a clamping mechanism.

[0347] Specifically, as Figure 19 shown, the clamping mechanism 881 is installed on the track 87. When the robot 83 operates, it clamps the slider 831 below the robot 83 to fix the slider 831, and then confines the robot 83 in an accurate position, preventing the robot from moving and improving the accuracy of the robot during operation.

[0348] In this solution, by fixing the robot to the track through the clamping mechanism, the robot can be prevented from moving during operation, ensuring the tapping accuracy.

[0349] In an implementable solution, the tapping system further includes a laser ranging module 89;

[0350] The laser ranging module 89 is used to collect the tapping height information of the workpiece.

[0351] In this solution, by collecting the tapping height information of the workpiece through the laser ranging module, the accuracy and reliability of the tapping height information are ensured.

[0352] In an implementable solution, the image acquisition module 82 includes a 2D camera.

[0353] In this solution, by collecting the target image of the workpiece to be tapped through the 2D camera, the accuracy and reliability of the target image are ensured.

[0354] In addition, the tapping system further includes a camera calibration kit. The camera calibration kit is used to calibrate the 2D camera and the reference positioning element. The reference positioning element can be a hole.

[0355] During operation, the camera calibration kit is used to calibrate the pose of the camera and the reference positioning element. If the types of the reference positioning elements are the same, the calibration work only needs to be carried out once, and there is no need to recalibrate for different workpieces or when the robot is moved to other positions for use. The same type means that the shapes of the reference positioning elements are the same, and the shapes include circles, rectangles, etc.

[0356] If there is only one camera fixedly installed on the robot, place the camera calibration kit on the ground or a fixed position where there is sufficient margin in all directions of the robot, perform hand-eye calibration on the camera, calibrate the pose of the camera, and calibrate the reference positioning element. If there are multiple cameras fixedly installed on the bracket structure, the robot will move the camera calibration kit under each camera, calibrate the pose of the camera, and calibrate the reference positioning element. After calibration, obtain the position of the camera relative to the end flange of the robot and the information of the reference positioning element. The information of the reference positioning element includes the reference image of the reference positioning element and the reference height information of the reference positioning element. Comparing the information of the reference positioning element with the target image of the workpiece to be tapped can obtain the tapping height information of the workpiece to be tapped. The above calibration is the preparatory work before positioning, and it can be used all the time after calibration, and there is no need to repeat calibration before the workpiece is replaced.

[0357] The working principle of the tapping system of this embodiment will be described below with specific examples:

[0358] As Figure 20 shown, the tapping gun 84 and the 2D camera 821 are fixedly installed on the robot 83. The host computer 81 drives the robot 83 to move to drive the 2D camera 821 to collect the target image of the workpiece A, send the target image to the positioning device 80, the positioning device 80 outputs the actual position information to the host computer 81, and the host computer 81 generates a driving instruction according to the actual position information, that is, the tapping position information, and sends the driving instruction to the robot 83. The robot 83 moves along the track 87 to the tapping position of the workpiece, and the braking member 88 fixes the robot 83 on the track 87. The servo motor 843 drives the propulsion shaft 842 to move along the sliding sleeve 841 to drive the tap 844 to perform tapping. After tapping a hole of the workpiece, the host computer 81 judges whether the tap needs to be replaced for the next hole position. When the tap needs to be replaced, the tap is replaced from the tap library 86 through the clamping mechanism 845 to complete the tapping of the next hole position, and so on, to complete the tapping work of the entire workpiece.

[0359] In this embodiment, the target image of the workpiece to be tapped is collected by the image acquisition module, and then the tapping position information is obtained and sent to the host computer, so that the host computer sends a driving instruction to the robot to drive the robot to drive the tapping gun to perform tapping, realizing the automatic positioning of the workpiece, improving the production efficiency, ensuring the positioning accuracy and processing quality of the workpiece, and reducing the cost.

[0360] Embodiment 4

[0361] Figure 14Schematic diagram of a structure of an electronic device shown in an exemplary embodiment of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and configured to run on the processor. When the processor executes the computer program, the positioning method of the workpiece described in any of the above embodiments is implemented. Figure 14 The electronic device 90 shown is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.

[0362] As Figure 14 shown, the electronic device 90 may be presented in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one of the above-mentioned processors 91, at least one of the above-mentioned memories 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0363] The bus 93 includes a data bus, an address bus, and a control bus.

[0364] The memory 92 may include volatile memory, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.

[0365] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924. Such program modules 924 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0366] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the positioning method of the workpiece provided in any of the above embodiments.

[0367] The electronic device 90 may also communicate with one or more external devices 94 (such as a keyboard, a pointing device, etc.). Such communication may be performed through an input / output (I / O) interface 95. In addition, the electronic device 90 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 96. As shown in the figure, the network adapter 96 communicates with other modules of the electronic device 90 through the bus 93. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0368] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described units / modules can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.

[0369] Embodiment 5

[0370] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the workpiece positioning method provided in any one of the above embodiments.

[0371] Among them, the more specific computer-readable storage medium that can be adopted may include but is not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0372] Embodiment 6

[0373] The embodiments of the present disclosure also provide a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the workpiece positioning method described in any one of the above.

[0374] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0375] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Without departing from the principles and essence of the present disclosure, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A positioning method for a workpiece, characterized in that, The workpiece includes a number of first positioning elements, and the positioning method includes: Obtaining first position information corresponding to the first positioning elements; Obtaining a three-dimensional model corresponding to the workpiece, where the three-dimensional model includes target positioning points and second positioning elements corresponding to the first positioning elements; Obtaining a first position information set; Wherein, the first position information set includes several groups of first position information pairs, and each group of the first position information pairs includes the first position information and second position information corresponding to the second positioning element; Based on the first position information set, obtaining a target conversion coefficient between the first position information and the second position information; Based on the target conversion coefficient and target position information corresponding to the target positioning point, obtaining actual position information of an actual positioning point on the workpiece corresponding to the target positioning point.

2. The positioning method of the workpiece according to claim 1, characterized in that, Before the step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set, it further includes: Modifying the first position information set; The step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set includes: Based on the modified first position information set, obtaining the target conversion coefficient.

3. The positioning method of the workpiece according to claim 2, characterized in that, The step of modifying the first position information set includes: Based on the first position information set, obtaining a first initial conversion coefficient for converting from the second position information to the first position information; Based on the first initial conversion coefficient, obtaining third position information corresponding to the second position information in several groups of the first position information pairs; Obtaining a first actual distance between the third position information and the corresponding first position information; Based on the first actual distance, modifying the first position information set.

4. The positioning method of the workpiece according to claim 2, characterized in that, The step of modifying the first position information set includes: Based on the first position information set, obtaining a second initial conversion coefficient for converting from the first position information to the second position information; Based on the second initial conversion coefficient, obtaining fourth position information corresponding to the first position information in several groups of the first position information pairs; Obtaining a second actual distance between the second position information and the corresponding fourth position information; Based on the second actual distance, modifying the first position information set.

5. The positioning method of the workpiece according to claim 3, characterized in that, The step of modifying the first position information set based on the first actual distance includes: In response to the first actual distance being greater than a preset distance, deleting the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set.

6. The positioning method of the workpiece according to claim 3, characterized in that The step of modifying the first position information set based on the first actual distance includes: Obtaining a target quantity of second position information pairs in a second position information set; Among them, the second position information set includes several groups of second position information pairs, each group of the second position information pairs includes the third position information and the corresponding first position information, and the target quantity is the quantity of the second position information pairs in which the first actual distance between the third position information and the first position information is greater than a preset distance; Based on the target quantity, the first position information set is changed.

7. The positioning method of the workpiece according to claim 6, characterized in that, The step of changing the first position information set based on the target quantity includes: In response to the target quantity being less than a preset quantity, delete the first position information pair where the first position information corresponding to the first actual distance greater than the preset distance is located from the first position information set; In response to the target quantity being not less than the preset quantity, determine that the workpiece does not match the three-dimensional model, and obtain a new three-dimensional model to change the first position information set.

8. The positioning method of the workpiece according to claim 1, characterized in that, The step of obtaining the target conversion coefficient between the first position information and the second position information based on the first position information set includes: Using the least squares method, based on the first position information set, to obtain the target conversion coefficient.

9. The positioning method of the workpiece according to claim 8, characterized in that, The target conversion coefficient includes a target rotation coefficient and a target translation coefficient, and the calculation formula corresponding to the step of using the least squares method, based on the first position information set, to obtain the target conversion coefficient is as follows: ; Among them, represents a preset error value between the first position information and the second position information, N represents the actual number of the first position information pairs in the first position information set, d i represents the i-th first position information, m i represents the i-th second position information, R represents the target rotation coefficient, and P represents the target translation coefficient.

10. The positioning method of the workpiece according to any one of claims 1-9, characterized in that, The step of obtaining the first position information corresponding to the first positioning element includes: Based on the second position information, drive an image acquisition device to acquire a target image corresponding to the first positioning element; Based on the target image, obtain the first position information.

11. The positioning method of the workpiece according to claim 10, characterized in that, The first position information includes target height information, and the step of obtaining the first position information based on the target image includes: Obtain the pixel ratio between the target image and a reference image; Among them, the reference image is an image corresponding to a reference positioning element acquired by the image acquisition device; Based on the pixel ratio and the reference height information corresponding to the reference image, obtain the target height information; and / or The first positioning element includes a positioning hole.

12. A positioning device for a workpiece, characterized in that, The workpiece includes several first positioning elements, and the positioning device includes: A first position acquisition module, configured to acquire the first position information corresponding to the first positioning element; A model acquisition module, configured to acquire a three-dimensional model corresponding to the workpiece, where the three-dimensional model includes a target positioning point and a second positioning element corresponding to the first positioning element; An information set acquisition module, configured to acquire a first position information set; Among them, the first position information set includes several groups of first position information pairs, each group of the first position information pairs includes the first position information and the second position information corresponding to the second positioning element; A coefficient acquisition module, configured to obtain a target conversion coefficient between the first position information and the second position information based on the first position information set; A second position acquisition module, configured to obtain the actual position information of the actual positioning point on the workpiece corresponding to the target positioning point based on the target conversion coefficient and the target position information corresponding to the target positioning point.

13. A tapping system, characterized in that, The tapping system includes a positioning device for the workpiece as described in claim 12; The tapping system further includes a host computer, an image acquisition module, a robot, and a tapping gun; The host computer is communicatively connected to the image acquisition module, the robot, and the tapping gun respectively; The image acquisition module is communicatively connected to the positioning device; The tapping gun is fixedly arranged on the robot; The image acquisition module is configured to acquire a target image of the workpiece to be tapped and send the target image to the positioning device; The positioning device is configured to output the actual position information to the host computer based on the target image; The host computer is configured to send a driving instruction to the robot based on the actual position information to drive the robot to drive the tapping gun to perform tapping.

14. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and configured to run on the processor, characterized in that, When the processor executes the computer program, it implements the workpiece positioning method according to any one of claims 1-11.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the workpiece positioning method according to any one of claims 1-11.

16. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the workpiece positioning method as described in any one of claims 1-11.