# Discrete-Time Sliding Mode Filter with Adaptive Gain
## 2 Overview of Related Works  
### Parabolic Sliding Mode Filters  
In a paper [20], [PERSON] et al. proposed a model-free sliding mode filter employing a parabolic-shaped sliding surface (PSMF), of which continuous-time representation is given as follows:  
\[\dot{x}_{1} =x_{2}, \tag{1a}\] \[\dot{x}_{2} \in-\frac{F(H+1)}{2}\text{sgn}(\sigma(F,u,x_{1},x_{2}))-\frac{F(H- 1)}{2}\text{sgn}(x_{2}), \tag{1b}\]  
where  
\[\sigma(F,u,x_{1},x_{2})\triangleq 2F(x_{1}-u)+|x_{2}|x_{2}. \tag{2}\]  
Here, \(u\in\mathbb{R}\) is the input, \(x_{1}\in\mathbb{R}\) is the output, \(x_{2}\in\mathbb{R}\) is the derivative of \(x_{1}\), and \(F>0\) and \(H>1\) are parameters. In addition, \(\text{sgn}()\) is the set-valued signum function defined as follows:  
\[\text{sgn}(z)\triangleq \begin{cases}1&\text{if }z>0,\\ -1,1&\text{if }z=0,\\ -1&\text{if }z<0,\end{cases}  \tag{3}\]  
where the argument \(z\in\mathbb{R}\) is a scalar. It should be noted that the return value of \(\text{sgn}()\) is a set instead of zero when \(z=0\). In PSMF, \(\dot{x}_{2}\) can be considered as the _acceleration_ of the output \(x_{1}\), and \(F\) can be seen as the gain of the _acceleration_. Figure 1 illustrates the parabolic-shaped sliding surface (thick curve) and the trajectories of the state \((x_{1},x_{2})\) (thin curves) of PSMF in \(x_{1}\)-\(x_{2}\) space. In PSMF, when \(\sigma x_{2}<0\) and \(\sigma x_{2}>0\), \(\dot{x}_{2}\) satisfies \(\dot{x}_{2}=|F|\) and \(\dot{x}_{2}=|HF|\), respectively. And thus, the state \((x_{1},x_{2})\) moves toward to the parabolic sliding surface in \(x_{1}\)-\(x_{2}\) space. Here, it should be mentioned that, in the case of \(\sigma x_{2}>0\) with \(H=1\) (i.e., the filter [12; 13]), the state moves parallel to the sliding surface, i.e., the state cannot reach the sliding surface in the regions of \(\sigma x_{2}>0\), resulting in overshoot during the convergence. After the state  
reaches the sliding surface, i.e., \(\sigma=0\), the state is constrained on the surface and it moves along the surface to the target state \((u,0)\). It may be worth noticing that such a behavior of PSMF is similar to that of a system under a bang-bang controller. The paper [20] also presented a discrete-time algorithm of PSMF, which is analytically derived by using the backward Euler discretization (i.e., by replacing \(x_{2}\) by \((x_{1}(k)-x_{1}(k-1))/T\)) and the following equivalent relation [20]:  
\[z-y\in\tfrac{b+a}{2}\text{sgn}(x-z)+\tfrac{b-a}{2}\text{sgn}(-z) \Longleftrightarrow z-y=\text{clip}(\text{clip}(-b,-a,-y),\text{clip}(a,b,-y),x-y), \tag{4}\]  
where \(a\in\mathbb{R}\) and \(b\in\mathbb{R}\) satisfy \(a\leq b\), and \(\text{clip}()\) is the function defined as follows:  
\[\text{clip}(a,b,z)\triangleq \begin{cases}b&\text{if }z>b,\\ z&\text{if }z\in[a,b],\\ a&\text{if }z<a.\end{cases}  \tag{5}\]  
Specifically, the complete algorithm of PSMF is as follows (see [20] for detailed derivation):  
```
1:\(x_{2}^{*}:=FT\,\Phi\Big{(}\dfrac{u(k)-x_{1}(k-1)}{FT^{2}}\Big{)}\)
2:\(x_{2}(k):=\text{clip}(\text{clip}(x_{2}(k-1)-HFT,x_{2}(k-1)-FT,0),\) \(\text{clip}(x_{2}(k-1)+FT,x_{2}(k-1)+FTH,0),x_{2}^{*})\)
3:\(x_{1}(k):=x_{1}(k-1)+Tx_{2}(k)\)
4:RETURN\(x_{1}(k)\). ```  
**Algorithm 1** PSMF  
Figure 1: The parabolic-shaped sliding surface (thick curve) and trajectories of the state of parabolic sliding mode filter (PSMF) (thin curve). Here, \(T\) is the sampling interval, \(k\) is the discrete-time index, and \(\Phi()\) is the function defined as follows:  
\[\Phi(z)\triangleq\text{sgn}(z)\Big{(}\sqrt{1+2|z|}-1\Big{)}. \tag{6}\]  
In Algorithm 1, \(x_{2}^{*}(k)\) is the value of \(x_{2}(k)\) that satisfies \(\sigma(k)=0\), and \(x_{2}(k)\) is determined in order to follow \(x_{2}^{*}(k)\) under the constraint of _acceleration_, as shown in Figure 2.  
Figure 3 shows the block diagram of the discrete-time algorithm of PSMF. One can observe that, due to the use of the backward Euler discretization and the equivalent relation (4), the algorithm is free from discontinuous functions.