Workpiece positioning method, device, equipment and storage medium
By obtaining the theoretical model points and actual points of the workpiece, determining the datum transformation matrix and optimizing the target transformation matrix, the problem of low workpiece positioning accuracy in the past was solved, and high-precision workpiece positioning and processing were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2026-03-27
AI Technical Summary
Existing workpiece positioning methods have low accuracy and are difficult to meet the requirements of high-precision machining.
By acquiring the theoretical model points and actual points of the workpiece, the datum transformation matrix is determined, and the target transformation matrix is adjusted by optimizing the geometric difference until the error is within the preset range, thereby improving the positioning accuracy.
It improves the positioning accuracy and machining accuracy of the workpiece in the machine tool coordinate system, thereby enhancing the machining quality.
Smart Images

Figure CN117549140B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of processing, and particularly relates to a positioning method, device and equipment of a workpiece and a storage medium. BACKGROUND
[0002] In modern industrial production, a numerical control machine tool has become an important processing equipment. Compared with traditional manual processing, the numerical control machine tool can realize high-precision, high-efficiency and automatic production, and can improve production efficiency and product quality. In the process of processing, the processing position of a workpiece needs to be positioned. The current positioning method positions the processing position of the workpiece manually, and the positioning precision is low. SUMMARY
[0003] Embodiments of the application provide a positioning method, device and equipment of a workpiece and a storage medium, which can improve positioning precision.
[0004] In a first aspect, embodiments of the application provide a positioning method of a workpiece, and the positioning method comprises the following steps.
[0005] Obtaining model points and sampling points, the model points being points of a theoretical model of the workpiece, and the sampling points being points on the workpiece corresponding to the model points;
[0006] Determining a reference conversion matrix according to all the model points and the corresponding sampling points;
[0007] Determining geometric difference values of geometric quantities of all the model points and the corresponding sampling points;
[0008] Determining a target conversion matrix according to all the model points and all the sampling points, the target conversion matrix being used to convert points of the theoretical model into points of the workpiece in a machine tool coordinate system;
[0009] If an error of the target conversion matrix relative to the reference conversion matrix is out of a preset range, removing the model points and the sampling points corresponding to the maximum or minimum geometric difference value, and re-determining the target conversion matrix based on the remaining model points and sampling points, until the error of the re-determined target conversion matrix relative to the reference conversion matrix is within the preset range.
[0010] In a second aspect, embodiments of the application provide a positioning device of a workpiece, and the positioning device comprises the following.
[0011] A point obtaining module is configured to obtain model points and sampling points, the model points being points of a theoretical model of the workpiece, and the sampling points being points on the workpiece corresponding to the model points;
[0012] a reference matrix determination module configured to determine a reference conversion matrix according to all the model points and corresponding sampling points;
[0013] a geometry difference determination module configured to determine geometry differences between geometry quantities of all the model points and corresponding sampling points;
[0014] a target matrix determination module configured to determine a target conversion matrix according to all the model points and all the sampling points, the target conversion matrix being used to convert points of the theoretical model into points of a machine tool coordinate system in which the workpiece is located;
[0015] an optimization module configured to, if an error of the target conversion matrix relative to the reference conversion matrix exceeds a preset range, remove a model point and a sampling point corresponding to a maximum or minimum geometry difference, and determine a target conversion matrix again based on remaining model points and sampling points until an error of the target conversion matrix relative to the reference conversion matrix is within the preset range.
[0016] In a third aspect, an embodiment of the present application provides a processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the positioning method in any one of the first aspect when executing the computer program.
[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executable on a processor to implement the positioning method in any one of the first aspect.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, and when the computer program product is executed on a terminal device, the terminal device executes the positioning method in any one of the first aspect.
[0019] The embodiment of the present application has the following beneficial effects:
[0020] The reference conversion matrix is determined according to all the model points and corresponding sampling points, the geometry differences between geometry quantities of all the model points and corresponding sampling points are determined, the target conversion matrix is determined according to all the model points and all the sampling points, if an error of the target conversion matrix relative to the reference conversion matrix exceeds a preset range, the model point and the sampling point corresponding to the maximum or minimum geometry difference are removed, the target conversion matrix is determined again based on the remaining model points and sampling points, until an error of the target conversion matrix relative to the reference conversion matrix is within the preset range, the conversion error of the points of the theoretical model converted into the points of the workpiece in the machine tool coordinate system is reduced, and the positioning accuracy is improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0022] Figure 1 is a flowchart of a positioning method of a workpiece provided by an embodiment of the present application;
[0023] Figure 2 is a flowchart of a positioning method of a workpiece provided by another embodiment of the present application;
[0024] Figure 3 is a flowchart of step A2 of a positioning method of a workpiece provided by an embodiment of the present application;
[0025] Figure 4 is a flowchart of step A21 of a positioning method of a workpiece provided by an embodiment of the present application;
[0026] Figure 5 is a flowchart of step A211 of a positioning method of a workpiece provided by an embodiment of the present application;
[0027] Figure 6 is a flowchart of step A23 of a positioning method of a workpiece provided by an embodiment of the present application;
[0028] Figure 7 is a structural diagram of a positioning device of a workpiece provided by an embodiment of the present application;
[0029] Figure 8 is a structural diagram of a positioning device of a workpiece provided by another embodiment of the present application;
[0030] Figure 9 is a structural diagram of a reference matrix determination module of a positioning device of a workpiece provided by an embodiment of the present application;
[0031] Figure 10 is a structural diagram of a conversion matrix acquisition sub-module of a positioning device of a workpiece provided by an embodiment of the present application;
[0032] Figure 11 is a structural diagram of a first conversion matrix determination unit of a positioning device of a workpiece provided by an embodiment of the present application;
[0033] Figure 12 is a structural diagram of a matrix determination sub-module of a positioning device of a workpiece provided by an embodiment of the present application;
[0034] Figure 13 is a structural schematic diagram of a processing equipment provided by an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the technical problems to be solved by the present application, technical solutions and beneficial effects clearer, the following will be further described in detail in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application. Figures 1 to 13 and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0036] In the following description, specific details are set forth in order to provide a thorough understanding of embodiments of the application. However, persons of ordinary skill in the art will appreciate that embodiments of the application can be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the application.
[0037] It should be understood that the term "comprising" as used in the specification and the appended claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0038] It should also be understood that the term "and / or" as used herein refers to any combination of associated listed items, and all possible combinations, and includes these combinations.
[0039] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "once" or "in response to a determination" or "in response to a detection" depending on the context. Similarly, the phrase "if determined" or "if detected [the described condition or event]" can be interpreted to mean "once determined" or "in response to a determination" or "once detected [the described condition or event]" or "in response to a detection [the described condition or event]" depending on the context.
[0040] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0041] Reference within the specification of this application to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places within specified
[0042] Embodiments of the application provide a method for positioning a workpiece, which is used for accurately positioning a workpiece by a machining device (such as a numerical control machine tool) so as to accurately machine the workpiece (especially a workpiece with a curved surface) to improve machining quality.
[0043] Figure 1 is a flowchart of the method for positioning a workpiece provided by an embodiment of the application. Referring to Figure 1 Embodiments of the application provide a method for positioning a workpiece, which is used for accurately positioning a workpiece by a machining device (such as a numerical control machine tool) so as to accurately machine the workpiece (especially a workpiece with a curved surface) to improve machining quality.
[0044] Step A1, acquiring model points and sampling points.
[0045] The model points are points of a theoretical model of the workpiece. The theoretical model can be a computer-aided design three-dimensional model or a virtual reality model of the workpiece. The model points can be key feature points of the theoretical model.
[0046] The sampling points are points on the workpiece corresponding to the model points. The sampling points are points of the workpiece in the machine tool coordinate system.
[0047] The number of the model points is multiple. Since the sampling points correspond to the model points, the number of the sampling points is the same as the number of the model points.
[0048] Step A2, determining a reference conversion matrix according to all the model points and the corresponding sampling points.
[0049] One or more conversion matrices can be determined according to all the model points and the corresponding sampling points. The conversion matrix is used to convert a point of the theoretical model into a point of the workpiece in the machine tool coordinate system.
[0050] One conversion matrix can be determined as the reference conversion matrix from all the conversion matrices. The reference conversion matrix is a reference for measuring conversion errors of the conversion matrices.
[0051] Step A3, determining geometric differences between geometric quantities of all the model points and geometric quantities of the corresponding sampling points.
[0052] The geometric quantity can be a distance, an angle, or other quantity. Correspondingly, the geometric difference can be a distance difference, an angle difference, or other difference.
[0053] For example, the distance MM between a certain point M of the sampling points and an arbitrary point M of the theoretical model of the workpiece is calculated. i i The distance PP between a certain point P of the sampling points and an arbitrary point P of the workpiece is calculated. i i The difference |MM-PP| between the two distances is calculated. i i
[0054] For example, the centroids P and M of the sampling points and the model points are calculated, and the angle ∠M between the line segment MM and the line segment connecting a certain point M of the model points and an arbitrary point M of the theoretical model of the workpiece is calculated. cen cen i cen i MM cen ; similarly, the angle ∠P between the line segment PP and the line segment connecting a certain point P of the sampling points and an arbitrary point P of the workpiece is calculated. i cen i PP cen The difference |∠M-∠P| between the two angles is calculated. i cen i cen
[0055] Step A4: determining a target transformation matrix based on all the model points and all the sampling points.
[0056] The target transformation matrix is used to transform the points of the theoretical model into the points of the workpiece in the machine tool coordinate system.
[0057] There are various methods for determining the target transformation matrix, such as singular value decomposition method, least squares method, or iterative nearest point method.
[0058] Step A5: if the error of the target transformation matrix relative to the reference transformation matrix exceeds the preset range, the model point and the sampling point corresponding to the largest or smallest geometric difference are removed, and the target transformation matrix is determined again based on the remaining model points and sampling points, until the error of the re-determined target transformation matrix relative to the reference transformation matrix is within the preset range.
[0059] If the error of the target transformation matrix relative to the reference transformation matrix exceeds the preset range, it indicates that the conversion error of the target transformation matrix is large, and the error does not meet the requirements.
[0060] Since the target conversion matrix is determined based on the model points and the sampling points, the model points and the sampling points corresponding to the maximum or minimum geometric difference value can be removed, so as to eliminate the errors caused by these points to the conversion.
[0061] Specifically, the model points and the sampling points corresponding to the maximum or minimum geometric difference value can be removed in the following manner.
[0062] For each distance difference |MM i -PP i |, summing up.
[0063] Length=Σ(|MM i -PP i |)
[0064] The sum Length of each distance difference is sorted to obtain a distance difference sum sorting.
[0065] For each angle difference |∠M i MM cen -∠P i PP cen |, summing up.
[0066] Angel=Σ(|∠M i MM cen -∠P i PP cen |)
[0067] The sum Angel of each angle difference is sorted to obtain an angle difference sum sorting.
[0068] The sorting of the two sets of difference sums (i.e., the distance difference sum sorting and the angle difference sum sorting) is assigned a score from 1 to n according to the numerical value (e.g., from small to large). The score obtained by each model point is added to the score obtained by the corresponding sampling point and sorted (e.g., from large to small). The point corresponding to the smaller total score has a larger difference sum, so the model point and the sampling point corresponding to the largest difference sum can be removed.
[0069] After the removal of the model points and the sampling points, the target conversion matrix is determined again based on the remaining model points and the sampling points, which is conducive to determining a conversion matrix with a relatively small conversion error, until the error of the re-determined target conversion matrix relative to the reference conversion matrix is within a preset range.
[0070] After the final target conversion matrix is determined, the points of the theoretical model are converted to the machine tool coordinate system through the target conversion matrix, the obtained mapping points are compared with the sampling points, the sampling points are adjusted to achieve optimization of the sampling points, and a higher-precision machined part can be obtained. Of course, the points of the theoretical model can also be converted to the machine tool coordinate system through the target conversion matrix, and then the workpiece is machined based on the obtained mapping points, so that the machining precision can be improved.
[0071] According to the above, the reference conversion matrix is determined according to all the model points and the corresponding sampling points, the geometric difference between the geometric quantity of all the model points and the geometric quantity of the corresponding sampling points is determined, the target conversion matrix is determined according to all the model points and all the sampling points, if the error of the target conversion matrix relative to the reference conversion matrix exceeds the preset range, the model point and the sampling point corresponding to the maximum or minimum geometric difference are removed, the target conversion matrix is determined again based on the remaining model points and sampling points, and the error of the conversion of the points of the theoretical model to the points of the workpiece in the machine tool coordinate system is reduced, the positioning precision is improved, the machining precision is improved, and the machining quality is improved.
[0072] Figure 2 is a flowchart of a positioning method of a workpiece provided by another embodiment of the application. Referring to Figure 2 The positioning method can further include step B1.
[0073] In step B1, if the error of the target conversion matrix relative to the reference conversion matrix is within the preset range, the target conversion matrix is determined as the final target conversion matrix.
[0074] If the error of the target conversion matrix relative to the reference conversion matrix is within the preset range, it indicates that the error meets the requirements and can be used as the final target conversion matrix, so that higher positioning precision can be achieved.
[0075] Figure 3 is a flowchart of step A2 of a positioning method of a workpiece provided by an embodiment of the application. Referring to Figure 3 Step A2 (determining the reference conversion matrix according to all the model points and the corresponding sampling points) can include steps A21 to A23.
[0076] In step A21, a plurality of candidate conversion matrices are obtained.
[0077] The candidate conversion matrix is used to convert the points of the theoretical model to the points of the workpiece in the machine tool coordinate system. As described above, the model points are the points of the theoretical model of the workpiece, and the sampling points are the points of the workpiece in the machine tool coordinate system, so the candidate conversion matrix is determined through the model points and the sampling points. Each group of model points and the corresponding sampling points corresponds to a candidate conversion matrix.
[0078] The plurality of candidate conversion matrices are obtained for subsequent determination of the reference conversion matrix therefrom.
[0079] Step A22, converting the model points to mapped points in the machine tool coordinate system according to the candidate conversion matrices.
[0080] The model points are points of a theoretical model. The coordinate system in which the points of the theoretical model are located is different from the machine tool coordinate system. All the model points can be converted to the machine tool coordinate system by the candidate conversion matrices, and the obtained points are the mapped points of the model points in the machine tool coordinate system. Each model point corresponds to a mapped point in the machine tool coordinate system.
[0081] Step A23, determining the reference conversion matrix from all the candidate conversion matrices according to all the sampling points and the corresponding mapped points.
[0082] In an ideal case, the points obtained by converting the model points to the machine tool coordinate system should coincide with the corresponding sampling points, i.e., the mapped points coincide with the corresponding sampling points. According to the coincidence degree of the sampling points and the corresponding mapped points in the machine tool coordinate system, the reference conversion matrix can be determined from all the candidate conversion matrices. Specifically, the candidate conversion matrix corresponding to the sampling point and the mapped point with the highest coincidence degree is determined as the reference conversion matrix, so that the reference conversion matrix with the smallest conversion error can be obtained.
[0083] Figure 4 is a flowchart of step A21 of the workpiece positioning method provided in an embodiment of the present application. Referring to Figure 4 The above step A21 (obtaining a plurality of candidate conversion matrices) can include steps A211 to A213.
[0084] Step A211, determining a first conversion matrix according to all the model points and the corresponding sampling points by using a first mode.
[0085] There are many modes for determining the first conversion matrix (i.e., the first mode), such as singular value decomposition method, least square method or iterative closest point method.
[0086] Figure 5 is a flowchart of step A211 of the workpiece positioning method provided in an embodiment of the present application. Referring to Figure 5 The above step A211 (determining a first conversion matrix according to all the model points and the corresponding sampling points by using a first mode) can include steps A2111 to A2116.
[0087] Step A2111, grouping every P model points as a group and grouping every P sampling points as a group.
[0088] P is an integer greater than or equal to 3. Taking P equal to 3 as an example for illustration.
[0089] Suppose the number of model points taken is n (n is a positive integer), since the model points and the sampling points are corresponding, the number of sampling points is also n. The number of groups of model points is The number of groups of sampling points is also
[0090] Step A2112, determine the center of each group of model points, and determine the center of each group of sampling points.
[0091] Each group of model points has at least 3 points, so a center can be determined. Each group of sampling points also has at least 3 points, so a center can also be determined.
[0092] Step A2113, obtain the model point translation and the sampling point translation.
[0093] The model points and the sampling points are points in different coordinate systems. The model points and the sampling points are translated to the same coordinate system (referred to as a specified coordinate system). The model point translation is the translation of the center of each group of model points to the origin of the specified coordinate system. The sampling point translation is the translation of the center of each group of sampling points to the origin. The specified coordinate system can be a machine tool coordinate system, a world coordinate system, or other coordinate systems.
[0094] Step A2114, obtain the model normal rotation angle and the sampling normal rotation angle.
[0095] As mentioned above, each group of model points has at least 3 points, so a plane can be determined, and a normal vector can also be determined. Each group of sampling points also has at least 3 points, so a plane can be determined, and a normal vector can also be determined.
[0096] The model normal rotation angle is the angle of rotation of the normal vector of each group of model points to parallel with the specified axis (such as the Y axis) of the specified coordinate system (such as the machine tool coordinate system).
[0097] The sampling normal rotation angle is the angle of rotation of the normal vector of each group of sampling points to parallel with the specified axis (such as the Y axis).
[0098] Step A2115, obtain the face rotation angle.
[0099] The face rotation angle is the angle of rotation of the face (such as the plane) determined by each group of model points around the specified axis (such as the Y axis) to make each group of model points coincide with the corresponding sampling points.
[0100] Alternatively, the face rotation angle is the angle of rotation of the face (such as the plane) determined by each group of sampling points around the specified axis (such as the Y axis) to make each group of model points coincide with the corresponding sampling points.
[0101] Based on the above, in order to make each group of model points coincide with the corresponding sampling points, the face determined by each group of model points can be rotated around a specified axis (such as the Y axis), and the face determined by each group of sampling points can also be rotated around a specified axis (such as the Y axis).
[0102] Step A2116, determine the first conversion matrix according to the model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle.
[0103] After obtaining the model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle, the model point is translated by the model point translation amount, rotated by the model normal rotation angle, rotated by the face rotation angle, then reversely rotated by the sampling normal rotation angle, and then translated by the sampling point translation amount, so that the coordinates of the model point in the machine tool coordinate system can be obtained, which are the mapping points of the model point in the machine tool coordinate system.
[0104] After obtaining the mapping points of the model point in the machine tool coordinate system, error analysis is performed on the mapping points and the corresponding sampling points (such as analyzing whether the distance between the mapping points and the corresponding sampling points meets a preset condition).
[0105] Specifically, if the mapping points of the model point in the machine tool coordinate system are close to the corresponding sampling points, it indicates that the conversion error is small (the error meets the preset condition), and the model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle obtained in the foregoing meet the requirements.
[0106] Since the conversion of the model point to the machine tool coordinate system involves translation and rotation, the model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle obtained in the foregoing can determine the conversion matrix, i.e., the first conversion matrix.
[0107] If the mapping points of the model point in the machine tool coordinate system are far away from the corresponding sampling points, it indicates that the conversion error is large (the error does not meet the preset condition), and the positions (specifically, the coordinates) of the sampling points need to be adjusted. The model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle are re-determined according to the model point and the adjusted sampling points, until the mapping points of the model point in the machine tool coordinate system are close to the corresponding sampling points, so that the conversion error is small (the error meets the preset condition), and then the conversion matrix, i.e., the first conversion matrix, can be determined according to the re-determined model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle.
[0108] The above method of determining the first conversion matrix can guarantee the accuracy of the conversion and prevent conversion errors.
[0109] Step A212, according to all the model points and corresponding sampling points, determine the second conversion matrix by a second method.
[0110] The second method can be singular value decomposition, least square method or iterative nearest point method.
[0111] The above step A212 (determine the second conversion matrix by a second method according to all the model points and corresponding sampling points) is specifically: according to all the model points and corresponding sampling points, determine the second conversion matrix by singular value decomposition.
[0112] Determine the centroid of the model points and the centroid of the sampling points.
[0113] centroid (M) = (1 / n) * ΣMi
[0114] centroid (p) = (1 / n) * Σpi
[0115] Wherein, centroid (M) is the centroid of the model points, Mi is the model point, centroid (p) is the centroid of the sampling points, and pi is the sampling point.
[0116] Determine the centralized coordinates of the model points and the decentralized coordinates of the sampling points.
[0117] Mi' = Mi - centroid (M)
[0118] pi' = pi - centroid (p)
[0119] Mi' is the centralized coordinates of the model points, and pi' is the decentralized coordinates of the sampling points.
[0120] Determine the covariance matrix.
[0121] H = ΣMi' * (pi')^T
[0122] H is the covariance matrix.
[0123] Singular value decomposition (SVD) is performed on the covariance matrix to obtain singular value decomposition.
[0124] H = U * S * V^T
[0125] Wherein, U and V are orthogonal matrices, and S is a diagonal matrix.
[0126] Determine the rotation matrix and the translation vector.
[0127] R = V * U^T
[0128] t = centroid(M) - R * centroid(p)
[0129] where R is a rotation matrix and t is a translation vector.
[0130] The rotation matrix and the translation vector are combined into a transformation matrix.
[0131] Ti = [R | t] [0 0 0 1]
[0132] where Ti is the transformation matrix, i.e., the second transformation matrix.
[0133] The second transformation matrix obtained by singular value decomposition has high conversion accuracy.
[0134] Step A213, determining a plurality of candidate transformation matrices from the first transformation matrix and the second transformation matrix.
[0135] The first transformation matrix and the second transformation matrix are compared to determine the correct candidate transformation matrix.
[0136] In an example, the first transformation matrix obtained by steps A2111 to A2116 has high conversion accuracy, the second transformation matrix obtained by singular value decomposition has high conversion accuracy, and the first transformation matrix and the second transformation matrix are compared, which can avoid conversion errors and improve conversion accuracy.
[0137] Figure 6 is a flowchart of step A23 of the workpiece positioning method provided by an embodiment of the present application. Referring to Figure 6 , the above step A23 (determining a reference transformation matrix from all candidate transformation matrices according to all sampling points and corresponding mapping points) can include steps A231 to A232.
[0138] Step A231, determining a geometric relationship value of the sampling point and the corresponding mapping point.
[0139] For all candidate transformation matrices, the model points are matrix transformed by using the corresponding candidate transformation matrix to convert the model points to the machine tool coordinate system, the corresponding mapping points are obtained, and the geometric relationship value (such as distance or angle) between each sampling point and the corresponding mapping point is determined by using the point-to-point correspondence (i.e., each mapping point corresponds to a sampling point).
[0140] Since each candidate transformation matrix corresponds to a plurality of model points, it also corresponds to a plurality of mapping points. Then, the geometric relationship value corresponding to each candidate transformation matrix is the sum of a plurality of distances or a plurality of angles.
[0141] Step A232, taking the candidate transformation matrix corresponding to the minimum or maximum geometric relationship value as the reference transformation matrix.
[0142] The conversion error of the candidate conversion matrix corresponding to the minimum or maximum geometric relation value is minimum, and can be used as the reference conversion matrix.
[0143] Whether the conversion error of the candidate conversion matrix corresponding to the minimum geometric relation value is minimum or the conversion error of the candidate conversion matrix corresponding to the maximum geometric relation value is minimum is determined by the specific type of the geometric relation. When the geometric relation is distance, the conversion error of the candidate conversion matrix corresponding to the minimum distance is minimum.
[0144] The method provided by the embodiment of the present application is a positioning method suitable for processing a three-dimensional curved surface workpiece, and can make the final processing point (i.e., the point of the theoretical model converted to the coordinate of the machine tool coordinate system through the target conversion matrix, which is also called the mapping point) approach the position of the actual processing point (i.e., the sampling point), thereby improving the positioning accuracy of the three-dimensional curved surface workpiece and improving the product quality.
[0145] Corresponding to the method described in the above embodiment, FIG. 7 shows a structural block diagram of the workpiece positioning device provided by the embodiment of the present application. For ease of illustration, only the parts related to the embodiment of the present application are shown.
[0146] Reference Figure 7 The workpiece positioning device provided by the embodiment of the present application includes a point acquisition module 1A, a reference matrix determination module 2A, a geometric difference determination module 3A, a target matrix determination module 4A, and an optimization module 5A.
[0147] The point acquisition module 1A is configured to acquire model points and sampling points.
[0148] The model points are the points of the theoretical model of the workpiece, and the sampling points are the points on the workpiece corresponding to the model points.
[0149] The reference matrix determination module 2A is configured to determine the reference conversion matrix according to all the model points and the corresponding sampling points.
[0150] The geometric difference determination module 3A is configured to determine the geometric differences between all the model points and the corresponding sampling points.
[0151] The target matrix determination module 4A is configured to determine the target conversion matrix according to all the model points and all the sampling points.
[0152] The target conversion matrix is used to convert the points of the theoretical model to the points of the machine tool coordinate system in which the workpiece is located.
[0153] The optimization module 5A is configured to: if the error of the target conversion matrix relative to the reference conversion matrix exceeds a preset range, remove the model points and the sampling points corresponding to the largest or smallest geometric difference, and re-determine the target conversion matrix based on the remaining model points and sampling points until the error of the re-determined target conversion matrix relative to the reference conversion matrix is within the preset range.
[0154] Figure 8 FIG. 1 is a structural schematic diagram of a positioning device for a workpiece according to an embodiment of the present application. As shown in FIG. 1, the positioning device comprises a reference matrix determination module 2A and a target conversion matrix determination module 1B. Figure 8 The target conversion matrix determination module 1B can further comprise an optimization module 5A.
[0155] The target conversion matrix determination module 1B is configured to: if the error of the target conversion matrix relative to the reference conversion matrix is within a preset range, determine the target conversion matrix as a final target conversion matrix.
[0156] Figure 9 FIG. 2 is a structural schematic diagram of a reference matrix determination module of a positioning device for a workpiece according to an embodiment of the present application. As shown in FIG. 2, the reference matrix determination module 2A comprises a conversion matrix acquisition sub-module 21A, a point conversion sub-module 22A, and a matrix determination sub-module 23A. Figure 9 The reference matrix determination module 2A can comprise a conversion matrix acquisition sub-module 21A, a point conversion sub-module 22A, and a matrix determination sub-module 23A.
[0157] The conversion matrix acquisition sub-module 21A is configured to: acquire a plurality of candidate conversion matrices.
[0158] The point conversion sub-module 22A is configured to: convert the model points into mapping points in the machine tool coordinate system according to the candidate conversion matrices.
[0159] The matrix determination sub-module 23A is configured to: determine the reference conversion matrix from all the candidate conversion matrices according to all the sampling points and the corresponding mapping points.
[0160] Figure 10 FIG. 3 is a structural schematic diagram of a conversion matrix acquisition sub-module of a positioning device for a workpiece according to an embodiment of the present application. As shown in FIG. 3, the conversion matrix acquisition sub-module 21A comprises a first conversion matrix determination unit 211A, a second conversion matrix determination unit 212A, and a candidate conversion matrix determination unit 213A. Figure 10 The conversion matrix acquisition sub-module 21A can comprise a first conversion matrix determination unit 211A, a second conversion matrix determination unit 212A, and a candidate conversion matrix determination unit 213A.
[0161] The first conversion matrix determination unit 211A is configured to: determine a first conversion matrix in a first manner according to all the model points and the corresponding sampling points.
[0162] The second conversion matrix determination unit 212A is configured to: determine a second conversion matrix in a second manner according to all the model points and the corresponding sampling points.
[0163] The candidate conversion matrix determination unit 213A is configured to determine a plurality of candidate conversion matrices from the first conversion matrix and the second conversion matrix.
[0164] Figure 11 is a structural schematic diagram of a first conversion matrix determination unit of a workpiece positioning device provided in an embodiment of the present application. Referring to Figure 11 The first conversion matrix determination unit 211A can include a point grouping subunit 2111A, a circle center determination subunit 2112A, a translation amount acquisition subunit 2113A, a normal rotation angle acquisition subunit 2114A, a face rotation angle acquisition subunit 2115A, and a matrix determination subunit 2116A.
[0165] The point grouping subunit 2111A is configured to group every P model points as a group and group every P sampling points as a group.
[0166] P is an integer greater than or equal to 3.
[0167] The circle center determination subunit 2112A is configured to determine the circle center of each group of model points and determine the circle center of each group of sampling points.
[0168] The translation amount acquisition subunit 2113A is configured to acquire the model point translation amount and the sampling point translation amount.
[0169] The model point translation amount is the translation amount of the circle center of each group of model points to the origin of the specified coordinate system. The sampling point translation amount is the translation amount of the circle center of each group of sampling points to the origin.
[0170] The normal rotation angle acquisition subunit 2114A is configured to acquire the model normal rotation angle and the sampling normal rotation angle.
[0171] The model normal rotation angle is the angle of rotation of the normal vector of each group of model points to parallel with the specified axis of the specified coordinate system. The sampling normal rotation angle is the angle of rotation of the normal vector of each group of sampling points to parallel with the specified axis.
[0172] The face rotation angle acquisition subunit 2115A is configured to acquire the face rotation angle.
[0173] The face rotation angle is the angle of rotation of the face determined by rotating each group of model points around the specified axis to make each group of model points coincide with the corresponding sampling points. Alternatively, the face rotation angle is the angle of rotation of the face determined by rotating each group of sampling points around the specified axis to make each group of model points coincide with the corresponding sampling points.
[0174] The matrix determination subunit 2116A is configured to determine the first conversion matrix according to the model point translation amount, the sampling point translation amount, the model normal rotation angle, the sampling normal rotation angle, and the face rotation angle.
[0175] The second conversion matrix determination unit 212A is specifically configured to determine the second conversion matrix by singular value decomposition according to all the model points and the corresponding sampling points.
[0176] Figure 12 is a structural diagram of a matrix determination sub-module of a workpiece positioning device provided in an embodiment of the present application. Referring to Figure 12 The matrix determination sub-module 23A can include a geometric relationship value determination unit 231A and a matrix determination unit 232A.
[0177] The geometric relationship value determination unit 231A is configured to determine geometric relationship values of the sampling points and the corresponding mapping points.
[0178] The matrix determination unit 232A is configured to take the candidate conversion matrix corresponding to the minimum or maximum geometric relationship value as the reference conversion matrix.
[0179] It should be noted that the information interaction between the above-mentioned devices / units, the execution process, and the like, are based on the same concept as the method embodiments of the present application, and the specific functions and the technical effects brought by them can be referred to the method embodiments part, which will not be described here.
[0180] Figure 13 is a structural diagram of a processing device provided in an embodiment of the present application. As Figure 13 shown, the processing device 13 of this embodiment includes at least one processor 130 Figure 13 only one is shown), a memory 131, and a computer program 132 stored in the memory 131 and executable on the at least one processor 130; the processor 130 implements the steps in each of the above-mentioned method embodiments when executing the computer program 132.
[0181] The processing device 13 can be a numerical control machine tool, a laser processing device, or other processing devices. The processing device can include, but is not limited to, the processor 130 and the memory 131. Those skilled in the art can understand that Figure 13 is only an example of the processing device and does not constitute a limitation on the processing device, and can include more or fewer components than those shown, or combine certain components, or different components, for example, it can also include input / output devices, network access devices, buses, etc.
[0182] The processor 130 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0183] The memory 131 can be an internal storage unit of the processing device 13, such as a hard disk or a memory of the processing device, in some embodiments. The memory 131 can also be an external storage device of the processing device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., in other embodiments. Further, the memory 131 can include both the internal storage unit and the external storage device of the processing device. The memory 131 is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of a computer program, etc. The memory 131 can also be used to temporarily store data that has been output or will be output.
[0184] For example, the computer program 132 can be divided into one or more modules / units, which are stored in the memory 131 and executed by the processor 130 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 132 in the processing device 13.
[0185] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0186] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
[0187] The foregoing integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on such understanding, all or part of the processes in the foregoing embodiment methods can be instructed by a computer program to relevant hardware, and the computer program can be stored in a computer-readable storage medium. When the processor executes the computer program, the steps of each method embodiment can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium includes any entity or device that can carry the computer program code to the device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0188] The embodiment of the application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each method embodiment described above can be implemented.
[0189] The embodiment of the application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in each method embodiment described above.
[0190] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments.
[0191] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0192] In the embodiments provided in the present application, it should be understood that the disclosed apparatuses / devices and methods can be implemented in other ways. For example, the above-described apparatus / device embodiments are merely illustrative, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0193] The units described as separate components in the foregoing can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiments according to actual needs.
[0194] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method of positioning a workpiece, characterized by, The positioning method comprises: acquiring model points and sampling points, the model points being points of a theoretical model of the workpiece, and the sampling points being points on the workpiece corresponding to the model points; determining a reference conversion matrix according to all the model points and the corresponding sampling points; determining geometric difference values of geometric quantities of all the model points and the corresponding sampling points; determining a target conversion matrix according to all the model points and all the sampling points, the target conversion matrix being used to convert points of the theoretical model into points of the workpiece in a machine tool coordinate system; if an error of the target conversion matrix relative to the reference conversion matrix exceeds a preset range, removing the model points and the sampling points corresponding to the maximum or minimum geometric difference value, and redetermining the target conversion matrix based on the remaining model points and sampling points until the error of the redetermined target conversion matrix relative to the reference conversion matrix is within the preset range.
2. The positioning method of claim 1, wherein, The determining of the reference conversion matrix according to all the model points and the corresponding sampling points comprises: acquiring a plurality of candidate conversion matrices; converting the model points into mapping points in the machine tool coordinate system according to the candidate conversion matrices; determining the reference conversion matrix from all the candidate conversion matrices according to all the sampling points and the corresponding mapping points.
3. The positioning method of claim 2, wherein, The determining of the reference conversion matrix from all the candidate conversion matrices according to all the sampling points and the corresponding mapping points comprises: determining geometric relationship values of the sampling points and the corresponding mapping points; taking the candidate conversion matrix corresponding to the minimum or maximum geometric relationship value as the reference conversion matrix.
4. The positioning method of claim 2, wherein, The acquiring of the plurality of candidate conversion matrices comprises: determining a first conversion matrix in a first manner according to all the model points and the corresponding sampling points; determining a second conversion matrix in a second manner according to all the model points and the corresponding sampling points; determining a plurality of candidate conversion matrices from the first conversion matrix and the second conversion matrix.
5. The positioning method of claim 4, wherein, The determining of the first conversion matrix in the first manner according to all the model points and the corresponding sampling points comprises: grouping every P model points into a group and grouping every P sampling points into a group, P being an integer greater than or equal to 3; determining a center of each group of model points and a center of each group of sampling points; acquiring model point translation amounts and sampling point translation amounts, the model point translation amount being a translation amount of the center of each group of model points to an origin of a specified coordinate system, and the sampling point translation amount being a translation amount of the center of each group of sampling points to the origin; acquiring model normal rotation angles and sampling normal rotation angles, the model normal rotation angle being an angle of rotation of a normal vector of each group of model points to parallel with a specified axis of the specified coordinate system, and the sampling normal rotation angle being an angle of rotation of a normal vector of each group of sampling points to parallel with the specified axis; an angle of rotation of a plane determined by rotating each set of model points about the specified axis to coincide with the corresponding set of sample points, or an angle of rotation of a plane determined by rotating each set of sample points about the specified axis to coincide with the corresponding set of model points; determining a first conversion matrix according to the model point translation, the sample point translation, the model normal rotation angle, the sample normal rotation angle, and the plane rotation angle.
6. The positioning method of claim 4, wherein, The second conversion matrix is determined in a second manner according to all the model points and the corresponding sample points, including: The second conversion matrix is determined by singular value decomposition according to all the model points and the corresponding sample points.
7. The positioning method according to any one of claims 1 to 6, characterized in that, The positioning method further includes: If the error of the target conversion matrix relative to the reference conversion matrix is within a preset range, the target conversion matrix is determined as a final target conversion matrix.
8. A positioning device for a workpiece, characterized by, The positioning device includes: a point acquisition module configured to acquire model points and sample points, the model points being points of a theoretical model of the workpiece, and the sample points being points on the workpiece corresponding to the model points; a reference matrix determination module configured to determine a reference conversion matrix according to all the model points and the corresponding sample points; a geometric difference determination module configured to determine geometric differences between geometric quantities of all the model points and geometric quantities of the corresponding sample points; a target matrix determination module configured to determine a target conversion matrix according to all the model points and all the sample points, the target conversion matrix being used to convert the points of the theoretical model into points of a machine tool coordinate system in which the workpiece is located; an optimization module configured to, if the error of the target conversion matrix relative to the reference conversion matrix exceeds a preset range, remove the model points and the sample points corresponding to the largest or smallest geometric difference, and redetermine the target conversion matrix based on the remaining model points and sample points until the error of the redetermined target conversion matrix relative to the reference conversion matrix is within the preset range.
9. A processing apparatus characterized by comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the positioning method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the positioning method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Positioning method and device and vehicle
CN111060126A
Aircraft component machining benchmark determination method
CN113467372A