# Enhanced Discrete-Time Sliding Mode Filter for Removing Noise

Authors: Shanhai Jin; Xiaodan Wang; Yonggao Jin; Xiaogang Xiong
Journal: Mathematical Problems in Engineering
 (2017)

---

## Abstract

This paper presents a new discrete-time sliding mode filter for effectively removing noise in control of mechatronic systems. The presented filter is an enhanced version of a sliding mode filter by employing an adaptive gain in determining a virtual desiredvelocity of the output. Owing to the use of backward Euler discretization, the discrete-time implementation of the filter does not produce chattering, which has been considered as a common problem of sliding mode techniques. Besides that, the state of the filter converges to the desired state in finite time. Numerical example and experimental position control of a mechatronic system are conducted for validating the effectiveness of the filter.


---

## Body

## 1. Introduction

In mechatronic control systems, sensor signals are usually noisy and uncertain due to measurement errors and environmental disturbances. Linear filters are often applied for attenuating noise due to simplicity. However, in linear filters, a strong noise attenuation results in a large phase lag, which may lead to system’s instability. In addition, any noise component is proportionally transferred into the output, and thus high-amplitude noise cannot be effectively removed.Nonlinear filters have been studied so as to avoid disadvantages of linear filters. Among them, sliding mode observers [1–3] based on the supertwisting algorithm [4, 5] have attracted much attention in the last decade. One major advantage of these observers is that they realize finite-time convergence in continuous-time analysis. However, in the case of numerical implementation, the performance of convergence is related to the sampling period, typically with finite difference [6, 7]. Besides that, they require a dynamic model, which is not always exactly obtained.A sliding mode filter that uses a parabolic-shaped sliding surface has been studied [8, 9]. This filter realizes finite-time convergence in the case of constant input. In addition, it does not require a dynamic model. However, its discrete-time implementation [10, 11] is prone to overshoot and sensitive to the sampling period, as pointed out in [12]. Toward the disadvantages of the filter [8, 9], Jin et al. [12] proposed a parabolic sliding mode filter (PSMF-J) for effectively removing noise. It is reported [13] that PSMF-J has similar gain characteristics to that of the second-order Butterworth low-pass filter (2-LPF), but it produces smaller phase lag than 2-LPF does. In addition, compared with the filter [8, 9], PSMF-J is less prone to overshoot, and it does not produce chattering, which has been considered as a common problem of sliding mode techniques. The effectiveness of PSMF-J has been experimentally validated [12–14].Extension studies of PSMF-J are reported in the literature. For example, Aung et al. [15] presented three variants of PSMF-J by including the derivative term of the input to the sliding surfaces. As another example, Jin et al. [16, 17] proposed filtering systems that integrate a first-order adaptive windowing filter (FOAW) and PSMF-J, and Aung et al. [15] reported a filtering strategy that combines a low-pass filter (LPF) and a variant of PSMF-J.This paper presents a new discrete-time sliding mode filter, which is an enhanced version of PSMF-J. The presented filter employs an adaptive gain in determining a virtual desiredvelocity of the output. Discrete-time implementation of the filter does not produce chattering. Moreover, the state of the filter converges to the desired state in finite time. Results of numerical and experimental evaluations validate the effectiveness of the presented filter. It should be mentioned here that the paper only considers single-stage filtering approach, and thus combination strategies of multifilter, for example, FOAW-integrated [16, 17] and LPF-integrated [15] methods, are not included in the paper. Besides that, the paper mainly focuses on noise attenuation in mechatronic systems, and thus potential applications of the presented filter to other areas are considered outside the scope of this study.The rest of this paper is organized as follows: Section2 provides some mathematical preliminaries to be used in subsequent sections; Section 3 gives an overview of parabolic sliding mode filters; Section 4 presents an enhanced version of PSMF-J, and Section 5 provides frequency domain characteristics of the new filter; Sections 6 and 7 validate the effectiveness of the presented filter numerically and experimentally, respectively; and Section 8 concludes the paper.


## 2. Mathematical Preliminaries

