## 4 Application to Multiple Quadcopter Systems
### Quadcopter Dynamics
\begin{array} []{c}\
u_{p,i}(t)\\ \
u_{q,i}(t)\\ \
u_{r,i}(t)\end{array} \right]\right), \tag{38}\]  
where \"\(\times\)\" denotes the cross product, \(G=[0,\ 0,\ g]^{T}\), and \(\mathcal{I}_{B,i}=\mathbf{diag}\left(\mathcal{I}_{x,i},\mathcal{I}_{y,i}, \mathcal{I}_{z,i}\right)\) is the tensor matrix of this system. By substituting (36) into (38), the dynamic equations of the quadcopter attitude \(i\)th can be obtained:  
\[\left[ \begin{array}{c}\ddot{\phi}_{i}(t)\\ \dot{\theta}_{i}(t)\\ \ddot{\psi}_{i}(t)\end{array} \right]=\mathcal{J}_{i}^{-1}\left(\left[ \begin{array}{c}U_{2i}(t)\\ U_{3i}(t)\\ U_{4i}(t)\end{array} \right]-\mathcal{C}_{i}\left[ \begin{array}{c}\dot{\phi}_ {i}(t)\\ \dot{\theta}_{i}(t)\\ \dot{\psi}_{i}(t)\end{array} \right]\right), \tag{39}\]  
where \(\mathcal{J}_{i}\) and \(\mathcal{C}_{i}\in\mathbb{R}^{3\times 3}\) can be found in Appendix A. Inspired by the studies [6; 7; 36; 37; 38; 39; 40], where the control of a quadcopter can be separated into inner (39) and outer loop (37) paradigms, this paper proposes a control structure, in which the outer control loop of each quadcopter guarantees the formation tracking in the group of quadcopters by adjusting the reference attitude. Additionally, the inner loop was designed such that the actual attitude tracked its reference generated by the outer loop. In the scope of this work, we were mainly devoted to designing the dynamic event-triggered formation control of the outer loop. Therefore, for the formation control problem, each quadcopter could be regarded as a point-mass, and its dynamics could be described by a second-order control system, which can be derived from Equation (37) as follows: where \(u_{i}(t)=A_{i}(t)\tau_{i}(t)-G\) and:  
\[A_{i}(t)=\frac{1}{m_{i}}\left[ \begin{array}{ccc}c\psi_{i}&-s\psi_{i}&0\\ s\psi_{i}&c\psi_{i}&0\\ 0&0&1\end{array} \right],\ \tau_{i}(t)=\left[ \begin{array}{c}\tau_{x,i}(t)\\ \tau_{y,i}(t)\\ \tau_{z,i}(t)\end{array} \right]=\left[ \begin{array}{c}U_{1i}(t)c\phi_{i}s \theta_{i}\\ -U_{1i}(t)s\phi_{i}\\ U_{1i}(t)c\phi_{i}c\phi_{i}\end{array} \right].\]  
It can be seen that the desired attitude is generated for the inner loop as follows:  
\[U_{1i}(t)=\sqrt{\tau_{x,i}(t)^{2}+\tau_{y,i}(t)^{2}+\tau_{z,i}(t) ^{2}},\] \[\phi_{i}(t)=arcsin\frac{-\tau_{y,i}(t)}{U_{1i}(t)},\ \theta_{i}(t)= arctan\frac{\tau_{x,i}(t)}{\tau_{z,i}(t)}. \tag{40}\]  
**Remark 6**. : _Most of the computational devices in quadcopter systems are developed by using the Robot Operating System (ROS), which is a set of software libraries and tools for building robot applications. In addition, these devices typically are a combination of a companion computer and an IMU, as shown in [41; 42; 43]. For the companion computer, each system can communicate with others and do its individual tasks to meet the formation flight requirements. Figure 3 illustrates our algorithm where the companion computer covers the formation control law, the event triggering condition, and the wireless communication. By following this procedure, the thrust force \(U_{1,i}(t)\) and desired roll, pitch, and yaw angle are calculated in the companion computer before being published to the inner loop. It can be assumed that the attitude is able to track immediately the desired one in the inner loop (refer to [33; 34; 35; 44; 45; 46])._