# 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.2 Trajectory Planning of the Robotic Arm  
Many scholars at home and abroad have proposed path planning methods [24] and trajectory optimization methods [25] for welding robotic arms, but comparative analyses are rare. This experiment conducts comparative analyses of unoptimized trajectories, uniform speed processing, cubic interpolation, and quintic interpolation trajectory planning algorithms, applying constraints on the joint axis velocities and accelerations of the robotic arm during the planning process. The specific flowchart is shown in Figure 27.  
The simulation time is 2 s, with initial and terminal angular velocities of 0. The starting point is (\(-200\), \(200\), \(-50\)), the guiding point is (\(-150\), \(100\), \(-100\)), and the terminal point is (\(-200\), \(-50\), \(75\)). The number of sampling points is 50. The initial joint radian values are (\(2.3171\), \(2.3171\), \(2.4888\), \(-1.6219\), \(-2.2184\), \(0\)), and the terminal joint radian values are (\(-0.2202\), \(-0.2202\), \(2.0665\), \(-0.1613\), \(2.7961\), \(0\)). The expressions for cubic and quintic polynomial interpolation functions are shown in Equations (34) and (36):  
\[q_{(t)}=a_{0}+a_{1}(t-t_{0})+a_{2}(t-t_{0})^{2}+a_{3}(t-t_{0})^{3} \tag{34}\]  
Equation (35) is the calculation formula for the four constant parameters in the cubic interpolation polynomial:  
\[\begin{cases}a_{0}=q_{0},a_{2}=\frac{1}{l^{2}}\big{[}3h-(v_{1}+2v_{0})T\big{]} \\ a_{1}=v_{0},a_{3}=\frac{1}{l^{3}}\big{[}-2h+(v_{1}+v_{0})T\big{]}\end{cases} \tag{35}\]  
\[\theta_{t}=\theta_{0}+a_{1}(t-t_{0})+a_{2}(t-t_{0})^{2}+a_{3}(t-t_{0})^{3}+a_{ 4}(t-t_{0})^{4}+a_{5}(t-t_{0})^{5} \tag{36}\]  
Figure 27: Trajectory planning flow chart.  
Equation (37) is the calculation formula for the six constant parameters in the quintic interpolation polynomial:  
\[\left\{\begin{matrix}a_{0}=\theta_{0},a_{3}=\frac{1}{2T^{3}}[20h-(8v_{1}+12v_{0}) T-(3a_{0}-a_{1})T^{2}]\\ a_{1}=v_{0},a_{4}=\frac{1}{2T^{4}}[-30h+(14v_{1}+16v_{0})T-(3a_{0}-2a_{1})T^{2}] \\ a_{2}=\frac{1}{2}a_{0},a_{5}=\frac{1}{2T^{5}}[12h-6(v_{1}+v_{0})T+(a_{1}-a_{0}) T^{2}]\end{matrix}\right. \tag{37}\]  
In Equations (35) and (37), \(v_{0}\) represents the initial joint velocity, \(v_{1}\) is the final joint velocity, \(a_{0}\) is the initial joint acceleration, \(a_{1}\) is the final joint acceleration, \(T=t_{1}-t_{0}\), \(h=q_{1}-\theta_{0}\), \(\theta_{0}\) is the initial joint angle, and \(q_{1}\) is the final joint angle. After running the analysis and comparison, the trajectory planning effects are contrasted as shown in Figure 28.  
Completing this comparative analysis study can provide practical assistance for the formulation of subsequent processing strategies. As seen from Figure 28, cubic interpolation achieves smooth operation of the joint axes, while quintic interpolation yields even better results. In the future, multi-robot-arm cooperative trajectory planning and obstacle avoidance can be developed to further enhance the automation and intelligence levels of welding robotic arms [26].