MH-FLOCKE v0.5.0: Replaced mathematical CPG with Izhikevich half-center oscillators

Update on MH-FLOCKE. This version brought two things: a 60% SNN speedup and a neural CPG to replace the sine waves. Long nights.

The speedup came from wrapping the SNN step in torch.no_grad(), switching to dense matmul for small networks, and caching time constants. The 232-neuron Freenove SNN now runs at 1.2ms/step in simulation. Along the way I found that setting output neurons to Fast Spiking (Izhikevich a=0.1) destabilized the Go2 — motoneurons are biologically Regular Spiking, not FS. Took me a while to figure that one out.

The bigger change: I replaced the sinusoidal CPG with 24 Izhikevich neurons arranged as half-center oscillators (Brown 1911). Each leg has its own flexor/extensor pair coupled through mutual inhibition. I’m calling it the Mogli Oscillator, named after my dog who provided the biological inspiration by being a dog.

Walk gait emerges from the coupling topology: FL↔FR correlation -0.78 (alternation), FL↔RR +0.73 (diagonal sync). The coupling weights are stored in a learnable matrix for future R-STDP adaptation.

50k step results in MuJoCo simulation (Freenove MJCF model, 232 neurons):

  • 0 falls, 50k upright streak
  • Actor competence 0.649 (was 0.108 with sin/cos CPG)
  • CPG weight dropped to 58%
  • Distance 1.21m (significantly lower than 8.2m with mathematical CPG)

No hardware test yet — this is all in simulation so far. The sim-to-real transfer with the mathematical CPG worked previously, so I’m cautiously optimistic, but the Mogli Oscillator on real servos is untested.

Some things that went wrong:

  • The robot walked backward for five iterations. Turns out knee phase must lag hip by -0.25, not lead. Obvious once you think about it.
  • The behavior planner killed locomotion when switching to “alert.” Fix: a CPG autonomy floor at 70%. Decerebrate cats still walk.
  • The Go2 shows regressions. I’ve tagged paper-compatible versions in the repo for reproducibility.
  • Distance is 6x lower than with the mathematical CPG. The SNN learns conservative dampening.

The gain is adaptive (3.0 to 8.0 over 2000 steps) rather than hardcoded, because biologically motor neuron excitability develops through serotonergic innervation, not through a constant.

Next: R-STDP on coupling weights, then limb-loss simulation, then hardware.

Video (simulation): https://www.youtube.com/watch?v=WBNBsaBs1Ng

Blog: https://mhflocke.com/the-mogli-oscillator-when-your-robot-dog-gets-a-real-spine/

Code: https://github.com/MarcHesse/mhflocke (–neural-cpg flag)

submitted by /u/mhflocke
[link] [comments]

Liked Liked