Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
42 views14 pages

Sliding Mode Control

Chapter 3 discusses sliding mode control (SMC) as a robust controller design technique for nonlinear systems affected by structured and unstructured uncertainties. It illustrates the application of SMC through an example involving a nonlinear system, demonstrating how to design control inputs to drive system states to the origin despite unknown disturbances. The chapter also addresses issues like chattering in real implementations and outlines general procedures for applying SMC to higher-order nonlinear systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views14 pages

Sliding Mode Control

Chapter 3 discusses sliding mode control (SMC) as a robust controller design technique for nonlinear systems affected by structured and unstructured uncertainties. It illustrates the application of SMC through an example involving a nonlinear system, demonstrating how to design control inputs to drive system states to the origin despite unknown disturbances. The chapter also addresses issues like chattering in real implementations and outlines general procedures for applying SMC to higher-order nonlinear systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Chapter 3

Sliding mode control

In general, two main sources of uncertainty may affect a model: structured and un-
structured uncertainty. While structured uncertainty refers to inaccuracies in some
components of the system, unstructured one usually regards unmodeled dynamics.
Both these uncertainties play a role in controlling a system; in fact, their pres-
ence may cause strong undesirable effects, especially when dealing with nonlinear
systems.
In this chapter, a technique for robust controller design for nonlinear systems is
reported. We refer to this technique to as sliding mode control (SMC).

3.1 Illustrative example


