## 3 Dynamic Modelling of the Hybrid Robots Class III  
\(\textbf{u}=\left[ \begin{array}{cccccc}u_{1}&u_{2}&u_{3}&\ldots&u_{n}\end{array}  \right]^{T}\) is the vector of \(n\) independent generalized coordinates which are selected among \(n\) joint variables \(\left[q_{i}\right]_{i=1+n}\) of the main arm, and \(2\times m\) joint variables \(\left\{q_{k_{1}},q_{k_{2}}\right\}_{k=1+m}\) of \(m\) closed-loops. In other words, **u** is the vector of all active joint variables. \(\textbf{z}=\left[z_{1}\ z_{2}\ \ldots\ z_{2m}\right]^{T}\) is the vector of \(2m\) dependent generalized coordinates. \(\textbf{s}=\left[ \begin{array}{cccc}\textbf{u}&\textbf{z}\end{array} \right]^{T}\) is the vector of all \((n+2m)\) generalized coordinates of the robot system. \(\textbf{f}=\left[ \begin{array}{cccccc}f_{11}&f_{12}&\ldots&f_{m1}&f_{m2}\end{array}  \right]^{T}\) is the vector of \(2m\) constraint equations. \(\textbf{\tau}=\left[ \begin{array}{cccccc}\underbrace{\tau_{1}&\tau_{2}& \ldots&\tau_{n}}_{n}&\underbrace{0&\ldots&0}_{2m}\end{array} \right]^{T}\) is the vector of applied torques/forces. By using the Lagrangian formulation, the equations of motion including constraint equations for the robot can be written as follows:  
\[\left\{ \begin{array}{l}\textbf{M}(\textbf{s},t)\ddot{\textbf{s}}+\textbf{C} \Big{(}\textbf{s},\dot{\textbf{s}},t\Big{)}\dot{\textbf{s}}+\textbf{g}(\textbf {s},t)+\textbf{J}_{\textbf{s}}^{T}\lambda=\tau(t)\\ \textbf{f}(\textbf{s},t)=0\end{array} \right. \tag{10}\]  
Note that the size of the global matrices \(\textbf{M}(\textbf{s},t)\) and \(\textbf{C}\Big{(}\textbf{s},\dot{\textbf{s}},t\Big{)}\) is \((n+2m)\times(n+2m)\). The global mass matrix \(\textbf{M}(\textbf{s},t)\) must be formulated with respect to all the links of the robot including \(n\) links of the serial chain and \(2m\) links added to \(m\) local closed-loops. The global mass matrix is calculated as follows:  
\[\textbf{M}(\textbf{s},t)=\sum_{j=1}^{n+2m}\Big{(}m\textbf{j}\textbf{j}\textbf{ j}_{Tj}^{T}\textbf{j}_{Tj}+\textbf{j}_{R_{j}}^{T}\textbf{j}_{R_{j}}\Big{)} \tag{11}\]  
where \(m_{j}\) and \(\textbf{I}_{j}\) are the mass and inertia of a link \(j\). The translational and rotational Jacobian matrices are calculated as \(\textbf{J}_{T_{j}}=\frac{\partial\textbf{r}_{Cj}}{\partial\textbf{s}}\) and \(\textbf{J}_{R_{j}}=\frac{\partial\textbf{w}_{j}}{\partial\textbf{s}}\), where \(\textbf{r}_{Cj}\) is the centre of mass, and \(\textbf{w}_{j}\) is the angular velocity of a link \(j\), respectively. The Coriolis and centrifugal matrix \(\textbf{C}\Big{(}\textbf{s},\dot{\textbf{s}},t\Big{)}\) is calculated by using Cristoffel notation. The matrix \(\textbf{g}(\textbf{s},t)\) is calculated as follows:  
\[\textbf{g}(\textbf{s},t)=\left[\frac{\partial\Pi}{\partial\textbf{s}}\right]^ {T} \tag{12}\]where the total potential energy of the entire system is calculated as  
\[\Pi=\sum_{j=1}^{n+2m}m_{j}\mathbf{g}^{T}\mathbf{r}_{Cj} \tag{13}\]  
The Jacobian matrix \(\mathbf{J}_{s}\) is derived with respect to \(2m\) constraint equations as \(\mathbf{J}_{s}=\frac{\partial\mathbf{f}}{\partial\mathbf{s}}\), and \(\lambda=\left[ \begin{array}{cccc}\lambda_{1}&\lambda_{2}&\ldots&\lambda_{2m }\end{array} \right]^{T}\) is the vector of \(2m\) Lagrangian Multipliers. It is clear that the system of DAE equations seen in Equation (11) consists of \((n+2m)\) differential equations of second order and \(2m\) constraint equations \(\mathbf{f}(\mathbf{s},t)=0\). Moreover, Equation (10) has not only \(n\) independent variables \(\mathbf{u}\), but also \(2m\) dependent variables \(\mathbf{z}\) and \(2m\) unknown Lagrangian Multipliers \(\lambda\). Therefore, if using this complex system of DAEs to analyse the dynamics behaviour and to design a control law for the robot, the time complexity of the formulation and computation will be increased dramatically. For this reason, it is necessary to transform Equation (10) into a more compact form in which the Lagrangian Multipliers \(\lambda\) should be cancelled, and the number of the differential equations is minimized.