**2. Sliding surfaces**

Consider the single-input dynamic system given below:

$$\mathfrak{x}^{(n)} = f(\mathfrak{x}) + b(\mathfrak{x})u,\tag{1}$$

where the scalar *x* is the output we are interested in, the scalar *u* is called the control input, and *<sup>x</sup>* <sup>¼</sup> *<sup>x</sup>*, *<sup>x</sup>*\_, … , *<sup>x</sup>*ð Þ *<sup>n</sup>*�<sup>1</sup> � �*<sup>T</sup>* represents the state vector. While the function *f*ð Þ *x* in (1) is not exactly known, an upper bound on *f*ð Þ *x* is set by a known continuous function of *x* to limit the size of the imprecision. Similarly, the control gain *b*ð Þ *x* is not exactly known either, only its sign is known; therefore, it is also bounded by the known continuous functions of *x*. The control problem is to ensure that the state *x* tracks an explicit time-varying state *x<sup>d</sup>* ¼ *xd*, *x*\_ *<sup>d</sup>*, … , *xd* ð Þ *<sup>n</sup>*�<sup>1</sup> � �*<sup>T</sup>* in the presence of model imprecision on *f*ð Þ *x* and *b*ð Þ *x* . In order for the tracking task to be achieved using a finite control *u*, desired initial state *xd*ð Þ 0 must be such that it ultimately validates the following relationship:

$$\mathfrak{x}\_d(\mathbf{0}) = \mathfrak{x}(\mathbf{0}) \tag{2}$$

For example, in a second-order system, the position or speed cannot bounce; as a result of this fact, any desired trajectory that can be workable from time *t* ¼ 0 necessarily starts at the same position and speed as those of the plant.

#### **2.1 A notational simplification**

Let us define *x*~ ¼ *x* � *xd* as the tracking error in the variable *x*, and *<sup>x</sup>*<sup>~</sup> <sup>¼</sup> *<sup>x</sup>* � *<sup>x</sup><sup>d</sup>* <sup>¼</sup> *<sup>x</sup>*~, *<sup>x</sup>*~\_, … , *<sup>x</sup>*~ð Þ *<sup>n</sup>*�<sup>1</sup> h i*<sup>T</sup>* as the tracking error vector. Let us also define a surface *S t*ð Þ that is time-varying in the state-space *<sup>R</sup>*ð Þ *<sup>n</sup>* with the scalar equation *s*ð Þ¼ *x*; *t* 0 expressed as:

$$s(\mathfrak{x};t) = \left(\frac{d}{dt} + \lambda\right)^{n-1}\check{\mathfrak{x}},\tag{3}$$

where *λ* is a strictly positive constant. For example, if *n* ¼ 2, Eq. (3) takes the following form:

*An In-Depth Analysis of Sliding Mode Control and Its Application to Robotics DOI: http://dx.doi.org/10.5772/intechopen.93027*

$$
\mathfrak{s} = \dot{\hat{\mathfrak{x}}} + \lambda \hat{\mathfrak{x}},
$$

that is, it simply consists of a weighted sum of the position and the velocity errors; thus, we can express *x*~ from Eq. (3) as follows:

$$\tilde{\boldsymbol{x}} = \frac{s(\boldsymbol{x}; t)}{\left(\frac{d}{dt} + \lambda\right)^{n-1}} \tag{4}$$

More specifically, a first-order stabilization problem in *s* is basically nothing other than a replacement for the problem of tracking the *n*-dimensional vector *x<sup>d</sup>* (i.e., the original *nth*-order tracking problem in *x*). Indeed, *s* needs to be differentiated only once for the appearance of the input *u* due to the presence of the term *x*~ð Þ *<sup>n</sup>*�<sup>1</sup> in the expression *s* in (3).

Additionally, the bounds on *s* can be evaluated directly as the bounds on the tracking error vector *x*~, and therefore, the scalar *s* is considered a true measure of tracking performance. Specifically, under the assumption that *x*~ð Þ¼ 0 **0** (in the meantime, we make a note that the effect of non-zero initial conditions in *x*~ can be added separately), we write:

