# Backstepping Based Formation Control of Quadrotors with the State Transformation Technique
## 3 Backstepping-Based Quadrotor Formation Control
### Altitude Control of a Quadrotor  
In this subsection, we derive the altitude control input for the formation control on the \(z\)-axis using the state transformation technique. This altitude control input is used for the position control in the next subsection. In this paper, we derive the controller by assuming that both the leader and the follower quadrotors have the same dynamics. First, the altitude dynamics of the \(i\)-th follower can be expressed using quadrotor dynamics in (7) as follows:  
\[\left\{ \begin{array}{l}\dot{\chi}_{i,5}=\chi_{i,6}\\ \dot{\chi}_{i,6}=\frac{\cos\phi_{fi}\cos\theta_{fi}}{m_{i}}\left(u_{i,1}-g \frac{m_{i}}{\cos\phi_{fi}\cos\theta_{fi}}\right)=T_{i,1}(\phi_{fi}\theta_{fi} )\cdot v_{i,1}\end{array} \right. \tag{8}\]  
where \(v_{i,1}\) is the pseudo altitude control input of the \(i\)-th follower defined by:  
\[v_{i,1}:=\left(u_{i,1}-g\frac{m_{i}}{\cos\phi_{fi}\cos\theta_{fi}}\right), \tag{9}\]  
and \(T_{i,1}(\phi_{fi},\theta_{fi})\) is the first state transformation variable of the \(i\)-th follower given by:  
\[T_{i,1}(\phi_{fi},\theta_{fi})=\frac{\cos\phi_{fi}\cos\theta_{fi}}{m_{i}}. \tag{10}\]  
To design the pseudo control input of the \(i\)-th follower using the backstepping technique, the first formation error related to the altitude of the \(i\)-th follower \(e_{zi,1}\) is the difference between the \(z\)-axis distance that the leader and follower must maintain and the actual \(z\)-axis distance, and the definition is as follows:  
\[e_{zi,1}=Z_{li}-d_{i,z},\qquad\qquad(i=1,2,...,N)\]  
where \(Z_{li}:=z_{l}-z_{i}\) is the relative \(z\)-axis distance between the leader and the \(i\)-th follower and \(d_{i,z}\) is the desired relative \(z\)-axis distance between the leader and the \(i\)-th follower. Differentiating the first formation error related to the altitude of the \(i\)-th follower \(e_{zi,1}\) with respect to time, we obtain:  
\[\dot{e}_{zi,1}=Z_{li}-d_{i,z}=v_{z,li}-d_{i,z}. \tag{11}\]  
where \(v_{z,li}=Z_{li}\) is the derivative of the relative \(z\)-axis distance between the leader and the \(i\)-th follower. Figure 3: Leader follower structure for the formation of quadrotors. Assuming \(v_{z,li}\) is given as \(v_{z,li}=-k_{i,1}e_{zi,1}+\dot{d}_{i,z}\), (11) can be rewritten as follows:  
\[\dot{e}_{zi,1}=-k_{i,1}e_{zi,1}.\]  
If \(k_{i,1}>0\), the above error dynamics becomes stable system, then the error \(e_{zi,1}\) converges to zero. Therefore, supposing \(v_{z,li}\) as a virtual altitude control input and defining it as \(\bar{v}_{z,li}\), the virtual altitude control input of the \(i\)-th follower \(\bar{v}_{z,li}\) to converge the first formation error related to the altitude of the \(i\)-th follower \(e_{zi,1}\) to zero is given by:  
\[\bar{v}_{z,li}=-k_{i,1}e_{zi,1}+\dot{d}_{i,z}, \tag{12}\]  
where \(k_{i,1}\) is a positive constant. Next, the second formation error related to the altitude of the \(i\)-th follower \(e_{zi,2}\) is the difference in velocity between the leader and follower on the \(z\)-axis, and the definition is as follows:  
\[e_{zi,2}=v_{z,li}-\bar{v}_{z,li}.\]  
Differentiating the second formation error related to the altitude of the \(i\)-th follower \(e_{zi,2}\) with respect to time and substituting (8), we obtain:  
\[\dot{e}_{zi,2}=\dot{Z}_{li}-\dot{v}_{z,li}=\dot{z}_{l}-\dot{z}_{i}-\dot{v}_{z, li}=\dot{z}_{l}-T_{i,1}(\phi_{fi},\theta_{fi})v_{i,1}-\dot{v}_{z,li}. \tag{13}\]  
The pseudo altitude control input of the \(i\)-th follower \(v_{i,1}\) to converge the second formation error related to the altitude of the \(i\)-th follower \(e_{zi,2}\) to zero is given by:  
\[v_{i,1}=\frac{1}{T_{i,1}(\phi_{fi},\theta_{fi})}\left(\dot{z}_{l}+k_{i,2}e_{zi,2}-\dot{v}_{z,li}+e_{zi,1}\right), \tag{14}\]  
where \(k_{i,2}\) is a positive constant. In this paper, we use the following assumption.