TL;DR
This paper introduces CaDeLaC (Context-Aware Deep Lagrangian MPC), a framework that enables robots to adapt online to changing environments and payloads while maintaining physically plausible dynamics. By combining a nominal physics model with a compact, context-conditioned deep network, the system achieves a 39% reduction in tracking error on a real 7-DOF robot arm, outperforming traditional adaptive baselines like Extended Kalman Filters.
What Problem Does This Paper Address?
When a robot arm manipulates different objects—like picking up a heavy tool or dropping off a payload—its underlying dynamics change instantly. Traditional Model Predictive Control (MPC) relies on an accurate dynamics model to plan future actions. If the model doesn't match reality, tracking performance degrades, or worse, the robot becomes unstable.
To handle these changes, robots need online system identification (SysID) to update their internal models on the fly. However, standard black-box neural networks require massive amounts of data and often violate basic physical principles (like the conservation of energy), making them risky for real-time control. Conversely, existing physics-informed models, such as Deep Lagrangian Networks (DeLaN), guarantee physical plausibility but are traditionally trained offline for a single, static environment. This paper bridges that gap by making physics-consistent models adaptive and fast enough for real-time MPC.
Methods
The authors propose CaDeLaC, which introduces three key architectural extensions to make physics-informed deep learning viable for online control:
- Context-Aware DeLaN: The original DeLaN architecture is modified to accept a latent context embedding, $z$, as an additional input. This allows a single neural network to represent a whole family of different dynamics (e.g., various payload masses and shapes).
- History-Based Encoder: An LSTM network runs in parallel to observe a short history of recent joint positions, velocities, and residual torques. It outputs the latent context vector $z$, effectively performing online system identification.
- Residual Learning: Instead of forcing the neural network to learn the robot's entire dynamics from scratch, it only learns the residual torque—the difference between the real robot and a known nominal model.
During control, the LSTM infers $z$ right before an MPC iteration. Crucially, $z$ is held constant over the MPC's look-ahead prediction horizon, reflecting the prior belief that the environment won't change mid-trajectory. This decoupling keeps the optimization problem computationally tractable.
Datasets
- Simulation Dataset: Generated using the MuJoCo physics engine with a model of a 7-DOF Franka Emika Panda robot. The dataset consists of 20 trajectories (10 seconds each) across 100 different payload configurations (masses from 0 to 4 kg, sampled uniformly). This yielded 1.01 million samples used exclusively for training the Context-Aware DeLaN and LSTM encoder.
- Real-World Evaluation: Tested zero-shot (without any real-world fine-tuning) on a physical Franka Emika Panda robot executing high-speed trajectories and dynamic pick-and-place tasks with unseen gym weights.
Key Insights and Ideas
- Small Networks for Fast Control: By focusing the neural network strictly on learning residual dynamics rather than full physics, the authors kept the network remarkably small (an MLP with just two hidden layers of 30 and 20 neurons). This compactness is vital for meeting the strict real-time constraints of MPC.
- Inertia Matters: Traditional baselines like Extended Kalman Filters (EKF) typically approximate payload changes purely as an external force at the end-effector (effectively just gravity compensation). CaDeLaC captures changes to the system's inertia matrix, which is why it drastically outperforms baselines during fast, agile movements where inertial forces dominate.
- Zero-Shot Sim-to-Real: Enforcing physical structure (via the Lagrangian formulation) acts as a powerful regularizer, enabling the model trained purely in simulation to transfer seamlessly to a real physical robot without exploding or behaving unpredictably.
Key Results
High-Speed Trajectory Tracking
The framework was evaluated on a real robot arm executing aggressive, high-speed maneuvers near its joint velocity limits while carrying unseen payloads (1 kg, 2 kg, and 3 kg weights).
CaDeLaC significantly reduced Cartesian tracking errors compared to both a Nominal MPC and an EKF-MPC baseline:
- 1 kg payload: Reduced tracking RMSE by 28.24% (vs. 14.80% for EKF).
- 2 kg payload: Reduced tracking RMSE by 57.93% (vs. 33.58% for EKF).
- 3 kg payload: Reduced tracking RMSE by 62.10% (vs. 35.62% for EKF).
Dynamic Pick-and-Place Task
In a 26-second task where the robot repeatedly picked up and dropped off weights (causing the system dynamics to change abruptly four times), CaDeLaC adapted swiftly, reducing the overall end-effector position RMSE by 39%, compared to only a 21% improvement from the EKF baseline.
Limitations and Future Work
The primary trade-off of CaDeLaC is computational complexity. Introducing the neural network into the MPC loop increased the total solver time by a factor of 4 (from 2.59 ms to 10.57 ms). While this still comfortably fits within the robot's 20 ms (50 Hz) control period, it could become a bottleneck for higher-frequency applications or higher-dimensional systems.
For future work, the authors plan to scale this approach to higher-dimensional and underactuated systems, such as humanoid robots, and explore reinforcement learning to optimize the history encoder directly for downstream task performance.
Summary updated