In recent years, the advancement of unmanned aerial vehicles (UAVs) has led to growing interest in multi-drone systems, particularly for applications such as aerial displays, surveillance, and search-and-rescue. Among these, formation drone light shows have captivated audiences worldwide, where hundreds or thousands of drones coordinate to create intricate patterns in the sky. However, achieving robust and scalable formation control while avoiding dynamic obstacles remains a significant challenge. In this article, we present a distributed control strategy inspired by flocking behavior to address formation keeping and dynamic obstacle avoidance for multiple UAVs. Our approach leverages potential fields and consensus methods, ensuring stability and collision-free operations even under disturbances. We validate the algorithm through real-time experiments on a quadrotor testbed, demonstrating its effectiveness in maintaining formations and avoiding moving obstacles, which is crucial for applications like formation drone light shows where precision and safety are paramount.
The core of our work lies in mimicking natural flocking behaviors—where birds or fish move cohesively while avoiding predators—to govern drone formations. For formation drone light shows, this translates to drones maintaining desired shapes, such as geometric patterns or animated figures, while adapting to environmental changes. We consider a distributed topology, where each drone communicates only with its neighbors, enhancing scalability and robustness compared to centralized systems. This is especially relevant for large-scale formation drone light shows involving numerous drones. Below, we summarize key symbols used throughout our analysis in Table 1.
| Symbol | Description |
|---|---|
| $\xi_i \in \mathbb{R}^3$ | Position vector of drone $i$ in inertial frame |
| $\zeta_i \in \mathbb{R}^3$ | Velocity vector of drone $i$ in inertial frame |
| $m_i \in \mathbb{R}^+$ | Mass of drone $i$ |
| $g \in \mathbb{R}^+$ | Gravitational acceleration |
| $R_i \in \mathbb{R}^{3 \times 3}$ | Rotation matrix from body to inertial frame |
| $F_{T_i} \in \mathbb{R}^+$ | Total thrust from rotors |
| $\beta_i \in \mathbb{R}^3$ | Disturbance due to inter-drone airflow |
| $p_i = [\xi_{ix}, \xi_{iy}]^T \in \mathbb{R}^2$ | 2D position vector in $x$-$y$ plane |
| $\upsilon_i = [\zeta_{ix}, \zeta_{iy}]^T \in \mathbb{R}^2$ | 2D velocity vector in $x$-$y$ plane |
| $u_i \in \mathbb{R}^2$ | Virtual control input in $x$-$y$ plane |
| $p_i^d \in \mathbb{R}^2$ | 2D position in moving coordinate frame |
| $\upsilon_i^d \in \mathbb{R}^2$ | 2D velocity in moving coordinate frame |
| $u_i^d \in \mathbb{R}^2$ | Virtual control input in moving frame |
We model the drone dynamics in 3D space, but for formation control, we focus on the horizontal plane ($x$-$y$), as vertical control can be handled separately. The dynamics of drone $i$ are given by:
$$
\dot{p}_i = \upsilon_i, \quad \dot{\upsilon}_i = u_i + \beta_i,
$$
where $\beta_i(t)$ represents bounded disturbances, such as airflow effects between drones, with $\|\beta_i(t)\| \leq \varsigma$. This is critical for formation drone light shows, where close proximity can cause aerodynamic interference. To design the controller, we introduce a moving coordinate frame with desired trajectory $(p_d(t), \upsilon_d(t))$, defining relative states as $p_i^d = p_i – p_d$ and $\upsilon_i^d = \upsilon_i – \upsilon_d$. The collective dynamics for $N$ drones become:
$$
\dot{\mathbf{p}}^d = \mathbf{\upsilon}^d, \quad \dot{\mathbf{\upsilon}}^d = \mathbf{u}^d + \mathbf{\beta}^d,
$$
where $\mathbf{p}^d = \text{col}(p_1^d, \dots, p_N^d) \in \mathbb{R}^{2N}$, and similarly for $\mathbf{\upsilon}^d$, $\mathbf{u}^d$, and $\mathbf{\beta}^d$. The communication topology is represented by an undirected graph $\mathcal{G} = (\mathcal{Q}, \mathcal{E})$, where drones are nodes and edges indicate neighbor relationships. For formation drone light shows, this distributed approach allows drones to coordinate locally, reducing computational load and improving resilience.
To achieve flocking behavior, we design potential field functions that govern attraction and repulsion between drones and with obstacles. The formation potential $H_\alpha(\mathbf{p}^d)$ encourages drones to maintain a desired distance $d_\alpha$, while the obstacle potential $H_\beta(\mathbf{p}^d)$ repels drones from obstacles. These functions are defined using $\sigma$-norms for smooth differentiability. For instance, the $\sigma$-norm for a vector $\lambda$ is:
$$
\|\lambda\|_\sigma = \frac{1}{\epsilon} \left[ \sqrt{1 + \epsilon \|\lambda\|^2} – 1 \right],
$$
with gradient $\sigma_\epsilon(\lambda) = \nabla_\lambda \|\lambda\|_\sigma = \lambda / \sqrt{1 + \epsilon \|\lambda\|^2}$. The adjacency matrix $A(\mathbf{p}^d) = [a_{ij}(\mathbf{p}^d)]$ uses a bump function $\partial_h(\cdot)$ to define neighbor interactions within a range $c_\alpha$. Similarly, obstacle neighbors within range $c_\beta$ are considered. The potential functions are:
$$
H_\alpha(\mathbf{p}^d) = \frac{1}{2} \sum_i \sum_{j \neq i} \Upsilon_\alpha(\|p_j^d – p_i^d\|_\sigma), \quad \Upsilon_\alpha(\lambda) = \int_{d_\alpha}^\lambda \Theta_\alpha(x) dx,
$$
where $\Theta_\alpha(\lambda) = \partial_h(\lambda/c_\alpha) \Theta(\lambda – d_\alpha)$ and $\Theta(\lambda) = \frac{1}{2}[(a+b)\sigma(\lambda+e) + (a-b)]$ with $\sigma(\lambda) = \lambda/\sqrt{1+\lambda^2}$. For obstacles, we have:
$$
H_\beta(\mathbf{p}^d) = \frac{1}{2} \sum_i \sum_{k \in \mathcal{W}_i^\beta} \Upsilon_\beta(\|p_k^d – p_i^d\|_\sigma), \quad \Upsilon_\beta(\lambda) = \int_{d_\beta}^\lambda \Theta_\beta(x) dx,
$$
with $\Theta_\beta(\lambda) = \partial_h(\lambda/d_\beta)(\sigma(\lambda – d_\beta) – 1)$. These potentials ensure that drones attract to form patterns for formation drone light shows while repelling from obstacles to avoid collisions.

