# Modular Design and Decentralized Control of the Recupera Exoskeleton for Stroke Rehabilitation
## 3 Exoskeleton Modeling and Control for Rehabilitation Therapies
### Kinematic and Dynamic Modeling
#### 3.1.1 Loop Closure Functions  
Let us define loop closure functions such that they provide a unique mapping between the independent position variables \(\boldsymbol{y}\) and position variables in the spanning tree \(\boldsymbol{q}\subseteq\mathbb{R}^{n}\). For this assumption to hold true, let us define a set \(C\subseteq\mathbb{R}^{m}\) of acceptable values of \(\boldsymbol{y}\), and assume \(\boldsymbol{y}\in C\). For all \(\boldsymbol{y}\in C\), there exists a function, \(\gamma\) such that  
\[\begin{split}\boldsymbol{q}&=\gamma(\boldsymbol{y}) \\ \dot{\boldsymbol{q}}&=\boldsymbol{G}\dot{\boldsymbol{y} }+\dot{\boldsymbol{G}}\dot{\boldsymbol{y}}=\boldsymbol{G}\dot{\boldsymbol{y} }+\boldsymbol{g}\end{split} \tag{1}\]  
where \(\boldsymbol{G}=\frac{\partial\gamma}{\partial\boldsymbol{y}}\) is the loop closure Jacobian matrix of size (\(n\times m\)), and \(\boldsymbol{g}=\dot{\boldsymbol{G}}\dot{\boldsymbol{y}}\). Let us also define a permutation matrix, \(\boldsymbol{Q}\in\mathbb{R}^{m\times n}\) such that \(\boldsymbol{u}=\boldsymbol{Q}\boldsymbol{q}\).  
Example of Loop Closure Function of Recupera Single Arm  
Each arm of the Recupera exoskeleton is a 5 DOF series-parallel hybrid mechanism (see Figure 6a) which contains a double parallelogram linkage. Figure 7 shows the schematic of the double parallelogram mechanism. The loop closure function of the Double parallelogram Linkage can be composed from mimic joint definition in URDF [39]. The topological graph of the Recupera exoskeleton arm is shown in Figure 6b. The red edges (\(J_{100,200}\), \(J_{200,232}\), \(J_{300,400}\), \(J_{400,500}\), \(J_{500,600}\)) correspond to the five independent (\(\boldsymbol{y}\)) and active (\(\boldsymbol{u}\)) degrees of freedom of the system. The spanning tree joints (excluding the loop joints shown by dotted blue edges) are collected in tree joint position vector \(\boldsymbol{q}\). The relation between \(\boldsymbol{q}\) and \(\boldsymbol{y}\) i.e., loop closure function is shown in Equation (2) from which the loop closure Jacobian \(\boldsymbol{G}\) and the vector \(\boldsymbol{g}\) can be deduced after successive differentiations (compare with Equation (1)). This can be used to solve various kinematics (e.g., workspace computation, see Figure 8) and dynamics problems related to the system.  
\[\mathbf{q}=\left[\begin{array}{c}q_{100,200}\\ q_{200,222}\\ q_{222,223}\\ q_{223,300}\\ q_{200,223}\\ q_{232,233}\\ q_{300,400}\\ q_{400,500}\\ q_{500,600}\end{array}\right]=\left[\begin{array}{ccccc}1&0&0&0&0\\ 0&1&0&0&0\\ 0&-1&0&0&0\\ 0&1&0&0&0\\ 0&1&0&0&0\\ 0&1&0&0&0\\ 0&-1&0&0&0\\ 0&1&0&0&0\\ 0&-1&0&0&0\\ 0&0&1&0&0\\ 0&0&0&1\end{array}\right]\left[\begin{array}{c}q_{100,200}\\ q_{200,232}\\ q_{300,400}\\ q_{400,500}\\ q_{500,600}\end{array}\right]+\left[\begin{array}{c}0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\end{array}\right] \tag{2}\]  
A comprehensive kinematic analysis of each parallel submechanism module of the system such as Active Ankle[38; 52], Stewart Platform etc is performed and the associated loop closure functions are derived analytically. Based on them, the loop closure function of the overall exoskeleton system is composed.  
Figure 6: Recupera single arm schematic and its topological graph.  
Figure 7: Double parallelogram schematic.