**5.1 Introduction to sliding mode control**

The sliding mode control (SMC) strategy deals with the design of a sliding manifold also called as a sliding surface which basically describe the desired behavior of the system. The designed control law works to bring the system states onto the user defined sliding surface and then slide them towards the equilibrium point along this surface. The general form of the sliding surface was proposed by Slotine and Li and is defined as [16]:

$$\mathbf{S} = \left(\frac{d}{dt} + c\_i\right)^{r-1} \mathbf{e} = \mathbf{0} \tag{30}$$

where *e* is the tracking error defined as *e* ¼ *x* � *xd*. *ci* is a positive constant and *r* is the relative degree of the SMC. In the presence of external disturbances and

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle DOI: http://dx.doi.org/10.5772/intechopen.86057*

uncertainties, the system trajectories may deviate from the sliding surface. This can be overcome by making the sliding surface attractive. To ensure sliding surface attractiveness, Lyapunov's theory is utilized as shown below:

Consider the Lyapunov's function *V* given as:

$$V = \frac{1}{2} \mathbf{S}^2 \tag{31}$$

To make the sliding surface attractive and to guarantee asymptotic stability, *V*\_ must be negative definite. In order to make *V*\_ negative definite following condition must be satisfied.

$$\text{S\dot{S}} < 0 \tag{32}$$

In order to achieve finite-time convergence (global finite-time stability), the above condition is modified as:

$$\text{LS} \dot{\text{S}} \le -\eta V^{1/2} \tag{33}$$

To satisfy the above inequality condition, a reaching law is selected as:

$$
\dot{\mathbf{S}} = -K \text{sign}(\mathbf{S}) \tag{34}
$$

where *K* is the gain and is always positive. The signum function, *sign S*ð Þ, may be defined as:

$$\operatorname{sign}(\mathcal{S}) = \begin{cases} +1 & \mathcal{S} > 0 \\ 0 & \mathcal{S} = \mathbf{0} \\ -1 & \mathcal{S} < \mathbf{0} \end{cases}$$

The control law generated using SMC has two components defined as [17]:

$$u(t) = u\_{eq}(t) + u\_h(t) \tag{35}$$

where *ueq*ð Þ*t* is the equivalent control, which can be derived by the invariance condition of the sliding surface, i.e., *<sup>S</sup>* <sup>¼</sup> 0 and \_ *S* ¼ 0, and *uh*ð Þ*t* is a hitting control law also called reaching law based control, which can be obtained by testing the attractiveness condition. This hitting law is basically used to overcome the effect of uncertainties and unpredictable disturbances. Chattering appears in SMC due to signum function and can be overcome by using boundary layer method, in which the signum function is replaced by a continuous approximation function like a saturation or hyperbolic function [18].

To understand the basic steps of control law design using sliding mode, Let us consider a second order uncertain nonlinear system [19]

$$\begin{aligned} \dot{\mathbf{x}}\_1 &= \mathbf{x}\_2\\ \dot{\mathbf{x}}\_2 &= f(\mathbf{x}) + \mathbf{g}(\mathbf{x})u(t) + d \end{aligned} \qquad\tag{36}$$

where *x* ¼ ½ � *x*<sup>1</sup> *x*<sup>2</sup> *<sup>T</sup>* is the system state vector, *f x*ð Þ and *g x*ð Þ 6¼ 0 are smooth nonlinear functions, and bounded uncertain term *d* satisfies ∣*d*∣ ≤*ds* >0, and *u t*ð Þ is the scalar control input.

**5. Control strategy**

*Real-time implementation.*

**Figure 5.**

**40**

**Figure 4.**

*A marker at the world's reference.*

*Unmanned Robotic Systems and Applications*

and Li and is defined as [16]:

**5.1 Introduction to sliding mode control**

The sliding mode control (SMC) strategy deals with the design of a sliding manifold also called as a sliding surface which basically describe the desired behavior of the system. The designed control law works to bring the system states onto the user defined sliding surface and then slide them towards the equilibrium point along this surface. The general form of the sliding surface was proposed by Slotine

> *dt* <sup>þ</sup> *ci <sup>r</sup>*�<sup>1</sup>

is the relative degree of the SMC. In the presence of external disturbances and

where *e* is the tracking error defined as *e* ¼ *x* � *xd*. *ci* is a positive constant and *r*

*e* ¼ 0 (30)

*<sup>S</sup>* <sup>¼</sup> *<sup>d</sup>*

Let us define the tracking error as:

$$e = \mathfrak{x}\_1 - \mathfrak{x}\_d \tag{37}$$

From Eq. (42), Substitute *u* in Eq. (45) then

*DOI: http://dx.doi.org/10.5772/intechopen.86057*

Since *<sup>V</sup>*\_ is negative semi definite for *<sup>K</sup>* <sup>≥</sup>*ds* <sup>þ</sup> *<sup>η</sup>*

*tr*. To derive an expression for *tr*: From Eq. (33), we can write

0≤*t*≤*tr*, we obtain

