-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch3-models.tex
2307 lines (2174 loc) · 78.1 KB
/
ch3-models.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{Modeling of a humanoid robot}
\label{ch.modeling}
\acresetall
%-------------------------------------------------------------------------------
A very abstract model of a humanoid robot~\cref{eq.general_system} was
sufficient for the discussion in \cref{ch.balance}, but it is of no use for
practical applications. Therefore, in the present chapter we specify and study
the structure of humanoid robot models. Though we employ only the whole body
model for control (\cref{sec.whole_body_model}) and approximate linear models
for anticipation (\cref{sec.linear_approx_models}), we also consider
approximate nonlinear models in \cref{sec.nonlinear_approx_models} to
demonstrate the ancestral relationships between these models. These
relationships can be illustrated with the following tree
\begin{forest}
for tree={
grow'=0,
child anchor=west,
parent anchor=south,
anchor=west,
calign=first,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south west) +(7.5pt,0) |- node[fill,inner sep=1.25pt] {} (.child anchor)\forestoption{edge label};
},
before typesetting nodes={
if n=1
{insert before={[,phantom]}}
{}
},
fit=band,
before computing xy={l=25pt},
}
[Whole body (\nameref{model.WB}) model (\cref{sec.whole_body_model})
[Nonlinear momenta-based (\nameref{model.NMB}) model (\cref{sec.momenta_based_nonlinear})
[Nonlinear point-mass (\nameref{model.NPM}) model (\cref{sec.point_mass_nonlinear})
[\begin{minipage}{11cm}Linear point-mass models (\nameref{model.CPPMJ} and \nameref{model.CPPMdZ}) with planar \ac{CoM} motion (\cref{sec.point_mass_planar})\end{minipage}]
[\begin{minipage}{11cm}Linear point-mass model (\nameref{model.CNPM}) with nonplanar \ac{CoM} motion (\cref{sec.point_mass_nonplanar})\end{minipage}]
]
[Linear momenta-based (\nameref{model.CMB}) model (\cref{sec.model_momenta})]
]
]
\end{forest}
We present detailed derivations of the models and try to be explicit about all
assumptions made in the process. Most of the assumptions are introduced to
linearize models in order to fit them in the \ac{PLLS} framework
(\cref{ch.optimization}), which we employ for both control and anticipation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Whole body dynamical model}\label{sec.whole_body_model}
We start by considering the whole body model of a humanoid robot. A humanoid
robot is a chain of $n+1$ links interconnected by $n$ joints. In general,
joints can be rotary or prismatic, actuated or not actuated. While all these
joint types can be incorporated in the model without much effort, we limit our
discussion to actuated rotary joints only, since the other types are rare in
humanoid robots. The links composing the robot can be in contact with the
environment, but are not fixed to any support. Therefore, the robot must be
modeled taking contacts and contact friction into account. We use \tn{Coulomb's
law} as a friction model \cite[Chapter~10]{Popov2010contact} and make the
following additional assumptions:
%
\begin{description}
\item[\ass{ass.frictioncoef}] coefficients of static and kinetic (dynamic)
friction are equal and constant \cite[Chapter~10]{Popov2010contact};
\item[\ass{ass.norolling}] there are no rolling contacts;
\item[\ass{ass.rigid}] the environment and links of the robot are rigid;
\item[\ass{ass.fixed_environment}] the robot contacts only the objects,
whose positions are fixed in the environment;
\item[\ass{ass.nojointfriction}] there is no friction in the joints;
\item[\ass{ass.nouncertainty}] there are no noises in measurements of the
state and no inaccuracies in parameters of the robot.
\end{description}
%
\cref{ass.frictioncoef} is ubiquitous in the literature.
\cref{ass.norolling,ass.rigid,ass.fixed_environment} are not valid in some
settings, but we do not consider such settings and thus avoid the burden of
more accurate modeling. The last two assumptions can never be fulfilled in
practice. However, friction in the joints can be modeled, if the corresponding
parameters of the robot are provided, or it can be concealed by joint-level
position controllers of a robot such as \sn{HRP-2} \cite{Kaneko2004icra}. The
problem of uncertainty, on the other hand, is not addressed by modeling, but
rather by robust control and techniques for estimation of parameters and state
\cite[Chapter~8]{Siciliano2010robotics}, \cite{Christensen2008handbook}. We
leave such topics outside of the scope of this thesis.
Based on the listed assumptions, we present the whole body model in the
following \cref{sec.complementarity_system}.
\cref{sec.wbm_constraints,sec.contact_constraints} focus on constraints
included in the model and their linearization. \cref{sec.linear_wbm} presents a
whole body model with linear constraints, while concluding
\cref{sec.wbm_control} overviews the control of the robot using this model.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Humanoid robot as a complementarity system}\label{sec.complementarity_system}
Under \crefrange{ass.frictioncoef}{ass.nouncertainty} the humanoid robot is
described by a \tn{complementarity system} \cite{Brogliato2003tranac,
Hurmuzlu2004automatica}, whose form at a given time instant with $M$ contacts
is \cite{Trinkle1997zamm}
%
\begin{subequations}\label{eq.complementarity_system}
\begin{empheq}[left=\empheqlbrace]{align}
& \M{H}(\q) \ddq + \V{h}(\q, \dq) = \Itorques\torques + m\T{\Jcom}(\q) \V{g} + \T{\Jcontact}(\q) \allcontactf,
\label{eq.complementarity_system.dynamics}\\[2mm]
& \ubarV{\objb} \le \FUNC{A} (\ddq, \dq, \q, \torques) \le \barV{\objb},
\label{eq.complementarity_system.constraints}\\[2mm]
& \ddcontactC^n_i \ge 0,
\label{eq.complementarity_system.nonpenetration}\\
& \forceC_i^n \ge 0,
\label{eq.complementarity_system.unilaterality}\\
& \ddcontactC^n_i \forceC_i^n = 0,
\label{eq.complementarity_system.complementarity}\\[2mm]
& \friction_i^2 (\forceC_i^n)^2 - \T{(\force_i^t)} \force_i^t \ge 0,
\label{eq.complementarity_system.frictioncone}\\
%|| n x f x n || =< \friction(f^T n)
& \friction_i \forceC_i^n \dcontact^t_i - \force_i^t \NORME{\dcontact^t_i} = 0,
\label{eq.complementarity_system.frictiondirection}
\end{empheq}
\end{subequations}
%
where $i \in \{1, ..., M\}$,
%
\begin{subequations}
\begin{align}
& (\ddcontact_1, \dots, \ddcontact_M) = \Jcontact(\q) \ddq + \dJcontact(\q) \dq, \\
& (\force_1, ..., \force_M) = \allcontactf,
\end{align}
\end{subequations}
%
and variables have the following meaning
%
\begin{longtable}[l]{@{\extracolsep{0pt}}l @{\extracolsep{3pt}}l p{9.5cm}}
$\q = (\qn, \V{r}, \V{\EULER})$ & $\in \RR^{n+3+3}$ & vector of generalized coordinates including
$n$ joint angles $\qn$, position of the base $\V{r}$,
and orientation of the base represented with Euler angles $\V{\EULER}$\\
$\torques$ & $\in \RR^n$ & vector of joint torques\\
$\force_i$ & $\in \RR^{3}$ & $i$-th contact force\\
$\contact_i$ & $\in \RR^{3}$ & position of the $i$-th contact \\
$\M{H}(\q)$ & $\in \RR^{(n+6) \CROSS (n+6)}$ & inertia matrix\\
$\V{h}(\q, \dq)$ & $\in \RR^{n+6}$ & vector of Coriolis and centrifugal terms\\
$\Jcom$ & $\in \RR^{3 \CROSS (n+6)}$ & Jacobian of the \ac{CoM} (see \cref{sec.momenta_structure})\\
$\Jcontact$ & $\in \RR^{3M \CROSS (n+6)}$ & translational Jacobian of the contact points\\
$\Itorques = (\M{I}_n, \M{0}_{6,n})$ & $\in \RR^{(n+6) \CROSS n}$ & torque selection matrix\\
$\V{g}$ & $\in \RR^3$ & vector of gravitational acceleration\\
$\friction_i$ & $\in \RR_{\ge 0}$ & friction coefficient of the $i$-th contact\\
$m$ & $\in \RR_{>0}$ & total mass of the system\\
$\FUNC{A}, \ubarV{\objb},\barV{\objb}$ & & function, which expresses application dependent
constraints on the state and controls, and its bounds\\
\end{longtable}
%
\noindent Superscripts $(\cdot)^t$ and $(\cdot)^n$ denote tangential and normal
components of vectors with respect to the contact surfaces as shown in
\cref{fig.friction_cone_contact}. These components are obtained by expressing
vectors in local frames $\FRAME{i}$ using rotation matrices $\M[][i]{R}$:
%
\begin{equation}
\begin{bmatrix}
\ddcontact^{t}_i\\
\ddcontactC^{n}_i
\end{bmatrix}
=
\M[][i]{R}
\ddcontact_i,
\enspace
\begin{bmatrix}
\dcontact^{t}_i\\
\dcontactC^{n}_i
\end{bmatrix}
=
\M[][i]{R}
\dcontact_i,
\enspace
\begin{bmatrix}
\force^{t}_i \\
\forceC^{n}_i
\end{bmatrix}
=
\M[][i]{R}
\force_i
.
\end{equation}
%
Each frame $\FRAME{i}$ is fixed to the contact point and its $z$ axis is normal
to the contact surface.
%
\begin{figure}
\centering{%
\includegraphics{friction_cone_contact.eps}}
\caption[Friction cone and the local frame $\FRAME{i}$ of the $i$-th contact.]{
Friction cone and the local frame $\FRAME{i}$ of the $i$-th contact.
Square patch indicates the contact surface.
}
\label{fig.friction_cone_contact}
\end{figure}
%
Individual components of system~\cref{eq.complementarity_system} have the
following interpretation
\begin{description}
\item[\cref{eq.complementarity_system.dynamics}] is the standard equation
of dynamics of a multibody system (see \cref{app.dynamics}). The
equation establishes relationship between motion of the joints and
forces acting on the robot.
\item[\cref{eq.complementarity_system.constraints}] represents constraints
of a particular robot and setting, for example, mechanical constraints.
These constraints are discussed later in \cref{sec.wbm_constraints}.
\item[\cref{eq.complementarity_system.nonpenetration}] prevents
interpenetration of the contact surface and the contacting body.
\item[\cref{eq.complementarity_system.unilaterality}] indicates that the
contacts are unilateral, \IE, the robot can push on the contact
surface, but cannot pull on it.
\item[\cref{eq.complementarity_system.complementarity}] is the
complementarity condition, which states that a contact force cannot be
applied at a contact surface if the contact point detaches from this
surface.
\item[\cref{eq.complementarity_system.frictioncone}] bounds tangential
components of the contact force depending on the norm of its normal
component in accordance with Coulomb's friction law.
\item[\cref{eq.complementarity_system.frictiondirection}] indicates that
the tangential component of the contact force is opposite to the
sliding velocity of the contact point.
\end{description}
In order to complete the model we have to consider one more important aspect,
which manifests itself in the discrete nature of changes of the set of
contacts. These changes, or \tn{switches} of the mode of the system, indicate
that the system at hand is \tn{hybrid}. The state of such a system is often
discontinuous at the instant of a switch, and a \tn{state reinitialization
rule} must be defined \cite{Brogliato2003tranac}. In the case of the considered
system with contacts we employ an \tn{impact law} described in
\cref{app.collision} as a reinitialization rule.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Mechanical constraints}\label{sec.wbm_constraints}
The general inequality \cref{eq.complementarity_system.constraints} comprises
mechanical limits of the joints and motors
%
\begin{subequations}\label{eq.mechanical_constraints}
\begin{align}
\ubar{\q}^{\prime}
\le
\qn
\le
\bar{\q}^{\prime},
\quad
\ubar{\dq}^{\prime}
\le
&
\dqn
\le
\bar{\dq}^{\prime},
\quad
\ubar{\ddq}^{\prime}
\le
\ddqn
\le
\bar{\ddq}^{\prime}, \label{eq.joint_constraints}\\
\ubar{\torques}
\le
&
\torques
\le
\bar{\torques}.
\end{align}
\end{subequations}
%
In general, constraints \cref{eq.complementarity_system.constraints} are not
limited to \cref{eq.mechanical_constraints}, but such cases are not considered
in this work.
Enforcement of constraints \cref{eq.joint_constraints} is not straightforward,
when the model is used exclusively for instantaneous control. In this case, the
current state $(\q, \dq)$ is given and cannot be constrained, while the next
state is not explicitly computed. For this reason, constraints on the joint
angles and velocities are imposed through the joint accelerations. Hence,
\cref{eq.joint_constraints} boils down to \cite{Rubrecht2012auro}
%
\begin{equation}
\ubar{\ddq}^{\prime}(\qn,\dqn)
\le
\ddqn
\le
\bar{\ddq}^{\prime}(\qn,\dqn),
\end{equation}
%
where bounds on accelerations incorporate bounds on joint angles and velocities
as well. We discuss computation of $\ubar{\ddq}^{\prime}(\qn,\dqn)$ and
$\bar{\ddq}^{\prime}(\qn,\dqn)$ in \cref{app.jointconstraints}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Contact constraints and assumptions}\label{sec.contact_constraints}
One of the primary sources of nonlinearity of system
\cref{eq.complementarity_system} are the contact constraints. In order to
linearize them we make a number of approximations and assumptions. We start by
assuming that
%
\begin{description}
\item[\ass{ass.nosliding}] There is no sliding, \IE, $\NORME{\dcontact^t_i}
= 0$. In order to enforce this,
constraint~\cref{eq.complementarity_system.frictiondirection}, which is
not needed now, is replaced with
%
\begin{equation}\label{eq.no_tangential_acc}
\ddcontact^t_i = \V{0}.
\end{equation}
%
While being useful in manipulation~\cite{Howe1996ijrr} sliding is less
common in locomotion~\cite{Miura2013tro}, and is usually prevented to
simplify control.
\item[\ass{ass.no_break_contacts}] Contacting bodies do not detach, and,
consequently, constraint
%
\begin{equation}\label{eq.no_normal_acc}
\ddcontactC^n_i = 0
\end{equation}
%
must be imposed instead of nonpenetration constraint
\cref{eq.complementarity_system.nonpenetration} and complementarity
condition \cref{eq.complementarity_system.complementarity}. This is
also a typical assumption. Whenever it is necessary to break one of the
contacts, constraint \cref{eq.no_normal_acc} is replaced by a motion
task for the contacting body.
\end{description}
%
\begin{figure}[ht]
\begin{minipage}[t]{0.45\textwidth}
\centering{%
\includegraphics{friction_cone3.eps}}
\subcaption{
Friction cone. The force vector is represented by a weighted sum of
vectors: $\force_i = 4.5\genvector_{i,1} + 3\genvector_{i,2} +
1.5\genvector_{i,3}$.
}
\label{fig.friction_cone3}
\end{minipage}
\hfill
\begin{minipage}[t]{0.45\textwidth}
\centering{%
\includegraphics{friction_cone4.eps}}
\subcaption{
Friction cone. The force vector is represented by a weighted sum of
vectors: $\force_i = 4.5\genvector_{i,1} + 3\genvector_{i,2} +
1.5\genvector_{i,3} + \genvector_{i,4}$.
}
\label{fig.friction_cone4}
\end{minipage}
\caption{Linear approximation of a friction cone.}
\label{fig.friction_cone}
\end{figure}
The next step is to linearize the quadratic
constraint~\cref{eq.complementarity_system.frictioncone}, which bounds the
$i$-th tangential contact force with respect to the normal contact force in
accordance with Coulomb's friction law. In order to linearize it, we replace
the second order cones with pyramids as shown in \cref{fig.friction_cone}. Then
for a pyramid with three faces (\cref{fig.friction_cone3}) the constraint is
expressed as
%
\begin{equation}\label{eq.friction_approx1}
\begin{bmatrix}
\T{(\genvector_{i,1} \CROSS \genvector_{i,2})} \\
\T{(\genvector_{i,2} \CROSS \genvector_{i,3})} \\
\T{(\genvector_{i,3} \CROSS \genvector_{i,1})} \\
\end{bmatrix}
\force_i
\ge
\V{0}
,
\end{equation}
%
where $\V{v}_{i,\{1, 2, 3\}}$ are unity vectors coinciding with the edges of
the pyramid, and cross product is used to obtain normals of the faces. Note
that \cref{eq.friction_approx1} implies unilaterality constraint
\cref{eq.complementarity_system.unilaterality} $\forceC_i^n \ge 0$, which
becomes redundant and should be removed from the system. There exist several
approaches to representation of the linearized constraints
\cite{Kuindersma2014icra}, and the one used in \cref{eq.friction_approx1} is
not optimal when it comes to solution of the system of constraints. We perform
a change of variables to express these constraints as simple bounds, which are
beneficial for solvers as indicated in \cref{sec.simple_bounds}:
%
\begin{equation}\label{eq.friction_approx2}
\force_i
=
\begin{bmatrix}
\genvector_{i,1} & \genvector_{i,2} & \genvector_{i,3}
\end{bmatrix}
\V{\lambda}_i
=
\M{V}_i
\V{\lambda}_i,
\quad
\V{\lambda}_i \ge \V{0}.
\end{equation}
%
Accuracy of the linear approximation increases with the number of faces of
pyramids, which is typically chosen to be 3 or 4
(\cref{fig.friction_cone3,fig.friction_cone4} respectively). We use pyramids
with three faces, because it results in the least number of inequality
constraints.
The number of inequality constraints is further reduced by representing a foot
contact force by a single wrench $\wrench_i = (\force_i, \moment_i) =
(\M{V}_i\V{\lambda}_i, \moment_i)$ applied at $\contact_i$ instead of multiple
$3$-dimensional forces applied at several points on the foot. The force
component of the wrench is subject to Coulomb's friction constraint as above,
while the moment is constrained by
%
\begin{equation}\label{eq.moment_constraint}
\forceC^n_i \ubar{\moment}_i \le \moment[i]_i \le \forceC^n_i \bar{\moment}_i
,
\quad
\mbox{or}
\quad
\forceC^n_i \ubar{\moment}_i \le \M[][i]{R} \moment_i \le \forceC^n_i \bar{\moment}_i
\end{equation}
%
where $\ubar{\moment}_i$ and $\bar{\moment}_i$ are constant vectors derived in
\cref{sec.rectangular_foot}, $\M[][i]{R}$ transforms the moment to the local
frame of $i$-th contact. This constraint is linear with respect to
$\V{\lambda}_i$ and $\moment_i$ and in the following is stated as
%
\begin{equation}\label{eq.moment_constraint2}
\objA_{\moment,i}
\begin{bmatrix}
\V{\lambda}_i\\
\moment_i
\end{bmatrix}
\ge
\ubarV{\objb}_{\moment,i}.
\end{equation}
%
When a foot contact is represented by three or
more contact points, the orientation of the foot is fixed. In order to prevent
rotation of the foot, when the foot contact is represented by a single point
$\contact_i$, it is necessary to fix angular acceleration with the constraint
%
\begin{equation}\label{eq.no_contact_rotation}
\dcontactW_i = \JcontactWi \ddq + \dJcontactWi \dq = \V{0}.
\end{equation}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Whole body model with linear constraints}\label{sec.linear_wbm}
Substitution of the constraints obtained in
\cref{sec.wbm_constraints,sec.contact_constraints} into the complementarity
system \cref{eq.complementarity_system} results in the whole body model with
linear constraints
%
\begin{model}{WB}{Whole Body}
\begin{subequations}\label{eq.linearized_system}
\begin{empheq}[left=\empheqlbrace]{align}
& \M{H} \ddq + \V{h} = \Itorques\torques + m\T{\Jcom} \V{g} + \sum_{i=1}^M \T{\M{J}_i} \wrench_i
,
\\
&
\begin{bmatrix}
\ddcontact_i \\
\dcontactW_i
\end{bmatrix}
=
\begin{bmatrix}
\Jcontacti \\
\JcontactWi
\end{bmatrix}
\ddq
+
\begin{bmatrix}
\dJcontacti \dq \\
\dJcontactWi \dq
\end{bmatrix}
=
\M{J}_i
\ddq
+
\dotM{J}_i
\dq
=
\V{0}
,
\label{eq.linearized_system.fixedcontact}
\\
& \ubar{\torques} \le \torques \le \bar{\torques}
,
\label{eq.linearized_system.ctrtorques}
\\
& \ubar{\ddq}^{\prime} \le \ddqn \le \bar{\ddq}^{\prime}
,
\label{eq.linearized_system.ctrq}
\\
&
\objA_{\moment,i}
\begin{bmatrix}
\V{\lambda}_i\\
\moment_i
\end{bmatrix}
\ge
\ubarV{\objb}_{\moment,i}
\label{eq.linearized_system.moments}
,
\\
&
\V{\lambda}_i \ge \V{0}
,
\label{eq.linearized_system.friction}
\end{empheq}
\end{subequations}
\end{model}
%
where $\wrench_i = (\force_i, \moment_i) = (\M{V}_i\V{\lambda}_i, \moment_i)$,
$\M{J}_i$ is the contact point Jacobian including both translational and
rotational parts. Dependence of $\M{H}$, $\V{h}$, $\ubar{\ddq}^{\prime}$,
$\bar{\ddq}^{\prime}$, and Jacobians on $\q$ and $\dq$ is omitted for brevity.
Equation \cref{eq.linearized_system.fixedcontact} incorporates constraints
\cref{eq.no_tangential_acc}, \cref{eq.no_normal_acc}, and
\cref{eq.no_contact_rotation}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Controlling the robot}\label{sec.wbm_control}
The primary interest of our modeling effort is to allow control of a humanoid
robot using its model. It turns out, that we have already introduced elements
of control in \nameref{model.WB} model by adding constraint
%
\begin{equation}\label{eq.fixed_position}
\ddcontact_i = \Jcontacti \ddq + \dJcontacti \dq = \V{0}
\end{equation}
%
in order to support \cref{ass.nosliding,ass.no_break_contacts}. This constraint
is clearly not physical, but rather dictated by our control goals. It falls
within the framework of \tn{operational space control} \cite{Khatib1987jra} or
more general \tn{task function control approach}
\cite[Chapter~3]{Samson1991robot}, both of which focus on control of the
end-effectors of the robot rather than its joints. Hence, we call
\cref{eq.fixed_position} a \tn{task}, whose purpose is to maintain constant
position of the end-effector corresponding to the contact point. In a similar
way we define tasks for other parts of the robot's body
%
\begin{equation}
\M{J}_{\!\MT{ee}}\ddq + \dotM{J}_{\!\MT{ee}} \dq = \ddotV{y}^{\DES}_{\!\MT{ee}},
\end{equation}
%
where $\M{J}_{\!\MT{ee}}$ and $\ddotV{y}^{\DES}_{\!\MT{ee}}$ are the Jacobian
and the desired acceleration of a certain end-effector.
$\ddotV{y}^{\DES}_{\!\MT{ee}}$ can be obtained with a simple
\acs{PD}-controller such as
%
\begin{equation}
\ddotV{y}^{\DES}_{\!\MT{ee}}
=
\K_{p,\MT{ee}} (\V{y}^{\DES}_{\!\MT{ee}} - \V{y}_{\!\MT{ee}})
-
\K_{d,\MT{ee}} \dotV{y}_{\!\MT{ee}},
\end{equation}
%
which drives the end-effector to the desired position
$\V{y}^{\DES}_{\!\MT{ee}}$ given current position $\V{y}$ and velocity
$\dotV{y}$, and positive scalar gains $\K_{p,\MT{ee}}$, $\K_{d,\MT{ee}}$.
Examples of various end-effector tasks for humanoid robots can be found in
\cite[Chapter~4]{Kanoun2009thesis}.
Tasks, however, are not limited to control of the end-effectors. For example,
the joint-level task
%
\begin{equation}
\ddqn = \K_{p,\qn} (\qn[\DES] - \qn) - \K_{d,\qn} \dqn
\end{equation}
%
employs a \acs{PD}-controller to maintain the desired joint configuration
$\qn[\DES]$. Furthermore, tasks can also be posed as inequalities
\cite[Chapter~3]{Kanoun2009thesis}
%
\begin{equation}
\ubar{\ddotV{y}}_{\!\MT{ee}}
\le
\M{J}_{\!\MT{ee}}\ddq + \dotM{J}_{\!\MT{ee}} \dq
\le
\bar{\ddotV{y}}_{\!\MT{ee}}.
\end{equation}
%
Thus, we conclude that the difference between tasks and constraints in the
model is only a matter of interpretation: as we are going to see in
\cref{ch.optimization}, the only important thing for numerical computations is
prioritization of the constraints or tasks with respect to each other. Hence,
in the following we use terms ``task'' and ``constraint'' interchangeably.
All whole body motion controllers employed in this work include tasks for
control of motion of the \ac{CoM} and orientation of the body, which are
related to linear and angular momenta respectively. Both are important for
balance preservation: in order to stop the robot it is necessary to nullify its
momenta. Furthermore, control over vertical motion of the \ac{CoM} helps to
prevent falls, which cannot be prevented by the constraints in
\nameref{model.WB} model. The desired values for momenta are obtained by
anticipating the motion of the robot with approximate linear models described
later in this chapter.
While controlling the robot using the task function approach, we may encounter
several types of problems. The first problem arises when imposed tasks do not
require all degrees of freedom of the system. This implies that the robot is
\tn{redundant} with respect to the tasks and there is an infinite number of
control inputs that achieve our goals \cite[Chapter~4]{Samson1991robot}. We can
easily alleviate this issue by adding tasks, which, however, increase the
chance of triggering the second problem: a \tn{conflict} of the tasks with each
other and the physical constraints. Both redundancy and conflicts are important
subjects of this thesis and are discussed in \cref{ch.optimization}. Another
important question is dealing with online addition, removal, or transformation
of the tasks, which is not considered here \cite{Lee2012tro}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Nonlinear approximate models}\label{sec.nonlinear_approx_models}
The whole body (\nameref{model.WB}) model reviewed in
\cref{sec.whole_body_model} allows for the control of the robot, but it varies
nonlinearly with the state of the system and is rather complicated. We have
already indicated in \cref{sec.balance_general}, that such complexity is not
always needed when online motion anticipation is performed. In this case it is
common to employ approximate models, which are derived from the complete model
under certain assumptions. In the present section we consider two approximate
nonlinear models, which we do not employ \tn{per se}, but use them later in
\cref{sec.linear_approx_models} for the construction of linear models.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Nonlinear momenta-based model}\label{sec.momenta_based_nonlinear}
First, let us consider the friction constraints
\cref{eq.linearized_system.moments}, \cref{eq.linearized_system.friction} in
\nameref{model.WB} model. It is interesting to observe that they primarily
limit the aggregate motion of the robot, \IE, the rate of its spatial momentum.
That is, as long as the rate of momentum complies with these constraints, the
joint motion can be arbitrary, provided that the motors can produce sufficient
torques and joint limits are satisfied. We demonstrate this by rewriting the
equation of dynamics using derivations from \cref{app.dynamics} as
%
\begin{equation}
\underbrace{
\begin{bmatrix}
\M{H}_1\\
\M{H}_2\\
\M{H}_3\\
\end{bmatrix}
}_{\M{H}}
\underbrace{
\begin{bmatrix}
\ddqn\\
\ddotV{r}\\
\ddotV{\EULER}
\end{bmatrix}
}_{\ddq}
+
\underbrace{
\begin{bmatrix}
\V{h}_1\\
\V{h}_2\\
\V{h}_3
\end{bmatrix}
}_{\V{h}}
=
\begin{bmatrix}
\torques\\
\V{0}\\
\V{0}
\end{bmatrix}
+
m
\underbrace{
\begin{bmatrix}
\T{\Jcom[,1]}\\
\T{\Jcom[,2]}\\
\T{\Jcom[,3]}
\end{bmatrix}
}_{\T{\Jcom}}
\V{g}
+
\sum_{i=1}^M
\underbrace{
\begin{bmatrix}
\T{\M{J}_{i,1}}\\
\T{\M{J}_{i,2}}\\
\T{\M{J}_{i,3}}
\end{bmatrix}
}_{\T{{\M{J}}_i}}
\wrench_i,
\end{equation}
%
and use the first line of this equation to eliminate $\torques$ from
\nameref{model.WB} model to obtain
%
\begin{subequations}\label{eq.eliminated_torques}
\begin{empheq}[left=\empheqlbrace]{align}
& \begin{bmatrix}
\M{I} & \M{0} \\
\M{0} & \T{\Teuler}\\
\end{bmatrix}
\begin{bmatrix}
\dotV[r]{\LM} \\
\dotV[r]{\AM}\\
\end{bmatrix}
=
\begin{bmatrix}
\M{H}_2\\
\M{H}_3\\
\end{bmatrix}
\ddq
+
\begin{bmatrix}
\V{h}_2\\
\V{h}_3
\end{bmatrix}
=
m
\begin{bmatrix}
\T{\Jcom[,2]}\\
\T{\Jcom[,3]}
\end{bmatrix}
\V{g}
+
\sum_{i=1}^M
\begin{bmatrix}
\T{\M{J}_{i,2}}\\
\T{\M{J}_{i,3}}
\end{bmatrix}
\begin{bmatrix}
\force_i\\
\moment_i
\end{bmatrix},
,
\\
& \begin{bmatrix}
\ddcontact_i \\
\dcontactW_i
\end{bmatrix}
=
\M{J}_i
\ddq
+
\dotM{J}_i
\dq
=
\V{0}
,
\label{eq.eliminated_torques.fixedcontact}
\\
&
\force_i
=
\M{V}_i
\V{\lambda}_i
,
\\
& \ubar{\torques}
\le
\M{H}_1 \ddq + \V{h}_1 - m \T{\Jcom[,1]} \V{g} - \sum_{i=1}^M \T{\M{J}_{i,1}}
\begin{bmatrix}
\force_i\\
\moment_i
\end{bmatrix}
\le
\bar{\torques}
,
\label{eq.eliminated_torques.ctrtorques}
\\
& \ubar{\ddq}^{\prime} \le \ddqn \le \bar{\ddq}^{\prime}
,
\label{eq.eliminated_torques.ctrq}
\\
&
\objA_{\moment,i}
\begin{bmatrix}
\V{\lambda}_i\\
\moment_i
\end{bmatrix}
\ge
\ubarV{\objb}_{\moment,i}
,
\\
& \V{\lambda}_i \ge \V{0},
\label{eq.eliminated_torques.friction}
\end{empheq}
\end{subequations}
%
where $\dotV[r]{\LM}$ and $\dotV[r]{\AM}$ are rates of linear and angular
momenta respectively, and $\Teuler$ transforms derivatives of the Euler angles
to angular velocities (see \cref{sec.jacobians}). Assuming that
%
\begin{description}
\item[\ass{ass.nojointctr}] constraints of the joints and motors
\cref{eq.eliminated_torques.ctrtorques},
\cref{eq.eliminated_torques.ctrq}, and contact preservation task
\cref{eq.eliminated_torques.fixedcontact} are always satisfied,
\end{description}
%
we neglect the structure of the robot and focus on its momenta and contact
forces. Both the contact forces and momenta are crucial for ensuring balance in
motion anticipation: control over the former allows to avoid tipping and
slipping, over the latter -- to stop motion of the robot as indicated in
\cref{sec.wbm_control}. Under \cref{ass.nojointctr} the model boils down to
constrained Newton-Euler equations for a rigid body (see also
\cref{app.dynamics})
%
\begin{model}{NMB}{Nonlinear Momenta-Based}
\begin{subequations}\label{eq.simplified_system}
\begin{empheq}[left=\empheqlbrace]{align}
& \begin{bmatrix}
\dotV[r]{\LM} \\
\dotV[r]{\AM}\\
\end{bmatrix}
=
m
\begin{bmatrix}
\M{I} \\
\CROSS[(\V{c} - \V{r})]
\end{bmatrix}
\V{g}
+
\sum_{i=1}^M
\begin{bmatrix}
\M{I} & \M{0}\\
\CROSS[(\contact_i - \V{r})] & \M{I}
\end{bmatrix}
\begin{bmatrix}
\force_i\\
\moment_i
\end{bmatrix},
\label{eq.simplified_system.dynamics}\\
& \force_i = \M{V}_i \V{\lambda}_i,
\\
&
\objA_{\moment,i}
\begin{bmatrix}
\V{\lambda}_i\\
\moment_i
\end{bmatrix}
\ge
\ubarV{\objb}_{\moment,i}
,
\\
& \V{\lambda}_i \ge \V{0},
\label{eq.simplified_system.friction}\\
& \mbox{proxy constraints}.
\label{eq.simplified_system.fixedcontact}
\end{empheq}
\end{subequations}
\end{model}
%
Here, the term \tn{proxy constraints} is used as in
\cite[Chapter~3]{Zaytsev2015thesis} and denotes constraints, which allow to
take into account \cref{eq.eliminated_torques.ctrtorques},
\cref{eq.eliminated_torques.ctrq}, and
\cref{eq.eliminated_torques.fixedcontact} indirectly through the variables
still present in \nameref{model.NMB} model. For example, one may choose to
reflect kinematic limits of the robot by constraining distance between \ac{CoM}
$\V{c}$ and contact points $\contact_i$. Proxy constraints are typically rough
approximations, but are often necessary to support \cref{ass.nojointctr}.
Equation \cref{eq.simplified_system.dynamics} has several properties, which
are important to mention:
%
\begin{itemize}
\item It is more convenient to work with Newton-Euler equation when the
base position coincides with the \ac{CoM} $\V{c} = \V{r}$ resulting in
%
\begin{equation}
\begin{bmatrix}
\dotV[c]{\LM} \\
\dotV[c]{\AM}\\
\end{bmatrix}
=
\begin{bmatrix}
m\V{g}\\
\V{0}
\end{bmatrix}
+
\sum_{i=1}^M
\begin{bmatrix}
\M{I} & \M{0}\\
\CROSS[(\contact_i - \V{c})] & \M{I}
\end{bmatrix}
\begin{bmatrix}
\force_i\\
\moment_i
\end{bmatrix}.
\end{equation}
%
\item Another important property of \cref{eq.simplified_system.dynamics} is
nonholonomy of its lower part corresponding to the rate of angular
momentum \cite{Wieber2006fastmotions}. This means that
\cref{eq.simplified_system.dynamics} constrains rotational motion of
the system, but not its orientation. The best known illustration of
this fact is a falling cat (see \cref{fig.falling_cat}), which changes
its orientation in mid-air without using any contacts with the
environment to finally land on its paws. Since there is no clear
connection between orientation of the robot and its angular momentum,
it is also unclear what are the desired values for angular momentum. It
is presumed that the angular momentum should be kept small, but not
equal to zero \cite{Wieber2006fastmotions}. In the present work, we
constrain the angular momentum by including it in a capturability
constraint (see \cref{sec.momenta_model_capturability}). Though not
necessary in our simulations, it is also reasonable to bound it.
%
\begin{figure}[ht]
\centering{%
\includegraphics{Falling_cat_1894.eps}}
\caption[Cat is changing its orientation during a fall to land on its paws.]{
Cat changes its orientation while falling even though its
angular momentum is initially zero and conserved during a fall.
Snapshots of a short film recorded by \'Etienne-Jules Marey in
1894 \cite{FallingCat}.
}
\label{fig.falling_cat}
\end{figure}
\end{itemize}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Nonlinear point-mass model}\label{sec.point_mass_nonlinear}
In order to construct this model we introduce additional assumptions. Also, we
facilitate derivations by manipulating the position and orientation of the
global frame. In practice, however, it may be more convenient to utilize models
in convenient working frames and transform data to the global frame when
necessary. In many cases it is beneficial to choose the orientation of the
global (working) frame so that
%
\begin{description}
\item[\ass{ass.gravity_z_aligned}] its $z$ axis is parallel to the gravity
vector $\V{g}$, \IE, $\V{g}^{xy} = \V{0}$.
\end{description}
%
Also, we simplify derivations by taking the orientation of $\FRAME{c}$ to be
the same as the orientation of the global (working) frame, \IE, $\V{\LM} =
\V[c]{\LM}$ and $\dotV{\LM} = \dotV[c]{\LM}$.
The characteristic feature of the point-mass model is the absence of angular
momentum $\V[c]{\AM} = \V{0}$, since all the mass of the robot is concentrated
in a point. Note that in spite of the popularity of such point-mass
approximations, it is not strictly necessary to neglect angular momentum to
construct a linear model.
We start with \nameref{model.NMB} model, but this time we express it with
respect to the global (working) frame
%
\begin{subequations}\label{eq.simplified_system1}
\begin{empheq}[left=\empheqlbrace]{align}
&
\begin{bmatrix}
\dotV{\LM} \\
\dotV{\AM}
\end{bmatrix}
=
\begin{bmatrix}
\dotV[c]{\LM} \\