# Discrete-Time Sliding Mode Filter with Adaptive Gain
## 5 Experimental Evaluation  
This section validates the effectiveness of AG-PSMF in position control. For comparison, the performances of position controls without filter and with PSMF were also evaluated. Figure 11 shows the experimental setup, which consisted of a DC motor with an optical encoder, a 16-bit motor controller and a motor driver. In the case of without a filter, the following discrete-time proportional-derivative (PD) controller was used:  
\[v(k)=K_{\text{P}}(\theta_{\text{d}}(k)-\theta(k))+K_{\text{d}}( \omega_{\text{d}}(k)-\omega(k)), \tag{10}\]  
whereas the following discrete-time PD controller was employed for the cases of PSMF and AG-PSMF:  
\[v(k)=K_{\text{P}}(\theta_{\text{d}}(k)-\theta_{\text{f}}(k))+K_{ \text{d}}(\omega_{\text{d}}(k)-\omega_{\text{f}}(k)). \tag{11}\]  
Here, \(\theta_{\text{d}}(k)\) is the desired trajectory, \(\theta(k)\) is the current position, \(\omega_{\text{d}}(k)\) is the desired velocity, \(\omega(k)\) is the current velocity, \(v(k)\) is the control voltage, \(K_{\text{P}}>0\) is the proportional gain, and \(K_{\text{d}}>0\) is the derivative gain. In addition, in the cases of PSMF and AG-PSMF, \(\theta_{\text{f}}(k)\) is the estimated position, and \(\omega_{\text{f}}(k)\) is the estimated velocity. Figure 12 shows the block diagrams of the PD-controlled systems used in the experiments. It should be noted that velocity signals were obtained by using the finite difference method. All experiments were implemented at sampling interval \(T=0.001\) s.  
Figure 13 shows the PD-controlled results with the following desired trajectory:  
\[\theta_{\text{d}}(k)= \begin{cases}90\text{sin}(3 kT)\text{ degree }&\text{if }kT\leq 6\text{ s},\\ 180\text{sin}(3 kT)\text{ degree }&\text{otherwise}.\end{cases}  \tag{12}\]  
In addition, Figure 14 illustrates the quantized position control performances through the data of the average magnitude of position error \(|\theta_{\text{d}}-\theta|\) and the average magnitude of duty ratio (normalized control voltage \(v\)) change rate \(|\dot{d}|\), which are respectively defined as follows:  
\[\text{AMP}\triangleq\frac{1}{11000-1000}\sum_{k=1000}^{11000}| \theta_{\text{d}}(k)-\theta(k)|, \tag{13}\] \[\text{AMD}\triangleq\frac{1}{11000-1000}\sum_{k=1000}^{11000} \Big{|}\frac{d(k)-d(k-1)}{T}\Big{|}. \tag{14}\]  
Figure 11: Experimental setup. It should be mentioned that the measure AMP provides information on the controlled position, while AMD can be considered as a measure of the intensity of high-frequency vibration of the device. It should be said that, for a better position control, both AMP and AMD should be kept small. In the figures, one can observe that the controller (10) produced the highest AMD among the three cases. This is because finite difference produced high-frequency noise in the velocity signal by magnifying quantized encoder error contained in the position signal. As a result, there was high-frequency vibration in the device. On the other hand, the controller (11) with PSMF avoided high-frequency vibration during the period of \(0\leq t\leq 6\) s owing to the smoothed position signal. However, it resulted in instability of the device after \(t>6\) s because of the fact that, the output of PSMF cannot follow the fast varying input signal with limited _acceleration_. Compared with the above-mentioned two control schemes, the controller (11) with AG-PSMF simultaneously reduced AMP and AMD, i.e., the controlled position followed the desired trajectory effectively without producing high-frequency vibration. These results clearly show the advantage of AG-PSMF. Figure 12: Block diagrams of PD-controlled systems. (**a**) without filter; (**b**) with PSMF; and (**c**) with AG-PSMF. Figure 14: Position control performances achieved with \(K_{p}=100\), \(K_{d}=10\) and \(T=0.001\). (**a**) without filter (**b**) with PSMF (\(F=1000\), \(H=5\)), and (**c**) with AG-PSMF (\(F=1000\), \(H=5\), \(N_{\text{max}}=10\), \(N_{\text{c}}=5\), \(R=0.00008\)). Figure 13: Results of PD control with \(K_{p}=100\), \(K_{d}=10\) and \(T=0.001\).