Obstacle Avoidance Control of UAV Formations Combining Consensus and Repulsion Functions

In this paper, we present a novel distributed formation obstacle avoidance method for quadrotor unmanned aerial vehicle (UAV) swarms operating in complex environments. Our approach integrates consensus algorithms with repulsion functions to ensure safe and efficient navigation around irregular obstacles. We first develop an obstacle detection strategy based on the minimum Euclidean distance between each quadrotor and any nearby obstacle. This allows us to handle non‑convex and irregular geometries without assuming a known center. A smooth, bounded repulsion field is then designed to generate collision‑free trajectories while preserving connectivity among formation members. An adaptive integral backstepping controller is employed for accurate tracking of the desired formation trajectory under external disturbances. Extensive simulations demonstrate that the proposed method outperforms conventional artificial potential field techniques in terms of trajectory smoothness, obstacle avoidance efficiency, and formation maintenance. The results highlight the potential of our integrated framework for practical drone technology applications.

1. Introduction

The rapid advancement of drone technology has led to widespread interest in multi‑UAV systems, which can overcome the limitations of single‑unit operations and accomplish complex missions such as surveillance, search and rescue, and environmental monitoring. Formation control is a fundamental problem in multi‑UAV coordination, and many approaches have been proposed, including virtual structure methods, behavior‑based methods, leader‑follower strategies, and consensus algorithms. However, most existing studies assume obstacle‑free environments. In real‑world scenarios, obstacles — both static and dynamic, regular and irregular — pose significant challenges to formation integrity and flight safety. Traditional artificial potential field methods are prone to local minima and unrealistic representations of obstacle geometry. To address these issues, we propose a distributed control framework that fuses consensus‑based formation maintenance with repulsion‑based obstacle avoidance. Our contributions include:

  • A novel obstacle detection method based on the minimum distance between the UAV and the obstacle boundary, enabling a more compact and smooth avoidance path for irregular obstacles.
  • A combined controller that guarantees connectivity preservation, collision avoidance, and relative distance stabilization, using a smooth bounded repulsion function to avoid local minima.
  • An adaptive integral backstepping controller for trajectory tracking in the presence of unknown external disturbances.
  • Comprehensive simulation studies comparing our approach with classical artificial potential field methods, demonstrating superior performance in both static and dynamic obstacle environments.

2. Quadrotor UAV Modeling

Each quadrotor UAV in the formation is modeled using Newton‑Euler equations. The dynamics are split into translational and rotational parts:

$$
\begin{aligned}
\dot{\mathbf{P}}_i &= \mathbf{V}_i \\
m \dot{\mathbf{V}}_i &= -mg\mathbf{t}_3 + \mathbf{R}(\boldsymbol{\Theta}_i)U_{\Gamma i}\mathbf{t}_3 + \mathbf{d}_{Vi} \\
\dot{\boldsymbol{\Theta}}_i &= \boldsymbol{\Pi}(\boldsymbol{\Theta}_i)\boldsymbol{\Omega}_i \\
\mathbf{J}_i \dot{\boldsymbol{\Omega}}_i &= -\boldsymbol{\Omega}_i \times (\mathbf{J}_i \boldsymbol{\Omega}_i) + \mathbf{G}_{ai} + \mathbf{U}_{Ti} + \mathbf{d}_{\Omega i}
\end{aligned}
$$

where i indexes the UAV, $\mathbf{P}_i=[x_i,y_i,z_i]^\mathsf{T}$, $\mathbf{V}_i=[\dot{x}_i,\dot{y}_i,\dot{z}_i]^\mathsf{T}$, $\boldsymbol{\Theta}_i=[\phi_i,\theta_i,\psi_i]^\mathsf{T}$, and $\boldsymbol{\Omega}_i=[p_i,q_i,r_i]^\mathsf{T}$ denote position, velocity, attitude angles, and angular rates respectively. $m$ is mass, $g$ is gravity acceleration, $\mathbf{t}_3=[0,0,1]^\mathsf{T}$, $\mathbf{R}(\boldsymbol{\Theta}_i)$ is the rotation matrix, $\boldsymbol{\Pi}(\boldsymbol{\Theta}_i)$ is the transformation matrix, $\mathbf{J}_i$ is the inertia tensor, $U_{\Gamma i}$ is total thrust, $\mathbf{U}_{Ti}$ is torque vector, $\mathbf{G}_{ai}$ is gyroscopic moment, and $\mathbf{d}_{Vi},\mathbf{d}_{\Omega i}$ are external disturbances.

The rotation matrix and transformation matrix are given by:

