Complex Locomotion Skill Learning via Differentiable Physics

Jiancheng Liu, Yu Fang, Mingrui Zhang, Jiasheng Zhang, Yidong Ma, Minchen Li, Yuanming Hu, Chenfanfu Jiang, Tiantian Liu

TL;DR

While differentiable physical simulators offer exact analytical gradients to train neural network controllers quickly, existing methods struggle to learn beyond simple, single-goal tasks. This paper introduces an end-to-end framework combining periodic sine activations (SIREN), a modified Adam optimizer, and tailored sliding-window losses to train unified controllers for multi-skill soft robot locomotion. The resulting policy enables real-time interactive control (e.g., dynamically adjusting speed, jump height, and steering) and outperforms state-of-the-art reinforcement learning (PPO) in both convergence speed and policy quality.

What Problem Does This Paper Address?

Soft-body robots possess near-infinite degrees of freedom, making control optimization notoriously difficult. While model-free reinforcement learning (RL) algorithms like PPO can learn complex behaviors, they require massive sample counts and frequently get stuck in local minima when tasked with balancing multiple simultaneous goals.

Differentiable physics engines address this sample inefficiency by computing analytical gradients via reverse-mode automatic differentiation. However, prior differentiable physics setups were fragile: they typically optimized controllers for narrow, single-objective tasks (such as crawling in a single direction) and failed to generalize or handle multi-skill conditioning without exploding or vanishing gradients over extended rollouts.

Methods

The authors build an end-to-end differentiable pipeline in DiffTaichi supporting both mass-spring systems and the Material Point Method (MLS-MPM). Key elements include:

  • SIREN-Enhanced Controller: A lightweight, two-layer fully connected network (64 hidden channels) using periodic sine activation functions ($\sin$) across hidden and output layers, naturally aligning with cyclic locomotion dynamics.
  • Invariant Feature Representation: Network inputs combine phase-shifted sinusoidal signals, normalized target parameters (duplicated to boost gradient sensitivity), and a centralized pose that strips out global translation and vertical-axis rotation.
  • Modified Optimization & Batching: Rather than vanilla SGD (which stalls on multi-goal tasks), the authors use GPU-batched parallel rollouts and Adam with reduced second-moment momentum ($\beta_2 = 0.9$ instead of $0.999$), preventing unstable momentum build-up across physical simulation steps.
  • Tailored Physics Losses:
  • Fluctuation-tolerant velocity loss: Computes running velocity over a sliding window ($P_r$) rather than instantaneous step-by-step velocities, preserving natural gait acceleration cycles.
  • Sparse jumping and crawling terms: Evaluated over gait periods ($P$) rather than every time step.
  • Actuation regularization: Penalizes large muscle actuations when commanded velocities are near zero to prevent high-frequency shaking.
  • Simulation Nuances: Replaced artificial drag damping with dashpot damping to prevent controller gradients from damping out, and added dynamic background grids for MLS-MPM to support boundless locomotion.

Datasets

  • Locomotion Environments (Simulated): Multiple 2D soft robots (Alpaca, Monster, HugeStool, Stool) and 3D irregular/cubic meshes built within mass-spring and MLS-MPM backends.
  • Manipulation Tasks: Evaluated generalization on two dynamic object-interaction tasks: Juggle (launching an object to a target height) and Dribble and Shot (pushing and shooting an object toward a translating goal).
  • No external real-world datasets were used.

Key Insights and Ideas

  • Momentum Tuning in Differentiable Physics: Vanilla SGD works for trivial single-goal trajectories but fails completely on multi-goal tasks. However, default Adam hyperparameters ($\beta_2 = 0.999$) aggregate long-term gradient noise across deep physical time horizons. Lowering $\beta_2$ to $0.9$ stabilized trajectory optimization across diverse goals.
  • Periodic Activations Beat Classical Nonlinearities: Replacing $\sin$ activations with standard activations ($\text{ReLU}$, $\text{GELU}$, $\text{tanh}$, $\text{sigmoid}$) severely crippled the agent's ability to coordinate periodic muscle contraction.
  • Physics Contact Gradients Must Match Mechanics: In 3D tasks, a naive sticky contact model caused soft robots to freeze. Implementing a differentiable slip-friction model (switching between kinetic and static friction) proved critical for learning terrestrial locomotion.
  • Sliding Window vs. Instantaneous Loss: Enforcing constant velocity per simulation step creates steep, conflicting gradients during natural impact and push-off phases. Averaging over a temporal window allows the optimizer to focus on overall progress rather than micro-fluctuations.

Key Results

  • Ablations on Alpaca (Normalized Task Loss):
  • Full method: $0.74 \pm 0.01$
  • DiffTaichi baseline (SGD + tanh): $0.96 \pm 0.01$
  • Without periodic signal: $0.99 \pm 0.00$ (agent completely fails to move)
  • Without modified Adam (Full-OP with SGD): $0.98 \pm 0.01$
  • Comparison with RL (PPO): PPO agents frequently collapsed into single behaviors (e.g., learning to jump in place while failing to track horizontal velocity). In contrast, the proposed differentiable framework converged dramatically faster and smoothly balanced multi-goal objectives.
  • Interactive Control: A single trained neural network interactively steered 3D quadruped agents across continuous velocity $[-0.08, 0.08]$ and height ranges $[0.1, 0.2]$ via real-time user inputs.
  • Gradient Stability: Gradient norm histograms over 10,000 iterations remained stable within $[-10, 10]$ on a log scale, avoiding gradient explosion across hundreds of consecutive simulation steps.

Limitations and Future Work

  • Manual Robot Morphology: The system's learning capability still depends heavily on manual actuator placement and material parameter tuning. Unnecessary actuators (as seen in the Stool agent) degrade convergence.
  • Sim-to-Real Transfer: All experiments were conducted purely in simulation; real-world robotic validation remains to be demonstrated.
  • Future Work: Integrating co-design algorithms that jointly optimize soft-body geometry, material parameters, and neural controllers automatically.

Summary updated

BibTeX
@inproceedings{liu2022complex,
  author = {Jiancheng Liu and Yu Fang and Mingrui Zhang and Jiasheng Zhang and Yidong Ma and Minchen Li and Yuanming Hu and Chenfanfu Jiang and Tiantian Liu},
  title = {{Complex Locomotion Skill Learning via Differentiable Physics}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=YpBHDlalKDG},
}
Figure