Position Regulation: Robotics 2
Position Regulation: Robotics 2
Position Regulation
(with an introduction to stability)
𝑥̇ # 𝑥$ 0
𝑥̇ = = −𝑀/# (𝑥 ) 𝑐 𝑥 , 𝑥 + 𝑔(𝑥 ) + 𝑢
𝑥̇ $ # # $ # 𝑀/# (𝑥# )
= 𝑓 𝑥 + 𝐺 𝑥# 𝑢
stability of 𝑥5
∀𝜀 > 0, ∃𝛿; > 0: 𝑥 𝑡> − 𝑥5 < 𝛿; ⟹ 𝑥 𝑡 − 𝑥5 < 𝜀, ∀𝑡 ≥ 𝑡>
Robotics 2 3
Stability vs. asymptotic stability
whiteboard…
𝑥5 𝛿; 𝑥5 𝑥5 𝑥5
𝜀
𝑥(𝑡> ) 𝑥(𝑡> )
𝑥5 𝑥5 𝑥5
+
𝛿 𝑥(𝑡> ) 𝑥(𝑡> )
x2
0
Robotics 2 6
Stability of dynamical systems
results - 1
LaSalle Theorem
if ∃𝑉 candidate: 𝑉̇ 𝑥 ≤ 0 along the trajectories of 𝑥̇ = 𝑓(𝑥)
Corollary
ℳ ≡ 𝑥5 asymptotic stability
Robotics 2 8
Bird-eye view on Lyapunov analysis
whiteboard…
2
2
1
1
phase 𝑥5 = 𝟎 𝑥5 = 𝟎
dtheta
dtheta
0 0
plane -1
-1
-2
-2
-3 level
-4
sets of 𝑉 -3
-4 -3 -2 -1 0 1 2 3 4 -3 -2 -1 0 1 2 3
1
theta theta
𝑥̇ = 𝑓(𝑥, 𝑡)
Barbalat Lemma
if i) a function 𝑉 𝑥, 𝑡 is lower bounded
ii) 𝑉̇ 𝑥, 𝑡 ≤ 0
then ⇒ ∃ lim 𝑉 𝑥, 𝑡 (but this does not imply that lim 𝑉̇ 𝑥, 𝑡 = 0)
N→s N→s
if in addition iii) 𝑉̈ 𝑥, 𝑡 is bounded
then ⇒ lim 𝑉̇ 𝑥, 𝑡 = 0
N→s
Corollary
if a Lyapunov candidate 𝑉(𝑥, 𝑡) satisfies Barbalat Lemma along the
trajectories of 𝑥̇ = 𝑓(𝑥, 𝑡), then the conclusions of LaSalle Theorem hold
Robotics 2 10
Stability of linear systems
time-invariant case
|}
̇
Let ∆𝑥 = 𝑥 − 𝑥5 and let ∆𝑥 = | 𝑥 − 𝑥5 = 𝐴 ∆𝑥 be the
|~ ~€~•
linear approximation of 𝑥̇ = 𝑓(𝑥) around the equilibrium 𝑥5
Robotics 2 12
PD control
(proportional + derivative action on the error)
robot 𝑀 𝑞 𝑞̈ + 𝑐 𝑞, 𝑞̇ + 𝑔 𝑞 = 𝑢
control law 𝑢 = 𝐾ƒ 𝑞| − 𝑞 − 𝐾„ 𝑞̇
Robotics 2 13
Asymptotic stability with PD control
Theorem 1
In the absence of gravity (𝑔(𝑞) = 0), the robot state (𝑞| , 0) under
the given PD joint control law is globally asymptotically stable
up to here, we proved
stability only
but 𝑉̇ = 0 ⇔ 𝑞̇ = 0 continues ...
Robotics 2 14
Asymptotic stability with PD control
LaSalle
system trajectories converge to the largest
𝑉̇ = 0 ⇔ 𝑞̇ = 0
invariant set of states ℳ where 𝑞̇ ≡ 0
(that is 𝑞̇ = 𝑞̈ = 0)
𝑞̇ = 0 𝑀 𝑞 𝑞̈ = 𝐾ƒ 𝑒 𝑞̈ = 𝑀/# (𝑞)𝐾ƒ 𝑒
closed-loop dynamics invertible
𝑞̇ = 0, 𝑞̈ = 0 ⇔ 𝑒 = 0
Robotics 2 15
Mechanical interpretation
n for diagonal positive definite gain matrices 𝐾ƒ and 𝐾„ (thus, with
positive diagonal elements), such values correspond to stiffness of
“virtual” springs and viscosity of “virtual” dampers placed at the joints
current
configuration 𝑞
desired
configuration 𝑞|
Robotics 2 16
Plot of the Lyapunov function 𝑉
n time evolution of the Lyapunov candidate
𝑉(0) = ½ 𝑒 Y (0)𝐾ƒ 𝑒(0)
𝑉 if the robot starts from rest
𝑉(0)
𝑉̇ = 0
0
(isolated) instants of global “motion inversion”
𝑡
(𝑞̇ = 0, but 𝑞̈ ≠ 0!)
Robotics 2 17
Comments on PD control -1
Robotics 2 18
Comments on PD control -2
n analog or digital implementation of derivative action in the control law
when only position is measured at the joints (e.g., through encoders)
continuous-time
𝑢 𝑡 = 𝐾ƒ 𝑒 𝑡 + 𝐾„ 𝑒(𝑡)
̇ 𝑒 = 𝑞| − 𝑞, 𝑒̇ = −𝑞̇
control law (design)
representation in 𝐾„ 𝑠
𝑢 𝑠 = 𝐾ƒ + 𝐾„ 𝑠 𝑒(𝑠) 𝑢 𝑠 = 𝐾ƒ + 𝑒(𝑠)
the Laplace domain 1 + 𝜏𝑠
not realizable as such
(non-proper transfer function) derivative action limited
in bandwidth (up to ω ≤ 1/𝜏)
transformation in 1 − 𝑧 /#
the Zeta-domain 1 − 𝑧 /# 𝑇•
(e.g., via backward 𝑢 𝑧 = 𝐾ƒ + 𝐾„ 𝑒(𝑧) 𝑢 𝑧 = 𝐾ƒ + 𝐾„ 𝑒(𝑧)
𝑇• 1 − 𝑧 /#
differentiation rule on 1+𝜏
samples, every 𝑇• sec) 𝑇•
discrete-time 𝑒’ − 𝑒’/# 𝐾„
𝑢’ = 𝐾ƒ 𝑒’ + 𝐾„ 𝑢’ = 𝐾ƒ 𝑒’ + 𝑒’ − 𝑒’/#
implementations 𝑇• 𝜏 + 𝑇•
𝜏
both realizable + (𝑢’/# − 𝐾ƒ 𝑒’/# )
Robotics 2
𝜏 + 𝑇• 19
Inclusion of gravity
n in the presence of gravity, the same previous arguments
(and proof) show that the control law
𝑢 = 𝐾ƒ 𝑞| − 𝑞 − 𝐾„ 𝑞̇ + 𝑔(𝑞) 𝐾ƒ > 0, 𝐾„ > 0
will make the equilibrium state (𝑞| , 0) globally
asymptotically stable (nonlinear cancellation of gravity)
§ if gravity is not cancelled or only approximately cancelled
𝑢 = 𝐾ƒ 𝑞| − 𝑞 − 𝐾„ 𝑞̇ + 𝑔(𝑞)
” 𝑔(𝑞)
” ≠ 𝑔(𝑞)
it is 𝑞 → 𝑞∗ ≠ 𝑞| , 𝑞̇ → 0, with steady-state position error
n 𝑞 ∗ is not unique in general, except when 𝐾ƒ is chosen large enough
n explanation in terms of linear systems: there is no integral action before
the point of access of the constant “disturbance” acting on the system
Robotics 2 20
PD control +
constant gravity compensation
since 𝑔(𝑞) contains only trigonometric and/or linear terms in 𝑞,
the following structural property holds
𝜕$𝑈 𝜕𝑔
finite ∃𝛼 > 0: $
= ≤ 𝛼, ∀𝑞
𝜕𝑞 𝜕𝑞
consequence 𝑔 𝑞 − 𝑔(𝑞| ) ≤ 𝛼 𝑞 − 𝑞|
induced
note: norm of 𝐴 = 𝜆•–— 𝐴Y 𝐴 ≜ 𝐴™ ≥ 𝐴š ≜ 𝜆•›œ(𝐴Y 𝐴)
a matrix
Theorem 2
If 𝐾ƒ,š > 𝛼 , the state (𝑞| , 0) of the robot under joint-space PD control
+ constant gravity compensation at 𝑞| is globally asymptotically stable
Proof
1. (𝑞| , 0) is the unique closed-loop equilibrium state
Robotics 2 22
PD control + constant gravity compensation
stability analysis
¡ Y
with 𝑒 = 𝑞| − 𝑞, 𝑔 𝑞 = , consider as Lyapunov candidate
¢
1 Y 1
𝑉= 𝑞̇ 𝑀 𝑞 𝑞̇ + 𝑒 Y 𝐾ƒ 𝑒 + 𝑈 𝑞 − 𝑈 𝑞| + 𝑒 Y 𝑔(𝑞| )
2 2
Robotics 2 23
PD control + constant gravity compensation
stability analysis
1 Y 1 Y
differentiating 𝑉 = 𝑞̇ 𝑀 𝑞 𝑞̇ + 𝑒 𝐾ƒ 𝑒 + 𝑈 𝑞 − 𝑈 𝑞| + 𝑒 Y 𝑔(𝑞| )
2 2
1 𝜕𝑈(𝑞)
̇ Y ̇ Y
𝑉 = 𝑞̇ 𝑀(𝑞)𝑞̈ + 𝑀(𝑞)𝑞̇ − 𝑒 𝐾ƒ 𝑞̇ + 𝑞̇ − 𝑞̇ Y 𝑔(𝑞| )
2 𝜕𝑞
1
Y
= 𝑞̇ 𝑢 − 𝑆(𝑞, 𝑞) ̇
̇ 𝑞̇ + 𝑀(𝑞) 𝑞̇ − 𝑔(𝑞) − 𝑒 Y 𝐾ƒ 𝑞̇ + 𝑞̇ Y 𝑔 𝑞 − 𝑔(𝑞| )
2
=0
= 𝑞̇ Y 𝐾ƒ 𝑒 − 𝑞̇ Y 𝐾„ 𝑞̇ + 𝑞̇ Y 𝑔 𝑞| − 𝑔(𝑞) − 𝑒 Y 𝐾ƒ 𝑞̇ + 𝑞̇ Y 𝑔 𝑞 − 𝑔(𝑞| )
= −𝑞̇ Y 𝐾„ 𝑞̇ ≤ 0
rad
𝑘ƒ 𝑘ƒ 𝑘ƒ
©𝑚𝑔 𝑑 = 0.5 ©𝑚𝑔 𝑑 = 1 ©𝑚𝑔 𝑑 = 5
> > >
o
zero final error 60 residual error no residual error!
large initial torque small initial torque even smaller initial torque
control
Robotics 2 26
Approximate gravity compensation
𝑢 = 𝐾ƒ 𝑞| − 𝑞 − 𝐾„ 𝑞̇ + 𝑔(𝑞
” |)
Robotics 2 27
PID control
n in linear systems, the addition of an integral control action is used
to eliminate a constant error in the step response at steady state
n in robots, a PID may be used to recover such a position error due
to an incomplete (or absent) gravity compensation/cancellation
N
the control law 𝑢 𝑡 = 𝐾ƒ 𝑞| − 𝑞(𝑡) + 𝐾± ² 𝑞| − 𝑞(𝜏) 𝑑𝜏 − 𝐾„ 𝑞(𝑡)
̇
>
𝑒 𝑡 = 𝑞| − 𝑞 𝑡
𝑚𝑞̈ + 𝑚𝑔> = 𝐹 (no friction)
𝑔> > 0 𝑒̇ 𝑡 = −𝑞̇ 𝑡
𝑚 𝐹 = 𝑘ƒ 𝑞| − 𝑞 − 𝑘„ 𝑞̇
𝑞
šnO
(PD ⇒ steady-state error 𝑒 = 𝑞| − 𝑞
³ , with 𝑞³ = 𝑞| − ’ )
´
𝐹 𝐹 = 𝑘ƒ 𝑞| − 𝑞 − 𝑘„ 𝑞̇ + 𝑚𝑔>
(PD + gravity cancellation ⇒ regulation ∀𝑘ƒ > 0, 𝑘„ > 0)
N
𝐹 = 𝑘ƒ 𝑞| − 𝑞 − 𝑘„ 𝑞̇ + 𝑘± ² 𝑞| − 𝑞(𝜏) 𝑑𝜏
> š’µ
(PID ⇒ regulation ∀𝑘± > 0, 𝑘„ > 0, 𝑘ƒ > > 0)
’¶
Laplace domain analysis: 𝑒 𝑠 = ℒ[𝑒 𝑡 ], 𝑑 𝑠 = ℒ[𝑚𝑔>] + Routh criterion
𝑒(𝑠) 𝑠 3 𝑚 𝑘ƒ
= 𝑊| 𝑠 = 2 𝑘„ 𝑘±
𝑑(𝑠) 𝑚𝑠 U + 𝑘„ 𝑠 $ + 𝑘ƒ 𝑠 + 𝑘±
1 (𝑘„ 𝑘ƒ − 𝑚𝑘± )/𝑘„
Robotics 2 0 𝑘± 29
Saturated PID control
§ more in general, one can prove global asymptotic stability of (𝑞| , 0),
under lower bound limitations for 𝐾ƒ , 𝐾± , 𝐾„ (depending on suitable
“bounds” on the terms in the dynamic model), for a nonlinear PID law
N
𝑢 𝑡 = 𝐾ƒ 𝑞| − 𝑞(𝑡) + 𝐾± ² Φ 𝑞| − 𝑞(𝜏) 𝑑𝜏 − 𝐾„ 𝑞̇
>
sin 𝑥 , 𝑥 ≤ 𝜋/2 𝑒 ~ − 𝑒 /~
Φ 𝑥 = ¾ 1, 𝑥 > 𝜋/2 or Φ 𝑥 = tanh 𝑥 = ~
−1, 𝑒 + 𝑒 /~
𝑥 < −𝜋/2
(see paper by R. Kelly, IEEE TAC, 1998; available as extra material on the course web)
Robotics 2 30
Limits of robot regulation controllers
n response times needed for reaching the desired steady state are not
easily predictable in advance
n depend heavily on robot dynamics, on PD/PID gains, on the required
n control efforts in the few first instants of motion typically exceed by far
those required at steady state
n especially for high positional gains
Robotics 2 31
Regulation in industrial robots
n in industrial robots, the planner generates a reference trajectory 𝑞¿ (𝑡)
even when the task requires only positioning/regulation of the robot
n “smooth” enough, with a user-defined transfer time 𝑇
n reference trajectory interpolates initial and final desired position
𝑞¿ (0) = 𝑞(0) 𝑞¿ (𝑡 ≥ 𝑇) = 𝑞|
n 𝑞¿ (𝑡) is used within a control law of the form
e.g., PD with
𝑢 = 𝐾ƒ 𝑞¿ (𝑡) − 𝑞 + 𝐾„ 𝑞̇ ¿ (𝑡) − 𝑞̇ + 𝑔(𝑞) gravity
cancellation
often neglected
n in this way, the position error is initially zero
n robot motion stays only “in the vicinity” of the reference trajectory
until 𝑡 = 𝑇, typically with small position errors (gains can be larger!)
n final regulation is only a “local” problem (𝑒 𝑇 = 𝑞| − 𝑞(𝑇) is small)
Robotics 2 32
Qualitative comparison
n no saturation of commands: in principle, much larger gains can be used
n better prediction of settling times: local exponential convergence (designed
on the linear approximation of the robot dynamics around (𝑞| , 0))
n “fine tuning” of control gains is easier, but still a tedious and delicate task
𝑞𝑑 step 𝑢(0)
variation
of desired
position
𝑢| = 𝑔(𝑞| )
𝑞(0)
joint variables time- control commands
varying
𝑞𝑑 position
reference
𝑞¿ (𝑡) 𝑢(0)
𝑢| = 𝑔(𝑞| )
𝑞(0)
𝑇 = planned
final time
Robotics 2 33
Quantitative comparison
planar 2R arm
Robotics 2 35
Comparison on a planar 2R arm – case b
max torques
PD with same gains of 7.5 and 2.4 Nm
on interpolating
trajectory of 𝑇 = 2 s
Robotics 2 36
Comparison on a planar 2R arm – case c
Robotics 2 37