# Orbital-Based Automatic Multi-Layer Multi-Pass Welding Equipment for Small Assembly Plates
## 3 Equipment Debugging and Simulation Analysis
### Debugging of the Robotic Arm
This is the \"eye-in-hand\" relationship; regardless of how many movements occur, the positional relationship between the robotic arm base and the calibration board remains unchanged, and the positional relationship between the laser sensor and the TCP remains unchanged--that is, BHCl and CHT are constants. CHCl represents the transformation from the laser sensor coordinate system {C} to the calibration object coordinate system {Cl}, obtained through laser sensor calibration. BHT represents the transformation from the base coordinate system {B} to the TCP coordinate system {T}, derived from the robotic arm calibration system. When the robotic arm moves from position 1 to position 2, the following transformation relationships hold:  
\[\{B\}=BHT_{1}\cdot\{T\}_{1} \tag{3}\]  
\[\{T\}_{1}=CHT^{-1}\cdot\{C\}_{1} \tag{4}\]  
\[\{C\}_{1}=CHCl_{1}\cdot\{Cl\} \tag{5}\]  
Based on Equations (3)-(5), we obtain (6):  
\[\{B\}=BHT_{1}\cdot CHT^{-1}\cdot CHCl_{1}\cdot\{Cl\} \tag{6}\]  
Similarly, after the robotic arm moves to position 2, we obtain (7):  
\[\{B\}=BHT_{2}\cdot CHT^{-1}\cdot CHCl_{2}\cdot\{Cl\} \tag{7}\]  
Combining and rearranging Equations (6) and (7), we derive (8):  
\[BHT_{2}^{-1}\cdot BHT_{1}\cdot CHT^{-1}=CHT^{-1}\cdot CHCl_{2}\cdot CHCl_{1} ^{-1} \tag{8}\]  
If we let \(X=CHT^{-1}\), \(A=BHT_{2}^{-1}\cdot BHT_{1}\), \(B=CHCl_{2}\cdot CHCl_{1}^{-1}\), we deduce (9):  
\[A\cdot X=X\cdot B \tag{9}\]  
To solve the problem in the form of Equation (9), we first need to complete the transformation from the base coordinate system to the TCP coordinate system. The rotation matrix is calculated based on the angles of the robotic arm. This paper adopts a specific ZYX Euler angle rotation matrix form to solve BHT. The rotation matrices of the three angles are as shown in Equation (10), where a, b, and c correspond to the (yaw), (pitch), and (roll) angles in the _ZYX_ Euler angles. \[\left\{ \begin{aligned} \mathbf{R}_{x}(a)&=\begin{bmatrix}1&0&0\\ 0&\cos a&-\sin a\\ 0&\sin a&\cos a\end{bmatrix}\\ \mathbf{R}_{y}(b)&=\begin{bmatrix}\cos b&0&\sin b^{\dagger}\\ 0&1&0\\ -\sin b&0&\cos b\end{bmatrix}\\ \mathbf{R}_{z}(c)&=\begin{bmatrix}\cos c&-\sin c&0\\ \sin c&\cos c&0\\ 0&0&1\end{bmatrix}\end{aligned} \right. \tag{10}\]  
Following the sequence of _ZYX_ Euler angles to complete the rotations, multiplying the three matrices yields (11), which expands into (12):  
\[R=R_{x}(a)R_{y}(b)R_{z}(c) \tag{11}\]  
\[R= \begin{bmatrix}\cos b\cos c&-\cos a\sin c+\sin a\sin b\cos c&\sin a\sin c+ \cos a\sin b\cos c\\ \cos b\sin c&\cos a\cos c+\sin a\sin b\sin c&-\sin a\cos b+\cos a\sin b\sin c \\ -\sin b&\sin a\cos b&\cos a\cos b\end{bmatrix}  \tag{12}\]  
A schematic diagram of the _ZYX_ Euler angle rotation is shown in Figure 18.  
The homogeneous matrix \(BHT_{(T)}\) is calculated based on \(R\):  
\[\mathbf{T}=\left( \begin{bmatrix}&&\mathbf{t_{0x}}\\ &\mathbf{R}&&\mathbf{t_{0y}}\\ &&\mathbf{t_{0z}}\\ \mathbf{0}&\mathbf{0}&\mathbf{0}&\mathbf{1}\end{bmatrix} \right)^{-1} \begin{bmatrix}\mathbf{t_{0x}} \\ \mathbf{t_{ty}}\\ \mathbf{t_{tz}}\\ \mathbf{1}\end{bmatrix} = \begin{bmatrix}\mathbf{T_{x}}\\ \mathbf{T_{y}}\\ \mathbf{T_{z}}\\ \mathbf{1}\end{bmatrix}  \tag{13}\]  
In Equation (13), \((t_{0x}\,,\,t_{0y},t_{0z})\) are the origin of the base coordinate system, \((t_{tx}\,,\,t_{ty},t_{tz})\) are the origin of the TCP, and \((\mathbf{T_{x}}\,,\,T_{y},\,T_{z})\) record the values of \(\mathbf{T}\), denoted as \(\mathbf{BHT}-\mathbf{T}\), which will be used for the calculation of the orthogonal vectors of \(\{\mathbf{C}\}\). In the actual calibration, the eight-point calibration method shown in Figure 19 is adopted for the TCP. These eight points are non-colinear and uniformly distributed within the working space of the robotic arm. The calibration postures need to be manually set, leaving a margin under rotational limit conditions to prevent the robotic arm from locking up or generating singularities.