All projects

Swarm robotics

Swarm Robot Firmware

Complete embedded C firmware for autonomous mobile swarm robots with advanced control algorithms and multi-robot coordination capabilities

Swarm Robot Firmware

Overview

The Swarm Robot Firmware is a comprehensive embedded C operating system designed for autonomous mobile robots in swarm configurations. Built for 8-bit AVR microcontrollers, this firmware provides a complete robotics platform with advanced control algorithms, sensor fusion, and multi-robot coordination capabilities. The system was developed as part of a mechatronics graduation project and represents a full-featured robotics control system optimized for resource-constrained environments.

Technical Architecture

Modular Design Philosophy

The firmware employs a highly modular architecture with clearly separated functional components, enabling easy maintenance, testing, and extension. Each subsystem is implemented as independent modules with well-defined interfaces, promoting code reusability and system reliability.

Core System Components

Hardware Abstraction Layer

Control System Architecture

Advanced Control Features

Sensor Fusion and Localization

The odometry system implements sophisticated sensor fusion combining multiple data sources:

// Potentiometer-based angular velocity estimation with median filtering
void _pmB_current_calc(void) {
    if(_sample_counter > __PM_SAMPLE_COUNT) {
        _sample_counter = 0;
        _insertion_sort(reads, __PM_SAMPLE_COUNT);
        _pmB_current = reads[(__PM_SAMPLE_COUNT >> 1)];
        _omega_pmB = __PM_SLOPE * (float)(_pmB_current - _pmB_prev);
    }
    _pmB_prev = _pmB_current;
}

Robust Filtering Algorithms

Real-time Control Implementation

The system implements a multi-rate control architecture:

Robot Platform Integration

Differential Drive Kinematics

The kinematics module provides complete mathematical models for differential drive robots:

struct point {
    float x;  ///< X coordinate in world frame
    float y;  ///< Y coordinate in world frame
};

struct _theta {
    float theta;  ///< Robot orientation in radians
};

// Robot geometric parameters
#define L 0.06    // Wheelbase (meters)
#define r 0.02    // Wheel radius (meters)
#define R_over_L 0.333  // Turning ratio

Multi-sensor Integration

Communication and Swarm Coordination

Serial Communication Protocol

The USART module provides robust communication with external systems:

Data Formatting and Telemetry

Custom formatting functions enable efficient data transmission:

char * _float_to_printable(float input) {
    int16_t a = input;
    uint16_t b = (float)((input - (float)a) * 10000.0);
    sprintf(out, "%d,%u", a, b);
    return out;
}

Swarm Behavior Framework

Development and Deployment

Build System

Hardware Requirements

Real-time Performance

The firmware is optimized for real-time performance on resource-constrained hardware:

Research Applications

Swarm Robotics Research

This firmware serves as a foundation for various swarm robotics research areas:

Educational Platform

The modular design and comprehensive documentation make this firmware ideal for:

Performance Characteristics

Control System Performance

Communication Performance

Future Enhancements

Planned Extensions

Scalability Features

This firmware represents a complete embedded robotics platform, demonstrating advanced control theory implementation in resource-constrained environments while maintaining the flexibility needed for diverse research applications and educational use cases.