## 3 Hierarchical Controllers for Trajectory Tracking
### Reference Model-Based Hierarchical Controller (RMHC)  
In this subsection, using reference model method (RM), the PD/PID controller synthesized for the proposed hierarchical controller is described. To synthesize the PD/PID controllers needed, we must define transfer functions for quadcopter outputs. The quadcopter dynamical equations are nonlinear and strongly coupled. Considering that rotation movements of the quadcopter have a small variation of angles, the approximation \(\cos(x)\approx 1\) and \(\sin(x)\approx 0\) can be used. In addition, the small constant attitude variation corresponds to the  
Figure 2: Synoptic scheme of the proposed hierarchical control strategy. hover states that involve \(\dot{\phi}=\dot{\theta}=\dot{\psi}=0\). From the nonlinear model (1)-(6) and based on the previous approximations, the simplified model given by (10) and (11) is obtained. \[\left\{ \begin{array}{l}I_{x}\dot{\phi}=IU_{2}\\ I_{y}\dot{\theta}=IU_{3}\\ I_{z}\ddot{\psi}=IU_{4}\end{array} \right. \tag{10}\]  
\[\left\{ \begin{array}{l}\ddot{x}=\frac{U_{2}}{m}U_{1}-\frac{K_{Hz}}{m}\dot{x} \\ \ddot{y}=\frac{U_{y}}{m}U_{1}-\frac{K_{Hz}}{m}\dot{y}\\ \dot{z}=-g+\frac{\cos\theta\cos\phi}{m}U_{1}+\frac{K_{Hz}}{m}\dot{z}.\end{array} \right. \tag{11}\]  
The attitude dynamic (10) is controllable. There are three inputs \(U_{2},U_{3},U_{4}\) and three outputs \(\{\phi,\theta,\psi\}\). However, in the case of position dynamics (11), the controllability is not guaranteed. There is only one input \(U_{1}\) but three outputs \(x,y,z\). To solve the under-actuated dynamic problems, we have to express the \(x\) and \(y\) position equations on the basis of \(U_{x}\) and \(U_{y}\), respectively (7). The hover \(\dot{z}\) is a constant reference, thus \(\ddot{z}=0\). In addition, the translation drag coefficient \(K_{ftz}\) is neglected in the altitude expression \(\ddot{z}\) so we get (12):  
\[U_{1}=gm. \tag{12}\]  
Replacing the \(x\) and \(y\) variable in (11), the following equations (13) are generated. \[\left\{ \begin{array}{l}\ddot{x}=U_{x}g-\frac{K_{ftz}}{m}\dot{x}\\ \dot{y}=U_{y}g-\frac{K_{ftz}}{m}\dot{y}\\ \dot{z}=-g+\frac{\cos\theta\cos\phi}{m}U_{1}+\frac{K_{ftz}}{m}\dot{z}.\end{array} \right. \tag{13}\]  
The transfer functions obtained from the simplified model (10) and (13) are given in (14). \[\left\{ \begin{array}{l}F_{\phi}(s)=\frac{\phi(s)}{U_{2}(s)}=\frac{l}{l_{x}s^ {2}}\\ F_{\theta}(s)=\frac{\theta(s)}{U_{3}(s)}=\frac{l}{l_{y}s^{2}}\\ F_{\psi}(s)=\frac{\psi(s)}{U_{4}(s)}=\frac{1}{l_{z}s^{2}}\\ F_{X}(s)=\frac{X(s)}{U_{4}(s)}=\frac{k_{x}}{s(\tau_{x}s+1)}\\ F_{Y}(s)=\frac{Y(s)}{U_{y}(s)}=\frac{k_{y}}{s(\tau_{y}s+1)}\\ F_{Z}(s)=\frac{Z(s)}{U_{1}(s)}=\frac{k_{z}}{s(\tau_{z}s+1)}.\end{array} \right. \tag{14}\]  
with :  
\[\left\{ \begin{array}{l}k_{x}=\frac{gm}{k_{ftz}},k_{y}=\frac{gm}{k_{fty}};k_{ z}=\frac{gm}{k_{ftz}}\\ \tau_{x}=\frac{m}{k_{ftz}};\tau_{y}=\frac{m}{k_{fty}};\tau_{z}=\frac{m}{k_{ftz}}.\end{array} \right. \tag{15}\]  
We desire the corrected system to behave as a first-order reference system (\(T_{s}\), \(\tau=\frac{T_{s}}{3}\)), which means that the dominant pole is placed at \(-1/\tau\), while the other poles must be placed far enough to the left of \(-1/\tau\) in the complex plan [28,29]. The reference model is chosen so that it ensures a behavior without overshoot with a response time \(T_{\rm s}\) of 0.1 s for all quadcopter flight parameters. To a reference model-based hierarchical controller (RMHC) design, we introduce for each variable (\(\phi\), \(\theta\), \(\psi\), \(x\), \(y\), \(z\)) a PD/PID controllers. Since all the established systems (14) are of order two, we impose for the corrected systems the references model \(M_{PD}(s)\) (16) and \(M_{PID}(s)\) (17) for PD and PID controllers, respectively. \[M_{PD}(s)=\frac{k}{(s-1/\tau)(s-a/\tau)} \tag{16}\]  
\[M_{PID}(s)=\frac{k}{(s-1/\tau)(s-a_{1}/\tau)(s-a_{2}/\tau)} \tag{17}\]  
with \(\tau=0.16\) (\(T_{\rm s}=3\tau\)) and \(\{a=2;a_{1}=10;a_{2}=25\}\) (\(a\), \(a_{1}\) and \(a_{2}\) must be significantly greater than 1).