The main idea of the SMC technique is reported by referring to the following exam-
ple. Let us consider the nonlinear system
(
ẋ1 = x2
(3.1)
ẋ2 = u + f (x)
where x = [x1 , x2 ]′ denotes the state vector, u is the control input, and f (x) is
a generic nonlinear function. Although function f may depend also on time and
on other exogenous variables, for ease of notation we explicitly report only the
dependence on the state vector.
Let the initial conditions be
(
x1 (0) = x10
x2 (0) = x20
Assuming an exact knowledge of the states at each time, the goal is to design a
control input u which drives the states to the origin.
If the nonlinear function f (x) is known, one may apply the feedback linearization
techniques described in the previous chapter. Setting as output y = x1 , and applying
the input-output feedback linearization, one has
(
ẏ = ẋ1 = x2
ÿ = ẋ2 = u + f (x)
Since the relative degree is equal to the order of the system, there is no internal
dynamics. The control input can be designed as u = v − f (x) obtaining ÿ = v.
Since the desired output is yd = 0, the equivalent input v can be chosen as
v = −k1 ẏ − k0 y

47
48 Chapter 3. Sliding mode control

1
x1
x2
0.5

-0.5

-1

-1.5

-2
0 1 2 3 4 5 6 7 8
Time (s)

Figure 3.1: Time plot of the states for the controller based on feedback linearization
(exact knowledge of f (x)).
1
x1
x2
0.5

-0.5

-1

-1.5

-2
0 1 2 3 4 5 6 7 8
Time (s)

Figure 3.2: Trajectories of the states for the controller based on feedback lineariza-
tion (ignoring the disturbance f (x)).

obtaining
ÿ + k1 ẏ + k0 y = 0
The controller parameters must be chosen to asymptotically stabilize the system.
A possible choice is k1 = 3, k2 = 4. In Fig. 3.1, the time plot of the states are
reported. As expected, the two states asymptotically converge to zero.
Let us now assume that f (x) represents an unknown disturbance. Since f (x) is
unknown, a possible choice is to ignore it, obtaining a controller u = v = −k1 ẏ −k0 y.
If the actual disturbance is
f = cos(2t)
the states will not converge to zero, but they remain limited, as illustrated in Fig. 3.2.
Consider now the case that we know a bound on the unknown function f (x),
that is
|f (x)| ≤ F , F > 0
3.1. Illustrative example 49

In this example, one may set F = 1. The sliding mode control aims at controlling
the system assuming the knowledge of a bound on f .
Suppose the input u has been designed to enforce the following first-order dy-
namics
ẋ1 + λx1 = 0 , λ > 0 (3.2)
Since ẋ1 = x2 , the solution of (3.2) is
(
x1 = x10 e−λt
(3.3)
x2 = −λ x10 e−λt

where both the states converge asymptotically to 0. Notice that this result is inde-
pendent on f . The key point is how to design u such that (3.2) holds.
Let us define the sliding variable σ as
σ = σ(x) = x2 + λx1 , λ>0 (3.4)
To allow x to asymptotically converge to 0 with the convergence rate as in (3.3),
one must enforce that condition σ = 0 must be achieved in finite time. To prove
this fact, we may take advantage of Lyapunov function techniques. Let us compute
the derivative of σ (
σ̇ = ẋ2 + λẋ1 = λx2 + f (x) + u
(3.5)
σ(0) = σ0
Let us choose the Lyapunov candidate function as
σ2
V (σ) = (3.6)
2
Notice that, the Lyapunov function V denotes the (half) square distance of σ from
the surface σ = 0. It is known that a sufficient condition to guarantee asymptotic
stability of (3.5) is
V̇ (σ) < 0 , ∀σ 6= 0 (3.7)
Condition (3.7) guarantees that σ → 0 for t → ∞. However, we are interested in
achieving σ = 0 in finite time. To this aim, the following proposition is introduced.
Proposition 3.1. Let √
V̇ ≤ −α V , α>0 (3.8)
hold. Then, (3.5) goes to zero in finite time.
Proof. It is easy to note that (3.8) implies (3.7), so asymptotic convergence is as-
sured. Let V0 = V (0) and Vt = V (t). By separating variables and integrating (3.8)
in the time interval [0, t], one has
Z Vt Z t
1
√ dV ≤ −α dτ
V0 V 0

which leads to p p
α
V (t) ≤ − t + V0
2
So, V reaches zero in a time which is no greater than

2 V0
treach = (3.9)
α
50 Chapter 3. Sliding mode control

If the control u satisfies (3.8) then the sliding variable σ will reaches 0 in finite
time, and it will remain there forever.
In this example, by (3.5) the derivative of V turns out to be

V̇ = σ σ̇ = σ(λx2 + f (x) + u)

Let us choose u = −λx2 + v, one has

V̇ = σf (x) + σv ≤ |σ|F + σv (3.10)

Let sign(·) denote the “sign” function, that is



 +1, if a > 0
sign(a) = 0, if a = 0 (actually, we are not interested in this case)

−1, if a < 0

By choosing
v = −ρ sign(σ) , ρ>0 (3.11)
(3.10) becomes
V̇ ≤ |σ|F − ρ|σ| = −|σ|(ρ − F )
Notice that, by substituting (3.6) in (3.8) one has
√ α
V̇ ≤ −α V = − √ |σ| , α>0 (3.12)
2
To satisfy (3.8), one must impose
α
−|σ|(ρ − F ) ≤ − √ |σ|
2
and so the gain ρ results
α
ρ≥F+√ (3.13)
2
Thus, the command u which drives the sliding variable to zero in finite time is

u = −λx2 − ρ sign(σ) (3.14)

Remark. Notice that, the above reasoning is based on the fact that σ̇ is a function
of u. This aspect must be taken into account when designing the sliding variable σ.
Remark. The first component of (3.13) allows one to compensate the disturbance
f (x), while the second one is related to the time needed to σ to reach zero. According
to (3.9), the greater is α, the shorter is the time.
The equation
σ = x2 + λx1 = 0 , λ>0
is called sliding surface.
By (3.12), one has that condition (3.8) is equivalent to
α
σ σ̇ ≤ − √ |σ| (3.15)
2
which is called reachability condition. If this condition is satisfied, then the system
trajectory is driven towards the sliding surface, and it will remain on it thereafter.
3.1. Illustrative example 51

0.1

-0.1

-0.2

-0.3

-0.4

-0.5
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (s)

Figure 3.3: Time plot of the sliding variable σ.


1
x
1
x
2
0.5

-0.5

-1

-1.5

-2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (s)

Figure 3.4: Trajectories of the states for sliding mode control.

Let us simulate the system in (3.1) with a sliding mode controller with ρ = 2
and λ = 1.5. Let x(0) = [1, −2]′ and let f (x, t) = sin(2t). In Fig. 3.3, one may
observe the behavior of the sliding variable. After a finite time, the system states
reach the sliding surface, after that they remain on it. In Fig. 3.4, the trajectory
of the two states are depicted. Notice the discontinuity around t = 0.22 when the
sliding surface is reached.
The state trajectories on the phase diagram are depicted in Fig. 3.5. Two steps
are shown: the former (reaching phase) is related to σ 6= 0, where condition σ σ̇ ≤
− √α2 guarantees finite-time reaching of the sliding surface. Once the sliding surface
is reached, the sliding phase allows exponential convergence to x = 0.
A main issue affecting SMC in real implementations is the so-called chattering,
that is high-frequency oscillations (zigzag) of the command input and of the system
states. This fact, illustrated in Fig. 3.6, is due to the imprecise measurements
or imperfect implementation of the sign function in (3.14). In Section 3.3, some
solutions aimed at reducing the chattering effect will be described.
52 Chapter 3. Sliding mode control

-0.2

-0.4

-0.6 sliding phase

-0.8
x2

-1

-1.2

-1.4

-1.6 reaching phase

-1.8

-2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x1

Figure 3.5: Phase diagram showing the trajectory of the sliding variable. The green
line denotes the sliding surface.

2
u

-1

-2
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Time (s)

Figure 3.6: Chattering phenomena on the command input.


3.2. General procedure and tracking 53

3.2 General procedure and tracking


In Section 3.1, an example involving a second-order system has been reported. Let
us now consider the general case of a nonlinear system of order n,

x(n) = f (t, x) + g(t, x)u

where x = [x, ẋ, . . . , x(n−1) ]′ = [x1 , x2 , . . . , xn ]′ denotes the state vector. Notice that,
functions f and g can depends both on the state and on time. Hereafter, to simplify
the notation, the dependence on t (and sometimes on x) will be omitted.
With a slight abuse of notation, the sliding variable σ can be designed as follows
 n−1
d
σ= +λ x , λ>0 (3.16)
dt

For n = 2 and 3, notation (3.16) means

σ = ẋ + λx = x2 + λx1 , n=2

σ = ẍ + 2λẋ + λ2 x = x3 + 2λx2 + λ2 x1 , n=3


and so on.
Since σ depends on the last state variable xn = x(n−1) , it will be sufficient to
derive once in order to obtain an explicit dependence on the command u. For
instance, if n = 3 one has

σ̇ = x(3) + 2λẍ + λ2 ẋ = ẋ3 + 2λx3 + λ2 x2 = f (x) + g(x)u + 2λx3 + λ2 x2


| {z }
r(x)

Then, for a system of order n the expression of σ̇ is

σ̇ = f (x) + g(x)u + r(x) (3.17)

where r(x) changes with n according to (3.16). Notice that, assuming to exactly
know the state vector x, then also r(x) is known.

3.2.1 Uncertainty on f (x)


Let us consider the case f (x) is uncertain, that is

f = fb + fe

where fb denotes the nominal value and fe the corresponding uncertainty, such that

|fe| = |f − fb| ≤ F

Assuming g(x) 6= 0 in the considered domain, according to the reasoning of


Section 3.1, it is possible to choose u as
1
u= (−fb(x) − r(x) − ρ sign(σ)) (3.18)
g(x)
for a suitable large ρ.
In case we are interested in the tracking problem, let us denote the reference
(n−1) ′
vector as xd = [xd , ẋd , . . . , xd ] = [x1d , x2d , . . . , xnd ]′ . The aim is to drive the
54 Chapter 3. Sliding mode control

states towards the desired ones, i.e., x ≃ xd . In this case, the sliding variable can be
chosen as in (3.16) by replacing the state vector with the error vector e = x − xd ,
that is  n−1
d
σ= +λ e , λ>0 (3.19)
dt
In this case, it is assumed that the reference xd and all its derivatives up to time n
are known at each time. So, the sliding dynamics (3.17) becomes

σ̇ = f (x) + g(x)u − ẋnd + r(e) (3.20)

where r(e) depends on e2 , . . . , en . Similar to (3.18), the control signal becomes


1
u= (b
u − ρ sign(σ)) (3.21)
g(x)
where  
b = −fb(x) + ẋnd − r(e)
u (3.22)
Substituting (3.21) into (3.20), one has

σ̇ = fe − ρ sign(σ)

By choosing the Lyapunov function as in (3.6), i.e., V = σ 2 /2 one has

V̇ = σ σ̇ = (fe − ρ sign(σ))σ = feσ − ρ|σ| ≤ |σ|(F − ρ)

So, it is sufficient to choose

ρ=F +η , η>0 (3.23)

to guarantee asymptotic stability. So, the overall command input u results


1  b 
u= −f (x) + ẋnd − r(e) − (F + η) sign(σ) , η>0 (3.24)
g(x)
The following proposition states that bounds on σ can be interpreted as bounds
on the tracking error e, and so the sliding variable σ represents a measure of the
tracking performance.
Proposition 3.2. Assume e(0) = 0 and let |σ(t)| ≤ δ, ∀t ≥ 0. Then,

(2λ)i
|e(i) (t)| ≤ δ , i = 0, . . . , n − 1, t ≥ 0. (3.25)
λn−1
In case e(0) 6= 0, bound (3.25) holds asymptotically, after a transient.
Example 3.1. Let us consider the following second-order system

ẍ + a(t)ẋ2 cos(3x) = u (3.26)

where a(t) is unknown but it is bounded in 1 ≤ a(t) ≤ 2. Let us define

f (x) = −a(t)ẋ2 cos(3x)

Thus, (3.26) becomes


ẍ = f (x) + u
3.2. General procedure and tracking 55

To minimize the uncertainty on f , since 1 ≤ a(t) ≤ 2, one may define

fb(x) = −1.5 ẋ2 cos(3x)

Let fe(x) = f (x) − fb(x), then

|fe(x)| ≤ 0.5 ẋ2 | cos(3x)| , F (x)


So, the system can be rewritten as
ẍ = fe(x) + fb(x) + u
Assume we are interested in tracking the first state variable, i.e. x ≃ xd . By defining
the error signal e = x − xd , one may design the sliding variable according to (3.19),
σ = ė + λe
and
σ̇ = ë + λė = fe(x) + fb(x) + u − ẍd + λė
By (3.24), the control command can be chosen as

u = −fb(x) + ẍd − λė − (F + η) sign(σ) , η>0


in order to drive the error to zero asymptotically. △

3.2.2 Uncertainty on g(x)


Consider again the nonlinear system
x(n) = f (t, x) + g(t, x)u
Now, let us assume that also the term g is affect by uncertainty
0<g≤g≤g
Since the control command enters multiplicatively, it is convenient to choose the
estimate of g as the geometric mean of its bounds, that is
q
g = gg
b

By defining q
β= g/g
one has
1 g
b
≤ ≤β
β g
It can be shown that the command which guarantees the asymptotic convergence
of the error to 0 is
1
u = (bu − ρ sign(σ)) (3.27)
g
b
with ub defined as in (3.22), and
ρ ≥ β(F + η) + (β − 1)|b
u| , η>0 (3.28)
Notice that, if no uncertainty affects the term g, then β = 1 and (3.27) coincides
with (3.21).
Summarizing, the design of an SMC controller can be divided in two parts:
56 Chapter 3. Sliding mode control

1. design the first-order sliding surface σ;


2. design the control u which drives the sliding variable σ to 0 in finite time.
Notice that to accomplish this task, one needs to compute the dynamics of σ,
that is, σ̇.
Remark. It is worthwhile to remark that the system dynamics in the sliding mode
do not depend on the functions f and g, but a bound on them is needed to compute
ρ in (3.28), and hence to compute the control command u in (3.27). Moreover, it is
assumed that the state is available and the reference signal and its derivatives are
known.

3.2.3 Equivalent control


Let us refer to the system in (3.1), and hence to the sliding variable defined in (3.4).
Assume that at time tr the sliding surface σ = x2 + λx1 = 0 is reached, and x1 , x2
remain on that surface for t ≥ tr . Then, σ = σ̇ = 0, for all t ≥ tr . So,

σ̇ = λx2 + f (x) + u = 0

This expression requires that the equivalent input to be applied (from time tr on-
wards) to enforce σ̇ = 0 corresponds to

ueq = −λx2 − f (x) (3.29)

Notice that the equivalent control (3.29) cannot be implemented in a real system,
since f (x) is not exactly known. Moreover, the equivalent control ueq is not the
actual control which is applied to the system. In fact, the actual control corresponds
to
u = −λx2 − ρ sign(σ)
which is a discontinuous control function. So, the equivalent control can be viewed
as the average effect of the high-frequency switching control (3.14). Let us write the
actual applied control signal as

u = −λx2 − ρzs

where zs = sign(σ). The equivalent input can be estimated online by filtering zs


through a low-pass filter. For instance, by using a first-order low-pass filter, one has
Zf (s) 1
GLP (s) = =
Zs (s) 1 + τs
where Zf (s) is the output of the filter, and τ denotes the time constant of the filter.
Denoting with u beq the estimate of the equivalent input, one has
1 1
żf = − zf + zs
τ τ
u
beq = −λx2 − ρzf (3.30)

We can obtain a good approximation of ueq by choosing τ small. In practical ap-


plications, this filter will be implemented in discrete time, and τ would be chosen
small but greater than the sampling time.
By comparing (3.29) and (3.30), an estimate of f can be obtained as

fest = ρzf
3.3. Chattering elimination and attenuation 57

3.3 Chattering elimination and attenuation


It has been seen that, in order to apply SMC, the input command u must switch,
possibly at high frequencies. Such a command can be safely implemented in some
cases, for instance when it is related to the electric voltage driving a motor. In fact,
a typical motor control is provided through pulse width modulation (PWM), where
a high frequency voltage with different duty cycle is involved.
Nevertheless, in general, the chattering behavior depicted in Fig. 3.6 is not de-
sirable from a practical point of view. In fact, it requires a high control activity and
it may excite high-frequency unmodeled dynamics. To this purpose, some solutions
have been devised to cancel or attenuate the chattering behavior.

3.3.1 Chattering elimination


A possible solution to eliminate chattering consists in approximating the sign func-
tion with a smooth one, like, e.g. the sigmoid function defined as
x
sigmoid(x) = (3.31)
|x| + ε

with ε > 0 arbitrarily small (see Fig. 3.7). It is clear that the approximation given
by (3.31) improves for ε → 0. So, ε can be designed to achieve the desired trade-off
between chattering and performance.
1.5
sign
sigmoid
1

0.5

-0.5

-1

-1.5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2

Figure 3.7: Comparison between the sign and the sigmoid functions (ε = 0.02).

An alternative approximation of the sign function is as follows


(
sign(x), if |x| ≥ B
signappr (x) = (3.32)
x/B, if |x| ≤ B

A comparison between signappr and the sign function is reported in Fig. 3.8.
Let us consider again the system (3.1) and replace the sign function with the
sigmoid (3.31). According to (3.14), the control command u becomes
σ
u = −λx2 − ρ
|σ| + ε

Due to this approximation, the sliding variable cannot reach zero, but it converges
around it. The time plot of the command input u for ε = 0.02 is reported in Fig. 3.9.
58 Chapter 3. Sliding mode control

1.5
sign
sign
appr
1

0.5

-0.5

-1

-1.5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2

Figure 3.8: Comparison between the signappr and the sign functions (B = 0.2).
5

2
u

-1

-2
0 1 2 3 4 5 6 7 8 9 10
Time (s)

Figure 3.9: Command input with chattering elimination.

In Fig. 3.10, one may notice that the sliding variable does not converge to zero, but
it oscillates around it. The SMC with chattering elimination is usually referred to
as quasi-SMC, since the sliding variable does not converge to zero in finite time.
However, as reported in Fig. 3.11, the system states tends to a neighbor of the
origin, whose amplitude decreases as ε → 0.

3.3.2 Chattering attenuation


Another method to deal with chattering is to apply SMC in terms of the control
function derivative. The actual control will be the integral of the chattering in-
put, and so it will not present discontinuities. This technique is called chattering
attenuation, since some periodic signals remain after command integration.
Let us rewrite system (3.1) as


 ẋ1 = x2
ẋ2 = u + f (x)


u̇ = ν

with u(0) = 0. In addition to |f (x)| ≤ F , let us assume to know a bound on the


3.3. Chattering elimination and attenuation 59

0.1

-0.1

-0.2

-0.3

-0.4

-0.5
0 1 2 3 4 5 6 7 8 9 10
Time (s)

Figure 3.10: Time plot of the sliding variable σ (chattering elimination).


1
x
1
x
2
0.5

-0.5

-1

-1.5

-2
0 1 2 3 4 5 6 7 8 9 10
Time (s)

Figure 3.11: Trajectories of the states for sliding mode control with chattering elim-
ination.

derivative of f , that is |f˙(x)| ≤ F .


The sliding variable σ is defined as in (3.4). Similarly, let us introduce the new
sliding variable s, defined as
s = σ̇ + λ̄σ , λ̄ > 0
The idea is to design a control law ν which provides finite-time convergence of
s to 0. This guarantees that σ, σ̇ → 0 exponentially, and hence also x1 , x2 → 0.
Differently from the original formulation of SMC, here σ → 0 asymptotically and
not in finite-time. So, we name this technique as asymptotic SMC.
To design ν, similarly to (3.15), one must impose
α
sṡ ≤ − √ |s| (3.33)
2
Since σ = x2 + λx1 , one has
s = ẋ2 + λẋ1 + λ̄x2 + λ̄λx1 = u + f (x) + (λ + λ̄)x2 + λ̄λx1
60 Chapter 3. Sliding mode control

and hence,
ṡ = ν + f˙(x) + (λ + λ̄)(u + f (x)) + λ̄λx2
By choosing ν = −λ̄λx2 − (λ + λ̄)u + ξ, one has ṡ = f˙(x) + (λ + λ̄)f (x) + ξ and
hence
sṡ = s(f˙(x) + (λ + λ̄)f (x) + ξ) ≤ |s|(F + (λ + λ̄)F ) + sξ
Taking ξ = −ρ sign(s) one has

sṡ ≤ |s|(F + (λ + λ̄)F − ρ)

To satisfy (3.33), it is sufficient to satisfy


α
F + (λ + λ̄)F − ρ = − √
2
that is
α
ρ = F + (λ + λ̄)F + √
2
So, the control ν which drives s to zero in finite time

2
treach ≤ |s(0)|
α
corresponds to
ν = −λ̄λx2 − (λ + λ̄)u − ρ sign(s)
It is worthwhile to notice that, since ν contains the sign function, it will be affected
by the chattering phenomena. However, since the actual command u is the integral
of ν, such issue will be greatly reduced.
Notice that, to compute the command ν one must know s, which requires the
computation of σ̇. To this purpose, numerical solutions can be exploited.

You might also like