where:

**43**

**5.2 SMC design for quadrotor**

*<sup>V</sup>*\_ <sup>¼</sup> *<sup>S</sup>*ð Þ �*K sign S*ð Þþ *<sup>d</sup>* ≤ � *K*∣*S*∣ þ *ds*∣*S*∣

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle*

¼ �∣*S*∣ð Þ *<sup>K</sup>* � *ds* <sup>≤</sup> � *<sup>η</sup>*

convergence of the sliding manifold. As a result, states are converging to desired value asymptotically. There are two phases associated with sliding mode control namely reaching phase and sliding phase. The reaching phase, is the part where the state trajectory starts from its initial condition and moves toward the sliding surface. In sliding phase, trajectories moves only on the desired sliding surface. The time taken by the states to reach sliding surface is called reaching time, denoted as

Indeed, separating variables and integrating Eq. (47) over the time interval

Therefore, a control *u* that is computed to satisfy Eq. (47) will drive the variable *S* to zero in finite time *tr* and will keep it at zero thereafter. Now we extend this idea

*tr* <sup>¼</sup> <sup>2</sup> *η*

to the quadrotor by using the model represented by the equation set (28).

*ϕ*\_ *Jy* � *Jz Jx* � � \_

\_ *θ Jz* � *Jx Jy* !

*ψ*\_ *Jx* � *Jy Jz* � �*ϕ*\_ \_

*z*\_ �*g x*\_ 0 *y*\_ 0

*θψ*\_

1

*ϕ*\_ *ψ*\_

*θ*

CCCCCCCCCCCCCCCCCCCCCCCCCCCA *,* **d** ¼

Let us represent the non-linear model of the quadrotor as:

0

BBBBBBBBBBBBBBBBBBBBBBBBBBB@

**f x**ð Þ¼

ffiffi 2 p ∣*S*∣

<sup>p</sup> . This ensure the finite time

*<sup>V</sup>*\_ ¼ �*ηV*<sup>1</sup>*=*<sup>2</sup> (47)

*<sup>V</sup>*ð Þ <sup>0</sup> <sup>1</sup>*=*<sup>2</sup> (48)

**x**\_ ¼ **f x**ð Þþ **g x**ð Þ**u** þ **d** (49)

0 *dϕ* 0 *dθ* 0 *dψ* 0 *dz* 0 *dx* 0 *dy*

1

CCCCCCCCCCCCCCCCCCCCA

(50)

0

BBBBBBBBBBBBBBBBBBBB@

ffiffi 2 (46)

where *xd* is the desired value of the controlled variable *x*1. The sliding variable is selected as:

$$S = \dot{\mathbf{e}} + \lambda \mathbf{e} \tag{38}$$

where *λ*>0. Taking the time derivative of *S* we get:

$$\begin{aligned} \dot{S} &= \ddot{e} + \lambda \dot{\mathcal{e}} \\ &= (\dot{\varkappa}\_2 - \ddot{\varkappa}\_d) + \lambda (\dot{\varkappa}\_1 - \dot{\varkappa}\_d) \\ &= (f(\varkappa) + g(\varkappa)u(t) + d - \ddot{\varkappa}\_d) + \lambda (\dot{\varkappa}\_1 - \dot{\varkappa}\_d) \end{aligned} \tag{39}$$

The equivalent control effort which is designed to guarantee desired performance under nominal model is derived as the solution of \_ *S* ¼ 0 without considering modeling errors and un-modeled dynamics ð Þ *d* ¼ 0 . It is represented by *ueq* and given by:

$$\mu\_{eq} = \frac{1}{g(\varkappa)} \left[ \ddot{\varkappa}\_d - f(\varkappa) - \lambda(\varkappa\_2 - \dot{\varkappa}\_d) \right] \tag{40}$$

The hitting control law *uh*, to eliminate the effect of perturbations in conventional SMC, is chosen as:

$$u\_h = -\frac{K}{\mathbf{g}(\boldsymbol{\alpha})} \text{sign}(\mathbf{S}) \tag{41}$$

Hence the control law *u* will be the summation of *ueq* and *uh* and is written as:

$$u = \frac{1}{g(\boldsymbol{\omega})} [\ddot{\boldsymbol{x}}\_d - f(\boldsymbol{\omega}) - \lambda(\boldsymbol{\omega}\_2 - \dot{\boldsymbol{x}}\_d) - K \operatorname{sign}(\mathbf{S})] \tag{42}$$

Now we wish to prove that, for the system Eq. (36), with the sliding variable Eq. (38), if the control law is designed as:

$$u = \frac{1}{g(\boldsymbol{\pi})} \left[ \ddot{\boldsymbol{x}}\_d - f(\boldsymbol{\pi}) - \lambda(\boldsymbol{\pi}\_2 - \dot{\boldsymbol{x}}\_d) - K \operatorname{sign}(\mathbf{S}) \right] \tag{43}$$

