## 2 Materials Furthermore, Methods
### Quasi-Continuous Sliding Mode Control  
QC-SMC belongs to the HOSMC, known for the robustness and performance in tracking precision; moreover, the chattering reduction is another advantage of this controller over other structures [32]. The control law that we settled as Equation (5) comprises of the terms \(u_{ann}\) and \(u_{sw}\)0, which, respectively, aim to compensate the non-linearities (such as the hysteresis) and counteract uncertainties or perturbations The definition of \(u_{sw}\) is defined in Equation (6), which is dependant on a sliding surface expressed by Equation (7) and where parameters \(\lambda\) and \(\gamma\) are positively defined by the designer. The term \(u_{ann}\) is dependant on the ANN compensation, and further details are given in the following section.  
\[u=u_{ann}+u_{sw} \tag{5}\]  
\[u_{sw}=-\gamma\frac{\dot{s}+|s|^{1/2}sign(\dot{s})}{|\dot{s}|+|s|^{1/2}} \tag{6}\]  
\[s=e+\lambda\int_{0}^{t}\!edt \tag{7}\]  
Neural Network Compensation Design  
The implementation of conventional SMC methods, where the equivalent term has to be through a mathematical model, can yield to a insufficient compensation or even increase  
Figure 3: Control schemes used where (**a**) is the proposed QCSMC-ANN and (**b**) is the contrasted PID.  
the computational cost. Nevertheless, in recent years, ANNs have been a suitable solution for system identification. The only drawback is the time that the training algorithm requires to develop a truthful output. Hence, we used a time-delay neural network (TDNN) due to the efficiency related to training time versus accuracy obtained.  
In former investigations, we tested TDNN structures to reduce hysteresis, which showed proper results in combination with conventional controllers [33]. As the name states, a TDNN is an extension of a classic multilayer perceptron (MLP) that works with time signals. The inclusion of time delays \(n\) allows the neurons to get further information about the time history of the input; this implies that the ANN will fit to a time set pattern [34]. Mathematically, this is expressed with Equation (8), where f is a non-linear function that relates the input/output of the ANN. An schematic explanation is provide in Figure 4.  
\[u_{ann}=f\Big{(}x(t),x(t-1),x(t-2),\ldots,x(t-n)\Big{)} \tag{8}\]  
A further expansion of the function \(f\) is as the following Equations (9)-(12): the retarded reference inputs \(r(t-n)\) are weighted with parameters \(W_{i}\) and bias \(b_{i}\); later, this operation yields into the activation function called _tansig_. The output \(q(t)\), which is the outcome of the described operation, is employed as an input into the output layer. In this case, the procedure is similar as previously, but the activation is done with a linear transfer function called _purelin_. Subsequently, the output of this layer provides the compensation voltage \(u_{ann}\).  
\[q(t)=tansig\Bigg{(}\sum_{p=0}^{n}W_{i}\cdot r(t-n)+b_{i}\Bigg{)} \tag{9}\]  
\[tansig(x)=\frac{2}{1+e^{-2x}}-1. \tag{10}\]  
\[u_{ann}=purelin[W_{i}q(t)+b_{i}], \tag{11}\]  
\[purelin(x)=x. \tag{12}\]  
The calculation of the weights and bias, related to the previous explained relations, are achieved with training algorithms. In this case, we used Levenberg-Marquardt, which represents a method that guarantees the fitting of the ANN to the experimental data through an adaptive behaviour [35]. This mechanism is generated by finding the location of the minimum of a cost function is declared as the sum of square errors and the real measurements within an iterative updating.