Keywords

6.1 Introduction

Since the late 1970s, sliding mode control (SMC) has attracted a significant interest from the control research community, and this is due to its insensitivity to model parametric uncertainties and external disturbances (Bandyopadhyay et al. 2009; Utkin 1977; Young et al. 1999). Indeed, the SMC design consists of two basic steps: selecting a stable sliding surface on the basis of control objectives and desired properties of the closed loop system, and synthesizing a discontinuous control law in such a way that the state trajectory of the system reaches the sliding surface in finite time and then remains there (Bandyopadhyay et al. 2009; Bregeaut 2010). Yet, in practice and in the presence of switching imperfections, the control cannot switch at a very high frequency, and then the discontinuity in the control law yields to the so-called chattering phenomenon.

This phenomenon can actuate disregarded high-frequency dynamics, degrade system performances and even cause mechanical damages (Perruquetti and Barbot 2002). In this regard, several approaches have been proposed in the literature in order to overcome this problem such as the one proposed by Slotine and Sastry (1983), which consists in substituting the signum function, origin of the discontinuity in the control law, by a smooth function like saturation function (Hung et al. 1993; Perruquetti and Barbot 2002; Slotine 1984; Slotine and Li 1991). Actually, the state trajectory will evolve inside a thin boundary layer neighboring the switching surface and then the chatter effect will be attenuated close to this surface.

Another approach, introduced by Levant (2003), the higher-order sliding mode control (HOSMC), consists in constraining the state trajectory to reach in finite time the sliding set defined by:

$$\begin{aligned} {S^r} = \left\{ x \in {\mathbb {R}^n}: s = \dot{s} = \ddot{s} = ... = s^{\left( r - 1\right) } = 0 \right\} \end{aligned}$$
(6.1)

In addition to the chatter elimination, HOSMC ensures a better accuracy and resolves the problem of the restriction to a relative degree one, while preserving the main features of the standard sliding mode (Levant 2003; Perruquetti and Barbot 2002). In this study, only second-order sliding mode control (SOSMC) and specially twisting and super-twisting algorithms (Emelyanov et al. 1996; Levant 1993; Perruquetti and Barbot 2002; Shtessel et al. 2014) will be demonstrated for the control of the inverted pendulum as a nonlinear and unstable system.

In Sect. 6.2, we represent the first order sliding mode theory. Section 6.3 is devoted to second order sliding mode algorithms. In Sect. 6.4, Simulations results for both first and second order sliding mode algorithms applied to the inverted pendulum will be shown. Finally, concluding remarks will be given in Sect. 6.5.

6.2 First Order Sliding Mode Control

Well known for its high accuracy and robustness against parametric variations and external disturbances, the sliding mode control consists, by means of a discontinuous control, in constraining the system states to reach, in finite time, and then to evolve onto a sliding manifold defined by:

$$\begin{aligned} S = \left\{ x \in {\mathbb {R}^n}: s = 0 \right\} \end{aligned}$$
(6.2)

Hence, the design of SMC involves two major steps: the first is to select a stable surface depending upon desired system dynamics, and the second is to synthesize a control law so that the system state trajectory evolves onto the chosen surface (Bregeaut 2010; Levant 2003).

Consider a single input nonlinear system as

$$\begin{aligned} \dot{x} = f\left( x \right) + b\left( x \right) u \end{aligned}$$
(6.3)

where \(x \in {\mathbb {R}^n}\) is the state vector and \(u \in \mathbb {R}\) is the control input. The control law of the sliding mode controller is expressed as follows:

$$\begin{aligned} u = {u_{eq}} + {u_d} \end{aligned}$$
(6.4)

with \({u_{eq}}\) is the equivalent control and \({u_d}\) is the discontinuous control. Using the equivalent control approach (DeCarlo et al. 1988; Gao and Hung 1992; Utkin 1992), \({u_{eq}}\) is obtained by setting \(\dot{s} = 0\). It ensures the maintain of the state trajectory onto the switching surface \(s = 0\) during the sliding mode (Bandyopadhyay et al. 2009; Hung et al. 1993; Perruquetti and Barbot 2002).

