As a researcher in the field of multi-agent systems, I have been deeply involved in developing advanced control strategies for drone formation. The ability to coordinate multiple unmanned aerial vehicles (UAVs) in a cohesive formation while navigating dynamic environments is crucial for applications such as surveillance, search and rescue, and environmental monitoring. In this article, I present a comprehensive study on a distributed flocking-based control algorithm for drone formation that incorporates dynamic obstacle avoidance. This work addresses the challenges of formation keeping, internal collision avoidance, and external obstacle evasion, all while considering real-world disturbances like airflow interference. The approach leverages artificial potential fields and consensus methods within a distributed topology, ensuring scalability and robustness. Through rigorous stability analysis and real-time experimental validation, I demonstrate the effectiveness of this control strategy in maintaining drone formation and safely avoiding moving obstacles.
The concept of drone formation refers to the coordinated movement of multiple UAVs to achieve a desired geometric pattern, which enhances operational efficiency and task performance. However, maintaining such formations in the presence of external disturbances and dynamic obstacles is non-trivial. Traditional centralized methods often suffer from high communication loads and single points of failure, whereas distributed approaches offer improved scalability and fault tolerance. My work builds upon flocking behavior observed in nature—such as in bird flocks or fish schools—where agents self-organize based on local interactions. By modeling drone formation using this paradigm, I aim to achieve robust and adaptive control without relying on global information.
In this article, I first outline the problem formulation, including notation, graph theory foundations, and system dynamics. Then, I detail the design of the control law based on attraction/repulsion potential functions and consensus protocols. Stability analysis using Lyapunov methods is provided to prove the ultimate boundedness of errors. Finally, I describe experimental implementations on a quadrotor testbed, showcasing real-time formation keeping and obstacle avoidance. Throughout, I emphasize the keyword “drone formation” to highlight its centrality to this research.
Problem Formulation and System Modeling
To formalize the control problem for drone formation, I begin by defining key symbols and concepts. Consider a formation of N drones, each indexed by i = 1, 2, …, N. The dynamics of each drone in three-dimensional space are modeled as a rigid body, but for simplicity in horizontal control design, I focus on the two-dimensional planar motion. The position and velocity vectors of drone i in an inertial frame are denoted as $\mathbf{p}_i = [p_{ix}, p_{iy}]^T \in \mathbb{R}^2$ and $\mathbf{v}_i = [v_{ix}, v_{iy}]^T \in \mathbb{R}^2$, respectively. The system is subject to disturbances such as inter-drone airflow, represented by $\boldsymbol{\beta}_i(t) \in \mathbb{R}^2$, which is bounded as per Assumption 1.
The communication topology among drones is represented by an undirected graph $\mathcal{G} = (\mathcal{Q}, \mathcal{E})$, where $\mathcal{Q} = \{1, 2, \dots, N\}$ is the set of nodes (drones), and $\mathcal{E} \subseteq \{(i, j): i, j \in \mathcal{Q}, i \neq j\}$ is the set of edges indicating communication links. The adjacency matrix $\mathbf{A} = [a_{ij}] \in \mathbb{R}^{N \times N}$ defines local interactions, with $a_{ij} > 0$ if drones i and j are within a communication range $c_\alpha$. This distributed structure ensures that each drone only exchanges information with its neighbors, reducing the overall system’s dependency on global data.
The dynamics of drone i in the horizontal plane are given by:
$$
\dot{\mathbf{p}}_i = \mathbf{v}_i, \quad \dot{\mathbf{v}}_i = \mathbf{u}_i + \boldsymbol{\beta}_i,
$$
where $\mathbf{u}_i \in \mathbb{R}^2$ is the control input to be designed. To facilitate control design, I introduce a moving coordinate frame with desired trajectory $(\mathbf{p}_d(t), \mathbf{v}_d(t))$. The relative position and velocity in this frame are $\mathbf{p}_i^d = \mathbf{p}_i – \mathbf{p}_d$ and $\mathbf{v}_i^d = \mathbf{v}_i – \mathbf{v}_d$, leading to the transformed dynamics:
$$
\dot{\mathbf{p}}_i^d = \mathbf{v}_i^d, \quad \dot{\mathbf{v}}_i^d = \mathbf{u}_i^d + \boldsymbol{\beta}_i^d,
$$
where $\mathbf{u}_i^d = \mathbf{u}_i – \dot{\mathbf{v}}_d$ and $\boldsymbol{\beta}_i^d = \boldsymbol{\beta}_i$. The collective dynamics for the entire drone formation can be expressed in vector form as:
$$
\dot{\mathbf{p}}^d = \mathbf{v}^d, \quad \dot{\mathbf{v}}^d = \mathbf{u}^d + \boldsymbol{\beta}^d,
$$
with $\mathbf{p}^d = \text{col}(\mathbf{p}_1^d, \dots, \mathbf{p}_N^d)$, $\mathbf{v}^d = \text{col}(\mathbf{v}_1^d, \dots, \mathbf{v}_N^d)$, $\mathbf{u}^d = \text{col}(\mathbf{u}_1^d, \dots, \mathbf{u}_N^d)$, and $\boldsymbol{\beta}^d = \text{col}(\boldsymbol{\beta}_1^d, \dots, \boldsymbol{\beta}_N^d)$.
To manage interactions within the drone formation, I define neighbor sets based on distances. The formation neighbor set for drone i is $\mathcal{W}_i^\alpha = \{j \in \mathcal{Q}: \|\mathbf{p}_j – \mathbf{p}_i\| < c_\alpha\}$, where $c_\alpha$ is the interaction range. Similarly, the obstacle neighbor set is $\mathcal{W}_i^\beta = \{k \notin \mathcal{Q}: \|\mathbf{p}_k – \mathbf{p}_i\| < c_\beta\}$, where $c_\beta$ is the obstacle detection range. The desired distance between drones in formation is $d_\alpha$, aiming to satisfy $\|\mathbf{p}_j – \mathbf{p}_i\| = d_\alpha$ for all $j \in \mathcal{W}_i^\alpha$.
Table 1 summarizes the key symbols used in this work for clarity.
| Symbol | Description |
|---|---|
| $\mathbf{p}_i$ | Position vector of drone i in inertial frame |
| $\mathbf{v}_i$ | Velocity vector of drone i in inertial frame |
| $\mathbf{u}_i$ | Control input for drone i |
| $\boldsymbol{\beta}_i$ | External disturbance (e.g., airflow) |
| $c_\alpha$ | Communication range for formation neighbors |
| $c_\beta$ | Detection range for obstacles |
| $d_\alpha$ | Desired distance between drones in formation |
| $d_\beta$ | Safety distance from obstacles |
| $\mathcal{W}_i^\alpha$ | Set of formation neighbors for drone i |
| $\mathcal{W}_i^\beta$ | Set of obstacle neighbors for drone i |
| $\mathbf{p}^d$ | Collective position vector in moving frame |
| $\mathbf{v}^d$ | Collective velocity vector in moving frame |
Control Law Design Based on Flocking Behavior
The core of my approach lies in designing a control law that enables drone formation to maintain cohesion while avoiding obstacles. This is achieved through a combination of potential functions and consensus algorithms. I start by defining the σ-norm, which is a smooth approximation of the Euclidean norm, to ensure differentiability in the control design. For a vector $\boldsymbol{\lambda} \in \mathbb{R}^n$, the σ-norm is given by:
$$
\|\boldsymbol{\lambda}\|_\sigma = \frac{1}{\epsilon} \left[ \sqrt{1 + \epsilon \|\boldsymbol{\lambda}\|^2} – 1 \right],
$$
where $\epsilon > 0$ is a constant. Its gradient is $\sigma_\epsilon(\boldsymbol{\lambda}) = \nabla_{\boldsymbol{\lambda}} \|\boldsymbol{\lambda}\|_\sigma = \boldsymbol{\lambda} / \sqrt{1 + \epsilon \|\boldsymbol{\lambda}\|^2}$.
For drone formation keeping, I construct an attractive/repulsive potential function $H_\alpha(\mathbf{p}^d)$ that governs interactions among drones. This function is defined as:
$$
H_\alpha(\mathbf{p}^d) = \frac{1}{2} \sum_{i=1}^N \sum_{j \neq i} \Upsilon_\alpha(\|\mathbf{p}_j^d – \mathbf{p}_i^d\|_\sigma),
$$
where $\Upsilon_\alpha(\lambda) = \int_{d_\alpha}^\lambda \Theta_\alpha(x) \, dx$. The function $\Theta_\alpha(\lambda)$ is designed to be smooth and incorporates a bump function $\partial_h(\cdot)$ to limit interactions to within the range $c_\alpha$:
$$
\Theta_\alpha(\lambda) = \partial_h(\lambda / c_\alpha) \Theta(\lambda – d_\alpha), \quad \Theta(\lambda) = \frac{1}{2} \left[ (a + b) \sigma(\lambda + e) + (a – b) \right],
$$
with $\sigma(\lambda) = \lambda / \sqrt{1 + \lambda^2}$, and constants $a, b > 0$, $e = |a – b| / \sqrt{4ab}$. This design ensures that drones attract each other when far apart and repel when too close, promoting a stable drone formation with desired spacing $d_\alpha$.
For obstacle avoidance, I introduce a repulsive potential function $H_\beta(\mathbf{p}^d)$ to handle external moving obstacles:
$$
H_\beta(\mathbf{p}^d) = \frac{1}{2} \sum_{i=1}^N \sum_{k \in \mathcal{W}_i^\beta} \Upsilon_\beta(\|\mathbf{p}_k^d – \mathbf{p}_i^d\|_\sigma),
$$
where $\Upsilon_\beta(\lambda) = \int_{d_\beta}^\lambda \Theta_\beta(x) \, dx$ and $\Theta_\beta(\lambda) = \partial_h(\lambda / d_\beta) (\sigma(\lambda – d_\beta) – 1)$. This function generates repulsive forces when drones approach obstacles within the safety distance $d_\beta$, effectively enabling the drone formation to evade dynamic threats.
The control law for each drone i is then designed as a distributed combination of potential-based forces and consensus terms. In the moving coordinate frame, the control input $\mathbf{u}_i^d$ is:
$$
\begin{aligned}
\mathbf{u}_i^d &= \sum_{j \in \mathcal{W}_i^\alpha} \left[ K_{p\alpha} \Theta_\alpha(\|\mathbf{p}_j^d – \mathbf{p}_i^d\|_\sigma) \boldsymbol{\tau}_{ij} + K_{p\alpha}’ a_{ij}(\mathbf{p}^d) (\mathbf{p}_j^d – \mathbf{p}_i^d) + K_{d\alpha} a_{ij}(\mathbf{p}^d) (\mathbf{v}_j^d – \mathbf{v}_i^d) \right] \\
&\quad + \sum_{k \in \mathcal{W}_i^\beta} \left[ K_{p\beta} \Theta_\beta(\|\mathbf{p}_k^d – \mathbf{p}_i^d\|_\sigma) \boldsymbol{\tau}_{ik} \right] – c_1 \mathbf{p}_i^d – c_2 \mathbf{v}_i^d,
\end{aligned}
$$
where $\boldsymbol{\tau}_{ij} = \sigma_\epsilon(\mathbf{p}_j^d – \mathbf{p}_i^d)$ and $\boldsymbol{\tau}_{ik} = \sigma_\epsilon(\mathbf{p}_k^d – \mathbf{p}_i^d)$. The gains $K_{p\alpha}, K_{p\alpha}’, K_{d\alpha}, K_{p\beta}, c_1, c_2 > 0$ are tuning parameters. The adjacency elements $a_{ij}(\mathbf{p}^d)$ are defined using the bump function $\partial_h(\cdot)$ to ensure smooth transitions in the communication graph.
This control law integrates several key aspects: (1) formation keeping via the attractive/repulsive potential $H_\alpha$, (2) obstacle avoidance via the repulsive potential $H_\beta$, (3) velocity alignment through consensus terms $K_{d\alpha} a_{ij}(\mathbf{v}_j^d – \mathbf{v}_i^d)$, and (4) damping terms $-c_1 \mathbf{p}_i^d – c_2 \mathbf{v}_i^d$ for stability. By relying only on local neighbor information, this approach adheres to the distributed nature of the drone formation control.
Stability Analysis and Error Boundedness
To ensure the reliability of the proposed control strategy for drone formation, I conduct a stability analysis using Lyapunov methods. The goal is to prove that the closed-loop system is stable and that state errors are ultimately bounded despite disturbances. I begin by stating Assumption 2, which requires that initial drone positions are within a feasible set $\Omega$ to avoid collisions.
Consider the Lyapunov candidate function $V(t)$ for the collective system:
$$
V(t) = \frac{1}{2} \|\mathbf{p}^d\|^2 + \frac{1}{2} \|\boldsymbol{\Lambda}\|^2 + K_{p\alpha} H_\alpha(\mathbf{p}^d) + K_{p\beta} H_\beta(\mathbf{p}^d),
$$
where $\boldsymbol{\Lambda} = \mathbf{v}^d + K_1 \mathbf{p}^d$ is an error variable, with $K_1 > 0$ as a gain. Taking the time derivative and substituting the control law, I obtain after simplification:
$$
\dot{V}(t) \leq -K_1 \|\mathbf{p}^d\|^2 + K_1 K_{p\alpha} \nabla H_{\alpha,\text{max}} \|\mathbf{p}^d\| – K_2 \|\boldsymbol{\Lambda}\|^2 + K_1 K_{p\beta} \nabla H_{\beta,\text{max}} \|\mathbf{p}^d\| + \|\boldsymbol{\Lambda}\| \varsigma,
$$
where $\nabla H_{\alpha,\text{max}}$ and $\nabla H_{\beta,\text{max}}$ are bounds on the gradients of the potential functions (as per Lemma 1), and $\varsigma$ is the bound on disturbances $\boldsymbol{\beta}^d$. By selecting gains appropriately, I can show that $\dot{V}(t)$ is negative definite when $\|\mathbf{p}^d\|$ and $\|\boldsymbol{\Lambda}\|$ exceed certain thresholds.
From this analysis, I derive that the system state errors are ultimately bounded. Specifically, there exists a bound $D_b$ such that:
$$
\limsup_{t \to \infty} \| \mathbf{D}(t) \| \leq D_b, \quad \text{where } \mathbf{D} = [\mathbf{p}^{d^T}, \boldsymbol{\Lambda}^T]^T.
$$
This result guarantees that the drone formation will maintain cohesion and avoid obstacles within prescribed safety margins, even in the presence of bounded disturbances. The proof leverages properties of the potential functions and Laplacian matrix of the communication graph, ensuring that the distributed control law achieves its objectives robustly.
Experimental Validation and Results
To validate the proposed control algorithm in real-world scenarios, I conducted experiments using a testbed of quadrotor drones. The setup consists of three drones equipped with onboard computing units and flight controllers, communicating via WiFi in a distributed manner. Position data are obtained from an OptiTrack motion capture system, and the control algorithm runs at 50 Hz on each drone. The experiments focus on demonstrating drone formation keeping and dynamic obstacle avoidance in indoor environments.

