System Design and Monitoring Method of Robot Grinding for Friction Stir Weld Seam

: In the grinding process of friction stir weld seams, excessive grinding will cause damage to the base metal and bring signiﬁcant economic losses. In this paper, the authors design a robotic system for grinding the weld seam and present a monitoring method of excessive grinding. The designed system consists of an industrial robot, a line scanner for measuring the weld seam and a force-controlled grinding tool. Since the result of the measurement of the weld seam is a point cloud, the extraction method of the weld seam point cloud based on graph-cut is proposed in this paper. The extracted features are used as prior knowledge of the monitoring algorithm. On the other hand, by combining the features from the point cloud and force-position information during the processing, a monitoring method for excessive grinding based on PSO-SVM is proposed and veriﬁed by experiments. The experiments demonstrate that the proposed method can identify excessive grinding, and the accuracy of recognition is 91.5%.


Introduction
Crucial investigation regarding robot-based automation are required in modern industrial manufacturing, such as aerospace assembly, high-speed railway construction, nuclear power plants development, and other various applications [1]. When producing large and complex aluminum workpieces under high-quality needed conditions, the friction stir welding method is often applied due to its advantages of easy performing and materials protection [2]. In such method, the welding wire is not required, and damages like the arc light are avoided.
However, in order to refine the aerodynamic performance of the workpieces, the weld seam needs to be appropriately ground as glitches are often occured at the edge of the welding area. The traditional manual grinding method's accuracy largely depends on the experience of operators. Manual grinding makes it difficult to produce qualified workpieces, and grinding is dangerous and harmful to the operators. Therefore, the robotic grinding system is suitable for friction stir welding because it is safer and more efficient. In the grinding, it needs to be ensured that the welding area is free of the oxide film, possesses metallic luster, and the grinding lines are parallel to the weld direction. At present, although the removal of friction stir weld seam can adopt milling, when processing lightweight and thin-walled components, the workpieces are easily deformed and have poor rigidity, so it is inappropriate to use a milling method with position control and large cutting force.
In terms of grinding tools, belt grinding is more suitable than other tools like angle grinder or grindstone for two crucial reasons. On the one hand, the belt grinding is flexible and referred to as This paper is organized into four sections. The method for system design, extraction of the weld seam, and monitoring lie in Section 2. The experimental results and discussions are reported in Section 3, and finally, the conclusion is presented in Section 4.

Method
This section includes the design of the robot grinding system, the feature extraction and analysis method of the weld seam, and the monitor method of the grinding process.

System Design of Robot Grinding and Monitoring
The Robot grinding and monitoring system consists of 4 parts: a 6-dof industrial robot, a line laser scanner, a force-controlled grinding tool, and a workpiece. The scanner is mounted on the end of the robot. The grinding tool is connected to the robot through a quick-change tool device. The reason for using the line laser sensor is that it can achieve high-precision measurement and complete the point cloud reconstruction of the weld seam. In contrast, the authors have tested a structured light-based 3D camera. Due to its insufficient measurement resolution, the weld seam measurement was almost ineffective, and there were many holes in the measurement results. When the weld seam is scanned, the grinding tool was unloaded to avoid blocking laser, and then the robot moves along the direction perpendicular to the light plane of the scanner. Combined with the recorded robot poses, a 3D reconstruction of the weld seam can be achieved. System working status and the grinding tool are shown in Figure 2. The design of the grinding tool is shown in Figure 3. The tool includes both electrical and mechanical systems. The electrical system has an interactive panel, a power module, a communication module, a force sensor module, an industrial personal computer (IPC), and two motor drivers. Almost all of the electrical parts are integrated into the grinding tool, only additional electrical power and communication are needed externally. The mechanical system consists of a driving part, a tension part, and a compensation part. Among the three parts, the driving part and tension part both provide the power for grinding. The driving part has a servo motor, a synchronous belt, and a wheel that drives an abrasive belt. The tension part has a low friction pneumatic cylinder and a contact wheel. Its function is to tension the belt. The cylinder is controlled by constant pressure, and its air pressure value is controlled by an external precision pressure reducing valve. The compensation part has a servo-electric cylinder, a contact wheel, and a force sensor. The force sensor and the contact wheel are connected through the shafting so that the force sensor can reflect the contact force. The direction of the measured force is perpendicular to the surface of the workpiece. The stroke of the electric cylinder is 40mm. Since the robot positioning may not be accurate, when the contact wheel is far away from the weld seam or collides with the weld seam, the electric cylinder will expand or contract according to the force situation. During the grinding process, the force and the displacement of the electric cylinder are recorded simultaneously for real-time monitoring.

