MH-FLOCKE MH-FLOCKE
HomeDocsGitHubBlogPapersYouTubeReddit𝕏

Hardware

Sim-to-Real Transfer

MH-FLOCKE runs on real hardware using the Freenove Robot Dog Kit (FNK0050, ~100€). The Raspberry Pi 4 executes the same SNN and cerebellum code as the MuJoCo simulator — one codebase, two platforms. A brain trained in simulation transfers directly to the real robot.

Hardware Setup

  • Kit: Freenove FNK0050 (~100€)
  • Compute: Raspberry Pi 4 (2GB+ RAM)
  • Servos: 12× SG90 via PCA9685 (I2C 0x40)
  • IMU: MPU6050 (I2C 0x68) — pitch, roll, yaw
  • Camera: Pi Camera v2 (320×240 @ 15fps for phototaxis)
  • SNN: 560 neurons (48 MF + 269 GrC + 47 GoC + 24 PkC + 24 DCN + 136 MH + 12 OUT)
  • Performance: 38 steps/sec, ~5 watts total

Bridge v4.4

The hardware bridge (freenove_bridge.py) is a standalone script that runs on the Pi. It imports src/brain/ directly — the same PyTorch SNN, the same cerebellar learning, the same topology computation. No simplified model, no NumPy port.

# Walk with SNN + Cerebellum
python3 freenove_bridge.py --gait walk --snn --verbose --duration 120

# Phototaxis: navigate toward a light source
python3 freenove_bridge.py --gait walk --snn --phototaxis --speed 1.5 --verbose --duration 60

# Transfer sim-trained brain
scp creatures/freenove/brain/brain.pt user@pi:~/brain.pt
python3 freenove_bridge.py --gait walk --snn --verbose --duration 120

PID Steering (v0.5.1)

The robot compensates mechanical drift automatically using a PID controller with IMU feedback. The camera provides target heading (light source position), the IMU provides actual heading, and the PID drives asymmetric stride — left legs longer stride makes the dog curve right, like tank steering.

Hardware PID gains: Kp=0.05, Ki=0.01, Kd=0.015. The I-term eliminates steady-state drift offset caused by servo tolerances and weight asymmetry.

Every Freenove unit has different drift characteristics. MH-FLOCKE handles this automatically — no manual calibration needed.

Hardware Drift Simulation

Measured drift from the real robot is injected into the MuJoCo simulator so training faces realistic challenges. Drift profiles in creatures/freenove/drift_profiles/ describe per-robot mechanical characteristics (yaw rate, roll bias, servo asymmetry).

# Train with measured hardware drift
python scripts/train_baby.py --creature-name freenove --phototaxis \
    --drift-profile creatures/freenove/drift_profiles/measured_marc_01.json \
    --hardware-sensors --no-vision --steps 50000 --no-llm --fresh

Hardware Test Results (v0.5.1)

  • Dog approaches light source: obstacle distance drops from 0.52m to 0.17m in 60 seconds
  • PID actively compensates ~2°/s mechanical drift
  • No tip-overs with asymmetric stride steering (previous Z-offset approach caused falls)
  • SpatialMap persists between sessions on the Pi

Live Dashboard

The Bridge includes a web dashboard on port 8080 showing all 6 cerebellar populations with live spike data, servo angles, competence gate, and neuromodulation levels.

python3 freenove_bridge.py --gait walk --snn --dashboard --verbose --duration 300
# Open http://pi-hostname:8080

Full deployment guide: FREENOVE_PI_DEPLOY.md on GitHub