Skip to content

MATLAB code implementing Spiking Neural Network (SNN) based control systems for multi-UAV formation and obstacle avoidance

License

Notifications You must be signed in to change notification settings

INQUIRELAB/SNN-Based-UAV-Formation-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🚁 SNN-Based UAV Formation Control

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.

📚 Overview

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:

  1. Learn control policies through supervised learning
  2. Maintain optimal formations using Voronoi tessellations
  3. Navigate through environments with static and dynamic obstacles
  4. Significantly reduce energy consumption compared to traditional approaches

🧠 SNN-Based Control Architecture

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

📋 Case Studies

Case Study 1: Formation Control without Obstacles

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:

  1. 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 SNNs
  • Snum: Number of sampling points in Lloyd's algorithm
  • iteration: Iteration count for Lloyd's algorithm
  • kkk: Error feedback gain (Line 42)
  • eta: Adaptation law gain (Line 43)
  • Kpf & Kvf: Formation controller gain matrices (Lines 51-52)

Case Study 2: Formation Control with Static and Dynamic Obstacles

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:

  1. Execute Static_obs.m in the "Case Study 2" folder
  2. 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)

🔬 Technical Implementation Details

Voronoi-Based Formation Control

The code uses Lloyd's algorithm to iteratively optimize agent positions:

  1. Random sampling from the desired coverage area
  2. Computing Voronoi cells for each agent
  3. Moving agents toward the centroid of their respective Voronoi cells

SNN Implementation

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

Obstacle Avoidance

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

📊 Visualization and Analysis

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

🛠️ Dependencies

  • MATLAB (developed and tested with R2019b or newer)
  • No additional toolboxes required

About

MATLAB code implementing Spiking Neural Network (SNN) based control systems for multi-UAV formation and obstacle avoidance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages