A method for analyzing the amount of weld beads that need to be ground inside the pipe wall
By constructing a causal graph neural network model and combining welding sequence and three-dimensional morphology data, the grinding amount is dynamically corrected, which solves the problems of low efficiency and poor accuracy in the analysis of the grinding amount of weld beads on the inner wall of the pipeline, realizes precise layered grinding, and ensures the safety and service life of the pipeline.
Patent Information
- Application Number
- CN202611326814.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-30
- Publication Date
- 2026-11-17
AI Technical Summary
In the existing technology, the method for analyzing the grinding amount of weld beads on the inner wall of the pipe is inefficient and has poor accuracy. Furthermore, it fails to effectively consider the impact of material hardness differences and welding process parameter fluctuations on the grinding amount during the welding process, leading to over-grinding or under-grinding problems.
By collecting welding process time-series data and 3D topographic point cloud data, a multimodal causal dataset for welding and grinding is constructed. A causal graph neural network model is built, and by combining causal constraints and counterfactual reasoning, the grinding amount is dynamically corrected to generate a precise layered grinding trajectory.
It enables precise analysis of the amount of weld beads removed from the inner wall of the pipe, improves grinding efficiency and accuracy, avoids over-grinding or under-grinding, and ensures the pipe wall thickness retention rate and grinding quality.
Smart Images