$$\forall t \ge 0, \left| s(t) \right| \le \Phi \Rightarrow \forall t \ge 0, \left| \tilde{\alpha}^{(i)}(t) \right| \le (2\lambda)^i e \qquad i = 0, \ldots, n-1 \tag{5}$$

where *<sup>ε</sup>* <sup>¼</sup> *<sup>Φ</sup>=λ<sup>n</sup>*�<sup>1</sup> *:* Indeed, Eq. (3), or more precisely, Eq. (4) derived from (3) clearly indicates that the tracking error *x*~ can be obtained from *s* through a sequence of first-order low-pass filters (see **Figure 1**, where *p* ¼ ð Þ *d=dt* is commonly known as the *Laplace operator*).

In general, a first-order low-pass filter's input-output relationship is given as follows:

$$\frac{Output\_{lpf}}{Input\_{lpf}} = K\_f \frac{1}{1 + p\tau},$$

where *K <sup>f</sup>* is filter gain and *τ* is filter time constant. Let *y*<sup>1</sup> be the output of the first filter. We can express the output of the first filter in terms of a *convolution integral* in time domain by taking into account the fact that the input is already defined as *s*:

$$\mathcal{Y}\_1(t) = \int\_0^t e^{-\lambda(t-T)} s(T) dT.$$

Using j j*s* ≤ *Φ***,** we get the following:

$$\left|y\_1(t)\right| \le \Phi \Big|\_{0}^{t} e^{-\lambda(t-T)} dT = \frac{\Phi}{\lambda} e^{-\lambda(t-T)} \Big|\_{0}^{t} = \frac{\Phi}{\lambda} \left(1 - e^{-\lambda t}\right) \le \Phi/\lambda.$$

**Figure 1.** *Computing bounds on x*~*:*

We can apply similar reasoning to the second filter, et cetera, until we reach *yn*�<sup>1</sup> <sup>¼</sup> *<sup>x</sup>*~. Ultimately, we get

$$|\tilde{\boldsymbol{\mathfrak{x}}}| \le \boldsymbol{\Phi}/\boldsymbol{\lambda}^{n-1} = \boldsymbol{\varepsilon}.$$

Similarly, *x*~ð Þ*<sup>i</sup>* can be considered to be acquired through the sequence of **Figure 2**.

One can easily make another similar relationship, *zI* j j<sup>≤</sup> *<sup>Φ</sup>=λn*�1�*<sup>i</sup>* by referring to the previous result. Here, *zI* is the output of the ð Þ *<sup>n</sup>* � *<sup>i</sup>* � <sup>1</sup> *th* filter. It is worth noting, however, that

$$\frac{p}{p+\lambda} = \frac{p+\lambda-\lambda}{p+\lambda} = \mathbf{1} - \frac{\lambda}{p+\lambda}.$$

One sees that the remaining *i* blocks right after *n* � *i* � 1 blocks in the sequence of **Figure 2** include numerators of *p* as can typically be seen in practical filter applications, and that the sequence of **Figure 2** means that

$$|\check{\mathbf{x}}^{(i)}| \le \left(\frac{\Phi}{\lambda^{n-1-i}}\right) \underbrace{\left(1 - \frac{\lambda}{p+\lambda}\right) \dots \dots \left(1 - \frac{\lambda}{p+\lambda}\right)}\_{i \text{ blocks}},$$

where the first multiplier to the right of inequality sign includes the first *n* � *i* � 1 blocks which do not have *p* as the numerator. When *i* blocks multipliers are arranged, the expression takes the form:

$$|\bar{\kappa}^{(i)}| \le \left(\frac{\Phi}{\lambda^{n-1-i}}\right) \left(\underbrace{1\dots\dots\dots\dots\dots\dots}\_{i\text{ times}} + \frac{\lambda\dots\dots\lambda}{\lambda^i}\right),$$