In this paper, the following definitions of the set-valued signum functionsgn⁡(·) and the generalized saturation function clip⁡(·) will be used:(1)sgn⁡z≜1ifz>0-1,1ifz=0-1ifz<0,(2)clip⁡a,b,z≜bifz>bzifz∈a,baifz<a,where a∈R and b∈R satisfy a≤b. Here, it should be noted that, when z=0, the return value of sgn(·) is a set instead of a single value. Moreover, in the case of a=-1 and b=1, clip⁡(·) reduces to the conventional saturation function. Figures 1(a) and 1(b) illustrate the behaviors of sgn(·) and clip(·), respectively.Figure 1
Behaviors of the set-valued signum functionsgn⁡(⋅) and the generalized saturation function clip⁡(⋅).
(a)
(b)In addition, the following equivalent [12, 16, 18] will be applied in the next section:(3)z-y∈b+a2sgn⁡x-z+b-a2sgn⁡-z⟺z-y=clip⁡clip⁡-b,-a,-y,clip⁡a,b,-y,x-y.


## 3. Overview of Parabolic Sliding Mode Filter

In a paper [12], Jin et al. presented a sliding mode filter that employs a certain kind of parabolic-shaped sliding surface (PSMF-J). The continuous-time representation of PSMF-J can be written as follows:(4)x˙1=x2,x˙2∈-FH+12sgn⁡σF,u,x1,x2-FH-12sgn⁡x2,where(5)σF,u,x1,x2≜2Fx1-u+x2x2.Here, u∈R and x1∈R are the input and output, respectively, x2∈R is the derivative of x1, and F>0 and H>1 are constants.In PSMF-J,x˙2 can be considered as the output x1’sacceleration, of which value is bounded by HF. Besides that, PSMF-J reduces to a filter reported in [8, 9] with H=1. Figure 2 illustrates the sliding surfaces and the trajectories of the state (x1,x2) of PSMF-J in x1-x2 space, and Figure 3 shows the relation among x1, x2, and x˙2. Note that PSMF-J has two sliding surfaces that are σ=0 and x2=0, respectively.Figure 2
Parabolic-shaped sliding surfaces (thick curves) and trajectories of the state(x1,x2) (thin curves) of PMSF-J.Figure 3
Relation amongx1, x2, and x˙2 in PSMF-J.The paper [12] also presented a discrete-time algorithm of PSMF-J, which is derived based on the backward Euler discretization. Specifically, the following is the derivation procedure of the discrete-time algorithm. First, by using the backward Euler discretization, the continuous-time expressions (4) can be approximated in discrete-time as follows:(6a)x1k-x1k-1T=x2k,(6b)x2k-x2k-1T=-FH+12sgn⁡σk-FH-12sgn⁡x2k,where(7)σk=2Fx1k-uk+x2kx2k.Here, k is the discrete-time index and T is the sampling period. By using (6a), (7) can be rewritten as follows:(8)σk=x2kx2k+2FTx2k+2Fx1k-1-uk.Then, because (8) is a monotonously increasing function with respect to x2(k), (6b) can be rewritten as follows:(9)x2k-x2k-1T=-FH+12sgn⁡x2k-x2∗k-FH-12sgn⁡x2k.Here, x2∗(k) is the value of x2(k) that satisfies σ(k)=0, and it is obtained through a tedious but straightforward derivation as follows:(10)x2∗k=FTΦuk-x1k-1FT2,where(11)Φz≜sgn⁡z1+2z-1.Figure 4 shows relation between x2(k), x2∗(k), and σ(k)=0. Then, by applying the equivalent relation (3), unknown x2(k) can be moved out from right-hand side of (9) as follows:(12)x2k=clip⁡clip⁡x2k-1-HFT,x2k-1-FT,0,clip⁡x2k-1+FT,x2k-1+HFT,0,x2∗k.Figure 4
Relation betweenx2(k), x2∗(k), and σ(k)=0.As a whole, the complete algorithm of PSMF-J is as follows.Algorithm 1 (PSMF-J).
(1)
x
2
∗
k
≔
F
T
Φ
(
u
k
-
x
1
k
-
1
)
/
F
T
2
(2)
x
R
(
k
)
≔
clip
⁡
x
2
k
-
1
-
H
F
T
,
x
2
k
-
1
-
F
T
,
0
(3)
x
L
(
k
)
≔
clip
⁡
x
2
k
-
1
+
F
T
,
x
2
k
-
1
+
H
F
T
,
0
(4)
x
2
(
k
)
≔
clip
⁡
x
R
,
x
L
,
x
2
∗
k
(5)
x
1
(
k
)
≔
x
1
(
k
-
1
)
+
T
x
2
k
(6)
R
E
T
U
R
N
x
1
(
k
).In Algorithm1, x2(k) is determined so as to follow x2∗(k), which in turn tracks the derivative of the signal component of input u(k), under the constraint ofacceleration, and then the output x1(k) is obtained by integrating x2(k).Owing to the use of the backward Euler discretization, the numerical implementation of PSMF-J does not produce chattering, which has been considered as a common problem of sliding mode techniques. Besides that, the output of PSMF-J converges to the input in finite time. Figure5 compares backward Euler- (BE-) based and forward Euler- (FE-) based discrete-time algorithms of PSMF-J. It is shown that FE-based method produces chattering in the output, and the magnitude of chattering is related to the sampling period. On the other hand, BE-based method realizes finite convergence of the output to the input, and it does not produce chattering. Such a way of realizing chattering avoidance and finite-time convergence of sliding mode technique by using the backward Euler discretization is also reported in [19, 20]. The stability of (4) under a constant input, that is, u˙=0, is theoretically validated [16].Figure 5
Comparison of discrete-time algorithms of PSMF-J: backward Euler-based versus forward Euler-based (F=250, H=5, and T=0.001 s).In [15], Aung et al. presented three variants of PSMF-J by including the derivative term of the input to the sliding surfaces to aim for improving tracking response. Specifically, the algorithms of the three variants, which are denoted as PSMF-A1, PSMF-A2, and PSMF-A3, respectively, are as follows.Algorithm 2 (PSMF-A1,2,3).
(1)
w
(
k
)
=
(
u
k
-
u
k
-
1
)
/
T
(2)
PSMF-A1:
x
2
∗
(
k
)
≔
F
T
Φ
(
(
u
(
k
)
-
x
1
(
k
-
1
)
)
/
F
T
2
)
PSMF-A2,3:
x
2
∗
(
k
)
≔
F
T
Φ
(
(
u
(
k
)
-
x
1
(
k
-
1
)
)
/
F
T
2
)
+
w
(
k
)
(3)
PSMF-A1,3:
x
R
(
k
)
≔
clip
⁡
x
2
k
-
1
-
H
F
T
,
x
2
k
-
1
-
F
T
,
w
k
PSMF-A-2:
x
R
(
k
)
≔
clip
⁡
x
2
k
-
1
-
H
F
T
,
x
2
k
-
1
-
F
T
,
0
(4)
PSMF-A1,3:
x
L
k
≔
clip
⁡
x
2
k
-
1
+
F
T
,
x
2
k
-
1
+
H
F
T
,
w
k
PSMF-A2:
x
L
(
k
)
≔
clip
⁡
x
2
k
-
1
+
F
T
,
x
2
k
-
1
+
H
F
T
,
0
(5)
x
2
(
k
)
≔
clip
⁡
x
R
,
x
L
,
x
2
∗
k
(6)
x
1
k
≔
x
1
k
-
1
+
T
x
2
k
(7)
R
E
T
U
R
N
x
1
(
k
).In the following sections, performance of a new parabolic sliding mode filter will be compared with those of PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3.


