top of page
cheat_pages1-2-4-1_800dpi.png

MIT Mini Cheetah: MPC With a Learned Dynamics Model

Writer: Maysarah Sukkar
Maysarah Sukkar
Oct 7
2 min read

A controller is only as good as its model of the world. I tested that directly: same planner, same task, two different models of the physics.



The setup. The task was MuJoCo's half-cheetah: run forward for 4 seconds without flipping over. I wrote a sampling-based model predictive controller using the cross-entropy method. Every 0.04 s it samples 200 candidate action sequences over a 20-step horizon, refits its distribution to the best 20, and executes the first few actions before replanning. Plain forward-velocity reward produced fast but unstable gaits, so I shaped the objective with 11 weighted terms covering velocity, torso pitch and pitch rate, height, gait anti-phase, energy and jerk.


Planning with the true simulator. Using MuJoCo itself as the model, the controller earned a reward of 133 in a single 4 s run without falling, comfortably past the course's full-marks bar of 100.


Planning with a model I learned. Then I replaced the simulator with a neural network. I collected 10,000 state-action transitions from 100 MPC rollouts and trained a 3-layer, 256-unit MLP that predicts the change in the 18-dimensional state rather than the next state itself. That residual formulation trained cleanly, reaching a held-out normalized MSE of 0.0015.


Low one-step error was not the same as good control. Planning through the learned model, the cheetah still stayed upright but earned 63, about half the reward. Small prediction errors compound over a 20-step rollout, and the planner happily exploits wherever the model is wrong.


What I took from it. The gap between the simulator and my learned model is the same problem I hit later on my biped, one level down: a policy is only as good as the data and model behind it. More rollouts, better state coverage, and keeping the planner in-distribution matter as much as the architecture.


Tools: MuJoCo (dm_control), PyTorch, NumPy.

Comments


bottom of page