where term comes from the result derived for the sequential blocks each of which is represented by 1*=*ð Þ *<sup>p</sup>* <sup>þ</sup> *<sup>λ</sup>* , and 1*=*ð Þ *<sup>p</sup>* <sup>þ</sup> *<sup>λ</sup> <sup>i</sup>* ≤ 1*=λ<sup>i</sup> :* Besides, the positive sign must be considered to obtain the prospective upper bound. In this case, the next step is:

$$\left|\tilde{\boldsymbol{\kappa}}^{(i)}\right| \le \left(\frac{\Phi}{\boldsymbol{\lambda}^{n-1-i}}\right) \left(\mathbf{1}^{i} + \frac{\boldsymbol{\lambda}^{i}}{\boldsymbol{\lambda}^{i}}\right).$$

Finally, we can write,

$$\left|\bar{\mathbf{x}}^{(i)}\right| \le \left(\frac{\Phi}{\lambda^{n-1-i}}\right) \left(1 + \frac{\lambda}{\lambda}\right)^i$$

$$\left|\underbrace{s \cdots \mathbf{0}}\_{n-1-1 \text{ blocks}}\right| \xrightarrow[n-i-1 \text{ blocks}]{} \underbrace{\frac{1}{p+\lambda} \cdots \underbrace{\frac{1}{p+\lambda} \mathbf{0}}\_{n-1 \text{ blocks}}}\_{\text{\$n-1-subks}} \xrightarrow[i \text{ blocks}]{} \underbrace{\frac{p}{p+\lambda} \cdots \underbrace{\frac{p}{p+\lambda}}\_{i \text{ blocks}}}\_{i \text{ blocks}}$$

**Figure 2.** *Computing bounds on x*~ð Þ*<sup>i</sup> :*

*An In-Depth Analysis of Sliding Mode Control and Its Application to Robotics DOI: http://dx.doi.org/10.5772/intechopen.93027*

since 1*<sup>i</sup>* <sup>þ</sup> *<sup>λ</sup><sup>i</sup> λi* <sup>≤</sup> <sup>1</sup> <sup>þ</sup> *<sup>λ</sup> λ <sup>i</sup>* . Thus, as a result, we reach the following statement:

$$|\ddot{\boldsymbol{\kappa}}^{(i)}| \le \left(\frac{\Phi}{\lambda^{n-1}}\right) \boldsymbol{\lambda}^{i} (\mathbf{1} + \mathbf{1})^{i} = \left(\frac{\Phi}{\lambda^{n-1}}\right) (2\lambda)^{i} = (2\lambda)^{i} \boldsymbol{\varepsilon},$$

i.e., the bounds of (5) are proven. Finally, in the case where *x*~ð Þ 0 6¼ **0**, the bounds of (5) are obtained asymptotically, that is, within a short time constant ð Þ *n* � 1 *=λ*. Please note that since the single filter block has a time constant equal to 1*=λ* as seen from the above analysis starting from (3), the sequence of ð Þ *n* � 1 filter blocks will have the time constants equal to ð Þ *n* � 1 *=λ*.

Hence, we, indeed, have replaced an *nth*-order *tracking problem* by a first-order *stabilization problem*, and have quantified with inequality (5) the transformations in which the performance measures correspond to.

Keeping the scalar *s* at zero, which is a simplified first-order problem, can now be achieved by choosing the control law *u* of (1) such that apart from *S t*ð Þ

$$\frac{1}{2}\frac{d}{dt}\mathfrak{s}^2 \le -\eta|\mathfrak{s}|,\tag{6}$$

