This repository implements a novel approach to multi-UAV formation control using energy-efficient Spiking Neural Networks (SNNs). The project demonstrates how neuromorphic computing can enable edge intelligence for autonomous drone swarms, reducing dependency on cloud computing infrastructure.
Modern multi-agent systems often rely on cloud-based controllers, which face challenges including communication delays, bandwidth limitations, and security concerns. This project explores a decentralized approach where each UAV uses its own SNN to:
- Learn control policies through supervised learning
- Maintain optimal formations using Voronoi tessellations
- Navigate through environments with static and dynamic obstacles
- Significantly reduce energy consumption compared to traditional approaches
The implementation uses a supervised learning approach where:
- Each UAV is equipped with an SNN of configurable neuron count
- The SNN learns to approximate a cloud-based controller through spike-based communication
- Membrane potentials integrate input and generate binary spike trains
- Filtered spike trains are used to generate continuous control signals
- Weight adaptation is performed through a bio-inspired learning mechanism
Description: Investigates the fundamental capability of SNNs to maintain optimal formations through distributed control in an obstacle-free environment. UAVs arrange themselves using Lloyd's algorithm to achieve optimal coverage of a designated area.
To run:
- Execute
SNN_based_dynamics_noobs.m
in the "Case Study 1" folder
Key parameters:
NOA
: Number of UAVs (recommended < 10)NON
: Number of neurons allocated for SNNsSnum
: Number of sampling points in Lloyd's algorithmiteration
: Iteration count for Lloyd's algorithmkkk
: Error feedback gain (Line 42)eta
: Adaptation law gain (Line 43)Kpf
&Kvf
: Formation controller gain matrices (Lines 51-52)
Description: Extends the formation control capabilities to realistic environments with obstacles. UAVs must maintain their formation while detecting and avoiding static and moving obstacles, demonstrating the robustness of the SNN-based control approach.
To run:
- Execute
Static_obs.m
in the "Case Study 2" folder - Alternatively, try
new_avoidance.m
for scenarios with dynamic obstacles
Key parameters:
- All parameters from Case Study 1
FOV_theta
: UAV field of view (0° to 180°)obs_radious
: Size of obstacles (Line 97)rd
: Detection zone limit (Line 91)rs
: Safety zone limit (Line 92)kc1
&kc2
: Collision avoidance gain parameters (Lines 95-96)
The code uses Lloyd's algorithm to iteratively optimize agent positions:
- Random sampling from the desired coverage area
- Computing Voronoi cells for each agent
- Moving agents toward the centroid of their respective Voronoi cells
The neuromorphic computing model includes:
- Leaky integrate-and-fire neuron model
- Thresholding mechanism for spike generation
- Weight matrices for fast synaptic dynamics
- Slow weight adjustment for learning
- Membrane potential dynamics simulation
The implementation features:
- Field of view (FOV) based obstacle detection
- Reactive avoidance behavior with configurable safety parameters
- Special handling for static vs. dynamic obstacles
- Support for both 2D and 3D obstacle avoidance
The code generates several outputs for performance analysis:
- Voronoi diagrams: Visualizing the optimal agent distribution
- 3D trajectory animations: Showing real-time agent movement
- Spiking pattern visualizations: Displaying neural activity over time
- Energy consumption analysis: Comparing SNN vs. traditional approaches
- Control signal comparisons: Evaluating tracking performance
- Relative distance plots: Confirming collision avoidance effectiveness
- MATLAB (developed and tested with R2019b or newer)
- No additional toolboxes required