In the first experiment, I tested formation keeping without obstacles. The drones start from random initial positions and are tasked to form a triangular pattern with desired inter-drone distance $d_\alpha = 1.5$ m. The control parameters are set as $K_{p\alpha} = 4$, $K_{d\alpha} = 2$, $c_1 = 0.6$, $c_2 = 1$, and $c_\alpha = 2$ m. The results show that the drones successfully converge to the desired formation, with distances stabilizing around 1.5 m and errors within ±0.15 m. This confirms the effectiveness of the flocking-based control for maintaining drone formation.
The second experiment introduces a dynamic obstacle—another quadrotor moving through the formation. The obstacle avoidance gains are $K_{p\beta} = 3.5$, $c_\beta = 2$ m, and $d_\beta = 1.5$ m. As the obstacle approaches, the drones exhibit evasive maneuvers by temporarily expanding the formation, then re-converge to the desired pattern after the obstacle passes. The minimum distances between drones and the obstacle remain above the safety threshold, indicating successful avoidance. This highlights the capability of the control law to handle dynamic threats while preserving the integrity of the drone formation.
A third experiment involves the drone formation moving along a predefined trajectory while avoiding obstacles. The drones navigate a straight-line path, and an obstacle crosses their path. The results demonstrate that the formation adjusts its shape to avoid collisions and then reforms to continue along the trajectory. Control inputs remain within practical limits, ensuring smooth and stable flight.
Table 2 summarizes the key parameters used in the experiments for reproducibility.
| Parameter | Value | Description |
|---|---|---|
| $N$ | 3 | Number of drones in formation |
| $d_\alpha$ | 1.5 m | Desired inter-drone distance |
| $c_\alpha$ | 2 m | Formation communication range |
| $c_\beta$ | 2 m | Obstacle detection range |
| $K_{p\alpha}$ | 4 | Gain for formation potential |
| $K_{d\alpha}$ | 2 | Gain for velocity consensus |
| $K_{p\beta}$ | 3.5 | Gain for obstacle potential |
| $c_1$ | 0.6 | Damping gain for position |
| $c_2$ | 1 | Damping gain for velocity |
| $\epsilon$ | 0.1 | Smoothing parameter for σ-norm |
The experimental outcomes validate the theoretical analysis and show that the distributed flocking control algorithm is practical for real-time applications. The drone formation exhibits robustness to disturbances and adaptability to dynamic environments, key requirements for advanced multi-UAV systems.
Conclusion and Future Work
In this article, I have presented a comprehensive framework for distributed drone formation control with dynamic obstacle avoidance, inspired by flocking behavior. The control law combines artificial potential fields for formation keeping and obstacle evasion with consensus protocols for velocity alignment, all implemented in a distributed topology. Stability analysis proves the ultimate boundedness of errors, ensuring reliable performance. Experimental results on a quadrotor testbed demonstrate the algorithm’s effectiveness in maintaining formations and avoiding moving obstacles in real time.
The work contributes to the field of multi-agent systems by offering a scalable and robust solution for drone formation coordination. Key advantages include reduced communication overhead, adaptability to local changes, and provable stability under disturbances. However, challenges remain, such as extending the approach to three-dimensional obstacle avoidance and outdoor environments with GPS-based localization. Future research will focus on integrating trajectory planning for complex 3D maneuvers and scaling to larger drone formations with heterogeneous agents. Additionally, machine learning techniques could be explored to enhance adaptability in unpredictable scenarios.
Overall, this study underscores the potential of bio-inspired flocking algorithms for advanced drone formation control, paving the way for more autonomous and collaborative UAV applications in diverse fields.