where *η* is a strictly positive design constant and ensures inequality (6) which is called *η*- reachability condition. A fundamental requirement is that the sliding mode dynamics must be attractive to the system state and there are many reachability conditions defined in the literature [13–17]. Basically, inequality (6) indicates that the squared "distance" to the surface, as measured by *s* 2, decreases throughout entire system trajectories. Therefore, it restricts trajectories to head toward the surface *S t*ð Þ, as depicted in **Figure 3**. Particularly, when they are on the surface, the system trajectories remain on the surface. In other words, the fact that the surface is an *invariant set* indicates that condition (6) (a.k.a., *sliding condition*) is satisfied*.* Moreover, as we shall notice, inequality (6) also suggests tolerating some disturbances or dynamic uncertainties while still holding the surface stationary (i.e., an invariant set). In **Figure 3**, this graphically means that the trajectories away from the surface can "move" while still denoting the surface. *S t*ð Þ verifying (6) is referred to as a *sliding surface*, and the system behavior that occurs on the surface is called *sliding regime* or *sliding mode*.

Another appealing feature of the invariant set *S t*ð Þ is that when the system trajectories are on the set, it is defined by the equation of the set itself, i.e.,

$$\left(\frac{d}{dt} + \lambda\right)^{n-1}\ddot{x} = \mathbf{0}.$$

**Figure 3.** *The sliding condition.*

#### *Automation and Control*

That is to say, the surface *S t*ð Þ represents both a place and a dynamics. This fact is clearly the geometric interpretation of our previous statement that definition (3), in fact, allows us to substitute a first-order problem for an *nth-*order one.

Finally, if condition (2) is not fully validated, i.e., if *x*ð Þ *t* ¼ 0 is indeed away from *xd*ð Þ *t* ¼ 0 , then, nevertheless, satisfying (6) gives a guarantee for reaching the surface *S t*ð Þ at a *finite time* smaller than j j *s t*ð Þ ¼ 0 *=η*. Indeed, assume, for instance, that *s t*ð Þ ¼ 0 >0 and define *treach* as the time needed to hit the surface *s* ¼ 0. Integrating (6) between the points *t* ¼ 0 and *t* ¼ *treach* (i.e., in the interval [0, *treach*]) gives rise to:

$$
\mathbf{0} - \mathbf{s}(t=\mathbf{0}) = \mathbf{s}(t=t\_{reach}) - \mathbf{s}(t=\mathbf{0}) \le -\eta(t\_{reach} - \mathbf{0}),
$$

which means that

$$t\_{reach} \le \mathfrak{s}(t=\mathbf{0})/\eta. \tag{7}$$

This result can simply be proven to be true by starting to integrate both sides of (6) between 0 and *treach* as follows:

$$\int\_{t=0}^{t=t\_{\rm{rack}}} \frac{1}{2} \frac{d}{dt} s^2 dt \le -\int\_{t=0}^{t=t\_{\rm{rock}}} \eta|s| dt.$$

Making the necessary simplifications within the integrals, we get the following:

$$\int\_{t=0}^{t=t\_{mck}} ds \le -\int\_{t=0}^{t=t\_{mck}} \eta dt.$$

Now, the integrals are taken and evaluated for the lower and upper limits as shown below:

$$s(t = t\_{reach}) - s(t = \mathbf{0}) \le -\eta (t\_{reach} - \mathbf{0}).$$

Finally from here,

$$s(t=0) \ge \eta t\_{reatch}$$

is written, and the same result as (7) is hereby obtained. Even if *s t*ð Þ ¼ 0 < 0, a similar result would be obtained, and thus, writing the above inequality as follows would be a correct representation:

$$t\_{reach} \le |\mathfrak{s}(t = \mathbf{0})|/\eta.$$

Furthermore, definition (3) implies that once on the surface, the tracking error tends exponentially to zero, with a time constant ð Þ *n* � 1 *=λ*.

The typical system behavior implied by satisfying sliding condition (6) is shown in **Figure 4** for *n* ¼ 2. A line with slope –*λ* and containing the time-varying point *x<sup>d</sup>* ¼ ½ � *xd x*€*<sup>d</sup> <sup>T</sup>* represents the sliding surface in the phase plane. The state trajectory reaches the time-varying surface in a finite time smaller than *s t*ð Þ ¼ 0 *=η* from any initial condition, and then slides across the surface towards *x<sup>d</sup>* exponentially, with a time constant equal to 1*=λ*.

