Method and system for detecting welding seam defects of transformer oil tank based on three-dimensional vision and robot polishing
Patent Information
- Application Number
- CN202611314711.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-10-27
AI Technical Summary
然而,现有技术仍存在以下不足:许多现有方法直接利用原始点云进行缺陷判断,缺乏对焊缝局部三维曲面模型的精细化重构,导致在复杂光照或反光环境下,缺陷识别的鲁棒性较差,容易将正常焊缝过渡区误判为缺陷
[0051]本发明通过构建局部三维曲面模型并与理想焊缝标准模型进行空间对齐配准,计算法向距离来识别异常区域,有效避免了直接利用原始点云在复杂环境下易将正常过渡区误判为缺陷的问题,提高了检测的鲁棒性。在缺陷分类环节,本发明首先根据最大法向偏差值的正负性将候选缺陷区分划分为凸出类和凹陷类,随后针对凸出类缺陷,依据平均正向偏差量是否大于第一预设阈值,精准区分余高过大与飞溅或焊瘤;针对凹陷类缺陷,结合平均负向偏差量的绝对值及位置信息,准确判定咬边、未焊透或气孔。这种基于几何特征参数和预设阈值的分级判定逻辑,不仅实现了缺陷类型的快速、准确识别,防止了误判,还为后续的等级量化提供了可靠基础。在等级量化方面,本发明针对不同缺陷类型设定了具体的阈值区间,如余高过大依据平均正向偏差量划分三级,飞溅或焊瘤依据体积划分两级,咬边依据深度和长度划分两级,未焊透或气孔依据深度和宽度划分三级,从而科学地反映了缺陷的实际危害程度。最后,根据缺陷等级和类型确定处理优先级,并结合机器人轨迹规划,实现了从检测到打磨的全流程自动化和智能化,显著提升了变压器油箱焊缝的处理效率和质量。
Smart Images

