## 2 Modeling of Upper Limb Robotic Rehabilitation Exoskeleton  
Figure 1 shows a two-link ULRRE model. It works in the sagittal plane for flexion and extension movements of shoulder and elbow joints. The electric motors provide these movements. The parameters of ULRRE for both joints are displayed in Figure 1. The lengths of connecting segments from the exoskeleton to the center of masses are \(L_{c1}\) and \(L_{c2}\). The lengths of two links are \(L_{1}\) and \(L_{2}\). The angular positions of the two links are \(q_{1}\) and \(q_{2}\). The model is obtained from [51] and parameters values are shown in Table 1.  
The equation of motion was obtained using the Euler-Lagrange method and is presented in Equation (1) as  
\[J(q)\ddot{q}+C(q,\dot{q})\dot{q}+G(q)+D=T \tag{1}\]  
Table 2 describes the Equation (1). \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Upper Limb Parameters** & **Parameter** & **Value** & **Units** \\ \hline Limb and exoskeleton masses & \(m_{1}\) & 2.25 & kg \\ \(m_{2}\) & 1.47 & kg \\ Limb lengths & \(L_{1}\) & 0.34 & m \\ \(L_{2}\) & 0.25 & m \\ Center of mass & \(L_{c1}\) & 0.25 & m \\  & \(L_{c2}\) & 0.125 & m \\ Mass moment of inertia for exoskeleton and limbs & \(I_{1}\) & 0.2505 & kg\(\cdot\)m\({}^{2}\) \\  & \(I_{2}\) & 0.0925 & kg\(\cdot\)m\({}^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Model parameter. Figure 1: Upper limb robotic rehabilitation exoskeleton. Properties of dynamic model in Equation (1) are as follows:  
1. Matrix \(\mathbf{J}\) (\(\mathbf{q}\)) is symmetric and positive definite. 2. Matrix \(\mathbf{\dot{J}}(\mathbf{\dot{q}})-\mathbf{2C(\mathbf{q}.\dot{\mathbf{q}})}\) is a skew-symmetric if \(\forall\epsilon\in R^{n},\epsilon^{T}(\mathbf{\dot{J}(\dot{\mathbf{q}})-2C(\mathbf{q}.\dot{ \mathbf{q}}))\epsilon=0\). 3. There are finite scalars \(\xi_{i}>0,\ i=1,....,\mathbf{4}\), for which \(\|\mathbf{I(q)}\|\leq\xi_{1},\|\mathbf{C(q}.\dot{\mathbf{q}})\|\leq\zeta_{2},\|\mathbf{G(q)}\| \leq\zeta_{3}\) and \(\|\mathbf{D}\|\leq\zeta_{4}\), that suggest all elements of model are bounded. The equations of matrices are given as: \[\mathbf{J(q)}= \begin{bmatrix}j_{11}&j_{12}\\ j_{21}&j_{22}\end{bmatrix} \] \[ \begin{array}{c}j_{11}=I_{1}+I_{2}+m_{1}L_{c1}^{2}\\ +m_{2}(L_{1}^{2}+L_{c2}^{2}+2L_{1}L_{c2}\cos(q_{2}))\\ j_{12}=j_{21}=I_{2}+m_{2}\left(L_{c2}^{2}+L_{1}L_{c2}\cos(q_{2})\right)\\ j_{22}=I_{2}+m_{2}L_{c2}^{2}\end{array} \] (2) In addition, \[\mathbf{C(q.\dot{\mathbf{q}})}= \begin{bmatrix}c_{11}&c_{12}\\ c_{21}&c_{22}\end{bmatrix} \] \[ \begin{array}{c}c_{11}=-m_{2}L_{1}L_{2}(2\dot{q}_{2})\sin q_{2}\\ c_{12}=-m_{2}L_{1}L_{2}(\dot{q}_{2})\sin q_{2}\\ c_{21}=m_{2}L_{1}L_{2}(\dot{q}_{1})\sin q_{2}\\ c_{22}=0\end{array} \] (3) where \(\dot{q_{1}}\) and \(\dot{q_{2}}\) are the velocities of two joints. Moreover, \(G(q)\) is given by:  
\[ \begin{array}{c}\mathbf{G(q)}=\begin{bmatrix}\dot{g_{1}}\\ \dot{g_{2}}\end{bmatrix}\\ g_{1}=(m_{1}+m_{2})gL_{1}\cos q_{1}+m_{2}gL_{2}\cos(q_{1}+q_{2})\\ g_{2}=m_{2}gL_{2}\cos(q_{1}+q_{2})\end{array}  \tag{4}\]  
\(\mathbf{q}_{d}=[q_{s}\ q_{e}]^{T}\)=\([q_{1}\ q_{2}]^{T}\), where \(q_{s}=q_{1}\) and \(q_{e}=q_{2}\) are the input trajectories given to elbow and shoulder joint. The tracking error is given by \(\mathbf{\epsilon=q_{d}-q}\). The reference and tracked trajectories are represented as \(\mathbf{q_{d}}\) and \(\mathbf{q}\). \(m\) and \(I\) denote the mass and moment of inertia