## Appendix A  
Detailed elements of matrixes M and C derived in the Dynamics section. \[ \begin{split}& M_{11}\\ &=I_{2 yy}+\left(m_{2}\left(2Z_{2}^{2}C_{2}^{2}+2Z_{2}^{2}S_{2}^{2} +2(l_{2}C_{2}+X_{2}C_{2}-Y_{2}S_{2})^{2}\right)\right)/2\\ &+m_{1}X_{1}^{2}+m_{1}Z_{2}^{3}+I_{3 yy}C_{23}^{2}+I_{3 xx}S_{23}^{ 2}+I_{2 yy}C_{2}^{2}+I_{2 xx}S_{2}^{2}\\ &+(m_{3}\left(2Z_{3}^{2}C_{23}^{2}+2Z_{3}^{2}S_{23}^{2}+2(l_{3}C_ {23}+X_{3}C_{23}-Y_{3}S_{23}\right.\\ &\left.+l_{2}C_{2})^{2}\right)/2\end{split}  \tag{10}\]\[ \begin{split}& M_{12}\\ &=-(m_{2}(2Z_{2}S_{2}(l_{2}+X_{2})+2Y_{2}Z_{2}C_{2}))/2-(m_{3}(2Z_{3 }C_{23}(Y_{3}\\ &-l_{2}S_{3})+2Z_{3}S_{23}(l_{3}+X_{3}+l_{2}C_{3})))/2\\ & M_{13}\\ &=-(m_{3}(2Z_{3}S_{23}(l_{3}+X_{3})+2Y_{3}Z_{3}C_{23}))/2\\ & M_{21}\\ &=-(m_{2}(2Z_{2}S_{2}(l_{2}+X_{2})+2Y_{2}C_{2}))/2-(m_{3}(Z_{3}C_ {23}(Y_{3}\\ &-l_{2}S_{3})+2Z_{3}S_{23}(l_{3}+X_{3}+l_{2}C_{3})))/2\\ & M_{22}\\ &=I_{2 zz}+I_{3 zz}+\Big{(}m_{3}\Big{(}2\Big{(}l_{3}+X_{3}+l_{2}C_{ 3})^{2}2(Y_{3}-l_{2}S_{3})^{2}\\ &+\Big{(}m_{2}{(l_{2}+X_{2})}^{2}+2Y_{2}^{2}\Big{)}\Big{)}/2\\ & M_{23}\\ &=I_{3 zz}+\left(m_{3}((2l_{3}+2X_{3})(l_{3}+X_{3}+l_{2}C_{3}+2Y_ {3}(Y_{3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2}l_{2}m_{2}X_{2}^{2}S_{22}\right.\\ &\quad\left.+\dot{q}_{1}\dot{q}_{2}m_{2}Y_{2}^{2}S_{22}+\left(- \dot{q}_{1}\dot{q}_{2}l_{3}^{2}m_{3}+\dot{q}_{1}\dot{q}_{3}l_{3}^{2}m_{3}- \dot{q}_{1}\dot{q}_{2}m_{3}X_{3}^{2}\right.\\ &\quad\left.-\dot{q}_{1}\dot{q}_{3}m_{3}Z_{3}^{2}+\dot{q}_{1}\dot{ q}_{2}m_{3}Y_{3}^{2}+\dot{q}_{1}\dot{q}_{3}m_{3}Y_{3}^{2}\right)\,\sin(2q_{2}+2q_{3}) \\ &\quad-2\dot{q}_{2}\dot{q}_{3}l_{3}m_{3}Z_{3}C_{23}-2\dot{q}_{2} \dot{q}_{3}m_{3}X_{3}Z_{3}C_{23}+2\dot{q}_{2}\dot{q}_{3}m_{3}Y_{3}Z_{3}S_{23} \\ &\quad-\dot{q}_{1}\dot{q}_{3}l_{2}m_{3}Y_{3}S_{3}-\dot{q}_{1}\dot{ q}_{3}l_{2}l_{3}m_{3}S_{3}-\dot{q}_{1}\dot{q}_{3}l_{2}m_{3}X_{3}S_{3}\\ &\quad\left.+\left(-2\dot{q}_{1}\dot{q}_{2}l_{2}m_{3}Y_{3}-\dot{q }_{1}\dot{q}_{3}l_{2}m_{3}Y_{3}\right)\cos(2q_{2}+q_{3})\\ &\quad+\left(-2\dot{q}_{1}\dot{q}_{2}l_{2}l_{3}m_{3}-\dot{q}_{1} \dot{q}_{3}l_{2}l_{3}m_{3}-2\dot{q}_{1}\dot{q}_{2}l_{2}m_{3}X_{3}\right.\\ &\quad-\dot{q}_{1}\dot{q}_{3}l_{2}m_{3}X_{3}\right)\sin(2q_{2}+q_ {3})-2\dot{q}_{1}\dot{q}_{2}l_{2}m_{2}Y_{2}C_{22}\\ &\quad-2\dot{q}_{1}\dot{q}_{2}m_{2}X_{2}Y_{2}C_{22}-2\dot{q}_{1} \dot{q}_{2}l_{2}m_{2}X_{2}S_{22}\\ &\quad-2\dot{q}_{1}\dot{q}_{2}l_{3}m_{3}Y_{3}\cos(2q_{2}+2q_{3})-2 \dot{q}_{1}\dot{q}_{3}l_{3}m_{3}Y_{3}\cos(2q_{2}+2q_{3})\\ &\quad-\left(2\dot{q}_{1}\dot{q}_{2}m_{3}X_{3}+2\dot{q}_{1}\dot{q}_{ 3}l_{3}m_{3}X_{3}\right)sin(2q_{2}+2q_{3})\end{split}