# Adaptive Recursive Sliding Mode Control (ARSMC)-Based UAV Control for Future Smart Cities
## 2 Mathematical Model  
Suitable and reasonable assumptions must be made in order to model a higher-order nonlinear system [6]. In this section, we describe a highly nonlinear system with a finite degree of freedom and discuss its important parameters in Table 1. We use mathematical state equations to describe an experimental prototype represented in Figure 1 with both main and tail rotors, as follows:  
\[\frac{d\dot{\theta}}{dt}=\frac{a_{1}}{I_{1}}\tau_{1}^{2}+\frac{b_{1}}{I_{1}} \tau_{1}-\frac{M_{g}}{I_{1}}\;sin(\theta)+\frac{0.0326}{2I_{1}}sin(2\theta) \dot{\varphi}^{2}-\frac{B_{1\theta}}{I_{1}}\Psi-\frac{k_{gy}}{I_{1}}cos(\theta )\;\dot{\varphi}\;(a_{1}\tau_{1^{2}}+b_{1}\tau_{1}) \tag{1}\]  
where \(\theta\) is the pitch angle of the main rotor. The variable \(I_{1}\) is the inertia of the main rotor. \[\frac{d\;\dot{\varphi}}{dt}=\frac{a_{2}}{I_{2}}\tau_{2}^{2}+\frac{b_{2}}{I_{2 }}\tau_{2}-\frac{B_{1\phi}}{I_{2}}\dot{\varphi}-\frac{k_{c}}{I_{2}}1.75\;\; \;(a_{1}\tau_{1}^{2}+b_{1}\tau_{1}) \tag{2}\]  
where \(\varphi\) is the yaw angle of the tail rotor. The variable \(I_{1}\) is the inertia of the main rotor. The variable \(I_{2}\) represents the inertia of the tail rotor. The equation for the main motor of the TRMS (UAV),  
\[\dot{\tau}_{1}=\frac{T_{10}}{T_{11}}\tau_{1}+\frac{k_{1}}{T_{11}}u_{1} \tag{3}\]  
where \(\tau_{1}\) represents the momentum of the main rotor. The equation for the tail motor of the TRMS (UAV),  
\[\dot{\tau}_{2}=\frac{T_{20}}{T_{21}}\tau_{2}+\frac{k_{2}}{T_{21}}u_{2} \tag{4}\]  
where \(\tau_{2}\) represents the momentum of the tail rotor. In order to model a system, some suitable assumptions need to be made. An experimental prototype consisting of both main and tail rotors can be described through mathematical state equations, which are then converted into linear state equations. This means that there are no terms with a degree higher than one in the resulting equations. The process of obtaining linear equations with some compromising assumptions is called linearization. The linearized model is more amenable to analysis and controller design. \[\dot{x}(t)=Ax(t)+Bu(t) \tag{5}\]\[y(t)=Cx(t) \tag{6}\]  
where \(x\in R\) and \(u\in R\) show real numbers and input value, while \(y\in R\) is considered as the output of the system. Dynamic states as state vectors are given as:  
\[x= \begin{bmatrix}\theta&\dot{\theta}&\varphi&\dot{\varphi}\end{bmatrix} ^{T} \tag{7}\]  
\[y= \begin{bmatrix}\theta&\varphi&\end{bmatrix} ^{T} \tag{8}\]  
where \(\theta\) is the elevation position, \(\phi\) is the azimuth position, \(\tau_{1}\) is the main rotor momentum and \(\tau_{2}\) represents the tail rotor momentum. The dynamic states at origin, \(x(t)=x(0)\),  
\[J=\frac{\delta f(x)}{\delta x}|_{x=0} \tag{9}\]  
\[J= \begin{bmatrix}\frac{\partial\text{f}_{1}}{\partial x_{1}}&\cdots&\frac{ \partial\text{f}_{1}}{\partial x_{6}}\\ \vdots&\ddots&\vdots\\ \partial\text{f}_{6}}{\partial x_{1}}&\cdots&\partial\text{f}_{6}}\end{bmatrix}  \tag{10}\]  
Figure 1: Basic schematic sketch of TRMS [6]. The simplified matrices can be obtained at origin \((0,0,0)\) as,  
\[A=\left[ \begin{array}{cccccc}0&1&0&0&0&0\\ -\frac{M_{g}}{T_{1}}&-\frac{B_{1g}}{T_{1}}&0&0&\frac{b_{1}}{T_{1}}&0\\ 0&0&0&1&0&0\\ 0&0&0&-\frac{B_{1g}}{T_{2}}&-\frac{k_{1}}{T_{2}}1.75&\frac{b_{2}}{T_{2}}\\ 0&0&0&0&-\frac{T_{10}}{T_{11}}&0\\ 0&0&0&0&0&-\frac{T_{20}}{T_{21}}\end{array} \right] \tag{11}\]  
\[C=\left[ \begin{array}{cccccc}1&0&0&0&0\\ 0&0&1&0&0&0\end{array} \right]B=\left[ \begin{array}{cccc}0&0\\ 0&0\\ 0&0\\ 0&0\\ \frac{k_{1}}{T_{11}}&0\\ 0&\frac{k_{2}}{T_{21}}\end{array} \right] \tag{12}\]  
Figure 2 shows a block diagram of a UAV with a representation of the coupling effect. The diagram includes two output states, which are the pitch angle and the yaw angle. The coupling effect is also depicted in the diagram. The system under consideration is checked by a well-known calculation process with respect to controllability and observability.