# A Robust Controller for Upper Limb Rehabilitation Exoskeleton
## 3 Controller for Trajectory Tracking
### Robust GPI Type Control with Trajectory Tracking  
The mathematical model of the 3-DOF exoskeleton can be obtained through the Euler-Lagrange equation, and can be given by the following structure:  
\[M(\theta)\ddot{\theta}(t)+C\Big{(}\theta(t),\dot{\theta}(t)\Big{)}\dot{\theta }(t)+G(\theta(t))=\tau(t) \tag{2}\]  
where \(\theta\in R^{3}\), \(M(\theta)\), \(C\Big{(}\theta,\dot{\theta}\Big{)}\) and \(G(\theta)\), are the positive-definite and symmetric inertia matrix, the Coriolis matrix and the vector of gravitational terms, respectively. Multiplying by \(M^{-1}(\theta)\)  
\[\ddot{\theta}(t)=M^{-1}(\theta)\tau(t)-M^{-1}(\theta)\Big{[}C\Big{(}\theta(t),\dot{\theta}(t)\Big{)}\dot{\theta}(t)+G(\theta(t))\Big{]} \tag{3}\]  
Consider  
\[\xi(t)=-M^{-1}(\theta)\Big{[}C\Big{(}\theta(t),\dot{\theta}(t)\Big{)}\dot{ \theta}(t)+G(\theta(t))\Big{]} \tag{4}\]  
\[u(t)=M^{-1}(\theta)\tau(t)\]  
The dynamic model of the 3-DOF exoskeleton system can be represented as a disturbed system given by:  
\[\ddot{\theta}_{i}(t)=u_{i}(t)+\dot{\xi}_{i}(t) \tag{5}\]Assuming that \(\xi_{i}(t)\) is unknown but uniformly bounded and absolute. The model results in a system of equations, so three independent control inputs can be defined for robust trajectory tracking:  
\[u_{i}=\ddot{\theta}_{id}-k_{3}\bigg{(}\overset{\frown}{\theta}_{i}-\dot{\theta} _{id}\bigg{)}-k_{2}(\theta_{i}-\theta_{id})-k_{1}\int_{0}^{t}(\theta_{i}-\theta _{id})d\tau-k_{0}\int_{0}^{t}\int_{0}^{\tau}(\theta_{i}-\theta_{id})d\lambda d\tau \tag{6}\]  
where (5) is the integral reconstruction of the speed of the corresponding link. \[ \begin{array}{c}\overset{\frown}{\theta}_{i}=\overset{\frown}{\int_{0}^{t }}u_{i}d\tau\\ \dot{\theta}_{i}=\overset{\frown}{\theta}_{i}+\dot{\theta}_{i0}\end{array}  \tag{7}\]  
Substituting (6) in (5), and considering the integral reconstruction (7) and the disturbance,  
\[ \begin{array}{c}\ddot{\theta}_{i}=\ddot{\theta}_{id}-k_{3}\bigg{(}\overset{ \frown}{\theta}_{i}-\dot{\theta}_{id}\bigg{)}-k_{2}(\theta_{i}-\theta_{id})-k _{1}\int_{0}^{t}(\theta_{i}-\theta_{id})d\tau\\ -k_{0}\int_{0}^{t}\int_{0}^{\tau}(\dot{\theta}_{i}-\theta_{id})d\lambda d\tau+ a_{1}t+a_{0}\end{array}  \tag{8}\]  
Defining the error as \(e=\theta_{i}-\theta_{id}\), and deriving twice results in a dynamic equation of the error given by  
\[e^{IV}+k_{3}\overset{\sim}{e}+k_{2}\dot{e}+k_{1}\dot{e}+k_{0}e=0 \tag{9}\]  
Applying the Laplace transform to (9) with initial conditions equal to zero, the characteristic equation of the closed-loop system is obtained:  
\[s^{4}+k_{3}s^{3}+k_{2}s^{2}+k_{1}s+k_{0}=0 \tag{10}\]  
The controller gains \((k_{i},\ i=0,\ 1,\ 2,\ 3)\) are determined by equating a Hurwitz polynomial so that the error dynamics are asymptotically stable. \[\Big{(}s^{2}+2\varsigma_{1}\omega_{1}s+\omega_{1}^{2}\Big{)}\Big{(}s^{2}+2 \varsigma_{2}\omega_{2}s+\omega_{2}^{2}\Big{)}=0 \tag{11}\]  
For this case, the following were selected:  
\[\varsigma_{1}=\varsigma_{2}=1.5\,y\ \omega_{1}=\omega_{2}=8\]  
Considering that the different parameters, such as the varying sizes, weights, and heights of humans that will use an exoskeleton for rehabilitation, will result in a dynamic modeling of a system with uncertainties, it is necessary to propose a control law that is robust. In the previous case, the controller considers a variant disturbance in the ramp type time; in this case, it is considered to be given by the following third degree polynomial:  
\[\xi_{1}=a_{3}t^{3}+a_{2}t^{2}+a_{1}t+a_{0} \tag{12}\]  
To compensate for the disturbance and to achieve the controller's objective of tracking the desired trajectory, the following robust controller is proposed. \[ \begin{array}{c}u_{1}=\ddot{z}_{1d}-k_{5}\Big{(}\dot{z}_{1}-\dot{z}_{1d} \Big{)}-k_{4}(z_{1}-z_{1d})-k_{3}\int_{0}^{t}(z_{1}-z_{1d})d\tau-k_{2}\int_{0} ^{t}\int_{0}^{\tau}(z_{1}-z_{1d})d\lambda d\tau\\ -k_{1}\int_{0}^{t}\int_{0}^{\tau}\int_{0}^{\lambda}(z_{1}-z_{1d})d\sigma d \lambda d\tau-k_{0}\int_{0}^{t}\int_{0}^{\tau}\int_{0}^{\lambda}\int_{0}^{ \sigma}(z_{1}-z_{1d})d\rho d\sigma d\lambda d\tau\end{array}