For the system (6.3), the first time derivative of the sliding variable \(s= s \left( x\right) \) is given by:

$$\begin{aligned} \dot{s} = \frac{\partial s}{\partial x}\left( {f\left( x \right) + b\left( x \right) u} \right) \end{aligned}$$
(6.5)

Assuming that \(\left( \frac{\partial s}{\partial x}b\left( x \right) \right) \) is invertible, the equivalent control law is expressed by:

$$\begin{aligned} {u_{eq}} = - \left( {\frac{\partial s}{\partial x}}b\left( x \right) \right) ^{ - 1}\frac{\partial s}{\partial x}f\left( x \right) \end{aligned}$$
(6.6)

Yet, a \(\eta \)-reachability condition defined in (Bandyopadhyay et al. 2009; Edwards and Spurgeon 1998; Perruquetti and Barbot 2002) as follows:

$$\begin{aligned} s\dot{s} \le - \eta \left| s \right| ,\,\,\,\eta > 0 \end{aligned}$$
(6.7)

must be met in order to ensure a finite time convergence to the sliding surface. Hence, the classic sliding mode control that satisfies the above condition is given by Riachy (2008):

$$\begin{aligned} u = - \left( \frac{\partial s}{\partial x} b\left( x \right) \right) ^{ - 1}\left( \frac{\partial s}{\partial x}f\left( x \right) + k\,\mathrm {sign}\left( s \right) \right) \end{aligned}$$
(6.8)

where k is a positive constant that verifies

$$\begin{aligned} s\dot{s}=s\left( -k\,\mathrm {sign}\left( s\right) \right) =-k\left| s\right| \le - \eta \left| s \right| \Leftrightarrow k \ge \eta \end{aligned}$$
(6.9)

and \(\mathrm {sign}\) is the signum function defined by

$$\begin{aligned} \mathrm {sign}(s)= \left| \begin{array}{ccc} 1 &{} \mathrm {~if~} &{} s > 0 \\ 0 &{} \mathrm {~if~} &{} s = 0 \\ -1 &{} \mathrm {~if~} &{} s < 0 \end{array} \right. \end{aligned}$$
(6.10)

Nevertheless, the discontinuity of the signum function in the vicinity of the sliding surface \(s = 0\) involves an infinite frequency commutation of the control law which cannot exist in practice because of switching imperfections. This leads to the so-called chattering phenomenon (Fig. 6.1) which can degrade performances of the controlled system, excite disregarded high-frequency dynamics and even deteriorate the control member.

Fig. 6.1
figure 1

Chattering phenomenon

To attenuate the chatter effect, several approaches were proposed in literature. The main idea of the first approach is to substitute signum function by a continuous one such as saturation function defined by:

$$\begin{aligned} \mathrm {sat}(s,\varphi )= \left| \begin{array}{ccc} \dfrac{s}{\varphi } &{} \mathrm {~if~} &{} \left| \dfrac{s}{\varphi } \right| \le 1 \\ \mathrm {sign}(s) &{} \mathrm {~if~} &{} \left| \dfrac{s}{\varphi } \right| > 1 \end{array}\right. \end{aligned}$$
(6.11)

The continuous function will ensure the convergence of system state trajectory to a thin boundary layer in the vicinity of the sliding surface. Consequently, the chatter effect will be reduced to the detriment of optimum accuracy and robustness of sliding mode.

The above restrictions were removed with the higher order sliding mode control which satisfies a finite time convergence of not only the sliding variable to zero, but also of a finite number of its time derivatives. In other words, for a relative degree \(r > 1\), i.e. \(\frac{\partial }{\partial u} s^{(i)}=0 \left( i=\left[ \left| 1,r-1\right| \right] \right) \) and \(\frac{\partial }{\partial u} s^{(r)}\ne 0\), it is necessary to ensure, for stability reasons, the following equalities:

$$\begin{aligned} s = \dot{s} = \ddot{s} = \cdots = {s^{(r - 1)}} = 0 \end{aligned}$$
(6.12)

Hence, HOSMC removes another drawback of classic sliding mode: the restriction to a relative degree one. However, this will require an additional information about the \(\left( {r - 1} \right) \) time derivatives of s. In what follows, only second order sliding mode algorithms will be treated.

6.3 Second Order Sliding Mode Control

The second order sliding mode controller consists on forcing the system state trajectories to evolve in finite time onto the second order sliding set defined by:

$$\begin{aligned} {S^2} = \left\{ {x \in {\mathbb {R}^n}:s = \dot{s} = 0} \right\} \end{aligned}$$
(6.13)

Return to the system

$$\begin{aligned} \begin{array}{c} \dot{x} = f\left( x\right) + b\left( x\right) u\\ s = s(x) \end{array} \end{aligned}$$
(6.14)

with \(x \in X = \left\{ x:\left| x_i \right| \le x_{i\max }, i \in \left[ \left| 1,n \right| \right] \right\} \) and \(u \in U = \left\{ u: \left| u \right| \le u_{\max } \right\} \).

Let the relative degree be equal to one, differentiating the sliding variable s twice yields to the following relation:

$$\begin{aligned} \ddot{s} = \frac{\partial {\dot{s}}}{\partial x}\left( f\left( x \right) + b\left( x \right) u \right) + \frac{\partial {\dot{s}}}{\partial u} \dot{u} = \alpha \left( x \right) + \beta \left( x \right) \dot{u} \end{aligned}$$
(6.15)

It is assumed that if \(\left| s\left( x \right) \right| < s_0\) then there are positive constants \(\varPhi \), \(\varGamma _m\) and \(\varGamma _M\) such that

$$\begin{aligned} \begin{array}{c} \left| \alpha \left( x \right) \right|< \varPhi \\ 0 < \varGamma _m \le \beta \left( x \right) \le \varGamma _M \end{array} \end{aligned}$$
(6.16)

Subsequently, Only Twisting and Super-Twisting algorithms will be studied.

6.3.1 Twisting Algorithm

The twisting algorithm, one of the first known second order sliding mode algorithms, ensures a finite time convergence of the state trajectory to the origin of the phase plane \(\left( {s,\dot{s}} \right) \) after executing a certain number of rotations around it (Fig. 6.2), and this is due to the commutation of the control between two values.

Fig. 6.2
figure 2

Twisting algorithm phase trajectory

For a relative degree 1, the control algorithm is defined by the following control law:

$$\begin{aligned} \dot{u}_{Tw}= \left| \begin{array}{ccl} -u &{} \mathrm {~if~} &{} | u |> u_{max} \\ -k_m\mathrm {sign}(s) &{} \mathrm {~if~} &{} s\dot{s}\le 0 \mathrm {~and~} \left| u \right| \le u_{max} \\ -k_M \mathrm {sign}(s) &{} \mathrm {~if~} &{} s\dot{s} > 0 \mathrm {~and~} \left| u \right| \le u_{max} \end{array}\right. \end{aligned}$$
(6.17)

The sufficient conditions that ensure a finite time convergence to the second order sliding set are:

$$\begin{aligned} {k_M}> {k_m}> 0,\,\,{k_m}> \frac{{4{\varGamma _M}}}{{{s_0}}},\,\,{k_m}> \frac{\varPhi }{{{\varGamma _m}}},\,\,{\varGamma _m}{k_M} - \varPhi > {\varGamma _M}{k_m} + \varPhi \mathrm{{}} \end{aligned}$$
(6.18)

6.3.2 Super-Twisting Algorithm

Unlike twisting algorithm, this algorithm is only able to stabilize in finite time (Fig. 6.3) systems whose relative degree is equal to one and then it does not require information about the time derivative of the sliding variable.

Fig. 6.3
figure 3

Super-twisting algorithm phase trajectory

The control law is given by:

$$\begin{aligned} \begin{array}{c} {u_{ST}} = - \alpha {\left| s \right| ^\rho }\mathrm {sign}\left( s \right) + {u_1}\\ {{\dot{u}}_1} = - w\,\mathrm {sign}\left( s \right) \end{array} \end{aligned}$$
(6.19)

and the corresponding sufficient conditions are:

$$\begin{aligned} w > \frac{\varPhi }{{{\varGamma _m}}},\,\,\,{\alpha ^2} \ge \frac{{4\varPhi }}{{{\varGamma _m}^2}}\frac{{{\varGamma _M}\left( {w + \varPhi } \right) }}{{{\varGamma _m}\left( {w - \varPhi } \right) }},\,\,\,\,0 < \rho \le 0.5 \end{aligned}$$
(6.20)

Choosing \(\rho = 0.5\) ensures the achievement of real second-order sliding mode.

6.4 Application to an Inverted Pendulum

The inverted pendulum is an interesting classic system which consists of a pendulum attached by a rotation joint to a cart. This cart, driven by a DC motor, can move along a horizontal guide rail in order to maintain the pendulum in its vertical balance. This system has two degrees of freedom whose generalized coordinates are: x for the horizontal cart movement and \(\theta \) for the pendulum rotation (Fig. 6.4).

Fig. 6.4
figure 4

Schematic of the inverted pendulum system

Let \(x = {\left[ {\begin{array}{*{20}{c}}{{x_1}}&{{x_2}}\end{array}} \right] ^\top } = {\left[ {\begin{array}{*{20}{c}}\theta&{\dot{\theta }}\end{array}} \right] ^\top }\) be the state vector and u be the force applied to the cart, the dynamic equations of the inverted pendulum are:

$$\begin{aligned} {\left\{ \begin{array}{ll} {\dot{x}}_1 = x_2\\ {\dot{x}}_2 = f(x_1,x_2)+b(x_1,x_2)u \end{array}\right. } \end{aligned}$$
(6.21)

with:

$$\begin{aligned} f\left( x_1,x_2\right)= & {} \frac{\left( M + m\right) g\sin {x_1} - mlx_2^2\sin x_1\cos x_1}{\frac{4}{3}\,\left( M + m \right) l - ml \cos ^2 x_1 } \\ b\left( x_1,x_2\right)= & {} \frac{\cos x_1}{\frac{4}{3} \left( M + m \right) l - ml \cos ^2 x_1} \end{aligned}$$

such that \(M = 1\,\mathrm{kg}\) is the cart mass, \(m = 0.1\,\mathrm{kg}\) is the pendulum mass, \(l = 0.5\,\mathrm{m}\) is the half length of the pendulum, \(g = 9.8~\mathrm{m/s}^2\) is the acceleration of gravity (Wang 1994).

6.4.1 Application of First Order Sliding Mode Control

6.4.1.1 Classic Sliding Mode Control

By referring to Slotine and Li (1991), the sliding function is chosen as:

$$\begin{aligned} s = \lambda \,e + \dot{e} \end{aligned}$$
(6.22)

where \(e = {x_1} - {x_{d1}}\) is the tracking error and \(\lambda \) is a positive constant. The first time derivative of s is:

$$\begin{aligned} \begin{array}{c} \dot{s} = \lambda \left( {{x_2} - {{\dot{x}}_{d1}}} \right) + \left( {f - {{\ddot{x}}_{d1}}} \right) + b\,u\\ = h + b\,u \end{array} \end{aligned}$$
(6.23)

Using (6.8) and (6.23), the control law of the classic sliding mode controller is expressed as:

$$\begin{aligned} u = - {b^{ - 1}}\left( {h + k\,\mathrm {sign}\left( s \right) } \right) \end{aligned}$$
(6.24)

For simulation results, the design parameters are chosen as follows: \( \lambda = 5\) and \( k = 18 \). The reference signal and the initial conditions are respectively \(x_{d1} = \frac{\pi }{30}\sin t\) and \(x_0 = \left[ 0.2~0 \right] ^\top \). Thus, by applying the classic sliding mode to the inverted pendulum, we obtain results shown in Fig. 6.5.

Fig. 6.5
figure 5

a Control input, b angular displacement, c sliding function, d angular velocity for classic SMC

Figure 6.5 shows clearly the chattering phenomenon present in the control input. Thus, in the next step, the signum function will be replaced by the saturation function in order to attenuate the chatter effect.

6.4.1.2 Sliding Mode Control with Saturation Function

Substituting the signum function by the saturation function defined in (6.11) in the control law (6.24) yields to:

$$\begin{aligned} u = - {b^{ - 1}}\left( {h + k\,\mathrm {sat}\left( {s,\varphi } \right) } \right) \end{aligned}$$
(6.25)

where \(\varphi \) is chosen to be equal to 0.5. Simulation results are shown in Fig. 6.6.

Fig. 6.6
figure 6

a Control input, b angular displacement, c sliding function, d angular velocity for SMC with saturation function

Fig. 6.7
figure 7

a Control input, b angular displacement, c sliding function, d angular velocity for twisting algorithm

These results show the efficiency of this approach in reducing the chatter effect. However, the existence of the boundary layer neighboring the sliding surface may affect the main characteristics of the sliding mode control such as robustness.

6.4.2 Application of Second Order Sliding Mode Control

6.4.2.1 Twisting Algorithm

Using (6.23), the second time derivative of the sliding function is given by:

$$\begin{aligned} \ddot{s} = \lambda \left( f + b\,u - \ddot{x}_{d1} \right) + \left( \dot{f} + \dot{b}\,u - \mathop {x}\limits ^{\dots }_{d1} \right) + b\,\dot{u} = d + b\,\dot{u} \end{aligned}$$
(6.26)

where d and b must verify relations given in (6.16).

Then, using (6.17) the control law of twisting algorithm is expressed as:

$$\begin{aligned} \dot{u} = {b^{ - 1}}\left( { - d + {{\dot{u}}_{Tw}}} \right) \end{aligned}$$
(6.27)

By fulfilling the necessary conditions (6.16) and the sufficient conditions (6.18), the optimum value of \({k_m}\) and \({k_M}\), chosen after some trials, are respectively 7 and 35.

Figure 6.7 shows that the twisting Algorithm reduces the chattering phenomenon while Fig. 6.8 shows that the system state trajectory converges to the origin of the phase plane \(\left( {s,\dot{s}} \right) \).

Fig. 6.8
figure 8

Twisting algorithm phase trajectory

Fig. 6.9
figure 9

a control input, b angular displacement, c sliding function, d angular velocity for super-twisting algorithm

Fig. 6.10
figure 10

Super-twisting algorithm phase trajectory

6.4.2.2 Super-Twisting Algorithm

Using (6.19) and (6.23), the control law for the super-twisting algorithm is given by:

$$\begin{aligned} u = {b^{ - 1}}\left( { - h + {u_{ST}}} \right) \end{aligned}$$
(6.28)

In accordance with the conditions given in (6.16) and (6.20), and after performing some simulations, we choose \(w = 8\), \(\alpha = 2\) and \(\rho = 0.5\).

Both Figs. 6.9 and 6.10 show that the super-twisting algorithm ensures a finite time convergence of the system trajectory to the origin of the phase plane. In addition, by comparing to Figs. 6.7a and 6.9a, we can conclude that super-twisting algorithm is better than twisting algorithm with regards to the reduction of chattering effect in the control input.

6.5 Conclusion

This paper has proposed some solutions to attenuate chattering phenomenon present in classic sliding mode control. At first, a continuous approximation has been made in the vicinity of the sliding surface by using the saturation instead of the signum function. However, this introduces a boundary layer that may affect the main features of sliding mode such as robustness. Then, a second order sliding mode control algorithms: twisting and super-twisting algorithms, have been applied to the inverted pendulum system. The simulations results have shown their efficiency in attenuating chatter effect while ensuring a finite time convergence and high accuracy.