Table of Contents
Fetching ...

NMPCM: Nonlinear Model Predictive Control on Resource-Constrained Microcontrollers

Van Chung Nguyen, Pratik Walunj, Chuong Le, An Duy Nguyen, Hung Manh La

TL;DR

This work presents an efficient solution for generating and deploying NMPC on microcontrollers (NMPCM) to control quadrotor UAVs and demonstrates its capability to achieve high-frequency NMPC execution in real-time systems.

Abstract

Nonlinear Model Predictive Control (NMPC) is a powerful approach for controlling highly dynamic robotic systems, as it accounts for system dynamics and optimizes control inputs at each step. However, its high computational complexity makes implementation on resource-constrained microcontrollers impractical. While recent studies have demonstrated the feasibility of Model Predictive Control (MPC) with linearized dynamics on microcontrollers, applying full NMPC remains a significant challenge. This work presents an efficient solution for generating and deploying NMPC on microcontrollers (NMPCM) to control quadrotor UAVs. The proposed method optimizes computational efficiency while maintaining high control accuracy. Simulations in Gazebo/ROS and real-world experiments validate the effectiveness of the approach, demonstrating its capability to achieve high-frequency NMPC execution in real-time systems. The code is available at: https://github.com/aralab-unr/NMPCM.

NMPCM: Nonlinear Model Predictive Control on Resource-Constrained Microcontrollers

TL;DR

This work presents an efficient solution for generating and deploying NMPC on microcontrollers (NMPCM) to control quadrotor UAVs and demonstrates its capability to achieve high-frequency NMPC execution in real-time systems.

Abstract

Nonlinear Model Predictive Control (NMPC) is a powerful approach for controlling highly dynamic robotic systems, as it accounts for system dynamics and optimizes control inputs at each step. However, its high computational complexity makes implementation on resource-constrained microcontrollers impractical. While recent studies have demonstrated the feasibility of Model Predictive Control (MPC) with linearized dynamics on microcontrollers, applying full NMPC remains a significant challenge. This work presents an efficient solution for generating and deploying NMPC on microcontrollers (NMPCM) to control quadrotor UAVs. The proposed method optimizes computational efficiency while maintaining high control accuracy. Simulations in Gazebo/ROS and real-world experiments validate the effectiveness of the approach, demonstrating its capability to achieve high-frequency NMPC execution in real-time systems. The code is available at: https://github.com/aralab-unr/NMPCM.

Paper Structure

This paper contains 12 sections, 3 equations, 16 figures, 3 tables, 1 algorithm.

Figures (16)

  • Figure 1: A detailed hardware comparison of various robot platforms, highlighting their processor, RAM, and flash memory. At the smallest scale, the Kilobot rubenstein2012kilobot exemplifies a microrobot that utilizes constrained 8-bit microcontrollers to execute pre-programmed motions. At slightly larger scales, platforms such as the Sphero Mini SpheroMini, Crazyflie 2.1 crazyflie, Hexapod robot bachega2023flexibility, Snake-like robot ohashi2010loop, and Petoi Robot Petoi employ more advanced 32-bit microcontrollers for motion planning and control. At the full scale, platforms like the TurtleBot 3 amsters2020turtlebot and Boston Dynamics' Spot bostondynamic leverage onboard computers such as the Raspberry Pi 4 and NVIDIA Jetson Xavier, enabling high-performance computing and the execution of complex tasks. In this research, we focus on tiny-scale platforms that utilize resource-constrained microcontrollers to achieve full task control and solve optimization problems. While these microcontrollers are capable of limited onboard computation, they exhibit significantly lower processor speeds, RAM, and flash memory compared to full-scale robotic systems.
  • Figure 2: The control diagram of the NMPC-PID.
  • Figure 3: Scheme of the NMPC on MCUs (Teensy 4.1).
  • Figure 4: Solving time of the proposed method, MPCC using ACADO code generation, and NMPC using CaSaDi (all employing RK4 for integration). The prediction horizons range from 10 to 20, with the integral step set to 5. While CaSaDi successfully solves the problem, the quadrotor fails to track the reference trajectory when the prediction horizon exceeds 16. The proposed method outperforms others in solving time while ensuring the tracking performance of the robot and satisfying the constraints of the NMPC problem.
  • Figure 5: Tracking performance along the x and y-axis.
  • ...and 11 more figures

Theorems & Definitions (1)

  • Remark 1