Skip to content

fred-schmittel/dependable_mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Dependable MPC for UAV Control

This repository provides the implementation of a Model Predictive Control (MPC) architecture designed for the reliable control of unmanned aerial vehicles (UAVs). It is part of the Master's thesis "Design and Implementation of a Model Predictive Control Architecture for Dependable Control of Unmanned Aerial Vehicles" by Frederik Schmittel.

Key Technical Features

Advanced Control System Implementation

  • Model Predictive Control (MPC)

    • Custom ADMM-based solver for optimal control computation
    • Real-time constraint handling to ensure system safety
  • State Estimation

    • Luenberger Observer for Robust State Estimation
      • Estimates system states without noise influence
      • Real-time state prediction and correction

Safety-Critical Systems Design

  • Predictive Safety Filter
    • Proactively enforces constraints to ensure safe operation
    • Real-time validation of control inputs
    • Automatic fallback to a backup control input in case of constraint violations

Modern Software Architecture

  • ROS2 Integration

    • Modular, node-based system architecture
    • Efficient inter-process communication through ROS2 topics
    • Zero-copy data transfer where applicable to minimize latency
  • High-Performance Computing

    • Optimized matrix operations for real-time execution
    • Cache-friendly data structures to enhance computational efficiency
    • Minimization of dynamic memory allocation for improved determinism

The system consists of three main components working together to ensure safe and optimal control of a dynamic system.

graph TD
    A[System Simulator] -->|Measurements| B[State Observer]
    B -->|State Estimate| C[MPC Controller]
    C -->|Control Commands| D[Safety Filter]
    D -->|Safe Controls| A
Loading

Core Components

1. System Simulator (system_simulator.cpp)

  • Simulates linearized UAV dynamics
  • Provides sensor measurements
  • Applies control inputs
  • Real-time system state updates

2. Safe Controller (safe_control.cpp)

  • Implements predictive safety filtering
  • Validates control constraints
  • Ensures state bounds
  • Provides backup control strategies

3. Controller (controller.cpp)

  • Executes MPC optimization
  • Performs state estimation
  • Computes optimal control inputs
  • Handles real-time constraints

Performance Characteristics

  • Control loop frequency: 50Hz
  • State dimension: 8 (position, velocity, orientation)
  • Control inputs: 4 (motor commands)
  • Constraint validation: <1ms
  • MPC solve time: ~5ms average

Getting Started

Prerequisites

  • Docker
  • Git
  • ROS2 Humble (if building from source)

Quick Start with Docker

# Clone repository
git clone https://github.com/F-DSK-SCH/ros2_dependable_mpc.git
cd ros2_dependable_mpc

# Build Docker image
docker build -t ros2_dependable_mpc .

# Run simulation
docker run --rm ros2_dependable_mpc ros2 launch mpc_package control_loop_launch.py

Building from Source

# Install dependencies
sudo apt-get update && sudo apt-get install -y \\
    python3-pip \\
    python3-colcon-common-extensions \\
    libeigen3-dev

# Build project
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/F-DSK-SCH/ros2_dependable_mpc.git
cd ..
colcon build
source install/setup.bash

# Run simulation
ros2 launch mpc_package control_loop_launch.py

System Configuration

The system can be configured through YAML files:

controller:
  ros__parameters:
    # System dynamics matrix (8x8)
    SYSTEM_MATRIX: [
      1.0, 0.0, -0.0001, ...
      # ... rest of matrix
    ]
    
    # Input matrix (8x4)
    INPUT_MATRIX: [
      0.0, -0.0065, ...
      # ... rest of matrix
    ]
    
    # Control constraints
    CONTROL_MAX: [0.43633, 0.34907, 0.52360, 0.75]
    CONTROL_MIN: [-0.43633, -0.34907, -0.52360, 0.0]

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This work is part of the Master's thesis "Design and implementation of a model predictive control architecture for dependable control of unmanned aerial vehicles" by Frederik Schmittel.

Project Link: https://github.com/F-DSK-SCH/dependable_mpc

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages