# Path Planning Optimization of the Load Transport Process Using Heuristic Algorithms
## 4 Inverse Kinematics Problem  
In order to implement the movement of the load along the optimal trajectory in the crane, the problem of inverse kinematics must be solved, allowing for the determination of the functions controlling the individual parts of the device. The kinematic structure of the crane is shown in (Figure 12). The coordinates of the relevant articulations (\(O_{1},O_{2},O_{3}\)) and the load suspension point (\(\Omega\)) can be written as:  
\[\begin{array}{l}x_{0_{1}}=0,\\ y_{0_{1}}=0,\\ z_{0_{1}}=L_{0},\end{array} \tag{6}\]  
\[\begin{array}{l}x_{0_{2}}=L_{1}\cos\alpha_{2}\cos\alpha_{1},\\ y_{0_{2}}=L_{1}\cos\alpha_{2}\sin\alpha_{1},\\ z_{0_{2}}=L_{0}+L_{1}\sin\alpha_{2},\end{array} \tag{7}\]  
\[\begin{array}{l}x_{0_{3}}=(L_{1}+L_{2})\cos\alpha_{2}\cos\alpha_{1},\\ y_{0_{3}}=(L_{1}+L_{2})\cos\alpha_{2}\sin\alpha_{1},\\ z_{0_{3}}=L_{0}+(L_{1}+L_{2})\sin\alpha_{2},\end{array} \tag{8}\]  
\[\begin{array}{l}x_{\Omega}=(L_{1}+L_{2})\cos\alpha_{2}\cos\alpha_{1},\\ y_{\Omega}=(L_{1}+L_{2})\cos\alpha_{2}\sin\alpha_{1},\\ z_{\Omega}=L_{0}+(L_{1}+L_{2})\sin\alpha_{2}-L_{3},\end{array} \tag{9}\]  
where \(L_{0}=const\) and \(L_{1}=const\).  
Figure 11: Projection of the shortest trajectories onto the YZ plane for various auxiliary points.  
Figure 10: Projection of the shortest trajectories onto the XZ plane for various auxiliary points.  
The presented system is a redundant system, which means that no unique solution to the inverse kinematics problem can be obtained without imposing additional constraints. This feature increases the complexity of kinematic calculations and limits the practical applicability unless the problem is constrained by additional methods. To solve this problem, an algorithm of temporary restriction of movement of specific kinematic pairs [39] can be used. This method consists in locking one of the available degrees of freedom of the crane [40]. Due to the construction of the rotary crane, the best solution was to lock the last degree of freedom, i.e., the length of the rope (\(L_{3}=const\)) remains constant during the entire duty cycle. Therefore, the crane is controlled by changing three parameters: platform rotation angle (\(\alpha_{1}\)), extension angle (\(\alpha_{2}\)) and cylinder extension length (\(L_{2}\)). Although the simplification of keeping the rope length constant is commonly used in such models, it can potentially limit the ability to simulate more dynamic and realistic crane operations. In addition, the phenomenon of rope swinging was omitted--the rope (\(O_{3}\Omega\)) in the model is always parallel to the crane frame (\(O_{0}O_{1}\)). \(L_{0}\), \(L_{1}\), \(L_{3}\) were assumed as constants.  
Parameters \(s\) and \(r\) are described by relations:  
\[r=\sqrt{x_{\Omega}^{2}+y_{\Omega}^{2}}, \tag{10}\]  
\[s=z_{\Omega}-L_{0}+L_{3}. \tag{11}\]  
With such assumptions, it becomes possible to determine the values of the angles and the lengths of the members regardless of the coordinates of the \(\Omega\) point. The only condition that the coordinates must meet is related to the construction of a crane (angle \(\alpha_{1}\) must be in the range \(0\div 270^{\circ}\), angle \(\alpha_{2}\) must be in the range \(0\div 60^{\circ}\), and the length \(L_{2}\) in the range \(0\div 450\) mm). The value of the angles \(\alpha_{1}\) and \(\alpha_{2}\) can be determined using the 2-argument arctangent function (\(atan2\)):  
\[\begin{array}{l}\alpha_{1}=atan2(y_{\Omega},z_{\Omega}),\\ \alpha_{2}=atan2(r,s),\end{array} \tag{12}\]  
and calculate the length of \(L_{2}\) from the following dependence:  
\[L_{2}=\sqrt{r^{2}+s^{2}}-L_{1}. \tag{13}\]  
The exemplary results of the numerical calculations show the change in the cylinder length \(L_{2}\) (Figure 13), the angle of rotation of the platform (Figure 14) and the angle of  
Figure 12: Kinematic diagram of the crane with marked values \(r\) and \(s\).