Dynamics & Non-holonomic Systems1D point mass, damping & oscillation, PID, general dynamic systems, Newton-Euler, joint space control, reference trajectory following, optimal operational
Trang 1Dynamics & Non-holonomic Systems
1D point mass, damping & oscillation, PID, general dynamic systems, Newton-Euler, joint space control, reference trajectory following, optimal operational space control, car system equation, path-finding for non-holonomic systems, control-based sampling, Dubins
curves
Marc Toussaint
Trang 2• So far we always assumed we could arbitrarily set the next robot state qt+1(or
an arbitrary velocity ˙qt) What if we can’t?
• Examples:
– An air plane flying: You cannot command it to hold still in the air, or to movestraight up
– A car: you cannot command it to move side-wards
– Your arm: you cannot command it to throw a ball with arbitrary speed (forcelimits)
– A torque controlled robot: You cannot command it to instantly change velocity(infinite acceleration/torque)
• What all examples have in comment:
– One can setcontrols ut(air plane’s control stick, car’s steering wheel, yourmuscles activations, torque/voltage/current send to a robot’s motors)
– But these controls only indirectly influence thedynamics of state,
xt+1= f (xt, ut)
Trang 3• The dynamics of a system describes how the controls utinfluence the
change-of-state of the system
xt+1 = f (xt, ut)
– The notation xtrefers to the dynamic state of the system: e.g., joint
positions and velocities xt= (qt, ˙qt)
– f is an arbitrary function, often smooth
constraints:
dim(ut) < dim(xt)
⇒ Not all degrees of freedom are directly controllable
Trang 4– f is an arbitrary function, often smooth
• We define a nonholonomic system as one with differential
constraints:
dim(ut) < dim(xt)
⇒ Not all degrees of freedom are directly controllable
Trang 5• We discuss three basic examples:
– 1D point mass
– A general dynamic robot
– A non-holonomic car model
• We discuss how previous methods can be extended to the
dynamic/non-holonomic case:
– inverse kinematics control → optimal operational space control
– trajectory optimization → trajectory optimization
– RRTs → RRTs with special tricks
Trang 6The dynamics of a 1D point mass
• Start with simplest possible example: 1D point mass
(no gravity, no friction, just a single mass)
• State x(t) = (q(t), ˙q(t)) is described by:
– position q(t) ∈ R
– velocity ˙q(t) ∈ R
• The controls u(t) is the force we apply on the mass point
• The system dynamics is:
¨q(t) = u(t)/m
Trang 71D point mass – proportional feedback
• Assume current position is q
The goal is to move it to the position q∗
What can we do?
“Always pull the mass towards the goal q :”
u = Kp(q∗− q)
Trang 81D point mass – proportional feedback
• Assume current position is q
The goal is to move it to the position q∗
What can we do?
• IDEA 1
“Always pull the mass towards the goal q∗:”
u = Kp(q∗− q)
Trang 91D point mass – proportional feedback
• What’s the effect of IDEA 1?
m ¨q = u = Kp(q∗− q)
q = q(t)is a function of time, this is a second order differential equation
(an “non-imaginary” alternative would be q(t) = a + b cos(ωt))
m b ω2eωt = Kpq∗− Kpa − Kpb eωt(m b ω2+ Kpb) eωt = Kp(q∗− a)
Trang 101D point mass – proportional feedback
• What’s the effect of IDEA 1?
Trang 11• What’s the effect of IDEA 1?
Trang 121D point mass – proportional feedback
0 0.5 1
0 2 4 6 8 10 12 14
cos(x)
Trang 13• That didn’t solve the problem!
• IDEA 2
“Pull less, when we’re heading the right direction already:”
“Damp the system:”
u = Kp(q∗− q) + Kd( ˙q∗− ˙q)
˙
q∗is a desired goal velocity
For simplicity we set ˙q∗= 0in the following
Trang 141D point mass – derivative feedback
• What’s the effect of IDEA 2?
m¨q = u = Kp(q∗− q) + Kd(0 − ˙q)
• Solution: again assume q(t) = a + beωt
m b ω2eωt= Kpq∗− Kpa − Kpb eωt− Kdb ωeωt(m b ω2+ Kdb ω + Kpb) eωt= Kp (q∗− a)
⇒ (m ω2+ Kd ω + Kp) = 0 ∧ (q∗− a) = 0
⇒ ω =−Kd±pK2
d− 4mKp2m
q(t) = q∗+ b eω t
The term −Kd
2min ω is real ↔ exponential decay (damping)
Trang 15q(t) = q∗+ b eω t, ω = −Kd±
√
K 2
d −4mK p 2m
• Effect of the second termpK2− 4mKp/2min ω:
K2< 4mKp ⇒ ωhas imaginary part
oscillating with frequencypKp/m − K2/4m2q(t) = q∗+ be−Kd /2m tei
d = 4mKp ⇒ second term zero
only exponential decay
Trang 161D point mass – derivative feedback
illustration from O Brock’s lecture
Trang 181D point mass – integral feedback
• IDEA 3
“Pull if the position error accumulated large in the past:”
u = Kp(q∗− q) + Kd( ˙q∗− ˙q) + Ki
Z t s=0(q∗(s) − q(s)) ds
• This is not a linear control law (not linear w.r.t (q, ˙q))
Analytically solving the euqation is hard!
(no explicit discussion here)
Trang 19u = Kp(q∗− q) + Kd( ˙q∗− ˙q) + Ki
Z t s=0(q∗− q(s)) ds
Trang 20Controlling a 1D point mass – lessons learnt
• Proportional and derivative feedback (PD control) are like adding aspring and damper to the point mass
• PD control is a linear control law
π : (q, ˙q) 7→ u = Kp(q∗− q) + Kd( ˙q∗− ˙q)
(linear in the dynamic system state x = (q, ˙q))
• With such linear control laws we can design approach trajectories (bytuning the gains)
– but no optimality principle behind such motions yet
Trang 21• The point mass is a basic example for a non-holonomic system:
– The state is x = (q, ˙q) ∈ R2
– The control u ∈ R is the force
– The dynamics are
˙q
˙q
Trang 22General robot system dynamics
• State x = (q, ˙q) ∈ R2n
– joint positions q ∈ Rn
– joint velocities ˙q ∈ Rn
• Controls u ∈ Rnare the torques generated in each motor
• The system dynamics are:
M (q) ¨q + C(q, ˙q) ˙q + G(q) = u
M (q) ∈ Rn×n is positive definite intertia matrix
(can be inverted → forward simulation of dynamics)C(q, ˙q) ∈ Rn are the centripetal and coriolis forces
G(q) ∈ Rn are the gravitational forces
u are the joint torques
• More compact:
Trang 23Computing M and F
M (q) ¨q + F (q, ˙q) = u
• Recall:
We have an algorithm to compute all positions and orientations given q:
TW →i(q) = TW →ATA→A 0(q)TA 0 →BTB→B 0(q)TB 0 →C TC→C 0(q)TC 0 →i
– linear velocities vi– angular velocities wi– linear accelerations ˙vi– angular accelerations ˙wifor any link i in the robot (via forward propagation; see geometrynotes for details)
Trang 24Computing M and F
M (q) ¨q + F (q, ˙q) = u
• Recall:
We have an algorithm to compute all positions and orientations given q:
TW →i(q) = TW →ATA→A 0(q)TA 0 →BTB→B 0(q)TB 0 →C TC→C 0(q)TC 0 →i
• This can be extended easily to compute also:
– linear velocities vi
– angular velocities wi
– linear accelerations ˙vi
– angular accelerations ˙wi
for any link i in the robot (via forward propagation; see geometry
notes for details)
Trang 25Newton-Euler (roughly)
focussing at the ith link:
• Newton’s equation expresses the force acting at the center of mass
for an accelerated body:
fi= m ˙vi
• Euler’s equation expresses the torque acting on a rigid body given
an angular velocity and angular acceleration:
ui = Iiw + w × Iw˙
• Idea of Newton-Euler algorithm
– Force and torque balance at every link
– Recursion through all links
Trang 26Newton-Euler (roughly)
focussing at the ith link:
• Newton’s equation expresses the force acting at the center of mass
for an accelerated body:
fi= m ˙vi
• Euler’s equation expresses the torque acting on a rigid body given
an angular velocity and angular acceleration:
ui = Iiw + w × Iw˙
• Idea of Newton-Euler algorithm
– Force and torque balance at every link
– Recursion through all links
• Bottom line:
Trang 27Controlling a general robot – joint space approach
• If we know the desired ¨q∗for each joint, the eqn
M (q) ¨q∗+ F (q, ˙q) = u∗gives the desired torques
Assume we have a nice smoothreference trajectory qref0:T (generatedwith some motion profile or alike), we can at each t read off the desiredacceleration as
¨reft := 1
τ[(qt+1− qt)/τ − (qt− qt-1)/τ ] = (qt-1+ qt+1− 2qt)/τ2However, tiny errors in acceleration will accumulate greatly over time!This is Instable!!
• Choose a desired acceleration ¨q∗t that implies a PD-like behavioraround the reference trajectory!
¨∗t = ¨qreft + Kp(qreft − qt) + Kd( ˙qreft − ˙qt)
This is a standard and very convenient heuristic to track a reference trajectorywhen the robot dynamics are known: All joints will exactly behave like a 1Dpoint particle around the reference trajectory!
Trang 28Controlling a general robot – joint space approach
• If we know the desired ¨q∗for each joint, the eqn
M (q) ¨q∗+ F (q, ˙q) = u∗gives the desired torques
• Where could we get the desired ¨q∗from?
Assume we have a nice smoothreference trajectory qref0:T (generated
with some motion profile or alike), we can at each t read off the desired
acceleration as
¨reft := 1
τ[(qt+1− qt)/τ − (qt− qt-1)/τ ] = (qt-1+ qt+1− 2qt)/τ2However, tiny errors in acceleration will accumulate greatly over time!
This is Instable!!
• Choose a desired acceleration ¨qt that implies a PD-like behavioraround the reference trajectory!
¨∗t = ¨qreft + Kp(qreft − qt) + Kd( ˙qreft − ˙qt)
This is a standard and very convenient heuristic to track a reference trajectorywhen the robot dynamics are known: All joints will exactly behave like a 1Dpoint particle around the reference trajectory!
Trang 29• If we know the desired ¨q∗for each joint, the eqn.
M (q) ¨q∗+ F (q, ˙q) = u∗gives the desired torques
• Where could we get the desired ¨q∗from?
Assume we have a nice smoothreference trajectory qref0:T (generatedwith some motion profile or alike), we can at each t read off the desiredacceleration as
¨reft := 1
τ[(qt+1− qt)/τ − (qt− qt-1)/τ ] = (qt-1+ qt+1− 2qt)/τ2However, tiny errors in acceleration will accumulate greatly over time!This is Instable!!
• Choose a desired acceleration ¨qt∗that implies a PD-like behavior
around the reference trajectory!
¨∗t = ¨qreft + Kp(qreft − qt) + Kd( ˙qreft − ˙qt)
Trang 30Controlling a robot – operational space approach
• Recall the inverse kinematics problem:
– We know the desired step δy∗(or velocity ˙y∗) of the endeffector
– Which step δq (or velocities ˙q) should we make in the joints?
• Equivalent dynamic problem:
– We know how the desired acceleration ¨y∗of the endeffector
– What controls u should we apply?
Trang 31• Given current state (qt, ˙qt)and yt= φ(qt), ˙yt= J ˙qt
given desired ¨y∗
compute a torque u such that
2) ¨is close to ¨y∗ ↔ accelerate endeffector
• We translate this to the objective function:
f (u) = ||u||2H+ ||J M-1(u − F ) + ˙J ˙q − ¨y∗||2
C
Trang 32Optimal operational space control
• Optimum: (analogous derivation to kinematic case)
u∗= T](¨y∗− ˙J ˙q + T F )with T = J M-1, T]= (T>CT + H)-1T>C
Trang 33Controlling a robot – operational space approach
• Where could we get the desired ¨y∗from?
–Reference trajectory y0:Tref in operational space!
–PD-like behavior in each operational space:
¨∗t = ¨ytref+ Kp(yreft − yt) + Kd( ˙yreft − ˙yt)
directly “apply 1D point mass behavior” to the endeffector
Trang 34Controlling a robot – operational space approach
• Where could we get the desired ¨y∗from?
–Reference trajectory y0:Tref in operational space!
–PD-like behavior in each operational space:
¨∗t = ¨ytref+ Kp(yreft − yt) + Kd( ˙yreft − ˙yt)
Operational space control: Let the system behave as if we could
Trang 36˙θ
Trang 37“A car cannot move directly lateral!”
For any given state x, let Uxbe the tangent space that is generated by controls:
Ux= { ˙x : ˙x = f (x, u), u ∈ U }(non-holonomic ⇐⇒ dim(Ux) < dim(x))
The elements of Uxare elements of Txsubject to additional differentialconstraints
Trang 38“A car cannot move directly lateral!”
• General definition of a differential constraint:
For any given state x, let Uxbe the tangent space that is generated by controls:
Ux= { ˙x : ˙x = f (x, u), u ∈ U }(non-holonomic ⇐⇒ dim(Ux) < dim(x))
The elements of Uxare elements of Txsubject to additional differential
Trang 39Could a car follow this trajectory?
Trang 40Path finding with a non-holonomic system
This is a solution we would like to have:
The path respectsdifferential constraints.
Trang 41• Control-based sampling: fulfils none of the nice exploration properties
of RRTs – but fulfils the differential constraints:
1) Select a q ∈ T from tree of current configurations
2) Pick control vector u at random
3) Integrate equation of motion over short duration (picked at random
or not)
4) If the motion is collision-free, add the endpoint to the tree
Trang 42Control-based sampling for the car
1) Select a q ∈ T2) Pick v, φ, and τ3) Integrate motion from q4) Add result if collision-free
Trang 43Controllability and Motion Planning in the Presence of Obstacles Algorithmica,
10:121-155, 1993
Trang 44car parking
Trang 46with a trailer
Trang 47• RRTs with differential constraints:
Input: qstart, number k of nodes,time interval τ
Output: tree T = (V, E)
1: initialize V = {qstart}, E = ∅
2: for i = 0 : k do
3: qtarget← random sample from Q
4: qnear←nearestneighbor of qtargetin V
5: use local planner to compute controls u that steer qneartowards
Trang 48Standard/Naive metrics:
• Comparing two 2D rotations/orientations θ1, θ2∈ SO(2):
a) Euclidean metric between eiθ1 and eiθ2
b) d(θ1, θ2) = min{|θ1− θ2|, 2π − |θ1− θ2|}
• Comparing two configurations (x, y, θ)1,2in R2:
Eucledian metric on (x, y, eiθ)
• Comparing two 3D rotations/orientations r1, r2∈ SO(3):
Represent both orientations as unit-length quaternions r1, r2∈ R4:
d(r1, d2) = min{|r1− r2|, |r1+ r2|}
where | · | is the Euclidean metric
(Recall that r1and −r1represent exactly the same rotation.)
• Ideal metric:
Optimal cost-to-go between two states x1and x2:– Use optimal trajectory cost as metric
– This is as hard to compute as the original problem, of course!!
→ Approximate, e.g., by neglecting obstacles
Trang 49Standard/Naive metrics:
• Comparing two 2D rotations/orientations θ1, θ2∈ SO(2):
a) Euclidean metric between eiθ1 and eiθ2
b) d(θ1, θ2) = min{|θ1− θ2|, 2π − |θ1− θ2|}
• Comparing two configurations (x, y, θ)1,2in R2:
Eucledian metric on (x, y, eiθ)
• Comparing two 3D rotations/orientations r1, r2∈ SO(3):
Represent both orientations as unit-length quaternions r1, r2∈ R4:
d(r1, d2) = min{|r1− r2|, |r1+ r2|}
where | · | is the Euclidean metric
(Recall that r1and −r1represent exactly the same rotation.)
• Ideal metric:
Optimal cost-to-go between two states x1and x2:
– Use optimal trajectory cost as metric
Trang 50Dubins curves
• Dubins car: constant velocity, and steer ϕ ∈ [−Φ, Φ]
• Neglecting obstacles, there are only six types of trajectories that
connect any configuration ∈ R2
× S1:{LRL, RLR, LSL, LSR, RSL, RSR}
• annotating durations of each phase:
{LαRβLγ, , RαLβRγ, LαSdLγ, LαSdRγ, RαSdLγ, RαSdRγ}
with α ∈ [0, 2π), β ∈ (π, 2π), d ≥ 0
Trang 51Dubins curves
→ By testing all six types of trajectories for (q1, q2)we can define a
Dubins metric for the RRT – and use the Dubins curves as controls!
(includes 46 types of trajectories, good metric for use in RRTs for cars)
Trang 52Dubins curves
→ By testing all six types of trajectories for (q1, q2)we can define aDubins metric for the RRT – and use the Dubins curves as controls!
• Reeds-Shepp curves are an extension for cars which can drive back.
(includes 46 types of trajectories, good metric for use in RRTs for cars)
Trang 53We discuss 3 examples for dynamic/non-holonomic systems:
• 1D point mass
– We learnt about PID and the corresponding damped/oscilatory trajectories
• General robot dynamics M (q) ¨q + C(q, ˙q) ˙q + G(q) = u
– We learnt how to follow a reference trajectory q0:T (joint space approach)
– We learnt about optimal operational space control and following a task space
trajectory y0:T (operational space control)
• A car
– We learnt about path finding under differential constraints
→ This generalizes also to path finding for dynamic robots (see LaValle’s