CPG-Actor: Reinforcement Learning for Central Pattern Generators

Luigi Campanaro, Siddhant Gangapurwala, Daniele De Martini, Wolfgang Merkt, Ioannis Havoutis

This paper, presented by researchers from the Oxford Robotics Institute, introduces CPG-ACTOR, a novel framework that marries the rhythmic stability of biological movement with the optimization power of Deep Reinforcement Learning (RL).

TL;DR

CPG-ACTOR integrates biologically inspired Central Pattern Generators (CPGs) directly as the "Actor" in an Actor-Critic RL framework. By making CPGs fully differentiable and jointly training them with a feedback-processing neural network, the authors achieve smoother locomotion and a 6x increase in reward compared to previous hybrid approaches.

What Problem Does This Paper Address?

Legged locomotion is a classic "hard" problem in robotics. Engineers usually choose between two paths:

  1. Model-based control: Precise but relies on "hand-crafted" heuristics that struggle with unexpected terrain.
  2. Deep Reinforcement Learning (RL): Robust and flexible, but standard Multi-Layer Perceptrons (MLPs) don't "naturally" oscillate. They often require long training times to learn basic rhythmic gaits and frequently produce jerky, "bang-bang" control signals that can damage real hardware.

Central Pattern Generators (CPGs)—neural circuits found in vertebrate spines that produce rhythmic patterns without sensory input—offer a middle ground. However, CPGs are notoriously difficult to tune, especially when trying to incorporate complex, non-linear sensory feedback (like foot contact or tilt). Previous attempts to combine RL and CPGs often treated the CPG as a "black box" inside the robot's environment, preventing the RL algorithm from efficiently optimizing the CPG's internal parameters via gradients.

Methods

The core innovation of CPG-ACTOR is moving the CPG from the "environment" into the Actor itself.

  • Differentiable Hopf Oscillators: The authors used Hopf oscillators (a mathematical model for CPGs) and discretized them so that every parameter is differentiable. This allows the system to use standard gradient-based optimization (specifically Proximal Policy Optimization or PPO).
  • CPG as a Stateless Network: CPGs are inherently recurrent (their next state depends on their current state). To avoid the complexity and "vanishing gradient" issues of Backpropagation Through Time (BPTT), the authors passed the CPG’s previous state back in as an observation. This effectively makes the CPG "stateless" from the perspective of the RL optimizer while preserving its recurrent dynamics.
  • Hybrid MLP-CPG Architecture: The "Actor" consists of two parts: an MLP that processes raw sensory observations to produce feedback signals, and the CPG which uses those signals to reshape its oscillations in real-time. Both are trained simultaneously.

Datasets

The researchers evaluated their method using a custom simulation environment built in PyBullet.

  • Robot Model: A single-leg hopper based on the ANYmal quadruped robot.
  • Task: Vertical hopping. The reward function prioritized jump height ($v_h$), tracking accuracy ($p_d - p_m$), and energy efficiency, while penalizing foot slippage.
  • Baselines: They compared CPG-ACTOR against a standard MLP-only Actor-Critic and a "warm-started" CPG-RL approach based on prior literature.

Key Insights and Ideas

  • The "Where" Matters: The biggest "aha" moment is that embedding the CPG in the Actor—where the RL agent can "see" and change its internal weights—is vastly more effective than treating it as part of the robot's external dynamics.
  • Encoding Priors: By using CPGs, the researchers are essentially giving the robot "muscle memory" for oscillation. The robot doesn't have to learn how to oscillate; it only has to learn how to tune those oscillations to the environment.
  • Natural Smoothness: Unlike pure MLPs that produce jagged control signals, the CPG-ACTOR naturally respects motor limits and produces smooth, sinusoidal-like trajectories. This makes the transition from simulation to real-world hardware much safer.

Key Results

  • 6x Performance Boost: CPG-ACTOR achieved roughly six times the reward of previous state-of-the-art methods that kept the CPG in the environment.
  • Superior Trajectories: Compared to a standard RL agent (MLP), CPG-ACTOR produced significantly smoother joint positions and velocities that stayed within the physical limits of the ANYmal's actuators.
  • Progressive Learning: The system demonstrated a clear evolution of behavior; over 60 million training steps, the hopper progressively learned to double its jump height by refining the interplay between the MLP feedback and the CPG oscillators.

Limitations and Future Work

While successful, the paper focuses on a single-leg hopper, which is a simplified 1D/2D locomotion task. The authors acknowledge that the next major challenge is scaling this to a full four-legged (quadrupedal) or two-legged (bipedal) robot.

Future work will involve:

  1. Full Locomotion: Applying CPG-ACTOR to coordinate multiple legs for walking, trotting, and running.
  2. Hardware Deployment: Testing the "sim-to-real" transfer to see if the smooth CPG trajectories indeed translate to better performance on physical robots.
  3. Complex Terrain: Evaluating how the non-linear feedback handles highly irregular surfaces.

Summary updated

Abstract

Central Pattern Generators (CPGs) have several properties desirable for locomotion: they generate smooth trajectories, are robust to perturbations and are simple to implement. However, they are notoriously difficult to tune and commonly operate in an open-loop manner. This paper proposes a new methodology that allows tuning CPG controllers through gradient-based optimisation in a Reinforcement Learning (RL) setting. In particular, we show how CPGs can directly be integrated as the Actor in an Actor-Critic formulation. Additionally, we demonstrate how this change permits us to integrate highly non-linear feedback directly from sensory perception to reshape the oscillators’ dynamics. Our results on a locomotion task using a single-leg hopper demonstrate that explicitly using the CPG as the Actor rather than as part of the environment results in a significant increase in the reward gained over time (20 $$\times $$ more) compared with previous approaches. Finally, we demonstrate how our closed-loop CPG progressively improves the hopping behaviour for longer training epochs relying only on basic reward functions.
BibTeX
@inproceedings{campanaro2021cpg,
  author = {Luigi Campanaro and Siddhant Gangapurwala and Daniele De Martini and Wolfgang Merkt and Ioannis Havoutis},
  title = {{CPG-Actor: Reinforcement Learning for Central Pattern Generators}},
  booktitle = {TAROS},
  year = {2021},
  url = {https://openreview.net/forum?id=rtYhS662zOI},
}

Loading related content...

Figure