A point cloud-based automatic polishing track generation method and system for complex curved welds
Patent Information
- Application Number
- CN202610567788.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-27
- Publication Date
- 2026-08-21
AI Technical Summary
[0007]针对现有技术的以上缺陷或改进需求,本发明提供了一种基于点云的复杂曲面焊缝自动打磨轨迹生成方法及系统,其中结合工件点云的统计能量分布特征及其复杂自由曲面的加工工艺特点,相应设计了基于点云主成分分析(PCA)与法向自适应控制的自动轨迹规划机制,并对其关键组件如加工坐标系自适应构建模块、有向包围盒(OBB)投影面构建模块和工艺联动参数调节模块的结构及其具体设置方式进行研究和设计,相应的可有效解决加工方向依赖人工经验、姿态与真实表面法向匹配不足、轨迹规划依赖CAD模型以及缺乏工艺自适应联动机制等问题,同时还具备高自动化、高稳定性以及加工一致性强等技术优势,因而尤其适用于复杂自由曲面场景下的工业机器人自动化打磨的应用场合
1.本发明基于三维点云的主成分分析结果自动确定打磨行进方向、行距方向及法向方向,无需依赖人工经验设定或CAD模型辅助,解决了传统轨迹规划中方向高度依赖人工调节的问题。通过统计特性自动构建加工坐标系,使不同尺寸、不同姿态摆放的工件均可自动生成一致的加工方向,显著提升轨迹规划的自动化程度与现场部署效率
Smart Images

Figure CN122606476A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of grinding control technology, and more specifically, relates to a method and system for generating automatic grinding trajectories for complex curved surface welds based on point clouds. Background Technology
[0002] Robotic grinding, as an important method for precision machining of complex curved surface components, has been widely used in shipbuilding, rail transportation, aerospace, and equipment manufacturing. Compared with traditional manual grinding methods, robotic grinding can effectively reduce labor intensity, improve processing consistency and safety, and is gradually becoming an important development direction for complex curved surface treatment. However, achieving high-quality automated grinding in complex curved surface environments still depends on the full acquisition and utilization of the workpiece surface geometry information, especially the automatic generation of grinding trajectories and postures that meet process requirements based on the workpiece morphology. This process directly determines the processing quality and stability.
[0003] In existing technologies, early robotic grinding largely relied on pre-programmed fixed-path processing patterns. Operators needed to manually set the trajectory direction and grinding posture based on experience, or perform offline trajectory planning based on CAD models. While this method could complete basic processing tasks, when dealing with complex curved surfaces or batches of workpieces with varying sizes, the trajectory direction and posture were highly dependent on manual settings, making it difficult to guarantee consistency and universality. Furthermore, the path update process was cumbersome and had a low degree of automation.
[0004] With the development of machine vision and 3D measurement technologies, solutions have emerged that utilize 2D cameras to identify contours and generate grinding paths, and 3D cameras to collect point clouds and generate trajectory points to drive robot processing. These solutions have improved the intelligence of grinding trajectory generation to some extent. However, 2D images can only represent planar information of the workpiece and have limited ability to recognize spatial geometric features such as bevels and chamfers. Especially in areas of abrupt geometric changes in three-dimensional geometry, they are difficult to accurately reflect the true shape, resulting in insufficient trajectory targeting. While 3D point cloud-based solutions can recover the true spatial geometric structure, in large-scale, multi-view scenarios, multiple point cloud acquisitions and stitching are often required. Existing technologies still have shortcomings in point cloud stitching accuracy, noise suppression, and data integrity, which can easily lead to unstable input data quality for trajectory planning, thus affecting the processing effect. Existing patents such as CN110091333B identify weld areas and generate grinding and polishing paths through local fitting, which can improve the processing efficiency of feature areas to a certain extent. However, it still focuses on local weld identification and has not yet achieved global adaptive planning for the processing direction and posture of the entire curved surface. While CN115358965A achieves automatic identification and path generation of weld trajectories, it is mainly for linear weld objects and is difficult to directly extend to the overall grinding scenario of large curvature and irregular free-form surfaces.
[0005] Furthermore, existing methods for generating grinding trajectories for complex curved surfaces generally suffer from the following problems: First, the determination of the trajectory direction relies on manual experience or simple rules, lacking an adaptive decision-making mechanism based on point cloud statistical characteristics, making it difficult to ensure the consistency of trajectory directions between different workpieces; second, the grinding posture cannot fully match the normal information of the real surface, resulting in a large deviation between the tool axis and the workpiece normal, thus producing uneven grinding textures, local overcutting, or residual defects; third, the trajectory generation process is highly dependent on CAD models or offline programming software, making it difficult to apply to scenarios with only point cloud data or missing models, limiting its on-site application capabilities; finally, existing methods mostly focus only on the geometric trajectory itself, lacking linkage design with process mechanisms such as constant force control, sandpaper wear compensation, curvature adaptation, and edge protection, resulting in the need to improve processing consistency and stability.
[0006] In summary, existing technologies in the field of robotic grinding of complex curved surfaces still have significant shortcomings in areas such as automatic trajectory direction determination, attitude normal matching, model dependency reduction, and adaptive process linkage. Therefore, how to achieve integrated automatic generation of processing direction, trajectory, and attitude relying solely on workpiece surface point cloud data, while taking into account both process adaptability and processing stability, has become a pressing technical problem to be solved in this field. Summary of the Invention
[0007] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a method and system for generating automatic grinding trajectories for complex curved surface welds based on point clouds. Combining the statistical energy distribution characteristics of the workpiece point cloud with the processing characteristics of its complex free-form surface, an automatic trajectory planning mechanism based on principal component analysis (PCA) and adaptive normal control is designed. The structure and specific settings of key components such as the adaptive machining coordinate system construction module, the directed bounding box (OBB) projection surface construction module, and the process linkage parameter adjustment module are studied and designed. This effectively solves problems such as reliance on manual experience for machining direction, insufficient matching between posture and real surface normals, reliance on CAD models for trajectory planning, and the lack of an adaptive process linkage mechanism. Furthermore, it possesses technical advantages such as high automation, high stability, and strong processing consistency, making it particularly suitable for automated grinding applications of industrial robots in complex free-form surface scenarios.
[0008] To achieve the above objectives, according to one aspect of the present invention, a method for automatically generating grinding trajectories for complex curved surface welds based on point clouds is proposed, comprising the following steps: S100: Acquire the 3D point cloud data of the workpiece and preprocess the data; S200, based on the principal component energy criterion, adaptively constructs the processing coordinate system. It calculates the covariance matrix of the preprocessed point cloud and performs eigenvalue decomposition, extracts three orthogonal principal direction vectors and their corresponding eigenvalues, performs stability analysis by defining the direction separation index, and adaptively determines the grinding travel direction, row spacing direction and normal reference direction according to the magnitude of the eigenvalues, thereby constructing the processing coordinate system. S300, based on the spindle constraint, adaptive directed bounding box and projection surface construction, in the machining coordinate system, calculates the boundary of the point cloud in each direction by spindle alignment, constructs a directed bounding box OBB consistent with the workpiece geometry, and performs plane applicability control according to the height fluctuation ratio to determine the projection reference plane for trajectory planning; S400 is a serpentine trajectory adaptive generation based on coverage constraints. In the projection plane, it calculates the adaptive row spacing by combining the effective width of the workpiece being polished and the target overlap rate. It determines the number of trajectory rows based on the width of the planned area, generates a covering serpentine path using an odd-even inversion mechanism, and dynamically adjusts the row spacing and step size by combining the local curvature estimation value. Finally, it maps the two-dimensional trajectory points back to the three-dimensional space. The S500 dynamically constructs the tool's attitude coordinate system based on the real surface normal information of each trajectory point, and encapsulates the generated trajectory point position information, quaternion attitude information, and process parameters, outputting the trajectory data that can be executed by the robot control system.
[0009] As a further preferred embodiment, S100 includes the following steps: S101, Obtain the original point cloud data of the workpiece, use a statistical filtering algorithm to reduce noise in the original point cloud data, and identify and remove isolated points and abnormal noise points based on the statistical characteristics of the distribution of neighborhood points. S102, Combining the structural morphology characteristics of the workpiece, the weld area is clipped and the region of interest is defined on the point cloud to eliminate irrelevant components and interference areas, ensuring that the data range is consistent with the actual grinding area; S103, perform voxel grid uniform downsampling on the point cloud after cropping in step S102. By dividing the spatial region into voxels and replacing the voxel inner points with the voxel center points, the number of point clouds is effectively compressed and the density is adjusted.
[0010] As a further preferred embodiment, the calculation formula for defining the region of interest includes: In the formula, This refers to the subset of point clouds retained after ROI filtering. The raw point cloud data, , Let N be the i-th 3D point in the original point cloud, and let N be the total number of 3D points in the point cloud set P. These are the minimum and maximum values of the x-coordinate, respectively. These are the minimum and maximum values of the y-coordinate, respectively. These are the minimum and maximum values of the z-coordinate, respectively. Points p i Coordinate values on the three axes, Region of interest; Preferably, the calculation formula for the uniform downsampling of the voxel grid includes: In the formula, This is the set of downsampled point clouds. The center point of the voxel, The number of primitive points contained within a single voxel. It is the k-th origin point within the voxel.
[0011] As a further preferred embodiment, S200 includes the following steps: S201, Calculate the geometric centroid of the point cloud data preprocessed in step S100. To eliminate the influence of overall translation on statistical features, construct a decentralized vector. The point cloud covariance matrix is established based on decentralized vectors; S202, Perform eigenvalue decomposition on the covariance matrix: k=1, 2, 3, where, For the first 1 eigenvalue, These are the corresponding unit feature vectors, sorted by size: eigenvalues Indicates the direction of point cloud The statistical energy magnitude is used to define a direction separation index, and the processing principal direction is quantized based on this index. Stability analysis is then performed on the quantized processing principal direction. If the principal direction separation is significant, the processing principal direction is stable and reliable; otherwise, a local sliding window PCA enhancement mechanism is adopted, which divides the point cloud into several overlapping sub-blocks. The covariance matrix is calculated independently for each sub-block. and its main direction Then, the directions are merged using a weighted average method, and the merged direction is used as the main processing direction. S203, Define the machining coordinate system ,in As the direction of processing. As the direction of line spacing As the normal reference direction, construct the rotation matrix. And the rotation matrix satisfies It is used to transform the point cloud from the global coordinate system to the machining coordinate system, thereby ensuring the consistency between the machining direction and the main geometric direction of the workpiece.
[0012] As a further preferred embodiment, the point cloud covariance matrix includes: In the formula, Let N be the point cloud covariance matrix; Preferably, the calculation model for the directional separation index includes: In the formula, This indicates the degree of energy advantage of the first principal direction relative to the second direction. This indicates the degree of energy advantage of the second direction relative to the third direction; Preferably, the stability analysis includes: Set a stability threshold If satisfied and If the separation in the main direction is obvious, the processing in the main direction is stable and reliable; otherwise, it indicates that the energy distribution of the point cloud is similar in multiple directions, and a local sliding window PCA enhancement mechanism is adopted.
[0013] As a further preferred embodiment, S300 includes: S301, Based on the machining coordinate system, calculate the boundaries in each direction: Define geometric dimensions: in, Indicates the length in the main machining direction. Indicates the processing coverage width. Indicates the amplitude of surface undulation. This represents the coordinate position of the point cloud in the processing coordinate system; S302, Perform planar suitability control based on the height undulation ratio, wherein the calculation model for the height undulation ratio includes: In the formula, The height fluctuation ratio; S303, when Then a single projection plane can be used directly, if This triggers the partitioned projection mechanism, which divides the point cloud into blocks and establishes local projection planes for each block.
[0014] As a further preferred embodiment, S400 includes the following steps: S401, a theoretical row spacing calculation model is constructed based on the effective processing width of the grinding tool and the target processing overlap rate, and a coverage error criterion is introduced to ensure the coverage integrity of the row spacing; S402 calculates the theoretical number of trajectory rows based on the two-dimensional planning area and introduces the end compensation criterion to ensure complete boundary coverage; S403, determine the number of single-row points according to the length of the main processing direction and the single-row step length, and generate a covering serpentine path based on the number of single-row points using the odd-even reversal mechanism; S404, for trajectories with large curvature, the local curvature estimate is defined as... The curvature adjustment coefficient is defined as , where parameters Let be the curvature sensitivity coefficient, then the local adaptive line spacing is... ,when This triggers a local encryption mechanism to reduce line spacing; S405, recovering two-dimensional trajectory points using nearest neighbor search or local surface fitting algorithms. Height coordinates To form a complete three-dimensional spatial trajectory point To ensure smooth robot motion, the trajectory curvature is constructed based on three adjacent trajectory points. Criterion; when the trajectory curvature Exceeding the smoothing threshold At the same time, optimization is achieved by reducing the single-row step size S; simultaneously, while satisfying the coverage and curvature constraints, a path length optimization objective is introduced. The goal is to minimize the total path length while satisfying coverage and curvature constraints.
[0015] As a further preferred embodiment, the theoretical line spacing calculation model includes: In the formula, 𝑊 is the effective processing width of the grinding tool, 𝜌 is the target processing overlap rate, and 𝜌∈(0,1). Line spacing; Preferably, the coverage error criterion includes: In the formula, For coverage error, if If this happens, the overlap rate φ will be automatically increased, and the line spacing d will be recalculated. Preferably, the end-compensation criterion includes: set up ,like Then execute To ensure complete boundary coverage, This indicates a wide processing coverage. This refers to the remaining processing allowance at the end of the process. This represents the planned number of processing rows (number of paths). As a further preferred embodiment, in step S403, the covering serpentine path includes: in, It is a covering serpentine path. , , These represent the maximum and minimum x-coordinate values within the processing row, respectively. These are the path point number and the path point spacing (step size), respectively. Preferably, the trajectory curvature The computational models include: In the formula, To refine the i-th path point (pose point) on the trajectory.
[0016] According to another aspect of the present invention, an automatic grinding trajectory generation system for complex curved surface welds based on point clouds is also provided, for implementing an automatic grinding trajectory generation method for complex curved surface welds based on point clouds according to any of the above embodiments or combinations of multiple embodiments, comprising: The point cloud preprocessing module is used to acquire the original three-dimensional point cloud data of the workpiece, use statistical filtering algorithms to reduce noise, and combine weld structure features to perform region of interest (ROI) clipping and voxel grid downsampling processing. The machining coordinate construction module is used to calculate the covariance matrix of the preprocessed point cloud and perform eigenvalue decomposition to extract the orthogonal principal direction vector and its corresponding eigenvalue; it performs stability analysis through the direction separation index and adaptively determines the grinding travel direction, row spacing direction and normal reference direction based on the eigenvalue energy distribution to construct the machining coordinate system. The spatial planning reference module is used to construct a oriented bounding box (OBB) of spindle constraints in the machining coordinate system and perform plane applicability control based on the height undulation ratio to determine the projection reference plane for trajectory planning. The trajectory adaptive generation module calculates adaptive line spacing within the projection space based on the effective width of the grinding tool and the target overlap rate, generating a covering serpentine path. It then dynamically adjusts the line spacing and step size using local curvature estimates, achieving a mapping from a two-dimensional trajectory to three-dimensional space. The data encapsulation and output module is used to dynamically construct the tool attitude coordinate system by combining the surface normal information of trajectory points during the trajectory generation process, and to encapsulate the generated trajectory point positions, quaternion attitudes and process parameters in a unified manner, and output them as trajectory data for the robot control system to execute.
[0017] In summary, compared with the prior art, the above-described technical solutions conceived by this invention mainly possess the following technical advantages: 1. This invention automatically determines the grinding travel direction, row spacing direction, and normal direction based on the principal component analysis results of 3D point clouds, eliminating the need for manual experience setting or CAD model assistance, thus solving the problem of high dependence on manual adjustment of direction in traditional trajectory planning. By automatically constructing a machining coordinate system through statistical characteristics, it enables the generation of consistent machining directions for workpieces of different sizes and orientations, significantly improving the automation level of trajectory planning and on-site deployment efficiency. 2. This invention constructs a tool attitude coordinate system with the point cloud normal as the core and performs orthogonal constraint calculations in conjunction with the trajectory direction, ensuring a stable geometric relationship between the tool axis and the real surface normal. This method effectively avoids the tool skew problem caused by traditional fixed attitude or empirical angle settings, reduces local overcutting, residual bumps, and uneven texture, thereby significantly improving the consistency and surface quality of complex curved surface polishing.
[0018] 3. This invention establishes an adaptive machining coordinate system for the workpiece using PCA and extracts the projected boundary based on a directed bounding box, enabling trajectory planning without the need to establish a global surface mathematical model. This method can adapt to large-sized curved surfaces, irregular surfaces, and freeform surface structures, and can stably generate covering trajectories under different curvature distributions and spatial postures, significantly improving its adaptability to complex geometric scenes.
[0019] 4. This invention replaces high-order surface fitting with statistical principal direction analysis, avoiding the computational burden of large-scale surface reconstruction. Simultaneously, by combining point cloud preprocessing and projection space trajectory generation strategies, it significantly reduces computational complexity and improves trajectory planning speed while ensuring trajectory accuracy, making it suitable for rapid processing of large-area surfaces.
[0020] 6. The method of this invention calculates orientation and attitude entirely based on the statistical characteristics of point cloud data, generating consistent trajectory results under the same input conditions, thus avoiding inconsistencies caused by manual teaching. This characteristic helps to build standardized processing procedures, improves batch production consistency, and provides a stable foundation for automated deployment and quality traceability in intelligent manufacturing systems. Attached Figure Description
[0021] Figure 1 This is a flowchart of an automatic grinding trajectory generation method for complex curved surface welds based on point clouds, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the data preprocessing process involved in an embodiment of the present invention; Figure 3 This is a schematic diagram of the adaptive construction process of machining coordinates according to an embodiment of the present invention; Figure 4 This is a flowchart of the adaptive generation of serpentine trajectories according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the original point cloud of the workpiece involved in an embodiment of the present invention; Figure 6 This is a visualization of the weld area according to an embodiment of the present invention; Figure 7 This is a diagram showing the segmentation results of the weld and substrate regions according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the trajectory planning results involved in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0023] like Figure 1 As shown, this invention provides a method for automatically generating grinding trajectories for complex curved surface welds based on point clouds. The method mainly includes: First, denoising, downsampling, and normal estimation processing of the acquired three-dimensional point cloud data of the workpiece to improve data quality and computational stability; Second, extracting three orthogonal principal directions of the point cloud through principal component analysis (PCA), and adaptively determining the grinding travel direction, row spacing direction, and normal direction based on the magnitude of the eigenvalues, thereby constructing a machining coordinate system consistent with the workpiece geometry; Then, calculating the directed bounding box of the workpiece based on the principal directions, and extracting the projection plane corresponding to the normal as the trajectory planning reference, generating a covering serpentine grinding trajectory within the projection space to achieve complete scanning coverage of the machining area; Subsequently, during trajectory generation, dynamically constructing a tool posture coordinate system by combining the real surface normal information of each trajectory point, and adaptively adjusting parameters according to curvature changes, edge region features, constant force machining requirements, and wear compensation strategies to achieve coordinated optimization of geometric trajectory and machining process; Finally, uniformly encapsulating the generated trajectory point position information, quaternion posture information, and related process parameters, and outputting complete trajectory data that can be directly executed by the robot control system. Unlike traditional trajectory generation methods that rely on manual teaching or CAD models, this invention uses point cloud statistical characteristics to drive the determination of the processing direction, constructs a posture model through normal information, and improves processing consistency through a process linkage mechanism, achieving integrated automatic generation and intelligent optimization of complex surface robot grinding trajectories. Figure 1 As shown, the weld grinding trajectory planning method of this invention includes: Step S100: Acquisition and preprocessing of 3D point cloud data of the workpiece (1) such as Figure 2 As shown, in step S100, the present invention processes the original point cloud data. Preprocessing is performed to ensure data quality for subsequent complex surface grinding trajectory planning. First, a statistical filtering algorithm is used to reduce noise in the input point cloud (S101). Isolated points and abnormal noise points are identified and removed based on the statistical characteristics of neighborhood point distribution, thereby improving the accuracy and stability of the point cloud data. Then, considering the structural morphology characteristics of the weld workpiece, weld region clipping and region of interest (ROI) definition are applied to the point cloud (S102) to eliminate irrelevant components and interfering areas, ensuring the data range matches the actual grinding area. Furthermore, to improve the uniformity of point cloud distribution and reduce subsequent computational complexity, voxel grid uniform downsampling is applied to the clipped point cloud (S103). By dividing the spatial region into voxels and replacing voxel interior points with voxel center points, effective compression and density adjustment of the point cloud are achieved, improving the computational efficiency of subsequent principal component analysis and trajectory generation. The ROI definition and sampling expressions are as follows: (1) (2) Step S200: Adaptive construction of processing coordinates based on principal component energy criterion (2) In step S200, the present invention constructs an adaptive determination mechanism for processing direction based on principal component statistical energy distribution (e.g., Figure 3 As shown in the figure, by performing energy decomposition and directional stability assessment on the statistical features of point clouds, the automatic determination of the main processing direction and the adaptive construction of the processing coordinate system are achieved, thereby avoiding the instability problem caused by manually setting the direction. This mechanism includes three stages: covariance matrix construction, eigenvalue energy criterion analysis, and processing coordinate construction. When the direction is unstable, an enhancement mechanism is introduced to improve the reliability of direction determination under complex surfaces and weak feature regions.
[0024] a. Covariance Matrix Construction (201) Let the point cloud data after preprocessing in step S100 be: First, calculate the geometric centroid of the point cloud: To eliminate the impact of the overall translation on statistical characteristics, a decentralized vector is constructed. The point cloud covariance matrix is constructed based on decentralized vectors: (3) Among them, matrix Its elements reflect the dispersion and correlation of the point cloud in three spatial directions. The physical meaning of the covariance matrix lies in characterizing the energy distribution characteristics of the point cloud in different spatial directions, and it is the statistical basis for extracting the principal direction.
[0025] b. Eigenvalue energy criterion and directional stability analysis (202) for covariance matrix Perform eigenvalue decomposition: (k=1,2,3), where For the first 1 eigenvalue, These are the corresponding unit feature vectors, sorted by size: Eigenvalues Indicates the direction of point cloud The statistical energy magnitude of the principal direction. To quantify the significance of the principal direction, this invention defines a direction separation index: (4) in, This indicates the degree of energy advantage of the first principal direction relative to the second direction; This indicates the degree of energy advantage of the second direction relative to the third direction. A stability threshold is set. When satisfied and (5) If the separation along the main direction is significant, then the processing along the main direction is considered stable and reliable. If the above conditions are not met, it indicates that the energy distribution of the point cloud is similar in multiple directions, which may indicate problems such as approximately symmetrical surfaces, weak local geometric features, and noise disturbances. In this case, the local sliding window PCA enhancement mechanism is activated. Specifically, the point cloud is divided into several overlapping sub-blocks. The covariance matrix is calculated independently for each sub-block. and its main direction Then, the directions are merged using a weighted average method: (6) in, The energy weight of the m-th sub-block (which can be its principal eigenvalue) ).
[0026] c. Machining Coordinate System Construction (203) After the main direction is determined, define the machining coordinate system. ,in As the direction of processing. As the direction of line spacing As the normal reference direction. To construct spatial transformation relationships, a rotation matrix is formed. Where matrix R ∈ SO(3), satisfies This rotation matrix is used to transform the point cloud from the global coordinate system to the machining coordinate system: (7) By constructing the coordinates described above, the consistency between the machining direction and the main geometric direction of the workpiece is achieved, thereby ensuring that the subsequent construction of the directed bounding box, trajectory generation, and attitude control are all carried out within a reference frame that is highly matched with the workpiece geometry.
[0027] Step S300: Construction of Adaptive Directed Bounding Box and Projection Surface Based on Principal Axis Constraints (3) In step S300, this invention proposes a method for constructing a principal axis-constrained directed bounding box (OBB). By establishing geometric boundaries in the principal component coordinate system, a trajectory planning reference surface consistent with the workpiece geometry is generated. This mechanism is based on the machining coordinate system constructed in step S200. Through principal axis alignment, boundary statistical analysis, and coverage integrity criteria, a spatial planning region consistent with the workpiece geometry is constructed. A redundancy compensation mechanism ensures the trajectory coverage integrity of the edge region of complex curved surfaces. This step includes three stages: coordinate transformation, directed bounding box construction, and projection plane generation.
[0028] a. Point cloud transformation in the machining coordinate system. Let the rotation matrix constructed in step S200 be... ,in To process the unit vector in the direction of travel. The unit vector in the row spacing direction. Let be the unit vector of the normal reference direction. Let the centroid of the point cloud be... The original point cloud is Then the point cloud is expressed in the processing coordinate system as: (8) in, This transformation aligns the principal axes of the point cloud, ensuring that in the new coordinate system, the X-axis is the primary machining direction, the Y-axis is the row spacing direction, and the Z-axis is the normal direction.
[0029] b. The directed bounding box (OBB) is statistically constructed in the machining coordinate system, and the boundaries in each direction are calculated: (9) Define geometric dimensions: (10) in, Indicates the length in the main machining direction. Indicates the processing coverage width. This indicates the amplitude of surface undulation.
[0030] Unlike traditional axis-aligned bounding boxes (AABBs), this invention constructs an OBB by aligning the main axis, ensuring that the planned area is consistent with the workpiece geometry, thus avoiding trajectory redundancy or omissions caused by directional deviations.
[0031] c. Projection Surface Construction: To avoid excessive errors caused by direct projection onto regions of extreme curvature, a curvature amplitude judgment is introduced to control planar applicability, ensuring that complex surfaces maintain geometric consistency and coverage stability during the 2D planning stage. The height undulation ratio is defined as: (11) when If so, a single projection plane can be used directly; if This triggers the partitioned projection mechanism, which divides the point cloud into blocks and establishes local projection planes for each block.
[0032] Step S400: Adaptive generation of serpentine trajectory based on coverage constraints (4) The adaptive generation method of serpentine trajectory based on coverage constraints in the embodiments of the present invention is as follows: Figure 6 As shown. In step S400, this invention constructs an adaptive serpentine trajectory generation mechanism based on coverage criteria and process linkage constraints. This mechanism constructs the trajectory within the two-dimensional planning region Ω determined in step S300. By incorporating constraints on processing width, overlap rate, curvature variation, and attitude variation into the trajectory parameter calculation, it achieves coordinated optimization of trajectory coverage integrity, processing consistency, and motion smoothness. This step includes five stages: coverage modeling, adaptive row spacing calculation, serpentine path construction, curvature linkage adjustment, and trajectory optimization criteria.
[0033] a. Coverage Criterion and Line Spacing Calculation Model (S401) Let the effective processing width of the grinding tool be *x*, and the target processing overlap rate be *y*, where: *y* represents the tool contact width; *y* ∈ (0,1) represents the overlap ratio between two adjacent trajectories. Then, the theoretical line spacing is defined as: (12) To ensure coverage integrity, a coverage error criterion is introduced. ,like If so, the overlap rate d will be automatically increased and the line spacing d will be recalculated.
[0034] b. Trajectory Row Count and Boundary Matching Criterion (S402) Let the two-dimensional planning region be... Its width is: Then the theoretical trajectory number is To avoid insufficient coverage of the last row, an end-of-row compensation criterion is introduced: set up ,like Then execute To ensure complete coverage of the boundary.
[0035] c. Trajectory Function Construction (S403) Let the single-row step size be φ (φ is determined by the robot's motion resolution or the desired surface resolution), and the number of points in a single row be . .in The trajectory is defined as follows: (13) (14) in , By using an odd-even reversal mechanism, path continuity is achieved, avoiding empty line jumps.
[0036] d. Curvature Adaptive Linkage Criterion (S404) In complex curved surface regions, if the curvature is large, a fixed row spacing may lead to uneven contact. The local curvature estimate is defined as... The curvature adjustment coefficient is defined as , where parameters Let be the curvature sensitivity coefficient, then the local adaptive line spacing is... .when This triggers a local encryption mechanism, reducing line spacing.
[0037] e. 3D mapping and trajectory optimization (S405) 2D trajectory points Height is recovered by fitting nearest neighbor or local surface. , forming three-dimensional trajectory points To ensure smooth robot motion, a path curvature optimization criterion is introduced. The curvature of the trajectory formed by three adjacent points is defined. (15) like Then reduce the step size S, and define the path length optimization objective. The goal is to minimize the total path length while satisfying coverage and curvature constraints.
[0038] Step S500: Attitude calculation and trajectory data output (5) In step S500, the present invention constructs a tool posture rotation matrix based on each trajectory point and converts it into a quaternion representation to obtain the complete pose information of each trajectory point. Finally, the planned trajectory results are output in a structured manner and visualized to enhance the interpretability and engineering usability of the results. The output includes: a complete trajectory data file containing the following information, three-dimensional spatial coordinates, and quaternion pose; the data can be directly used for execution by the robot control system. Through the visualization results, users can intuitively understand the overall trajectory planning and local anomaly features of the workpiece surface, thereby providing a reliable basis for production and manufacturing.
[0039] Taking the calculation of a single workpiece containing a weld as an example, the overall process output results are as follows: Figures 5 to 8 As shown. Figure 5 The data not only includes the spatial geometry of the workpiece's actual surface, but also retains the actual undulations of the weld area, as well as noise points and local discrete points generated during the scanning process, thus providing a relatively complete reflection of the objective state of the original measurement data. Based on this, such as... Figure 6 As shown, by normalizing the elevation values of the point cloud on the reference plane and mapping them to a continuous color gradient, different height ranges are presented with differentiated colors, thus intuitively and quantitatively reflecting the bulge amplitude and spatial distribution characteristics of the weld area, making the height difference between the weld morphology and the base plane more clearly distinguishable. Furthermore, as... Figure 7 and Figure 8 As shown, the planned machining trajectory is highly consistent with the overall surface trend of the workpiece, achieving targeted coverage in the weld area while maintaining a smooth transition in the base area. The trajectory is evenly distributed and continuous in direction, with no obvious jumps or omissions, providing a stable and reliable geometric benchmark for subsequent deviation analysis and flatness evaluation.
[0040] According to another aspect of the present invention, an automatic grinding trajectory generation system for complex curved surface welds based on point clouds is also provided, for implementing an automatic grinding trajectory generation method for complex curved surface welds based on point clouds according to any of the above embodiments or combinations of multiple embodiments, comprising: The point cloud preprocessing module is used to acquire the original three-dimensional point cloud data of the workpiece, use statistical filtering algorithms to reduce noise, and combine weld structure features to perform region of interest (ROI) clipping and voxel grid downsampling processing. The machining coordinate construction module is used to calculate the covariance matrix of the preprocessed point cloud and perform eigenvalue decomposition to extract the orthogonal principal direction vector and its corresponding eigenvalue; it performs stability analysis through the direction separation index and adaptively determines the grinding travel direction, row spacing direction and normal reference direction based on the eigenvalue energy distribution to construct the machining coordinate system. The spatial planning reference module is used to construct a oriented bounding box (OBB) of spindle constraints in the machining coordinate system and perform plane applicability control based on the height undulation ratio to determine the projection reference plane for trajectory planning. The trajectory adaptive generation module calculates adaptive line spacing within the projection space based on the effective width of the grinding tool and the target overlap rate, generating a covering serpentine path. It then dynamically adjusts the line spacing and step size using local curvature estimates, achieving a mapping from a two-dimensional trajectory to three-dimensional space. The data encapsulation and output module is used to dynamically construct the tool attitude coordinate system by combining the surface normal information of trajectory points during the trajectory generation process, and to encapsulate the generated trajectory point positions, quaternion attitudes and process parameters in a unified manner, and output them as trajectory data for the robot control system to execute.
[0041] The operation steps and processes performed by each module are the same as those described above, and will not be repeated here.
[0042] In summary, this invention proposes a trajectory generation mechanism based on principal component analysis (PCA) and adaptive normal control by deeply integrating the statistical energy distribution characteristics of the workpiece's 3D point cloud and the grinding process characteristics under complex freeform surfaces. The logic and specific settings of key components such as adaptive construction of the machining coordinate system, construction of the directed bounding box (OBB) with principal axis constraints, and curvature linkage adjustment are studied and designed. Compared with traditional technologies, this invention effectively solves the core problems of machining direction dependence on human experience, insufficient matching degree between pose and real surface normal, and high dependence of trajectory planning on CAD models by driving the determination of machining direction through point cloud statistical characteristics. Simultaneously, by introducing coverage constraints and an adaptive curvature linkage mechanism, it achieves synergistic optimization of trajectory line spacing, step size, and surface geometric features, significantly improving the automation level and surface quality consistency of complex surface machining.
[0043] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for automatically generating grinding trajectories for complex curved surface welds based on point clouds, characterized in that, Includes the following steps: S100: Acquire the 3D point cloud data of the workpiece and preprocess the data; S200, based on the principal component energy criterion, adaptively constructs the processing coordinate system. It calculates the covariance matrix of the preprocessed point cloud and performs eigenvalue decomposition, extracts three orthogonal principal direction vectors and their corresponding eigenvalues, performs stability analysis by defining the direction separation index, and adaptively determines the grinding travel direction, row spacing direction and normal reference direction according to the magnitude of the eigenvalues, thereby constructing the processing coordinate system. S300, based on the spindle constraint, adaptive directed bounding box and projection surface construction, in the machining coordinate system, calculates the boundary of the point cloud in each direction by spindle alignment, constructs a directed bounding box OBB consistent with the workpiece geometry, and performs plane applicability control according to the height fluctuation ratio to determine the projection reference plane for trajectory planning; S400 is a serpentine trajectory adaptive generation based on coverage constraints. In the projection plane, it calculates the adaptive row spacing by combining the effective width of the workpiece being polished and the target overlap rate. It determines the number of trajectory rows based on the width of the planned area, generates a covering serpentine path using an odd-even inversion mechanism, and dynamically adjusts the row spacing and step size by combining the local curvature estimation value. Finally, it maps the two-dimensional trajectory points back to the three-dimensional space. The S500 dynamically constructs the tool's attitude coordinate system based on the real surface normal information of each trajectory point, and encapsulates the generated trajectory point position information, quaternion attitude information, and process parameters, outputting the trajectory data that can be executed by the robot control system.
2. The method for generating automatic grinding trajectories for complex curved surface welds based on point clouds according to claim 1, characterized in that, S100 includes the following steps: S101, Obtain the original point cloud data of the workpiece, use a statistical filtering algorithm to reduce noise in the original point cloud data, and identify and remove isolated points and abnormal noise points based on the statistical characteristics of the distribution of neighborhood points. S102, Combining the structural morphology characteristics of the workpiece, the weld area is clipped and the region of interest is defined on the point cloud to eliminate irrelevant components and interference areas, ensuring that the data range is consistent with the actual grinding area; S103, perform voxel grid uniform downsampling on the point cloud after cropping in step S102. By dividing the spatial region into voxels and replacing the voxel inner points with the voxel center points, the number of point clouds is effectively compressed and the density is adjusted.
3. The method for automatically generating grinding trajectories for complex curved surface welds based on point clouds according to claim 2, characterized in that, The calculation formula for defining the region of interest includes: ; In the formula, This refers to the subset of point clouds retained after ROI filtering. The raw point cloud data, , Let N be the i-th 3D point in the original point cloud, and let N be the total number of 3D points in the point cloud set P. These are the minimum and maximum values of the x-coordinate, respectively. These are the minimum and maximum values of the y-coordinate, respectively. These are the minimum and maximum values of the z-coordinate, respectively. Points p i Coordinate values on the three axes, Region of interest; Preferably, the calculation formula for the uniform downsampling of the voxel grid includes: ; In the formula, This is the set of downsampled point clouds. The center point of the voxel, The number of primitive points contained within a single voxel. It is the k-th origin point within the voxel.
4. The method for automatically generating grinding trajectories for complex curved surface welds based on point clouds according to claim 2, characterized in that, S200 includes the following steps: S201, Calculate the geometric centroid of the point cloud data preprocessed in step S100. To eliminate the influence of overall translation on statistical features, construct a decentralized vector. The point cloud covariance matrix is established based on decentralized vectors; S202, Perform eigenvalue decomposition on the covariance matrix: k=1, 2, 3, where, This is the eigenvalue decomposition expression for the covariance matrix. For the first 1 eigenvalue, These are the corresponding unit feature vectors, sorted by size: eigenvalues Indicates the direction of point cloud The statistical energy magnitude is used to define a direction separation index, and the processing principal direction is quantized based on this index. Stability analysis is then performed on the quantized processing principal direction. If the principal direction separation is significant, the processing principal direction is stable and reliable; otherwise, a local sliding window PCA enhancement mechanism is adopted, which divides the point cloud into several overlapping sub-blocks. The covariance matrix is calculated independently for each sub-block. and its main direction Then, the directions are merged using a weighted average method, and the merged direction is used as the main processing direction. S203, Define the machining coordinate system ,in As the direction of processing. As the direction of line spacing As the normal reference direction, construct the rotation matrix. And the rotation matrix satisfies It is used to transform the point cloud from the global coordinate system to the machining coordinate system, thereby ensuring the consistency between the machining direction and the main geometric direction of the workpiece.
5. The method for generating automatic grinding trajectories for complex curved surface welds based on point clouds according to claim 4, characterized in that, The point cloud covariance matrix includes: ; In the formula, Let N be the point cloud covariance matrix; Preferably, the calculation model for the directional separation index includes: ; In the formula, This indicates the degree of energy advantage of the first principal direction relative to the second direction. This indicates the degree of energy advantage of the second direction relative to the third direction; Preferably, the stability analysis includes: Set a stability threshold If satisfied and If the separation in the main direction is obvious, the processing in the main direction is stable and reliable; otherwise, it indicates that the energy distribution of the point cloud is similar in multiple directions, and a local sliding window PCA enhancement mechanism is adopted.
6. The method for automatically generating grinding trajectories for complex curved surface welds based on point clouds according to claim 1, characterized in that, The S300 includes: S301, Based on the machining coordinate system, calculate the boundaries in each direction: ; Define geometric dimensions: ; in, Indicates the length in the main machining direction. Indicates the processing coverage width. Indicates the amplitude of surface undulation. This represents the coordinate position of the point cloud in the processing coordinate system; S302, Perform planar suitability control based on the height undulation ratio, wherein the calculation model for the height undulation ratio includes: ; In the formula, The height fluctuation ratio; S303, when Then a single projection plane can be used directly, if This triggers the partitioned projection mechanism, which divides the point cloud into blocks and establishes local projection planes for each block.
7. The method for generating automatic grinding trajectories for complex curved surface welds based on point clouds according to claim 1, characterized in that, The S400 includes the following steps: S401, a theoretical row spacing calculation model is constructed based on the effective processing width of the grinding tool and the target processing overlap rate, and a coverage error criterion is introduced to ensure the coverage integrity of the row spacing; S402 calculates the theoretical number of trajectory rows based on the two-dimensional planning area and introduces the end compensation criterion to ensure complete boundary coverage; S403, determine the number of single-row points according to the length of the main processing direction and the single-row step length, and generate a covering serpentine path based on the number of single-row points using the odd-even reversal mechanism; S404, for trajectories with large curvature, the local curvature estimate is defined as... The curvature adjustment coefficient is defined as , where parameters Let be the curvature sensitivity coefficient, then the local adaptive line spacing is... ,when This triggers a local encryption mechanism to reduce line spacing; S405, recovering two-dimensional trajectory points using nearest neighbor search or local surface fitting algorithms. Height coordinates To form a complete three-dimensional spatial trajectory point To ensure smooth robot motion, the trajectory curvature is constructed based on three adjacent trajectory points. Criterion; when the trajectory curvature Exceeding the smoothing threshold At the same time, optimization is achieved by reducing the single-row step size S; simultaneously, while satisfying the coverage and curvature constraints, a path length optimization objective is introduced. The goal is to minimize the total path length while satisfying coverage and curvature constraints.
8. The method for automatically generating grinding trajectories for complex curved surface welds based on point clouds according to claim 7, characterized in that, The theoretical line spacing calculation model includes: ; In the formula, 𝑊 is the effective processing width of the grinding tool, 𝜌 is the target processing overlap rate, and 𝜌∈(0,1). Line spacing; Preferably, the coverage error criterion includes: ; In the formula, For coverage error, if If this happens, the overlap rate φ will be automatically increased, and the line spacing d will be recalculated. Preferably, the end-compensation criterion includes: set up ,like Then execute To ensure complete boundary coverage, This indicates a wide processing coverage. This refers to the remaining processing allowance at the end of the process. This refers to the planned number of processing rows.
9. The method for automatically generating grinding trajectories for complex curved surface welds based on point clouds according to claim 7, characterized in that, In step S403, the covering serpentine path includes: ; ; in, It is a covering serpentine path. , , These represent the maximum and minimum x-coordinate values within the processing row, respectively. These are the path point numbers and the path point spacing, respectively. Preferably, the trajectory curvature The computational models include: ; In the formula, To refine the i-th path point on the trajectory.
10. A method for automatically generating grinding trajectories for complex curved surface welds based on point clouds, characterized in that, include: The point cloud preprocessing module is used to acquire the original three-dimensional point cloud data of the workpiece, use statistical filtering algorithms to reduce noise, and combine weld structure features to perform region of interest (ROI) clipping and voxel grid downsampling processing. The machining coordinate construction module is used to calculate the covariance matrix of the preprocessed point cloud and perform eigenvalue decomposition to extract the orthogonal principal direction vector and its corresponding eigenvalue; it performs stability analysis through the direction separation index and adaptively determines the grinding travel direction, row spacing direction and normal reference direction based on the eigenvalue energy distribution to construct the machining coordinate system. The spatial planning reference module is used to construct a oriented bounding box (OBB) of spindle constraints in the machining coordinate system and perform plane applicability control based on the height undulation ratio to determine the projection reference plane for trajectory planning. The trajectory adaptive generation module is used to calculate the adaptive line spacing in the projection space based on the effective width of the grinding tool and the overlap rate of the target, generate a covering serpentine path, and dynamically adjust the line spacing and step size in combination with the local curvature estimation value to realize the mapping of the two-dimensional trajectory to the three-dimensional space. as well as The data encapsulation and output module is used to dynamically construct the tool attitude coordinate system by combining the surface normal information of trajectory points during the trajectory generation process, and to encapsulate the generated trajectory point positions, quaternion attitudes and process parameters in a unified manner, and output them as trajectory data for the robot control system to execute.
Citation Information
Patent Citations
Device and method for identifying weld features and automatically grinding and polishing complex curved surfaces
CN110091333B
Welding deformation self-adaptive linear welding seam polishing track generation method and device
CN115358965A