Source-linked AI summary

Real-time Neural-MPC: Deep Learning Model Predictive Control for Quadrotors and Agile Robotic Platforms

Tim Salzmann, Elia Kaufmann, Jon Arrizabalaga, Marco Pavone, Davide Scaramuzza, Markus Ryll

arXiv:2203.07747v5cs.ROcs.LGeess.SY

TL;DR

Embedded MPC is constrained by the tension between accurate but computationally expensive neural dynamics and the real-time demands of agile systems. RTN-MPC separates neural-model preparation from MPC optimization and uses local, batched approximations to run larger models on embedded hardware. Experiments demonstrate 4000-times greater model capacity than prior neural online-MPC implementations in a 50Hz window and up to 82% lower positional tracking error than nominal MPC.

  • Problem

    Embedded MPC has favored simple first-principles dynamics because expressive neural models are computationally expensive despite modeling complex effects accurately.

  • Method

    RTN-MPC integrates neural-network dynamics into online MPC by separating model preparation from optimization and computing local approximations with batched CPU or GPU differentiation.

  • Results

    Up to 82% lower positional tracking error than the nominal controller was achieved in real-world quadrotor experiments.

  • Takeaways & Limitations

    The framework scales data-driven MPC to larger neural architectures while remaining real-time capable on embedded devices.

Abstract

from arXiv · show

Model Predictive Control (MPC) has become a popular framework in embedded control for high-performance autonomous systems. However, to achieve good control performance using MPC, an accurate dynamics model is key. To maintain real-time operation, the dynamics models used on embedded systems have been limited to simple first-principle models, which substantially limits their representative power. In contrast to such simple models, machine learning approaches, specifically neural networks, have been shown to accurately model even complex dynamic effects, but their large computational complexity hindered combination with fast real-time iteration loops. With this work, we present Real-time Neural MPC, a framework to efficiently integrate large, complex neural network architectures as dynamics models within a model-predictive control pipeline. Our experiments, performed in simulation and the real world onboard a highly agile quadrotor platform, demonstrate the capabilities of the described system to run learned models with, previously infeasible, large modeling capacity using gradient-based online optimization MPC. Compared to prior implementations of neural networks in online optimization MPC we can leverage models of over 4000 times larger parametric capacity in a 50Hz real-time window on an embedded platform. Further, we show the feasibility of our framework on real-world problems by reducing the positional tracking error by up to 82% when compared to state-of-the-art MPC approaches without neural network dynamics.

I. INTRODUCTION

MPC needs accurate dynamics models, but embedded real-time constraints have favored simple first-principles models over more expressive neural networks. RTN-MPC addresses this trade-off by integrating larger data-driven models into online optimization MPC on embedded devices.

  • Embedded MPC performance depends on accurate dynamics models, yet strict real-time constraints have limited embedded systems to simple first-principles models.
  • Neural networks can model complex nonlinear effects, including aerodynamic and environmental interaction forces, but their computational complexity complicates embedded MPC integration.
  • Prior approaches reduced model capacity, commonly using small neural networks or Gaussian Processes, to achieve real-time speeds.
  • RTN-MPC integrates arbitrary neural-network architectures as dynamics constraints using CPU- or GPU-parallelized local approximations.
  • The framework separates data-driven model computation from MPC optimization, enabling larger models and GPU acceleration without decreasing performance.
  • Experiments include simulation and aggressive real-world quadrotor maneuvers, demonstrating large models in a real-time embedded control window.

II. RELATED WORK

Related work shows that learned dynamics can represent complex robotic behavior, but real-time embedded MPC has typically required small models or alternative control strategies. RTN-MPC combines higher-capacity neural dynamics with gradient-based online optimization.

  • Deep neural networks have been used to model complex dynamics in quadrotors, helicopters, turbulence, tire friction, and actuators.
  • Alternative learned-control strategies include reactive controllers, offline or non-optimized methods, and end-to-end reinforcement-learning policies.
  • RTN-MPC replaces lower-capacity Gaussian Process or neural dynamics with higher-capacity networks while retaining gradient-based optimization and flexible architecture choice.
  • MPC formulates optimal control by minimizing a cost over inputs while enforcing system dynamics and state or input constraints across future timesteps.

IV. BRINGING NEURAL MPC TO ONBOARD REAL-TIME

RTN-MPC accelerates neural MPC by replacing globally evaluated learned dynamics with local approximations around current optimization iterates. Batched derivative computation on CPUs or GPUs makes quadratic-program generation largely independent of network architecture.

  • Local approximations of learned dynamics preserve similar control performance while substantially reducing optimization-problem generation time.
  • The method addresses the heavy processing required to generate QPs when computationally intensive data-driven dynamics are used.
  • The learned model and its derivatives only need accuracy around specific optimization inputs, rather than across the entire training-data input space.
  • For first- and second-order approximations, simplification errors are respectively second- and third-order in state and control changes between nodes.
  • Separating neural-model interfaces from QP generation makes QP creation independent of the data-driven model’s complexity and architecture.
  • The approach computes neural-network Jacobians and Hessians for all shooting nodes as one parallelized batch on CPU or GPU.

B. Real-time Neural MPC

RTN-MPC uses a three-part real-time procedure that prepares neural dynamics, constructs a quadratic program, and rapidly solves it after sensing a disturbed state. This separates expensive model processing from timely feedback.

  • RTN-MPC divides real-time optimization into QP preparation, data-driven preparation, and feedback-response phases.
  • The data-driven preparation phase computes model quantities using efficient batched differentiation on a CPU or GPU.
  • The QP preparation phase linearizes around the current state and control, using a local learned-dynamics approximation for continuity constraints.
  • After a disturbed state is sensed, the feedback phase solves the pre-constructed QP, updates the iterate, and sends the optimized command to the actuators.

C. Implementation

RTN-MPC integrates PyTorch-trainable neural-network models into CasADi and acados MPC, using CPU or GPU parallelized local approximations. Figure 3 evaluates real-time capability across embedded and laptop platforms against a naive neural-network integration.

  • C. Implementation: RTN-MPC supports arbitrary PyTorch-trainable neural-network models within CasADi and acados optimization.The implementation uses PyTorch as the machine-learning framework and enables models trained there to be used in CasADi.
  • C. Implementation: Figure 3 measures two-layer model capacity using the squared neuron count per layer on an Nvidia Jetson Xavier NX and an Intel i7/Nvidia RTX 3000 laptop.The evaluation uses 50Hz as the minimum target window and over 100Hz as the preferred target, while noting that real-world thresholds are use-case specific.
  • C. Implementation: The naive baseline directly embeds trained weight matrices and activation functions in CasADi, leaving QP generation and automatic differentiation to CPU-only processing.The comparison targets a direct neural-network construction that lacks optimized algorithms for the full network structure.

V. RUNTIME ANALYSIS

The runtime experiment isolates the computational cost of neural-network dynamics by using a trivial nominal system and manually configured zero-output networks. Across model sizes and architectures, RTN-MPC maintains real-time operation at capacities where the naive implementation becomes costly.

  • V. RUNTIME ANALYSIS: The experiment compares RTN-MPC with naive data-driven MPC using a double-integrator nominal model and variable-architecture neural networks.The networks are manually weighted to force zero output, isolating computational complexity from modeling accuracy.
  • V. RUNTIME ANALYSIS: The dynamics function is numerically integrated with an explicit fourth-order Runge-Kutta method, ϕ(x, u, f, δt) = RK4(x, u, f, δt).The optimization uses a multiple-shooting scheme with N = 10 nodes and no model-plant mismatch.
  • V. RUNTIME ANALYSIS: 60-fold larger CPU models and 4000-fold larger GPU models remain within a real-time window above 50Hz on the Nvidia Jetson Xavier NX.The comparison is against a naive implementation of the same neural-network dynamics integration.
  • V. RUNTIME ANALYSIS: More than 150 million parameters run above 100Hz on a low-end Nvidia RTX 3000 GPU in the desktop evaluation.This result concerns two-layer models in the runtime comparison.
  • V. RUNTIME ANALYSIS: A 12-layer, 512-neuron-per-layer network runs above 50Hz on an embedded CPU and above 500Hz on a desktop CPU with RTN-MPC.The naive approach performs better for small networks, while RTN-MPC dominates for larger and deeper networks.
  • V. RUNTIME ANALYSIS: An 18-convolutional-layer ResNet runs above 50Hz in the optimization loop when RTN-MPC leverages GPU capabilities.The result demonstrates integration of a complex convolutional architecture rather than only two-layer networks.

VI. EXPERIMENTAL SETUP

