## 4 Design of the Controller
### Design of the Position Controller  
Many researchers have studied control algorithms for EHSSs. In a previous study [28], a two-loop control structure of a position-pressure master-slave controller in a rolling shear hydraulic system was studied. However, the nonlinear characteristics of the system were not considered in the design process of the controller. The DSC algorithm can handle nonlinear problems [29; 30; 31; 32]. However, a first-order filter used in the DSC limits the performance of the controller. In this section (Section 4.2), based on NDO and TDDSC control methods, a position controller was designed. An NDO was used to observe the disturbance in the system. The first-order filter of the NDO was replaced by a TD, which has a better performance than the first-order filter used in the DSC [33]. The TD used in this paper is expressed using Equation (19):  
\[\left\{ \begin{array}{l}\dot{x}_{1}=x_{2}\\ \dot{x}_{2}=R^{2}\bigg{\{}-a_{1}\arctan(f_{1}(x_{1}-v)-a_{2}\arctan(\frac{f_{ 2}x_{2}}{R})\bigg{\}}\end{array} \right., \tag{19}\]  
where \(v\) is the input, \(x_{1}\) is the tracking output of \(v\) and \(x_{2}\) is the tracking output of the derivation of \(v\); \(R\), \(a_{1}\), and \(f_{1}\) are the gain of TD, and they are positive, which determine the tracking speed of TD; \(a_{2}\) and \(f_{2}\) determine the differentiation effect of the TD. The detailed parameter-tuning method was described in the literature [33]. The design of the position controller is divided into three steps using the TDDSC method. In this paper, symbol'-represents the estimate of a variable, symbol represents the estimate error of a variable. For example, \(A\) is a variable, \(\hat{A}\) is used to denote the estimate of \(A\), whereas \(\overline{A}\) is used to represent the error in the estimate of \(A\), which means the relationship: \(\overline{A}=A-\hat{A}\). The error state variables are defined using Equation (20):  
\[\left\{ \begin{array}{l}e_{1}=x_{i1}-x_{d}\\ e_{2}=x_{i2}-\alpha_{1}\\ e_{3}=x_{i3}-\alpha_{2}\end{array} \right., \tag{20}\]  
where \(\alpha_{1}\) and \(\alpha_{2}\) are the virtual control variables. **Step 1:**  
The first error surface \(e_{1}\) is defined using Equation (21):  
\[e_{1}=x_{i1}-x_{d}. \tag{21}\]  
The derivative of Equation (21) is given by Equation (22):  
\[\dot{e}_{1}=\dot{x}_{i1}-\dot{x}_{d}=x_{i2}-\dot{x}_{d}. \tag{22}\]Furthermore, the virtual control variable \(\alpha_{1}\) is given by Equation (23):  
\[\alpha_{1}=-k_{1}e_{1}+\dot{x}_{d}, \tag{23}\]  
where \(k_{1}\) is the controller gain and \(k_{1}>0\). When the Lyapunov function is expressed as \(V_{1}=\frac{1}{2}e_{1}^{2}\), Equation (24) is obtained and shown as following:  
\[\dot{V}_{1}=e_{1}\dot{e}_{1}=e_{1}(e_{2}+\alpha_{1}-\dot{x}_{d})=-k_{1}e_{1}^{ 2}+e_{1}e_{2}. \tag{24}\]  
As long as \(e_{2}\) converges to \(0\) and \(k_{1}>0\), it can be guaranteed that \(\dot{V}_{1}<0\). Therefore, step 2 is needed. **Step 2:**  
The second error surface \(e_{2}\) is defined using Equation (25):  
\[e_{2}=x_{i2}-\alpha_{1}. \tag{25}\]  
The derivative of \(e_{2}\) is given by Equation (26):  
\[\dot{e}_{2}=\dot{x}_{i2}-\dot{\alpha}_{1}=c_{1}x_{3}+c_{2}x_{i2}+\theta_{i2}+ \delta_{2}-\dot{\alpha}_{1}, \tag{26}\]  
where \(\dot{\alpha}_{1}\) is obtained using the TD, which is given by Equation (19). In order to estimate \(\theta_{i2}\), the following NDO is designed (Equation (27)):  
\[\left\{ \begin{array}{l}\dot{\theta}_{i2}=\sigma_{2}+\eta_{i2}x_{i2}\\ \dot{\sigma}_{i2}=-\eta_{i2}\sigma_{i2}-\eta_{i2}(c_{1}x_{i3}+c_{2}x_{i2}+ \delta_{i2}+\eta_{i2}x_{i2})\end{array} \right., \tag{27}\]  
where \(\eta_{i2}\) is the observer gain (\(\eta_{i2}>0\)), which is related to the convergence speed of the NDO, and \(\sigma_{i2}\) is the internal variable.