$$
\mathbf{R}(\boldsymbol{\Theta}_i)=
\begin{bmatrix}
c\theta c\psi & s\phi s\theta c\psi – c\phi s\psi & c\phi s\theta c\psi + s\phi s\psi \\
c\theta s\psi & s\phi s\theta s\psi + c\phi c\psi & c\phi s\theta s\psi – s\phi c\psi \\
-s\theta & s\phi c\theta & c\phi c\theta
\end{bmatrix}
$$

$$
\boldsymbol{\Pi}(\boldsymbol{\Theta}_i)=
\begin{bmatrix}
1 & s\phi t\theta & c\phi t\theta \\
0 & c\phi & -s\phi \\
0 & s\phi/c\theta & c\phi/c\theta
\end{bmatrix}
$$

with shorthand $c\cdot=\cos(\cdot)$, $s\cdot=\sin(\cdot)$, $t\cdot=\tan(\cdot)$. The control inputs (thrust and torques) are related to rotor speeds $\omega_j$ via:

$$
U_{\Gamma i} = k_b \sum_{j=1}^4 \omega_j^2,\quad
\mathbf{U}_{Ti}=
\begin{bmatrix}
k_b l(\omega_2^2-\omega_4^2)\\
k_b l(\omega_3^2-\omega_1^2)\\
k_d(\omega_2^2+\omega_4^2-\omega_1^2-\omega_3^2)
\end{bmatrix}
$$

Table 1 lists the physical parameters used in our simulations.

Table 1: Quadrotor parameters
Parameter Value
$m$ $0.28\,\text{kg}$
$l$ $0.23\,\text{m}$
$J_{ix}$ $5.67\times10^{-3}\,\text{kg·m}^2$
$J_{iy}$ $5.67\times10^{-3}\,\text{kg·m}^2$
$J_{iz}$ $8.34\times10^{-3}\,\text{kg·m}^2$
$J_{ri}$ $1.0\times10^{-6}\,\text{kg·m}^2$
$k_b$ $9.23\times10^{-8}\,\text{N·s}^2$
$k_d$ $3.03\times10^{-8}\,\text{N·m·s}^2$

3. Formation and Obstacle Avoidance Control

3.1 Consensus‑Based Formation Controller

Consider a team of n follower UAVs and one virtual leader (index 0). The communication topology is represented by a weighted undirected graph $\mathcal{G}$. The consensus controller for each follower is:

$$
\mathbf{u}_i = \alpha\beta\big( \mathbf{v}_0 – \mathbf{v}_i \big) – \beta\sum_{j=1}^n a_{ij}\big( (\mathbf{x}_i-\mathbf{l}_i)-(\mathbf{x}_j-\mathbf{l}_j) \big) – \beta\sum_{j=1}^n a_{ij}(\mathbf{v}_i-\mathbf{v}_j)
$$

where $\mathbf{x}_i$, $\mathbf{v}_i$ are position and velocity of UAV i, $\mathbf{l}_i$ is the desired offset from the virtual leader, $\alpha=1$ if the leader’s information is available to UAV i, otherwise 0, and $\beta>0$ is a gain. This controller drives the formation to the desired geometry as $t\to\infty$.

3.2 Obstacle Detection via Minimum Distance

Instead of assuming obstacles are spheres or cylinders, we define for each irregular obstacle $b$ the closest point on its boundary to UAV i at time $t$:

$$
\mathbf{x}_{ob} = \arg\min_{\mathbf{p}\in\mathcal{O}_b} \|\mathbf{x}_i(t)-\mathbf{p}\|
$$

where $\mathcal{O}_b$ is the set of all boundary points of obstacle $b$. This point is used as the center of a repulsive field with two zones: a forbidden region of radius $r_o$ and an avoidance region of radius $R_o$ ($R_o>r_o$). The repulsion function for obstacle $b$ is:

$$
U_{ob}^{ij} = \begin{cases}
\frac{4(R_o^2 – \|\mathbf{x}_i-\mathbf{x}_{ob}\|^2)}{(R_o^2 – r_o^2)^2}, & r_o < \|\mathbf{x}_i-\mathbf{x}_{ob}\| \le R_o \\
0, & \|\mathbf{x}_i-\mathbf{x}_{ob}\| > R_o
\end{cases}
$$

Its gradient is continuous across the boundary:

$$
\nabla U_{ob}^{ij} = \begin{cases}
-\frac{4(R_o^2 – \|\mathbf{x}_i-\mathbf{x}_{ob}\|^2)}{(R_o^2 – r_o^2)^2} \frac{\mathbf{x}_i-\mathbf{x}_{ob}}{\|\mathbf{x}_i-\mathbf{x}_{ob}\|}, & r_o < \|\mathbf{x}_i-\mathbf{x}_{ob}\| \le R_o \\
\mathbf{0}, & \|\mathbf{x}_i-\mathbf{x}_{ob}\| > R_o
\end{cases}
$$

