Finite-Horizon MPC and the Condensed QP
The Optimization Problem
At each control update, the controller receives the current state and a velocity command. It then chooses ground-reaction forces for the next prediction steps.
The cost is
The state evolves according to
Here contains the three force components for each of the four feet, so . The horizon uses steps of 25 ms, for a total of 400 ms.
The optimization also enforces three physical requirements:
- A stance foot can only apply a force inside its friction limit.
- A swing foot applies zero ground force.
- The normal force of a stance foot is nonnegative and bounded.
Eliminating the Predicted States
The state sequence does not need to be stored as an independent decision variable. Starting with the first step,
The second step is
Substituting the first equation into the second gives
Repeating this substitution expresses every predicted state as an affine function of the initial state and the force sequence. Stack the forces into one vector:
For , this vector has entries. Substituting the predicted states into the cost produces the quadratic form
The state variables have disappeared, but their dynamics are still represented by and .
Tracking and Effort Weights
The state-tracking term penalizes deviation from the desired body motion:
The matrix gives larger weights to important quantities such as body height and linear velocity. Smaller weights can be used for quantities that may drift temporarily without immediately threatening balance.
The effort term limits unnecessarily large forces:
Increasing generally produces smaller and smoother forces. Increasing makes reference tracking more aggressive.
Friction Constraints
For foot , the Coulomb friction cone is
The implementation replaces this circular cone with four linear inequalities:
This inscribed pyramid is conservative. Forces accepted by the linear approximation are also inside the original friction cone.
Contact Schedule
The gait schedule is known before the QP is assembled. For a swing foot, the controller sets
For a stance foot, the controller applies the friction inequalities, the normal-force lower bound
and the upper bound
Because the contact schedule is fixed, the solver sees a convex quadratic program rather than a mixed-integer contact problem.
QP Form
After condensation, the problem has the standard form
The force constraints can be written as
The controller solves this QP with qpOASES. Warm-starting reuses the previous force sequence, which is effective because consecutive control problems differ only slightly.
Next: Part 4 explains the gait schedule and the separate swing-leg controller.