Time-Varying Model Predictive Control For Highly Dynamic Motions of Quadrupedal Robots
Time-Varying Model Predictive Control For Highly Dynamic Motions of Quadrupedal Robots
net/publication/355436026
CITATIONS READS
4 257
3 authors:
SEE PROFILE
All content following this page was uploaded by Robert Griffin on 09 October 2022.
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
are the states of the system, and x∗ (t) are the predicted states. Here, the inertia I is a function of the orientation of the
Compared to previous approaches like [17], [13], [16] we use robot, specifically I = RIB RT . As the rotation matrix R is a
angular momentum around a fixed point instead of lineariz- function of the quaternion qr and the body inertia matrix IB
ing/simplifying the angular velocity. We include experiments is constant, the inertia I is determined as follows:
and simulations of this momentum-based control approach
containing a partial linearization of the dynamics. We also I(qr ) = R(qr )IB R(qr )T (7)
provide heuristics to track dynamic motions like jumps with
Using (6), (5), and (7), we obtain our quaternion dynamics
rotations.
II. BACKGROUND q̇r = Q(qr )I−1 (qr )L (8)
7345
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
A. Contact Scheduling where W(t), R pla (t) and b(t) encodes the friction restrictions
If we fix the footsteps timings, then the MPC for (13) is defined (14), u contains the stacked reaction forces fi (con-
linear [2], [5], [12]. The contact schedule uses time-based trol input/decision variables) and kxkP = xT Px. We define
phases and it is taken from [12], [14]. The gaits are periodic x∗k,pre (t) as the resulting trajectory of the optimization Pk :
and the legs of the robot are enforced to touch the ground x∗k,pre (t) = argmin Pk (16)
based on the gait scheduled clock. x
We concatenate the footsteps between different gaits for The update rule in xk (t), defined in [0,t f ] is given by:
feasibility and consistency purposes. Jumps are defined as (
aperiodic “gaits”: they are played only once, and after that ∗ x∗k,pre (t + ∆tMPC ) ∀t ∈ [0,t f − ∆tMPC ]
xk (t) = (17)
the contact placements of the next gait are used. Flight phases x∗d,H (t) ∀t ∈ [t f − ∆tMPC ,t f ]
are the only phase that are state-based. We define them as
a function of the time that it takes the robot to land using We are shifting the new trajectory by a time of ∆tMPC ,
IMU measurements. The flight phase is ended if we detect which corresponds approximately to the time when each
contact in any leg. The contact detector uses a generalized- optimization is solved. Adding a term εkx∗k−1 (t) − xkL2 to
momentum-based disturbance observer in discrete form (10) (15) helps to provide stability to the next solutions in the
from [18], and the forces are found using an unconstrained optimization, because the MPC will also track a previous
version of (9) from [19]. A Coriolis Matrix is necessary for solution. The last section of the trajectory given by x∗d,H (t)
that, so we implement it from [20]. corresponds to a heuristic for the new desired states provided
by a higher level input (detailed in Section IV). Ak−1 (t),
B. Rotated Friction Cones Bk−1 (t) and Ck−1 (t) come from (13):
To better address uneven ground and contact surfaces, we
03×3 I3×3 03×3 03×4
base the friction restrictions according to the orientation of 03×3 03×3 03×3 03×4
the terrain. For flat ground and per each ith contact, the Ak−1 (t) =
−m[g]× 03×3 03×3 03×4
inequalities can be expressed in matrix form as Wi fi ≤ bi , ∂F ∂F ∂F ∂F
∂ r x∗k−1 ∂ ṙ x∗k−1 ∂ L2 x∗k−1 ∂ qr x∗k−1
where Wi ∈ R6×3 , bi ∈ R6×1 and fi contains the stacked (18)
forces in x, y, and z. For a non-horizontal plane, the linearized
03×3 03×3 03×3 03×3
friction cone is Wi rotated with the transpose of the matrix 1 I3×3 1 I3×3 1 1
m I3×3 m I3×3
Bk−1 (t) = m m (19)
R plai mapping from the world to the contact plane: [r p1 ]× [r p2 ]× [r p3 ]× [r p4 ]×
Wi RTplai fi ≤ bi (14) 04×3 04×3 04×3 04×3
03×1
We also constrain the maximum value of the normal force.
The maximum force the robot can produce depends on the g
Ck−1 (t) = 03×1
(20)
configuration of the robot, but study is outside of the scope
of the paper. F(x∗k−1 ) − ∂∂ Fx x∗
x∗k−1 k−1
We perform a QP optimization using a heuristic x∗H (t) The MPC setup defined in (15) is now written in discrete
as an initial guess, and then perform successive QP opti- time as a QP optimization using the direct transcription
mizations on the linearized system (13) around the resulting method with a condensed approach written as in [13], with
trajectories. minor modifications to include the term Ck−1 .
The initial heuristic x∗H models the behavior of the robot The dynamics in (15) are discretized as:
in the future and provides a high level description of the x[n + 1] = Ak−1 [n]x[n] + Bk−1 [n]u[n] + Ck−1 [n] (21)
desired position and orientation of the robot, without needing
to be perfectly dynamically feasible. The results of predictive Solving for each x[n], we can condense the equations to:
controllers based on heuristics for quadrupeds [14], [15], [16]
are highly reliant on these predefined heuristics, being the
general tracking objective for the robot. The more dynam-
ically feasible the trajectory, the better the tracking. Here,
we also track the heuristic but we linearize the dynamics
(13) around previous trajectory solutions. The iterative MPC
setup is defined as Pk :
Rt
Pk : p∗k = minx,u 0 f kx∗H (t) − xkL + kukK dt, s.t.
ẋ = Ak−1 (t)x + Bk−1 (t)u +Ck−1 (t),
(15) Fig. 2. Mini-Cheetah Sim jumping over sloped terrain (real robot in blue;
x(0) = x0 , white robot is the state estimation) Left: aerial phase; Right: forces applied
b(t) ≥ W(t)RTpla (t)u, in the orientation of the terrain.
7346
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
X = Aqp x0 + Bqp U + Cqp (22)
Note that we are omitting the subindex k − 1 in Aqp , Bqp ,
and Cqp , which are built using Ak−1 , Bk−1 and Ck−1 . The
resulting cost function in (15) corresponds to:
J(U) = kAqp x0 + Bqp U + Cqp − x∗Hv kK1 + kUkK2 (23) Fig. 4. Mini-Cheetah robot jumping and spinning 90◦ .
where x∗Hv is the heuristic x∗H vertically stacked, and K1
and K2 are weights defined from (15). We have the QP A. Sloped terrain
optimization written as: For normal walking, a higher level input provides a
commanded velocity and rotation to the robot. Those values
PDk : p∗k = minU 12 UT Hk−1 U + UT gk−1 , s.t. are inserted in the QP as the heuristic x∗d,H (t) in (17),
(24)
Wqp U ≤ bqp
r0 + tvcmd
where Wqp and bqp (also dependent on k) contains the
vcmd
x∗d,H (t) =
restrictions of (15) related with the friction constraints and: (28)
mr0 × vcmd
Hk−1 = 2(BTqp K1 Bqp + K2 ) (25) R2qr (E2R(Θd + t Θ̇cmd )RTp )
gk−1 = 2BTqp K1 (Aqp x0 + Cqp − x∗Hv ) (26) where r0 is the current position, vcmd is the commanded
velocity, Θd is the desired orientation of the robot in Euler
E. Whole-Body Controller angles, Θ̇cmd is the commanded RPY derivative for the robot,
The iterative QP formulation PDk given in (24) finds E2R(•) maps an Euler angles to its rotation matrix, and
desired forces to apply to the the world and trajectories for R2qr (•) maps a rotation matrix to its quaternion form. In
the CoM position and orientation. The WBC given in [11] sloped terrain, we desired to orient the robot according to the
is then used to track the desired force, and desired tasks for terrain (posture orientation), so we rotate Θd with the rotation
the CoM position and orientation. We use the same approach matrix of the plane R p . The current heuristic enforces zero
with a minor change in the force constraints to allow the angular momentum around the CoM, because this is only for
robot to use any orientation in the foot, similar to the force common locomotion over sloped terrain.
constraint in (15) and (14) as follows: The matrix R p can be obtained by prior knowledge of the
terrain, or detected by the robot using a least-squares regres-
WRTpla fr ≤ b (27) sion from the estimated contact placements as is described
in [21]. The matrix R plai from (27) can be used as the matrix
where W and b contains the friction constraints for horizontal
R p stacked diagonally.
terrain, R pla is the rotation from the world to the plane
In [22], authors presented the robot HyQ performing
orientation and fr contains the vertically stacked forces. In
a quasi-static walk in a V-shaped terrain where there is
this paper, we sent the cartesian position of the feet as local
not enough friction to apply a vertical force. We obtain
tasks with respect to the body instead of the original tasks
a simulated dynamic walk over a V-shaped terrain. We
with respect to the world.
use the heuristic defined in (28) and assume knowledge
IV. DYNAMIC MOTIONS of the orientation of each side of the terrain. We define
R pla = diag([RV 1 , RV 2 , RV 2 , RV 1 ]) for its use on (27) and
This subsection provide an approach for solving the (15), where RV 1 and RV 2 are the rotation matrices of each
problem of dynamic motions, specifically walks and jumps side of the V-shaped terrain (where the feet are).
over sloped (hardware Fig. 3) and V-shaped (simulation)
terrain, leaps over sloped terrain (hardware), jumps with B. Leap and rotations
yaw rotations (hardware) and frontflips while bounding (sim- In order to obtain a leap over a sloped terrain, we assume
ulation). The MIT Biomimetics physical simulator shows again that the terrain is already known. In this case, when
two robots as in Fig. 2. The “real” robot is shown in the leap event is triggered, the optimization Pk is restarted,
blue, meanwhile the white robot comes from the state i.e., run from k = 1. Here, the initial trajectory to track x∗0 is
estimator. A compilation of the motions can be found at defined as:
www.youtube.com/watch?v=MDEv9g6LHAQ. T
x∗0 (t) = rT0 , 01×3 , 01×3 , qTr0 ∀t ∈ [0,tLO ],
(29)
7347
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Mini-Cheetah Hardware performing a leap between two planes
where tLO is the lift-off time, tla the landing time, r0 the
initial position, qr0 the initial orientation (quaternion), r f the
final desired position, qr f the final desired orientation, and:
r f − r0 − 12 g(tla − tLO )2
vH = , (32)
tla − tLO
1
L2H (t + tLO ) = LH + m(r0 − gt 2 ) × (vH + gt), (33)
2
qr0 + qr f qr f − qr0
LH = M† , (34)
kqr0 + qr f k tla − tLO
7348
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
The condensed approach for the QP formulation is faster [4] A. Herzog, S. Schaal, and L. Righetti, “Structured contact force op-
at least than sparse direct transcription (for horizons between timization for kino-dynamic motion generation,” in Intelligent Robots
and Systems (IROS), 2016 IEEE/RSJ Int. Conference on, 2016, pp.
10-20 with 120-240 variables), mainly because we avoid the 2703–2710.
equality constraints, but other algorithms (such as splines, [5] P. Fernbach, S. Tonneau, and M. Tax, “CROC: Convex resolution of
direct collocation, or other solvers) may perform better Centroidal Dynamics trajectories to provide a feasibility criterion for
the multi contact planning problem,” in Intelligent Robots and Systems
computationally. The hardware implementation was built (IROS), 2018 IEEE/RSJ International Conference on, Oct 2018.
over the base MIT MiniCheetah code. The MPC algorithm [6] H. Dai and R. Tedrake. “Planning robust walking motion on uneven
is run on a quad-core Intel Atom CPU with 4 GB RAM, terrain via convex optimization,” in Humanoid Robots (Humanoids),
2016 IEEE-RAS 16th International Conference on, 2016.
at a fixed update frequency of approximately 38.5Hz. The [7] S. Kajita, F. Kanehiro, K. Kaneko, K. Fujiwara, K. Harada, K.
QP is reliably solved on-board within this allotted time. The Yokoi, H. Hirukawa. “Resolved momentum control: humanoid motion
solving time is ≈ 3ms for common locomotion (horizon: 10) planning based on the linear and angular momentum,” in Intelligent
Robots and Systems (IROS) 2003, IEEE/RSJ International Conference
and ≈ 7ms for jumps (horizon: 16). on, 2003.
Another limitation is the assumed fixed timing and the step [8] S. Kuindersma, R. Deits, M. Fallon, A. Valenzuela, H. Dai, F.
adjustment problem. This is well addressed for flat terrain Permenter, T. Koolen, P. Marion, and R. Tedrake, “Optimization-
based locomotion planning, estimation, and control design for the
(or even for small slopes in the terrain when the steps are atlas humanoid robot,” Autonomous Robots, vol. 40, pp. 429–455, Mar
projected) by the heuristics described in [12], [21], [15], but 2016.
these heuristics do not work well in terrain with steep inclines [9] T. Koolen, T. De Boer, J. Rebula, A. Goswami, and J. Pratt,
“Capturability-based analysis and control of legged locomotion, part 1:
or in vertical walls. Another interesting topic of study is Theory and application to three simple gait models,” The International
the inclusion of the stepping places in the optimization, Journal of Robotics Research, vol. 31, no. 9, pp. 1094–1113, 2012.
which introduces significant non-linearities in the dynamics, [10] S. Fahmi, C. Mastalli, M. Focchi and C. Semini, “Passive Whole-
Body Control for Quadruped Robots: Experimental Validation Over
specifically in the Bk−1 (t) matrix from the (15). Challenging Terrain,” in IEEE Robotics and Automation Letters, vol.
While the heuristic vH (32) partially mitigates the fixed 4, no. 3, pp. 2553-2560, July 2019.
time step problem, we still need to provide good values [11] D. Kim, J. Di Carlo, B. Katz, G. Bledt, and S. Kim “Highly Dynamic
Quadruped Locomotion via Whole-Body Impulse Control and Model
for the lifting-off and the landing time. The optimization Predictive Control,” in arXiv preprint arXiv:1909.0658, Sep 2019.
in (15) finds good corrections for dynamic tracking errors, [12] B. Katz, J. Di Carlo, and S. Kim. “Mini Cheetah: A Platform for
but it is still subject to the pre-calculated contact phases, Pushing the Limits of Dynamic Quadruped Control,” in Robotics and
Automation (ICRA), 2019 IEEE-RAS International Conference on,
as times are fixed in the optimization. We wish to obtain 2019.
online optimization which also modifies the timing between [13] J. Di Carlo, P. Wensing, B. Katz, G. Bledt, and S. Kim. “Dynamic
steps. Using variable times though changes the problem to Locomotion in the MIT Cheetah 3 Through Convex Model-Predictive
Control,” in Intelligent Robots and Systems (IROS), 2018 IEEE/RSJ
a complex state-dependent hybrid system, meanwhile giving International Conference on, 2018.
the program multiple possible times for the solution results [14] G. Bledt, P. Wensing and S. Kim. “Policy-regularized model predictive
using Mixed-Integer Programming, which is usually slower. control to stabilize diverse quadrupedal gaits for the MIT cheetah,” in
Intelligent Robots and Systems (IROS), 2017 IEEE/RSJ International
VI. CONCLUSIONS Conference on, 2017.
[15] G. Bledt, and S. Kim. “Implementing Regularized Predictive Control
In the presented work, we obtained highly dynamic fea- for Simultaneous Real-Time Footstep and Ground Reaction Force Op-
sible trajectories for the centroidal dynamics, and quasi- timization,” in Intelligent Robots and Systems (IROS), 2019 IEEE/RSJ
International Conference on, 2019.
feasible orientations of the robot using a MPC formulation [16] G. Bledt, and S. Kim. “Extracting Legged Locomotion Heuristics with
in a time-varying linearization of the dynamics of the Single Regularized Predictive Control,” to appear in Robotics and Automation
Rigid Body Model. This orientation approximation approach (ICRA), 2020 IEEE-RAS International Conference on, 2020.
[17] Y. Ding, A. Pandala, and Hae-Won Park.“Real-time model predictive
results in a quadratic error, rather than the standard linear control for versatile dynamic motions in quadrupedal robots,” in
error. We have shown the results of the rotation of the friction Robotics and Automation (ICRA), 2019 IEEE International Conference
cone, and jumps of 90◦ in the yaw componnent and jumps on, 2019 pp. 8484-8490.
[18] G. Bledt, P. M. Wensing, S. Ingersoll, and S. Kim, “Contact model fu-
over a 20◦ sloped terrain. The theoretical derivation and sion for event-based locomotion in unstructured terrains,” in Robotics
the results obtained in simulation are a solid base for the and Automation (ICRA), 2018 IEEE-RAS International Conference on,
implementation on real hardware of higher dynamic motions 2018, pp. 1–8.
[19] L. Manuelli and R. Tedrake, “Localizing external contact using pro-
like the frontflips, backflips or sideflips like in Fig. 7, and this prioceptive sensors: The contact particle filter,” in 2016 IEEE/RSJ
depends on improvements of other areas like state estimation International Conference on Intelligent Robots and Systems (IROS),
for the landing controller. pp. 5062–5069, Oct 2016.
[20] S. Echeandia, and P. Wensing “Numerical Methods to Compute the
R EFERENCES Coriolis Matrix and Christoffel Symbols for Rigid-Body Systems,” in
arXiv preprint arXiv:2010.01033, Oct 2020.
[1] D. Orin, A. Goswami, and S. Lee. Centroidal dynamics of a humanoid [21] G. Bledt, P. Wensing and S. Kim. “MIT Cheetah 3: Design and Control
robot. Autonomous Robots, (September 2012):1–16, Jun 2013. of a Robust, Dynamic Quadruped Robot,” in Intelligent Robots and
[2] H. Dai, A. Valenzuela, and R. Tedrake. “Whole-Body Motion Planning Systems (IROS), 2018 IEEE-RAS International Conference on, 2018.
with Centroidal Dynamics and Full Kinematics,” in Humanoid Robots [22] M. Focchi, A. del Prete, I. Havoutis, R. Featherstone, D. G. Caldwell,
(Humanoids), 2014 IEEE-RAS 14th International Conference on, and C. Semini, “High-slope terrain locomotion for torque-controlled
2014. quadruped robots,” Auton. Robots, vol. 41, no. 1, pp. 259–272, 2017.
[3] B. Ponton, A. Herzog, S. Schaal, and L. Righetti, “A convex model of
humanoid momentum dynamics for multi-contact motion generation,”
in Humanoid Robots (Humanoids), 2016 IEEE-RAS 16th International
Conference on, 2016.
7349
Authorized licensed use limited to: University of West Florida. Downloaded on October 09,2022 at 13:08:21 UTC from IEEE Xplore. Restrictions apply.
View publication stats