Similarly, to avoid collisions between UAVs, we define a repulsion function $U_{ij}$ with forbidden radius $r_u$ and avoidance radius $R_u$:

$$
U_{ij} = \begin{cases}
\frac{4(R_u^2 – \|\mathbf{x}_i-\mathbf{x}_j\|^2)}{(R_u^2 – r_u^2)^2}, & r_u < \|\mathbf{x}_i-\mathbf{x}_j\| \le R_u \\
0, & \|\mathbf{x}_i-\mathbf{x}_j\| > R_u
\end{cases}
$$

The total repulsive force on UAV i is:

$$
\mathbf{F}_i(\mathbf{x}_i) = \sum_{j\neq i} \nabla U_{ij} + \sum_{b=1}^M \nabla U_{ob}^{ij}
$$

3.3 Integrated Formation‑Obstacle Avoidance Controller

The final control input for each follower combines consensus and repulsion:

$$
\mathbf{u}_i^z = \alpha\beta\big( \mathbf{v}_0 – \mathbf{v}_i \big) – \beta\sum_{j=1}^n a_{ij}\big( (\mathbf{x}_i-\mathbf{l}_i)-(\mathbf{x}_j-\mathbf{l}_j) \big) – \beta\sum_{j=1}^n a_{ij}(\mathbf{v}_i-\mathbf{v}_j) + \beta_1 \mathbf{F}_i(\mathbf{x}_i)
$$

where $\beta_1>0$ scales the repulsion effect. This controller ensures that the formation maintains desired geometry while avoiding both inter‑UAV collisions and external obstacles.

3.4 Trajectory Tracking via Adaptive Integral Backstepping

Given a desired trajectory $\mathbf{P}_{di}(t)$ from the virtual leader and offsets, we design an adaptive integral backstepping controller for each UAV. Define position tracking error:

$$
\mathbf{e}_{1i} = \mathbf{P}_i – \mathbf{P}_{di}
$$

Choose Lyapunov function:

$$
Z_{1i} = \frac12 \mathbf{e}_{1i}^\mathsf{T}\mathbf{e}_{1i} + \frac{\gamma_{1i}}{2} \boldsymbol{\zeta}_{1i}^\mathsf{T}\boldsymbol{\zeta}_{1i}, \quad \boldsymbol{\zeta}_{1i} = \int_0^t \mathbf{e}_{1i}\,d\tau
$$

Virtual control for velocity:

$$
\boldsymbol{\mu}_{1i} = -k_{1i}\mathbf{e}_{1i} + \dot{\mathbf{P}}_{di} – \gamma_{1i}\boldsymbol{\zeta}_{1i}
$$

Error dynamics:

$$
\mathbf{e}_{2i} = \mathbf{V}_i – \boldsymbol{\mu}_{1i}
$$

Define second Lyapunov function:

$$
Z_{2i} = Z_{1i} + \frac12 \mathbf{e}_{2i}^\mathsf{T}\mathbf{e}_{2i}
$$

Position control law (thrust vector):

$$
\boldsymbol{\eta}_i = m\big( -k_{2i}\mathbf{e}_{2i} – \mathbf{e}_{1i} + \dot{\boldsymbol{\mu}}_{1i} + g\mathbf{t}_3 – \hat{\mathbf{d}}_{Vi} \big)
$$

where $\hat{\mathbf{d}}_{Vi}$ is the adaptive estimate of disturbance $\mathbf{d}_{Vi}$, updated by $\dot{\hat{\mathbf{d}}}_{Vi} = \lambda_{1i}\mathbf{e}_{2i}$, $\lambda_{1i}>0$. This yields $\dot{Z}_{3i} = -k_{1i}\mathbf{e}_{1i}^\mathsf{T}\mathbf{e}_{1i} – k_{2i}\mathbf{e}_{2i}^\mathsf{T}\mathbf{e}_{2i}$, guaranteeing asymptotic stability.

The desired thrust and attitude angles are extracted from $\boldsymbol{\eta}_i=[\eta_{ix},\eta_{iy},\eta_{iz}]^\mathsf{T}$:

$$
U_{\Gamma i} = m\sqrt{\eta_{ix}^2+\eta_{iy}^2+(\eta_{iz}+g)^2}
$$
$$
\phi_{di} = \arcsin\!\left( \frac{m(\eta_{ix}\sin\psi_{di} – \eta_{iy}\cos\psi_{di})}{U_{\Gamma i}} \right)
$$
$$
\theta_{di} = \arctan\!\left( \frac{\eta_{ix}\cos\psi_{di} + \eta_{iy}\sin\psi_{di}}{\eta_{iz}+g} \right)
$$