Figure CN123118532A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weld bead internal cutting and grinding technology, specifically to a method for analyzing the amount of weld bead internal cutting and grinding on the inner wall of a pipe. Background Technology
[0002] Pipelines, as the core carriers of fluid transportation, are widely used in key sectors of the national economy such as oil and gas, chemical industry, power, and municipal water supply and drainage. The quality of their connections directly determines the operational safety and service life of the entire transportation system. Welding is the most important connection method in pipeline engineering. After a single weld is completed, raised weld beads will inevitably form on the inner wall of the pipeline. The presence of weld beads not only increases the fluid transportation resistance and reduces the transportation efficiency, but also causes stress concentration in the transition area between the weld bead and the base material. At the same time, it is easy to cause local corrosion and erosion. Under harsh conditions such as high pressure and high corrosion, it is very easy to cause major safety accidents such as pipeline leakage and rupture. Therefore, it is necessary to perform internal cutting and grinding treatment on the weld beads on the inner wall of the pipeline. The accurate analysis and control of the grinding amount is the core link that determines the grinding quality, which directly affects the surface flatness of the weld, the retention rate of the base material wall thickness, and the overall efficiency of the grinding operation.
[0003] Currently, the analysis of weld bead grinding volume on the inner wall of pipelines mainly relies on manual measurement and single geometric morphology analysis. Manual measurement involves multi-point sampling of weld bead height using tools such as calipers and micrometers, combined with experience to estimate the grinding volume. This method suffers from low measurement efficiency, poor accuracy, and strong subjectivity, making it difficult to achieve precise grinding volume analysis across the entire circumference and axis. Single geometric morphology analysis uses line lasers, structured light, and other technologies to obtain the three-dimensional morphology of the weld bead and calculates the basic removal volume based on geometric dimensions. However, this method only considers the macroscopic geometric characteristics of the weld bead and completely ignores the uneven heat input during the welding process. The unevenness of the weld bead fusion zone, heat-affected zone, and base material zone leads to hardness differences. Material hardness is a key factor affecting the grinding removal rate. Hardness differences can cause significant deviations in the actual removal amount at different locations under the same grinding parameters, resulting in over-grinding or under-grinding problems. In addition, some grinding amount prediction methods based on traditional machine learning only perform data-level fitting and do not explore the inherent causal relationship between welding parameters, material hardness, removal rate, and internal cutting amount. The model has poor generalization ability, and the prediction accuracy drops significantly when welding process parameters fluctuate, which cannot meet the application needs of complex working conditions in industrial sites. Summary of the Invention
[0004] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a method for analyzing the amount of welding beads requiring internal grinding on the inner wall of pipes. By simultaneously acquiring welding process time-series data and welding bead 3D morphology point cloud data, parallel welding bead samples from the same process are prepared to obtain hardness distribution and establish a material removal rate mapping table covering all parameters. A multimodal causal dataset for welding grinding is constructed. Then, based on prior knowledge of welding metallurgy and grinding mechanics, a directed acyclic causal graph and a causal graph neural network model integrating multimodal features are built. Causal constraints and counterfactual reasoning are introduced to improve the model's generalization ability. Finally, the basic removal amount is calculated by fitting the inner circle of the base material and dynamically corrected using the position-related removal rate coefficient output by the model, generating a circumferential rotating layered grinding trajectory. This method solves the technical problems of low efficiency, poor accuracy, and strong subjectivity in traditional manual measurement methods; the tendency of single geometric morphology analysis methods to ignore material hardness differences and easily lead to over-grinding or under-grinding; and the significant decrease in prediction accuracy when traditional machine learning methods fail to uncover inherent causal relationships and welding process parameters fluctuate.
[0005] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a method for analyzing the amount of weld beads that need to be ground inside the inner wall of a pipe, comprising: After a single pass of pipe welding is completed, the welding process timing data of the complete welding process from the moment the arc is started to the moment the arc is ended is collected, and the three-dimensional topographic point cloud data of the weld bead and the surrounding base material area is obtained. Welding process features are extracted from welding process time series data. Parallel weld bead samples with the same welding process parameters as the weld to be ground are prepared and their hardness distribution cloud map is obtained. Single-factor grinding experiments are carried out to establish a material removal rate mapping table. Welding process features, weld bead three-dimensional morphology point cloud data, hardness distribution cloud map, material removal rate mapping table and standard internal tangent are correlated one-to-one to form a welding grinding multimodal causal dataset. A directed acyclic causal graph containing welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent amount nodes is constructed. A causal graph neural network model consisting of a feature extraction layer, a graph convolutional layer, a counterfactual reasoning layer, and an output layer is built. The causal graph neural network model is trained using a multimodal causal dataset of welding and grinding. The base material inner circle is fitted based on the three-dimensional morphology point cloud data of the weld bead and the basic removal amount at each position of the weld bead is calculated. The welding process features and the three-dimensional point cloud data of the weld bead cross section are input into the causal graph neural network model, and the grinding removal rate coefficient at the corresponding position is output. The basic removal amount is corrected using the removal rate coefficient to obtain the final inner cutting amount. A circumferential rotational layered grinding trajectory is generated based on the final inner cutting amount.
[0006] Furthermore, the welding process timing data covers the entire welding process from the start of the arc to the end of the arc, including welding current, welding voltage, wire feed speed, and welding speed. A continuous scan is performed on the base material area extending 50mm to both sides of the weld bead's axial centerline to acquire three-dimensional topographic point cloud data covering the entire inner circumference of the pipe. The welding process timing data is then filtered using a 5-point moving average to remove high-frequency electrical noise generated during welding. Statistical filtering is applied to the three-dimensional topographic point cloud data, calculating the average distance between each point and its 20 nearest neighbors. Outliers with an average distance greater than three times the global average distance are removed. Radius filtering is then applied to the remaining three-dimensional topographic point cloud data, with a search radius of 0.1mm to remove isolated noise points with fewer than five neighbors within this search radius.
[0007] Furthermore, welding process features were extracted from the welding process time sequence data, including the average welding current, welding current variance, average welding voltage, welding voltage variance, average wire feed speed, average welding speed, and welding heat input. Three parallel weld bead samples with the same welding process parameters as the weld to be ground were prepared. The welding process parameters included welding current, welding voltage, wire feed speed, welding speed, welding wire type, base material type, and shielding gas flow rate. Each parallel weld bead sample was cut into sections along a plane perpendicular to the center line of the weld bead axis. The cutting started in the base material area 50 mm from one side of the weld bead and ended in the base material area 50 mm from the other side of the weld bead. A section was cut every 5 mm along the center line of the weld bead axis. All the cut sections were then subjected to coarse grinding, fine grinding, polishing, and 4% nitric acid alcohol etching treatment to prepare metallographic samples.
[0008] Furthermore, hardness tests were performed on each metallographic specimen. Grid test points were arranged on the cross-section of each metallographic specimen at a horizontal spacing of 0.1 mm and a vertical spacing of 0.1 mm. All test points completely covered the weld bead fusion zone, heat-affected zone, and base material zone. The base material zone was covered by at least 5 consecutive test points, the heat-affected zone by at least 10 consecutive test points, and the fusion zone by at least 15 consecutive test points. Hardness distribution cloud maps of each cross-section were obtained.
[0009] Furthermore, single-factor grinding experiments were conducted, testing the material removal rate for all parameter combinations within the hardness range of 150HV to 350HV (in 10HV increments), grinding force within the range of 5N to 20N (in 1N increments), and feed speed within the range of 5mm / s to 15mm / s (in 1mm / s increments). The material removal rate was obtained by calculating the volumetric removal amount and grinding time using 3D morphology scans before and after grinding. Each parameter combination was repeated several times, and the arithmetic mean of the material removal rates obtained from several experiments was taken as the final material removal rate for that parameter combination, establishing a material removal rate mapping table. Welding process features, weld bead 3D morphology point cloud data, hardness distribution cloud map, material removal rate mapping table, and measured standard internal shear were correlated one-to-one. For each sampling point in each weld bead cross-section that corresponds one-to-one with the 3D morphology point cloud, causal chain labels for welding parameters, internal hardness distribution, grinding removal rate, and internal shear were established, forming a welding grinding multimodal causal dataset.
[0010] Furthermore, a fixed-structure directed acyclic causal graph is constructed, including welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent nodes. The welding parameter nodes are feature vectors containing multiple dimensions, corresponding to the extracted mean welding current, variance welding current, mean welding voltage, variance welding voltage, mean wire feed speed, mean welding speed, and welding heat input. The hardness distribution nodes, removal rate nodes, and internal tangent nodes are all vectors containing multiple dimensions, corresponding to the hardness value, removal rate value, and internal tangent value of each circumferential sampling point of the circumferential cross-section, respectively. There are only three directed edges in the causal graph: the welding parameter node points to the hardness distribution node, the hardness distribution node points to the removal rate node, and the removal rate node points to the internal tangent node.
[0011] Furthermore, the feature extraction layer consists of a one-dimensional convolutional neural network and a PointNet++ network connected in parallel. The input of the one-dimensional convolutional neural network is the welding process features, which includes two convolutional layers and one global average pooling layer. The input of the PointNet++ network is the three-dimensional point cloud data of the weld bead cross-section, with each point containing three coordinate values (x, y, z), which includes two SetAbstraction layers and one global feature extraction layer. The outputs of the two networks are concatenated to obtain a joint feature vector. The graph convolutional layer contains two graph attention networks, which only propagate information along the directed edges of the constructed causal graph, prohibiting reverse information flow. The counterfactual reasoning layer generates counterfactual input samples by modifying the value of any dimension of the welding parameter node to a preset intervention value within the range of that feature value, with a stride of 1 / 10 of the feature value range, while keeping the values of other dimensions unchanged. The output layer is a fully connected layer with a sigmoid activation function, which outputs the grinding removal rate coefficient of the weld bead cross-section sampling points, with the output value range limited to 0.8~1.5.
[0012] Furthermore, the constructed welding and grinding multimodal causal dataset was randomly divided into training, validation, and test sets in a 7:2:1 ratio, using a single complete weld bead as the unit. The Adam optimizer was used to train the causal graph neural network model, and the test set was used to validate the trained causal graph neural network model. The mean absolute error of the removal rate coefficient of the model on all sampling points of all weld bead samples in the test set was calculated. If the mean absolute error is less than or equal to the error threshold, the model is considered to have passed the training. If the mean absolute error is greater than the error threshold, the hidden layer dimension of the graph convolutional layer, the number of attention heads, and the initial learning rate are adjusted in sequence, and the training and validation steps are repeated until the causal graph neural network model is trained successfully.
[0013] Furthermore, based on the 3D morphology point cloud data of the weld bead, each circumferential cross-section of the weld bead is processed separately. Point clouds of the base material region not covered by the weld bead are extracted within 20mm on both sides of the axial center line of the weld bead within the cross-section, with a height difference of less than 0.05mm. The point cloud of the base material region is fitted with an inner circle trajectory using the least squares method in the cross-sectional plane perpendicular to the pipe axis. Abnormal points with a deviation greater than 0.05mm from the fitted circle are iteratively removed to obtain the center coordinates and radius of the inner circle of the base material in the cross-section. The vertical distance from the coordinates of each circumferential sampling point on the weld bead cross-section to the fitted inner circle of the base material is calculated to obtain the current height of each position of the weld bead, and thus the basic removal amount is obtained. The welding process features corresponding to the weld bead and the 3D point cloud data of the sampling points of the weld bead cross-section are input into the causal graph neural network model to output the removal rate coefficient corresponding to each sampling point of the weld bead cross-section.
[0014] Furthermore, the basic removal amount is dynamically corrected based on the grinding removal rate coefficient at each location to obtain the final internal shear amount, and a mandatory hard constraint is applied. If the calculated final internal shear amount exceeds the constraint value, it is truncated to the constraint value. A circumferential rotating layered grinding trajectory is generated based on the final internal shear amount distribution of all cross sections of the solder ball, including a coarse grinding layer, a fine grinding layer, and a finishing layer. The grinding rotation directions of adjacent two layers are opposite.
[0015] (III) Beneficial Effects This invention provides a method for analyzing the amount of weld beads that need to be ground inside the pipe wall, which has the following advantages: (1) By collecting complete welding time sequence data of the entire welding process and the three-dimensional shape point cloud of the weld beads in the whole domain, and then using moving average filtering, statistical filtering and radius filtering for dual denoising, high-frequency electrical noise, outliers and isolated noise points are effectively removed, and accurate and pure original data is obtained, which lays a solid data foundation for subsequent feature extraction, model training and accurate calculation of grinding amount.
[0016] (2) Extract the core features of welding, prepare parallel samples to obtain the hardness distribution of the weld bead across the entire range, establish a material removal rate mapping table through single-factor grinding experiments, accurately correlate multi-dimensional data to construct a causal dataset, clearly anchor the intrinsic relationship between welding parameters, hardness, removal rate and internal shear amount, and provide high-quality and highly correlated causal data support for model training.
[0017] (3) Construct a directed acyclic causal graph and build a causal graph neural network, integrate causal constraints and counterfactual reasoning, divide the dataset according to proportions for training and optimization, strictly limit the forward propagation of information, greatly improve the model's prediction accuracy and generalization ability, and can stably output accurate polishing removal rate coefficients, providing reliable model support for subsequent dynamic correction of polishing amount.
[0018] (4) Accurately fit the base material inner circle to calculate the amount of material to be removed, combine the model coefficients to dynamically correct and apply safety hard constraints to generate a layered grinding trajectory, taking into account both grinding efficiency and forming quality. It can also continuously optimize the model through incremental fine-tuning, effectively avoiding over-grinding and under-grinding, and ensuring the pipe wall thickness retention rate and grinding accuracy. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the steps in the method for analyzing the amount of weld beads cut and ground on the inner wall of a pipe according to the present invention. Figure 2 This is a schematic diagram of the method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please see Figures 1-2 This invention provides a method for analyzing the amount of weld beads that need to be ground inside the inner wall of a pipe, including the following: Step 1: After the single-pass welding of the pipeline is completed, the welding process timing data of the complete welding process from the moment of arc initiation to the moment of arc termination is collected, and the three-dimensional topographic point cloud data of the weld bead and the surrounding base material area are obtained. Step one includes the following: Step 101: After the single-pass welding of the pipeline is completed, export and extract the welding process timing data collected and stored in real time during the welding process of the welding control system. The data time range strictly covers the complete welding process of the weld from the moment of arc ignition to the moment of arc termination. The collected parameters include welding current, welding voltage, wire feed speed and welding speed. The sampling frequency of the above four parameters is 1000Hz. Step 102: Insert the pipe inspection robot equipped with a line laser profile sensor into the pipe from the pipe port corresponding to the weld to be ground. Use the robot's built-in high-definition camera to assist in positioning until the line laser profile sensor is directly above the axial center line of the weld bead. Activate the robot's built-in pneumatic three-jaw self-centering support device so that the three support jaws press against the inner wall of the pipe with equal pressure, ensuring that the robot axis is coaxial with the pipe axis, with a coaxiality error of no more than 0.1mm. Adjust the circumferential angle of the line laser profile sensor by using the robot's rotating joint in conjunction with the weld bead image captured by the high-definition camera, so that the laser emission plane of the line laser profile sensor is perpendicular to the axial center line of the weld bead, with an angle deviation of no more than 0.5°. Step 103: Control the robot to move at a constant speed of 1 mm / s along the axial direction of the pipe, and continuously scan the base material area extending 50 mm to both sides of the axial centerline of the weld bead, to obtain three-dimensional topographic point cloud data covering the entire inner circumference surface of the pipe. The axial sampling resolution is 0.03 mm, that is, the robot collects a complete circumferential cross-sectional data for every 0.03 mm of movement, and the number of circumferential sampling points for each complete circumferential cross-section is fixed at 400 points. Step 104: Perform 5-point moving average filtering on the time-series data of welding current, welding voltage, wire feed speed, and welding speed to remove high-frequency electrical noise generated during the welding process; perform statistical filtering on the three-dimensional topography point cloud data, calculate the average distance between each point and its 20 nearest neighbors, remove outliers whose average distance is greater than 3 times the standard deviation of the global average distance of all points, and then perform radius filtering on the remaining three-dimensional topography point cloud data, setting the search radius to 0.1 mm, and remove isolated noise points with fewer than 5 neighbors within the search radius.
[0022] When using this method, refer to steps 101 to 104: By collecting complete welding time-series data of the entire welding process and the three-dimensional topography point cloud of the weld beads, and performing dual denoising through moving average filtering, statistical filtering and radius filtering, high-frequency electrical noise, outliers and isolated noise points are effectively removed, and accurate and pure raw data is obtained, laying a solid data foundation for subsequent feature extraction, model training and accurate calculation of grinding amount.
[0023] Step 2: Extract welding process features from welding process time series data, prepare parallel weld bead samples with the same welding process parameters as the weld to be ground and obtain their hardness distribution cloud map, conduct single-factor grinding experiments to establish a material removal rate mapping table, and associate the welding process features, weld bead three-dimensional morphology point cloud data, hardness distribution cloud map, material removal rate mapping table with the standard internal tangent to form a welding grinding multimodal causal dataset. Step two includes the following: Step 201: Extract welding process features from the welding process time series data. The extracted features include the mean welding current, the variance of welding current, the mean welding voltage, the variance of welding voltage, the mean wire feed speed, the mean welding speed, and the welding heat input. Step 202: Prepare three parallel weld bead samples with the same welding process parameters as the weld bead to be ground. The welding process parameters include welding current, welding voltage, wire feed speed, welding speed, welding wire type, base material type, and shielding gas flow rate. Use an electric spark wire cutting device to cut the cross section of each parallel weld bead sample along a plane perpendicular to the center line of the weld bead axis. The cutting starts in the base material area 50 mm on one side of the weld bead and ends in the base material area 50 mm on the other side of the weld bead. Cut a cross section every 5 mm along the center line of the weld bead axis. All the cut cross sections are then subjected to rough grinding, fine grinding, polishing, and 4% nitric acid alcohol etching treatment to prepare metallographic samples. Step 203: Use a Vickers microhardness tester to test the hardness of each metallographic specimen. The test load is set to 100 gf and the holding time is set to 10 s. Arrange grid-like test points on the cross section of each metallographic specimen with a horizontal spacing of 0.1 mm and a vertical spacing of 0.1 mm. All test points completely cover the weld bead fusion zone, heat-affected zone and base material zone. The base material zone should be covered by at least 5 consecutive test points, the heat-affected zone should be covered by at least 10 consecutive test points, and the fusion zone should be covered by at least 15 consecutive test points. Obtain the hardness distribution cloud map of each cross section. Step 204: Conduct single-factor grinding experiments. Using the same grinding wheel model, grinding wheel material, grinding wheel grit size, and grinding wheel speed as the actual grinding process in Step 4 of this invention, test the material removal rate corresponding to all parameter combinations with hardness values in the range of 150HV to 350HV (step size 10HV), grinding force in the range of 5N to 20N (step size 1N), and feed speed in the range of 5mm / s to 15mm / s (step size 1mm / s). The material removal rate is obtained by calculating the volume removal amount by scanning the three-dimensional morphology before and after grinding and then dividing it by the grinding time. Each parameter combination is repeated several times for grinding experiments. The arithmetic mean of the material removal rate measured in several experiments is taken as the final material removal rate of the parameter combination. Establish a material removal rate mapping table. Step 205: Correlate the welding process features, weld bead 3D morphology point cloud data, hardness distribution cloud map, material removal rate mapping table, and measured standard internal shear amount one-to-one. Establish a causal chain label for each sampling point in each weld bead cross section that corresponds one-to-one with the 3D morphology point cloud, forming a welding-grinding multimodal causal dataset.
[0024] When using this method, refer to steps 201 to 205: The core features of welding were extracted, parallel samples were prepared to obtain the hardness distribution of the weld beads over the entire range, and a material removal rate mapping table was established through single-factor grinding experiments. Multi-dimensional data were accurately correlated to construct a causal dataset, clearly anchoring the intrinsic relationship between welding parameters, hardness, removal rate and internal shear amount, providing high-quality and highly correlated causal data support for model training.
[0025] Step 3: Construct a directed acyclic causal graph containing welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent amount nodes. Build a causal graph neural network model consisting of a feature extraction layer, a graph convolutional layer, a counterfactual reasoning layer, and an output layer connected in series. Train the causal graph neural network model using a multimodal causal dataset of welding and grinding. Step three includes the following: Step 301: Based on prior knowledge in welding metallurgy and grinding mechanics, a fixed-structure directed acyclic causal graph is constructed. The causal graph contains four types of nodes: welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent nodes. The welding parameter nodes are feature vectors with multiple dimensions, corresponding to the extracted mean welding current, variance welding current, mean welding voltage, variance welding voltage, mean wire feed speed, mean welding speed, and welding heat input. The hardness distribution nodes, removal rate nodes, and internal tangent nodes are all vectors with multiple dimensions, corresponding to the hardness value, removal rate value, and internal tangent value of each circumferential sampling point of the circumferential cross-section, respectively. There are only three directed edges in the causal graph: welding parameter nodes pointing to hardness distribution nodes, hardness distribution nodes pointing to removal rate nodes, and removal rate nodes pointing to internal tangent nodes. The initial attention weight of all edges is set to 0.5. Step 302: Construct a causal graph neural network model. This neural network model consists of a feature extraction layer, a graph convolutional layer, a counterfactual reasoning layer, and an output layer connected in series. The feature extraction layer is composed of a one-dimensional convolutional neural network and a PointNet++ network connected in parallel. The input of the one-dimensional convolutional neural network is the welding process features, which includes two convolutional layers and one global average pooling layer. The kernel size of each convolutional layer is 3, the stride is 1, the padding is 1, and the output dimension is 64. The input of the PointNet++ network is the three-dimensional point cloud data of the weld bead cross-section. Each point contains three coordinate values: x, y, and z. It includes two SetAbstraction layers and one global feature extraction layer. The first SetAbstraction layer has 100 sampling points, a search radius of 0.2 mm, and an MLP dimension of [64, 64, 128]. The abstraction layer has 25 sampling points and a search radius of 0.4 mm. The MLP dimension is [128, 128, 256]. The global feature extraction layer has an output dimension of 128. The outputs of the two networks are concatenated to obtain a joint feature vector. The graph convolutional layer contains two graph attention networks, each with 8 attention heads and a hidden layer dimension of 64. Information propagation only occurs along the directed edges of the constructed causal graph, and reverse information flow is prohibited. The counterfactual reasoning layer generates counterfactual input samples by modifying the value of a certain dimension of the welding parameter node to a preset intervention value within the range of that feature value, with a stride of 1 / 10 of the feature value range, while keeping other dimension values unchanged. The output layer is a fully connected layer with a sigmoid activation function. The output dimension is the number of sampling points, corresponding to the grinding removal rate coefficient of the sampling points on the weld bead cross-section. The output value range is limited to 0.8~1.5. Step 303: The constructed welding and grinding multimodal causal dataset is randomly divided into training, validation, and test sets in a ratio of 7:2:1, with each complete weld bead as a unit. The Adam optimizer is used to train the model, with the optimizer parameters set to β1=0.9, β2=0.999, ε=1e-8, the initial learning rate set to 0.001, the batch size set to 32, and the number of training epochs set to 100. During training, validation is performed on the validation set after each training epoch. If the validation set loss does not decrease after 10 consecutive epochs, the learning rate is multiplied by 0.5. If the validation set loss does not decrease after 20 consecutive epochs, training is terminated early. Step 304: The total loss function used in the model training process is L = Ldata + λ1 × Lcausal + λ2 × Lcountfactual Ldata is the data fitting loss, which is the mean square error between the predicted removal rate coefficient and the actual removal rate coefficient. The actual removal rate coefficient is calculated as follows: The Vickers hardness value of the weld bead cross-section sampling point is extracted from the hardness distribution cloud map. Then, the material removal rate mapping table is consulted to obtain the material removal rate corresponding to each hardness value under standard grinding process parameters: grinding force 10N, feed speed 10mm / s, and grinding wheel speed 3000rpm. The standard removal rate of the base material is calculated: the material removal rate corresponding to a base material hardness of 160HV. Finally, the actual removal rate coefficient = material removal rate at this location / standard removal rate of the base material. Lcausal is the causal constraint loss, calculated as the sum of the L1 norms of the back information propagation weights from the hardness distribution node to the welding parameter node, from the removal rate node to the hardness distribution node, and from the internal tangent node to the removal rate node in the graph convolutional layer. It is used to penalize information flow that violates the causal direction. Lcounterfactual is the counterfactual reasoning loss, calculated as the mean square error between the predicted removal rate coefficient and the actual counterfactual removal rate coefficient corresponding to the counterfactual input sample. The actual counterfactual removal rate coefficient is calculated as follows: Method Calculation: Find the three samples closest to the intervention parameters from the welding and grinding multimodal causal dataset. The intervention parameters are the welding parameters after intervention by the counterfactual inference layer in step 302. The predicted hardness value of the weld bead cross-section sampling point under the intervention parameters is calculated by linear interpolation. The corresponding removal rate is obtained by querying the material removal rate mapping table. The true counterfactual removal rate coefficient is obtained by the same calculation method as the true removal rate coefficient. λ1 and λ2 are fixed weight coefficients with a value range of 0~1. The default settings are 0.5 and 0.3. The total loss function adopts a three-layer progressive structure of data fitting loss + causal constraint loss + counterfactual inference loss. Data fitting loss ensures the model's fitting accuracy to the known labeled data and avoids excessive deviation between the predicted value and the true value. Causal constraint loss punishes the information propagating in the reverse direction of the causal graph, forcing the model to learn only along the true causal path of welding parameters → hardness distribution → removal rate → internal shear, eliminating false associations from the root. Counterfactual inference loss verifies the model's ability to predict how the removal rate changes after changing a certain welding parameter, forcing the model to learn transferable causal laws and improving out-of-distribution generalization ability. Step 305: Validate the trained causal graph neural network model using the test set. Calculate the mean absolute error of the removal rate coefficient of the model on all sampling points of all solder bead samples in the test set. If the mean absolute error is less than or equal to the error threshold of 0.018, the model is considered to have passed training, and the model weight file is saved to the storage unit of the polishing control system. If the mean absolute error is greater than the error threshold of 0.018, adjust the hidden layer dimension of the graph convolutional layer in sequence: 32~128, stride 32, number of attention heads: 4~16, stride 4, initial learning rate: 0.0001~0.01, 10 times stride, and repeat steps 303 to 305 until the model is trained successfully.
[0026] When using this method, refer to steps 301 to 305: By constructing a directed acyclic causal graph and building a causal graph neural network, incorporating causal constraints and counterfactual reasoning, and dividing the dataset proportionally for training and optimization, and strictly limiting the forward propagation of information, the model's prediction accuracy and generalization ability are significantly improved. It can stably output accurate polishing removal rate coefficients, providing reliable model support for subsequent dynamic correction of polishing amount.
[0027] Step 4: Fit the inner circle of the base material based on the three-dimensional morphology point cloud data of the weld bead and calculate the basic removal amount at each position of the weld bead. Input the welding process features and the three-dimensional point cloud data of the weld bead cross section into the causal graph neural network model, output the grinding removal rate coefficient at the corresponding position, use the removal rate coefficient to correct the basic removal amount to obtain the final inner cutting amount, and generate a circumferential rotational layered grinding trajectory based on the final inner cutting amount.
[0028] Step four includes the following: Step 401: Based on the three-dimensional topography point cloud data of the weld bead, process each circumferential cross section of the weld bead separately, extract the point cloud of the base material area not covered by the weld bead within 20 mm on both sides of the axial center line of the weld bead in the cross section with a height difference of less than 0.05 mm, and use the least squares method to fit the inner circle trajectory of the base material area point cloud in the cross section plane perpendicular to the pipe axis. Iteratively remove outliers with a deviation greater than 0.05 mm from the fitted circle and refit until there are no outliers. Finally, calculate the center coordinates (x0, y0) and radius R of the inner circle of the base material in the cross section. Step 402: Calculate the perpendicular distance h from the coordinates (x, y) of each circumferential sampling point on the weld bead cross-section to the inner circle of the fitted base material, which is: h = R - √[(x - x0)]. 2 +(y-y0) 2 The current height of each position of the weld bead is obtained, and then the basic removal amount is calculated: Basic removal amount = current height - target remaining height, where the target remaining height is set according to the pipeline pressure level. When the pressure level is ≤ PN16, the target remaining height is 0.1mm, and when the pressure level is > PN16, the target remaining height is 0mm. If the calculated basic removal amount is < 0, it is set to 0. Step 403: Input the welding process features corresponding to the weld bead and the three-dimensional point cloud data of the sampling points of the weld bead cross section into the causal graph neural network model, and output the removal rate coefficient corresponding to the sampling points of the weld bead cross section. The output value range is limited to 0.8~1.5. Step 404: Based on the grinding removal rate coefficient at each location, perform position-related dynamic correction on the basic removal amount to obtain the final internal cutting amount: final internal cutting amount = basic removal amount × removal rate coefficient, and apply a mandatory hard constraint: final internal cutting amount ≤ min (nominal pipe wall thickness × 5%, 0.2 mm). If the calculated final internal cutting amount exceeds this constraint value, it is truncated to the constraint value. Step 405: Generate a circumferential rotary layered grinding trajectory based on the final internal shear distribution of all cross-sections of the solder bead, including a coarse grinding layer, a fine grinding layer, and a finishing layer. The coarse grinding layer has a feed rate of 12 mm / s and a grinding force of 15 N, removing 80% of the final internal shear. The fine grinding layer has a feed rate of 8 mm / s and a grinding force of 10 N, removing 15% of the final internal shear. The finishing layer has a feed rate of 5 mm / s and a grinding force of 5 N, removing the remaining 5% of the final internal shear. The grinding trajectories of adjacent layers are rotated... The rotation direction is opposite, and the axial overlap rate of adjacent grinding trajectories is 35%. After grinding 10 solder balls consecutively, the three-dimensional morphology data of these 10 solder balls before and after grinding are collected, and the actual removal amount at each position is calculated. Incremental fine-tuning dataset is constructed in this way, and incremental fine-tuning is performed on the causal graph neural network model. During fine-tuning, all parameters of the causal graph structure layer and feature extraction layer are frozen, and only the parameters of the graph convolutional layer are updated. The fine-tuning learning rate is set to 0.0001, the batch size is set to 16, and the number of training rounds is set to 5.
[0029] When using this method, refer to steps 401 to 405: The model accurately fits the inner circle of the base material to calculate the amount of material to be removed. It combines the model coefficients with dynamic correction and applies safety hard constraints to generate a layered grinding trajectory. It takes into account both grinding efficiency and forming quality. It can also continuously optimize the model through incremental fine-tuning, effectively avoiding over-grinding and under-grinding, and ensuring the pipe wall thickness retention rate and grinding accuracy.
[0030] In the application, the various formulas mentioned are all calculated by removing dimensions and taking their numerical values. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The coefficients in the formulas are set by those skilled in the art according to the actual situation.
[0031] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, and combinations thereof. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0032] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0033] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for analyzing the amount of weld beads that need to be ground inside the inner wall of a pipe, characterized in that: include: After a single pass of pipe welding is completed, the welding process timing data of the complete welding process from the moment the arc is started to the moment the arc is ended is collected, and the three-dimensional topographic point cloud data of the weld bead and the surrounding base material area is obtained. Welding process features are extracted from welding process time series data. Parallel weld bead samples with the same welding process parameters as the weld to be ground are prepared and their hardness distribution cloud map is obtained. Single-factor grinding experiments are carried out to establish a material removal rate mapping table. Welding process features, weld bead three-dimensional morphology point cloud data, hardness distribution cloud map, material removal rate mapping table and standard internal tangent are correlated one-to-one to form a welding grinding multimodal causal dataset. A directed acyclic causal graph containing welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent amount nodes is constructed. A causal graph neural network model consisting of a feature extraction layer, a graph convolutional layer, a counterfactual reasoning layer, and an output layer is built. The causal graph neural network model is trained using a multimodal causal dataset of welding and grinding. The base material inner circle is fitted based on the three-dimensional morphology point cloud data of the weld bead and the basic removal amount at each position of the weld bead is calculated. The welding process features and the three-dimensional point cloud data of the weld bead cross section are input into the causal graph neural network model, and the grinding removal rate coefficient at the corresponding position is output. The basic removal amount is corrected using the removal rate coefficient to obtain the final inner cutting amount. A circumferential rotational layered grinding trajectory is generated based on the final inner cutting amount.
2. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 1, characterized in that: The welding process timing data covers the entire welding process from the moment the arc is started to the moment the arc is ended, including welding current, welding voltage, wire feed speed and welding speed. The base material area extending 50mm to both sides of the center line of the weld bead axis is continuously scanned to obtain three-dimensional topographic point cloud data covering the entire inner circumference surface of the pipe. The welding process time series data is filtered by a 5-point moving average to remove high-frequency electrical noise generated during welding. The 3D topography point cloud data is statistically filtered to calculate the average distance between each point and its 20 nearest neighbors. Outliers with an average distance greater than 3 times the standard deviation of the global average distance of all points are removed. The remaining 3D topography point cloud data is then filtered by radius. The search radius is set to 0.1 mm to remove isolated noise points with fewer than 5 neighbors within the search radius.
3. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 1, characterized in that: Welding process features were extracted from the welding process time series data, including the average welding current, welding current variance, average welding voltage, welding voltage variance, average wire feed speed, average welding speed, and welding heat input. Three parallel weld bead samples with the same welding process parameters as the weld to be ground were prepared. The welding process parameters included welding current, welding voltage, wire feed speed, welding speed, welding wire type, base material type, and shielding gas flow rate. Each parallel weld bead sample was cut into sections along a plane perpendicular to the center line of the weld bead axis. The cutting started in the base material area 50 mm from one side of the weld bead and ended in the base material area 50 mm from the other side of the weld bead. A section was cut every 5 mm along the center line of the weld bead axis. All the cut sections were then subjected to coarse grinding, fine grinding, polishing, and 4% nitric acid alcohol etching treatment to prepare metallographic samples.
4. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 3, characterized in that: Hardness tests were performed on each metallographic specimen. Grid test points were arranged on the cross-section of each metallographic specimen at horizontal and vertical intervals of 0.1 mm. All test points completely covered the weld bead fusion zone, heat-affected zone, and base metal zone. The base metal zone was covered by at least 5 consecutive test points, the heat-affected zone by at least 10 consecutive test points, and the fusion zone by at least 15 consecutive test points. Hardness distribution cloud maps of each cross-section were obtained.
5. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 4, characterized in that: Single-factor grinding experiments were conducted, testing the material removal rate for all parameter combinations within the hardness range of 150HV to 350HV (in 10HV increments), grinding force within the range of 5N to 20N (in 1N increments), and feed speed within the range of 5mm / s to 15mm / s (in 1mm / s increments). The material removal rate was obtained by calculating the volumetric removal amount and grinding time using 3D morphology scans before and after grinding. Each parameter combination was repeated several times, and the arithmetic mean of the material removal rates obtained from these experiments was taken as the final material removal rate for that parameter combination, thus establishing a material removal rate mapping table. Welding process features, weld bead 3D morphology point cloud data, hardness distribution cloud map, material removal rate mapping table, and measured standard internal shear were correlated one-to-one. For each sampling point in each weld bead cross-section that corresponds one-to-one with the 3D morphology point cloud, causal chain labels for welding parameters, internal hardness distribution, grinding removal rate, and internal shear were established, forming a welding grinding multimodal causal dataset.
6. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 1, characterized in that: A fixed-structure directed acyclic causal graph is constructed, comprising welding parameter nodes, hardness distribution nodes, removal rate nodes, and internal tangent nodes. The welding parameter nodes are feature vectors with multiple dimensions, corresponding to the extracted mean welding current, variance of welding current, mean welding voltage, variance of welding voltage, mean wire feed speed, mean welding speed, and welding heat input. The hardness distribution nodes, removal rate nodes, and internal tangent nodes are also vectors with multiple dimensions, corresponding to the hardness value, removal rate value, and internal tangent value of each circumferential sampling point of the circumferential cross-section, respectively. The causal graph contains only three directed edges: welding parameter nodes pointing to hardness distribution nodes, hardness distribution nodes pointing to removal rate nodes, and removal rate nodes pointing to internal tangent nodes.
7. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 6, characterized in that: The feature extraction layer consists of a one-dimensional convolutional neural network and a PointNet++ network connected in parallel. The input to the one-dimensional convolutional neural network is the welding process features, which includes two convolutional layers and one global average pooling layer. The input to the PointNet++ network is the three-dimensional point cloud data of the weld bead cross-section, where each point contains three coordinate values (x, y, z), and includes two SetAbstraction layers and one global feature extraction layer. The outputs of the two networks are concatenated to obtain a joint feature vector. The graph convolutional layer contains two graph attention networks that propagate information only along the directed edges of the constructed causal graph, prohibiting reverse information flow. The counterfactual inference layer generates counterfactual input samples by modifying the value of any dimension of the welding parameter node to a preset intervention value within the range of that feature value, with a stride of 1 / 10 of the feature value range, while keeping other dimension values unchanged. The output layer is a fully connected layer with a sigmoid activation function, outputting the grinding removal rate coefficient of the weld bead cross-section sampling points, with the output value range limited to 0.8~1.
5.
8. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 7, characterized in that: The constructed welding and grinding multimodal causal dataset was randomly divided into training, validation, and test sets in a 7:2:1 ratio, using a single complete weld bead as the unit. The Adam optimizer was used to train the causal graph neural network model. The test set was used to validate the trained causal graph neural network model. The mean absolute error (MAE) of the model's removal rate coefficients across all sampling points of all weld bead samples in the test set was calculated. If the MAE was less than or equal to the error threshold, the model was considered successfully trained. If the MAE was greater than the error threshold, the hidden layer dimension, the number of attention heads, and the initial learning rate of the graph convolutional layers were adjusted sequentially, and the training and validation steps were repeated until the causal graph neural network model was successfully trained.
9. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 1, characterized in that: Based on the 3D topographic point cloud data of the weld bead, each circumferential cross-section of the weld bead is processed separately. Point clouds of the base material region not covered by the weld bead are extracted within 20mm on both sides of the axial center line of the weld bead within the cross-section, with a height difference of less than 0.05mm. The point cloud of the base material region is fitted with an inner circle trajectory using the least squares method in the cross-sectional plane perpendicular to the pipe axis. Outliers with a deviation greater than 0.05mm from the fitted circle are iteratively removed to obtain the center coordinates and radius of the inner circle of the base material in the cross-section. The vertical distance from the coordinates of each circumferential sampling point on the weld bead cross-section to the fitted inner circle of the base material is calculated to obtain the current height of each position of the weld bead, and thus the basic removal amount is obtained. The welding process features corresponding to the weld bead and the 3D point cloud data of the sampling points of the weld bead cross-section are input into the causal graph neural network model to output the removal rate coefficient corresponding to each sampling point of the weld bead cross-section.
10. The method for analyzing the amount of weld beads that need to be ground inside the pipe wall according to claim 9, characterized in that: The base removal amount is dynamically corrected based on the grinding removal rate coefficient at each location to obtain the final internal shear amount, and a mandatory hard constraint is applied. If the calculated final internal shear amount exceeds the constraint value, it is truncated to the constraint value. A circumferential rotating layered grinding trajectory is generated based on the final internal shear amount distribution of all cross sections of the solder ball, including a coarse grinding layer, a fine grinding layer, and a finishing layer. The grinding rotation directions of adjacent two layers are opposite.