with *λ*>0 then the *S* ¼ 0 will be reached in finite time. Also, the states *x*<sup>1</sup> and *x*<sup>2</sup> will converge to zero asymptotically. We use the Lyapunov's stability criteria: Let us choose the following Lyapunov candidate function as:

$$V = \frac{1}{2} \mathbf{S}^2 \tag{44}$$

Taking the time derivative of *V* we get:

$$\begin{split} \dot{V} &= \mathcal{S}\dot{\mathcal{S}} \\ &= \mathcal{S}[f(\boldsymbol{\omega}) + \mathcal{g}(\boldsymbol{\omega})\boldsymbol{u} + d - \ddot{\boldsymbol{\omega}}\_d + \lambda(\boldsymbol{\omega}\_2 - \dot{\boldsymbol{\omega}}\_d)] \end{split} \tag{45}$$

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle DOI: http://dx.doi.org/10.5772/intechopen.86057*

From Eq. (42), Substitute *u* in Eq. (45) then

Let us define the tracking error as:

*Unmanned Robotic Systems and Applications*

The sliding variable is selected as:

Taking the time derivative of *S* we get:

\_ *S* ¼ *e*€þ *λe*\_

where *λ*>0.

given by:

**42**

tional SMC, is chosen as:

where *xd* is the desired value of the controlled variable *x*1.

¼ ð Þþ *x*\_ <sup>2</sup> � *x*€*<sup>d</sup> λ x*\_ ð Þ <sup>1</sup> � *x*\_ *<sup>d</sup>*

mance under nominal model is derived as the solution of \_

*ueq* <sup>¼</sup> <sup>1</sup>

*<sup>u</sup>* <sup>¼</sup> <sup>1</sup>

*<sup>u</sup>* <sup>¼</sup> <sup>1</sup>

Taking the time derivative of *V* we get:

*<sup>V</sup>*\_ <sup>¼</sup> *<sup>S</sup>* \_ *S*

choose the following Lyapunov candidate function as:

Eq. (38), if the control law is designed as:

¼ ð *f x*ð Þþ *g x*ð Þ*u t*ðÞþ *d* � *x*€*d*Þ þ *λ x*\_ ð Þ <sup>1</sup> � *x*\_ *<sup>d</sup>*

The equivalent control effort which is designed to guarantee desired perfor-

The hitting control law *uh*, to eliminate the effect of perturbations in conven-

Hence the control law *u* will be the summation of *ueq* and *uh* and is written as:

Now we wish to prove that, for the system Eq. (36), with the sliding variable

with *λ*>0 then the *S* ¼ 0 will be reached in finite time. Also, the states *x*<sup>1</sup> and *x*<sup>2</sup> will converge to zero asymptotically. We use the Lyapunov's stability criteria: Let us

> *<sup>V</sup>* <sup>¼</sup> <sup>1</sup> 2

¼ *Sf x* ½ � ð Þþ *g x*ð Þ*u* þ *d* � *x*€*<sup>d</sup>* þ *λ*ð Þ *x*<sup>2</sup> � *x*\_ *<sup>d</sup>*

*uh* ¼ � *<sup>K</sup>*

modeling errors and un-modeled dynamics ð Þ *d* ¼ 0 . It is represented by *ueq* and

*e* ¼ *x*<sup>1</sup> � *xd* (37)

*S* ¼ *e*\_ þ *λe* (38)

*g x*ð Þ½ � *<sup>x</sup>*€*<sup>d</sup>* � *f x*ð Þ� *<sup>λ</sup>*ð Þ *<sup>x</sup>*<sup>2</sup> � *<sup>x</sup>*\_ *<sup>d</sup>* (40)

*g x*ð Þ½ � *<sup>x</sup>*€*<sup>d</sup>* � *f x*ð Þ� *<sup>λ</sup>*ð Þ� *<sup>x</sup>*<sup>2</sup> � *<sup>x</sup>*\_ *<sup>d</sup> K sign S*ð Þ (42)

*g x*ð Þ½ � *<sup>x</sup>*€*<sup>d</sup>* � *f x*ð Þ� *<sup>λ</sup>*ð Þ� *<sup>x</sup>*<sup>2</sup> � *<sup>x</sup>*\_ *<sup>d</sup> K sign S*ð Þ (43)

*g x*ð Þ*sign S*ð Þ (41)

*S*<sup>2</sup> (44)

(45)

(39)

*S* ¼ 0 without considering

$$\begin{split} \dot{\mathcal{V}} &= \mathcal{S}(-K \dot{\text{sign}}(\mathcal{S}) + d) \\ &\leq -K|\mathcal{S}| + d\_{\text{s}}|\mathcal{S}| \\ &= -|\mathcal{S}|(K - d\_{\text{s}}) \leq -\frac{\eta}{\sqrt{2}}|\mathcal{S}| \end{split} \tag{46}$$