The control law for drone $i$ combines these potentials with consensus terms to achieve coordinated motion. In the moving frame, the control input $u_i^d(t)$ is:
$$
\begin{aligned}
u_i^d &= \sum_{j \in \mathcal{W}_i^\alpha} \left[ K_{p\alpha} \Theta_\alpha(\|p_j^d – p_i^d\|_\sigma) \tau_{ij} + K_{p\alpha}’ a_{ij}(\mathbf{p}^d) (p_j^d – p_i^d) + K_{d\alpha} a_{ij}(\mathbf{p}^d) (\upsilon_j^d – \upsilon_i^d) \right] \\
&\quad + \sum_{k \in \mathcal{W}_i^\beta} \left[ K_{p\beta} \Theta_\beta(\|p_k^d – p_i^d\|_\sigma) \tau_{ik} \right] – c_1 p_i^d – c_2 \upsilon_i^d,
\end{aligned}
$$
where $\tau_{ij} = \sigma_\epsilon(p_j^d – p_i^d)$ and $\tau_{ik} = \sigma_\epsilon(p_k^d – p_i^d)$. The gains $K_{p\alpha}$, $K_{d\alpha}$, $K_{p\beta}$, $c_1$, and $c_2$ are positive constants tuned for performance. This distributed controller requires only local information, making it scalable for large formation drone light shows. The closed-loop system dynamics are:
$$
\dot{\mathbf{p}}^d = \mathbf{\upsilon}^d, \quad \dot{\mathbf{\upsilon}}^d = -K_{p\alpha} \nabla_{\mathbf{p}^d} H_\alpha(\mathbf{p}^d) – K_{p\alpha}’ \hat{L} \mathbf{p}^d – K_{d\alpha} \hat{L} \mathbf{\upsilon}^d – K_{p\beta} \nabla_{\mathbf{p}^d} H_\beta(\mathbf{p}^d) – c_1 \mathbf{p}^d – c_2 \mathbf{\upsilon}^d + \mathbf{\beta}^d,
$$
where $\hat{L} = L \otimes I_2$ is the Laplacian matrix for the graph, ensuring consensus on relative states.
We analyze stability using Lyapunov methods. Consider the Lyapunov candidate:
$$
V(t) = \frac{1}{2} \|\mathbf{p}^d\|^2 + \frac{1}{2} \|\mathbf{\Lambda}\|^2 + K_{p\alpha} H_\alpha(\mathbf{p}^d) + K_{p\beta} H_\beta(\mathbf{p}^d),
$$
where $\mathbf{\Lambda} = \mathbf{\upsilon}^d + K_1 \mathbf{p}^d$ is an error signal. Under Assumption 1 (bounded disturbances) and Assumption 2 (initial conditions avoiding collisions), we derive the time derivative:
$$
\dot{V} \leq -K_1 \|\mathbf{p}^d\|^2 + K_1 K_{p\alpha} \nabla H_\alpha^{\text{max}} \|\mathbf{p}^d\| – K_2 \|\mathbf{\Lambda}\|^2 + K_1 K_{p\beta} \nabla H_\beta^{\text{max}} \|\mathbf{p}^d\| + \|\mathbf{\Lambda}\| \varsigma,
$$
with bounds $\nabla H_\alpha^{\text{max}} = \frac{b}{\epsilon} \sqrt{\sum_i |\mathcal{W}_i^\alpha|^2}$ and $\nabla H_\beta^{\text{max}} = \frac{1}{\epsilon} \sqrt{\sum_i |\mathcal{W}_i^\beta|^2}$. By choosing parameters appropriately, we show that $\dot{V} < 0$ outside a compact set, proving ultimate boundedness of the system errors. This ensures that drones maintain formation and avoid obstacles, critical for reliable formation drone light shows.
To validate our approach, we conducted real-time experiments using a quadrotor testbed with three drones. The platform includes ARM-based computing units and flight controllers, with ROS for communication and OptiTrack for positioning. We tested two scenarios: formation keeping without obstacles and dynamic obstacle avoidance. For formation drone light shows, such experiments mimic real-world conditions where drones must adapt to unexpected obstacles. Key parameters are summarized in Table 2.
| Parameter | Value | Description |
|---|---|---|
| $K_{p\alpha}$ | 4 | Formation potential gain |
| $K_{d\alpha}$ | 2 | Formation damping gain |
| $c_1$ | 0.6 | Position feedback gain |
| $c_2$ | 1 | Velocity feedback gain |
| $c_\alpha$ | 2 m | Formation interaction range |
| $d_\alpha$ | 1.5 m | Desired inter-drone distance |
| $K_{p\beta}$ | 3.5 | Obstacle potential gain |
| $c_\beta$ | 2 m | Obstacle detection range |
| $d_\beta$ | 1.5 m | Safe obstacle distance |
In the first experiment, drones started from random positions and converged to a triangular formation without obstacles. The distances between drones stabilized around $d_\alpha = 1.5$ m with errors within $\pm 0.15$ m, as shown in Table 3 for a snapshot of data.
| Time (s) | Distance $d_{01}$ (m) | Distance $d_{02}$ (m) | Distance $d_{12}$ (m) |
|---|---|---|---|
| 60 | 1.52 | 1.48 | 1.51 |
| 80 | 1.49 | 1.53 | 1.50 |
| 100 | 1.50 | 1.49 | 1.52 |
Control inputs remained within reasonable limits, e.g., $u_i \in [-2, 2] \, \text{m/s}^2$, ensuring feasible drone maneuvers. In the second experiment, a dynamic obstacle (another drone) moved through the formation. The drones successfully avoided the obstacle while temporarily distorting the formation, then reconverged to the desired triangle after the obstacle passed. This demonstrates the algorithm’s capability for dynamic obstacle avoidance, essential for formation drone light shows in cluttered environments. The minimum distances between drones and the obstacle were always above $0.9$ m, ensuring safety. A third experiment involved the formation moving along a straight line while avoiding an obstacle, further validating robustness.
Our stability analysis and experimental results confirm that the proposed distributed flocking control strategy ensures formation keeping and dynamic obstacle avoidance. The use of potential fields and consensus protocols allows drones to self-organize, mimicking natural flocking behaviors. This approach is highly scalable and robust to disturbances, making it suitable for large-scale formation drone light shows where hundreds of drones must coordinate precisely. Future work will extend to 3D obstacle avoidance and outdoor deployments using GPS, enhancing applicability to real-world formation drone light shows and other multi-UAV applications.
In conclusion, we have developed a novel distributed control algorithm for drone formations based on flocking behavior. By integrating attraction/repulsion potentials and consensus methods, we achieve stable formation keeping and effective dynamic obstacle avoidance. The Lyapunov-based analysis proves ultimate boundedness of errors, and real-time experiments on quadrotors validate performance. This work contributes to the advancement of autonomous formation drone light shows, enabling safer and more reliable aerial displays. As drone technology evolves, such distributed strategies will play a key role in scaling up formation drone light shows to new heights of complexity and beauty.
