An Adaptive Localization Method and System for 2D Contour Matching of Blanks Without Feature Constraints
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2026-08-14
AI Technical Summary
1)加工定位可靠性低,毛坯件加工废品率高
本发明实现复杂毛坯的自适应定位,能够准确确定任意装夹于工作台的毛坯的位姿,突破传统方法对毛坯定位特征、回转类或对称类零件的限制,具有广泛的适用性。
Smart Images

Figure CN120411234B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of manufacturing engineering and automation technology, and specifically relates to an adaptive positioning method and system for matching two-dimensional contours of blanks without feature constraints. Background Technology
[0002] Aerospace integral structural components typically have large blank dimensions, complex manufacturing characteristics, and are mostly thin-walled structures. Before CNC machining, the blanks are generally positioned manually using scribing. A scribing tool is used to mark the geometric contours of the part on the blank, and the datum is repeatedly adjusted based on experience to ensure sufficient and evenly distributed allowances in each part. Finally, CNC machining is performed according to the scribing datum. The problems encountered in the positioning process of aerospace integral structural component blanks can be summarized as follows: 1) Low reliability of machining positioning and high scrap rate of blank parts. On the one hand, the production tolerance of integral structural parts blanks obtained by casting or forging is large. Even blanks from the same batch have different actual shapes. The positioning reference features of the blank itself are difficult to use directly, and some parts do not even have geometric features that can be used as references. On the other hand, manual scribing can only verify whether the local allowance is sufficient. If there is a shortage of material in some areas during the blank manufacturing process and it is not detected in advance, the insufficient allowance in some positions will lead to the scrapping of parts.
[0003] 2) Traditional scribing and alignment methods are inefficient and time-consuming. Each surface of the overall structural component blank has a certain amount of machining allowance, making it impossible to directly utilize the design datum. For workpieces with complex process features, to ensure sufficient machining allowance for each feature of the blank, repeated manual adjustments of the positioning datum are necessary. Furthermore, given the large size of the overall structural component, the entire positioning process consumes a significant amount of auxiliary time, severely impacting production efficiency.
[0004] 3) Existing machining positioning methods cannot fully meet the needs of adaptive positioning. Online positioning methods based entirely on machine tool probes are difficult to obtain all the data of the workpiece surface, so they are generally limited to a single type of workpiece. Furthermore, due to the slow measurement speed, positioning of larger workpieces takes a long time. Existing positioning methods based on image processing or 3D scanning mainly focus on the overall matching of blank data, and the integration of allowance optimization and on-machine alignment is not tight.
[0005] Existing patents disclose an adaptive positioning method for femtosecond laser micro-hole machining of complex curved surfaces. This method uses sensors to measure the positions of several feature points on the complex curved surface to form a coordinate transformation matrix, which is then used as a machine tool compensation for laser micro-hole machining. However, this method relies on feature points for positioning, requiring the workpiece to have easily selectable feature points for analysis. Therefore, it is not applicable to complex parts without obvious features. The two-dimensional contour matching adaptive positioning method proposed in this paper, on the other hand, has low requirements for the features of the workpiece being positioned.
[0006] Existing patents disclose an adaptive positioning method for machining rotary parts. This method involves positioning the rotary workpiece, rotating the spindle, selecting key point coordinates and offset angles, and then using an algorithm to calculate the specific position coordinates of each machining hole. However, this method has a relatively narrow focus, primarily targeting rotary parts. In contrast, the method proposed in this paper does not have specific requirements regarding whether the part is rotary.
[0007] Existing patents disclose a freeform surface localization method based on the KNN-ICP algorithm. This method uses the KNN-ICP algorithm as the criterion for determining whether a 3D point cloud is registered, and then employs quaternions to calculate the translational and rotational offsets between the ideal and actual model point clouds, ultimately obtaining the localized coordinates. However, this method directly performs 3D registration on the freeform surface, resulting in a high computational cost. The method proposed in this paper transforms the 3D contour registration problem into a 2D contour registration problem, making it easier to implement.
[0008] In summary, the traditional positioning process for aerospace structural components suffers from low reliability, low efficiency, and high cost. Therefore, ensuring the accurate positioning of the overall structural component blank before CNC machining has become an urgent problem to be solved. Summary of the Invention
[0009] The purpose of this invention is to provide an adaptive positioning method and system for matching two-dimensional contours of blanks without feature constraints, so as to solve the above-mentioned problems.
[0010] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides an adaptive positioning method for matching two-dimensional contours of a blank without feature constraints, comprising: Point cloud data preprocessing and feature surface extraction are performed on the blank and design model respectively; The preprocessed data is used to calculate the margin, and the blank measurement point cloud and the design model point cloud are coarsely and finely registered. The margin is actively allocated through processing margin optimization, and the optimal pose of the blank measurement point cloud and the design model point cloud is obtained. By using the two-dimensional contour matching adaptive positioning of the blank, the translational offset and rotational offset required for positioning are obtained by selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system.
[0011] Optionally, the point cloud data preprocessing and feature surface extraction for the blank and design model respectively includes: Voxel downsampling and farthest-point downsampling algorithms are used to simplify point cloud data and reduce redundant data. After obtaining the simplified point cloud, the point cloud normal vectors are calculated and redirected. The point cloud normal vector calculation method adopts the method of calculating the normal vector by fitting the local surface of the point cloud, using a local surface at a certain point. kThe normal vector of the point is estimated by the normal vector of the neighborhood plane, and the solution is obtained using principal component analysis. k Neighborhood refers to any point in a point cloud. p i Distance point in space p i Recent k A set of points; for the obtained blank measurement point cloud and design model point cloud data, the point cloud feature surface is initially segmented using a random sampling consensus algorithm based on octree units, and then the point cloud feature surface is further segmented using a region growing algorithm.
[0012] Optionally, the step of performing margin calculation on the preprocessed data, coarsely and finely registering the blank measurement point cloud and the design model point cloud, and actively allocating the margin through machining margin optimization to obtain the optimal pose of the blank measurement point cloud and the design model point cloud includes: After preprocessing and feature surface extraction of the blank measurement point cloud and design model point cloud data, the preprocessed normal information and other data are used for allowance calculation, and a correspondence is established for the extracted feature surfaces. A nominal minimum machining allowance is specified for a specific machining surface, and the allowance of the blank machining surface is optimized. Based on the SAC-IA coarse registration of FPFH features, the FPFH features of each point in the blank measurement point cloud and the design model point cloud are solved, and the random sampling consistency principle is applied to match the feature points, so that the two point clouds are initially aligned. At the same time, an improved ICP fine registration algorithm is proposed, and the truncated least squares method is introduced to improve the ICP algorithm. A feature surface correspondence is established between the blank measurement point cloud and the design model point cloud after feature surface extraction, allowance constraints are set, and mathematical models of allowances are established for the plane and other machining surfaces respectively. Allowance optimization is performed by the constraint variance minimization matching algorithm.
[0013] Optionally, the adaptive positioning using two-dimensional contour matching of the blank, by selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system, obtains the translational and rotational offsets required for positioning, including: First, based on the relative positional relationship between the design coordinate system and the workpiece / programming coordinate system used by the CNC program, the blank measurement point cloud and part model point cloud are transformed from the design coordinate system to the workpiece / programming coordinate system. Next, a plane is generated at a specified height, or the blank point cloud is used to extract predicted measurement points at a specified height. Finally, the measurement macro program is run on the machine tool to obtain the set of measured points for the blank's contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... Extract the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system to obtain the blank's two-dimensional contour point set. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved by using the two-dimensional ICP algorithm to solve the least squares problem; finally, the rotation matrix and translation vector from the machine tool coordinate system to the workpiece / programming coordinate system are obtained.
[0014] Optional, the least squares objective function is as follows:
[0015] Obtain the offsets in the X, Y, and Z directions. , , The rotation angle C around the Z-axis can be set within the workpiece coordinate system of the machine tool to achieve adaptive positioning after margin optimization.
[0016] Optionally, after CNC machining of the blank, inspect the machining results after the blank's adaptive positioning: Two sets of measuring points on both sides of the wall were obtained by machine tool probe measurement. and Measurement points on surface I The equation of plane I is obtained by least-squares fitting method. Then, for each point on plane II... q i Calculate the distance from each to surface I. d i , d i The average value is the measured distance between the two surfaces; the least squares fitting of the plane is solved using the SVD matrix decomposition method; finally, the thickness value is obtained. d The following calculation formula is given:
[0017] Flatness error is assessed using the least squares method, which involves obtaining points on the workpiece's surface to be evaluated through machine measurement. The set of coordinates is used to fit the least squares plane equation of these N points using the point set and the least squares method. The plane passes through point For each point in the point set P P i Calculate the directed distance from each to the least squares plane. d xi When vector p i v The included angle n is less than 180°. d xi A value greater than 0 indicates that point v is on the side pointed to by the normal vector n. When the included angle is greater than 180°, d xiA value less than 0 indicates that point v is on the opposite side of the direction pointed to by the normal vector n; the distance between the two measuring points with the largest distance on both sides of the least squares plane is taken as the flatness error, i.e., the directed distance. d xi The difference between the maximum and minimum values:
[0018] Select two cross-sections as far apart as possible inside the hole, with the centers of the cross-sections being respectively... , The least squares fitting yields the normal vector n of the reference plane, with the center of the base circle as the reference vector. O 1. Establish a minimum-enclosing cylinder along the axis direction, where n is the axis. O The distance from point 2 to the axis of the cylinder is the perpendicularity error. O 1 O The angle between 2 and n is θ, and the final perpendicularity error is:
[0019] Secondly, the present invention provides an adaptive positioning system for matching two-dimensional contours of a blank without feature constraints, comprising: The data preprocessing module is used to preprocess point cloud data and extract feature surfaces for the blank and design model, respectively. The optimal pose acquisition module is used to perform margin calculation on the preprocessed data, perform coarse and fine registration between the blank measurement point cloud and the design model point cloud, and achieve active allocation of margin through machining margin optimization to obtain the optimal pose of the blank measurement point cloud and the design model point cloud. The positioning output module is used for adaptive positioning by matching the two-dimensional contour of the blank. By selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system, the translational offset and rotational offset required for positioning are obtained.
[0020] Optionally, the adaptive positioning using two-dimensional contour matching of the blank, by selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system, obtains the translational and rotational offsets required for positioning, including: First, based on the relative positional relationship between the design coordinate system and the workpiece / programming coordinate system used by the CNC program, the blank measurement point cloud and part model point cloud are transformed from the design coordinate system to the workpiece / programming coordinate system. Next, a plane is generated at a specified height, or the blank point cloud is used to extract predicted measurement points at a specified height. Finally, the measurement macro program is run on the machine tool to obtain the set of measured points for the blank's contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... Extract the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system to obtain the blank's two-dimensional contour point set. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved by using the two-dimensional ICP algorithm to solve the least squares problem; finally, the rotation matrix and translation vector from the machine tool coordinate system to the workpiece / programming coordinate system are obtained. The least squares objective function is shown below:
[0021] Obtain the offsets in the X, Y, and Z directions. , , The rotation angle C around the Z-axis can be set within the workpiece coordinate system of the machine tool to achieve adaptive positioning after margin optimization.
[0022] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the feature-constrained blank two-dimensional contour matching adaptive positioning method.
[0023] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the feature-constrained blank two-dimensional contour matching adaptive positioning method.
[0024] Compared with the prior art, the present invention has the following technical effects: This invention enables adaptive positioning of complex blanks, accurately determining the position and orientation of any blank clamped on the worktable. It breaks through the limitations of traditional methods on blank positioning features, rotary or symmetrical parts, and has wide applicability.
[0025] 1) The method innovatively transforms the positioning problem of structural components into a two-dimensional matching problem between the two-dimensional contour points of the blank in the workpiece coordinate system and the measured contour points in the machine tool coordinate system. This method only needs to handle two-dimensional contour registration, which reduces the amount of point cloud data to be processed for positioning, thereby significantly shortening the positioning time.
[0026] 2) A two-dimensional ICP matching algorithm is adopted. By setting Z in the three-dimensional algorithm to the same real number for calculation, the transformation from the machine tool coordinate system to the programming coordinate system is realized. The algorithm has been experimentally verified on joint parts and curved parts, and has the characteristics of fast calculation speed and good registration effect, which can effectively improve positioning accuracy and efficiency. Attached Figure Description
[0027] Figure 1 This is a flowchart of the feature surface segmentation and extraction process.
[0028] Figure 2 This is a schematic diagram of the adaptive positioning principle.
[0029] Figure 3 This is a diagram showing the two-dimensional contour points and measured contour points of the connector.
[0030] Figure 4 This is a matching diagram of the two-dimensional contour points and the measured contour points of the connector.
[0031] Figure 5 This is a matching diagram of the two-dimensional contour points and the measured contour points of the curved surface part.
[0032] Figure 6 This is a diagram showing the measurement of the rib thickness.
[0033] Figure 7 This is a diagram showing the verticality error. Detailed Implementation
[0034] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0035] This invention provides an adaptive positioning method for blanks of complex structural parts, comprising the following steps: Step 1: Perform point cloud data preprocessing and feature surface extraction on the blank model and the design model respectively.
[0036] Voxel downsampling and farthest-point downsampling algorithms are used to simplify point cloud data and reduce redundant data. After obtaining the simplified point cloud, the point cloud normal vectors are calculated and redirected. The point cloud normal vector calculation method adopts the method of calculating the normal vector by fitting the local surface of the point cloud. The algorithm assumes that the point cloud surface is smooth everywhere, and the normal vector of a point can be approximately estimated by the normal vector of the local k-neighbor plane. Principal component analysis is used to solve the problem. The k-neighborhood refers to any point in the point cloud. Distance point in space The quality of the k nearest neighbors affects the calculation of the normal vector. And for each point in the point cloud... Each point needs to find its k-neighborhood. For point cloud data where there is no topological relationship between points, a query is required every time. Only by considering all points outside the range can the nearest k points be determined, thus the time complexity of each brute-force search is O(n). Where N is the number of points in the point cloud, this efficiency is unacceptable. Therefore, a KD-tree is constructed to manage the point cloud data. A KD-tree is a k-dimensional binary tree where each node represents k-dimensional data. The KD-tree can organize the unordered point cloud into an ordered structure. The time complexity of constructing a KD-tree is O(n log n). The time complexity of each retrieval is reduced by Down to The specific construction method of the KD-tree is not described in this article; instead, the function KDTreeFlann() in the third-party point cloud processing library Open3d is directly called to perform the k-nearest neighbor query. For the obtained blank measurement point cloud and design model point cloud data, a random sampling consensus algorithm based on octree units is used to initially segment the point cloud feature surfaces, and then a region growing algorithm is used to further segment the point cloud feature surfaces. The flowchart is as follows... Figure 1 .
[0037] Step 2: Perform coarse and fine registration between the blank measurement point cloud and the design model point cloud. After optimizing the machining allowance, actively allocate the allowance to obtain the optimal pose of the blank measurement point cloud and the design model point cloud.
[0038] After preprocessing and feature surface extraction of the blank measurement point cloud and design model point cloud data, the preprocessed normal information and other data are used for allowance calculation, and a correspondence is established for the extracted feature surfaces. A nominal minimum machining allowance is specified for a specific machining surface, and the blank machining surface allowance is optimized. SAC-IA coarse registration based on FPFH features is performed. The FPFH features of each point in the blank measurement point cloud and design model point cloud are solved, and the random sampling consistency principle is applied to match the feature points, achieving initial alignment of the two point clouds. An improved ICP fine registration algorithm is proposed. The truncated least squares method is introduced to improve the traditional ICP algorithm. Verification shows that the improved ICP fine registration algorithm further aligns the two point clouds based on coarse registration, outperforming the traditional ICP algorithm in both convergence speed and registration accuracy, improving the registration accuracy of the joint part point cloud by 52.42%. A constraint variance minimization matching machining surface allowance optimization method is proposed. A correspondence between the feature surfaces is established between the measured point cloud of the blank after feature surface extraction and the point cloud of the design model. Allowance constraints are set, and mathematical models of allowances are established for the plane and other machining surfaces respectively. Allowance optimization is performed by the constraint variance minimization matching algorithm.
[0039] Step 3: Using the blank 2D contour matching adaptive positioning method, a section at a certain height in the Z direction is selected as the registration object between the machine tool coordinate system and the workpiece coordinate system to obtain the translational offset and rotational offset required for positioning.
[0040] First, based on the design coordinate system Workpiece / programming coordinate system used for CNC program generation The relative positional relationship of the blank measurement point cloud and the point cloud of the part model from the design coordinate system Transform to workpiece / programming coordinate system middle.
[0041] Next, specify the height using SolidWorks or other CAD software. Generate a plane or use a blank point cloud to position the blank point cloud at a specified height. Extract the points from the generated prediction values.
[0042] Then, run the measurement macro program on the machine tool to obtain the set of measured points of the blank contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... By extracting the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system, a two-dimensional contour point set of the blank can be obtained. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved using a two-dimensional ICP algorithm to obtain a least-squares problem. The least-squares objective function is shown below. Finally, the rotation matrix and translation vector from the machine coordinate system to the workpiece / programming coordinate system are obtained, and the offsets in the X, Y, and Z directions are calculated using the following formula. , , The rotation angle C around the Z-axis can be set within the workpiece coordinate system of the machine tool to achieve adaptive positioning after margin optimization.
[0043]
[0044] Experiments were conducted to verify the effectiveness of the adaptive positioning method based on two-dimensional contour matching of blanks.
[0045] First, extract the two-dimensional contour of the connector, as shown below. Figure 3 As shown in (a), there are a total of 3822 points located in the workpiece coordinate system. Then, 30 predicted points are discretized. The predicted points are rotated 30° clockwise around the Z-axis, translated 2mm in the negative X direction, and translated 2mm in the negative Y direction. These are used as the actual measurement points of the joint contour in the machine tool coordinate system. If the algorithm principle is correct, the two-dimensional contour points will be successfully matched with the actual measurement points of the contour, and the offset amount set in advance for the predicted points can be calculated.
[0046] After solving using the two-dimensional ICP algorithm, the relative positions of the two change as follows: Figure 4 As shown, the two-dimensional contour of the connector is matched with the measured points of the contour, and the rotation matrix is obtained. Find the loop in reverse Z Rotate the axis by 30.000° and translate the vector. Inverse calculation X and Y The directional offsets are 1.999 and 2.000, which are basically consistent with the initial offset settings.
[0047]
[0048] Verification was performed on curved surfaces without available positioning features, and the rotation matrix was obtained. Find the loop in reverse Z Axis rotation 26.000°, translation vector The matching effect is as follows Figure 5 As shown.
[0049]
[0050] Step 4: Study the calculation method of the feature dimensions and form and position errors of the workpiece after CNC machining of the blank, and verify the machining results after adaptive positioning.
[0051] After preliminary preparation and adaptive positioning, aerospace blanks begin CNC machining. Machine tool probes are used to measure feature dimensions and form and position error parameters after some machining processes, allowing for timely verification of the adaptive positioning effect. Depending on the feature shape to which the dimension belongs, the corresponding dimension calculation methods also differ. Based on the dimension calculation method, the measurement of common workpiece dimensions can be divided into dimension measurement based on planar features and dimension measurement based on circular hole features. A brief overview of dimension measurement based on planar features is provided below.
[0052] Many features in complex aerospace parts are composed of planes, such as thin walls, vertical ribs, and webs. The calculation methods for dimensions such as wall height, wall thickness, and rib thickness based on these features are consistent: first, a reference plane is fitted, then the point-to-plane distance is solved, and finally the dimensional values are calculated by combining the results.
[0053] Taking the calculation of rib thickness as an example, such as Figure 6 As shown, two sets of measuring points on both sides of the wall were obtained through on-machine measurement using a probe. and Measurement points on surface I The equation of plane I is obtained by least-squares fitting method. Then, for each point on plane II... q i Calculate the distance from each to surface I. d i , d i The average value is the measured distance between the two surfaces. The least-squares fit of the plane is solved using the SVD matrix decomposition method.
[0054] any point in space to plane distance d 0 is as shown in equation (2).
[0055]
[0056] Finally, the thickness value is obtained. d As shown in equation (3).
[0057]
[0058] For calculating the form and position errors of workpieces, this paper focuses on the calculation methods of flatness and perpendicularity based on in-machine measurement data. Flatness error can be evaluated using methods such as the three-far-point method, the minimum area evaluation method, the maximum straightness evaluation method, and the least squares method. This paper adopts the least squares method. Points on the plane of the workpiece to be evaluated are obtained through in-machine measurement. The set of coordinates, fitted using the least squares method with the point set. N Least square plane equations at points The plane must pass through the point. For point sets P Each point in P i Calculate the directed distance from each to the least squares plane. d xi .
[0059]
[0060] When vector p i v The included angle n is less than 180°. d xi A value greater than 0 indicates a point. v On the side pointed to by the normal vector n, when the included angle is greater than 180°, d xi Less than 0 indicates a point v On the opposite side pointed to by the n-normal vector. The distance between the measuring points with the largest distance on both sides of the least squares plane is taken as the flatness error, i.e., the directed distance. d xi The difference between the maximum and minimum values:
[0061] Perpendicularity refers to the variation of elements such as lines, planes, and axes in the vertical direction relative to a reference. Here, we discuss the perpendicularity of an axis, defined as the diameter of the smallest cylinder that completely encloses the axis and is perpendicular to the reference. Figure 7 As shown.
[0062] Select two cross-sections as far apart as possible inside the hole, with the centers of the cross-sections being respectively... , The least squares fitting yields the normal vector n of the reference plane, with the center of the base circle as the reference vector. O 1. Establish a minimum-enclosing cylinder along the axis direction, where n is the axis. O The distance from point 2 to the axis of the cylinder is the perpendicularity error. O 1 O The angle θ between 2 and n is:
[0063] The perpendicularity error is:
[0064] In another embodiment of the present invention, a method is provided. Adaptive positioning system for 2D contour matching of blank without feature constraints ,able Sufficient to achieve the above Adaptive localization of 2D contour matching for blanks without feature constraints Specifically, the system includes the following methods: The data preprocessing module is used to preprocess point cloud data and extract feature surfaces for the blank and design model, respectively. The optimal pose acquisition module is used to perform margin calculation on the preprocessed data, perform coarse and fine registration between the blank measurement point cloud and the design model point cloud, and achieve active allocation of margin through machining margin optimization to obtain the optimal pose of the blank measurement point cloud and the design model point cloud. The positioning output module is used for adaptive positioning by matching the two-dimensional contour of the blank. By selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system, the translational offset and rotational offset required for positioning are obtained.
[0065] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0066] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of an adaptive positioning method for matching two-dimensional contours of a blank without feature constraints.
[0067] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the adaptive positioning method for matching two-dimensional contours of a blank without feature constraints in the above embodiments.
[0068] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0069] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0070] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0071] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An adaptive positioning method for two-dimensional contour matching of blanks without feature constraints, characterized in that, include: Point cloud data preprocessing and feature surface extraction are performed on the blank and design model respectively; The preprocessed data is used to calculate the margin, and the blank measurement point cloud and the design model point cloud are coarsely and finely registered. The margin is actively allocated through processing margin optimization, and the optimal pose of the blank measurement point cloud and the design model point cloud is obtained. By using the two-dimensional contour matching adaptive positioning of the blank, the cross section at a certain height in the Z direction is selected as the registration object between the machine tool coordinate system and the workpiece coordinate system, and the translational offset and rotational offset required for positioning are obtained. The adaptive positioning using two-dimensional contour matching of the blank involves selecting a section at a certain height in the Z-axis as the registration object between the machine tool coordinate system and the workpiece coordinate system to obtain the translational and rotational offsets required for positioning, including: First, based on the relative positional relationship between the design coordinate system and the workpiece / programming coordinate system used by the CNC program, the blank measurement point cloud and the part model point cloud are transformed from the design coordinate system to the workpiece / programming coordinate system; then, a plane is generated at a specified height or the blank point cloud is used to extract the predicted quantity points at a specified height. Then, run the measurement macro program on the machine tool to obtain the set of measured points of the blank contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... Extract the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system to obtain the blank's two-dimensional contour point set. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved by using the two-dimensional ICP algorithm to solve the least squares problem; finally, the rotation matrix and translation vector from the machine tool coordinate system to the workpiece / programming coordinate system are obtained.
2. The adaptive positioning method for matching two-dimensional contours of a blank without feature constraints according to claim 1, characterized in that, The point cloud data preprocessing and feature surface extraction for the blank and design model respectively include: Voxel downsampling and farthest-point downsampling algorithms are used to simplify point cloud data and reduce redundant data. After obtaining the simplified point cloud, the point cloud normal vectors are calculated and redirected. The point cloud normal vector calculation method adopts the method of calculating the normal vector by fitting the local surface of the point cloud, using a local surface at a certain point. k The normal vector of the point is estimated by the normal vector of the neighborhood plane, and the solution is obtained using principal component analysis. k Neighborhood refers to any point in a point cloud. p i Distance point in space p i Recent k A set of points; for the obtained blank measurement point cloud and design model point cloud data, the point cloud feature surface is initially segmented using a random sampling consensus algorithm based on octree units, and then the point cloud feature surface is further segmented using a region growing algorithm.
3. The adaptive positioning method for matching two-dimensional contours of a blank without feature constraints according to claim 1, characterized in that, The process of calculating the margin in the preprocessed data, coarsely and finely registering the blank measurement point cloud and the design model point cloud, and actively allocating the margin through machining margin optimization to obtain the optimal pose of the blank measurement point cloud and the design model point cloud includes: After preprocessing and feature surface extraction of the blank measurement point cloud and design model point cloud data, the preprocessed normal information data is used for allowance calculation, and a correspondence is established for the extracted feature surfaces. A nominal minimum machining allowance is specified for a specific machining surface, and the allowance of the blank machining surface is optimized. Based on the SAC-IA coarse registration of FPFH features, the FPFH features of each point in the blank measurement point cloud and the design model point cloud are solved, and the random sampling consistency principle is applied to match the feature points, so that the two point clouds are initially aligned. At the same time, an improved ICP fine registration algorithm is proposed, and the truncated least squares method is introduced to improve the ICP algorithm. A feature surface correspondence is established between the blank measurement point cloud and the design model point cloud after feature surface extraction, and allowance constraints are set. Mathematical models of allowances are established for the plane and other machining surfaces, and the allowance is optimized by the constraint variance minimization matching algorithm.
4. The adaptive positioning method for matching two-dimensional contours of a blank without feature constraints according to claim 1, characterized in that, The least squares objective function is shown below: In the formula, R is the rotation matrix for the coordinate transformation from the machine tool coordinate system to the workpiece coordinate system; t is the translation vector for the coordinate transformation from the machine tool coordinate system to the workpiece coordinate system; p mi Let i be the i-th point on the actual measured blank contour; p ci for p mi The nearest point on the two-dimensional contour point set of the blank; Obtain the offsets in the X, Y, and Z directions. , , The rotation angle C around the Z-axis can be set within the workpiece coordinate system of the machine tool to achieve adaptive positioning after margin optimization.
5. The adaptive positioning method for matching two-dimensional contours of a blank without feature constraints according to claim 1, characterized in that, After CNC machining of the blank, inspect the machining results after the blank is self-adaptively positioned: Two sets of measuring points on both sides of the wall were obtained by machine measurement using the machine tool probe. and Measurement points on surface I The equation of plane I is obtained by least-squares fitting method. Then, for each point on plane II... q i Calculate the distance from each to surface I. d i , d i The average value is the measured distance between the two surfaces; the least squares fitting of the plane is solved using the SVD matrix decomposition method; finally, the thickness value is obtained. d The following calculation formula is given: In the formula, d is the final thickness value; N2 is the number of measurement points on surface II; d i For each point q on plane II i The distance to point I on surface I; Flatness error is assessed using the least squares method, which involves obtaining points on the workpiece's surface to be evaluated through machine measurement. The set of coordinates is used to fit the least squares plane equation of these N points using the point set and the least squares method. The plane passes through point For each point in the point set P P i Calculate the directed distance from each to the least squares plane. d xi When vector p i v The included angle n is less than 180°. d xi A value greater than 0 indicates that point v is on the side pointed to by the normal vector n. When the included angle is greater than 180°, d xi A value less than 0 indicates that point v is on the opposite side of the direction pointed to by the normal vector n; the distance between the two measuring points with the largest distance on both sides of the least squares plane is taken as the flatness error, i.e., the directed distance. d xi The difference between the maximum and minimum values: In the formula, flatness is the flatness error value; d xmax Directed distance d xi The maximum value; d xmin Directed distance d xi The minimum value; Select two cross-sections as far apart as possible inside the hole, with the centers of the cross-sections being respectively... , The least squares fitting yields the normal vector n of the reference plane, with the center of the base circle as the reference vector. O 1. Establish a minimum-enclosing cylinder along the axis direction, where n is the axis. O The distance from point 2 to the axis of the cylinder is the perpendicularity error. O 1 O The angle between 2 and n is θ, and the final perpendicularity error is: In the formula, perpendicularity is the verticality error value; θ is... O 1 O The angle between 2 and n.
6. An adaptive positioning system for matching two-dimensional contours of a blank without feature constraints, characterized in that, include: The data preprocessing module is used to preprocess point cloud data and extract feature surfaces for the blank and design model, respectively. The optimal pose acquisition module is used to perform margin calculation on the preprocessed data, perform coarse and fine registration between the blank measurement point cloud and the design model point cloud, and achieve active allocation of margin through machining margin optimization to obtain the optimal pose of the blank measurement point cloud and the design model point cloud. The positioning output module is used for adaptive positioning by matching the two-dimensional contour of the blank. By selecting a section at a certain height in the Z direction as the registration object between the machine tool coordinate system and the workpiece coordinate system, the translational offset and rotational offset required for positioning are obtained. The adaptive positioning using two-dimensional contour matching of the blank involves selecting a section at a certain height in the Z-axis as the registration object between the machine tool coordinate system and the workpiece coordinate system to obtain the translational and rotational offsets required for positioning, including: First, based on the relative positional relationship between the design coordinate system and the workpiece / programming coordinate system used by the CNC program, the blank measurement point cloud and the part model point cloud are transformed from the design coordinate system to the workpiece / programming coordinate system; then, a plane is generated at a specified height or the blank point cloud is used to extract the predicted quantity points at a specified height. Then, run the measurement macro program on the machine tool to obtain the set of measured points of the blank contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... Extract the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system to obtain the blank's two-dimensional contour point set. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved by using the two-dimensional ICP algorithm to solve the least squares problem; finally, the rotation matrix and translation vector from the machine tool coordinate system to the workpiece / programming coordinate system are obtained.
7. The feature-constrained blank two-dimensional contour matching adaptive positioning system according to claim 6, characterized in that, The adaptive positioning using two-dimensional contour matching of the blank involves selecting a section at a certain height in the Z-axis as the registration object between the machine tool coordinate system and the workpiece coordinate system to obtain the translational and rotational offsets required for positioning, including: First, based on the relative positional relationship between the design coordinate system and the workpiece / programming coordinate system used by the CNC program, the blank measurement point cloud and part model point cloud are transformed from the design coordinate system to the workpiece / programming coordinate system. Next, a plane is generated at a specified height, or the blank point cloud is used to extract predicted measurement points at a specified height. Finally, the measurement macro program is run on the machine tool to obtain the set of measured points for the blank's contour. The measured point set is located in the machine tool coordinate system, and the height is determined by... Extract the blank measurement point cloud that has been transformed to the workpiece / programming coordinate system to obtain the blank's two-dimensional contour point set. At this point, the adaptive positioning problem of the blank after margin optimization is transformed into a set of measured points. With two-dimensional contour point set The registration problem is solved by using the two-dimensional ICP algorithm to solve the least squares problem; finally, the rotation matrix and translation vector from the machine tool coordinate system to the workpiece / programming coordinate system are obtained. The least squares objective function is shown below: In the formula, R is the rotation matrix for the coordinate transformation from the machine coordinate system to the workpiece coordinate system; t is the translation vector for the coordinate transformation from the machine coordinate system to the workpiece coordinate system. p mi Let i be the i-th point on the actual measured blank contour; p ci for p mi The nearest point on the two-dimensional contour point set of the blank; Obtain the offsets in the X, Y, and Z directions. , , The rotation angle C around the Z-axis can be set within the workpiece coordinate system of the machine tool to achieve adaptive positioning after margin optimization.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the adaptive positioning method for matching two-dimensional contours of a blank without feature constraints as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the adaptive positioning method for matching two-dimensional contours of a blank without feature constraints as described in any one of claims 1 to 6.