# Kinematic Modelling and Motion Analysis of a Humanoid Torso Mechanism
## 2 Materials and Methods
### Kinematic Modelling of a Compliant Tendon-Driven Torso Mechanism
\right], \tag{1}\]  
while the rotation from \(\{S_{0}\}\) to \(\{S\}\) can be written as a rotation matrix \(\mathbf{R}\in SO(3)\) that is:  
\[\mathbf{R}(\theta,\varphi,\Delta\varphi)=\mathbf{R}_{z}(\varphi)\cdot\mathbf{R}_{y}( \theta)\Delta\mathbf{R}_{z}(\Delta\varphi-\varphi), \tag{2}\]  
where \(\mathbf{R}_{z}(\varphi)\) represents a rotation of \(\varphi\) around the \(z\)-axis, \(\mathbf{R}_{y}(\theta)\) represents a rotation of \(\theta\) around the \(y\)-axis, and \(\mathbf{R}_{z}(\Delta\varphi-\varphi)\) represents a rotation of \(\Delta\varphi-\varphi\) around the \(z\)-axis. These equations expand the conventional PCCK that is described in [25] to include both the elongation/compression and the axial torsion that are characteristic of the mechanism under examination. The forward kinematics of the torso mechanism can be thus defined with the homogeneous transformation \(\mathbf{T}\in SE(3)\) from \(\{S_{0}\}\) to \(\{S\}\) as:  
\[\mathbf{T}(\theta,\varphi,\Delta\ell,\Delta\varphi)=\left[ \begin{array}{cc}\bm {R}(\theta,\varphi,\Delta\varphi)&\mathbf{t}(\theta,\varphi,\Delta\ell)\\ \mathbf{0}&\mathbf{1}\end{array} \right]. \tag{3}\]  
Equation (3) represents only the first part of the kinematics of the structure, as it relates the pose of the upper torso (with respect to the lower torso) only to its configuration, not to the length of the actuating tendons. To compute tendon length \(\mathbf{l}=(l_{1};\ l_{2};\ l_{3};\ l_{4})^{T}\), the four tendons can be modelled as circle arcs that bend in parallel to the backbone, with the same bending angle and direction. Thus, their lengths can be evaluated as:  
\[l_{i}=\ell+\Delta\ell+\theta r\cos\left(\varphi+\Delta\varphi+\frac{(i-1)\pi} {2}\right);i=\{1,\ 2,\ 3,\ 4\}. \tag{4}\]  
By using Equations (3) and (4), the relationship between actuation vector \(\mathbf{l}\) and upper platform pose \(\mathbf{T}\) can be obtained, defining the kinematic input-output function of the robotic system. However, as previously mentioned, the stiffness of the backbone must be considered for full characterization. In order to do so, a linear elastic behaviour of the backbone is assumed, with a torsional stiffness \(k_{t}\), a compression module of \(k_{c}\), and a bending stiffness \(k_{b}\) that can be evaluated from the material properties and are related to motion parameters as:  
\[M_{z}=k_{t}\Delta\varphi;\ F_{z}=k_{c}\Delta\ell;\ M_{\theta}=k_{b}\theta, \tag{5}\]  
where \(M_{z}\) is the moment around the \(z\)-axis of the backbone, representing axial torsion; \(F_{z}\) is the force along the \(z\)-axis of the backbone, representing compression; and \(M_{\theta}\ =\ M_{y}\sin\varphi-M_{x}\cos\varphi\) is the bending moment acting on the backbone, which can be written as a combination of the moments around the \(x\)- and \(y\)-axes of the backbone, \(M_{x}\) and \(M_{y}\). Given the tensions in the tendons \(F_{1}\), \(F_{2}\), \(F_{3}\), and \(F_{4}\), these values can be computed as:  
\[ \begin{split} M_{x}&=(F_{2}-F_{4})r;\\ M_{y}&=(F_{3}-F_{1})r;\\ M_{\theta}&=M_{y}\sin\varphi-M_{x}\cos\varphi;\\ F_{z}&=\sum\limits_{i=1}^{4}F_{i}.\end{split}  \tag{6}\]  
Thus, as expressed in Equation (6) and with reference to Figure 4, the four actuation cables can actively control the two DoFs related to bending, whereas the compression/elongation and torsion of the backbone are coupled and cannot be actuated independently. If a general external wrench \(\left(P_{x};\ P_{y};\ P_{z};\ W_{x};\ W_{y};\ W_{z}\right)^{T}\) is applied to the upper torso, the elongation and torsion of the backbone can be estimated from:  
\[ \begin{split} M_{x}&=(F_{2}-F_{4})r+\frac{\ell+ \Delta\ell}{\theta}\big{(}P_{z}\sin\varphi(1-\cos\theta)-P_{y}\sin\theta \big{)}+W_{x};\\ M_{y}&=(F_{3}-F_{1})r+\frac{\ell+\Delta\ell}{\theta }(P_{x}\sin\theta-P_{z}\cos\varphi(1-\cos\theta))+W_{y};\\ F_{z}&=P_{z}+\sum\limits_{i=1}^{4}F_{i};\end{split}