Since *<sup>V</sup>*\_ is negative semi definite for *<sup>K</sup>* <sup>≥</sup>*ds* <sup>þ</sup> *<sup>η</sup>* ffiffi 2 <sup>p</sup> . This ensure the finite time convergence of the sliding manifold. As a result, states are converging to desired value asymptotically. There are two phases associated with sliding mode control namely reaching phase and sliding phase. The reaching phase, is the part where the state trajectory starts from its initial condition and moves toward the sliding surface. In sliding phase, trajectories moves only on the desired sliding surface. The time taken by the states to reach sliding surface is called reaching time, denoted as *tr*. To derive an expression for *tr*: From Eq. (33), we can write

$$
\dot{V} = -\eta V^{1/2} \tag{47}
$$

Indeed, separating variables and integrating Eq. (47) over the time interval 0≤*t*≤*tr*, we obtain

$$t\_r = \frac{2}{\eta} V(\mathbf{0})^{1/2} \tag{48}$$

Therefore, a control *u* that is computed to satisfy Eq. (47) will drive the variable *S* to zero in finite time *tr* and will keep it at zero thereafter. Now we extend this idea to the quadrotor by using the model represented by the equation set (28).

#### **5.2 SMC design for quadrotor**

Let us represent the non-linear model of the quadrotor as:

$$
\dot{\mathbf{x}} = \mathbf{f}(\mathbf{x}) + \mathbf{g}(\mathbf{x})\mathbf{u} + \mathbf{d} \tag{49}
$$

where:

$$\mathbf{f}(\mathbf{x}) = \begin{pmatrix} \dot{\phi} \\ \left(\frac{J\_{\mathcal{V}} - J\_{z}}{J\_{x}}\right) \dot{\partial}\dot{\psi} \\ \dot{\theta} \\ \left(\frac{J\_{x} - J\_{x}}{J\_{y}}\right) \dot{\phi}\dot{\psi} \\ \dot{\psi} \\ \left(\frac{J\_{x} - J\_{y}}{J\_{z}}\right) \dot{\phi}\dot{\theta} \\ \dot{z} \\ \dot{\tilde{x}} \\ \dot{\tilde{x}} \\ \dot{\tilde{x}} \\ 0 \\ \dot{\tilde{y}} \\ \dot{\tilde{y}} \\ 0 \end{pmatrix}, \mathbf{d} = \begin{pmatrix} 0 \\ d\_{\phi} \\ 0 \\ d\_{\theta} \\ 0 \\ d\_{\psi} \\ 0 \\ d\_{x} \\ 0 \\ \dot{d}\_{y} \\ 0 \\ \dot{d}\_{\tilde{y}} \end{pmatrix} \tag{50}$$

**g x**ð Þ¼ 0 000 0 1*=Jx* 0 0 0 000 0 01*=Jy* 0 0 000 0 0 01*=Jz* 0 000 ð Þ cos *ϕ* cos *θ =m* 000 0 000 *ux=m* 000 0 000 *uy=m* 000 0 BBBBBBBBBBBBBBBBBBBB@ 1 CCCCCCCCCCCCCCCCCCCCA (51) *S<sup>ϕ</sup>* ¼ *e*\_*<sup>ϕ</sup>* þ *λ*1*e<sup>ϕ</sup>* (56)

(57)

(60)

(64)

(65)

*d* � �

*d* � � � *<sup>K</sup>*1*sign S<sup>ϕ</sup>* � � � � (59)

> *θd* � � � *<sup>K</sup>*2*sign S*ð Þ*<sup>θ</sup>*

� � (58)

1

CA (61)

Taking the time derivative of *Sϕ*:

*DOI: http://dx.doi.org/10.5772/intechopen.86057*

\_

*S<sup>ϕ</sup>* ¼ *e*€*<sup>ϕ</sup>* þ *λ*1*e*\_*<sup>ϕ</sup>*

\_

From Eqs. (57) and (58) the control law can be chosen as:

*Jx*

On similar lines, *u*1, *ux*, *uy*, *u*<sup>3</sup> and *u*<sup>4</sup> are designed as:

€*<sup>d</sup>* � *Jz* � *Jx Jy*

0

B@

*Jz*

where *θ<sup>d</sup>* is computed from 52 and is given as:

*<sup>u</sup>*<sup>4</sup> <sup>¼</sup> *Jz <sup>ψ</sup>*€*<sup>d</sup>* � *Jx* � *Jy*

cos *x*1*cosx*<sup>3</sup>

*ux* <sup>¼</sup> *<sup>m</sup> u*1

*uy* <sup>¼</sup> *<sup>m</sup> u*1

*<sup>u</sup>*<sup>1</sup> <sup>¼</sup> *<sup>m</sup>*

The sliding variables are expressed as:

With the tracking errors as:

**45**

*<sup>u</sup>*<sup>2</sup> <sup>¼</sup> *Jx <sup>ϕ</sup>*€*<sup>d</sup>* � *Jy* � *Jz*

*u*<sup>3</sup> ¼ *Jy θ*

<sup>¼</sup> *<sup>ϕ</sup>*€ � *<sup>ϕ</sup>*€*<sup>d</sup>*

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle*