where $\psi_{di}$ is the desired yaw (set to leader’s yaw). A first‑order filter is used to avoid “explosion of terms” in backstepping:

$$
\tau_i \dot{\hat{\boldsymbol{\Theta}}}_{di} + \hat{\boldsymbol{\Theta}}_{di} = \boldsymbol{\Theta}_{di},\quad \hat{\boldsymbol{\Theta}}_{di}(0)=\boldsymbol{\Theta}_{di}(0)
$$

Attitude tracking errors are defined analogously, and a similar adaptive backstepping controller yields the torque inputs $\mathbf{U}_{Ti}$. The complete control architecture is shown in Table 2.

Table 2: Controller parameters
Parameter Value
$k_{1i},k_{3i}$ 8
$k_{2i},k_{4i}$ 6
$\gamma_{1i},\gamma_{2i}$ 2
$\lambda_{1i},\lambda_{2i}$ 0.5
$\tau_i$ 0.05
$\beta$ 2
$\beta_1$ 0.03
$r_u$, $R_u$ 0.5 m, 1.2 m
$r_o$, $R_o$ 0.3 m, 0.8 m

The communication topology among 4 followers and a virtual leader is shown in the following figure (note: this is an illustration of the concept of drone technology).

4. Simulation Results

4.1 Static Obstacle Environment

Four UAVs start from different initial positions: $[0,1,0]^\mathsf{T}$, $[1,1,0]^\mathsf{T}$, $[1,0,0]^\mathsf{T}$, $[0,0,0]^\mathsf{T}$ (units in meters). The virtual leader follows $\mathbf{P}_0(t)=[0.6t,\sin(0.1t),2]^\mathsf{T}$ m. Desired offsets are $\mathbf{l}_1=[0,2,0]^\mathsf{T}$, $\mathbf{l}_2=[0,1,0]^\mathsf{T}$, $\mathbf{l}_3=[0,-1,0]^\mathsf{T}$, $\mathbf{l}_4=[0,-2,0]^\mathsf{T}$, switching at $t=50$ s to a tighter formation with offsets halved. Three irregular static obstacles are placed. Figure 2 shows the 3D trajectories under our method vs. the artificial potential field (APF) method. Table 3 summarizes performance metrics.

Table 3: Performance comparison in static obstacle environment
Metric Proposed method APF method
Total avoidance duration (s) 22.3 27.8
Max avoidance speed (m/s) 1.78 3.49
Max tracking error (m) 0.72 2.43

Our method yields smoother velocity profiles (Figure 7) and smaller tracking errors (Figure 8). At $t=50$ s, the formation switches smoothly to a closer geometry, demonstrating the robustness of the controller.

4.2 Dynamic Obstacle Environment

Three moving irregular obstacles are introduced. Offsets are $\mathbf{l}_1=[0,2,0]^\mathsf{T}$, $\mathbf{l}_2=[0,0,2]^\mathsf{T}$, $\mathbf{l}_3=[0,-2,0]^\mathsf{T}$, $\mathbf{l}_4=[0,0,-2]^\mathsf{T}$. The virtual leader trajectory remains the same. Figure 10 shows that our method produces more reasonable paths that follow the obstacle shape, while APF causes unnecessary detours. Inter‑UAV distances (Figure 12) always remain above the safe threshold of 0.7 m. Table 4 compares performance.

Table 4: Performance comparison in dynamic obstacle environment
Metric Proposed method APF method
Total avoidance duration (s) 24.2 31.5
Max avoidance speed (m/s) 1.46 1.98
Max tracking error (m) 0.72 1.45

The velocity profiles in Figure 11 indicate that our controller achieves smoother acceleration and deceleration. Trajectory tracking errors (Figure 13) are significantly lower, indicating superior formation maintenance.

5. Conclusion

We have proposed a distributed formation obstacle avoidance controller for quadrotor UAVs that combines consensus theory with a carefully designed repulsion function. The key novelty lies in the obstacle detection scheme based on the minimum distance to the obstacle boundary, which allows realistic handling of irregular obstacles without requiring prior knowledge of the obstacle’s geometric center. The smooth bounded repulsion function prevents local minima and ensures connectivity preservation. An adaptive integral backstepping tacking controller guarantees asymptotic convergence of the formation to the desired trajectory despite external disturbances. Simulation results in both static and dynamic environments demonstrate that our method outperforms traditional artificial potential field approaches in terms of avoidance efficiency, path smoothness, and formation accuracy. This work contributes to the advancement of drone technology by providing a practical and robust solution for autonomous multi‑UAV operations in cluttered environments.

Scroll to Top