## 2 Configuration and Kinematics Modeling
### Forward and Inverse Kinematics Based on Geometrical Relationships
#### 2.2.1 Kinematics between Cable Lengths and Joint Angles  
To establish the kinematics model between cable lengths and joint angles, a geometric model is presented as shown in Figure 4, noting that adjacent universal joints are orthogonal rather than in the same direction, although the same model is adopted, which does not impact the outcome. To be simplified, a coordinate system is created. Frame \(\{P_{i}\}\) and \(\{R_{i}\}\) are attached to the proximal endplate and rear endplate of \(i\)th tubular structure with their origins located at the centers of those plates, respectively.  
When joint angles \(\Phi_{i}=\left[\varphi_{i},\theta_{i}\right](i=1,2,\cdots,N)\) are given, the three driving cables of \(i\)th joint will present unique and definite lengths \(L_{i,j}(j=1,2,3)\), where \(N\) represents the number of all joints. Similarly, some essential symbols, their properties, and corresponding values of CHCM are presented in Table 1.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Symbol** & **Property** & **Value** \\ \hline N & Number of all joints & 5 \\ M & Number of through holes at endplates & 18 \\ R & Radius of tubular structure & 33.8 mm \\ D & Distance from tubular structure to the center of universal joint & 12 mm \\ H & Length of tubular structure & 106 mm \\ \hline \hline \end{tabular}
\end{table}
Table 1: The properties and values of some symbols.  
Figure 4: A geometric model of universal joint.  
According to the principle of the coordinate system transformation, the pose transformation matrix of joint frame \(\{P_{i}\}\) with respect to adjoining one \(\{R_{i-1}\}\) connected by one universal joint could be expressed as:  
\[T_{i-1}^{i}=Trans(0,D,0)Rot(Z,\theta_{i})Rot(X,\varphi_{i})Trans(0,D,0) \tag{1}\]  
where \(Trans(0,D,0)\) represents the translation function, which can be written as:  
\[Trans(0,D,0){=}\begin{bmatrix}1&0&0&0\\ 0&1&0&D\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix} \tag{2}\]  
and \(Rot(Z,\theta_{i})\), \(Rot(X,\varphi_{i})\) represent the rotation function about \(X\)-axis by angle \(\varphi_{i}\) and rotation about \(Z\)-axis by angle \(\theta_{i}\), respectively, which can be written as:  
\[Rot(Z,\theta_{i})=\begin{bmatrix}\cos\theta_{i}&-\sin\theta_{i}&0&0\\ \sin\theta_{i}&\cos\theta_{i}&0&0\\ 0&0&1&0\\ 0&0&0&1\end{bmatrix},Rot(X,\varphi_{i})=\begin{bmatrix}1&0&0&0\\ 0&\cos\varphi_{i}&-\sin\varphi_{i}&0\\ 0&\sin\varphi_{i}&\cos\varphi_{i}&0\\ 0&0&0&1\end{bmatrix} \tag{3}\]  
As shown in Figure 3, \(\alpha_{i,j}\) is a counterclockwise angle, which represents the deflection angle of the attachment point of \(j\)th cable on the \(i\)th tubular structure and \(X\)-axis of \(\{P_{i}\}\), which can be derived as (4). Such that the attachment position \(p_{i,j}\) and the cable length between \(p_{i,j}\) and \(p_{i-1,j}\) can be derived as (5) and (6).  
\[\alpha_{i,j}=i\cdot\frac{360^{\circ}}{M}+(j-1)\cdot 120^{\circ} \tag{4}\]  
\[p_{i,j}=[R\cdot\cos\alpha,0,R\cdot\sin\alpha]^{T} \tag{5}\]  
\[l_{i,j}=\left\|T_{i-1}^{i}\cdot p_{i,j}-p_{i,j}\right\| \tag{6}\]  
Ignoring the deformation of cables and considering that the cables in every tubular structure get lengths of \(H\), the total lengths of cables can be derived as:  
\[L_{k,j}{=}\sum_{i}^{k}\left(l_{i,j}+H\right) \tag{7}\]  
When cable lengths \(L_{i,j}(j=1,2,3)\) are given, each joint angle will be unique and definite, which can be solved from Equation (8).  
\[l_{i,j}=\left\|T_{i-1}^{i}\cdot p_{i,j}-p_{i-1,j}\right\|=f(\theta_{i},\varphi _{i},\alpha_{i,j}) \tag{8}\]