The experimental setup uses agile quadrotor flight and augments nominal rigid-body dynamics with neural residual models. RTN-MPC also supports height-map inputs, quadratic tracking costs, and constrained control inputs.

  • Agile quadrotor flight is used to showcase RTN-MPC on real-world robotic problems.
  • The nominal model represents a 6-degree-of-freedom rigid body with a 13-dimensional state and four rotor-thrust control inputs.The model uses mass, diagonal inertia, gravity, collective thrust, and body torque terms.
  • Neural residual models complement nominal dynamics by modeling disturbances in linear and angular accelerations.Separate neural-network parameters model the linear and angular disturbance components.
  • Simplified residual models use platform velocity, optionally together with commanded inputs, to model residual forces.
  • The augmented ground-effect model adds a local height-map patch around the quadrotor as a high-level input.The mapping returns a 3×3 local patch from the global height map at 10 cm resolution.
  • The MPC cost penalizes deviations from a reference trajectory while constraining controls between zero and their maximum values.

VII. EXPERIMENTS

Experiments evaluate learned dynamics through system identification and trajectory tracking, comparing model types and RTN-MPC against naive integration. The simplified simulation results show improved model performance and real-time scalability for larger networks.

  • Experiments first collect system-identification data and train residual models from errors generated by re-simulating the nominal controller.
  • Evaluation tracks fixed Circle and Lemniscate trajectories using mean Euclidean distance between reference and tracked positions.
  • Model names encode architecture size and implementation type, distinguishing RTN-MPC models marked “-Ours” from naive integrations marked “-Naive”.GP-20 denotes a Gaussian Process with 20 inducing points.
  • Training uses Adam with batch size 64, learning rate 1e−4, validation splits, and early stopping.Datasets contain 20k, 200k, and 1.8 million datapoints across the listed environments.
  • In simplified simulation, deep-learning models outperform Gaussian Processes, while RTN-MPC enables large models without increasing optimization time versus naive integration.

A. Simulation

Simulation studies compare RTN-MPC with non-augmented MPC, naive learned-dynamics integration, and Gaussian Processes across simplified and aerodynamic environments. The BEM experiment increases modeling complexity while examining real-time control and tracking error.

  • The simulations compare controllers by real-time capability and model capacity against non-augmented MPC, naive integration, and Gaussian Processes.
  • The simplified simulation assumes perfect odometry and ideal commanded-thrust tracking while adding rotor and fuselage drag plus Gaussian process and motor-signal noise.
  • The simplified environment analyzes predictive performance and runtime across network sizes, constraining residual models to linear accelerations.
  • The BEM simulator models lift and drag from rotor motion and rotor speeds, communicates through ROS, and targets a 100 Hz control frequency.
  • RTN-MPC leverages multidimensional inputs and large model capacities in real time, whereas a four-layer naive network becomes unstable for high-dimensional input.The Lemniscate BEM comparison reports error standard deviations within 1 mm over five trials.
  • The real-world experiment reports up to 82% tracking improvement versus the nominal controller and up to 55% versus Gaussian Processes while remaining real-time capable.

B. Real World

Real-world experiments on an agile quadrotor show that the framework improves trajectory tracking and models ground-effect aerodynamics near obstacles.

  • B. Real World: 82% lower positional tracking error was achieved than the nominal controller in circle and lemniscate trajectories reaching 14 m s−1.The experiments ran onboard a Jetson Xavier NX and compared against nominal, naive-integration, and Gaussian Process configurations.
  • B. Real World: The naive neural-network integration became unstable because of long optimization times, while the proposed approach remained effective in real-world flight.The comparison included the nominal controller, naive integration, and Gaussian Process configuration.
  • B. Real World: 72% lower z-direction tracking error was achieved near a 70 cm-high table when the model used height-map information during eight evaluation flyovers.The quadrotor flew at an 80 cm center-of-gravity target altitude, leaving approximately 2 cm between the table and its lowest point.
  • B. Real World: The ground-effect experiment evaluated repeated close-proximity flights over a table, with vertical position error measured over distance and table locations marked.The evaluation compared a baseline without height-map information against a model given that information.

VIII. CONCLUSION

The paper demonstrates that neural-network dynamics can increase MPC modeling capacity while retaining real-time embedded operation and tracking performance. It identifies sequence-based learned dynamics as an open challenge for future work.

  • VIII. CONCLUSION: The framework scales data-driven MPC to larger neural architectures while remaining real-time capable on embedded devices.The conclusion presents this as a way to increase available real-time modeling capacity for data-driven MPC applications.
  • VIII. CONCLUSION: Using historical state and control-input sequences in learned dynamics models remains an open challenge not considered in this work.The authors identify sequential models such as LSTMs, GRUs, and TCNs as future directions for embedded MPC.
  • VIII. CONCLUSION: Controller performance was not negatively affected by the real-time approximations, enabling powerful learned models to be used for agile quadrotor tracking.The experiments report substantially reduced tracking error while using powerful models on-device.
Loading 2203.07747v5…