The Single Rigid Body Model
State Representation
The MPC state is 13-dimensional:
x=[Θ,p,ω,p˙]∈R13
Decomposed:
- Θ=[θz,θy,θx] — ZYX Euler angles (body orientation)
- p=[px,py,pz] — body center-of-mass position (world frame)
- ω=[ωx,ωy,ωz] — angular velocity (body frame)
- p˙=[p˙x,p˙y,p˙z] — linear velocity (world frame)
Writing the rigid-body equations as a nonlinear dynamical system:
x˙=f(x,u)
where the control input is the vector of ground-reaction forces:
u=[f1,f2,f3,f4]⊤∈R12
The continuous dynamics are:
Θ˙=T(Θ)ω
p˙=v
v˙=g+m1∑i=14fi
ω˙=I−1(∑i=14(ri−p)×fi−ω×Iω)
where T(Θ) is the orientation kinematics matrix.
Linearization Around Equilibrium
For MPC, we linearize around a reference trajectory. Near a hovering equilibrium (zero velocity, level orientation):
xk+1=Axk+Buk+c
The Jacobians are:
A=∂x∂fref,B=∂u∂fref
Key insights:
- A captures orientation kinematics, gravity coupling, and gyroscopic terms
- B encodes how each contact force affects body acceleration and rotation
- Linearization is valid for small deviations (trotting speeds), not high-speed flips
Discretization: Zero-Order Hold
The MPC runs at 40 Hz (25 ms timesteps). Assuming forces are held constant over each interval, we integrate:
xk+1=∫tktk+1f(x(t),uk)dt
For linear systems:
xk+1=(I+AΔt+2(AΔt)2+…)xk+(BΔt+AB2(Δt)2+…)uk+c
Matrix exponential form:
Φ(Δt)=eAΔt,Γ(Δt)=∫0ΔteAτdτB
giving:
xk+1=Φxk+Γuk+cΔt
The feet are located at positions in the body frame (from the robot's geometry):
ri,body=[xi,yi,zi]⊤
World-frame position:
ri(Θ,p)=p+R(Θ)ri,body
where R(Θ) is the rotation matrix from Euler angles.
The Jacobian mapping body motion to foot motion:
Ji=[∂Θ∂riI3]
This is needed to:
- Compute foot velocities for swing-leg trajectory tracking
- Map contact forces to body torques (via transpose)
- Implement kinematic constraints
Why Linearize and Discretize?
- Convexity: Linear dynamics + quadratic cost = convex QP
- Stability: Finite-horizon MPC with linear model is provably stable under mild conditions
- Computational speed: Condensed QP with linear constraints solves in under 5 ms
- Validity range: For trotting (±0.5 m/s, ±5° pitch), linearization errors stay under 10%
Without linearization, we'd need nonlinear optimization (much slower and no guaranteed convergence).
Next: Part 3 converts this state-space model into the QP solved at each timestep.