## 4. Enhanced Discrete-Time Parabolic Sliding Mode Filter

This section proposes a new discrete-time sliding mode filter, which is an enhanced version of PSMF-J.First, let us consider the influence ofx2∗(k) in Algorithm 1. It has been discussed in Section 3 that x2∗(k) is the value of x2(k) that satisfies σ(k)=0, and it follows the derivative of the signal component of input u(k). On the other hand, x2(k) is determined so as to follow x2∗(k) under the constraint ofacceleration. This means, state (x1(k),x2∗(k)) can be considered as a virtual desired state of (x1(k),x2(k)) in the context of tracking the desired state, that is, signal component of input u(k) and its derivative. It is well recognized that, in the case where the current state is far from the desired state, the value of x2(k) should be set large for realizing rapid convergence. On the other hand, in the case where the current state is around the desired state, the value of x2(k) should be set small for obtaining smooth output. In the light of this consideration, a variant of PSMF-J, which is referred to as enhanced parabolic sliding mode filter (PMSF-E), can be obtained as follows.Algorithm 3 (PSMF-E).
(1)
x
M
(
k
)
≔
F
T
Φ
u
k
-
x
1
k
-
1
/
F
T
2
(2)
x
2
∗
(
k
)
≔
x
M
(
k
)
x
M
k
/
R
α
(3)
x
R
(
k
)
≔
clip
⁡
x
2
k
-
1
-
H
F
T
,
x
2
k
-
1
-
F
T
,
0
(4)
x
L
(
k
)
≔
clip
⁡
x
2
k
-
1
+
F
T
,
x
2
k
-
1
+
H
F
T
,
0
(5)
x
2
(
k
)
≔
clip
⁡
x
R
,
x
L
,
x
2
∗
k
(6)
x
1
(
k
)
≔
x
1
k
-
1
+
T
x
2
(
k
)
(7)
R
E
T
U
R
N
x
1
(
k
),where α>0 and R>0 are constants.In step(2) of Algorithm 3, an adaptive gain, of which value is determined by a power function, is involved in obtaining the virtual desired value x2∗(k) of x2(k). Figure 6 shows the effect of the exponent. It should be noted that, in the case of α=0, PSMF-E reduces to PSMF-J. In PSMF-E, one can observe that the value of the coefficient is larger than that of PSMF-J when |xM(k)|>R, while it is smaller when |xM(k)|<R. Then, in steps (3)–(5), x2(k) is determined in order to follow x2∗(k), and, after that, x1(k) is obtained by integrating x2(k). The difference between PSMF-E and PSMF-J is also illustrated in Figure 7, which provides the relation among x1(k-1), x2(k-1), and x2(k)-x2(k-1).Figure 6
Effect ofα on the coefficient |xM/R|α.Figure 7
Relation amongx1(k-1), x2(k-1), and x2(k)-x2(k-1) in PSMF-E.
(a)
α
=
0
(b)
α
=
0.5
(c)
α
=
1Similar to the case of Algorithm1, owing to the use of backward Euler method, the discrete-time implementation of Algorithm 2 does not produce chattering, and the output converges to the input in finite time, as shown in Figure 8. It should be noticed that these properties of PSMF-E are independent of sampling period.Figure 8
Step response of PSMF-E (F=250, H=5, R=1, and T=0.001 s).Figure9 shows the robustness of PSMF-E against impulse-like disturbances. Specifically, Figures 9(a) and 9(b) show the cases where the input is disturbed by a positive and a negative disturbances during convergence, respectively, while Figures 9(c) and 9(d) show the cases of steady state. It is shown that the deviation of the output from its original trajectory is small during the period of the disturbance, and the output converges fast to the desired state after the disturbance disappears.Figure 9
Response of PSME-E against impulse-like disturbance (F=250, H=5, R=1, and T=0.001 s).
(a)
(b)
(c)
(d)


