Improved Artificial Potential Field (IAPF) + Event-Based Reconfiguration Control (ERC)
A Python simulator of a 5-quadcopter swarm with full 6-DoF dynamics, cascaded PID control, obstacles and wind gusts.
ERC swarm shrinks its V-formation, switches to single-file tailgating to pass a 1 m gap, then re-forms.
- Hierarchical and decentralized. A swarm-level planner (IAPF / ERC) generates setpoints, and each drone runs its own cascaded PID loop.
- Adaptive reconfiguration. ERC estimates the free width ahead, scales the formation, and switches to tailgating when the gap is too narrow.
- 3D mission extensions. Autonomous takeoff, 3D goal/waypoint navigation, circular-path tracking, and formation orientation along the heading.
- High-fidelity plant. Quaternion 6-DoF model derived with Kane's method (DJI F450 parameters), 2nd-order motor dynamics, and a periodic gust wind model.
| Scenario | IAPF (static) | ERC (adaptive, proposed) |
|---|---|---|
| 1 · Basic obstacle avoidance | ![]() |
![]() |
| 2 · Narrow gap passage | ![]() ❌ stalls at the entrance · ▶ YouTube |
![]() ✅ scale → tailgate → re-form · ▶ YouTube |
| 3 · Narrow gap + wind gust | 4 · U-shaped trap (limitation) |
|---|---|
![]() ▶ V-shape · ▶ Polygon |
![]() Local minimum of a purely reactive planner |
| 5 · Waypoint navigation (gust) | 6 · Circular path tracking (gust) |
![]() ▶ YouTube |
![]() ▶ YouTube |

▶ Watch the full simulation playlist on YouTube
![]() System architecture: high-level planner + per-agent PID |
![]() High-level planner: state machine, behaviors, event trigger |
Behaviors. Every agent sums simple velocity behaviors. ERC blends formation and tailgating with a switching function σᵢ:
![]() Formation |
![]() Migration |
![]() Avoidance |
![]() Tailgating |
![]() Takeoff |
![]() V-shape topology |
![]() Polygon topology |
![]() Free-width estimation we that triggers scaling/tailgating |
➡️ Dynamics model, controller gains, full behavior equations and the hardware plan are in docs/TECHNICAL.md.
| Scenario | Planner | Outcome | Time (s) | Avg. speed (m/s) | RMSEtotal (m) | Φ (order) |
|---|---|---|---|---|---|---|
| 1 · Basic obstacles | IAPF | ✅ | 66.790 | 0.492 | 0.236 | 0.892 |
| ERC | ✅ | 65.745 | 0.503 | 0.241 | 0.890 | |
| 2 · Narrow gap | IAPF | ❌ | 54.195 | 0.365 | 0.525 | 0.868 |
| ERC | ✅ | 59.735 | 0.561 | 0.692 | 0.878 | |
| 3 · Narrow gap + gust | ERC | ✅ | 59.735 | 0.557 | 0.694 | 0.925 |
git clone https://github.com/izmaherdian/multi-agent-sim.git
cd multi-agent-sim
pip install numpy==1.26.4 scipy==1.15.2 sympy==1.13.3 matplotlib==3.9.4
python main.pyConfigure the run in agent/config.py:
| Setting | Options |
|---|---|
CONTROLLER |
'erc', 'iapf' |
OBSTACLE_SCHEME |
'scheme1' basic · 'scheme2' narrow gap · 'scheme3' U-trap · 'NONE' |
WIND_TYPE |
'NONE', 'FIXED', 'GUST' |
PATH_TYPE |
'goal', 'multi-goal' (waypoints), 'circular' |
At the bottom of main.py, switch the call to main_multi_agent() for the swarm (the default main() runs a single quadcopter). Logs (*.pkl) and videos (*.mp4) are saved to results/data/ and results/videos/ (git-ignored). Post-process them with the scripts in visualization/, e.g. plot_paper_figures.py.
├── agent/ quadcopter model, cascaded PID, IAPF & ERC planners, config
├── environment/ obstacles, wind model, 3D animation canvas
├── visualization/ analysis & plotting scripts
├── main.py simulation entry point
├── scratch/ early prototype scripts (not needed to run the simulator)
├── paper/latex/ LaTeX source + figures of the journal paper
└── docs/
├── paper/ published paper (PDF) + citation (.ris)
├── thesis/ undergraduate thesis report & slides (Bahasa Indonesia)
├── media/ GIFs and figures used in this README
└── TECHNICAL.md detailed model, controller and algorithm description
📑 Read the paper (PDF) · Publisher page · LaTeX source · Thesis report
I. A. Herdian, E. Ekawati, F. Mukhlish, P. Prabaswara, "Decentralized formation control system design for swarm quadcopters using an improved artificial potential field and event-based reconfiguration control," Journal of King Saud University – Engineering Sciences, 38(5), 41 (2026).
@article{Herdian2026,
author = {Herdian, Izma Alhazmi and Ekawati, Estiyanti and Mukhlish, Faqihza and Prabaswara, Pramoda},
title = {Decentralized formation control system design for swarm quadcopters using an improved artificial potential field and event-based reconfiguration control},
journal = {Journal of King Saud University -- Engineering Sciences},
volume = {38},
number = {5},
pages = {41},
year = {2026},
doi = {10.1007/s44444-026-00111-4}
}A RIS file is available at docs/paper/herdian2026_citation.ris.
The source code is released under the MIT License. The paper, thesis and figures in docs/ and paper/ remain under their respective copyrights (the published paper is open access under its publisher's license).
Engineering Physics, Institut Teknologi Bandung






















