# Design and Isokinetic Training Control Method of Leg Press Training Device
## 4 Resistance Training Controller Algorithm
### Sliding Mode Variable Structure Controller Design  
The dynamic Equation (2) is shown as follows:  
\[\ddot{S}=f_{1}\dot{S}^{2}+f_{2}\dot{S}+GU+d \tag{18}\]  
where \(f_{1}=-BA^{-1}\), \(f_{2}=-CA^{-1}\), \(G=K_{\infty}A^{-1}\), \(d=DA^{-1}\), and \(U=I_{c}\) are the control quantities. Because the actual man-machine system model is difficult to identify and some system model parameters are uncertain and time-varying, here, the certain and the uncertain parameters of the system are considered separately, and we can further obtain:  
\[\ddot{S} =(f_{1n}+f_{1 un})\dot{S}^{2}+(f_{2n}+f_{2 un})\dot{S}+(G_{n}+G_{un} )U+d \tag{19}\] \[=f_{1n}\dot{S}^{2}+f_{2n}\dot{S}+G_{n}U+\Delta\]  
where \(f_{1n}\), \(f_{2n}\), and \(G_{n}\) represent the certain parameters of the system, respectively, \(f_{1 un}\), \(f_{2 un}\), and \(G_{un}\) represent the uncertain parameters of the system, respectively, \(d\) is the system interference term, \(\Delta\) represents the sum of the system uncertainties superposition. The \(D(\theta_{1},\theta_{2},Z)\) was introduced in Equation (8), \(K\), \(B\), \(X_{0}\), and \(Z\) introduced in Equation (9) are related to the physical condition of the trainer itself. These parameters are unknown and different (each person is different), and \(Z\) means muscle stimulation rate and is characterized by time variance. \[\Delta=f_{1 un}\dot{S}^{2}+f_{2 un}\dot{S}+G_{un}U+d \tag{20}\]  
Suppose that the sum of the uncertainties superposition is bounded:  
\[|\Delta|\leq\delta,\delta\in R^{+} \tag{21}\]  
First, we can define the system tracking error \(e=\dot{S}-\dot{S}_{d}\) and its derivative \(\dot{e}=\ddot{S}-\ddot{S}_{d}\). Transferring them to Equation (19), we can obtain:  
\[\dot{e}=-\ddot{S}_{d}+f_{1n}\big{(}e+\dot{S}_{d}\big{)}^{2}+f_{2n}\big{(}e+ \dot{S}_{d}\big{)}+G_{n}U+\Delta \tag{22}\]  
Define \(s=e\) as the sliding surface function, then \(s=e\). For the linear and the nonlinear part of the system dynamics equation, the sliding mode control quantity is divided into two parts [24,25]: one is the equivalent control quantity of the first approximation system, and the other is the robust control quantity to deal with the nonlinear term [26,27]. \[U_{s}=U_{eq}+U_{hit} \tag{23}\]  
The equivalent control quantity of the first approximation system is obtained. \[ \begin{array}{ll}U_{eq}&=K_{\infty}^{-1}A\bigg{[}\ddot{S}_{d}+BA^{-1}\big{(} e+\dot{S}_{d}\big{)}^{2}+CA^{-1}\big{(}e+\dot{S}_{d}\big{)}\bigg{]}\\ &=K_{\infty}^{-1}\bigg{[}A\ddot{S}_{d}+B\Big{(}e+\dot{S}_{d}\big{)}^{2}+C\big{(} e+\dot{S}_{d}\big{)}\bigg{]}\end{array}  \tag{24}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Training Stage** & **State of Consciousness** & **Joint Torque \(T\)** & **Pedal Speed \(\dot{S}\)** & **Pedal Acceleration \(\ddot{S}\)** \\ \hline A & Stretching leg & \(T_{train}\) & \(0\to v_{d}\) & \(\frac{f_{max}-v_{d}}{m^{*}}\) \\ B & Stretching leg & \(T_{train}\) & \(v_{d}\) & \(0\) \\ C & Curved leg & \(T_{test}\) & \(v_{d}\to 0\) & \(\frac{f_{max}-v_{d}}{m^{*}}\) \\ D & Curved leg & \(T_{test}\) & \(0\to v_{m}\) & \(\frac{f_{max}-v_{d}}{m^{*}}\) \\ E & Curved leg & \(T_{test}\) & \(v_{m}\) & \(0\) \\ F & Stretching leg & \(T_{train}\) & \(v_{m}\to 0\) & \(\frac{f_{max}-v_{d}}{m^{*}}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Analysis of different training stages. The nonlinear control quantity is obtained. \[U_{hit}=-K_{ce}^{-1}A(\delta+\sigma)\text{sgn}(s) \tag{25}\]  
where \(\sigma\) is a real number greater than zero. Therefore, the sliding mode control of resistance training can be rewritten as the following:  
\[U_{s}=K_{ce}^{-1}\left[ \begin{array}{c}A\Big{(}\hat{S}_{d}-(\delta+\sigma) \text{sgn}(e)\Big{)}\\ +B\Big{(}e+\hat{S}_{d}\Big{)}^{2}+C\Big{(}e+\hat{S}_{d}\Big{)}\end{array} \right] \tag{26}\]  
In the equation, the switching function is composed of the system disturbance boundary \(\delta\) and the robust coefficient \(\sigma\). Both of these are fixed values.