The project is focused on development of a specialized solver for a quadratic model predictive control problem, and a software module, which uses this solver to control walking behavior of a Nao humanoid robot.

The development has been performed within the Mobile Robotics and Olfaction Lab at Örebro University under the supervision of Dimitar Dimitrov.

All related derivations, a more detailed description of results and implementation can be found in my Master's thesis.

Source code and documentation

Key differences from the built-in module

  • We do not eliminate the equality constraints (due to the system dynamics) when forming the QP problem for MPC. This allows us to have variations of time discretization and height of the center of mass from one preview window to the next without pre-computations. The resulting QP is larger but more structured, an exploitation of this structure leads to faster computation.

  • The inverse kinematics module works with position of the center of mass instead of position of the trunk.

Video demonstration

There are several videos recorded from different viewpoints, they can be chosen from a playlist.

Alternatively, you can watch the videos on YouTube:

A simulation of the walk is demonstrated in the following set of videos. The robot is represented by a skeletal model. The red box indicates a position of the center of mass. Also, you can see the reference frame switching from one foot to another during the walk. We use one of two inverse kinematics functions depending on the current reference foot.


The parameters, that we used during the recording, are described below.

  • Error feedback for CoM position

    • gain = 0.3;
    • threshold = 0.004 meter (smaller errors were ignored);
  • MPC solver:

    • gain for reference ZMP positions = 8000 (reference ZMP positions are centers of footsteps);
    • penalty for the velocity of CoM = 1;
    • penalty for the acceleration of CoM = 1;
    • penalty for the jerk of CoM = 1 (jerk is the control input);
  • Steps:

    • step height = 0.02 meter;
    • step length = 0.04 meter (this is a relative distance from the position of the other foot, i.e. full step length is 0.08);
    • trajectories of a swing foot were build using Bezier curves;
  • Preview window:

    • number of sampling intervals in a preview window = 40;
    • time in a single support = 400 ms.
    • time in a double support = 120 ms.
    • length of a sampling interval = 40 ms.

Since we solve IK twice (the reason behind this is explained here) we need to get positions of CoM at 20 ms and 40 ms (one and two control loops respectively). Therefore we set the length of the first two sampling intervals in a preview window to 20 ms.


The data was collected during execution on the Nao v3.2, which is equipped with AMD GEODE 500MHz CPU. No external disturbances were applied. Note that we use a real time scheduling policy (SCHED_FIFO).

The execution time of one control loop (in seconds):

Active set method Logarithmic barrier method
min 0.001867 0.004108
mean 0.003071 0.004834
max 0.004650 0.006012

This time includes:

  • Logging (takes about 0.0005 sec.).
  • Solution of the QP problem
Active set method Logarithmic barrier method
min 0.000490 0.002569
mean 0.001259 0.003016
max 0.002782 0.004126
  • Two solutions of inverse kinematics.

Active set method activates from 0 to 7 constraints. In the initial and final double supports constraints are not added, during the walk the number of constraints is usually 6 or 7.

The solver is not hot-started.

Solution of inverse kinematics takes from 1 to 3 iterations.


  • Dimitrov, Sherikov, Wieber. A sparse model predictive control formulation for walking motion generation. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). (preprint) (bibtex)
  author = {Dimitrov, D. and Sherikov, A. and Wieber, P.-B.},
  title = {{A sparse model predictive control formulation for walking motion generation}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  pages = {2292-2299},
  year = {2011},