# Automated Docking System for LNG Loading Arm Based on Machine Vision and Multi-Sensor Fusion
## 2 Design of Docking Logic and Kinematic Analysis for LNG Loading Arm
### Kinematic Modeling and Docking Posture Control of LNG Loading Arms
#### 2.2.1 Kinematic Modeling of LNG Loading Arm  
To accurately describe the motion relationship between joints of the LNG loading arm, this study adopts the standard D-H parameter method for kinematic modeling. The D-H method defines the link parameters (\(a\), \(a\), \(d\), and \(\theta\)) to establish coordinate systems for the links, enabling the mathematical representation of transformations between joints [23]. This provides theoretical support for analyzing motion trajectories and posture adjustment. Figure 5 illustrates the link coordinate systems of the LNG loading arm, where each joint motion is described using the corresponding D-H parameters. Table 1 lists the D-H parameters of the LNG loading arm:  
* \(\theta\): Joint rotation angle;
* \(d\): Displacement along the Z-axis;
* \(a\): Length of the link between adjacent joints;
* \(\alpha\): Twist angle between joint axes. Figure 4: LNG loading arm structure diagram. By applying the D-H parameter method, the spatial transformation relationship between the joints can be expressed using homogeneous transformation matrices, providing a mathematical model for the precise control of the end-effector posture. The specific parameters are shown in Table 1.  
Given the geometric parameters and motion relationships between adjacent links of the manipulator, the homogeneous transformation method is used to solve the transformation from coordinate frame {0} to frame {i}. This parameterized representation simplifies the description and analysis of the manipulator's kinematics [24]. The transformation matrix between adjacent joints is expressed as follows:  
\[\underset{i}{\overset{i-1}{\underset{i}{\right}}}T=Rot_{z_{i-1}}(\theta_{i}) Trans_{x_{i}}(d_{i})Trans_{x_{i}}(a_{i})Rot_{x_{i}}(\alpha_{i}) \tag{1}\]  
The detailed expression is as follows:  
\[ \begin{bmatrix}\cos\theta_{i}&-\sin\theta_{i}\cos\alpha_{i}&\sin\theta_{i} \sin\alpha_{i}&a_{i}\cos\theta_{i}\\ \sin\theta_{i}&\cos\theta_{i}\cos\alpha_{i}&-\cos\theta_{i}\sin\alpha_{i}&a_{ i}\sin\theta_{i}\\ 0&\sin\alpha_{i}&\cos\alpha_{i}&d_{i}\\ 0&0&0&1\end{bmatrix}  \tag{2}\]  
By substituting the D-H parameters from Table 1 into the equation, the homogeneous transformation matrices between each link can be derived as follows:  
\[\underset{i}{\overset{0}{\underset{1}{\right}}}T= \begin{bmatrix}\cos\theta_{1 }&0&\sin\theta_{1}&0\\ \sin\theta_{1}&0&-\cos\theta_{1}&0\\ 0&1&0&855\\ 0&0&0&1\end{bmatrix}  \tag{3}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Joint** & \(\theta\) & **D** & \(a\) & \(\alpha\) \\ \hline
1 & \(\theta_{1}\) & 855 & 0 & 90 \\
2 & \(\theta_{2}\) & 50 & 900 & 0 \\
3 & \(\theta_{3}\) & 0 & 900 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: D-H parameters of the LNG loading arm. Figure 5: Coordinate frames of the LNG loading-arm links. \[\frac{1}{2}T= \begin{bmatrix}\cos\theta_{2}&-\sin\theta_{2}&\sin\theta_{2}&900\cos \theta_{2}\\ \sin\theta_{2}&\cos\theta_{2}&-\cos\theta_{2}&900\sin\theta_{2}\\ 0&0&1&50\\ 0&0&0&1\end{bmatrix}  \tag{4}\]  
\[\frac{2}{3}T= \begin{bmatrix}\cos\theta_{3}&-\sin\theta_{3}&\sin\theta_{3}&900 \cos\theta_{3}\\ \sin\theta_{3}&\cos\theta_{3}&-\cos\theta_{3}&900\sin\theta_{3}\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix}  \tag{5}\]  
Thus, the kinematic equation can be established to obtain the transformation matrix of frame [3] relative to frame [0]:  
\[ \begin{array}{cccc}0&T=&0T12T3T=&\begin{bmatrix}r_{11}&r_{12}&r_{13}&P_{x}\\ r_{21}&r_{22}&r_{23}&P_{y}\\ r_{31}&r_{32}&r_{33}&P_{z}\\ 0&0&0&1\end{bmatrix}\end{array}  \tag{6}\]  
This sequential matrix multiplication describes the relative motion between joints of the manipulator, ultimately determining the position and orientation of the end-effector. Here, \(\left(P_{x},P_{y},\text{ and }P_{z}\right)\) represents the three-dimensional coordinates of the manipulator's end-effector. To accurately align the end-effector with the target position, inverse kinematics is used to calculate the joint angles. The goal of inverse kinematics is to determine the joint angles based on the given position of the end-effector.