# Orbital-Based Automatic Multi-Layer Multi-Pass Welding Equipment for Small Assembly Plates
## 3 Equipment Debugging and Simulation Analysis
### Simulation Analysis of the Robotic Arm
#### 3.2.3 Workspace Analysis of the Robotic Arm  
In this section, the Monte Carlo method is used to calculate the robotic arm's global workspace and the constrained workspace analysis that fits the actual working conditions and processing requirements, respectively. The specific workflow is shown in Figure 29.  
Figure 28: Comparative analysis chart for trajectory planning. First, the spatial position vector of the end effector is obtained from the forward kinematics equations, and the position vector (38) is derived from the end pose matrix in Equation (30). \[p= \begin{bmatrix}p_{x}\\ p_{y}\\ p_{z}\end{bmatrix} = \begin{bmatrix}D_{3}(S_{5}(S_{1}S_{4}+C_{4}(C_{1}C_{23}))+C_{5} (C_{1}S_{23})+D_{2}(C_{1}S_{23})-A_{2}C_{1}C_{2}\\ D_{2}S_{1}S_{3}(C_{2}+C_{4}(C_{23}))-C_{5}S_{1}(S_{23}))-A_{2}C_{2}S_{1}\\ D_{1}-D_{3}(C_{5}C_{23})-C_{4}S_{5}(S_{23})-D_{2}C_{23}-A_{2}S_{2}\end{bmatrix}  \tag{38}\]  
The number of sample points is set to N = 5000. In the MATLAB environment, the Rand function is used to define uniform random numbers in (0, 1), generating random step sizes L:  
\[L=\left(q_{i}^{max}-q_{i}^{min}\right)\times Rand(N,1) \tag{39}\]  
The random variable is (40):  
\[q_{i}=q_{i}^{min}+\left(q_{i}^{max}-q_{i}^{min}\right)\times Rand(N,1) \tag{40}\]  
In Equation (40), \(q_{i}^{max}\) and \(q_{i}^{min}\) represent the maximum and minimum rotation limits of joint \(i\) of the robotic arm, respectively, where \(i=1\sim 6\). The iterative execution steps are repeated according to the number of samples until the maximum number of random samples is reached. MATLAB outputs the point cloud diagram of the robotic arm's workspace based on the collected points. Figure 30a is the DH model of the initial working posture of the robotic arm; in Figure 30b, the coordinate system is the reference coordinate system, and the center point of the robotic arm base is the origin coordinate system. Figure 30c,d are the robotic arm welding posture diagrams. Figure 29: Workspace solution analysis diagram. The global experimental parameters for the robotic arm workspace analysis and the experimental parameters for the constrained welding postures within the working conditions are shown in Tables 8 and 9, respectively. The dimensions of the workspace point clouds for both are listed in Table 10. The output two-dimensional and three-dimensional point cloud views are shown in Figure 31. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Serial Number** & **Experimental Information** & **Unit/(mm)** \\ \hline
1 & Working arm span (Robotic arm) & 590 mm \\
2 & Erection height (Track) & 540 mm \\
3 & Erection length (Track) & 2030 mm \\
4 & Welding posture (panel) & (\(0^{\circ}\), \(22.14^{\circ}\), \(114^{\circ}\), \(-180^{\circ}\), \(-71.1^{\circ}\), \(58.26^{\circ}\)) \\
5 & Welding position (panel) & (\(-185.77\), \(-54.39\), \(535.38\), \(86.18\), \(77.88\), \(-85.64\), U(316.43)) \\
6 & Welding posture (vertical plate) & (\(-156^{\circ}\), \(-78.1^{\circ}\), \(42.8^{\circ}\), \(-257.7^{\circ}\), \(-98.4^{\circ}\), \(-148.4^{\circ}\)) \\
7 & Welding position (vertical plate) & (\(-440.76\), \(299.82\), \(582.54\), \(20.14\), \(128.22\), \(106.42\), U(\(-96.96\))) \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Global experimental parameters of robotic arm. Figure 30: Working condition and robotic arm posture information diagram.