# Development and Control of an Electro-Hydraulic Actuator System for an Exoskeleton Robot
## 5 The Position and Force Control Experiments  
### Design of the Sliding Mode Control  
In order to apply a sliding mode control to the EHA system, the nonlinear dynamic system is defined as follows:  
\[x^{(n)}=f(\mathbf{x})+b(\mathbf{x})u, \tag{20}\]  
where the scalar \(x\) is the output of interest, the scalar \(\mathbf{u}\) is the control input, and \(\mathbf{x}=\left[ \begin{array}{ccc}x&\dot{x}&\ldots&x^{(n-1)}\end{array}  \right]^{T}\) is the state vector. One of the typical methods for a nonlinear system is sliding mode control. First, a sliding surface is defined, and the state (\(\mathbf{x}\)) slides along the surface of the desired state (\(\mathbf{x_{d}}\)). Once on the sliding surface, \(\mathbf{s}\) (\(\mathbf{t}\)) = 0 is satisfied and the desired state is maintained. For the nonlinear control of the EHA system, the sliding surface can be defined as [30]:  
\[ \begin{array}{ll}s(\mathbf{x},t)&=\left(\frac{d}{dt}+\lambda\right)^{n-1} \overline{x}\\ &=c_{1}e_{1}+c_{2}\frac{d}{dt}c_{2}+\cdots+c_{n}\frac{d^{n-1}}{dt^{n-1}}e_{n} \end{array} , \tag{21}\]  
where, \(e=\overline{x}=x-x_{d}\) is the tracking error, and \(\lambda\) and \(c\) are the positive constants. In this study, because the position, velocity, and acceleration of the single rod of the EHA system should be tracked, \(n\) is set to 3, and the sliding surface is defined as follows:  
\[s=c_{1}e+c_{2}\dot{e}+\ddot{e}. \tag{22}\]  
For \(s\to 0\) to occur, the Lyapunov function \(V\) is set to \(V=\frac{1}{2}s^{2}\), and when \(\dot{V}=s\dot{s}\leq 0\), the current state does not deviate from the sliding surface. The control input \(u\) consists of the equivalent control input \(u_{eq}\) for entering the sliding surface and the switching control input \(\mathrm{sgn}(s)\) for not going out of the surface at the sliding surface (\(s=0\)). However, the function \(\mathrm{sgn}(s)\), which is the nonlinear function, generates chattering because of the discontinuous response. To avoid this, we replaced it with a saturation function. So, the control input is  
\[u=u_{eq}-K_{s}\cdot sat(s),\ sat(s)=\left\{ \begin{array}{cc}s,&|s|<1\\ \mathrm{sgn}(s),&|s|\geq 1\end{array} \right.. \tag{23}\]  
Assuming that the cylinder rod moves forward, the equation differentiating Equation (16) can be rearranged with respect to time for \(\mathbf{x}\) as follows:  
\[\dddot{x}=\frac{1}{M}\left(A\dot{P}-B\ddot{x}-\frac{dF_{d}}{dt}\right). \tag{24}\]  
By substituting Equation (13) in Equation (24), we can obtain Equation (25):  
\[\dddot{x}=-\frac{B}{M}\ddot{x}-\frac{2A^{2}\beta}{MV}\dot{x}+\frac{2A\beta}{MV }D\omega-\frac{2A\beta}{MV}C_{ip}P+d. \tag{25}\]  
Figure 8: The block diagram of the entire system. If \(\omega\) in this equation is replaced by \(u\), and summarized as \(\frac{2A\beta}{MV}\), then the equation is as follows:  
\[\dddot{\vec{x}}=-\frac{B}{M}\ddot{\vec{x}}-\frac{2A^{2}\beta}{MV}\dot{x}+\frac{ 2A\beta}{MV}D(u-d_{e}), \tag{26}\]  
where, \(d_{e}\) includes the disturbance \(d\), volumetric elastic modulus, area, volume, and so on. \[\dot{s}=c_{1}\dot{e}+c_{2}\ddot{e}+\dddot{e}=0, \tag{27}\]  
where the control input \(u\) satisfying Equation (26) is the equivalent control input \(u_{eq}\). It can be obtained through Equations (26) and (27). \[\dot{s} =c_{1}\dot{e}+c_{2}\ddot{e}+\dddot{e} \tag{28}\] \[=c_{1}\left(\ddot{x}_{d}-\dot{x}\right)+c_{2}\left(\ddot{x}_{d}- \ddot{x}\right)+\frac{2A^{2}\beta}{MV}\dot{x}+\frac{B}{M}\ddot{x}-\frac{2A \beta D}{MV}u_{eq}+\frac{2A\beta D}{MV}d_{e}+\dddot{x}_{d}=0\] \[u_{eq}=\frac{MV}{2A\beta D}\left\{\left(\frac{2A^{2}\beta}{MV}+c _{1}\right)\ddot{x}+\left(\frac{B}{M}+c_{2}\right)\ddot{x}+d_{e}-c_{1}\dot{x }_{d}-c_{2}\ddot{x}_{d}+\dddot{x}_{d}\right\}, \tag{29}\]  
where \(d_{e}\) is the disturbance that cannot actually be measured and is set by \(K_{p}\times e\) because the state value must go into the sliding surface.