Figure CN122989699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect detection technology, and in particular to a method and system for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision. Background Technology
[0002] As a core piece of equipment in a power system, the sealing performance of the transformer's oil tank directly affects its safe operation and service life. During the manufacturing process of the transformer oil tank, weld quality is a key factor determining the overall strength and sealing performance of the tank. Common welding defects include excessive weld reinforcement, spatter, weld beads, undercut, incomplete penetration, and porosity. These defects not only reduce the mechanical properties of the weld but can also lead to oil leakage accidents, resulting in serious safety hazards. Therefore, efficient and accurate defect detection and subsequent treatment of transformer oil tank welds are crucial.
[0003] Traditional transformer tank weld quality inspection mainly relies on manual visual inspection or simple non-destructive testing methods. However, manual inspection is inefficient, highly subjective, and difficult to quantify the specific size and shape of defects. While traditional non-destructive testing can detect internal defects, it has limited ability to quantify surface morphology defects, such as excess weld height and spatter, and cannot directly guide subsequent grinding and repair work.
[0004] With the development of machine vision technology, 3D vision-based weld inspection is increasingly being applied in industrial fields. Existing 3D vision inspection methods typically acquire point cloud data of welds using structured light or laser scanning and attempt to identify defects. However, existing technologies still have the following shortcomings: many existing methods directly utilize the raw point cloud for defect judgment, lacking refined reconstruction of the local 3D surface model of the weld. This results in poor robustness of defect identification under complex lighting or reflective environments, easily misclassifying normal weld transition zones as defects. Furthermore, existing solutions often only distinguish between defective and non-defective areas, or rely on simple thresholds for coarse classification, failing to combine defect type and its geometric characteristics for comprehensive grading, thus failing to accurately reflect the actual severity of defects. Especially in defect type determination, existing technologies often lack clear classification logic, easily confusing different types of defects. For example, excessive weld reinforcement may be misclassified as ordinary spatter, or undercut may be misclassified as other types of dent defects. This not only affects the accuracy of defect identification but also reduces the speed and reliability of inspection, making it difficult to meet the needs of rapid and accurate defect classification in actual production.
[0005] After detecting multiple defects, existing technologies typically generate grinding paths in spatial or random order, without scientifically prioritizing grinding operations based on the severity and type of the defects. This can easily lead to robots prioritizing minor defects while ignoring serious ones, or to processing in a sequence that does not conform to process specifications, reducing grinding efficiency and repair effectiveness. Furthermore, the results generated by the detection system are mostly static two-dimensional images or simple coordinate lists, failing to form a structured map containing defect types, locations, and processing priorities, making it difficult to directly drive the robot for refined trajectory planning and grinding control.
[0006] Therefore, there is an urgent need for technical solutions for transformer tank weld defect detection and robotic grinding methods and systems based on 3D vision. Summary of the Invention
[0007] To address the aforementioned technical problems, embodiments of the present invention provide a method for detecting defects in transformer tank welds and performing robotic grinding based on three-dimensional vision, specifically including the following steps:
[0008] S1. Obtain the original point cloud data of the transformer tank weld area and preprocess the original point cloud data to obtain a standard point cloud dataset.
[0009] S2. Extract the weld centerline trajectory and weld cross-sectional geometric feature parameter sequence based on standard point cloud dataset;
[0010] S21. Using the first point distributed along the weld extension direction in the standard point cloud dataset as the starting seed point, the standard point cloud data is iteratively clustered using the K-means clustering algorithm until all points are assigned to one of the following clusters: the base material region cluster and the weld reinforcement region cluster.
[0011] S22. Extract the point cloud data belonging to the base material region cluster, and fit two straight lines located on both sides of the weld and parallel to the weld extension direction using the least squares method, as the left base material edge line and the right base material edge line.
[0012] S23. Extract a vertical slice of a preset width from the standard point cloud dataset along the weld extension direction, and obtain a subset of the point cloud within the current slice.
[0013] S24. Select points belonging to the weld reinforcement region cluster from the point cloud subset within the current slice, calculate the average height value of these points as the instantaneous reinforcement point at the current slice, and take the midpoint between the left and right base material edge lines at the current slice position as the instantaneous center point.
[0014] S25. Connect the instantaneous center points of all slice positions to form a discrete center point sequence, and perform cubic spline smoothing on the center point sequence to generate a globally continuous weld centerline trajectory.
[0015] S26. For each slice position, record the vertical distance from the instantaneous residual height point at the current slice position to the reference line formed by the left and right base material edge lines as the residual height value. At the same time, record the distance between the left and right base material edge lines at the current slice position as the weld width, and obtain the complete sequence of weld section geometric feature parameters.
[0016] S3. Construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric characteristic parameters of the weld section, and identify abnormal areas in the local three-dimensional surface model as candidate defect areas.
[0017] S301. Using the global continuous weld centerline trajectory as the reference ridge line, select several discrete points along the reference ridge line direction as control sampling points for surface construction.
[0018] S302. Map each control sampling point to all slice positions one by one, so that each control sampling point corresponds to a slice position.
[0019] S303. For each control sampling point, read the residual height value of the corresponding slice position as the height of the current control sampling point, and read the weld width of the corresponding slice position as the width of the current control sampling point.
[0020] S304. In a plane perpendicular to the weld centerline trajectory, take the instantaneous center point corresponding to the current control sampling point as the vertex, and take the two intersection points of the left and right base material edge lines at the current slice position as the bottom endpoints. Use the height of the current control sampling point to determine the vertical distance of the vertex relative to the bottom edge, and use the width of the current control sampling point to determine the length of the bottom edge, and construct the triangular cross-sectional profile of the current control sampling point.
[0021] S305. Using the B-spline surface fitting algorithm, the triangular cross-sectional contours of all control sampling points are smoothly connected along the weld centerline trajectory to generate a continuous local three-dimensional surface model covering the entire weld area.
[0022] S311. Establish an ideal weld standard model, which consists of a series of regular triangular sections distributed along the global continuous weld centerline trajectory; for each of the regular triangular sections, the height is set to the theoretical average residual height value, and the width is set to the theoretical average weld width.
[0023] S312. Spatial alignment and registration of the local three-dimensional surface model and the ideal weld standard model, so that the reference ridge lines of the two coincide, and calculate the normal distance from each point on the surface of the local three-dimensional surface model to the surface of the ideal weld standard model.
[0024] S313. Set positive deviation threshold and negative deviation threshold. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is greater than the positive deviation threshold, the current point is marked as a convex abnormal point.
[0025] S314. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is less than the negative deviation threshold, the current point is marked as a depression anomaly point.
[0026] S315. Perform connected component analysis on all protruding and concave anomalies in space, merge adjacent anomalies to form closed three-dimensional regions, and use each closed three-dimensional region as a candidate defect area.
[0027] S4. Perform morphological classification and grading of candidate defect areas to generate a defect distribution map containing defect type, location coordinates and processing priority.
[0028] S41. Extract the three-dimensional geometric feature parameters of each candidate defect area, divide the candidate defect area into at least one defect type according to the three-dimensional geometric feature parameters, and determine the defect level of each defect type;
[0029] S41a1. Calculate the maximum normal deviation value for each candidate defect area, wherein the maximum normal deviation value is the absolute maximum value of the normal distances from all points in each candidate defect area to the surface of the ideal weld standard model.
[0030] S41a2. Determine the sign of the maximum normal deviation value: if the maximum normal deviation value is positive, then mark the current candidate defect area as a convex defect; if the maximum normal deviation value is negative, then mark the current candidate defect area as a concave defect.
[0031] S41a3. For candidate defect areas marked as protruding defects, the average positive deviation relative to the ideal weld standard model is further calculated. When the average positive deviation is greater than the first preset threshold, the candidate defect area currently marked as protruding defects is classified as a defect with excessive excess height; otherwise, it is classified as a spatter or weld bead defect.
[0032] S41a4. For candidate defect areas marked as dent defects, the average negative deviation relative to the ideal weld standard model is further calculated. When the absolute value of the average negative deviation is less than the second preset threshold and the candidate defect area is located near the edge line of the base material, the candidate defect area currently marked as dent defects is classified as undercut defects. When the absolute value of the average negative deviation is greater than or equal to the second preset threshold, the candidate defect area currently marked as dent defects is classified as incomplete penetration or porosity defects.
[0033] S41b1. For defects with excessive excess height, the defect level is divided into three levels based on the average positive deviation: when the average positive deviation is greater than the first preset threshold and less than or equal to the third preset threshold, it is defined as a level one defect; when the average positive deviation is greater than the third preset threshold and less than or equal to the fourth preset threshold, it is defined as a level two defect; when the average positive deviation is greater than the fourth preset threshold, it is defined as a level three defect.
[0034] S41b2. For spatter or weld bead defects, the defect level is divided into Level 1 and Level 2 based on the volume of the candidate defect area: when the volume of the candidate defect area is less than the preset volume threshold, it is defined as Level 1 defect; when the volume of the candidate defect area is greater than or equal to the preset volume threshold, it is defined as Level 2 defect.
[0035] S41b3. For undercut defects, the defect level is divided into Level 1 and Level 2 based on the absolute value of the average negative deviation and the length of the defect along the weld direction: when the absolute value of the average negative deviation is less than the second preset threshold and the length is less than the preset length threshold, it is defined as Level 1 defect; otherwise, it is defined as Level 2 defect.
[0036] S41b4. For incomplete penetration or porosity defects, the defect level is divided into three levels based on the absolute value of the average negative deviation and the width of the defect in the direction perpendicular to the weld: Level 1, Level 2, and Level 3 are defined as follows: when the absolute value of the average negative deviation is greater than or equal to the second preset threshold and less than or equal to the fifth preset threshold, and the width is less than the preset width threshold, it is defined as a Level 1 defect; when the absolute value of the average negative deviation is greater than the fifth preset threshold and less than or equal to the sixth preset threshold, or the width is greater than or equal to the preset width threshold, it is defined as a Level 2 defect; when the absolute value of the average negative deviation is greater than the sixth preset threshold, it is defined as a Level 3 defect.
[0037] S42. Obtain the spatial coordinates of each candidate defect area in the local three-dimensional surface model;
[0038] S43. Determine the processing priority of each candidate defect area according to the defect type and defect level;
[0039] S431. Mark Level 3 defects as first priority, Level 2 defects as second priority, and Level 1 defects as third priority;
[0040] S432. Within candidate defect areas of the same priority, further secondary sorting is performed according to the severity of the defect type: for recessed defects, incomplete penetration or porosity defects are ranked higher than undercut defects; for protruding defects, excessive weld bead height defects are ranked higher than spatter or weld bead defects.
[0041] S433. Sort all candidate defect areas according to priority and sub-priority to determine the processing priority of each candidate defect area.
[0042] S44. Summarize the defect types, location coordinates, and processing priorities of all candidate defect areas to generate a defect distribution map;
[0043] S5. Plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory.
[0044] This embodiment also discloses a transformer tank weld defect detection and robotic grinding system based on three-dimensional vision, including the following modules:
[0045] Data acquisition module: used to acquire raw point cloud data of the weld area of transformer tank and preprocess the raw point cloud data to obtain a standard point cloud dataset;
[0046] Data processing module: Connected to the data acquisition module, it is used to extract the weld centerline trajectory and the sequence of geometric feature parameters of the weld section based on the standard point cloud dataset;
[0047] Identification module: Connected to the data processing module, it is used to construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric feature parameters of the weld section, and to identify abnormal areas in the local three-dimensional surface model as candidate defect areas;
[0048] Classification and quantization module: Connected to the recognition module, it is used to perform morphological classification and grading of candidate defect areas, and generate a defect distribution map containing defect type, location coordinates and processing priority;
[0049] Planning module: Connected to the classification and quantization module, it is used to plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory.
[0050] The embodiments of the present invention have the following technical effects:
[0051] This invention identifies abnormal regions by constructing a local three-dimensional curved surface model and spatially aligning it with an ideal weld standard model, then calculating the normal distance. This effectively avoids the problem of misjudging normal transition areas as defects in complex environments when directly using the original point cloud, thus improving the robustness of detection. In the defect classification stage, this invention first classifies candidate defects into protrusion and depression categories based on the sign of the maximum normal deviation value. Then, for protrusion defects, it accurately distinguishes between excessive weld height and spatter or weld beads based on whether the average positive deviation is greater than a first preset threshold. For depression defects, it accurately determines undercut, incomplete penetration, or porosity by combining the absolute value of the average negative deviation and location information. This hierarchical judgment logic based on geometric feature parameters and preset thresholds not only achieves rapid and accurate identification of defect types and prevents misjudgment, but also provides a reliable foundation for subsequent grading. In terms of grading, this invention sets specific threshold ranges for different defect types. For example, excessive weld bead height is classified into three levels based on the average positive deviation; spatter or weld beads are classified into two levels based on volume; undercut is classified into two levels based on depth and length; and incomplete penetration or porosity is classified into three levels based on depth and width. This scientifically reflects the actual severity of the defects. Finally, processing priorities are determined based on the defect grade and type, and combined with robot trajectory planning, the entire process from detection to grinding is automated and intelligent, significantly improving the processing efficiency and quality of transformer tank welds.
[0052] In summary, this invention effectively solves the problem of misjudgment caused by environmental interference in existing technologies by constructing a local three-dimensional curved surface model and comparing it with an ideal model, thus improving the accuracy and robustness of defect identification. Simultaneously, based on the sign of the normal deviation and specific geometric feature parameters, defect types are meticulously classified, and each defect is quantified in terms of severity using preset thresholds, objectively reflecting the degree of harm caused by the defect. Furthermore, processing priorities are determined according to the defect level and type, guiding the robot to prioritize the handling of severe defects and optimizing the grinding path planning. This not only overcomes the shortcomings of low efficiency and strong subjectivity of manual inspection, as well as the inability of traditional non-destructive testing to guide repair, but also achieves seamless integration of inspection and grinding operations, significantly improving the automation level and overall quality of transformer tank weld treatment, and possesses significant practical value. Attached Figure Description
[0053] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0054] Figure 1This is a flowchart of a method for detecting defects in transformer tank welds and performing robotic grinding based on three-dimensional vision, provided in an embodiment of the present invention.
[0055] Figure 2 This is a framework diagram of the transformer tank weld defect detection and robotic grinding system based on three-dimensional vision provided in an embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0057] Example 1: As Figure 1 As shown, the present invention provides a method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision, comprising the following steps:
[0058] S1. Obtain the original point cloud data of the transformer tank weld area and preprocess the original point cloud data to obtain a standard point cloud dataset.
[0059] In this embodiment, a 3D laser scanner is first fixed to the end of a robotic arm or mounted on a fixed bracket. The scanning position is adjusted so that the scanning field of view covers the weld area of the transformer tank to be inspected. The scanner is then activated, and by emitting a laser beam and receiving reflected signals, it acquires the spatial coordinate information of the weld surface and the surrounding base material, thereby obtaining raw point cloud data containing a large number of disordered points. Since the raw point cloud data often contains noise, outliers, and points from non-weld areas such as the background environment and fixtures, it is necessary to preprocess the raw point cloud data to obtain a standard point cloud dataset. The specific preprocessing operations include: First, using a statistical filtering algorithm to denoise the original point cloud. By calculating the average distance from each point to its neighboring points, outliers whose average distance is significantly greater than the global average distance are removed to eliminate isolated noise points caused by scanning errors. Second, using a pass-through filter, based on a preset spatial range limit, point cloud data located near the weld area is retained, while irrelevant point clouds in the background environment and non-target areas are cropped, thus focusing on the weld itself. Finally, the cropped point cloud data is resampled and homogenized to ensure that the point cloud density is moderate and the distribution is relatively uniform, avoiding the impact of excessively dense or sparse point clouds on the accuracy of feature extraction in subsequent calculations. The final result is a standard point cloud dataset with a clear structure, less noise, and containing only the geometric information of the weld area.
[0060] S2. Extract the weld centerline trajectory and weld cross-sectional geometric feature parameter sequence based on standard point cloud dataset;
[0061] S21. Using the first point distributed along the weld extension direction in the standard point cloud dataset as the starting seed point, the standard point cloud data is iteratively clustered using the K-means clustering algorithm until all points are assigned to one of the following clusters: the base material region cluster and the weld reinforcement region cluster.
[0062] In this embodiment, the point with the smallest coordinate value along the weld extension direction is first selected from the standard point cloud dataset and used as the starting seed point. Next, the K-means clustering algorithm is used to iteratively cluster the standard point cloud data. Specifically, two initial cluster centers are pre-defined, randomly selected based on the spatial location characteristics of the starting seed point and its neighbors. In each iteration, the Euclidean distance from each point in the standard point cloud dataset to these two initial cluster centers is calculated, and each point is assigned to the cluster of the nearest cluster center, thus forming two temporary clusters: the base material region cluster and the weld reinforcement region cluster. The base material region cluster mainly contains relatively flat points with low height, i.e., the surface of the transformer tank body; the weld reinforcement region cluster mainly contains raised areas formed by the welding process, including normal weld reinforcement and areas with defects such as excessive reinforcement, spatter, weld beads, undercut, incomplete penetration, or porosity. After all points are assigned, the geometric center (mean) of all points within each cluster is recalculated, and this geometric center is used as the new cluster center. Repeat the above process until all points at the cluster centers no longer change cluster affiliation in two consecutive iterations. At this point, the iteration ends, and each point in the standard point cloud dataset is stably assigned to either the base material region cluster or the weld reinforcement region cluster. This binary classification method clearly separates the weld structure regions that require focused analysis, eliminating interference from background noise and the smooth base material surface, laying the foundation for subsequent construction of local 3D surface models and accurate identification of defect types.
[0063] S22. Extract the point cloud data belonging to the base material region cluster, and fit two straight lines located on both sides of the weld and parallel to the weld extension direction using the least squares method, as the left base material edge line and the right base material edge line.
[0064] In this embodiment, firstly, all point cloud data belonging to the base material region cluster are selected from the standard point cloud dataset. These points constitute the relatively flat surface areas on both sides of the transformer tank weld. To determine the specific location boundary of the weld on the plane, the edge features at the junction of the base material and the weld need to be extracted. Specifically, the point cloud data belonging to the base material region cluster is first projected onto a two-dimensional plane perpendicular to the weld extension direction. Since the base material surfaces on both sides of the weld are relatively flat, the average height and centerline position of the base material surface on that side can be determined by calculating the mean coordinate of each point perpendicular to the weld extension direction. Next, point sets near the weld center are collected for the left and right base material regions respectively, and the least squares method is used to fit these points with a straight line. The core idea of the least squares method is to find a straight line that minimizes the sum of the squares of the perpendicular distances from all points involved in the fitting to that line. Through matrix operations, the optimal fitting line parameters describing the left and right base material edges are obtained. These two straight lines are defined as the left and right edge lines of the base material, respectively. They not only reflect the basic orientation of the base material surface, but also serve as spatial reference lines for subsequent judgment of weld geometry such as weld reinforcement and undercut, ensuring the consistency and accuracy of the coordinate system for subsequent defect detection.
[0065] S23. Extract a vertical slice of a preset width from the standard point cloud dataset along the weld extension direction, and obtain a subset of the point cloud within the current slice.
[0066] In this embodiment, to perform localized refined analysis of the weld, a vertical slice of a certain width needs to be extracted from the standard point cloud dataset along the weld extension direction. Specifically, regarding the setting of the preset width, firstly, the average distance between the left and right edge lines of the parent material in the point cloud data belonging to the parent material region cluster is statistically analyzed. This distance reflects the typical width characteristics of the transformer tank weld region. Based on this, the preset width is set to between 1.5 and 2 times the aforementioned average distance, for example, 1.8 times the average distance. The reason for this setting is that the preset width needs to be wide enough to include the complete weld reinforcement area and the necessary transition background on both sides, ensuring that the transverse cross-sectional shape of the weld can be fully presented within the slice, while avoiding excessive width that would introduce too many irrelevant parent material noise points, affecting the accuracy and efficiency of subsequent calculations. After determining the specific preset width value, the region of this width is slidably extracted along the weld extension direction, i.e., the previously determined straight line direction, with a fixed step size such as 0.5mm or 1mm, thereby obtaining a series of independent point cloud subsets. Each point cloud subset contains three-dimensional spatial information of the weld and its adjacent base material at a specific location, providing basic data units for subsequent construction of local three-dimensional surface models.
[0067] S24. Select points belonging to the weld reinforcement region cluster from the point cloud subset within the current slice, calculate the average height value of these points as the instantaneous reinforcement point at the current slice, and take the midpoint between the left and right base material edge lines at the current slice position as the instantaneous center point.
[0068] In this embodiment, the first step is to accurately filter out points belonging to the weld reinforcement region cluster from the point cloud subset within the current slice. Specifically, each point in the point cloud subset is traversed, and its cluster label is checked. Since all standard point cloud data has already been divided into base material region clusters and weld reinforcement region clusters using the K-means clustering algorithm in step S21, direct extraction is sufficient. Subsequently, the arithmetic mean of these valid points along the Z-axis is calculated; this value is the instantaneous reinforcement point at the current slice, representing the center height characteristic of the weld bulge at this section. Simultaneously, to determine the lateral center position of the weld, the midpoint of the horizontal coordinates corresponding to the left and right base material edge lines at the current slice position—that is, the coordinates perpendicular to the weld extension direction—is taken; this midpoint is the instantaneous center point. The instantaneous center point and the instantaneous reinforcement point together constitute the two-dimensional key parameters of the weld geometry at the current slice.
[0069] S25. Connect the instantaneous center points of all slice positions to form a discrete center point sequence, and perform cubic spline smoothing on the center point sequence to generate a globally continuous weld centerline trajectory.
[0070] In this embodiment, the instantaneous center points of all slice positions calculated in step S24 are first arranged in order of weld extension direction to form a discrete center point sequence. Since these points are obtained by slicing based on a fixed step size, they are spatially discrete and may contain minor fluctuations caused by point cloud noise. Direct connection would result in an uneven trajectory, affecting the accuracy of subsequent defect detection. Therefore, this sequence needs to be subjected to cubic spline smoothing to generate a globally continuous weld centerline trajectory. Specifically, the coordinates of each instantaneous center point along the weld extension direction are used as the independent variable. Its lateral and height coordinates, perpendicular to the weld extension direction, are used as dependent variables. and The core idea of cubic spline interpolation is to construct a cubic polynomial function between two adjacent discrete points, such that this function not only passes through the given data points at the nodes, but also that its first and second derivatives are continuous, thus ensuring the smoothness of the curve. In actual calculations, we first establish the relationship between the independent variable and the given data points. The piecewise cubic polynomial equation system is used, and boundary conditions are employed, such as setting the second derivatives at both ends to zero (i.e., natural boundary conditions), to solve for the coefficients of each polynomial segment. After obtaining all control points by solving the linear equation system, the corresponding values can be calculated at any non-node location. and Coordinate values. Finally, the generated polynomial function is sampled along the weld extension direction at small intervals, such as 0.1 mm, to obtain a series of dense coordinate points. Connecting these points sequentially forms a globally continuous weld centerline trajectory.
[0071] S26. For each slice position, record the vertical distance from the instantaneous residual height point at the current slice position to the reference line formed by the left and right base material edge lines as the residual height value. At the same time, record the distance between the left and right base material edge lines at the current slice position as the weld width, and obtain the complete sequence of weld section geometric feature parameters.
[0072] S3. Construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric characteristic parameters of the weld section, and identify abnormal areas in the local three-dimensional surface model as candidate defect areas.
[0073] S301. Using the global continuous weld centerline trajectory as the reference ridge line, select several discrete points along the reference ridge line direction as control sampling points for surface construction.
[0074] S302. Map each control sampling point to all slice positions one by one, so that each control sampling point corresponds to a slice position.
[0075] S303. For each control sampling point, read the residual height value of the corresponding slice position as the height of the current control sampling point, and read the weld width of the corresponding slice position as the width of the current control sampling point.
[0076] S304. In a plane perpendicular to the weld centerline trajectory, take the instantaneous center point corresponding to the current control sampling point as the vertex, and take the two intersection points of the left and right base material edge lines at the current slice position as the bottom endpoints. Use the height of the current control sampling point to determine the vertical distance of the vertex relative to the bottom edge, and use the width of the current control sampling point to determine the length of the bottom edge, and construct the triangular cross-sectional profile of the current control sampling point.
[0077] S305. Using the B-spline surface fitting algorithm, the triangular cross-sectional contours of all control sampling points are smoothly connected along the weld centerline trajectory to generate a continuous local three-dimensional surface model covering the entire weld area.
[0078] In this embodiment, the specific process of generating a continuous local three-dimensional surface model using the B-spline surface fitting algorithm is as follows: First, the triangular cross-sectional profiles of all control sampling points constructed in step S304 are regarded as a series of discrete cross-sectional skeletons distributed along the weld centerline trajectory. Since these cross-sections are calculated independently, direct splicing will produce sharp corners or discontinuities between adjacent cross-sections. In order to obtain a smooth transition surface, the B-spline surface fitting algorithm is used to optimize these cross-sectional data as a whole. Specifically, the direction parameter of the weld centerline trajectory is used as one parameter direction of the surface, such as the u direction, and the lateral span of each triangular cross-sectional profile from the bottom edge to the vertex is used as another parameter direction, such as the v direction. The coordinates of the triangle vertices and the bottom edge endpoints corresponding to all control sampling points are organized into a two-dimensional control point grid. The B-spline surface uses a set of basis functions to perform a weighted summation of these control points. Its core advantage is that it has local support, that is, modifying a certain control point will only affect the local area covered by the basis functions, without causing global deformation, while ensuring that the surface achieves second-order or even higher-order smoothness at the connection. During calculation, a system of linear equations is established based on preset node vectors and orders. The mathematical expression describing the entire surface is then solved, seamlessly and smoothly connecting all discrete triangular cross-sectional profiles into a continuous local three-dimensional surface model covering the entire weld area. Specifically, the mathematical expression of the surface is: ;
[0079] in, This represents the three-dimensional spatial coordinate vector of any point on the generated continuous local three-dimensional surface model; The first directional parameter variable of the surface, i.e. along the weld length direction, typically has a value range of [0,1]. The second directional parameter variable of the surface, i.e. along the width of the cross section, usually takes values in the range of [0,1]. Indicates the control point grid in Direction, i.e., the index subscript of the weld length direction; Indicates the control point grid in Direction, specifically the index subscript in the direction of the cross-section width; and These represent the maximum index values of the control point grid in two directions, where... Depending on the number of control sampling points selected, It depends on the number of key points when constructing the triangular cross-section; The three-dimensional coordinate vector represents the control point, where the three-dimensional coordinate vector... Its corresponding The set includes the instantaneous center point, i.e., the vertex, and the intersection of the left and right parent material edge lines, i.e., the bottom edge endpoint; Indicates the surface in The order of the direction is set to 3, which is a cubic B-spline. Choosing the 3rd order can ensure that the surface has the continuity of the second derivative in the direction of weld extension, thereby eliminating the sharp corners generated by the splicing of adjacent sections and realizing a smooth transition connection. Indicates the surface in The order of the direction is set to 2, i.e., a quadratic B-spline. Since the cross-sectional profile is defined by three points, i.e., a triangle, a second-order parabola is sufficient to accurately describe this simple cross-sectional shape while ensuring the smoothness within the cross-section. and They are respectively Xianghe B-spline basis functions;
[0080] in B-spline basis functions Depend on To node vector Confirmed, among which For the first The node value corresponds to the selected node along the weld centerline trajectory. The parameter positions of each control sampling point are expressed as follows:
[0081] When the order When the value is 0, i.e., the basis function of degree 0, the expression is:
[0082] ;
[0083] When the order At that time, that is When using secondary basis functions, the expression is:
[0084] ;
[0085] in B-spline basis functions Depend on To node vector Confirmed, among which For the first Each node value corresponds to a position of the lateral span parameter of the triangular cross-section profile from the base to the vertex. The specific expression is as follows:
[0086] When the order When the value is 0, i.e., the basis function of degree 0, the expression is:
[0087] ;
[0088] When the order At that time, that is When using secondary basis functions, the expression is:
[0089] .
[0090] It is worth further explaining that, compared with existing methods for constructing local three-dimensional surface models of welds, this invention can obtain a more refined model through S301 to S305. The main reason lies in the fundamental difference in modeling logic and data utilization. Existing local three-dimensional surface models of welds are usually constructed based on global statistics or simple geometric assumptions. For example, they assume that the cross-section of the weld is a fixed circular arc or parabolic shape, and then stretch or sweep along an idealized straight line or low-order curve to generate a surface. This method ignores the local morphological fluctuations of the weld caused by uneven heat input and changes in assembly gaps during actual manufacturing, resulting in a systematic deviation between the model and the real weld. This error is more significant, especially in areas where the weld starts or ends or has minor defects. In contrast, the local three-dimensional surface model constructed in this invention is based on slice-by-slice geometric feature parameters such as the instantaneous center point, instantaneous residual height point, and weld width obtained from actual measurements. The cross-sectional profile of each control sampling point truly reflects the actual state of the weld at that location. Building upon this foundation, a B-spline surface fitting algorithm is used for smoothing, preserving both the local detail accuracy of the measured data and the overall smoothness of the surface. This allows the generated model to effectively reproduce the microscopic undulations and morphological changes of the weld surface, avoiding the loss of detail caused by oversimplification or global averaging in existing methods. Therefore, significant improvements are achieved in both spatial resolution and morphological fidelity, providing a more reliable geometric benchmark for the accurate identification of subsequent anomaly areas.
[0091] S311. Establish an ideal weld standard model, which consists of a series of regular triangular sections distributed along the global continuous weld centerline trajectory; for each of the regular triangular sections, the height is set to the theoretical average residual height value, and the width is set to the theoretical average weld width.
[0092] In this embodiment, to establish an ideal weld standard model as a benchmark for subsequent defect identification, it is necessary to determine the geometric parameters of the regular triangular cross-section, namely the theoretical average residual height and the theoretical average weld width. These two values are statistically calculated based on all slice data obtained during the actual measurement of the current inspection object. Specifically, the calculation process of the theoretical average residual height is as follows: First, extract the instantaneous residual height data at all slice locations obtained in step S24. Let there be a total of... The slice position, for the th slice position The coordinates of the instantaneous residual height point at each slice location in the vertical direction perpendicular to the weld extension direction are: Sum the instantaneous residual elevation coordinates of all slice locations, then divide by the total number of slices. This yields the theoretical average residual height value. It can be expressed by the formula:
[0093] ;
[0094] in, This represents the theoretical average residual height value; This represents the total number of slices in the standard point cloud dataset taken along the weld extension direction. Indicates the first The height coordinates of the instantaneous residual height points calculated at each slice location;
[0095] Similarly, for the calculation of the theoretical average weld width, it needs to be clarified that in steps S23 and S24, for each slice location, the specific coordinates of the left and right base metal edge lines at that cross-section position are determined. Let the... At each slice location, the lateral coordinate of the left edge line of the parent material is: The lateral coordinate of the edge line of the right parent material is The actual weld width at that slice location. It equals the coordinates of the right edge line minus the coordinates of the left edge line, i.e. ; All Actual weld width at each slice location Sum the results and then divide by the total number of slices. The theoretical average weld width can then be obtained. This can be expressed by the formula:
[0096] ;
[0097] in, This represents the theoretical average weld width; This represents the total number of slices in the standard point cloud dataset taken along the weld extension direction. Indicates the first The lateral coordinate values of the right edge line of the parent material at each slice location; Indicates the first The lateral coordinate values of the left edge line of the parent material at each slice location; Indicates the first The actual weld width at each slice location;
[0098] The result obtained from the above two formulas and , representing the average bulge height and average transverse span of the weld along its entire length, respectively. Using these two average values as fixed parameters, a series of regular triangles are uniformly distributed along the globally continuous weld centerline trajectory, with each triangle having a vertex height of . The bottom width is This allows for the construction of a standard model for ideal welds with uniform and regular shapes.
[0099] S312. Spatial alignment and registration of the local three-dimensional surface model and the ideal weld standard model, so that the reference ridge lines of the two coincide, and calculate the normal distance from each point on the surface of the local three-dimensional surface model to the surface of the ideal weld standard model.
[0100] In this embodiment, the local 3D surface model is first spatially aligned and registered with the ideal weld standard model. Specifically, using the globally continuous weld centerline trajectory as the reference ridge, translation and rotation operations are performed to ensure that the reference ridge of the local 3D surface model completely coincides with the reference ridge of the ideal weld standard model in space. This step ensures that the two models are positioned consistently in the weld extension direction, eliminating comparison errors caused by overall displacement or attitude differences.
[0101] After spatial alignment, it is necessary to calculate the normal distance from each point on the surface of the local 3D surface model to the surface of the ideal weld standard model in order to quantify the deviation between the two. The specific process is as follows: For each discrete sampling point on the surface of the local 3D surface model, determine its projection position in the plane perpendicular to the trajectory of the weld centerline. Since the two models have been aligned along the reference ridge, this projection position corresponds to a specific cross-sectional position on the ideal weld standard model. At this cross-sectional position, the ideal weld standard model is a regular triangle with a vertex height of... The bottom width is Based on the point's position in the weld's transverse coordinates (perpendicular to the centerline and parallel to the base), the theoretical height of the ideal weld standard model at that transverse position is calculated. If the point's transverse coordinates are within the base of the triangle, its theoretical height can be obtained through linear interpolation; if it exceeds the base, the theoretical height is the base material surface height, typically set to 0. Next, the difference between the actual height of the actual sampling point on the local 3D surface model and the theoretical height is calculated. This difference represents the vertical deviation between the two points. To obtain a more accurate normal distance, considering the potential tilt of the weld surface, the projection component of this deviation in the section normal direction can be further calculated. However, in this embodiment, to simplify the calculation and ensure efficiency, the vertical height deviation is primarily considered as the normal distance. The calculation process of the normal distance is expressed by the following formula:
[0102] ;
[0103] in, Represents the first 3D surface model on the local surface. The normal distance from each sampling point to the surface of the standard model of the ideal weld; The index number of the sampling point; Indicates the first The actual height coordinates of each sampling point in the local three-dimensional surface model; This indicates that in the standard model of an ideal weld, corresponding to the first... Horizontal coordinates of each sampling point The theoretical height value at that location; Indicates the first The lateral offset of each sampling point relative to the weld centerline, i.e., the lateral coordinate;
[0104] By traversing all sampling points on the surface of the local 3D curved surface model, the corresponding value for each point is calculated. This yields a sequence of distance data reflecting the degree to which the local geometry deviates from the ideal state.
[0105] S313. Set positive deviation threshold and negative deviation threshold. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is greater than the positive deviation threshold, the current point is marked as a convex abnormal point.
[0106] In this embodiment, the setting of the positive and negative deviation thresholds is specifically as follows: First, the technical standard or process specification corresponding to the weld is consulted to obtain the allowable fluctuation range of the weld reinforcement height and weld width. For example, if the standard specifies that the allowable deviation of the weld reinforcement height is ±0.5mm, then the positive deviation threshold can be set to 0.5mm and the negative deviation threshold can be set to -0.5mm.
[0107] It is worth further clarification that in weld surface inspection, protrusion usually refers to excessive weld metal buildup, forming a bulge higher than the ideal profile. This may be caused by excessive welding current, slow welding speed, or excessive number of weld layers. Such protrusions not only affect the appearance but may also become stress concentration points, reducing the fatigue life of the structure. Therefore, when the normal distance at a point, i.e., the difference between the actual height and the ideal height, is positive and exceeds the positive deviation threshold, it indicates that the weld at that point is significantly higher than the standard allowable limit, belonging to a typical excessive height or protrusion defect, and is thus marked as a protrusion anomaly.
[0108] S314. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is less than the negative deviation threshold, the current point is marked as a depression anomaly point.
[0109] In this embodiment, the term "depression" specifically refers to localized low-lying areas caused by insufficient weld metal filling, poor fusion, or excessive melting of the base material during weld inspection. These areas are geometrically lower than the ideal height expected in the design.
[0110] If the normal distance at a point is negative (below the ideal profile), but its absolute value is small and within the negative deviation threshold range (e.g., -0.2 mm, threshold -0.5 mm), this is usually considered normal process fluctuation or slight surface unevenness during welding, still within acceptable tolerances, and will not significantly affect the load-bearing capacity or sealing performance of the structure; therefore, it should not be considered a defect. Only when the normal distance is less than the negative deviation threshold (e.g., -0.6 mm, less than the threshold -0.5 mm) does it indicate that the actual depth at that point has exceeded the maximum negative deviation limit allowed by the process specifications, forming a noticeable pit-like structure. Such a deep depression not only reduces the effective cross-sectional area and weld strength but also easily leads to stress concentration at the bottom of the depression, causing crack propagation and seriously threatening the safety and reliability of the welded joint. Therefore, by setting a negative deviation threshold as a judgment boundary, deep pits exceeding the allowable range can be accurately identified as abnormal depression points, thus distinguishing normal minor undulations from real defects with potential safety hazards, ensuring that the detection results are neither too sensitive to cause false alarms nor too lenient to cause missed detections.
[0111] S315. Perform connected component analysis on all protruding and concave anomalies in space, merge adjacent anomalies to form closed three-dimensional regions, and use each closed three-dimensional region as a candidate defect area.
[0112] In this embodiment, all protruding and concave anomalies are analyzed spatially using connected component analysis to merge adjacent anomalies into a closed three-dimensional region. The specific operation process is as follows: First, obtain the discrete point set of all points marked as protruding and concave anomalies in steps S313 and S314. These points have their own three-dimensional coordinate positions in the spatial coordinate system of the local three-dimensional surface model. Next, set a spatial proximity threshold, which is usually determined based on the sampling density of the weld surface and the minimum expected size of the defect, for example, set as the distance between several adjacent sampling points. Then, use a breadth-first search or depth-first search algorithm to traverse the anomaly point set. For any unvisited anomaly point, add it to the current connected component queue and check other anomalies in its surrounding neighborhood. If there is another anomaly point in the neighborhood, and the Euclidean distance between that point and the current point is less than the set spatial proximity threshold, then the two points are considered adjacent, and the latter is also added to the current connected component, and its neighborhood is checked again. In this way, all interconnected and spatially continuous anomalies are gathered together to form a complete point group. After traversing all outliers, each independent group of points constitutes a closed 3D region. Finally, the convex hull algorithm or surface reconstruction algorithm is used to enclose these discrete group of points, generating a smooth 3D mesh surface, thus obtaining independent candidate defect regions. This method can eliminate scattered, isolated false positives because they cannot form connected regions with a certain volume, and integrate the various parts belonging to the same real defect into a whole, facilitating subsequent evaluation of the overall characteristics of the defect.
[0113] It is worth further explaining that by constructing a local 3D curved surface model and spatially aligning and registering it with an ideal weld standard model, and calculating the normal distance to identify abnormal areas, this effectively solves the problem of misjudging normal transition zones as defects in complex environments when directly using the original point cloud. It also significantly improves the robustness of defect identification under complex lighting or reflective environments. This is because the original point cloud data directly reflects the geometric shape acquired by the sensor. However, in actual welding scenarios, there is a natural geometric transition zone from the base material to the weld toe and then to the weld center. If the original point cloud is used directly and compared with a simple planar or linear reference, this normal slope change is easily misinterpreted by the algorithm as insufficient reinforcement or undercut defects. The ideal weld standard model introduced in this embodiment is a sequence of regular triangular sections constructed based on the theoretical average reinforcement height and width, representing the geometric contour of the weld in its perfect state. Spatial alignment and registration eliminates the influence of overall position and orientation, allowing the comparison to focus on local shape deviations. The normal distance calculates the degree of deviation of the actual surface from this ideal geometric reference, rather than the absolute height. Therefore, normal geometric transition zones, conforming to the basic shape rules of welds, typically deviate from the ideal model within acceptable limits and are not flagged as abnormal. Only areas that significantly deviate from the ideal shape, such as sudden bulges or deep pits, are identified. Furthermore, in complex lighting or reflective environments, point clouds acquired by optical sensors often contain noise, voids, or false specular highlights, distorting the original data. However, the local 3D surface model, processed through filtering and smoothing, has filtered out most high-frequency noise and extreme values. Comparing this relatively clean and stable surface model with the ideal model can mask random errors caused by uneven lighting, focusing only on actual geometric deformation. This detection logic, based on shape deviation rather than absolute coordinates, makes the system insensitive to minor fluctuations in sensor data, thus significantly improving stability and reliability in harsh industrial environments while maintaining detection accuracy.
[0114] S4. Perform morphological classification and grading of candidate defect areas to generate a defect distribution map containing defect type, location coordinates and processing priority.
[0115] S41. Extract the three-dimensional geometric feature parameters of each candidate defect area, divide the candidate defect area into at least one defect type according to the three-dimensional geometric feature parameters, and determine the defect level of each defect type;
[0116] S41a1. Calculate the maximum normal deviation value for each candidate defect area, wherein the maximum normal deviation value is the absolute maximum value of the normal distances from all points in each candidate defect area to the surface of the ideal weld standard model.
[0117] In this embodiment, the maximum normal deviation value of each candidate defect area is calculated to quantify the most severe geometric deviation within that area, serving as a key indicator for subsequent defect severity assessment. Specifically, the discrete point set constituting each closed 3D region generated in step S315 is first extracted. For each candidate defect area, all discrete points contained within it are traversed. For any given discrete point, its spatial position within the local 3D surface model is obtained, and the normal distance from that point to the surface of the ideal weld standard model is calculated backtracking. This distance, calculated in previous steps, is typically positive or negative, with positive values indicating convexity and negative values indicating concavity. To uniformly measure the magnitude of the deviation without distinguishing between convexity and concavity, the absolute value of this normal distance is taken. By comparing the absolute values of the normal distances corresponding to all discrete points within the candidate defect area, the largest value is identified. This maximum value represents the maximum deviation of the candidate defect area relative to the ideal standard model, i.e., the maximum normal deviation value. This process ensures that regardless of whether the defect manifests as a localized, severe bulge or a deep pit, a uniform scalar value can be used to characterize its extreme degree of morphological anomaly. The calculation process for the maximum normal deviation value is expressed by the following formula:
[0118] ;
[0119] in, Indicates the first The maximum normal deviation value of each candidate defect region; The index number is assigned to the candidate defect area to distinguish different defect areas; Indicates the first The set of all discrete points contained in a candidate defect region; Represents a set The Middle The normal distance from each discrete point to the surface of the standard model of the ideal weld;
[0120] Through the above calculations, the corresponding defect region for each candidate defect region can be obtained. value.
[0121] S41a2. Determine the sign of the maximum normal deviation value: if the maximum normal deviation value is positive, then mark the current candidate defect area as a convex defect; if the maximum normal deviation value is negative, then mark the current candidate defect area as a concave defect.
[0122] In this embodiment, the sign of the maximum normal deviation value is used to mark the defect type. The core logic lies in using the sign of the normal distance to define the spatial positional relationship between the actual weld surface and the ideal standard model surface. It is worth noting that the calculation benchmark for the normal distance has been clearly defined in the preceding steps: when a point on the local three-dimensional surface model is located outside the ideal weld standard model surface, i.e., away from the center of the base material, the normal distance is positive; when the point is located inside, i.e., close to the center of the base material or below the ideal profile, the normal distance is negative. Therefore, the maximum normal deviation value, as the maximum absolute value of the normal distance from all points in that region to the ideal model surface, directly reflects the spatial orientation characteristics of the most extreme point in that region with its original value's sign.
[0123] If the maximum normal deviation is positive, it indicates that within the candidate defect area, there exists at least one point whose normal distance to the surface of the ideal weld standard model is positive, and this positive value represents the largest deviation among all points. This means that the overall morphology of the area exhibits excessive accumulation of actual weld metal, with the surface bulging higher than the ideal contour. From a welding process perspective, this is usually due to metal overflow caused by excessive welding current, slow welding speed, or excessive wire feed speed, resulting in an excess height or excessively wide edge that exceeds the design standard. This bulging shape not only affects the smoothness of the appearance but may also require grinding removal in subsequent processing, and may even reduce fatigue strength due to stress concentration. Therefore, based on the intuitive judgment of geometric position, marking the area with the largest positive deviation as a bulging defect is consistent with physical facts.
[0124] Conversely, if the maximum normal deviation is negative, it indicates that the most extreme deviation point within the candidate defect area is concave inward, meaning its normal distance is negative. This suggests that the actual weld surface in this area is below the contour line of the ideal weld standard model. From a causal perspective, this could be due to insufficient welding heat input, excessive gap, or excessively fast welding speed, causing the molten pool metal to fail to fully fill the joint root or sides, thus forming grooves or pits below design standards. This concave morphology directly reduces the effective cross-sectional area of the weld, weakens its load-bearing capacity, and the bottom of the concave area is highly susceptible to becoming a crack initiation point. Therefore, marking areas with the maximum negative deviation as concave defects accurately reflects their geometric deficiencies. This positive / negative classification method clearly distinguishes between excess and missing parts of defects without the need for additional complex algorithms.
[0125] S41a3. For candidate defect areas marked as protruding defects, the average positive deviation relative to the ideal weld standard model is further calculated. When the average positive deviation is greater than the first preset threshold, the candidate defect area currently marked as protruding defects is classified as a defect with excessive excess height; otherwise, it is classified as a spatter or weld bead defect.
[0126] In this embodiment, for candidate defect areas marked as protruding defects, the average positive deviation relative to the ideal weld standard model is further calculated. This aims to distinguish between excessive overall weld height and local spatter or weld beads by statistically analyzing the overall deviation of all abnormal points within the area. The specific calculation process is as follows: First, all discrete points within the candidate defect area are obtained. For each discrete point, since the area is known to be marked as a protruding defect, and the maximum normal deviation value is determined to be positive in S41a2, it can be inferred that the normal distances of most points within the area, especially those constituting the main body of the defect, are positive. To accurately reflect the overall degree of bulging, the normal distances of all points within the area need to be extracted, and only those with positive normal distances are retained, i.e., excluding the very few small negative points caused by noise. These positive normal distances are summed and then divided by the total number of points involved in the calculation within the candidate defect area; the quotient is the average positive deviation. This value represents how much the defect area is on average higher than the ideal contour, and can well characterize the volume or overall height of the defect, rather than just focusing on a certain extreme peak.
[0127] The calculation process for the average positive deviation can be expressed by the formula as follows:
[0128] ;
[0129] in, Indicates the first The average positive deviation of each candidate defect area; Indicates the first The set of all discrete points contained in a candidate defect region; Represents a set The Middle The normal distance from each discrete point to the surface of the standard model of the ideal weld; conditions This means that only points with positive normal distances are selected for accumulation to eliminate possible background noise or slight interference in edge transition areas; Represents a set The conditions are met The total number of discrete points, i.e. the number of sample points used to calculate the average.
[0130] It's worth noting that the reason for classifying candidate defect areas currently labeled as protrusion-type defects as excessive height defects when the average positive deviation exceeds a first preset threshold, and otherwise as spatter or weld bead defects, lies in the fundamental difference in their geometric morphology. Excessive height typically manifests as a continuous, gently sloping regional bulge along the weld seam. Its characteristics include a wide affected area, with the entire surface of the region higher than the ideal profile. Therefore, the normal distance of all points within this area is generally large and positive, resulting in a high calculated average value. Conversely, spatter or weld beads are usually isolated small particles or protrusions attached to or near the weld surface. They exist only in a very small local area, while most of the surrounding area remains close to the ideal profile. Although these isolated points may generate large maximum normal deviation values, thus being identified as protrusion-type defects, since they only occupy a very small portion of the candidate defect area, the normal distance of most other points may be small or even zero, leading to a lower average positive deviation for the entire area. Therefore, using the average value as a criterion can effectively distinguish between large-area overall height deviations and small-area local protrusions.
[0131] It is worth further explaining that, specifically, the setting of the first preset threshold is determined by consulting relevant welding standards to obtain the maximum allowable value of the weld reinforcement. and nominal high value Typically, the upper limit of the allowable allowable height in the process is the nominal allowable height plus a positive deviation. For example, if the standard requires the weld bead height to be no more than 2mm, while the ideal design weld bead height is 1.5mm, then the allowable positive deviation is 0.5mm. In this case, the first preset threshold can be set to 0.5mm. The advantage of this setting is that only when the average bulge of the defect area exceeds the limit allowed by the process will it be judged as a serious defect with excessive weld bead height, requiring grinding. If the average bulge does not exceed this threshold, even if the maximum deviation is large, it may be caused by a small weld bead, and is considered a minor spatter or weld bead that can be removed by simple cleaning without large-scale rework. This standard tolerance-based setting method ensures that the classification results are highly consistent with the actual engineering needs.
[0132] S41a4. For candidate defect areas marked as dent defects, the average negative deviation relative to the ideal weld standard model is further calculated. When the absolute value of the average negative deviation is less than the second preset threshold and the candidate defect area is located near the edge line of the base material, the candidate defect area currently marked as dent defects is classified as undercut defects. When the absolute value of the average negative deviation is greater than or equal to the second preset threshold, the candidate defect area currently marked as dent defects is classified as incomplete penetration or porosity defects.
[0133] In this embodiment, for candidate defect areas marked as depression-type defects, the average negative deviation relative to the ideal weld standard model is further calculated to quantify the overall depth of the depression in the area. The specific calculation process is as follows: First, all discrete points contained in the candidate defect area are obtained. Since the area has been marked as a depression-type defect, its normal distance is mainly negative. To accurately reflect the overall depth of the depression, the normal distances of all points in the area need to be extracted, and only those negative normal distances are retained (to exclude the small positive value interference that may exist in the edge transition area). These negative normal distances are summed and then divided by the total number of points involved in the calculation in the candidate defect area (i.e., the number of points that meet the negative value condition). The quotient obtained is the average negative deviation. It should be noted that since these distances themselves are negative, the calculated average negative deviation is also a negative value, and its absolute value represents the average depth of the depression.
[0134] The calculation process for the average negative deviation is expressed by the following formula:
[0135] ;
[0136] in, Indicates the first The average negative deviation of each candidate defect area; Indicates the first The set of all discrete points contained in a candidate defect region; Represents a set The Middle The normal distance from each discrete point to the surface of the standard model of the ideal weld; conditions This means that only points with negative normal distances are selected for accumulation to ensure that the calculation represents the actual concave portion. Represents a set The conditions are met The total number of discrete points, i.e. the number of sample points used to calculate the average.
[0137] It is worth noting that the reason why candidate defect areas currently marked as depression defects are classified as undercut defects when the absolute value of the average negative deviation is less than the second preset threshold and the candidate defect area is located near the edge line of the base material is because undercut has specific spatial distribution and depth characteristics in terms of geometry. Undercut usually occurs at the junction of the weld and the base material, i.e., the edge line of the base material, and is formed by the failure to fill the groove after the base material is partially melted due to excessive arc heat or improper angle. The characteristics of this defect are that its location is fixed, that is, it only occurs at the edge, is relatively narrow in width, and is relatively shallow in depth. Therefore, if the detected depression area is located near the edge line of the base material and its average depression depth, i.e., the absolute value of the average negative deviation, is small, it indicates that this is only a slight metal loss at the edge, which is consistent with the typical characteristics of undercut.
[0138] Conversely, when the absolute value of the average negative deviation is greater than or equal to the second preset threshold, the candidate defect area currently marked as a depression is classified as incomplete penetration or porosity defect. This is because these two types of defects typically manifest as severe internal or cross-sectional deficiencies, resulting in deep depressions or holes on the surface. Incomplete penetration refers to the incomplete fusion at the root of the weld, often accompanied by the collapse of the root gap or unfused area, causing the depth at that location to be significantly lower than the ideal profile. Porosity, on the other hand, refers to cavities left by the escape of internal gas; if the pores are large or dense, they will form obvious pits on the surface. These defects share the characteristic of large depression depth, and are not necessarily limited to the edges; they can appear at the center of the weld or anywhere else. Therefore, as long as the average depression depth exceeds a certain limit, regardless of its location, it indicates a serious structural integrity problem and needs to be classified as a more severe incomplete penetration or porosity defect.
[0139] It is worth further explaining that, specifically, the setting of the second preset threshold is determined by consulting relevant welding quality standards to identify the maximum permissible depth of incomplete penetration at the weld root. and the maximum allowable value of the bite depth Typically, incomplete penetration is far more harmful than undercut, so its allowable depth may be smaller or the judgment logic may differ. However, in the classification logic of this embodiment, deep recesses are considered as incomplete penetration or porosity, while shallow recesses plus edges are considered undercut. Therefore, the second preset threshold can be set as a critical value between typical undercut depth and typical incomplete penetration depth. For example, based on engineering experience, the depth of slight undercut is usually within 0.5mm, while root recesses caused by incomplete penetration are often deeper or have a greater impact. Therefore, the second preset threshold can be set to a value between 0.5mm and 1.0mm, and the specific value can be adjusted according to the actual plate thickness and welding process, for example, 0.8mm. The advantage of this setting is that it can distinguish between shallow, location-specific edge defects, i.e., undercut, and deep, structural defects, i.e., incomplete penetration or porosity, ensuring sensitive identification of serious defects while avoiding overreaction to minor edge imperfections.
[0140] S41b1. For defects with excessive excess height, the defect level is divided into three levels based on the average positive deviation: when the average positive deviation is greater than the first preset threshold and less than or equal to the third preset threshold, it is defined as a level one defect; when the average positive deviation is greater than the third preset threshold and less than or equal to the fourth preset threshold, it is defined as a level two defect; when the average positive deviation is greater than the fourth preset threshold, it is defined as a level three defect.
[0141] In this embodiment, for defects with excessive weld height, the defect level is classified based on the average positive deviation. The core logic is that this indicator can intuitively reflect the overall severity of the weld surface bulge. As mentioned above, the average positive deviation represents the average height of all protrusions within the candidate defect area relative to the ideal model surface. For defects like excessive weld height, the essence is that too much weld metal accumulates, causing the weld profile to exceed the design standard. This accumulation not only affects the appearance flatness but, more importantly, increases the workload of subsequent processing, such as grinding and machining, and may even affect assembly accuracy due to stress concentration or geometric interference. Therefore, the higher and thicker the bulge, the greater the impact on subsequent processes, and the higher the severity of the defect. Compared to the maximum normal deviation value, which only focuses on the most extreme point, the average positive deviation value better reflects the volume and thickness of the entire defect area, thus more reasonably assessing its impact on the overall performance and use of the workpiece.
[0142] It is worth noting that the reason for setting the classification intervals as follows: when the average positive deviation is greater than the first preset threshold and less than or equal to the third preset threshold, it is defined as a level 1 defect; when it is greater than the third preset threshold and less than or equal to the fourth preset threshold, it is defined as a level 2 defect; and when it is greater than the fourth preset threshold, it is defined as a level 3 defect, is based on the need for tiered management of defect tolerance in engineering practice.
[0143] First, Level 1 defects correspond to minor excess heights that are still within acceptable or easily manageable ranges. Although these defects exceed the contours of the ideal model, the bulge is small and can usually be quickly removed with simple grinding, or remain within allowable tolerances, without affecting the main structural strength and function. Therefore, they are classified as the lowest level, Level 1, indicating that attention is needed but complex rework measures are not required immediately.
[0144] Secondly, level two defects correspond to moderately excessive excess height. At this stage, the average bulge has significantly exceeded the "minor" range, meaning a larger amount of metal needs to be removed, increasing the grinding workload and potentially affecting local stress distribution. These defects typically require planned repairs or more refined machining and are considered of moderate severity.
[0145] Finally, Level 3 defects correspond to severely excessive weld reinforcement. A large average positive deviation indicates extremely severe weld metal buildup, potentially leading to serious geometric interference that cannot be repaired by conventional grinding. It may require excision and re-welding or large-scale material removal. This not only results in significant waste of material and time but may also weaken the effective cross-section of the base metal, severely impacting structural integrity. Therefore, it is classified as Level 3, the highest level, indicating that immediate cessation of use and rigorous rework are necessary.
[0146] It is worth further clarification regarding the specific settings of the third and fourth preset thresholds. The third preset threshold is set to a multiple of the first preset threshold; for example, if... Considering the limits of slight polishing, the third preset threshold can be... The setting is 4mm. This means that an average bulge between 2mm and 4mm is considered a Level 1 defect. This range takes into account the processing capacity limit of most conventional grinding equipment. Similarly, for a fourth preset threshold, for example, it can be set to 8mm. This means that an average bulge between 4mm and 8mm is considered a Level 2 defect, because grinding efficiency is significantly reduced at this point, and the heat-affected zone may be touched. An average bulge exceeding 8mm is considered a Level 3 defect, because this usually indicates a serious welding parameter error or operational mistake, almost certainly accompanied by other potential quality problems, requiring complete rework.
[0147] S41b2. For spatter or weld bead defects, the defect level is divided into Level 1 and Level 2 based on the volume of the candidate defect area: when the volume of the candidate defect area is less than the preset volume threshold, it is defined as Level 1 defect; when the volume of the candidate defect area is greater than or equal to the preset volume threshold, it is defined as Level 2 defect.
[0148] In this embodiment, for spatter or weld bead defects, the defect level is classified based on the volume of the candidate defect area. The core logic is that volume most directly reflects the degree of impact of the defect on subsequent workpiece processing and the difficulty of cleaning. Spatter and weld bead are essentially excess metal particles or small protrusions attached to or near the weld surface. Unlike overall bulges such as excessive weld height, spatter or weld bead are usually localized, isolated protrusions. For this type of defect, the key to judging its severity is not how tall it is, because a single small weld bead may be tall but the total volume is small, but rather how much space it occupies, that is, its size or volume.
[0149] Volume was chosen as the grading criterion because it directly relates to two practical engineering factors: the amount of work required to remove the defect and the potential risk of stress concentration. If a spatter or weld bead is very small, it's likely a tiny particle that can be easily removed with simple tools like a wire brush or small file, with minimal thermal impact on the surrounding base material and almost no visible machining marks, thus posing little threat. Conversely, a large volume indicates that the weld bead may be tall, have a large base area, or be a large mass of molten metal. Removing such a large defect requires more grinding time and deeper cuts, easily damaging the base material surface and even altering the local geometry, increasing the risk of new defects. Furthermore, large metal deposits are often accompanied by potential quality problems such as internal porosity or lack of fusion, posing a greater risk to structural integrity. Therefore, using volume as a metric is reasonable and intuitive.
[0150] It is worth noting that the specific classification logic is as follows: when the volume of the candidate defect area is less than the preset volume threshold, it is classified as a level 1 defect; when the volume of the candidate defect area is greater than or equal to the preset volume threshold, it is classified as a level 2 defect.
[0151] Level 1 defects are small in size, representing minor spatter or small weld beads. These defects are usually dot-like or tiny flakes and are easy to handle. On automated production lines, these defects can be quickly smoothed out by a high-speed rotating grinding wheel or simply cleaned manually, without downtime or complex rework processes. Classifying them as Level 1 means they can be categorized as acceptable low-priority defects, negligible in mass production or handled incidentally during routine quality inspections.
[0152] Level 2 defects are large, representing significant weld beads or dense clusters of spatter. These defects occupy substantial physical space and may not be completely removed by ordinary rapid grinding, or the large amount removed may affect the smoothness of the weld surface. Addressing these defects may require more delicate operations, or even re-welding of localized areas. Therefore, classifying them as Level 2 indicates a moderately severe defect requiring special attention, necessitating specialized cleaning procedures, and potentially requiring re-inspection to ensure the treated surface quality meets requirements.
[0153] It is worth further elaboration that the specific setting of the preset volume threshold is determined by statistically analyzing the volume data of typical spatter generated during a large number of normal welding processes, combined with experimental data on the cleaning efficiency of on-site workers. For example, in actual operation, workers generally consider round or near-spherical metal particles with a diameter less than 3mm and a height less than 1mm to be easily wiped off, while weld beads with a diameter greater than 5mm or a height greater than 2mm require vigorous grinding. Assuming a typical easily cleanable spatter is approximated as a hemisphere with a radius... If it is approximately 1.5mm, then its volume is... However, a weld bead that requires special attention may have an equivalent volume of [missing information]. The above. Considering a certain safety margin and detection error, the preset volume threshold can be set to an intermediate value, for example... to between.
[0154] S41b3. For undercut defects, the defect level is divided into Level 1 and Level 2 based on the absolute value of the average negative deviation and the length of the defect along the weld direction: when the absolute value of the average negative deviation is less than the second preset threshold and the length is less than the preset length threshold, it is defined as Level 1 defect; otherwise, it is defined as Level 2 defect.
[0155] In this embodiment, for undercut defects, the defect level is classified based on the absolute value of the average negative deviation and the length of the defect along the weld direction. The core logic is that undercut, as a linear groove-like defect, depends not only on its depth but also on its length. Depth, i.e., the absolute value of the average negative deviation, reflects the intensity of stress concentration and the proportion of loss of the effective cross-section of the base material, while length determines the extent of the defect's extension in the overall structure and the breadth of its impact on subsequent processing. Combining these two dimensions allows for a more comprehensive and accurate assessment of the actual severity of the undercut, avoiding misjudgments caused by considering only depth or length. For example, an extremely deep but short undercut may only affect a localized point, while a shallow but very long undercut may penetrate the entire weld segment, leading to large-area cross-sectional weakening and visual defects. Therefore, dual-indicator judgment is more objective and reasonable than single-indicator judgment.
[0156] It is worth noting that the reason why a defect is classified as a Level 1 defect when the absolute value of the average negative deviation is less than the second preset threshold and the length is less than the preset length threshold, and otherwise as a Level 2 defect, is based on a trade-off between the structural safety of the defect.
[0157] Level 1 defects represent minor and localized undercuts. These defects are characterized by being neither too deep nor too long. Since the depth is within the permissible range (less than the second preset threshold), it indicates minimal loss of the base material cross-section and will not significantly reduce joint strength. Simultaneously, the short length means it is merely a minor, localized flaw that can be easily repaired with simple welding or grinding, and may even be acceptable in some non-critical structures. Classifying it as Level 1 indicates that it is a low-priority defect, simple and quick to handle.
[0158] Level 2 defects are those that do not meet the above conditions, meaning they satisfy either of the following conditions: the absolute value of the average negative deviation is greater than or equal to the second preset threshold (too deep), or the length is greater than or equal to the preset length threshold (too long), or both exceed the limit. If it's too deep, even if the length is short, an excessively deep undercut will create a severe stress concentration point, easily leading to crack propagation and threatening structural safety. It must undergo rigorous repair processes, such as multi-layer welding, to eliminate the hidden danger. If it's too long, even if the depth is not deep, a long undercut means a large surface area needs to be treated, requiring a huge amount of grinding work, and may affect the overall aesthetics and sealing of the weld, classifying it as a moderately serious defect. If it's both deep and long, this is clearly a serious defect and must be reworked extensively. Therefore, classifying any undercut beyond the minor range as Level 2 ensures that all potentially risky defects receive sufficient attention and treatment.
[0159] It is worth further elaborating on the specific setting of the preset length threshold. Specifically, by consulting relevant welding standards, the maximum allowable length of a single undercut is usually specified. For example, for certain grades of welds, the length of a single undercut is specified not to exceed a certain percentage of the total weld length, or the absolute value does not exceed a certain number of millimeters, such as 10mm or 20mm. In addition, considering that in actual operation, undercuts shorter than a certain length are often regarded as randomly distributed isolated points, which are easy to ignore or handle all at once, while undercuts longer than that length need to be recorded and handled in segments.
[0160] S41b4. For incomplete penetration or porosity defects, the defect level is divided into three levels based on the absolute value of the average negative deviation and the width of the defect in the direction perpendicular to the weld: Level 1, Level 2, and Level 3 are defined as follows: when the absolute value of the average negative deviation is greater than or equal to the second preset threshold and less than or equal to the fifth preset threshold, and the width is less than the preset width threshold, it is defined as a Level 1 defect; when the absolute value of the average negative deviation is greater than the fifth preset threshold and less than or equal to the sixth preset threshold, or the width is greater than or equal to the preset width threshold, it is defined as a Level 2 defect; when the absolute value of the average negative deviation is greater than the sixth preset threshold, it is defined as a Level 3 defect.
[0161] In this embodiment, for incomplete penetration or porosity defects, the defect level is classified based on the absolute value of the average negative deviation and the width of the defect perpendicular to the weld direction. The core logic is that these two types of defects typically manifest as cross-sectional missing parts or internal voids, and their severity depends mainly on the depth and breadth of the missing parts. The absolute value of the average negative deviation reflects the average depth of the defect area, directly related to the reduction in the effective load-bearing cross-section and the severity of stress concentration; while the width perpendicular to the weld direction reflects the lateral expansion range of the defect. An increase in width means an expansion of the affected area, which may lead to greater local strength weakening. Combining depth and width allows for a more comprehensive assessment of the actual impact of defects on structural integrity, because a deep and narrow defect and a shallow and wide defect have drastically different damage mechanisms and impact ranges on the structure.
[0162] It's worth noting that the criteria for determining a Level 1 defect are: the absolute value of the average negative deviation is greater than or equal to the second preset threshold and less than or equal to the fifth preset threshold, and the width is less than the preset width threshold. This level represents a medium-depth but narrow defect. Although the depth exceeds the limit of slight undercut (greater than the second preset threshold), indicating a certain structural risk, the narrow width (less than the preset width threshold) means the defect's impact is very limited, mainly concentrated on a thin line or a small area. This type of defect can usually be repaired by localized welding or grinding, with limited weakening of the overall structural strength. Therefore, it is classified as Level 1, indicating that attention and targeted repair are needed, but it is not the most urgent situation.
[0163] The criteria for classifying a Level 2 defect are: the absolute value of the average negative deviation is greater than the fifth preset threshold and less than or equal to the sixth preset threshold, or the width is greater than or equal to the preset width threshold. This level represents a deeper or wider defect; meeting either condition upgrades the defect. If it is deeper (greater than the fifth preset threshold), it means that even if the width is not wide, the excessive depth implies severe cross-sectional loss and a very high risk of stress concentration, easily leading to cracks, and must be taken seriously. If it is wider (greater than or equal to the preset width threshold), it means that even if the depth is not particularly large, the wide defect area implies a large area of material loss or porosity, which significantly reduces the overall stiffness and strength of the joint, and is more difficult to repair, possibly requiring large-area welding. Both of these situations indicate that the defect has exceeded the scope of a local minor flaw and has obvious structural hazards; therefore, it is classified as Level 2 and requires planned rework.
[0164] The criteria for determining a Level 3 defect are: the absolute value of the average negative deviation is greater than the sixth preset threshold. This level represents extremely deep defects. Such deep depressions or voids are usually accompanied by serious welding process errors, such as excessive current or insufficient speed. This not only causes huge material waste but may also completely destroy the weld's connection function, even leading to the scrapping of the workpiece. These types of defects cannot be repaired by simple grinding and must be completely removed and re-welded, belonging to the highest level of serious defects.
[0165] It is worth further clarification that the specific setting of the preset width threshold is mainly based on the limitations on the allowable width of linear defects in welding standards and the determination of detection resolution. For incomplete penetration or porosity groups, the maximum allowable width of a single defect is usually specified. For example, if the standard allows a maximum single-point width of 5mm, considering a certain safety margin, the preset width threshold can be set to 4mm or 5mm. This means that defects exceeding this width are considered large-area defects with higher risk. The fifth preset threshold can be set as a multiple of the second preset threshold. For example, if the second preset threshold is 0.5mm, the typical hazardous depth of incomplete penetration may begin to significantly increase the risk at around 1.0mm. Therefore, the fifth preset threshold can be set to 1.0mm. When the depth exceeds 1.0mm, the defect is considered to have entered an area requiring close monitoring. Similarly, the specific setting of the sixth preset threshold is as follows: when the incomplete penetration depth reaches a specific proportion of the plate thickness, such as 10%-20%, or the absolute value reaches a certain value, such as 2.0mm-3.0mm, depending on the plate thickness, it is considered a serious defect. For example, for common medium-thick plates, the sixth preset threshold can be set to 2.0mm. When the depth exceeds 2.0 mm, the defect is considered to have seriously affected the structural integrity and must be classified as Level 3.
[0166] S42. Obtain the spatial coordinates of each candidate defect area in the local three-dimensional surface model;
[0167] In this embodiment, the spatial coordinates of each candidate defect area in the local 3D surface model are obtained. The core of this method lies in establishing the correspondence between point cloud data and the geometric model. The specific operation process is as follows:
[0168] First, it's important to clarify that a local 3D surface model refers to a mathematical model constructed by fitting an ideal weld contour or reference surface. This model typically consists of a series of ordered points, lines, or meshes, existing within a unified 3D coordinate system, such as a workpiece coordinate system established based on a camera or laser scanner. Candidate defect areas, on the other hand, are point cloud sets containing anomalous data identified in the preceding steps. Therefore, the specific steps for obtaining coordinates are as follows: for each point cloud cluster marked as a candidate defect area, the system iterates through all data points within that cluster. Since these point cloud data are acquired from 3D scanning equipment, they naturally carry... The spatial coordinate information. Therefore, the most direct method is to directly extract the original coordinate values of all points within the candidate defect area.
[0169] S43. Determine the processing priority of each candidate defect area according to the defect type and defect level;
[0170] S431. Mark Level 3 defects as first priority, Level 2 defects as second priority, and Level 1 defects as third priority;
[0171] S432. Within candidate defect areas of the same priority, further secondary sorting is performed according to the severity of the defect type: for recessed defects, incomplete penetration or porosity defects are ranked higher than undercut defects; for protruding defects, excessive weld bead height defects are ranked higher than spatter or weld bead defects.
[0172] In this embodiment, after determining the first, second, and third priorities, candidate defect areas of the same priority need to be further ranked according to the inherent hazard level of the defect type. The logical basis of this process is that even if two defects are classified into the same level, such as both being level two defects, their impact mechanisms on the workpiece structural integrity and subsequent processing are fundamentally different. By introducing defect type as a secondary ranking criterion, the rework sequence can be guided more precisely, ensuring that the most dangerous or difficult-to-handle defects receive priority. Specifically, this secondary ranking is determined based on the physical characteristics and failure modes of dent and convex defects.
[0173] For dent-type defects, incomplete penetration or porosity defects are ranked higher in secondary importance than undercut defects, primarily for the following reasons: First, undercut is usually located at the edge of the weld surface, visible to the naked eye, and its shape is relatively regular. Incomplete penetration, on the other hand, often occurs inside the weld root, while porosity may be distributed deep within the weld. Both are highly concealed, difficult to detect using conventional surface inspection methods, and easily missed. Once missed, they become significant safety hazards. In contrast, undercut, because of its exposed location, poses a relatively controllable risk.
[0174] Secondly, incomplete penetration is essentially a planar void formed by the failure of the weld metal to fuse with the base metal, or a cluster of internal pores. This geometry easily creates a sharp notch effect, leading to severe stress concentration, and under alternating loads, it is highly likely to become the initiation point for fatigue cracks and propagate rapidly. Although pores are mostly circular, dense pores significantly reduce the effective cross-sectional area. While undercut is a surface notch, its tip radius of curvature is usually larger than that of the root of incomplete penetration, resulting in a relatively low stress concentration factor. Furthermore, because it is located on the surface, stress concentration is more easily eliminated by grinding. Therefore, from the perspective of preventing catastrophic fracture, the hazards of incomplete penetration and pores far outweigh those of undercut and must be addressed first.
[0175] For protruding defects, excessive weld reinforcement is ranked higher in secondary importance than spatter or weld beads, primarily for the following reasons: First, excessive weld reinforcement refers to the height of the entire weld area exceeding the standard allowable range. This is not merely a localized issue but affects the geometry of the entire weld segment. Excessive reinforcement can lead to abrupt changes in stiffness at the weld joint, causing significant stress concentration, especially at the weld transition. Furthermore, excessive reinforcement can also affect subsequent processes, such as insufficient assembly clearance, uneven coating thickness, or interference during machining.
[0176] Secondly, spatter or weld beads are usually localized, isolated metal particles or small protrusions. Removing them only requires simple grinding or tapping, which is easy, quick, and has minimal impact on the surrounding base material. However, correcting excessive weld bead height usually requires extensive grinding or even re-welding, which is labor-intensive, time-consuming, and prone to causing insufficient weld thickness due to over-grinding, resulting in new depression defects. Therefore, excessive weld bead height is not only more problematic in itself, affecting overall strength and assembly, but also more difficult to handle. Therefore, under the same priority, it should be prioritized over spatter or weld beads to allow for earlier resource allocation for treatment.
[0177] In summary, the secondary prioritization process involves comparing the potential destructive power and urgency of different defect types within the same priority level. For dents, priority is given to internal defects that are easily concealed and prone to cracking, such as incomplete penetration or porosity. For protrusions, priority is given to systematic deviations that affect overall geometric accuracy, such as excessive weld height. This approach effectively ensures that the rework process complies with safety regulations.
[0178] S433. Sort all candidate defect areas according to priority and sub-priority to determine the processing priority of each candidate defect area.
[0179] In this embodiment, all candidate defect areas are sorted according to priority and secondary order to determine the final processing priority of each candidate defect area. The core logic is to adopt a hierarchical comparison strategy that prioritizes primary keys and supplements secondary keys. The specific operation process is as follows: First, all identified candidate defect areas are placed into a list to be processed. Each element in this list contains two key attributes: one is its major priority, i.e., first priority, second priority, or third priority; the other is its secondary sorting position within that major priority.
[0180] The specific steps for sorting are as follows:
[0181] First round of screening: Grouping by priority. Based on the results determined in S431, all candidate defects are first divided into three groups: the first priority group (Level 3 defects), the second priority group (Level 2 defects), and the third priority group (Level 1 defects). Clearly, defects in the first priority group need to be processed first, followed by those in the second priority group, and finally those in the third priority group. Therefore, in the overall ranking, any candidate defect area belonging to the first priority group will be ranked before any candidate defect area belonging to the second or third priority group; similarly, second priority defects will be ranked before third priority defects. This step establishes the macro-level processing order framework.
[0182] The second round of refinement involves arranging candidates according to their secondary priority within the same group. For candidate defect areas within the same high-priority group, such as second-priority level 2 defects, a ranking is still required. This is done by using the secondary ranking result obtained in S432. For example, if there are two level 2 defects in the group, one is incomplete penetration (ranked higher in secondary priority) and the other is undercut (ranked lower in secondary priority), then incomplete penetration will be ranked before undercut. Similarly, if there are two level 1 defects in the group, one is excessive height (ranked higher in secondary priority) and the other is spatter (ranked lower in secondary priority), then excessive height will be ranked before spatter. This ensures that, among defects of the same severity, those that pose a greater threat or require more urgent attention are assigned a higher internal ranking value.
[0183] Finally, combining the above two steps, the entire list is traversed and compared. The comparison rule is simple: first compare the highest priority, placing those with higher priority at the top; if the highest priorities are the same, then compare the secondary priority, placing those with higher secondary priority at the top. Ultimately, all candidate defect areas will be rearranged into a single, linear, ordered list. The first item in this list is the defect that most needs immediate attention, while the last item represents minor defects that can be addressed later or even ignored.
[0184] The advantages of this sorting method are its clear logic, simple execution, and fairness. It avoids neglecting higher priorities due to a lower priority, and also solves the problem of difficulty in distinguishing the severity of different defect types within the same level. Through this dual sorting mechanism, operators obtain a clear and unambiguous rework list, knowing which part to repair first and which to repair second, thereby improving the efficiency and accuracy of welding quality control.
[0185] S44. Summarize the defect types, location coordinates, and processing priorities of all candidate defect areas to generate a defect distribution map;
[0186] In this embodiment, the generated defect distribution map is significantly superior to existing static two-dimensional images or simple coordinate lists because it integrates previously isolated and scattered defect data into a structured whole with logical connections and decision-making guidance. Specifically, existing technologies typically provide only two forms of data: static two-dimensional images, which, while intuitive, lack depth information and cannot accurately reflect the specific location and severity of defects in three-dimensional space; and simple coordinate lists, which, while providing location information, are often just cold, impersonal lists of numbers without clearly indicating the specific type of defect or the urgency of handling it. This data presentation method often forces operators to spend a significant amount of time consulting different documents or repeatedly verifying information when faced with multiple defects, leading to errors and inefficiency.
[0187] It is worth further explaining that the defect distribution map in this embodiment achieves several key advantages by summarizing the defect types, location coordinates, and processing priorities of all candidate defect areas: First, it achieves multi-dimensional fusion and visualization of information. This map is not merely a set of point markers on a plane, but rather maps three-dimensional spatial coordinates onto a visualized model, while using different colors, shapes, or labels to distinguish defect types. For example, a red dot might represent incomplete penetration in a first-level defect, while a blue square might represent undercut in a second-level defect. In this way, operators can immediately see which areas have problems, what type of problem it is, and their spatial distribution patterns. This provides two more dimensions of information—type and priority—than a simple two-dimensional image, and offers more intuitive visual feedback than a simple list of coordinates.
[0188] Secondly, it provides clear action guidelines. Because the map includes processing priorities, it is essentially a sorted task list. Operators no longer need to guess which part to repair first and which to repair later based on coordinates; the map directly tells them: look at this red dot, a level 3 defect, first priority; then look at that blue block, a level 2 defect, second priority. This structured presentation eliminates decision-making uncertainty, ensuring that rework is strictly carried out according to the degree of hazard and urgency, avoiding resource waste or safety hazards caused by misjudging the order.
[0189] Finally, it possesses a high degree of structure and traceability. Existing simple lists or unstructured images are difficult for computer systems to directly read and utilize. In contrast, the defect distribution map in this embodiment is generated based on a unified data structure, with each defect point fully carrying its type, location, and priority attributes. This not only facilitates manual viewing but also enables subsequent automated system calls. For example, a robot can automatically plan a polishing path based on the coordinates and type in the map.
[0190] In summary, the defect distribution map of this invention organically integrates three key elements—defect type, location coordinates, and processing priority—transforming passive display into proactive guidance and fragmented information into structured knowledge. It not only makes the defect situation readily apparent but also directly guides subsequent processing procedures, something that existing static two-dimensional images or simple coordinate lists cannot match. This map truly becomes a bridge connecting inspection data with actual repair work, significantly improving the overall efficiency and accuracy of welding quality control.
[0191] S5. Plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory;
[0192] In this embodiment, planning the robot's motion trajectory based on the defect distribution map and controlling it to perform the grinding operation is a process of converting decision data into physical actions. The specific operation can be divided into three main stages: trajectory planning, path optimization, and actual control, each of which is closely related to the information in the defect distribution map.
[0193] First, during the trajectory planning phase, the system reads the position coordinates of all candidate defect areas in the defect distribution map, i.e., the three-dimensional spatial coordinates obtained in S42, and their corresponding processing priorities, i.e., the order determined in S433. The robot control system then determines the target position of each defect point according to this priority list. For each defect area to be processed, the system does not simply move the robot directly above that point; instead, it generates a complete motion trajectory suitable for the entry and exit of the grinding tool.
[0194] Specifically, for each defect point, the system calculates an approach path. This path typically includes several parts: first, a vertical or inclined movement from the safe height to the working height; second, a horizontal movement along the weld seam or cutting into the defect area at a specific angle; third, a grinding path covering the entire defect area, such as straight reciprocating motion or circular sweeping, depending on the shape of the defect; and fourth, the process of exiting along the original path or the safe path after grinding. Since the defect distribution map clearly indicates which defects to process first and which to process later, these individual trajectories are linked together to form a global motion sequence. For example, if the map shows that the first defect to be processed is a level 3 defect located at the left end of the weld seam, and the second is a level 2 defect at the right end, then the robot's trajectory will first move from the starting point to the left end for grinding, and then move to the right end for a second grinding, including necessary idle travel in between. To ensure consistent grinding results, the system also sets different grinding parameters based on the defect type from the map. For example, for deep pit defects such as incomplete penetration, a slower movement speed and greater pressure may be planned; while for shallow defects such as spatter, a faster speed may be used. Finally, during the actual control execution phase, the system converts these digitized instructions into signals recognizable by the robot controller. The robot then begins executing tasks sequentially according to a predetermined priority order. In summary, this process uses a defect distribution map as a navigation map, telling the robot where to go (its location coordinates), what to repair (the defect type), and which to repair first (the processing priority). Based on this information, combined with its own mobility, the robot calculates each specific movement path and ultimately completes the automated grinding operation via motor drive. This method avoids the tediousness and instability of manual teaching, achieving a seamless transition from inspection data to automated repair.
[0195] Example 2: Figure 2 As shown, the present invention also discloses a transformer tank weld defect detection and robotic grinding system based on three-dimensional vision, comprising the following modules:
[0196] Data acquisition module: used to acquire raw point cloud data of the weld area of transformer tank and preprocess the raw point cloud data to obtain a standard point cloud dataset;
[0197] Data processing module: Connected to the data acquisition module, it is used to extract the weld centerline trajectory and the sequence of geometric feature parameters of the weld section based on the standard point cloud dataset;
[0198] Identification module: Connected to the data processing module, it is used to construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric feature parameters of the weld section, and to identify abnormal areas in the local three-dimensional surface model as candidate defect areas;
[0199] Classification and quantization module: Connected to the recognition module, it is used to perform morphological classification and grading of candidate defect areas, and generate a defect distribution map containing defect type, location coordinates and processing priority;
[0200] Planning module: Connected to the classification and quantization module, it is used to plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory.
[0201] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0202] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0203] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for defect detection and robotic grinding of transformer tank welds based on 3D vision, characterized in that, Includes the following steps: S1. Obtain the original point cloud data of the transformer tank weld area and preprocess the original point cloud data to obtain a standard point cloud dataset. S2. Extract the weld centerline trajectory and weld cross-sectional geometric feature parameter sequence based on standard point cloud dataset; S3. Construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric characteristic parameters of the weld section, and identify abnormal areas in the local three-dimensional surface model as candidate defect areas. S4. Perform morphological classification and grading of candidate defect areas to generate a defect distribution map containing defect type, location coordinates and processing priority. S5. Plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory.
2. The method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision as described in claim 1, characterized in that, The extraction of the weld centerline trajectory and weld cross-section geometric feature parameter sequence based on the standard point cloud dataset includes: S21. Using the first point distributed along the weld extension direction in the standard point cloud dataset as the starting seed point, the standard point cloud data is iteratively clustered using the K-means clustering algorithm until all points are assigned to one of the following clusters: the base material region cluster and the weld reinforcement region cluster. S22. Extract the point cloud data belonging to the base material region cluster, and fit two straight lines located on both sides of the weld and parallel to the weld extension direction using the least squares method, as the left base material edge line and the right base material edge line. S23. Extract a vertical slice of a preset width from the standard point cloud dataset along the weld extension direction, and obtain a subset of the point cloud within the current slice. S24. Select points belonging to the weld reinforcement region cluster from the point cloud subset within the current slice, calculate the average height value of these points as the instantaneous reinforcement point at the current slice, and take the midpoint between the left and right base material edge lines at the current slice position as the instantaneous center point. S25. Connect the instantaneous center points of all slice positions to form a discrete center point sequence, and perform cubic spline smoothing on the center point sequence to generate a globally continuous weld centerline trajectory. S26. For each slice position, record the vertical distance from the instantaneous residual height point at the current slice position to the reference line formed by the left and right base material edge lines as the residual height value. At the same time, record the distance between the left and right base material edge lines at the current slice position as the weld width, thus obtaining a complete sequence of weld cross-sectional geometric feature parameters.
3. The method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision as described in claim 2, characterized in that, The construction of a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric feature parameters of the weld section includes: S301. Using the global continuous weld centerline trajectory as the reference ridge line, select several discrete points along the reference ridge line direction as control sampling points for surface construction. S302. Map each control sampling point to all slice positions one by one, so that each control sampling point corresponds to a slice position. S303. For each control sampling point, read the residual height value of the corresponding slice position as the height of the current control sampling point, and read the weld width of the corresponding slice position as the width of the current control sampling point. S304. In a plane perpendicular to the weld centerline trajectory, take the instantaneous center point corresponding to the current control sampling point as the vertex, and take the two intersection points of the left and right base material edge lines at the current slice position as the bottom endpoints. Use the height of the current control sampling point to determine the vertical distance of the vertex relative to the bottom edge, and use the width of the current control sampling point to determine the length of the bottom edge, and construct the triangular cross-sectional profile of the current control sampling point. S305. Using the B-spline surface fitting algorithm, the triangular cross-sectional contours of all control sampling points are smoothly connected along the weld centerline trajectory to generate a continuous local three-dimensional surface model covering the entire weld area.
4. The method for detecting defects in transformer tank welds and performing robotic grinding based on three-dimensional vision as described in claim 3, characterized in that, The identification of abnormal regions in the local three-dimensional surface model as candidate defect regions includes: S311. Establish an ideal weld standard model, which consists of a series of regular triangular sections distributed along the global continuous weld centerline trajectory; for each of the regular triangular sections, the height is set to the theoretical average residual height value, and the width is set to the theoretical average weld width. S312. Spatial alignment and registration of the local three-dimensional surface model and the ideal weld standard model, so that the reference ridge lines of the two coincide, and calculate the normal distance from each point on the surface of the local three-dimensional surface model to the surface of the ideal weld standard model. S313. Set positive deviation threshold and negative deviation threshold. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is greater than the positive deviation threshold, the current point is marked as a convex abnormal point. S314. Only when the normal distance from any point on the local three-dimensional curved surface model to the surface of the ideal weld standard model is less than the negative deviation threshold, the current point is marked as a depression anomaly point. S315. Perform connected component analysis on all protruding and concave anomalies in space, merge adjacent anomalies to form closed three-dimensional regions, and use each closed three-dimensional region as a candidate defect area.
5. The method for detecting defects in transformer tank welds and performing robotic grinding based on three-dimensional vision as described in claim 4, characterized in that, The step of performing morphological classification and hierarchical quantification of candidate defect regions to generate a defect distribution map containing defect type, location coordinates, and processing priority includes: S41. Extract the three-dimensional geometric feature parameters of each candidate defect area, divide the candidate defect area into at least one defect type according to the three-dimensional geometric feature parameters, and determine the defect level of each defect type; S42. Obtain the spatial coordinates of each candidate defect area in the local three-dimensional surface model; S43. Determine the processing priority of each candidate defect area according to the defect type and defect level; S44. Summarize the defect types, location coordinates, and processing priorities of all candidate defect areas to generate a defect distribution map.
6. The method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision as described in claim 5, characterized in that, The step of classifying candidate defect regions into at least one defect type based on the three-dimensional geometric feature parameters includes: S41a1. Calculate the maximum normal deviation value for each candidate defect area, wherein the maximum normal deviation value is the absolute maximum value of the normal distances from all points in each candidate defect area to the surface of the ideal weld standard model. S41a2. Determine the sign of the maximum normal deviation value: if the maximum normal deviation value is positive, then mark the current candidate defect area as a convex defect; if the maximum normal deviation value is negative, then mark the current candidate defect area as a concave defect. S41a3. For candidate defect areas marked as protruding defects, the average positive deviation relative to the ideal weld standard model is further calculated. When the average positive deviation is greater than the first preset threshold, the candidate defect area currently marked as protruding defects is classified as a defect with excessive excess height; otherwise, it is classified as a spatter or weld bead defect. S41a4. For candidate defect areas marked as dent defects, the average negative deviation relative to the ideal weld standard model is further calculated. When the absolute value of the average negative deviation is less than the second preset threshold and the candidate defect area is located near the edge line of the base material, the candidate defect area currently marked as dent defects is classified as undercut defects. When the absolute value of the average negative deviation is greater than or equal to the second preset threshold, the candidate defect area currently marked as dent defects is classified as incomplete penetration or porosity defects.
7. The method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision according to claim 6, characterized in that, Determining the defect level for each defect type includes: S41b1. For defects with excessive excess height, the defect level is divided into three levels based on the average positive deviation: when the average positive deviation is greater than the first preset threshold and less than or equal to the third preset threshold, it is defined as a level one defect; when the average positive deviation is greater than the third preset threshold and less than or equal to the fourth preset threshold, it is defined as a level two defect; when the average positive deviation is greater than the fourth preset threshold, it is defined as a level three defect. S41b2. For spatter or weld bead defects, the defect level is divided into Level 1 and Level 2 based on the volume of the candidate defect area: when the volume of the candidate defect area is less than the preset volume threshold, it is defined as Level 1 defect; when the volume of the candidate defect area is greater than or equal to the preset volume threshold, it is defined as Level 2 defect. S41b3. For undercut defects, the defect level is divided into Level 1 and Level 2 based on the absolute value of the average negative deviation and the length of the defect along the weld direction: when the absolute value of the average negative deviation is less than the second preset threshold and the length is less than the preset length threshold, it is defined as Level 1 defect; otherwise, it is defined as Level 2 defect. S41b4. For incomplete penetration or porosity defects, the defect level is divided into three levels based on the absolute value of the average negative deviation and the width of the defect in the direction perpendicular to the weld: when the absolute value of the average negative deviation is greater than or equal to the second preset threshold and less than or equal to the fifth preset threshold, and the width is less than the preset width threshold, it is defined as a level one defect; when the absolute value of the average negative deviation is greater than the fifth preset threshold and less than or equal to the sixth preset threshold, or the width is greater than or equal to the preset width threshold, it is defined as a level two defect; when the absolute value of the average negative deviation is greater than the sixth preset threshold, it is defined as a level three defect.
8. The method for detecting defects in transformer tank welds and for robotic grinding based on three-dimensional vision as described in claim 7, characterized in that, The step of determining the processing priority of each candidate defect region based on the defect type and defect level includes: S431. Mark Level 3 defects as first priority, Level 2 defects as second priority, and Level 1 defects as third priority; S432. Within candidate defect areas of the same priority, further secondary sorting is performed according to the severity of the defect type: for recessed defects, incomplete penetration or porosity defects are ranked higher than undercut defects; for protruding defects, excessive weld bead height defects are ranked higher than spatter or weld bead defects. S433. Sort all candidate defect areas according to priority and sub-priority to determine the processing priority of each candidate defect area.
9. A transformer tank weld defect detection and robotic grinding system based on three-dimensional vision, used to execute the transformer tank weld defect detection and robotic grinding method based on three-dimensional vision as described in any one of claims 1-8, characterized in that, Includes the following modules: Data acquisition module: used to acquire raw point cloud data of the weld area of transformer tank and preprocess the raw point cloud data to obtain a standard point cloud dataset; Data processing module: Connected to the data acquisition module, it is used to extract the weld centerline trajectory and the sequence of geometric feature parameters of the weld section based on the standard point cloud dataset; Identification module: Connected to the data processing module, it is used to construct a local three-dimensional surface model based on the weld centerline trajectory and the sequence of geometric feature parameters of the weld section, and to identify abnormal areas in the local three-dimensional surface model as candidate defect areas; Classification and quantization module: Connected to the recognition module, it is used to perform morphological classification and grading of candidate defect areas, and generate a defect distribution map containing defect type, location coordinates and processing priority; Planning module: Connected to the classification and quantization module, it is used to plan the robot's motion trajectory based on the defect distribution map, and control the robot to perform grinding operations according to the planning results of the motion trajectory.