# Design of a Lower Limb Exoskeleton: Robust Control, Simulation and Experimental Results
## 4 Mathematical Model
### Dynamic Model  
The exoskeleton is symmetrical, which means that the dynamic model is the same for both legs so the system can be reduced to a two DOF robot. In order to obtain the dynamic equations that govern the behaviour of the robot, it is necessary to have the simplified link diagram of the exoskeleton including the patient's lower limb, which is presented in Figure 8, which shows the two links that make up the prototype, and there is a centre of mass for each one. The points (marked in red) are the joints and also the names that were assigned to each variable. The mass centre symbolizes the location where the system's entire mass is supposed to be concentrated.  
The distances between the axis of rotation and the centre of mass of Link 1 and Link 2 are denoted by \(l_{c1}\) and \(l_{c2}\), while \(l_{1}\) and \(l_{2}\) express the moments of inertia of each link around the axis passing through their centres of mass. Both joints are rotational. The degree of freedom associated with angle \(q_{1}\) is measured from the longitudinal axis of the thigh (line dotted in blue) to Link 1, which is positive in the counterclockwise direction, while \(q_{2}\) is measured from the extension of the longitudinal axis through Link 1 to Link 2. Finally, \(m_{1}\) and \(m_{2}\) are the masses of the links. The position vector of the rotational joints with \(q_{1}(t)\) corresponds to the knee joint and \(q_{2}(t)\) for the ankle joint. The Euler-Lagrange formalism was used to obtain the dynamic model. The general equation of motion of the exoskeleton is  
\[M(q)\ddot{q}+C(q,q)\dot{q}+g(q)=\tau \tag{1}\]  
with  
\[\begin{bmatrix}M_{11}(q)&M_{12}(q)\\ M_{21}(q)&M_{22}(q)\end{bmatrix}\begin{bmatrix}\dot{q}_{1}\\ \dot{q}_{2}\end{bmatrix}+\begin{bmatrix}C_{11}(q,q)&C_{12}(q,q)\\ C_{21}(q,q)&C_{22}(q,q)\end{bmatrix}\begin{bmatrix}\dot{q}_{1}\\ \dot{q}_{2}\end{bmatrix}+\begin{bmatrix}\dot{s}_{1}(q)\\ \dot{s}_{2}(q)\end{bmatrix}=\begin{bmatrix}\tau_{1}\\ \tau_{2}\end{bmatrix}, \tag{2}\]  
Figure 8: Simplified link diagram of the exoskeleton to develop the mathematical model.  
where \(M\in R^{2\times 2}\) is the inertia matrix, \(C\in R^{2\times 2}\) is the Coriolis matrix, \(g\in R^{2}\) is the vector of gravitational forces and \(\tau\in R^{2}\) are the torques of the actuators. Furthermore, the elements of the \(M\), \(C\) and \(g\) matrixes are  
\[\begin{split} M_{11}(q)&=I_{1}+I_{2}+m_{2}l_{1}^{2} +m_{1}l_{c1}^{2}+m_{2}l_{c2}^{2}+2m_{2}l_{1}l_{c2}\cos(q_{2}+\alpha),\\ M_{12}(q)&=I_{2}+m_{2}l_{c2}^{2}+m_{2}l_{1}l_{c2} \cos(q_{2}+\alpha),\\ M_{21}(q)&=I_{2}+m_{2}l_{c2}^{2}+m_{2}l_{1}l_{c2} \cos(q_{2}+\alpha),\\ M_{22}(q)&=I_{2}+m_{2}l_{c2}^{2},\\ C_{11}(q,\dot{q})&=-m_{2}l_{1}l_{c2}\sin(q_{2}+ \alpha)\dot{q}_{2},\\ C_{12}(q,\dot{q})&=-m_{2}l_{1}l_{c2}\sin(q_{2}+ \alpha)\dot{q}_{1}+\dot{q}_{2}],\\ C_{21}(q,\dot{q})&=m_{2}l_{1}l_{c2}\sin(q_{2}+ \alpha)\dot{q}_{1},\\ C_{22}(q,\dot{q})&=0,\\ g_{1}(q)&=[m_{1}l_{c1}+m_{2}l_{1}]g\sin(q_{1})+m_{ 2}gl_{c2}\sin(q_{1}+q_{2}+\alpha),\\ g_{2}(q)&=m_{2}gl_{c2}\sin(q_{1}+q_{2}+\alpha), \end{split} \tag{3}\]  
and \(\tau_{1}\) is the torque responsible for generating flexion and extension for the knee, while \(\tau_{2}\) is the torque responsible for generating flexion and extension for the ankle.