� � <sup>þ</sup> *<sup>λ</sup>*<sup>1</sup> *<sup>x</sup>*<sup>2</sup> � *<sup>ϕ</sup>*\_

*<sup>x</sup>*4*x*<sup>6</sup> � *<sup>λ</sup>*<sup>1</sup> *<sup>x</sup>*<sup>2</sup> � *<sup>ϕ</sup>*\_

*<sup>x</sup>*2*x*<sup>6</sup> � *<sup>λ</sup>*<sup>2</sup> *<sup>x</sup>*<sup>4</sup> � \_

*<sup>θ</sup><sup>d</sup>* <sup>¼</sup> sin �<sup>1</sup> *ux* cos *<sup>ψ</sup><sup>d</sup>* <sup>þ</sup> *uy* sin *<sup>ψ</sup><sup>d</sup>* ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

*S<sup>θ</sup>* ¼ *e*\_*<sup>θ</sup>* þ *λ*2*e<sup>θ</sup> S<sup>ψ</sup>* ¼ *e*\_*<sup>ψ</sup>* þ *λ*3*e<sup>ψ</sup> Sz* ¼ *e*\_*<sup>z</sup>* þ *λ*4*ez*

*e<sup>θ</sup>* ¼ *x*<sup>3</sup> � *θd; e<sup>ψ</sup>* ¼ *x*<sup>5</sup> � *ψd; ez* ¼ *x*<sup>7</sup> � *zd;*

*y*€*<sup>d</sup>* � *λ*<sup>6</sup> *x*<sup>12</sup> � *y*\_*<sup>d</sup>*

To achieve *x* and *y* motion control, the virtual inputs *ux* and *uy* are designed as:

½ � *x*€*<sup>d</sup>* � *λ*5ð Þ� *x*<sup>10</sup> � *x*\_ *<sup>d</sup> K*5*sign S*ð Þ*<sup>x</sup>*

� � � *<sup>K</sup>*6*sign Sy*

� � � � (66)

" #

1 � *ux* sin *ψ<sup>d</sup>* � *uy* cos *ψ<sup>d</sup>* � �<sup>2</sup> <sup>q</sup>

*x*2*x*<sup>4</sup> � *λ*<sup>3</sup> *x*<sup>6</sup> � *ψ*\_ *<sup>d</sup>* ð Þ� *K*3*sign S<sup>ψ</sup>* � � � � (62)

> 9 >>=

> >>;

9 = ;

½ � *z*€*<sup>d</sup>* þ *g* � *λ*4ð Þ� *x*<sup>8</sup> � *z*\_*<sup>d</sup> K*4*sign S*ð Þ*<sup>z</sup>* (63)

In order to eliminate the disturbance effects, the reaching law is selected as:

*S<sup>ϕ</sup>* ¼ �*K*<sup>1</sup> *sign S<sup>ϕ</sup>*

Here, the terms *ux* and *uy* are termed as virtual inputs and are evaluated as:

$$\begin{aligned} u\_{\mathfrak{x}} &= \cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi\\ u\_{\mathfrak{y}} &= \cos\phi \sin\theta \sin\psi - \sin\phi \cos\psi \end{aligned} \tag{52}$$

From Eq. (49), the state vector can be expressed as

**<sup>x</sup>** <sup>¼</sup> *<sup>ϕ</sup>; <sup>ϕ</sup>*\_ *; <sup>θ</sup>;* \_ *θ; ψ; ψ*\_ *; z; z*\_*; x; x*\_*; y; y*\_ � �*<sup>T</sup>* and the control input vector as **u** ¼ ð Þ *u*1*; u*2*; u*3*; u*<sup>4</sup> *<sup>T</sup>* which corresponds to *F; τϕ; τθ; τψ* � �. **d** represents bounded lumped disturbance which is a sum of modeling uncertainties and external wind gust disturbance associated with the quadrotor dynamics. For convenience, let the states of the system be renamed as: **x** ¼ ð Þ *x*1*; x*2*; x*3*; x*4*; x*5*; x*6*; x*7*; x*8*; x*9*; x*10*; x*11*; x*<sup>12</sup> *T*.

The quadrotor dynamical model can be split into 6 second-order sub-systems, namely the altitude, *x*-position, *y*-position, roll, pitch and yaw sub-systems. The altitude and yaw sub-systems are controlled directly by *u*! and *u*4. However, the position sub-systems are coupled with the roll and pitch sub-systems. Hence, the concept of virtual control is utilized to develop the control scheme. Hence, *ux* and *uy* will control the x and y positions and *u*<sup>2</sup> and *u*<sup>3</sup> will control the roll and pitch sub-systems.

In order to design *u*2, let us consider the roll subsystem which can be obtained from Eq. (49) given as:

$$\begin{aligned} \dot{\varkappa}\_1 &= \varkappa\_2 \\ \dot{\varkappa}\_2 &= \frac{J\_\mathcal{Y} - J\_x}{J\_\mathcal{X}} \varkappa\_4 \varkappa\_6 + \frac{u\_2}{J\_\mathcal{X}} + d\_\phi \end{aligned} \tag{53}$$