## 5. Frequency Domain Characteristics of PSMF-E

Frequency domain behavior of PSMF-E is analyzed by using the Bode plot. The describing function method [21], which only considers the fundamental harmonic component of responses of nonlinear systems, is applied in the frequency analysis of the nonlinear filter. In addition, the following sinusoidal signal is applied as input to PSMF-E:(13)uk=Usin⁡2πfkT,where U>0. It should be noticed that the sinusoidal input u(k) is free of noise. Moreover, in the rest part of the paper, the sampling period T=0.001 s, which is widely accepted in real-time control in industries and academia by considering the trade-off between processing speed and hardware limitation, is used.Figures10 and 11 show Bode plots of PSMF-E under different values of α and U, respectively. It is shown that, compared with PSMF-J (i.e., PSME-E with α=0), PSME-E produces larger gain and smaller phase lag in the low-frequency range, which is usually considered as the region of the signal components that should be reserved as much as possible, as α increases. It is also shown that, due to the nonlinearity, the frequency response of PSMF-E depends on the input magnitude U. This implies that appropriate parameter selection guidelines should be sought for PSMF-E.Figure 10
Bode plots of PSMF-E for different values ofα (F=250, H=5, R=1, T=0.001 s, and U=1).
(a)
Gain plot
(b)
Phase plotFigure 11
Bode plots of PSMF-E for different values ofU (F=250, H=5, R=1, α=0.5, and T=0.001 s).
(a)
Gain plot
(b)
Phase plotIn Figures10 and 11, it is interestingly observed that the slope of the high-frequency asymptote of PSMF-E is approximately -40 dB/decade, which is the same as that of the second-order Butterworth low-pass filter (2-LPF). Moreover, at PSMF-E’s cut-off frequency, which is referred to as the frequency at which the low-frequency asymptote and high-frequency asymptote of gain plot intersect each other, the gain is approximately 0.8, whereas those of 2-LPF are 0.707. It is known that Butterworth low-pass filters have the flattest gain characteristics at cut-off frequencies among all linear filters. Thus, it can be claimed that the gain characteristics of PSMF-E are advantageous over all linear filters. Furthermore, at cut-off frequency, PSMF-E’s phase lag is approximately 54.5 degrees, where that of 2-LPF is 90 degrees, which may result in system’s instability. Thus, it can be said that the phase characteristics of PSMF-E are better than 2-LPF.Figure12 compares frequency domain characteristics of PSMF-E and PSMF-J’s three variants. It is shown that, at low-frequency range, the gain and phase characteristics of PSMF-E are similar to those of the three variants. In the case of high-frequency range, which is usually considered as the region of the noise components that should be attenuated as much as possible, PSMF-E produces larger phase lag than the three variants do.Figure 12
Bode plots of PSMF-E, PSMF-A1, PSMF-A2, and PSMF-A3 forU=1 (PSMF: F=250, H=5, R=1, α=0.5; PSMF-A1, PSMF-A2, and PSMF-A3: F=250, H=5; T=0.001 s).
(a)
Gain plot
(b)
Phase plotIt should be mentioned here that these results are obtained under clean sinusoidal input; that is, there is no noise component contained in the input. However, in practice, input signal usually contains various frequency components. Thus, for the nonlinear filters, the results of frequency domain analysis reported here do not represent their whole property. Therefore, in the following section, numerical examples will be conducted for validating the filters’ effectiveness under the case where input is corrupted by noise.


