Imperative MPC: An End-to-End Self-Supervised Learning with Differentiable MPC for UAV Attitude Control

Haonan He, Yuheng Qiu, Junyi Geng

Introduction

Controlling Unmanned Aerial Vehicles (UAVs) in dynamic, real-world environments remains a significant challenge in robotics. Traditional control architectures are typically modular, separating state estimation, path planning, and control into distinct pipelines. While this modularity simplifies development, it often leads to suboptimality because the individual components are not optimized jointly. Conversely, pure data-driven approaches like Reinforcement Learning (RL) offer end-to-end potential but frequently struggle with the "sim-to-real" gap, high sample complexity, and a lack of physical interpretability.

This paper introduces Imperative MPC, a novel self-supervised framework that bridges the gap between deep learning and classical control. By integrating a differentiable Model Predictive Control (d-MPC) module with a neural network for inertial odometry, the system can simultaneously denoise sensor data and learn physical parameters—such as mass and inertia—without requiring manual labels or expert demonstrations.

Methodology: The Imperative Learning Framework

The core of the Imperative MPC framework is a Bi-Level Optimization (BLO) setup, which the authors term "Imperative Learning." This architecture allows the system to treat the controller as a differentiable layer within a larger neural network, enabling gradients to flow from the final control performance back to the raw sensor inputs.

1. The Perception Layer (Lower Level)

The perception module utilizes a lightweight Multi-Layer Perceptron (MLP) designed to process raw, noisy data from an Inertial Measurement Unit (IMU). This layer acts as a learned Inertial Odometry (IO) module, predicting the UAV's attitude (orientation). By learning to "clean" the sensor data, the MLP provides a more accurate state estimate than raw sensor readings.

2. The Control Layer (Inner Level)

The estimated state is passed to a Differentiable MPC (d-MPC). Unlike standard MPC, which acts as a "black box" to optimization algorithms, d-MPC allows for the calculation of gradients through the optimization process. The authors implement this using the PyPose library, specifically utilizing an iterative Linear Quadratic Regulator (iLQR) solver. This allows the system to understand how changes in perception or physical parameters directly affect the control output.

3. The Self-Supervised Loop (Upper Level)

The system operates in a self-supervised manner by comparing the drone's predicted next state (derived from its internal physics model) with the actual measured state. The resulting discrepancy serves as a loss function. Because the entire pipeline is differentiable, this loss is used to update both the neural network's weights and the physical parameters of the MPC (such as mass and moment of inertia) via backpropagation. This "reciprocal correction" ensures that the perception system and the controller co-evolve to minimize error.

Experimental Setup and Datasets

The framework was rigorously evaluated across multiple simulation environments to test its robustness and learning efficiency:

  • Custom Python Simulation: A standard 6-degree-of-freedom (DoF) quadrotor model was used for initial training and verifying the system's ability to identify physical parameters.
  • Gazebo PX4 SITL: To emulate real-world conditions, the authors used the Gazebo simulator with the PX4 Software-in-the-Loop (SITL) stack. This environment included realistic sensor noise (modeled after the Epson G365 IMU) and communication delays.
  • Wind Disturbance Scenarios: To test robustness, external forces based on the drag equation were introduced, simulating both impulse and step wind gusts at speeds ranging from 10 to 45 m/s.

Key Results and Insights

Robustness and Precision

Imperative MPC demonstrated superior performance compared to both traditional modular MPC and standalone data-driven models. In Gazebo simulations, the system maintained stable flight in wind gusts up to 20 m/s, whereas the Reinforcement Learning baseline (PPO) lost control at 15 m/s. Furthermore, iMPC achieved significantly lower Steady-State Error (SSE) and Root-Mean-Square Error (RMSE) in attitude tracking.

Physics-Informed Parameter Identification

One of the most striking capabilities of the framework is its ability to recover physical constants. Starting with a 50% error in the initial guess for mass and moment of inertia (MOI), the system was able to identify these parameters with less than 3.5% error through self-supervised observation of the drone's dynamics.

Training Efficiency

Because Imperative MPC leverages an underlying understanding of physics, it is far more sample-efficient than model-free RL. The authors found that the framework required 221% less training time than the PPO baseline to reach a stable, high-performance level.

Conclusion and Future Work

Imperative MPC represents a significant step toward autonomous systems that can adapt to their environment and their own physical changes without human intervention. By combining the flexible perception of neural networks with the rigorous optimization of MPC, the framework achieves high robustness and efficiency.

Future research will focus on transitioning this system to physical hardware in outdoor environments. Additionally, the authors plan to expand the perception module to include vision-based sensors (cameras or LiDAR) and incorporate uncertainty quantification to further enhance robustness against sensor failures.

Summary updated

BibTeX
@inproceedings{he2025imperative,
  author = {Haonan He and Yuheng Qiu and Junyi Geng},
  title = {{Imperative MPC: An End-to-End Self-Supervised Learning with Differentiable MPC for UAV Attitude Control}},
  booktitle = {L4DC},
  year = {2025},
}
Figure