Abstract
Accurate dynamics modeling is fundamental to robotic planning and control. However, researchers often face a dichotomy between physically consistent but under-expressive "white-box" analytic models and flexible but "physically illiterate" "black-box" neural networks. This paper introduces DiffNEA, a differentiable simulator that bridges this gap. By implementing the Newton-Euler equations within an automatic differentiation framework and employing "virtual parameters" to enforce physical laws, DiffNEA identifies complex robot dynamics—including friction and non-holonomic constraints—from real-world data. The resulting models enable successful offline reinforcement learning on physical hardware, specifically for tasks involving complex string dynamics that cause standard neural network models to fail.
Introduction
In the quest for the "holy grail" of robotics—an accurate dynamics model—traditional approaches fall into two categories. White-box models, derived from first principles like Newtonian mechanics, are physically consistent and generalize well but often fail to capture messy real-world effects like non-linear friction. Conversely, black-box models like deep neural networks can fit complex data but often violate physical laws, predicting impossible energy gains that lead to divergent trajectories during long-term planning.
The challenge lies in creating a model that is both accurate and physically plausible. This is particularly difficult for systems with complex constraints, such as the non-holonomic dynamics of a string in a "ball in a cup" task. DiffNEA addresses this by making the physics engine itself differentiable, allowing it to learn from data while remaining bounded by the laws of physics.
Methodology
The core of this work is the Differentiable Newton-Euler Algorithm (DiffNEA), which leverages several key innovations:
- Differentiable Physics Engine: The authors utilize a Lie algebra formulation of the Articulated Body Algorithm (ABA) and Recursive Newton-Euler Algorithm (RNEA). Implemented in PyTorch, this allows for the computation of gradients of simulation outputs with respect to physical parameters like mass, inertia, and link lengths.
- Virtual Parameterization: To prevent the learning of impossible physics (e.g., negative mass), parameters are optimized in a "virtual" space. For instance, optimizing $\sqrt{m}$ instead of $m$ ensures mass remains strictly positive.
- Hybrid Actuator Models: Rigid-body equations are augmented with actuator models ranging from simple viscous friction to "NN-Friction." The latter is a neural network constrained to be dissipative, ensuring the model cannot act as a perpetual motion machine.
- Constraint Handling: For non-holonomic constraints, such as a string that can go slack but not stretch, the simulator incorporates penalty terms in the optimization objective, allowing it to "learn" these constraints directly from motion data.
Experimental Setup
The researchers evaluated DiffNEA across three distinct physical systems, each presenting unique challenges in dynamics modeling:
- Quanser Cartpole: An under-actuated system characterized by high stiction.
- Quanser Furuta Pendulum: A sensitive system with small masses and lengths.
- Barrett WAM (Ball in a Cup): A high-degree-of-freedom robot arm performing a task with complex, non-linear string dynamics.
These systems were tested using three data regimes: idealized randomly sampled data, simulated trajectories with noise, and real-world system observations.
Results and Discussion
The primary advantage of DiffNEA is its ability to produce stable, long-term rollouts that remain physically consistent. While standard feed-forward neural networks (FF-NN) might achieve lower one-step prediction errors on training data, they often diverge rapidly when used for multi-step planning because they do not respect energy conservation.
Key Findings:
- Ball in a Cup Success: DiffNEA was the only model capable of solving the "ball in a cup" task using offline reinforcement learning on the physical robot. It achieved a 60% transferability rate and up to 100% repeatability. In contrast, standard LSTMs and FF-NNs failed completely, learning "spurious solutions" that did not translate to the real world.
- Energy Boundedness: By forcing actuator models to be energy-dissipative, DiffNEA prevents the RL agent from exploiting physical inconsistencies in the model.
- Joint Kinematic-Dynamic Learning: For simpler systems, DiffNEA demonstrated the ability to infer both the robot's geometry (link lengths) and its mass properties simultaneously from raw motion data.
Conclusion
DiffNEA demonstrates that embedding physical inductive biases into differentiable frameworks is essential for real-world robotic learning. By prioritizing global physical validity over local fitting accuracy, the algorithm provides a robust foundation for offline reinforcement learning on complex hardware. Future work will explore multi-step loss functions and generative models to further refine parameter identification over longer horizons and resolve ambiguities in over-parameterized systems.
Summary updated