# Backstepping Based Formation Control of Quadrotors with the State Transformation Technique
## 3 Backstepping-Based Quadrotor Formation Control
### Position Control of a Quadrotor with the State Transformation Technique  
To realize the \(x,y\) position control for the quadrotor formation control on the \(x,y\)-axis, we define the variable \(\widetilde{u}_{i,1}\), using the actual altitude control input of the \(i\)-th follower \(u_{i,1}\), as follows:  
\[\widetilde{u}_{i,1}=T_{i,1}(\phi_{fi},\theta_{fi})u_{i,1}=\frac{\cos\phi_{fi} \cos\theta_{fi}}{m_{i}}v_{i,1}+g. \tag{19}\]  
The \(x,y\) position dynamics of the \(i\)-th follower can be expressed using quadrotor dynamics in (7) as follows:  
\[\left\{ \begin{array}{l}\dot{\chi}_{i,1}=\chi_{i,2}\\ \dot{\chi}_{i,2}=u_{i,1}\big{(}cos\phi_{fi}sin\theta_{fi}cos\psi_{fi}+sin\phi_{ fi}sin\psi_{fi}\big{)}/m_{i}\\ \dot{\chi}_{i,3}=\chi_{i,4}\\ \dot{\chi}_{i,4}=u_{i,1}\big{(}cos\phi_{fi}sin\theta_{fi}sin\psi_{fi}-sin\phi_ {fi}cos\psi_{fi}\big{)}/m_{i}\end{array} \right. \tag{20}\]  
Rearranging these equations, we finally obtain the \(x,y\) position dynamics of the \(i\)-th follower as follows:  
\[\left\{ \begin{array}{l}\dot{P}_{i}=V_{i}\\ \dot{V}_{i}=u_{i,1}/m_{i}\left[\begin{matrix}u_{i,x}\\ u_{i,y}\end{matrix}\right]\end{array} \right. \tag{21}\]  
where \(P_{i}\) and \(V_{i}\) are defined as \(P_{i}\): \(=[\chi_{i,1}\)\(\chi_{i,3}]^{T}\) and \(V_{i}\): \(=\)\(\dot{P}_{i}\), respectively, and \(u_{i,x}\) and \(u_{i,y}\) are the effective \(x,y\) position control inputs of the \(i\)-th follower defined as:  
\[\left[ \begin{matrix}u_{i,x}\\ u_{i,y}\end{matrix} \right]=\left[ \begin{matrix}cos\phi_{fi}sin\theta_{fi}cos\psi _{fi}+sin\phi_{fi}sin\psi_{fi}\\ cos\phi_{fi}sin\theta_{fi}sin\psi_{fi}-sin\phi_{fi}cos\psi_{fi}\end{matrix}  \right]. \tag{22}\]  
Substituting the actual altitude input of the \(i\)-th follower in (19) into the \(x,y\) position dynamics of the \(i\)-th follower in (21), and using the state transformation matrix of the \(i\)-th follower \(T_{i,2}(e_{zi,1},e_{zi,2},\phi_{fi},\theta_{fi},\psi_{fi})\) given by:  
\[T_{i,2}(e_{zi,1},e_{zi,2},\phi_{fi},\theta_{fi},\psi_{fi})=\widetilde{u}_{i,1} \left[ \begin{matrix}cos\psi_{fi}&\sin\psi_{fi}\\ \sin\psi_{fi}&-\cos\psi_{fi}\end{matrix} \right], \tag{23}\]we obtain the matrix-type position dynamics of the \(i\)-th follower quadrotor as follows:  
\[ \begin{split}\dot{P}_{i}&=V_{i}\\ \dot{V}_{i}&=T_{i,2}(e_{xz,1},e_{z,i,2},\phi_{fi}, \theta_{fi},\psi_{fi})\ u_{i,p}\end{split}  \tag{24}\]  
where \(u_{i,p}\) is the \(x,y\) position control input vectors of the \(i\)-th follower given by:  
\[u_{i,p}= \begin{bmatrix}u_{i,pitch}\\ u_{i,roll}\end{bmatrix} = \begin{bmatrix}\tan\theta_{fi}\\ \sec\theta_{fi}\cdot\tan\phi_{fi}\end{bmatrix} . \tag{25}\]  
To design the \(x,y\) position control input vectors of the \(i\)-th follower using the backstepping technique, the first formation error vector related to the \(x,y\) position of the \(i\)-th follower \(e_{pi,1}\) is the difference between the \(x,y\)-axis distance that the leader and follower must maintain and the actual \(x,y\)-axis distance, and the definition is as follows:  
\[e_{pi,1}=P_{li}- \begin{bmatrix}d_{i,x}\\ d_{i,y}\end{bmatrix} ,\]  
where \(P_{li}:=P_{l}-P_{i}\) is the relative \(x,y\)-axis distance between the leader and the \(i\)-th follower and \(d_{i,x}\) are the desired relative distance on the \(x\) and \(y\) each axis between the leader and the \(i\)-th follower, respectively. Differentiating the first formation error vector related to the \(x,y\) position of the \(i\)-th follower \(e_{pi,1}\) with respect to time, we obtain:  
\[\dot{e}_{pi,1}=\dot{P}_{li}- \begin{bmatrix}d_{i,x}\\ d_{i,y}\end{bmatrix} =V_{p,li}- \begin{bmatrix}d_{i,x}\\ d_{i,y}\end{bmatrix} . \tag{26}\]  
where \(V_{p,li}=\dot{P}_{li}\) is the derivative of the relative \(x\)- and \(y\)-axis distance between the leader and the \(i\)-th follower. Assuming \(V_{p,li}\) is given as \(V_{p,li}=-k_{i,3}e_{pi,1}+ \begin{bmatrix}d_{i,x}\\ d_{i,y}\end{bmatrix}