## 6. Numerical Example

The performance of PSMF-E is now numerically evaluated by using the following input:(14)u=0.2sin⁡15t+0.006ϵtift≤2s0.4sin⁡15t+0.006ϵtif2s<t≤4s0.2sin⁡25t+0.006ϵtotherwise,where ε~N(0,1) is the unit white Gaussian noise with zero mean. Parameters F=100, H=5, R=1, and α=0.5 are used.Figure13 shows the output of PSMF-E. The results of PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3 with F=100 and H=5 are also provided in the figure for comparison. The initial states of all filters are set zeros at t=0 s. One can observe that the advantage of PSMF-E over PSMF-J, PSMF-A1, and PSMF-A3 is not significant in the case of slow motion, that is, t≤2 s, as shown in Figure 13(b). However, in the case of fast motion, that is, t>2 s, PSMF-E produces the smallest phase lag among the five filters. As a result, the output shape of PSMF-E is closer to that of signal component of the input compared with those of the other filters, as illustrated in Figures 13(b) and 13(c). One can also notice that, in the case of noisy input, the output of PSMF-A2 is distorted. This result is consistent with the result reported in [15]. Thus, it can be concluded that PSMF-E performs best among the five filters.Figure 13
Comparison among PSMF-E, PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3 for the input (14) corrupted by white Gaussian noise (PSMF: F=250, H=5, R=1, α=0.5; PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3: F=250, H=5; T=0.001 s).
(a)
Input and output
(b)
Enlarged view of (a)
(c)
Enlarged view of (a)
(d)
Enlarged view of (a)


