-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathch4-mpc.tex
1922 lines (1760 loc) · 68.2 KB
/
ch4-mpc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%-------------------------------------------------------------------------------
\chapter{Anticipation using approximate models}
\label{ch.mpc}
\acresetall
%-------------------------------------------------------------------------------
We have indicated in \cref{sec.balance_general}, that awareness of the future
is crucial for balance preservation in a general setting. It is, however, often
sufficient to look into the future for a limited time horizon. This can be
achieved with \ac{MPC} \cite{Rawlings2009mpc, Maciejowski2002mpc}, which is the
subject of the present chapter. The discussion begins with a brief overview of
\ac{MPC} in \cref{sec.mpc_overview}, which is followed by
\cref{sec.approx_models_discret,sec.approx_models_capturability}, where we
discretize the continuous-time approximate models constructed in
\cref{sec.linear_approx_models} and derive capturability constraints for them.
In the last two \cref{sec.mmpc,sec.sampling_interval} we introduce \ac{MMPC}
and discuss the choice of duration of sampling intervals.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Overview of Model Predictive Control}\label{sec.mpc_overview}
The name of the \acf{MPC} paradigm stresses two of its important components: a
model of the system, and a prediction of its evolution. In this thesis, we
employ linear discrete-time models of the form
%
\begin{subequations}
\begin{empheq}[left=\empheqlbrace]{align}
&\V{x}_{k+1} = \M{A}_k \V{x}_k + \M{B}_k \V{u}_k, \quad k \in \{0, ..., N-1\}
\label{eq.discrete_linear_system_dynamics}
\\
&\V{x}_{k+1} \in \SET{X}_{k+1},
\\
&\V{u}_k \in \SET{U}_k.
\end{empheq}
\end{subequations}
%
The prediction is used to choose a sequence of $N$ control inputs $(\V{u}_{0},
..., \V{u}_{N-1})$, such that the future states $(\V{x}_{1}, ..., \V{x}_{N})$
comply with the constraints of the model. In some cases, the constraints
uniquely determine the future evolution of the model and controls can be found
analytically. In general, however, a selection criterion for controls is
needed, which is typically expressed as a least-squares objective, for example,
%
\begin{equation}
\begin{aligned}
\MINIMIZE{\V{u}_{0}, ..., \V{u}_{N-1}}
&
\sum_{k=0}^{N-1}
\left(
\NORME{\M{\Gamma}_{\V{u}} \V{u}_{k}}^2
+
\NORME{\M{\Gamma}_{\V{x}} \V{x}_{k+1}}^2
\right)
,
\\
\end{aligned}
\end{equation}
%
where $\M{\Gamma}_u$ and $\M{\Gamma}_x$ are weighting matrices. Given the
constraints of the model and a selection criterion for controls we express an
\ac{MPC} problem as a \ac{QP} \cite{Nocedal2006numopt, Boyd2004conopt}, which
can be solved with off-the-shelf software, for example, \sn{qpOASES}
\cite{Ferreau2014mpc}.
%
\begin{figure}[ht]
\centering{%
\includegraphics{mpc_idea.eps}}
\caption[Shift of the preview horizon in Model Predictive Control.]{
Shift of the preview horizon in \ac{MPC}. Trajectory of state $x$
previewed starting from time $t_0$ is recomputed at time
$t_0^{\prime}$. Length of the preview horizon is $H = t_N - t_0 =
\sum_{k=0}^{N-1} T_k$, where $N$ is the number of sampling intervals
and $T_k$ is the duration of $k$-th interval.
}
\label{fig.mpc_idea}
\end{figure}
%
The key feature of \ac{MPC} is that the control problem is resolved
periodically in order to realize state feedback. Hence, not all $N$ control
inputs are applied, instead, the \ac{MPC} problem is updated and resolved after
a short time, usually one sampling interval, as illustrated in
\cref{fig.mpc_idea}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Discretization of approximate models}\label{sec.approx_models_discret}
Standard approaches to \ac{MPC} rely on discrete-time models. For this reason,
we discretize the linear continuous-time models constructed in
\cref{sec.linear_approx_models} with the help of \sn{Maxima} \ac{CAS}
\cite{MAXIMAsite}. Discretization is performed in the standard way with
\tn{zero-order hold} for controls, \IE, the discrete-time models have constant
controls during a sampling interval \cite[Chapter~1]{BaoCang2010mpc}.
In all considered discrete-time models, $k$ denotes the index of a sampling
interval and $T_k$ is the duration of this interval.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Momenta-based model}\label{sec.momenta_model_discret}
Discretization of \nameref{model.CMB} model yields
%
\begin{model}{MB}{}
\begin{subequations}\label{eq.discrete_momenta_model}
\begin{empheq}[left=\empheqlbrace]{align}
&
\V{x}_{k+1}
=
\underbrace{
\begin{bmatrix}
\V{I} & T_k \V{I} & \V{0}\\
\V{0} & \V{I} & \V{0}\\
T_k \tildeM{A} & \frac{T_k^2}{2} \tildeM{A} & \V{I}
\end{bmatrix}
}_{\M{A}_k}
\V{x}_{k}
+
\sum_{i=1}^{M_k}
\underbrace{
\begin{bmatrix}
\frac{T^2_k}{2} \Ixy & \V{0}\\
T_k \Ixy & \V{0}\\
T_k\tildeM{B}_{k,i} + \frac{T^3_k}{6}\tildeM{A} \Ixy & T_k \Ixy
\end{bmatrix}
}_{\M{B}_{k,i}}
\wrench_{k,i}
+
\underbrace{
\begin{bmatrix}
\frac{T^2_k}{2} \tildeV{b} \\
T_k \tildeV{b} \\
\frac{T^3_k}{6} \tildeM{A} \tildeV{b}
\end{bmatrix}
}_{\V{b}},
\label{eq.discrete_momenta_model.dynamics}
\\
& \force_{k,i} = \M{V}_{k,i} \V{\lambda}_{k,i},
\\
&
\sum_{i=1}^{M_k} \forceC_{k,i}^z = - m g^z
,
\\
&
\objA_{\moment,k,i}
\begin{bmatrix}
\V{\lambda}_{k,i}\\
\moment_{k,i}
\end{bmatrix}
\ge
\ubarV{\objb}_{\moment,k,i}
,
\\
& \V{\lambda}_{k,i} \ge \V{0},
\label{eq.discrete_momenta_model.friction}\\
& \mbox{proxy constraints},
\label{eq.discrete_momenta_model.fixedcontact}
\end{empheq}
\end{subequations}
\end{model}
%
where the state vector $\V{x}$ and matrices $\tildeM{A}$, $\tildeV{b}$ are
defined as in \cref{sec.model_momenta}, contact wrench $\wrench_{k,i} =
(\force_{k,i}, \moment_{k,i})$ is constant during $T_k$, $M_k$ is the number of
contacts during the $k$-th interval, and $\tildeM{B}_{k,i}$ in contrast with
$\tildeM{B}_{i}$ used in continuous-time \nameref{model.CMB} model allows for
different positions of contacts $\contact_{k,i}$ during different intervals
%
\begin{equation}
\tildeM{B}_{k,i}
=
\begin{bmatrix}
0 & - (\contactC_{k,i}^z - {c}^z) & \contactC_{k,i}^y\\
\contactC_{k,i}^z - {c}^z & 0 & - \contactC_{k,i}^x
\end{bmatrix}.
\end{equation}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Point-mass models with planar CoM motion}\label{sec.point_mass_planar_discret}
In the following subsections we discretize \nameref{model.CPPMJ} and
\nameref{model.CPPMdZ} models presented in \cref{sec.point_mass_planar}. For
simplicity we assume that
%
\begin{description}
\item[\ass{ass.constant_ext_wrench}] the external wrench $(\forceext,
\momentext)$ and orientation of the gravity $\V{g}$ do not change
within the preview horizon;
\item[\ass{ass.constant_foot_height}] the vertical position of contact
points $\contactC^z$ is constant.
\end{description}
%
It is possible to generalize the derivations to situations, when these
assumptions do not hold. This, however, would require a larger number of
constraints on the \ac{CoP} positions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Model controlled with the CoM jerk}\label{sec.point_mass_planar_discret_jerk}
Discretization of \nameref{model.CPPMJ} model yields
%
\begin{model}{PPMJ}{Planar Point-Mass controlled with \acs{CoM} Jerk}
\begin{subequations}\label{eq.ppmj}
\begin{empheq}[left=\empheqlbrace]{align}
&
\V{x}_{k+1}
=
\begin{bmatrix}
\tildeM{A}_k & \M{0} \\
\M{0} & \tildeM{A}_k \\
\end{bmatrix}
\V{x}_k
+
\begin{bmatrix}
\tildeV{B}_k & \V{0}\\
\V{0} & \tildeV{B}_k \\
\end{bmatrix}
\dddotV{c}_k^{xy}
,
\\
&
\cop_{k+1}
=
\begin{bmatrix}
\tildeM{D} & \M{0}\\
\M{0} & \tildeM{D}\\
\end{bmatrix}
\V{x}_{k+1}
+
\FUNC{Z}(\zeta, \V{g}, \forceext, \momentext)
,
\label{eq.ppmj.cop}
\\[2mm]
&
\cop_{k+1} \in \SET{S}(\contact_{k+1,1}^{xy}, ... ,\contact_{k+1,M_s}^{xy})
,
\end{empheq}
\end{subequations}
\end{model}
%
where $k \in \{0, ..., N-1\}$,
$
\V{x}_k =
(
\C{c}^x_k,
\dotC{c}^x_k,
\ddotC{c}^x_k,
\C{c}^y_k,
\dotC{c}^y_k,
\ddotC{c}^y_k
)
$,
%
\begin{equation}
\tildeM{A}_k =
\begin{bmatrix}
1 & T_k & T_k^2/2\\
0 & 1 & T_k \\
0 & 0 & 1 \\
\end{bmatrix}
,
\quad
\tildeM{B}_k =
\begin{bmatrix}
T_k^3/6 \\
T_k^2/2 \\
T_k \\
\end{bmatrix}
,
\\
\quad
\tildeM{D}
=
\begin{bmatrix}
1 & 0 & - \zeta
\end{bmatrix}
,
\quad
\zeta
=
\frac{m (c^z - \contactC^z)}{- m \C{g}^z - \forceextC^z}
.
\end{equation}
%
\begin{equation}
\FUNC{Z}(\zeta, \V{g}, \forceext, \momentext)
=
\zeta
\left(
\V{g}^{xy}
+
\frac{\forceext^{xy}}{m}
\right)
+
\frac{1}{- m \C{g}^z - \forceextC^z}
\begin{bmatrix}
- \momentextC^y\\
\momentextC^x\\
\end{bmatrix}
\end{equation}
%
Note that, if one of the parameters in \cref{eq.ppmj.cop} changes at the
boundary between the $k$-th and $k+1$ sampling intervals, there is a
discontinuity in the \ac{CoP} position at this instant. Hence, if, for example,
the external force $\forceext$ changes at this instant, the number of
constraints on the \ac{CoP} position must be doubled. For the same reason it is
necessary to impose the \ac{CoP} constraints twice for each sampling interval
in the case of the second order model based on a double integrator and
controlled with the \ac{CoM} acceleration. In order to avoid this complication
we introduced \cref{ass.constant_ext_wrench,ass.constant_foot_height}.
Satisfaction of the constraints on $\cop_k$ and $\cop_{k+1}$ in the models
controlled by the \ac{CoM} acceleration or jerk does not guarantee their
satisfaction during the $k$-th sampling interval. In order to illustrate this we
consider the $k$-th sampling interval of the system controlled by the \ac{CoM}
jerk. Let $\V{x}_k$ be an initial state, $\dddotV{c}_k^{xy}$ -- the constant
jerk applied during $T_k$, $\V{x}_t$ -- the state of the system at some $t \in
[0, T_k]$. Position of the \ac{CoP} during the sampling interval can be found
as
%
\begin{equation}
\copC^\alpha_t
=
\tildeM{D}_k
\begin{bmatrix}
\C{c}^\alpha_t\\
\dotC{c}^\alpha_t\\
\ddotC{c}^\alpha_t
\end{bmatrix}
=
\tildeM{D}_k
\left(
\tildeM{A}_t
\begin{bmatrix}
\C{c}^\alpha_k\\
\dotC{c}^\alpha_k\\
\ddotC{c}^\alpha_k
\end{bmatrix}
+
\tildeM{B}_t
\dddotC{c}^{\alpha}_k
\right)
,
\end{equation}
%
where $\alpha \in \{x,y\}$, $(\forceext[k,], \momentext[k,]) = \V{0}$ for
simplicity, and
%
\begin{equation}
\tildeM{A}_t =
\begin{bmatrix}
1 & t & t^2/2\\
0 & 1 & t \\
0 & 0 & 1 \\
\end{bmatrix}
,
\quad
\tildeM{B}_t =
\begin{bmatrix}
t^3/6 \\
t^2/2 \\
t \\
\end{bmatrix}
.
\end{equation}
%
Hence, the \ac{CoP} position at time $t$ depends cubically on time $t$:
%
\begin{equation}\label{eq.cop_polynomial}
\copC_t^\alpha
=
\frac{\dddotC{c}_k^\alpha}{6} t^3
+
\frac{\ddotC{c}_k^\alpha}{2} t^2
+
\left(
\dotC{c}_k^\alpha
-
\dddotC{c}_k^\alpha \zeta_k
\right)
t
-
\ddotC{c}_k^\alpha \zeta_k
+
\C{c}_k^\alpha.
\end{equation}
%
Similarly, this dependence is quadratic in the case of a second order model
controlled by the \ac{CoM} acceleration. Therefore, satisfaction of the
\ac{CoP} constraints at time $0$ and $T_k$, as is usually enforced by \ac{MPC}
schemes, does not guarantee their satisfaction at $t \in (0, T_k)$. The systems
controlled by the \ac{CoP} position or its velocity are not subject to this
problem. This problem, however, is typically not critical, since the support
areas are intentionally shrunk due to the addition of safety margins
\cite{Wieber2015handbook}. The size of these margins can be estimated by
computing maxima of the polynomial \cref{eq.cop_polynomial}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{System controlled with the CoP velocity}\label{sec.point_mass_planar_discret_dcop}
\begin{figure}[ht]
\begin{minipage}[t]{0.45\textwidth}
\centering{%
\includegraphics{inverted_pendulum.eps}}
\caption{Inverted pendulum with a mass $\V{c}$ constrained to a plane.}
\label{fig.inverted_pendulum1}
\end{minipage}
\hfill
\begin{minipage}[t]{0.45\textwidth}
\centering{%
\includegraphics{pendulum.eps}}
\caption{Pendulum with a mass $\V{c}$ constrained to a plane.}
\label{fig.pendulum1}
\end{minipage}
\end{figure}
Discretized version of \nameref{model.CPPMdZ} is
%
\begin{model}{PPMdZ}{Planar Point-Mass controlled with $\dot{\cop}$}
\begin{subequations}
\begin{empheq}[left=\empheqlbrace]{align}
&
\V{x}_{k+1}
=
\begin{bmatrix}
\tildeM{A}_k & \M{0} \\
\M{0} & \tildeM{A}_k \\
\end{bmatrix}
\V{x}_k
+
\begin{bmatrix}
\tildeV{B}_k & \V{0}\\
\V{0} & \tildeV{B}_k \\
\end{bmatrix}
\dot{\cop}_k
,
\\
&
\cop_{k+1}
=
\begin{bmatrix}
\tildeM{D} & \M{0}\\
\M{0} & \tildeM{D}\\
\end{bmatrix}
\V{x}_{k+1}
+
\FUNC{Z}(\zeta, \V{g}, \forceext, \momentext)
,
\\[2mm]
&
\cop_{k+1} \in \SET{S}(\contact_{k+1,1}^{xy}, ... ,\contact_{k+1,M_s}^{xy})
,
\end{empheq}
\end{subequations}
\end{model}
%
where all terms are defined as in \nameref{model.PPMJ} model, except matrices
$\tildeM{A}_k$ and $\tildeV{B}_k$, which differ depending on the sign of
$\zeta$
%
\begin{equation}
\zeta
=
\frac{m (c^z - \contactC^z)}{- m \C{g}^z - \forceextC^z}.
\end{equation}
%
Note that we already have $\zeta \ne 0$ due to \cref{ass.nonzero_com_height}.
%
\begin{itemize}
\item The variable $\zeta$ is negative, when $c^z - \contactC^z > 0$ and $-
m \C{g}^z < \forceextC^z$, or $c^z - \contactC^z < 0$ and $- m \C{g}^z
> \forceextC^z$. This is possible in two cases: ({\bf i}) the \ac{CoM}
is below the support surface and $\forceextC^z$ does not cancel the
gravity, ({\bf ii}) the \ac{CoM} is above the support surface and
$\forceextC^z$ cancels the gravity. In any case, the robot is hanging
and its dynamics resembles dynamics of a standard pendulum shown in
\cref{fig.pendulum1}. We are not aware of publications, where this
version of the model was employed, but it may be useful in some
settings, for example, to realize locomotion on monkey bars as in
\cite{Dai2014humanoids}, which relies on a nonlinear model. So,
whenever $\zeta < 0$, the matrices are defined as
\vspace{-\parskip}\par
%
{
\small
\begin{equation}
\label{eq.ppmdz_matrices1}
\tildeM{A}_k
=
\begin{bmatrix}
1 & \sin \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) \sqrt{ \NORM{\zeta}} & \zeta\cos \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) - \zeta \\
0 & \cos \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) & \sin \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) \sqrt{ \NORM{\zeta}} \\
0 & -\frac{1}{\sqrt{\NORM{\zeta}}} \sin \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) & \cos \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) \\
\end{bmatrix}
,
\enspace
\tildeM{B}_k
=
\begin{bmatrix}
T_k - \sin \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) \sqrt{ \NORM{\zeta}} \\
1 - \cos \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right) \\
\frac{1}{\sqrt{\NORM{\zeta}}} \sin \left(\frac{T_k}{\sqrt{ \NORM{\zeta}}}\right)\\
\end{bmatrix}
.
\end{equation}
}
%
\item In the case of positive $\zeta$, which corresponds to \ac{LIPM}
(\cref{fig.inverted_pendulum1}), the matrices have the following form
%
\begin{equation}
\label{eq.ppmdz_matrices2}
\tildeM{A}_k
=
\begin{bmatrix}
1 & \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) \sqrt{\zeta} & \zeta\cosh \left(\frac{T_k}{\sqrt{\zeta}}\right) - \zeta \\
0 & \cosh \left(\frac{T_k}{\sqrt{\zeta}}\right) & \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) \sqrt{\zeta} \\
0 & \frac{1}{\sqrt{\zeta}}\sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) & \cosh \left(\frac{T_k}{\sqrt{\zeta}}\right)\\
\end{bmatrix}
,
\quad
\tildeM{B}_k
=
\begin{bmatrix}
T_k - \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) \sqrt{\zeta} \\
1 - \cosh \left(\frac{T_k}{\sqrt{\zeta}}\right) \\
- \frac{1}{\sqrt{\zeta}} \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right)
\end{bmatrix}
.
\end{equation}
%
Note that substitution of negative $\zeta$ in the obtained matrices
yields \cref{eq.ppmdz_matrices1}, hence, they are expressed in
\cref{eq.ppmdz_matrices2} in a more general form.
\end{itemize}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Point-mass model with nonplanar CoM motion}
Discretization of \nameref{model.CNPM} model presented in
\cref{sec.point_mass_nonplanar} is trivial as in the case of
\nameref{model.CPPMJ} model with planar \ac{CoM} motion (see
\cref{sec.point_mass_planar_discret_jerk}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Variation of discrete-time models with time}\label{sec.discret_variation}
One can observe that state transition matrices, control matrices, and
constraints in discrete-time models can be chosen differently depending on the
sampling interval $k$. Hence, some parameters of the models, which were assumed
to be constant in continuous-time case, can vary in discrete-time case if their
changes are known in advance and synchronized with the boundaries of sampling
intervals. For example,
%
\begin{itemize}
\item The number and positions of contacts can be changed in momenta-based
model as hinted in \cref{sec.momenta_model_discret}. Therefore, this
model can be used to realize locomotion \cite{Nagasaka2012,
Audren2014iros}.
\item Variation of the discrete-time models with planar \ac{CoM} motion is
used to change foot contacts and orientations of the feet without
compromising linearity \cite{Herdt2010auro},
\cref{sec.mpc_foot_positions}.
\item The point-mass model with nonplanar \ac{CoM} motion can be utilized
for walking on an uneven terrain, if height of the contact surface
$\contactC^z_k$ as well as its orientation are changed appropriately
\cite{Brasseur2015humanoids}.
\end{itemize}
%
Variation of the discrete-time models is typically realized with the help of
external routines with respect to \ac{MPC}. For example, a preliminary \ac{MPC}
problem is solved in \cite[Chapter~2]{Herdt2012thesis} to determine
orientations of the foot contacts. In the same work, a \ac{FSM} is used to set
durations and alternation of left and right foot contacts during a regular
walk. Though durations of the contacts are usually decided externally when
approximate models are employed, in some settings this can be partially avoided
with the help of motion anticipation and task prioritization as described in
\cref{sec.optional_force} and \cite{Sherikov2015humanoids}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Capturability constraints}\label{sec.approx_models_capturability}
We claimed in \cref{sec.balance_general} that balance is maintained as long as
it is possible to stop the robot, \IE, capture it, without violation of the
system constraints. A capturability constraint on the final state-control pair
$(\V{x}_N, \V{u}_{N+1})$ formalizes conditions under which the robot can be
stopped. In this regard the capturability constraint is similar to the so
called \tn{terminal constraint}, which is employed in \tn{dual-mode} \ac{MPC}
\cite{Mayne2000automatica}, \cite[Chapter~6]{Rossiter2003mpc}. In this version
of \ac{MPC} a terminal constraint is imposed at the end of the preview horizon
to make sure that the system reaches some \tn{terminal set}, where a simple
local controller can stabilize the system. Here we take a similar approach, but
we want a local controller to drive the system to \tn{any} of its statically
balanced states instead of \tn{a given desired} state. Our approach is
conceptually similar to constraining the final state-control pair to a
\tn{terminal feasible invariant set} as suggested in
\cite{Schouwenaars2006thesis}.
There are several conceptual questions regarding capturability constraints,
which we would like to address before going into details of construction of
these constraints for particular models:
%
\begin{itemize}
\item Shouldn't we aim for stability rather than capturability? So far we
cannot give a decisive answer. Capturability is in general less
restrictive as indicated above. On the other hand, closed loop behavior
of an \ac{MPC} with capturability constraints may be worse, for
example, due to different statically balanced states being chosen on
different control iterations.
\item Why many applications of \ac{MPC} for balance preservation are
successful without capturability constraints \cite{Herdt2010auro,
Kajita2003icra} and what kind of improvements such constraints can
bring? The answer to the first part of the question lies in the fact
that a finite preview horizon \tn{approximates} an infinite preview
horizon, which, in turn, guarantees viability, \IE, that the robot will
not fall \cite{Wieber2008iros}. A capturability constraint, on the
other hand, \tn{guarantees} capturability, \IE, the ability to stop,
even with a finite preview horizon. Hence, an \ac{MPC} problem with
capturability constraint is more reliable in balance preservation and
does not need the preview horizon to be as long as in the case without
such constraint.
\item What is the impact of a capturability constraint on feasibility of
the underlying optimization problem? A capturability constraint, as
well as any other hard constraint, may cause infeasibility
\cite[Chapter~8]{Rossiter2003mpc}, which means that the chosen model of
the robot cannot be stopped within the chosen preview horizon. This
infeasibility is equivalent to a conflict between tasks in whole body
motion control reviewed in \cref{sec.wbm_control} and, thus, can be
addressed with the same numerical tools, which are discussed in
\cref{ch.optimization}.
\end{itemize}
%
In the following subsections we construct capturability constraints for the
approximate models introduced in \cref{sec.linear_approx_models} and
discretized in \cref{sec.approx_models_discret}. In all cases we derive
constraints assuming that
%
\begin{description}
\item[\ass{ass.timeinvariant}] The model is time-invariant, starting from
the end of the preview horizon, which implies, in particular, that the
number and positions of the contacts do not change. Note that our
capturability constraints ensure recursive feasibility of
time-invariant systems in the same way as the usual terminal
constraints \cite{Mayne2000automatica}.
\end{description}
%
It is also presumed that the system constraints are imposed on the final
state-control pair in addition to the derived capturability constraints.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Momenta-based model}\label{sec.momenta_model_capturability}
In its simplest form a capturability constraint imposes that the robot is in a
statically balanced state. A statically balanced state must necessarily be a
part of a fixed point, \IE, such state-control pair $(\V{x}_k, \V{u}_k)$ that
\cite[Chapter~8]{Scheinerman1996ids}
%
\begin{equation}
\V{x}_k = \M{A}_k \V{x}_k + \M{B}_k \V{u}_k.
\end{equation}
%
In the case of momenta-based (\nameref{model.MB}) model, this condition results
in the following constraints, where indices of state and control variables are
omitted for simplicity:
%
\begin{itemize}
\item $\V{\LM}^{xy} = \V{0}$ -- no linear momentum in the $x$-$y$ plane,
\IE, the \ac{CoM} velocity is zero $\dotV{c}^{xy} = \V{0}$;
\item $m \V{g}^{xy} + \sum_{i=1}^{M} \force_i^{xy} = \V{0}$ -- no forces in
the $x$-$y$ plane, \IE, the \ac{CoM} acceleration is zero
$\ddotV{c}^{xy} = \V{0}$;
\item the rate of change of the angular momentum about the $x$ and $y$ axes
is also zero:
\begin{equation}
\begin{aligned}
\dotV[c]{\AM}^{xy}
&=
\begin{bmatrix}
\hatC{\LM}^y \C{g}^z
+
\sum_{i=1}^{M}
\left(
\forceC^z_i \contactC_i^y
+
\Ix \moment_i
-
\forceC^y_i (\contactC^z_i - \C{c}^z)
\right)
\\
-\hatC{\LM}^x \C{g}^z
+
\sum_{i=1}^{M}
\left(
-\forceC^z_i \contactC_i^x
+
\Iy \moment_i
+
\forceC^x_i (\contactC^z_i - \C{c}^z)
\right)
\end{bmatrix}
\\
&=
\begin{bmatrix}
\hatC{\LM}^y \C{g}^z
-
m \C{c}^z \C{g}^y
+
\sum_{i=1}^{M}
\left(
\forceC^z_i \contactC_i^y
+
\Ix \moment_i
-
\forceC^y_i \contactC^z_i
\right)
\\
-\hatC{\LM}^x \C{g}^z
+
m \C{c}^z \C{g}^x
+
\sum_{i=1}^{M}
\left(
- \forceC^z_i \contactC_i^x
+
\Iy \moment_i
+
\forceC^x_i \contactC^z_i
\right)
\end{bmatrix}
=
\V{0}.
\end{aligned}
\end{equation}
\end{itemize}
%
Note that the fixed points of the approximate system include states with
non-zero angular momentum $\V[c]{\AM}^{xy} \neq \V{0}$, even though the real
system cannot store angular momentum \cite{Stephens2010iros}. Consequently, a
fixed point of this approximate model does not always correspond to a fixed
point of the whole body model and does not imply that the latter is captured.
We alleviate this issue by imposing that $\V[c]{\AM}^{xy}$ is zero as well.
Furthermore, provided that $m \V{g}^{xy} + \sum_{i=1}^{M} \force_i^{xy} =
\V{0}$ holds, we can also determine $\dotC[c]{\AM}^{z}$ using the equation
\cref{eq.component_wise_momenta} and constrain it:
%
\begin{equation}
\begin{aligned}
\dotC[c]{\AM}^z
&=
\sum_{i=1}^M
\left(
\begin{bmatrix}
- (\contactC_i^y - {c}^y) & \contactC_i^x - {c}^x & 0
\end{bmatrix}
\force_i
+
\Iz
\moment_i
\right)
\\
& =
\sum_{i=1}^M
\left(
\contactC_i^x
\forceC_i^y
-
\contactC_i^y
\forceC_i^x
+
\Iz
\moment_i
\right)
+
\hatC{\LM}^x
\C{g}^y
-
\hatC{\LM}^y
\C{g}^x
=
0
,
\end{aligned}
\end{equation}
%
even though $\dotC[c]{\AM}^z$ depends nonlinearly on the state and control
variables in general.
Thus, the complete capturability constraint is defined as
%
\begin{subequations}
\label{eq.capture_momenta_model}
\begin{empheq}[left=\empheqlbrace]{alignat=2}
&\V{\LM}^{xy}
&&= \V{0},
\\
&\V[c]{\AM}^{xy}
&&= \V{0},
\\
&\dotV{\LM}^{xy}
&&= m \V{g}^{xy} + \sum_{i=1}^{M} \force_i^{xy} = \V{0},
\\
&
\dotV[c]{\AM}
&&=
-
\V{g}
\CROSS
\begin{bmatrix}
\hatV{\LM}^{xy}\\
m \C{c}^z
\end{bmatrix}
+
\sum_{i=1}^{M}
\left(
\contact_i
\CROSS
\force_i
+
\moment_i
\right)
=
\V{0}
.
\end{empheq}
\end{subequations}
%
Note that the capturability constraint imposed in \cite{Sherikov2015humanoids}
for the same model is not entirely correct.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Point-mass models with planar CoM motion}\label{sec.point_mass_planar_capturability}
In the present section we construct capturability constraints for the two third
order point-mass models introduced in \cref{sec.point_mass_planar} and
discretized in \cref{sec.point_mass_planar_discret}. We approach the derivation
of these constraints using the idea of dual-mode \ac{MPC} instead of
identification of fixed points as in the previous case of the momenta-based
model. To be more precise, we use capturability constraints to specify a set of
states, starting from which the system can converge to a statically balanced
state with the help of a simple linear feedback controller. Strictly speaking,
\tn{convergence} to a statically balanced state contradicts with our definition
of capturability given in \cref{ch.balance}, since this definition requires
that the system reaches a statically balanced state in \tn{finite} time.
However, we consider this contradiction to be insignificant.
We construct linear feedback controllers in such a way, that they maintain a
constant position of the \ac{CoP}. This implies that constraints on this
position will not be violated in the future. Though the controllers are
supposed to be discrete-time, we consider their continuous-time counterparts as
well to emphasize relations and differences between variants of the model with
different control variables.
In order to simplify presentation, we exploit the fact, that the state
transition and control matrices in systems are block diagonal and each block
corresponds to motion along the $x$ or $y$ axis. This allows us to limit our
analysis to blocks $\tildeM{A}$, $\tildeV{B}$, $\tildeM{A}_k$, $\tildeV{B}_k$
defined in \cref{sec.point_mass_planar,sec.point_mass_planar_discret}
respectively.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Continuous-time model controlled by the CoM jerk}
In this section we work with \nameref{model.CPPMJ} model. Our goal is to derive
a controller, which maintains constant position of the \ac{CoP} or, in other
words, maintains zero velocity of the \ac{CoP}. Velocity of the \ac{CoP} can be
found by differentiation of the equation \cref{eq.point_mass_jerk_control.cop}
(assuming constant external wrench $(\forceext, \momentext)$):
%
\begin{equation}
\dot{\cop} = \dotV{c}^{xy} - \zeta \dddotV{c}^{xy} = \V{0}.
\end{equation}
%
If $\zeta = 0$, the \ac{CoP} velocity is zero when the \ac{CoM} velocity is
zero. Hence, the capturability constraint is
%
\begin{equation}
\dotV{c}^{xy} = \V{0}
,
\quad
\ddotV{c}^{xy} = \V{0}
,
\quad
\dddotV{c}^{xy} = \V{0}.
\end{equation}
%
If $\zeta \ne 0$, we substitute $\dddotV{c}^{xy} = \dotV{c}^{xy} / \zeta$ into
the model. The obtained model is identical to \nameref{model.CPPMdZ} model with
control input equal to zero $\dot{\cop} = \V{0}$. This case is analyzed in the
following subsection, while the discrete-time case of the model controlled by
the \ac{CoM} jerk is considered afterwards.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Continuous and discrete-time models controlled by the CoP velocity}\label{sec.capturability_cop_control}
Position of the \ac{CoP} in \nameref{model.CPPMdZ} model can always be
maintained with a trivial linear controller $\dot{\cop} = \V{0}$. Hence, we can
analyze stability of the system with the help of eigen decomposition of the
state transition matrices $\tildeM{A}$ and $\tildeM{A}_k$
%
\begin{equation}
\tildeM{A}
=
\begin{bmatrix}
0 & 1 & 0 \\
0 & 0 & 1 \\
0 & \frac{1}{\zeta} & 0 \\
\end{bmatrix}
,
\quad
\tildeM{A}_k
=
\begin{bmatrix}
1 & \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) \sqrt{\zeta} & \zeta\cosh \left(\frac{T_k}{\sqrt{\zeta}}\right) - \zeta \\
0 & \cosh \left(\frac{T_k}{\sqrt{\zeta}}\right) & \sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) \sqrt{\zeta} \\
0 & \frac{1}{\sqrt{\zeta}}\sinh \left(\frac{T_k}{\sqrt{\zeta}}\right) & \cosh \left(\frac{T_k}{\sqrt{\zeta}}\right)\\
\end{bmatrix}
.
\end{equation}
%
Eigen decomposition allows to identify unstable eigenvalues and nullify
unstable modes of the system \cite{Scheinerman1996ids, Muske1993aiche}.
Eigenvalues of matrices $\tildeM{A}$ and $\tildeM{A}_k$ are
%
\begin{equation}
\left(-\frac{1}{\sqrt{\zeta}}, \frac{1}{\sqrt{\zeta}}, 0 \right)
\mbox{ and }
\left( e^{-\frac{T_k}{\sqrt{\zeta}}}, e^{\frac{T_k}{\sqrt{\zeta}}}, 1 \right)
\end{equation}
respectively, where $e$ is Euler's number. Thus, stability of the systems is
determined by the sign of $\zeta$
%
\begin{itemize}
\item When $\zeta < 0$ matrix $\tildeM{A}$ has two purely imaginary and one
zero eigenvalues. In order to suppress oscillatory behavior in this
case it is necessary to set the \ac{CoM} velocities and accelerations
to zero:
%
\begin{equation}
\dotV{c}^{xy} = \V{0}
,
\quad
\ddotV{c}^{xy} = \V{0}.
\end{equation}
%
Analysis of the discrete-time matrix $\tildeM{A}_k$ results in the same
conclusion.