As mentioned previously, *d<sup>ϕ</sup>* is the bounded lumped uncertainty in the roll dynamics with an upper bound of *ds*. Let us consider the tracking error in roll angle as:

$$e\_{\phi} = \mathbf{x}\_1 - \phi\_d \tag{54}$$

where *ϕ<sup>d</sup>* is computed from Eq. (52) as:

$$\phi\_d = \sin^{-1} \left( u\_\mathbf{x} \sin \psi\_d - u\_\mathbf{y} \cos \psi\_d \right) \tag{55}$$

The sliding variable is defined as:

and

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle DOI: http://dx.doi.org/10.5772/intechopen.86057*

$$S\_{\phi} = \dot{\varepsilon}\_{\phi} + \lambda\_1 \varepsilon\_{\phi} \tag{56}$$

Taking the time derivative of *Sϕ*:

and

**<sup>x</sup>** <sup>¼</sup> *<sup>ϕ</sup>; <sup>ϕ</sup>*\_ *; <sup>θ</sup>;* \_

sub-systems.

angle as:

**44**

from Eq. (49) given as:

**u** ¼ ð Þ *u*1*; u*2*; u*3*; u*<sup>4</sup>

**g x**ð Þ¼

*Unmanned Robotic Systems and Applications*

0

BBBBBBBBBBBBBBBBBBBB@

From Eq. (49), the state vector can be expressed as

*x*\_ <sup>1</sup> ¼ *x*<sup>2</sup>

where *ϕ<sup>d</sup>* is computed from Eq. (52) as:

The sliding variable is defined as:

*<sup>x</sup>*\_ <sup>2</sup> <sup>¼</sup> *Jy* � *Jz Jx*

*θ; ψ; ψ*\_ *; z; z*\_*; x; x*\_*; y; y*\_ � �*<sup>T</sup>* and the control input vector as

*<sup>T</sup>* which corresponds to *F; τϕ; τθ; τψ*

0 000 0 1*=Jx* 0 0 0 000 0 01*=Jy* 0 0 000 0 0 01*=Jz* 0 000

1

CCCCCCCCCCCCCCCCCCCCA

� �. **d** represents bounded

(51)

(52)

*T*.

(53)

ð Þ cos *ϕ* cos *θ =m* 000 0 000 *ux=m* 000 0 000 *uy=m* 000

Here, the terms *ux* and *uy* are termed as virtual inputs and are evaluated as:

*ux* ¼ cos *ϕ* sin *θ* cos *ψ* þ sin *ϕ* sin *ψ uy* ¼ cos *ϕ* sin *θ* sin *ψ* � sin *ϕ* cos *ψ*

lumped disturbance which is a sum of modeling uncertainties and external wind gust disturbance associated with the quadrotor dynamics. For convenience, let the states of the system be renamed as: **x** ¼ ð Þ *x*1*; x*2*; x*3*; x*4*; x*5*; x*6*; x*7*; x*8*; x*9*; x*10*; x*11*; x*<sup>12</sup>

The quadrotor dynamical model can be split into 6 second-order sub-systems, namely the altitude, *x*-position, *y*-position, roll, pitch and yaw sub-systems. The altitude and yaw sub-systems are controlled directly by *u*! and *u*4. However, the position sub-systems are coupled with the roll and pitch sub-systems. Hence, the concept of virtual control is utilized to develop the control scheme. Hence, *ux* and *uy* will control the x and y positions and *u*<sup>2</sup> and *u*<sup>3</sup> will control the roll and pitch

In order to design *u*2, let us consider the roll subsystem which can be obtained

*x*4*x*<sup>6</sup> þ

As mentioned previously, *d<sup>ϕ</sup>* is the bounded lumped uncertainty in the roll dynamics with an upper bound of *ds*. Let us consider the tracking error in roll

*<sup>ϕ</sup><sup>d</sup>* <sup>¼</sup> sin �<sup>1</sup> *ux* sin *<sup>ψ</sup><sup>d</sup>* � *uy* cos *<sup>ψ</sup><sup>d</sup>*

*u*2 *Jx* þ *d<sup>ϕ</sup>* 9 >=

>;

*e<sup>ϕ</sup>* ¼ *x*<sup>1</sup> � *ϕ<sup>d</sup>* (54)

� � (55)

$$\begin{split} \dot{\vec{S}}\_{\phi} &= \ddot{\varepsilon}\_{\phi} + \lambda\_1 \dot{\varepsilon}\_{\phi} \\ &= \left( \ddot{\phi} - \ddot{\phi}\_d \right) + \lambda\_1 (\infty\_2 - \dot{\phi}\_d) \end{split} \tag{57}$$

In order to eliminate the disturbance effects, the reaching law is selected as:

$$\dot{\mathcal{S}}\_{\phi} = -K\_1 \text{sign}\left(\mathbb{S}\_{\phi}\right) \tag{58}$$

From Eqs. (57) and (58) the control law can be chosen as:

$$\mu\_2 = J\_x \left[ \ddot{\phi}\_d - \frac{J\_\gamma - J\_x}{J\_x} \mathbf{x}\_4 \mathbf{x}\_6 - \lambda\_1 \left( \mathbf{x}\_2 - \dot{\phi}\_d \right) - K\_1 \text{sign} \left( \mathbf{S}\_\phi \right) \right] \tag{59}$$

On similar lines, *u*1, *ux*, *uy*, *u*<sup>3</sup> and *u*<sup>4</sup> are designed as:

$$\mathfrak{u}\_3 = J\_\gamma \left[ \ddot{\theta}\_d - \frac{J\_x - J\_x}{J\_\gamma} \mathbf{x}\_2 \mathbf{x}\_6 - \lambda\_2 (\mathbf{x}\_4 - \dot{\theta}\_d) - K\_2 \text{sign}(\mathbf{S}\_\theta) \right] \tag{60}$$

where *θ<sup>d</sup>* is computed from 52 and is given as:

$$\theta\_d = \sin^{-1}\left(\frac{u\_x \cos \psi\_d + u\_y \sin \psi\_d}{\sqrt{1 - \left(u\_x \sin \psi\_d - u\_y \cos \psi\_d\right)^2}}\right) \tag{61}$$

$$u\_4 = J\_x \left[ \ddot{\boldsymbol{\nu}}\_d - \frac{J\_x - J\_y}{J\_x} \mathbf{x}\_2 \mathbf{x}\_4 - \lambda\_3 (\mathbf{x}\_6 - \dot{\boldsymbol{\nu}}\_d) - K\_3 \text{sign} \left( \mathbf{S}\_{\boldsymbol{\nu}} \right) \right] \tag{62}$$

$$\mu\_1 = \frac{m}{\cos \varkappa\_1 \cos \varkappa\_3} [\ddot{z}\_d + \text{g} - \lambda\_4(\varkappa\_8 - \dot{z}\_d) - K\_4 \text{sign}(\mathbb{S}\_\mathbb{z})] \tag{63}$$

The sliding variables are expressed as:

$$\begin{aligned} S\_{\theta} &= \dot{\varepsilon}\_{\theta} + \lambda\_2 \varepsilon\_{\theta} \\ S\_{\psi} &= \dot{\varepsilon}\_{\psi} + \lambda\_3 \varepsilon\_{\psi} \\ S\_x &= \dot{\varepsilon}\_x + \lambda\_4 \varepsilon\_x \end{aligned} \tag{64}$$

With the tracking errors as:

$$\begin{aligned} \mathbf{e}\_{\theta} &= \mathbf{x}\_{3} - \theta\_{d}; \\ \mathbf{e}\_{\psi} &= \mathbf{x}\_{5} - \psi\_{d}; \\ \mathbf{e}\_{x} &= \mathbf{x}\_{7} - \mathbf{z}\_{d}; \end{aligned} \tag{65}$$

To achieve *x* and *y* motion control, the virtual inputs *ux* and *uy* are designed as:

$$\begin{aligned} u\_{\mathbf{x}} &= \frac{m}{u\_1} \left[ \ddot{\mathbf{x}}\_d - \dot{\lambda}\_5 (\mathbf{x}\_{10} - \dot{\mathbf{x}}\_d) - K\_\mathcal{S} \text{sign}(\mathbf{S}\_\mathbf{x}) \right] \\ u\_{\mathbf{y}} &= \frac{m}{u\_1} \left[ \ddot{\mathbf{y}}\_d - \dot{\lambda}\_6 \left( \mathbf{x}\_{12} - \dot{\mathbf{y}}\_d \right) - K\_\mathcal{S} \text{sign}(\mathbf{S}\_\mathbf{y}) \right] \end{aligned} \tag{66}$$

where

$$\begin{aligned} \mathcal{S}\_{\mathfrak{x}} &= \dot{e}\_{\mathfrak{x}} + \lambda\_{\mathfrak{S}} e\_{\mathfrak{x}} \\ \mathcal{S}\_{\mathfrak{y}} &= \dot{e}\_{\mathfrak{y}} + \lambda\_{\mathfrak{G}} e\_{\mathfrak{y}} \end{aligned} \tag{67}$$

where ∣*di*∣<*dsi*. Hence, the convergence of **S** is proven by the Lyapunov stability

This section presents the simulation results of the SMC described in the previous section. The tracking performance of the quadrotor is evaluated by making it track a circle of radius 1 m at an altitude of 3 m with a desired yaw angle of *π=*6. The

The control inputs are shown in **Figures 10**–**13**. One can observe that there exists a presence of chattering in the control inputs when using the signum function and cannot be directly implemented in real-time hardware. To overcome this, the boundary layer approximation is utilized which smoothens the control inputs.