## 7. Experiment

This section experimentally evaluates the performance of PSMF-E in position control by comparing with the performances without filter, with PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3. Figure14 shows the experimental setup, which consisted of a DC motor with an optical encoder, a motor controller, and a motor driver.Figure 14
Experimental setup.In the case without filter, the following proportional-derivative (PD) controller was applied:(15)vk=Kpθdk-θk+Kdωdk-ωk,whereas the following PD controller was used for the cases with filters:(16)vk=Kpθdk-θk+Kdωdk-ωfk. Here, θd(k) is the desired trajectory, θ(k) is the current position, ωd(k) is the desired velocity, ω(k) is the current velocity, v(k) is the control voltage, Kp>0 is the proportional gain, and Kd>0 is the derivative gain. Besides that, in the cases with filters, ωf(k) is the smoothed velocity. Figure 15 shows the block diagrams of the PD-controlled systems employed in the experiments. It should be mentioned that velocity is obtained by applying finite difference method on position signal. Moreover, the following signal is applied as the desired trajectory to the system:(17)θdk=90sin⁡3kTdegree.All experiments were implemented at sampling period T=0.001 s.Figure 15
Block diagrams of PD-controlled systems: (a) without filter, (b) with PSMF-J and PSMF-E, and (c) with PSMF-A1, PSMF-A2, and PSMF-A3.
(a)
PD-controlled system without filter
(b)
PD-controlled systems with PSMF-J and PSMF-E
(c)
PD-controlled systems with PSMF-A1, PSMF-A2, and PSMF-A3Figure16 shows the PD-controlled results. In addition, Figure 17 illustrates the quantized position control performances through the data of the average magnitude of position error θd-θ and the average magnitude of duty ratio (normalized control voltage v) change rate |d˙|, which are, respectively, defined as follows:(18)AMP≜115000-5000∑k=500015000θdk-θk,(19)AMD≜115000-5000∑k=500015000dk-dk-1T.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 maintained small.Figure 16
Results of PD control withKp=100, Kd=10, and T=0.001: (a) without filter and (b) with PSMF-E (F=10000, H=5, R=5000, and α=0.5).
(a)
Position control without filter
(b)
Position control with PSMF-EFigure 17
Position control performances achieved withKp=100, Kd=10, and T=0.001 (PSMF: F=10000, H=5, R=5000, and α=0.5; PSMF-J, PSMF-A1, PSMF-A2, and PSMF-A3: F=10000, H=5).One can observe that, in the case without filter, the controller (15) produced undesirable high-frequency vibration in duty ratio. As a result, the device vibrates at high frequency. This is due to the fact that velocity signal obtained by finite differencing of the measured position signal was corrupted by high-frequency noise. On the other hand, in the case with PSMF-E, high-frequency vibration was removed owing to the smoothed velocity signal. Besides that, the controller (16) with PSMF-E produced smaller AMP compared with the controller (15).The performance comparison among the cases with filters is also provided in Figure17. It is shown that PSMF-E produced both smaller AMP and smaller AMD compared with the other filters. These results clearly indicate the advantage of PSMF-E.


## 8. Conclusion

This paper has presented a new discrete-time sliding mode filter, which is named PSMF-E, for effectively removing noise in control of mechatronic systems. The presented PSMF-E is an enhanced version of PSMF-J by employing an adaptive gain in determining a virtual desiredvelocity of the output. Owing to the use of backward Euler discretization, the discrete-time implementation of PSMF-E does not produce chattering. Besides that, the state of PSMF-E converges to the desired state in finite time. The effectiveness of PSMF-E has been numerically and experimentally validated.One limitation of this paper is that the effectiveness of PSMF-E is only confirmed through numerical and experimental methods due to the strong nonlinearity. Thus, theoretical validation including stability analysis remained as an open problem. Besides that, as a nonlinear filter, the behavior of PSMF-E varies considerably with parameters. Therefore, development of appropriate parameter selection guidelines is posted as another open research issue for future investigations.



---

*Source: 3134987-2017-05-11.xml*