RobDyn
RobDyn
"ξ # "ξ #
0
ξ1 ξ0 −ξ3 ξ2 ξ1 2.6 Multi-task IDK
ξAB ⊗ ξBC = ξ2 ξ3 ξ0 −ξ1 ξ2
ξ3 −ξ2
ξ1 ξ0 AB ξ3 BC Given nt tasks {Ji , w∗i }, we have:
0 0 −1
Robot Dynamics HS18 Ar
= ξAB ⊗ Br
⊗ ξAB J + w∗
1 1
q̇ = .. ..
. .∗
Sean Bone 1.3 Angular Velocity Jnt wn
t
http://weblog.zumguy.com/ 0 −ωz ωy
In case the row-rank of the stacked Jacobian is
[ A ωAB ]× = ωz 0 −ωx = ĊAB CT
AB
−ωy ωx 0 greater that the column-rank, we are only mini-
January 30, 2019 mizing ||w̄ − J¯q̇||2 . We can weigh the tasks with
A ω AB = ER (χR ) χ̇R
¯ −1 JW
J¯+W = (J¯T W J) ¯
1.4 Transformations
h
CAB A r AB
i where W = diag(w1 , ..., wm ) and we minimize
A r AP B r BP
1 = 01×3 1 1 ||W 1/2 (w̄ − J¯q̇)||2 .
0
(sin(x)) = − cos(x) | {z }
(cos(x))0 = sin(x) TAB
r BA
Task Prioritization
z B }|
T−1
{
= CT −CT
AB A r AB
1 Parametrizations AB AB q̇ = J1+ w∗1 + N1 q̇0
01×3 1
w2 = J2 q̇ = J2 (J1+ w∗1 + N1 q̇0 )
1.1 Position and velocity
2 Kinematics ⇒ q˙0 = (J2 N1 )+ (w∗2 − J2 J1+ w∗1 )
For every position parametrization, there is a
linear mapping between linear velocities ṙ and ⇒ q̇ = J1+ w∗1 + N1 (J2 N1 )+ (w∗2 − J2 J1+ w∗1 )
2.1 Velocity in rigid bodies
derivatives of the representation χ̇.
In general:
ṙ = EP (χP ) χ̇P , χ̇P = EP (χP )−1 ṙ • v P : abs. velocity of P
• aP : abs. acceleration of P nt
X
Cartesian Coordinates: EPc = I • ΩB = I ω B : angular vel. of frame B q̇ = N̄i q̇i
χPc = [x y z]T , A r = [x y z]T • ΨB = Ω̇B : angular accel. of frame B i=1
Cylindrical coordinates: i−1
!
X
χPz = [ρ θ z]T , q̇i = (Ji N̄i ) +
w∗i − Ji N̄k q̇k
T A v AP = A (ṙAP ) = A v AB + A ω AB × A r BP
A r = [ρcos θ ρ sin θ z]
k=1
cos θ −ρ sin θ 0 In general, unless C is an inertial frame:
EPz = sin θ −ρ cos θ 0 d 2.7 Inverse Kinematics
0 0 1 C v AP = C (ṙAP ) 6= dt (C r AP )
−1 cos θ sin θ 0 In r igid body formulation: 1. q ← q0
EP = − sin θ/ρ cos θ/ρ 0
z
0 0 1 v P = v B + Ω × r BP 2. While ||χ∗e χe (q)|| > tol do
Spherical coordinates: aP = aB + Ψ × r BP + Ω × (Ω × r BP ) 3. JA ← JA (q) = ∂χ∂q
e
(q)
χPs = [r θ φ]T , 4. +
JA ← (JA )+
Ar = [r cos θ sin φ r sin θ cos φ z]T In a kinematic chain: 5. ∆χe ← χ∗e χe (q)
cos θ sin φ −r sin φ sin θ r cos φ cos θ
I v IE = I ω I1 × I r 12 + ... + I ω In × I r nE
+
sin φ sin θ r cos θ sin φ r cos φ sin θ 6. q ← q + JA ∆χe
−r sin φ
cos φ
cos θ sin φ
0
sin φ sin θ cos φ
I ω IE = I ω I1 + I ω 12 + ... + I ω nE
One issue is that for very large errors ∆χe , we
− sin θ/(r sin φ) cos θ/(r sin φ) 0 get too imprecise. We can avoid this by scal-
(cos φ cos θ)/r (cos φ sin θ)/r − sin φ/r
2.2 Forward kinematics ing the update with a factor 0 < k < 1: q ←
+
nj ! q + kJA ∆χe . But we still have issues inverting
1.2 Rotation Y JA in singular configurations. An alternative is
TIE (q) = TI0 Tk−1,k (qk ) Tnj E T ∆χ , which converges for small α.
y
atan2(y, x) := atan( x ), checking for correct quad- q ← q + αJA e
k=1
rant. We must also appropriately compute the differ-
ence χ∗e χe (q) depending on the parametriza-
A u = CAC · C u = CAB CBC · C u 2.3 Analytical Jacobian tion. For cartiesian coordinates, this is regular
CBA = C−1 AB = CAB
T
" ∂χ
pos
# vector subtraction. Also note that with cartesian
Elementary rotations: ∂χ
1 0 0
χ̇(q) = q̇ = JA (q) · q̇ = ∂q q̇ coordinates J0,P = JA,P . For rotational differ-
∂χrot
Cx = 0 cos ϕ − sin ϕ ∂q ∂q ence we can extract the rotation vector ∆ϕ from
0 sin ϕ cos ϕ
the ”rotation difference”, and use that for the up-
cos ϕ 0 sin ϕ
Cy = 0 1 0 date:
2.4 Geometric Jacobian
− sin ϕ 0 cos ϕ CGS (∆ϕ) = CGI (ϕ∗ )CSI (ϕt )
cos ϕ − sin ϕ 0
Cz = sin ϕ cos ϕ 0 vE
wE = = J0 (q)q̇ +
0 0 1 ωE q ← q + kpR J0,R ∆ϕ
Euler ZYZ (proper) angles:
atan2(c23 ,c13 )
!
J n1 × r1,E ... nn × rn,E 2.8 Trajectory control
J0 (q) = 0,P =
q
χR,ZY Z = atan2( c2 2
13 +c23 ,c33 ) J0,R n1 ... nn
atan2(c32 ,−c31 ) Position: with ∆rte = r∗e (t) − re (qt )
Euler ZXZ (proper) angles:
atan2(c13 ,−c23 )
q
! 2.5 Inverse differential kinematics q̇∗ = Je0P
+
(qt )(ṙ∗e (t) + kpP ∆rte )
χR,ZXZ = atan2( c2 2
13 +c23 ,c33 )
atan2(c31 ,c32 )
wE = J q̇ ⇒ q̇ = J + wE Orientation: with ∆ϕ as above,
Euler ZYX (Tait-Bryan) angles: where J+
= J T (JJ T )−1
(Moore-Penrose). How- q̇∗ = Je0R
+
(qt )(ωe∗ (t) + kpR ∆ϕ)
atan2(c21 ,c11 )
!
q ever we risk encountering singular configurations
χR,ZY X = atan2(−c31 , c2 2
32 +c33 )
qs where rank(J(qs )) < m0 , m0 being the num- 3 Dynamics
atan2(c32 ,c33 )
Euler XYZ (Cardan) angles: ber of operational-space coordinates. Here J is
atan2(−c23 ,c33 )
! badly conditioned. We can mitigate this by using
q
a redundant robot to carefully avoid singularities, M(q)q̈ + b(q, q̇) + g(q) = τ + Jc (q)T Fc
χR,XY Z = atan2(c13 , c2 2
11 +c12 )
and/or by damping the pseudo-inverse:
atan2(c12 ,−c11 ) • M(q) ∈ Rnq ×nq Mass matrix (⊥).
Angle-axis:
T
q̇ = J (JJ T
+ λ I)2 −1
wE • q, q̇, q̈ ∈ Rnq Gen. pos., vel., accel.
1 c32 −c23
b(q, q̇) ∈ Rnq Coriolis and centrifugal terms
χR,AA = n θ
, n= · c31 −c13 , •
2 sin(θ) c21 −c12
Now the pseudo-inverse minimizes ||w∗E − J q̇||2 + • g(q) ∈ Rnq Gravity terms
c11 + c22 + c33 − 1 λ2 ||q̇||2 instead of just ||w∗E − J q̇||2 , so conver- • τ ∈ Rnq External generalized forces
θ = acos( ), ϕ = θ · n • Fc ∈ R3×nc External cartesian forces
2 gence is slower but more stable for larger λ.
• Jc (q) ∈ Rnc ×nq Geometric Jacobian of loca-
In a redundant configuration q ∗ where
Unit Quaternions: tion where external forces apply
ξ ξ rank(J(q∗ )) < n, the pseudoinverse minimizes
χR,quat = ξ = ξ̌ , ξ−1 = − ξ̌ ||q̇||2 while satisfying w∗E = J q̇ by using
vs J
ξ0 = cos(θ/2), ξ̌ =√n · sin(θ/2) = P q̇
Ω JR
J(J + w∗E + N q̇0 ) = w∗E ∀q̇0
c11 +c22 +c33 +1
√
1 sgn(c32 −c23 )√c11 −c22 −c33 +1 J˙
χR,quat = as v̇s JP
2 sgn(c13 −c31 ) c22 −c11 −c33 +1
√ where N = I − J + J. = = q̈ + ˙P q̇
sgn(c21 −c12 ) c33 −c11 −c22 +1 Ψ Ω̇ JR JR
Newton-Euler method • Fext ∈ R3×nc External cartesian forces acting Inverse dynamics control
on robot
• m body mass Compensate for system dynamics:
• Jext (q) ∈ Rnc ×nu Geometric Jacobian of loca-
• ΘS inertia matrix around CoG
tion where external forces apply τ = M̂(q)q̈∗ + b̂(q, q̇) + ĝ(q)
• pS = mvS linear momentum
• NS = ΘS · Ω angular momentum around CoG Position and velocity of a point Q on the robot: If the model is exact, we have Iq̈ = q̈∗ , mean-
• ṗ = maS change in linear momentum ing we can perfectly control system dynamics. We
• ṄS = ΘS · Ψ + Ω × ΘS · Ω change in angular I r IQ (q) = I r IB (q) + CIB (q) · B r BQ (q) could apply a PD-control law, making each joint
momentum behave like a mass-spring-damper with unitary
I3×3 −CIB ·[B r BQ ]× CIB ·B J Pq (qj )·u
I vQ = j
| {z } mass:
=I J Q (q)
Cut each link free as a single rigid body, and in- q̈∗ = kp (q∗ − q) + kd (q̇∗ − q̇)
troduce constraint forces Fi acting on the body
at the joint. Then apply conservation of linear Contact kinematics p
ω = kp , D = p
kd
and angular momentum in all DoFs subject to all The point of contant C is not allowed to move: 2 kp
external forces (including contraints Fi ): rC = const. and ṙC = r̈C = 0. Written in gener-
alized coordinates these are: Operational space control
ṗS = Fext,S
˙ Generalized framework to control motion and
ṄS = Text I J Ci u = 0, I J Ci u̇ + I J Ci u = 0
force. End-effector dynamics:
We can therefore stack the constraint Jacobians:
For calculations all quantities must be in the Λẇe + µ + p = Fe
same coordinate system. For the inertia matrix I J C1
we have B Θ = CBA · A Θ · CT . Λ = (Je M−1 JT
e)
−1
BA . Jc = .. ∈ R3nc ×(nb +nj )
µ = ΛJe M−1 b − ΛJ̇e q̇
Lagrange method I J Cnc
p = ΛJe M−1 g
Define the Lagrangian function: By using the nullspace projection Nc of Jc we
can still move the system: τ = JT
e Fe
6 Rotorcraft FM =
Ideal power to hover
<1
Actual power to hover
Propeller thrust and drag proportional to squared
rotational speed (b: thrust constant; d: drag con- Blade Elemental and Momentum Theory
stant): (BEMT): blade shape determines drag and lift co-
2 2
Ti = bωp,i , Qi = dωp,i efficients cD , cL .
Representation of rotation
Use Tait-Bryan angles, consisting of yaw ψ (Z-
axis), pitch θ (Y-axis) and roll φ (X-axis).
CEB = CE1 (z, ψ) · C12 (y, θ) · C2B (x, φ)
Angular velocity:
B ω pitch = CT
2B (0, θ̇, 0)
T
Body Dynamics
Change of momentum and spin in the body frame
(M = total moment/torque):
mE 0 B v̇ ω × m Bv F
+ B = B
0 I B ω̇ Bω × I Bω BM
BF = B F G + B F Aero
BM = B M Aero
0
BF G = CTEB
0
mg
X4 0
B F Aero = 0
2
i=1 −Ti = −bωp,i
l(T4 − T2 ) 0
B M Aero = B M T + B Q = l(T1 − T3 ) + P 0
4 (i−1)
0 i=1 Qi (−1)