ChainQueen: A Real-Time Differentiable Physical Simulator for Soft Robotics

Yuanming Hu, Jiancheng Liu, Andrew Spielberg, Joshua B. Tenenbaum, William T. Freeman, Jiajun Wu, Daniela Rus, Wojciech Matusik

TL;DR

ChainQueen is a high-performance, fully differentiable physical simulator designed specifically for the complex world of soft robotics. By leveraging the Moving Least Squares Material Point Method (MLS-MPM), it allows researchers to use efficient gradient-based optimization to solve "inverse problems"—like automatically designing a robot's shape or perfecting its walking gait—running up to 132x faster than standard deep learning frameworks.

What Problem Does This Paper Address?

In traditional robotics, simulating rigid parts is relatively straightforward. However, soft robots—made of deformable materials like silicone or biological tissue—present a nightmare for simulators. They have nearly infinite degrees of freedom, and calculating how they collide with themselves or their environment is computationally expensive.

The real "holy grail" in robotics is solving inverse problems: instead of asking "what happens if I move this motor?", you ask "how should I move these motors to reach that target?" To solve this efficiently, you need a differentiable simulator. If a simulator is differentiable, you can calculate "gradients" (mathematical directions) that tell you exactly how to tweak your parameters to improve performance. Existing soft-body simulators were either too slow, lacked differentiability, or relied on "black-box" neural networks that didn't follow the laws of physics accurately.

Methods

The authors introduce ChainQueen, a simulator built on the Moving Least Squares Material Point Method (MLS-MPM).

  • Hybrid Approach: MPM is a "best of both worlds" method. It uses particles (Lagrangian) to track the material's deformation and a background grid (Eulerian) to handle physics calculations like collisions and pressure.
  • Analytical Differentiability: Unlike previous work that might use "automatic differentiation" (which can be memory-heavy and slow), the authors derived the analytical gradients for the entire simulation loop. This includes the transfer of data from particles to the grid and back again.
  • Actuation Model: They added a custom "actuation stress" model that simulates how soft muscles contract or expand, allowing the simulator to model pneumatic or cable-driven robots.
  • High-Performance Implementation: While they provide a TensorFlow interface for ease of use, the core engine is written in C++ and CUDA. This allows the simulation to run directly on GPUs, bypassing the overhead of general-purpose machine learning libraries.

Datasets and Benchmarks

Since this is a physics simulator, the "datasets" consist of controlled physical scenarios used for validation:

  • Accuracy Benchmarks: Analytic 3D cases (like a falling cube) where the "true" math is known, used to verify that the simulator's gradients are precise.
  • Experimental Validation: The authors built a physical cross-shaped pneumatic actuator and compared its real-world bending and bouncing to the simulator's predictions.
  • Control Tasks: New benchmarks for soft robotics, including a 2D bipedal runner, a 3D quadruped, and a multi-link robotic arm.

Key Insights and Ideas

  • Gradients > Reinforcement Learning: The biggest "aha moment" is the comparison to model-free Reinforcement Learning (RL). Because ChainQueen provides exact gradients, it can find a walking gait for a robot in 20 minutes, while a state-of-the-art RL algorithm (PPO) was still making random movements after 4 hours.
  • Long-Term Stability: Differentiable simulators often suffer from "exploding gradients" over long time horizons. ChainQueen’s gradients remain stable and accurate even over 1,000 simulation time steps.
  • Co-Design Capability: Because the simulator is differentiable with respect to everything, you can optimize the robot's geometry (where it should be stiff vs. soft) and its controller (how it should move) simultaneously.
  • Tailored Kernels: The authors found that a custom CUDA implementation was 132x faster than implementing the same physics in TensorFlow, proving that general-purpose AI frameworks aren't yet optimized for the specific memory patterns of physical simulation.

Key Results

  • Speed: ChainQueen achieves real-time performance, running at over 2,500 FPS for 8,000 particles. It is roughly 4–9x faster than NVIDIA Flex, a popular non-differentiable simulator.
  • Precision: In numerical tests, the relative error for gradients was as low as $10^{-8}$, indicating extremely high mathematical fidelity.
  • Optimization: In a "co-design" task for a robotic arm, the simulator automatically discovered that making the inside of a joint stiffer than the outside (similar to how finger joints work) resulted in more efficient movement with 4.5% less energy cost.

Limitations and Future Work

  • Stiffness Constraints: The current version uses "explicit" time integration. This means that if you try to simulate very stiff materials (like steel), the simulation becomes unstable unless you use a tiny, computationally expensive time step.
  • Material Scope: While MPM can simulate sand and water, ChainQueen is currently optimized for elastic "soft" materials.
  • Rigid-Soft Coupling: The authors suggest that future versions should better integrate rigid body dynamics (like a soft hand on a metal arm) to handle more complex robotic systems.

Summary updated

Abstract

Physical simulators have been widely used in robot planning and control. Among them, differentiable simulators are particularly favored, as they can be incorporated into gradient-based optimization algorithms that are efficient in solving inverse problems such as optimal control and motion planning. Therefore, rigid body simulators and recently their differentiable variants are studied extensively. Simulating deformable objects is, however, more challenging compared to rigid body dynamics. The underlying physical laws of deformable objects are more complex, and the resulting systems have orders of magnitude more degrees of freedom and there-fore they are significantly more computationally expensive to simulate. Computing gradients with respect to physical design or controller parameters is typically even more computationally challenging. In this paper, we propose a real-time, differentiable hybrid Lagrangian-Eulerian physical simulator for deformable objects, ChainQueen, based on the Moving Least Squares Material Point Method (MLS-MPM). MLS-MPM can simulate deformable objects with collisions and can be seamlessly incorporated into soft robotic systems. We demonstrate that our simulator achieves high precision in both forward simulation and backward gradient computation. We have successfully employed it in a diverse set of inference, control and co-design tasks for soft robotics.
BibTeX
@inproceedings{hu2019chainqueen,
  author = {Yuanming Hu and Jiancheng Liu and Andrew Spielberg and Joshua B. Tenenbaum and William T. Freeman and Jiajun Wu and Daniela Rus and Wojciech Matusik},
  title = {{ChainQueen: A Real-Time Differentiable Physical Simulator for Soft Robotics}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2019},
  doi = {10.1109/icra.2019.8794333},
}

Loading related content...

Figure