# Backstepping Based Formation Control of Quadrotors with the State Transformation Technique
## 3 Backstepping-Based Quadrotor Formation Control
### Attitude Control of a Quadrotor  
The attitude dynamics related to the roll movement of the \(i\)-th follower can be expressed using quadrotor dynamics in (7) as follows:  
\[\left\{ \begin{array}{l}\dot{\chi}_{i,7}=\chi_{i,8}\\ \dot{\chi}_{i,8}=f_{i,1}(\chi_{i,10},\chi_{i,12},\Omega_{r})+\frac{u_{i,2}}{I _{xx}}\end{array} \right. \tag{36}\]  
where \(f_{i,1}(\chi_{i,10},\chi_{i,12},\Omega_{r})=\dot{\chi}_{i,9}\dot{\chi}_{i,11} \frac{(I_{yy}-I_{zz})}{I_{xx}}-\frac{I}{I_{xx}}\dot{\chi}_{i,9}\Omega_{r}\). As in the previous altitude, the \(x,y\) position cases, to design the attitude control input related to the roll movement of the \(i\)-th follower using the backstepping technique, the first error related to the roll \(e_{\phi i,1}\) is defined as follows:  
\[e_{\phi i,1}=\chi_{i,7}-\phi_{d,fi},\]  
Differentiating the first error related to the roll \(e_{\phi i,1}\) with respect to time, we obtain:  
\[\dot{e}_{\phi i,1}=\dot{\chi}_{i,7}-\dot{\phi}_{d,fi}=\chi_{i,8}-\dot{\phi}_{d,fi}. \tag{37}\]  
To converge the first error related to the roll \(e_{\phi i,1}\) to zero, the virtual attitude control input related to the roll movement for \(\chi_{i,8}\) of the \(i\)-th follower is defined by:  
\[\tilde{\chi}_{i,8}=-k_{i,7}e_{\phi i,1}+\dot{\phi}_{d,fi}, \tag{38}\]  
where \(k_{i,7}\) is a positive constant. The second error related to the roll \(e_{\phi i,2}\) is defined as follows:  
\[e_{\phi i,2}=\chi_{i,8}-\tilde{\chi}_{i,8}.\]  
Differentiating the second error related to the roll \(e_{\phi i,2}\) with respect to time and substituting (36), we obtain:  
\[\dot{e}_{\phi i,2}=\dot{\chi}_{i,8}-\dot{\chi}_{i,8}=f_{i,1}(\chi_{i,10},\chi _{i,12},\Omega_{r})+\frac{u_{i,2}}{I_{xx}}-\dot{\chi}_{i,8}. \tag{39}\]  
To converge the second error related to the roll \(e_{\phi i,2}\) to zero, the actual attitude control input related to the roll movement of the \(i\)-th follower \(u_{i,2}\) is defined as:  
\[u_{i,2}=I_{xx}\left(-k_{i,8}e_{\phi i,2}-f_{i,1}(\chi_{i,10},\chi_{i,12}, \Omega_{r})+\dot{\chi}_{i,8}-e_{\phi i,1}\right), \tag{40}\]  
where \(k_{i,8}\) is a positive constant. Similarly, the actual attitude control inputs related to the pitch and yaw movement of the \(i\)-th follower \(u_{i,3}\) and \(u_{i,4}\) are defined as:  
\[ \begin{split} u_{i,3}&=I_{yy}\left(-k_{i,10}e_{\theta i,2}-f_{i,2}(\chi_{i,8},\chi_{i,12},\Omega_{r})+\hat{\chi}_{i,10}-e_{\theta i,1} \right),\\ u_{i,4}&=I_{zz}\left(-k_{i,12}e_{\varphi i,2}-f_{i,3}( \chi_{i,8},\chi_{i,10})+\hat{\chi}_{i,12}-e_{\varphi i,1}\right),\end{split}  \tag{41}\]  
where \(k_{i,10}\) and \(k_{i,12}\) are positive constants, \(f_{i,2}(\chi_{i,8},\chi_{i,12},\Omega_{r})=\hat{\chi}_{i,7}\hat{\chi}_{i,11} \frac{(I_{zz}-I_{xx})}{I_{yy}}+\frac{I}{I_{yy}}\hat{\chi}_{i,7}\Omega_{r}\), \(f_{i,3}(\chi_{i,8},\chi_{i,10})=\hat{\chi}_{i,7}\hat{\chi}_{i,9}\frac{(I_{xx}- I_{yy})}{I_{zz}}\), and the virtual attitude control inputs related to the pitch and yaw movement for \(\chi_{i,10}\) and \(\chi_{i,12}\) of the \(i\)-th follower are defined by:  
\[ \begin{split}\tilde{\chi}_{i,10}&=-k_{i,9}e_{\theta i,1}+\dot{\theta}_{d,fi},\\ \tilde{\chi}_{i,12}&=-k_{i,11}e_{\varphi i,1}+\dot{ \psi}_{d,fi}.\end{split}  \tag{42}\]  
Here, \(\theta_{d,fi}\), \(\dot{\psi}_{d,fi}\) are the reference pitch and yaw angles of the \(i\)-th follower, respectively, and \(k_{i,9}\), \(k_{i,11}\) are positive constants. The errors related to the pitch and yaw movements \(e_{\theta i,1},e_{\theta i,2},e_{\varphi i,1},e_{\varphi i,2}\) are defined as:  
\[