## 4 Singular Perturbation Decomposition of the System
#### 5.1.2 Repetitive Learning Sliding Mode Control based on the Concept of Virtual Force  
The rigid model of the slow subsystem has the effect of link elasticity. This section uses the principle of virtual control force to improve the originally desired trajectory and generate a hybrid trajectory. The improved repetitive learning sliding mode control is designed to realize the dual functions of trajectory tracking and link elastic vibration suppression. The virtual force \(\mathbf{F}\in\mathbf{R}^{3\times 1}\) is defined by the second-order instruction generator \(\ddot{\mathbf{e}}_{\rm h}+a\dot{\mathbf{e}}_{\rm h}+\mathbf{b}\mathbf{e}_{\rm h}=\mathbf{F}\), where \(\mathbf{e}_{\rm h}=\mathbf{q}_{\rm d}-\mathbf{q}_{\rm h}\) and \(\mathbf{q}_{\rm h}\) is the hybrid trajectory.  
Define the hybrid error \(\mathbf{e}_{\rm r}=\mathbf{q}_{\rm h}-\mathbf{q}\) and the hybrid exponential sliding mode variable as \(\mathbf{s}_{\rm r}=\dot{\mathbf{e}}_{\rm r}+a\mathbf{e}_{\rm r}+b\mathbf{e}_{\rm r}^{(q/p)}\), modify \(\mathbf{q}_{\rm d}\) in Equations (28)-(30) to \(\mathbf{q}_{\rm h}\), and design a repetitive learning sliding mode control based on the concept of virtual force as:  
\[\mathbf{u}_{\rm r}=\mathbf{Q}_{0}\mathbf{z}_{0\rm r}+\sum\limits_{k=1}^{N}\mathbf{Q}_{k}\dot{ \mathbf{z}}_{\rm kr}+\mathbf{K}_{M}\Big{(}a\dot{\mathbf{e}}_{\rm r}+b\frac{q}{p}\mathbf{e}_{ \rm r}^{(\frac{q}{p}-1)}\Big{)}+\mathbf{\eta}_{\rm r} \tag{37}\]  
\[\ddot{\mathbf{z}}_{k}=\mathbf{Q}_{k}\mathbf{s}_{\rm r}-k^{2}\omega^{2}\mathbf{z}_{\rm kr},k=1, \cdots N \tag{38}\]  
\[\dot{\mathbf{z}}_{0\rm r}=\mathbf{Q}_{0}\mathbf{s}_{\rm r} \tag{39}\]  
where \(\mathbf{\eta}_{\rm r}=\Big{(}\mathbf{K}_{1}\|a\dot{\mathbf{e}}_{\rm r}+b\frac{q}{p}\mathbf{e}_ {\rm r}^{(\frac{q}{p}-1)}\|+\mathbf{K}_{2}\|\mathbf{h}_{\rm r}\|+\mathbf{K}_{3}\|\mathbf{h}_{ \rm r}\|^{2}+\mathbf{K}_{d}\Big{)}\mathbf{S}\mathbf{g}\mathbf{n}(\mathbf{s}_{\rm r})\).  
Let \(\mathbf{W}_{\rm s}=\Big{[}\delta^{T},\mathbf{e}^{T},\dot{\mathbf{\delta}}^{T},\dot{\mathbf{e} }^{T}\Big{]}^{T}\). After substituting the controller equations (Equations (37)-(39)) into Equation (20), and then taking the resulting equation into the derivative of \(\mathbf{W}_{\rm s}\), we have:  
\[\dot{\mathbf{W}}_{\rm s}=\mathbf{A}_{\rm s}\mathbf{W}_{\rm s}+\mathbf{B}_{\rm s}\mathbf{F}+\mathbf{L}_{ \rm s} \tag{40}\]  
\[\text{where }\mathbf{A}_{\rm s}=\left[\begin{array}{ccc}\mathbf{0}_{4\times 4}&\mathbf{0}_{4 \times 3}&\mathbf{I}_{4\times 4}&\mathbf{0}_{4\times 3}\\ \mathbf{0}_{3\times 4}&\mathbf{0}_{3\times 3}&\mathbf{0}_{3\times 4}&\mathbf{I}_{3\times 3}\\ -\mathbf{Q}_{22}^{-1}\mathbf{K}_{5}&-\mathbf{Q}_{22}^{-1}\mathbf{Q}_{21}\mathbf{b}&-\mathbf{Q}_{22}^{ -1}\mathbf{R}_{22}&-\mathbf{Q}_{22}^{-1}\mathbf{Q}_{21}\mathbf{a}\\ \mathbf{0}_{3\times 4}&-\mathbf{b}&\mathbf{0}_{3\times 4}&-\mathbf{a}\end{array}\right]\text{, }\mathbf{B}_{\rm s}= \left[\begin{array}{c}\mathbf{0}_{4\times 3}\\ \mathbf{0}_{3\times 3}\\ \mathbf{Q}_{22}\mathbf{Q}_{21}\\ \mathbf{I}_{3\times 3}\end{array}\right]\text{,}\]  
\[\text{and }\mathbf{L}_{\rm s}=\left[\begin{array}{c}\mathbf{0}_{4\times 1}\\ \mathbf{0}_{3\times 1}\\ \mathbf{Q}_{22}^{-1}\mathbf{Q}_{21}\mathbf{(G}-\tilde{\mathbf{q}}_{\rm d})-\mathbf{Q}_{22}^{-1} \mathbf{R}_{21}\dot{\mathbf{q}}\\ \mathbf{G}\end{array}\right]\text{.}\]  
Select virtual force \(\mathbf{F}\) as:  
\[\mathbf{F}=-\mathbf{Q}_{\rm s}^{-1}\mathbf{B}_{\rm s}^{T}\mathbf{P}_{\rm s}\mathbf{W}_{\rm s} \tag{41}\]  
where \(\mathbf{P}_{\rm s}\) is the solution of the Riccati equation.  
When \(\mathbf{F}\) takes the value shown in Equation (41), Equation (40) is stable. Stability proof refers to [PERSON] et al. (2010).