theory. The sliding variables are converging to zero in finite time, i.e., **S** ! 0. Therefore, tracking error will converge to zero asymptotically, i.e., **e** ! 0.

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle*

**6. Simulation results**

**Figure 6.** *X-position tracking.*

**Figure 7.** *Y-position tracking.*

**47**

tracking performance is shown in **Figures 6**–**9**.

*DOI: http://dx.doi.org/10.5772/intechopen.86057*

and

$$\begin{aligned} \mathcal{e}\_{\mathfrak{X}} &= \mathfrak{x}\_{\mathfrak{Y}} - \mathfrak{x}\_{d\mathfrak{Y}} \\ \mathcal{e}\_{\mathfrak{Y}} &= \mathfrak{x}\_{11} - \mathfrak{y}\_{d\mathfrak{Y}} \end{aligned} \qquad\tag{68}$$

As previously done, the task now is to prove that the system Eq. (49), with the sliding variables given by Eqs. (56), (64) and (67). If the control laws are designed as Eqs. (59), (60), (62), (63), and (66) then the sliding manifolds are reached in finite time *tr* and the tracking error *eϕ, eθ, e<sup>ψ</sup> , ez, ex, ey* will stay on the sliding manifolds thereafter. Consequently the controlled states *x*1*, x*3*, x*5*, x*7*, x*9*, x*<sup>11</sup> will converge to the desired values in finite time *tf* in the presence of bounded disturbance and uncertainties.

To do so, let us select a candidate Lyapunov function as:

$$V = \frac{1}{2} \mathbf{S}^{\mathsf{T}} \mathbf{S} \tag{69}$$

where **S** ¼ *Sϕ; Sθ; S<sup>ψ</sup> ; Sz; Sx; Sy* � �*<sup>T</sup>* . By taking the time derivative of the Lyapunov energy function Eq. (69), one can get:

$$
\dot{V} = \mathbf{S}^{\mathsf{T}} \dot{\mathbf{S}} \tag{70}
$$

where **<sup>S</sup>**\_ <sup>¼</sup> \_ *Sϕ;* \_ *Sθ;* \_ *S<sup>ψ</sup> ;* \_ *Sz;* \_ *Sx;* \_ *Sy* � �*<sup>T</sup>* . After substitution of *S*, *V*\_ can be expressed as:

$$
\dot{V} = \mathbf{S}^{\mathbf{T}} (\ddot{\mathbf{e}} + A\dot{\mathbf{e}}) \tag{71}
$$

where **e**\_ ¼ *e*\_*ϕ;e*\_*θ;e*\_*<sup>ψ</sup> ;e*\_*z;e*\_*x;e*\_*<sup>y</sup>* � �*<sup>T</sup>* and **A** is the diagonal matrices where **A** ¼ *diag*f g *λ*1*; λ*2*; λ*3*; λ*4*; λ*5*; λ*<sup>6</sup> with *λ<sup>i</sup>* > 0. Substituting the value of designed control laws in Eq. (71):

$$\dot{V} = \mathbf{S}^{\mathrm{T}} \left( -\mathbf{K} \mathbf{s} \mathbf{i} \mathbf{n} (\mathbf{S}) + \mathbf{d} \right) \tag{72}$$

where **K** ¼ *diag K*f g <sup>1</sup>*;K*2*;K*3*;K*4*;K*5*;K*<sup>6</sup> with *Ki* >0 and **<sup>d</sup>** <sup>¼</sup> *<sup>d</sup>ϕ; <sup>d</sup>θ; <sup>d</sup><sup>ψ</sup> ; dz; dx; dy* � �*<sup>T</sup>* and *sign*ð Þ¼ **S** *sign S<sup>ϕ</sup>* � �*; sign S*ð Þ*<sup>θ</sup> ; sign S<sup>ψ</sup>* � �*; sign S*ð Þ*<sup>z</sup> ; sign S*ð Þ*<sup>x</sup> ;* � *sign Sy* � �<sup>Þ</sup> *T*

$$\begin{split} \dot{V} &= \mathbf{S}^{\mathrm{T}} \left( -\mathbf{K} \mathbf{sign}(\mathbf{S}) + \mathbf{d} \right) \\ &\leq \sum\_{i=1}^{6} \left( |S\_i| d\_{si} - K\_i |S\_i| \right) \\ &= -\sum\_{i=1}^{6} |S\_i| (-d\_{si} + K\_i) \\ &\leq -\frac{\eta\_1}{\sqrt{2}} \sum\_{i=1}^{6} |S\_i| \end{split} \tag{73}$$

**46**

*Vision-Based Autonomous Control Schemes for Quadrotor Unmanned Aerial Vehicle DOI: http://dx.doi.org/10.5772/intechopen.86057*

where ∣*di*∣<*dsi*. Hence, the convergence of **S** is proven by the Lyapunov stability theory. The sliding variables are converging to zero in finite time, i.e., **S** ! 0. Therefore, tracking error will converge to zero asymptotically, i.e., **e** ! 0.
