## 2 Model Description of Welding Robot Path Planning with Obstacle Avoidance  
Because spot welding robots are widely used for car body in white, it was selected as the welding object in this paper. All weld joints are given as spots, which are shown in Figure 1. To illustrate the problem more clearly, parts of the weld joints are chosen to conduct path planning, which are shown in Figure 2. The coordinates of 15 weld joints were obtained in \"RobotStudio\" software and are shown in Table 1.  
In order to achieve welding robot path planning with a collision-free path, a welding torch should move through all the weld joints first. At the same time, the shortest path length possible and the avoidance of all obstacles in the environment are desired. Suppose the number of the weld joints is \(n\), the welding sequence is \([\pi(1),\ \pi(2),\ldots,\ \pi(n)]\). Then, the problem can be treated as a TSP (Traveling Salesman Problem) with constraint conditions. TSP is described as follows. Suppose a salesman has to  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**NO.** & \(X\) **(mm)** & \(Y\) **(mm)** & \(Z\) **(mm)** & **NO.** & \(X\) **(mm)** & \(Y\) **(mm)** & \(Z\) **(mm)** \\ \hline
1 & 1443.60 & \(-53.20\) & 686.00 & 9 & 1474.16 & \(-111.25\) & 791.00 \\
2 & 1399.56 & \(-60.05\) & 688.49 & 10 & 1442.88 & \(-117.47\) & 779.19 \\
3 & 1356.00 & \(-66.67\) & 689.57 & 11 & 1414.82 & \(-122.26\) & 771.35 \\
4 & 1456.36 & \(-48.49\) & 669.34 & 12 & 1356.71 & \(-132.48\) & 759.65 \\
5 & 1417.70 & \(-54.51\) & 671.94 & 13 & 1554.17 & \(-94.37\) & 909.95 \\
6 & 1379.31 & \(-60.57\) & 674.61 & 14 & 1539.25 & \(-99.03\) & 879.83 \\
7 & 1504.91 & \(-126.99\) & 813.51 & 15 & 1549.76 & \(-8.79\) & 903.34 \\
8 & 1493.74 & \(-109.17\) & 801.14 & - & - & - & - \\ \hline \hline \end{tabular}
\end{table}
Table 1: Weld joints coordinates.  
Figure 1: Body in white weld piece.  
visit \(N\) cities with the conditions that he must visit each city only once and finally return to the original departure city. The path planning problem can be described as  
\[\left\{\begin{array}{c}\min f=\sum_{i=1}^{N-1}L_{\pi(i),\pi(i+1)}\\ \text{s.t. path }\pi(i)\pi(i+1)\text{ is a safe path }(i=1,2,\ldots,n-1)\end{array}\right. \tag{1}\]  
where path \(\pi(i)\pi(i+1)\) is the path between Weld Joints \(\pi(i)\) and \(\pi(i+1)\), which represents the local path. The welding sequence \([\pi(1),\ \pi(2),\ldots,\ \pi(n)]\) represents the global path.  
For the path between two weld joints, the welding torch moves through intermediate points to avoid the obstacle and suppose that the path between weld joints and the intermediate points are straight lines. If the starting point is \(\pi(i)\), the terminal point is \(\pi(i+1)\), and the intermediate points are \([X_{1},X_{2},\ldots,X_{K}]\). Path \(\pi(i)\pi(i+1)\) is made up of path \(\pi(i)X_{1},\text{path }X_{k}X_{k+1}(k=1,2,\ldots,K-1)\), path \(X_{k}\pi(i+1)\), and the planning of path \(\pi(i)\pi(i+1)\) can be described as follows:  
\[\left\{\begin{array}{c}\min L_{\pi(i),\pi(i+1)}=\text{dist}(\pi(i),X_{1})+ \sum_{k=1}^{K-1}\text{dist }(X_{k},X_{k+1})+\text{dist }(X_{K},\pi(i+1))\\ \text{s.t. path }\pi(i)X_{1}\text{ is a safe path}\\ \text{path }X_{k}X_{k+1}\text{ is a safe path}(k=1,2,\ldots,K-1)\\ \text{path }X_{K}\pi(i+1)\text{is a safe path}\end{array}\right. \tag{2}\]  
where \(\text{dist}(X,Y)\) indicates the Euclidean distance between point \(X\) and \(Y\). \(XY\) is a safe path, which represents that the robot's moves from point \(X\) to point \(Y\) without collision.