In conclusion, the idea behind (3) and (6) is to obtain an appropriate function of the tracking error, *s*, in accordance with (3), and then choose the feedback control law *u* in (1) such that *s* <sup>2</sup> continues to be used as a Lyapunov-like function of the closed-loop system, in spite of the presence of model imprecision and of

*An In-Depth Analysis of Sliding Mode Control and Its Application to Robotics DOI: http://dx.doi.org/10.5772/intechopen.93027*

**Figure 4.** *Graphically represented Eqs. (3) and (6) for n* ¼ 2*.*

disturbances. Then, the controller design is a two-step procedure. First, the selection of a feedback control law *u* is performed to verify sliding condition (6). However, it is required that the control law be *discontinuous throughout S t*ð Þ to take into account the presence of modeling imprecision and of disturbances. Since the execution of the associated control switchings is not necessarily perfect (for instance, in practice, switching is not instantaneous, and the value of *s* is not known with infinite precision), this causes *chattering* (**Figure 5**). Now, with a few important exceptions, chattering is practically undesirable, because it contains high control activity and can trigger neglected high-frequency dynamics during modeling (such as unmodeled structural modes, neglected time-delays, etc.). Thus, in a second step, the *discontinuous control law u* is *smoothed accordingly to reach an optimal compromise between control bandwidth and tracking precision*: while the first step explains parametric uncertainty, the second step ensures robustness to highfrequency unmodeled dynamics.

As mentioned previously, the discontinuous control law causes chattering of the trajectories to take place around the surface *s* ¼ 0. This problem can be eliminated

**Figure 5.** *Chattering caused by the switching delays.*

**Figure 6.** *Boundary layer with thickness* ∅*:*

by smoothing out the discontinuities in the vicinity of the sliding surface through the introduction of a boundary layer thickness. An adaptation of saturation nonlinearity instead of signum nonlinearity in a position control system in which it is represented by Eqs. (83) and (84) in order to decrease the chattering phenomenon caused by sliding mode control law is the result of the same effort of smoothing out the discontinuities with the introduction of the boundary layer thickness as illustrated in **Figure 6**.

To maintain the system work in the sliding surface, a switching action term, *usw*, is added to the control law, and is defined by

$$u\_{sw} = -\text{Ksat}(s),$$

and overall control law can be expressed as:

$$\boldsymbol{u} = \boldsymbol{\hat{u}} + \boldsymbol{u}\_{sw} = \underbrace{\left(-\boldsymbol{\hat{f}} + \boldsymbol{\ddot{x}}\_{d} - \lambda \boldsymbol{\dot{\dot{x}}}\right)}\_{\text{Low frequency control}} - \underbrace{\mathbf{K} \mathbf{s} \mathbf{a} \mathbf{t} (\mathbf{s})}\_{\text{High frequency control}}$$

,

which will be explained in more detail in Section 5.1. Here, the nonlinear saturation function *sat s*ð Þ, which is the replacement for nonlinear signum function *sgn s*ð Þ, is defined by

$$\text{sat}(\mathfrak{s}) = \begin{cases} -\mathbf{1}, & \frac{\mathfrak{s}}{\mathfrak{Q}} < \mathbf{0} \\\\ \mathbf{0}, & \left| \frac{\mathfrak{s}}{\mathfrak{Q}} \right| < \mathbf{1}, \\\\ \mathbf{1}, & \frac{\mathfrak{s}}{\mathfrak{Q}} < -\mathbf{1} \end{cases}$$

where ∅ is the boundary layer thickness.

*An In-Depth Analysis of Sliding Mode Control and Its Application to Robotics DOI: http://dx.doi.org/10.5772/intechopen.93027*
