## 2 Materials and Methods
### Kinematical Analysis Based on the Constraints
\[C_{r,J}(\mathbf{q},t)=\hat{v}^{T}\mathbf{R}_{i}^{T}\big{(}\mathbf{\varphi}_{j}-\mathbf{\varphi }_{i}\big{)}-\theta(t)=0 \tag{6}\]  
The related scleronomic constraints \(C_{s,J}\) are composed of a translational part and a rotational one [25], in (7):  
* the joint position calculated starting from the body \(i\), \(\mathbf{r}_{j,i}\), has to be equal to the one seen by the body \(j\), \(\mathbf{r}_{l,j}\);
* a vector fixed to body \(j\), \(\mathbf{\overline{s}}_{j}\), parallel to the rotation axis \(\hat{v}\), has to be orthogonal with respect to others two vectors fixed to the body \(i\), \(\mathbf{\overline{s}}_{i1}\) and \(\mathbf{\overline{s}}_{i2}\), both orthogonal to the rotation axis \(\hat{v}\) and to each other. \[\left\{ \begin{array}{l}\mathbf{r}_{l,i}=\mathbf{t}_{i}+\mathbf{R}_{i}\overline{u}_{l,i} \\ \mathbf{r}_{l,j}=\mathbf{t}_{j}+\mathbf{R}_{j}\overline{u}_{l,j}\\ \mathbf{s}_{j}=\mathbf{R}_{j}\mathbf{\overline{s}}_{j}\\ s_{i1}=\mathbf{R}_{i}\mathbf{\overline{s}}_{i1}\\ s_{i2}=\mathbf{R}_{i}\mathbf{\overline{s}}_{i2}\end{array} \right.\ \ \rightarrow\ \mathbf{C}_{s,J}(\mathbf{q})=\left[ \begin{array}{l}\mathbf{r}_{l,i}-\mathbf{r}_{l,j}\\ \mathbf{s}_{l1}^{T}s_{j}\\ \mathbf{s}_{l2}^{T}s_{j}\end{array} \right]=\mathbf{0} \tag{7}\]  
Figure 2: Revolute joint scheme. While the joint local positions \(\overline{\mathbf{u}}_{I,i}\) and \(\overline{\mathbf{u}}_{I,j}\) are provided by the geometry of the system, the vectors \(\overline{\mathbf{s}}_{j}\), \(\overline{\mathbf{s}}_{i1}\) and \(\overline{\mathbf{s}}_{i2}\) can be calculated considering the spherical transformation that rotates the reference frame of the body \(i\) or \(j\) leading the \(x\) axis to be parallel with respect to the rotation axis \(\hat{\mathbf{v}}\). The time derivatives of the rheonomic constraint are then performed in (8) (considering that from the quaternion theory results \(\dot{\mathbf{G}}\dot{\mathbf{\theta}}=\mathbf{0}\)). \[ \begin{split}\dot{C}_{r,J}\Big{(}\mathbf{q},\dot{\mathbf{q}},t\Big{)}=- \hat{\mathbf{v}}^{T}\overline{\mathbf{G}}_{i}\dot{\mathbf{\theta}}_{i}+\hat{\mathbf{v}}^{T}\bm {R}_{i}^{T}\mathbf{R}_{j}\overline{\mathbf{G}}_{j}\dot{\mathbf{\theta}}_{j}-\dot{\theta}(t) =0\\ \ddot{C}_{r,J}\Big{(}\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}},t\Big{)}=- \hat{\mathbf{v}}^{T}\overline{\mathbf{G}}_{i}\dot{\mathbf{\theta}}_{i}+\hat{\mathbf{v}}^{T} \mathbf{R}_{i}^{T}\mathbf{R}_{j}\overline{\mathbf{G}}_{j}\dot{\mathbf{\theta}}_{j}+\hat{\mathbf{v}} ^{T}\mathbf{R}_{i}^{T}\overline{\mathbf{\omega}}_{i}^{T}\mathbf{R}_{j}\overline{\mathbf{G}}_{ j}\dot{\mathbf{\theta}}_{j}+\hat{\mathbf{v}}^{T}\mathbf{R}_{i}^{T}\overline{\mathbf{\omega}}_{j} \mathbf{R}_{j}\overline{\mathbf{G}}_{j}\dot{\mathbf{\theta}}_{j}-\ddot{\theta}(t)=0\end{split}  \tag{8}\]  
Collecting the terms in order to build the matrices needed for the kinematical analysis, Equation (9) is obtained. \[ \begin{split}\dot{C}_{r,J}=\begin{bmatrix}\mathbf{0}&-\hat{\mathbf{v}}^{T} \overline{\mathbf{G}}_{i}\end{bmatrix}\begin{bmatrix}\dot{\mathbf{t}}_{i}\\ \dot{\mathbf{\theta}}_{i}\end{bmatrix}+\begin{bmatrix}\mathbf{0}&\hat{\mathbf{v}}^{T}\mathbf{R} _{i}^{T}\mathbf{R}_{j}\overline{\mathbf{G}}_{j}\end{bmatrix}\begin{bmatrix}\dot{\mathbf{t} }_{j}\\ \dot{\mathbf{\theta}}_{j}\end{bmatrix}-\dot{\theta}(t)=0\\ \ddot{C}_{r,J}=\begin{bmatrix}\mathbf{0}&-\hat{\mathbf{v}}^{T}\overline{\mathbf{G}}_{i} \end{bmatrix}\begin{bmatrix}\dot{\mathbf{t}}_{i}\\ \ddot{\mathbf{\theta}}_{i}\end{bmatrix}+\begin{bmatrix}\mathbf{0}&\hat{\mathbf{v}}^{T}\mathbf{R }_{i}^{T}\mathbf{R}_{j}\overline{\mathbf{G}}_{j}\end{bmatrix}\begin{bmatrix}\dot{\mathbf{t} }_{j}\\ \dot{\mathbf{\theta}}_{j}\end{bmatrix}+\begin{bmatrix}\dot{\mathbf{t}}_{i}\\ \dot{\mathbf{\theta}}_{i}\end{bmatrix}+\begin{bmatrix}\mathbf{0}&\hat{\mathbf{v}}^{T}\mathbf{R }_{i}^{T}\Big{(}\overline{\mathbf{\omega}}_{i}^{T}+\overline{\mathbf{\omega}}_{j} \Big{)}\mathbf{R}_{j}\overline{\mathbf{G}}_{j}\end{bmatrix}-\ddot{\theta}(t)=0\end{split}