# Active Gait Retraining with Lower Limb Exoskeleton Based on Robust Force Control
## 2 Materials and Methods
### Exoskeleton Dynamic Model  
Figure 2 shows a simple diagram of one leg of the exoskeleton with the elastic joints shown in Figure 1a. The model in this section is the same for both legs. The dynamic model of the exoskeleton with elastic joints is derived from the Euler-Lagrange approach and is expressed as follows:  
\[M_{e}(x_{e})\bar{x}_{e}+C_{e}(x_{e},\bar{x}_{e})\bar{x}_{e}+g_{e} (x_{e})-K[x_{m}-x_{e}]= 0 \tag{1a}\] \[J_{m}\bar{x}_{m}+B\bar{x}_{m}+K[x_{m}-x_{e}]= \tau_{m} \tag{1b}\]  
where the angular positions of links 1 (hip) and 2 (knee) of the exoskeleton are denoted by the vector expressed as \(x_{e}=[x_{e1}\quad x_{e2}]^{T}\), while the angular positions of motors 1 (hip) and 2 (knee) are denoted by the vector expressed as \(x_{m}=[x_{m1}\quad x_{m2}]^{T}\). The exoskeleton inertia matrix is given by \(M_{e}\in\mathbb{R}^{2\times 2}\), the exoskeleton Coriolis matrix is given by \(C_{e}\in\mathbb{R}^{2\times 2}\), the gravitational forces vector is given by \(g_{e}\in\mathbb{R}^{2}\), and \(K\) is a diagonal matrix formed by the torsional spring stiffness coefficients with the following form: \(K=diag\{k_{1},k_{2}\}\). \(J=diag\{l_{1}r_{1,1}^{2},l_{2}r_{1,2}^{2}\}\) is a diagonal matrix formed by the product of the inertia moment of the rotors and the square of the gear ratio. The viscous friction values of the motors form the diagonal matrix (\(B\)). Finally, the torques of the actuators of the hip and knee form the input vector expressed as \(\tau_{m}\in\mathbb{R}^{2}\). Figure 2: Simple diagram of one leg of the exoskeleton. Solving for \(\dot{x}_{e}\) from (8a) and substituting it into (10) yields  
\[\dot{x}_{m}=K^{-1}\tau_{s}+M^{-1}\tau_{h}+M^{-1}\tau_{s}-M^{-1}C\dot{x}_{e}-M^{-1 }g-M^{-1}\Phi \tag{11}\]  
Substituting (11) into (8b) and solving for \(\tau_{m}\) yields  
\[K^{-1}J_{m}\tau_{s}+M^{-1}J_{m}\tau_{h}+M^{-1}J_{m}\tau_{s}-M^{-1}J_{m}C\dot{x} _{e}-M^{-1}J_{m}g-M^{-1}J_{m}\Phi+B\dot{x}_{m}=\tau_{m}-\tau_{s} \tag{12}\]  
\[K^{-1}J_{m}\tau_{s}+\Big{(}I+M^{-1}J_{m}\Big{)}\tau_{s}-M^{-1}J_{m}C\dot{x}_{e} -M^{-1}J_{m}g+M^{-1}J_{m}\tau_{h}-M^{-1}J_{m}\Phi+B\dot{x}_{m}=\tau_{m} \tag{13}\]  
Equation (13) can be rewritten as follows:  
\[a_{2}\tau_{s}+a_{1}\tau_{s}+a_{0}\tau_{s}=\tau_{m}+b(C\dot{x}_{e}+g+\Gamma_{1}( t)) \tag{14}\]  
where \(b=M^{-1}J_{m}\), \(a_{2}=K^{-1}J_{m}>0\), \(a_{1}=0\), \(a_{0}=I+b>0\), and \(\Gamma_{1}(t)=\Phi-\tau_{h}+b^{-1}B\dot{x}_{m}\), considering that \(\Gamma_{1}(t)\) is bounded as \(\mid\Gamma_{1}\mid<\Gamma_{1_{max}}\). _Stability Proof_  
Consider the following control law [37; 38]:  
\[\tau_{m}=a_{2}\Big{(}\ddot{\tau}_{d}-2\lambda\dot{\tau}-\lambda^{2}\ddot{\tau }\Big{)}+a_{1}\dot{\tau}_{s}+a_{0}\tau_{s}-\rho_{1}\mid\sqrt{s_{1}}\mid sign(s_ {1})-b(Cx_{e}+g) \tag{15}\]  
where we define the torque error as \(\tilde{\tau}=\tau_{s}-\tau_{d}\) and consider that \(\rho_{1}>b\Gamma_{1_{max}}\). The sliding surface in (15) is defined as  
\[s_{1}=\dot{\tau}+\lambda\tilde{\tau} \tag{16}\]  
where \(\lambda>0\). With the intention of proving that the system is stable, we propose the following Lyapunov candidate function:  
\[V_{1}(t)=\frac{1}{2}s_{1}^{T}a_{2}s_{1} \tag{17}\]  
With this form, \(V_{1}\) is positive definite.