Extraction Method of Weld Seam
In this robot grinding system, the line laser scanner is adopted to generate the point cloud of the surface of the target workpiece. To get the weld seam part from the whole point cloud, the authors extract and segment the point cloud in two main steps: detection and partition. In the detection step, the authors distinguish the whole weld seam from the surface of the workpiece in the point cloud by optimizing a specially-designed energy function. In the partition step, the authors further segment a detected weld seam into several units according to specific features so that it can be used as prior knowledge of robot grinding monitoring.

Weld Seam Detection
Generally, the welded workpieces have relatively low curvatures, and weld seams generated on the surface have a relatively small size. Although the surface's curvature is low, there still exist lots of problems when using the traditional method to select the part of the weld seam. The authors have tested the least square method and the method based on the slope between points, but the results are not correct. Therefore, a method based on point cloud registration and graph-cut is adopted.
Before the detection, a method to remove the noise of the point cloud in [29] is adopted. Then, the detection method is described in detail as follows.
Firstly, the initial registration between the scanned point cloud (scan point cloud) and the point cloud (standard point cloud) sampled from the Computer Aided Design (CAD) model is used, and then the initial weld seam part can be obtained. However, since the surface of each workpiece is not precisely equal to the CAD model, especially when the weld seam is small relative to the base metal, a small curvature change easily leads to a large deviation of the result. So the obtained weld seam part is not always correct, and a more elaborate method is necessary. In this paper, in order to detect out a complete and accurate weld seam from each workpiece, the authors model this process as an energy optimization problem. However, simultaneously optimizing all the points in the point cloud is time-consuming. After designing a energy function for weld seam detection, an efficient optimization method is also needed. A coarse-to-fine strategy is adopted in the optimization to speed it up.
We define {point i } = W point j , {Bpoint k } , where W point j are weld seam points and {Bpoint k } are background points. The whole point cloud is {point i }. The energy is explained as follows, Three parts of the energy function are defined as: where R p l p is a penalty for assigning labels to one point p in point cloud {point i }.
where q is another point, and where σ is a constant, and where d is scanning result while d is the result from CAD model. We have assumed that the weld seam is continuous, so where C is a judgment function, and it aims to judge whether the points are consist. Its function is realized by judging whether the minimum value of the distance between every two points in the point cloud exceeds the threshold. In fact, the energy function E total can be directly adopted for optimization, and the optimization method in [30] is adopted. However, the scanning point cloud is relatively dense, so this method will lead to slow computing speed. So a coarse-to-fine method is presented in this step for optimization, and it contains: (1) Voxel segmentation. First, segment the point cloud into voxels.
(2) Initialization. For each voxel, its probability of containing points belonging to the weld seam is defined according to the result of the registration. After the registration, the distance between the points in the i th voxel and the registrated surface are obtained as d i , and d i is the average value of all the distances between all the points in the voxel and the surface. The normal distribution is used to estimate the probability that each voxel belongs to the weld seam. p( In the estimation, it is considered that the point farther away from the registration surface is more likely to belong to the weld seam. For example, when d i = 0.8 mm, the probability that it belongs to the weld points is set to 0.5. Then, the σ d can be obtained. Those voxels whose probabilities are larger than a threshold are selected as initial voxels to help optimize the E consist term. (3) Consistency check. To optimize the E consist term, the authors analyze the initial voxels and link them up to form a consistent result. The Dijkstra algorithm is adopted to calculate the shortest paths between each group of voxels to all other groups. The authors simply define the weights between two neighboring voxels as W(vi, vj) = (Pr(vi) + Pr(vj))/2. The authors then selected the shortest paths to merge two groups until the detection result forms one single group or exceeds the distance threshold.
(4) Voxel-level Graph-Cut. Optimize the E data + E pariwise term with the well-known graph cut algorithm. Note that for voxels selected by consistency check, the authors double their probability of being weld seams.
(5) Repeat (3) and (4) until the detected weld seams meet the consistency requirements, or the algorithm reaches the maximum iteration threshold. (6) Point-level Graph-Cut. For each voxel, the authors optimize E data + E pairwise at point level by graph cut. The neighbors of each point are initialized as its four nearest points in 3D space.
The result of the feature extraction is a point cloud representing one weld seam. There are two forms of the weld seam. One is a uniform line, which is higher than the surrounding plane, and the other is the uneven part. The differences between the two types and the monitoring methods will be discussed in the following chapters.

Weld Seam Partition
In the second step, a complete weld seam is divided into several segments. This extraction segment method is relatively simple. The partition is conducted along the grinding direction. First, a filtering method is adopted to remove the scanning noise, and then the segmentation is carried out according to the gradient of the projected point cloud. When a rise-drop process is detected, a part is divided.

Analysis of Weld Seam Grinding Process in Designed System
The grinding process of the weld seam is complex and dynamic. The contact force of the grinding tool shows different dynamic characteristics during normal and excessive grinding. Meanwhile, these characteristics are also related to the characteristics of the weld seam.
In this section, firstly, the control method of the grinding tool is explained. The position error of the weld seam occurs due to the system calibration error, robot positioning error, etc. Therefore, in the robot belt grinding, the force control method must be used, because the position control method is adopted, even a small position error will significantly affect the grinding effect. In this system, a Proportion -Integral -Derivative (PID) control method based on the force is conducted for the compensation part of the grinding. Incremental PID is an effective and widely used method in practice, in our method, there are: where L k is the command position for the grinding tool, and where F k and F d are actual force and desired force value, separately, K p , K i and K d are appropriate parameters of the controller. In this control mode, when the grinding wheel does not touch the weld seam or contact too deep due to the system position error, the tool can compensate for this error through moving the contact wheel according to the actual value ∆F k .
Considering the situation of the weld seam and the application of force control method mentioned above, when grinding, a dynamic contact process is inevitable. In general, the belt grinding process is divided into three parts: approach state, transition state, and steady state, as shown in Figure 4. Different from traditional belt grinding, weld seam grinding in this paper has two types due to the particularity of the weld seam. The first type is grinding of the uniform line weld seam, and the second type is the grinding of the uneven part, as shown in Figure 5.  For the first type of weld seam, the grinding process goes through the above three contact stages. Robot holding the grinding tool moves and grinds along the direction of the weld seam. During the process, the grinding is basically in a steady state stage due to the uniform weld shape.
For the second type of weld seam, the robot moves and grinds weld seam from top to bottom. There are two reasons for this way of grinding. One is that when grinding along the line, if there exists a uneven part, the contact state will change, that is, the grinding is easy to exit the steady stage and then affects the final effect of grinding. The other reason is that grinding this kind of weld seam needs more energy. Considering the wear and heat of the abrasive belt, when using this method, the tool can be lifted to dissipate heat after the grinding of the uneven part is completed. During the process, the rinding is basically in a transition state stage due to the uncertainty of trimming shape. Therefore, during the linear weld seam grinding of the first type of weld seam, the robot's reasonable processing speed and force strategy can almost ensure that the processing is not excessive, because it is basically in the steady-state stage. So the authors put forward a relatively simple monitoring method, that is, monitoring the displacement of the end compensation movement. If the change rate of displacement exceeds the threshold value, it is judged as excessive grinding. However, it needs to be emphasized that if the robot strategy is suitable, the excessive grinding rarely occurs. Therefore, this paper focuses on the second kind of weld seam grinding monitoring. Because the second kind of grinding is almost in an transition state, it is difficult to complete the monitoring only by the judgment of displacement, so the method proposed in this paper combines the point cloud information of the weld seam and the actual grinding force to monitor the grinding process.

Feature Analysis of Weld Seam
Two key parameters are proposed in this section, namely, the total depth of weld seam p 1 and the uniformity of the weld seam p 2 . These two parameters are respectively related to the total energy required for grinding and the dynamic characteristics during grinding.
where d i is the height of each point in the weld seam, N is the number of points, andd is the average of the heights.

Feature Analysis of Grinding Force
A typical grinding contact force curve is shown in Figure 6. It should be noted that the force here represents the value of the contact force transmitted to the sensor through the mechanical structure, not the actual contact force value. Besides, the value is the actual force minus the belt tension force. During processing, generally, the contact force increases first, then fluctuates, and finally decreases. Five key parameters are proposed in this section, namely, the grinding time f 1 , the total energy f 2 , the fluctuation times f 3 , the max force f 4 and end period time which is the time after reaching the maximum force f 5 .
where f (t) is the function between time and force, as shown in the curve of Figure 6, and other parameters are shown in the figure. It should be noted that the proper filtering method is used in the actual calculation.

Classification Method
Since the grinding result can only be observed after processing, it is not possible to obtain a specific time in the experiment where excessive grinding occurs. Therefore, some state estimation methods such as Hidden Markov Models cannot be used because the time points of state transition cannot be labeled. So, the output of the monitor method is the state of the workpiece after grinding, which is normal processing (0) and excessive grinding (1).
As shown in Figure 7, the classification method based on Particle Swarm Optimization-Support Vector Machine (PSO-SVM) is presented to identify the status of the grinding process. In the PSO-SVM framework, the input includes force features in the past period of time f 1 , f 2 , f 3 , f 4 , f 5 and the calculated weld seam characteristic values p 1 and p 2 in advance.
where a is the Lagrange multiplier, t is the label term, x is the feature space, and C is the penalty parameter. For samples in high dimensional space, Gaussian kernel function is used to represent inner product in feature space, namely: where γ is the parameter of Gaussian kernel function. In this method, the seven parameters are input into the SVM classifier, and to improve the accuracy, a particle swarm optimization (PSO) method is combined, as shown in Algorithm 1. In the algorithm, the input is the seven features and the label (normal processing (0) or excessive grinding (1)) of all the samples. This algorithm improves the accuracy of classification by continuously optimizing the parameters C and γ in the SVM model. For the case that the total number of samples is not very large, the authors use the cross-validation method to calculate the accuracy of each particle.

Algorithm 1 Classification Method based on PSO-SVM
Initialize particle swarm and parameters {c n }, {γ n }. Set generation time T = 1 Compute SVM accuracy Acc a for each particle {c a }, {γ a } using 5-fold cross validation. Set fitness of every particle f itness = Acc a . Update individual optimal value P best and group optimal value G best . while Convergence condition not satisfied do Update position and velocity vectors for each particle. Compute fitness of every particle using the above method. Update individual optimal value P best and group optimal value G best .

Specific use of Monitoring Methods in Processing
In the online application of the uniform line weld seam, a relative simple method is proposed.
where L denotes the displacement of the tool compensation. When the displacement difference ∆L exceeds a threshold for a period of time t period , it is considered to be excessive grinding.
In the online application of the uneven weld seam, a time threshold t threshold is set. When the time of single grinding exceeds t threshold , the monitoring system is turned on. At this time, the point cloud information of the weld seam has already been stored, and its feature has been extracted. The force information is updated according to a sampling frequency of f s . In a sampling period of t s , all the force information is analyzed, and then the sampling classification algorithm is used for excessive grinding judgment. In this way, when the classification algorithm detects excessive grinding, the system will give an alarm.

Experiment Platform
The experiment platform includes an industrial robot, a line laser scanner, a force-controlled grinding tool, and the workpieces, as shown in Figure 8. The workpieces were welded 16 times, and it contained 32 weld seams, as shown in Figure 9. Relatively flat line weld seams and large trimming both existed on the workpiece. The weld seam was ground by 180 mesh white corundum belt. It should be emphasized that the grinding process is guided by experienced workers to ensure that each grinding is near normal conditions to prevent excessive grinding samples far away from the normal range.

Judgment of Excessive Grinding
In this paper, the definition of excessive grinding is that the maximum depth difference between the ground part and the surrounding base metal exceeds 0.5 mm. Figure 10 shows the scanning result of 3 typical grindings. Scanning A, B, and C were excessive grinding, excessive grinding, and normal grinding, respectively.
It should be noted that, it is difficult to judge the excessive grinding in some cases, such as the measured maximum depth is near 0.5 mm. This is because the resolution of scanning results is limited, and sometimes the ground surface has a strong reflection, which interferes with the results. So in this case, the judgment of excessive grinding needs to combine the scanning measurement results and the judgment by skilled operators. When judging the excessive grinding, the operators touch the ground weld seam and draw a conclusion by experience.
This judgment method is used in the labeling of samples. The labeled results are combined with the extracted features to train the classification model, and in subsequent monitoring, this judgment is no longer necessary.

Experiment of Feature Extraction Method of Weld Seam
The measurement of the weld seam was performed by a line laser scanner. During the measurement, the laser scanner moved continuously over the workpiece with a speed of 10 mm/s. The scanning period was set to 20 ms, and the resolution of the reconstructed point cloud along the scanner moving direction is 0.2 mm. The scanning process and 3D point clouds are shown in Figure 11. The feature extraction result is shown as Figure 12. From the results, the common continuous weld seam and the uneven part can be clearly distinguished. Figure 12a shows the raw point cloud, which is the 3D reconstruction result by combing the scanning result and the robot recorded poses. Figure 12b is the registration result. In this workpiece, the CAD model is a plane and the plane is paralleled to the x-y plane. It can be seen that this result is the bottom side of the (a). Figure 12c is the probability distribution of the weld seam. The probability is expressed in terms of gray values. The larger the gray value on each voxel, the higher the probability that it belongs to the weld seam point is. Figure 12d is the extraction result, which is the optimization result. Figure 12e is the partition result of a typical weld seam. It can be seen that the weld seam is divided into 20 parts. It is noted that the weld seam should be moved to be paralleled to the y-axis before partition.

Validation of Monitor of Line Weld Seam Grinding Process
In this section, the grinding result is shown in Figure 13. As can be seen that in the blue dotted frame, the workpiece was excessive ground. This result is judged using the method in Section 3.1.1. The excessive ground part of the workpiece was at the end of the trajectory. It can be seen that the displacement curve has three distinct stages. After the approaching stage, it comes to the normal grinding stage, and the curve changes uniformly in this normal stage. However, at the end of the grinding, the curve changes significantly. This experiment verifies the proposed monitoring method based on the change rate of the displacement curve. It should be noted that the displacement in the excessive grinding is not the real grinding depth because of the elastic deformation of the contact wheel.

Experiment of Monitor of Grinding Process Based on PSO-SVM Method
In this section, 101 uneven weld seam grinding tests were performed. Force signals from all tests were recorded, and the grinding results are shown in Figure 14.  All 101 grinding force signals were recorded, and 3 of them are shown in Figure 16. Grinding A and B are normal grinding, while Grinding C is excessive grinding. It can be seen from the results that grinding force curves in different states show different fluctuations, but it is difficult to judge only by some simple standards intuitively.

Data Training and Result Analysis
The features and the labels from the above sections are the input of the PSO-SVM algorithm. The initial setting of the algorithm is that c 1 = 1.2, c 2 = 1.4, maxgen = 200, sizepop = 20. The result of PSO is shown in Figure 17. In the figure, it can be seen that after near 30 generations, The fitness has become maximum and has not change in the following 170 generations. So in the real application, the maxgen can be set to 50 to save the time cost.
In the training, 80 samples are set as the training set. The classification result of all the samples is shown in Figure 18. E and N in the vertical axis of the figure represent excessive grinding and normal grinding, respectively. From the result, it can be seen that 95 of 101 tests are classified correctly when the best training results are used for all 101 samples. 6 tests are misclassified, and 5 of them are predicted to be excessive grinding but they are actually normal grinding. This situation is relatively acceptable because it is actually an early warning. Therefore, in this experiment, the probability of not reporting excessive grinding was about 1%. In addition, the average calculation time of once feature extraction and prediction is about 120 ms when running on the processor Intel Core i7-6500U with a central frequency of 2.5 GHz. Therefore, t s in Section 2.3.5 can be set to 150 ms.

Result Comparison
In this study, sample acquisition is difficult and laborious. Each sample acquisition requires robotic scanning of the weld seam, welding seam analysis, robot grinding, and evaluation of the grinding results. Therefore, in the selection of comparison methods, methods such as deep learning of large samples cannot be selected. At the same time, in the current research for grinding monitoring, most of them are grinding for flat planes or curved surfaces, and many types of research are done by modeling and identifying parameters. Due to the different grinding objects in our system, this paper cannot adopt the model-based method. The input parameters include the point cloud data and dynamic force data, which are different from the existed grinding monitor method. Therefore, this system is not applicable to traditional monitoring methods and cannot be compared.
Therefore, the experimental comparison includes two parts. The first comparison is the classification results with and without point cloud data. In the second comparison, many traditional small sample classification methods are adopted.
In the first comparison, A total of 1000 experiments were conducted. In each experiment, from 101 samples, 20 samples were randomly selected as the test set, and other samples were used as the training set. Two methods are used respectively: full input feature method (seven input features) and no point cloud feature value method (five input features) for training and verification. The result is shown in Figure 19. In the figure on the left, the value around each vertical line is the number of experiments at this accuracy. It can be seen that the method of using seven inputs has significantly higher accuracy, and its accuracy is concentrated near 90%. The results of the five-input method are concentrated around 85%. The average accuracies of the two methods are 91.515% and 84.315%. Therefore, it can be concluded that the point cloud feature plays a role in the monitoring method, and can improve the accuracy of the excessive grinding prediction. In the second comparison, some traditional classification algorithm results are shown in Table 1. In the table, for each method, 1000 experiments are conducted, which is the same as those in the first comparison. The average accuracy of the 1000 results is shown in the table. It can be seen that the adopted method is better than other methods. The reason is that through the optimization of the PSO method, the effect of the SVM classifier is better, and a better classification accuracy can be achieved. Since the training is conducted offline, after the training is completed, in each online monitoring, the time taken to classify the sample is within 1ms, which is negligible compared to the feature calculation time in Section 3.4.2. Therefore, in terms of calculation time, this method has the same effect as other methods and has no effect on practical applications.

Conclusions
In this paper, the authors present a system design and monitoring method of robot grinding for friction stir weld seams. The feature extraction method of weld seam based on the point cloud is proposed, and the extracted features are used as the prior knowledge of the monitoring algorithm. The monitoring methods for two different types of weld seam are proposed. Through experiments, the authors verify the feasibility of the two methods. The experiments show that the proposed monitor method for the grinding of the uneven weld seam has a good effect compared with other methods, with a recognition rate of 91.5%. In future work, the authors will further study the robot grinding strategy based on the weld seam characteristics to optimize the grinding effect without excessive grinding.