# Introduction to Robotics

AI and Robotics

Nov 2, 2013 (4 years and 7 months ago)

104 views

Universitat Hamburg
MIN-Fakultat
Department Informatik
- Introduction to Robotics
Introduction to Robotics
Jianwei Zhang
zhang@informatik.uni-hamburg.de
Universit

at Hamburg
Fakult

at f

ur Mathematik,Informatik und Naturwissenschaften
Department Informatik
Technische Aspekte Multimodaler Systeme
10.Mai 2013
J.Zhang
118
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Outline
General Information
Introduction
Coordinates of a manipulator
Kinematic equations
Inverse kinematics for manipulators
Trajectory planning
Generation of trajectories
Trajectories in multidimensional space
Cubic polynomials between two congurations
Linear function with parabolical intersections
Velocity calculation at the waypoints
Factors for time optimal motion - arc length
Factors for time optimal motion - curvature
J.Zhang
119
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Outline (cont.)
Factors for time optimal motion - motion time
Dynamical constraints for all joints
Diculties for the trajectory generation in cartesian space
Motion along a line
J.Zhang
120
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trajectory planning
Trajectory planning
Problem:I'm at poit A and will move to point B.
How and in what time can the end position be achieved???
Solution:
I
Generate a possible trajectory,
I
Trajectory planning
J.Zhang
121
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Denition of trajectory:
I
(Changeable) position of TCP and joint position respectively as
function of time
I
In most cases the discrete position (TCP or joint position) is
given with xed temporal distance (e.g.10 ms).
J.Zhang
122
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Pre-conditions
I
The same methods should be applicable for the calculation of
cartesian trajectories for TCP as well as for the trajectories in
the joint space.
J.Zhang
123
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Primitive approach (to receive B from A)
I
Set the position for the next time step (10 ms later) to B,
I
Possible for the simulation,doesn't work in reality.The moving
distance for a manipulator at the time of 10 ms is limited
(velocity limitation).
J.Zhang
124
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Next best approach (to receive B from A)
I
The linear interpolation is used to devide the distance between
A and B into shorter distances with respect to maximal velocity
of the manipulator.
J.Zhang
125
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Linear interpolation
J.Zhang
126
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Linear interpolation
Problem:the physical constraints are violated
Contraints for the robot motion:
Joint velocity is limited (max.motor rotation speed)
Joint acceleration is also limited (max.motor torque)
Implicitly thess contraints are valid for the motion in cartesian
space
The robot dynamics (joint moments resulting from the robot motion)
aects the boundary condition,too.Solution:dynamical trajectory
planning,advanced optimization methods,current topic of research.
J.Zhang
127
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Next best approach (to receive B from A)
I
Limitation of joint velocities and accelerations
I
Two dierent methods
I
trapezoidal interpolation,
I
polynomial interpolation.
J.Zhang
128
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trapezoidal and polynomial interpolation
J.Zhang
129
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Trapezoidal interpolation
I
Consider joint velocities and accelerations contraints
I
Optimal time usage (movements with maximal acceleration and
velocity)
I
Acceleration is not dierentiable (the jerk is not continuous;
jerk:derivation of acceleration)
I
Start and end velocity equals 0 (disadvantageous for combining
dierent trajectories),can be improved through polynomial
interpolation.
J.Zhang
130
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Trapezoidal interpolation
I
Diculties with multidimensional trapezoidal interpolations
I
dierent running time for joints (or cartesian dimension);
I
dierent velocity and acceleration contraints
I
consequence:dierent\time swich points"
I
from acceleration to continuous velocity,
I
from continuous velocity to deceleration.
I
consequence:moving along the line in joint and cartesian space
respectively is impossible
Solution
I
Normalization to the slowest joint
I
Using the jerk and the arrival time of the slowest joint instead of
its velocity.
J.Zhang
131
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trapezoidal interpolation
Normalization to the slowest joint
J.Zhang
132
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trapezoidal interpolation
Normalization to the slowest joint
J.Zhang
133
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Generating of possible trajectory
Polynomial interpolation
I
Consider velocity and acceleration boundary conditions
(Calculation of extremum and time scaling for the trajectory)
I
Not optimal time usage (maximal acceleration or velocity will
be achieved only at one point inside the trajectory)
I
Acceleration dierentiable (the jerk is continuous;;\smooth
trajectory";interesting only in the theory - for momentum
control)
I
Start- and end velocity can be dierent from 0
J.Zhang
134
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trajectory generation
Polynomial interpolation
I
Approach:in most cases a polynom with a degree of 3.(Spline;
cubic spline) or 5.,Calculation of coecient with respect to
boundary constraints.
I
three-degree polynomial:allows us to consider 4 boundary
constraints (only velocities)
J.Zhang
135
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trajectory generation
I
fth-degree polynomial:allows us to consider 6 boundary
constraints (velocity and acceleration)
I
e.g.f(x) = a1 x5 + a2 x4 + a3 x3 + a4 x2 + a5 x + a6
I
boundary conditions for start (x=0) and end (x=1):
I
f(0) = 0,f (1) = 1,//ptoper f (0) = A,
I
f (1) = B,see below
I
f'(0) = vStart,f'(1) = vGoal
I
f"(0) = aStart,f"(1) = aGoal
I
t:\formal"time from the interval between [0;1]
I
\Proper"position interpolation P(t) = Af(t) + B(1-t)
J.Zhang
136
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
Trajectory generation
Polynomial interpolation
J.Zhang
137
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
\Pick-and-Place"- operation and its boundary constraints
(via points:waypoints)
J.Zhang
138
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning Introduction to Robotics
\Pick-and-Place"- operation and it's boundary constraints
(a)\Pick":position (is given),velocity and acceleration (is given,
0 in normal case)
(b)\Lift-o":continuous motion via waypoints
(c)\Set-down":similar to (b)
(d)\Place":similar to (a)
J.Zhang
139
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Generation of trajectories Introduction to Robotics
Generation of trajectories - I
Calculate,interpolate or approximate the necessary trajectory with
lots of continuous functions related to time for moving the robot
from start to goal point.The start and goal points can be specied
in cartesian or joint space.
Two possible solutions:The trajectories are generated in
I
cartesian space:
I
I
J.Zhang
140
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Generation of trajectories Introduction to Robotics
Generation of trajectories - II
I
joint space:
I
the planned trajectory can be immediately applied
I
the calculation of inverse kinematics is unnecessary
I
joint physical contraints can be considered
J.Zhang
141
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Trajectories in multidimensional space Introduction to Robotics
Trajectories in multidimensional space
The changes in position,velocity and acceleration of all joints are
analyzed over a certain period of time.The trajectory with i DOF
is a parameterized function q
i
(t) with values in its motion region.
The trajectory of the robot with n DOF is then a vector of q
i
(t)
with one common parameter:
q(t) = [q
1
(t);q
2
(t);:::;q
n
(t)]
T
A trajectory is C
k
-continuous,if all derivations up to k-th
(inclusively) exist and are continuous.
A trajectory is smooth,if it is C
2
-continuous (minimum).
J.Zhang
142
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Trajectories in multidimensional space Introduction to Robotics
Remarks on generation of trajectories
I
The rst derivation of trajectory related to the time is the
velocity
I
The second derivation of trajectory related to the time is the
acceleration
I
The third derivation of trajectory related to the time is the jerk
J.Zhang
143
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Trajectories in multidimensional space Introduction to Robotics
Remarks on generation of trajectories
I
The smoothest curves are calculated via innite,often
dierentiable functions.
e.g.e
x
,sin x,
and
log x (for x > 0).
I
The polynomials are suitable for the interpolation (oscillations
caused by an order that is too high).
I
Piecewise polynomials with specied order are applicable:
cubic polynomial,Splines,B-Splines etc.
J.Zhang
144
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Cubic polynomials between two congurations Introduction to Robotics
Cubic polynomials between two congurations - I
If the start and end velocity is 0 then:
(0) = 
0
(t
f
) = 
f
_
(0) = 0
_
(t
f
) = 0
J.Zhang
145
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Cubic polynomials between two congurations Introduction to Robotics
Cubic polynomials between two congurations - I
four constraints )a fourth-degree polynomial:
(t) = a
0
+a
1
t +a
2
t
2
+a
3
t
3
J.Zhang
146
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Cubic polynomials between two congurations Introduction to Robotics
Cubic polynomials between two congurations - II
The solution:
a
0
= 
0
a
1
= 0
a
2
=
3
t
2
f
(
f

0
)
a
3
= 
2
t
3
f
(
f

0
)
J.Zhang
147
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Cubic polynomials between two congurations Introduction to Robotics
Cubic polynomials for a trajectory with waypoints
The positions of waypoints are given.Only the velocities between
the waypoints are dierent from 0:
_
(0) =
_

0
_
(t
f
) =
_

f
The solution:
a
0
= 
0
a
1
=
_

0
J.Zhang
148
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Cubic polynomials between two congurations Introduction to Robotics
Cubic polynomials for a trajectory with waypoints
a
2
=
3
t
2
f
(
f

0
) 
2
t
f
_

0

1
t
f
_

f
a
3
= 
2
t
3
f
(
f

0
) +
1
t
2
f
(
_

f
+
_

0
)
J.Zhang
149
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Linear function with parabolical intersections Introduction to Robotics
Linear function with parabolical intersections

  t
b
=

h

b
t
h
t
b
J.Zhang
150
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Linear function with parabolical intersections Introduction to Robotics
Linear function with parabolical intersections

b
= 
0
+
1
2

t
2
b
If t = 2t
h
then:

t
2
b

tt
b
+(
f

0
) = 0
t
b
=
t
2

q

2
t
2
4

(
f

0
)
2

The acceleration contraint is:

 
4(
f

0
)
t
2
J.Zhang
151
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Velocity calculation at the waypoints Introduction to Robotics
Velocity calculation at the waypoints
I
Manual specication based on cartesian linear and angle
velocity for the tool frame;
I
Automatical calculation in cartesian or joint space with the
help of heuristics;
I
Automatical choosing of the parameteres in the case where
the acceleration at the waypoints is continuous.
J.Zhang
152
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Factors for time optimal motion - arc length Introduction to Robotics
Factors for time optimal motion - arc length
The curve in the n-dimensional K space is given
q(t) = [q
1
(t);q
2
(t);:::;q
n
(t)]
T
then the arc length can be dened as follows:
s =
Z
t
0
j _q(t)j dt
where j _q(t)j is the eucledean norm of vector dq(t)=dt and is
labeled as a ow velocity along the curve.
The following two points are given p
0
= q(t
s
) und p
1
= q(t
z
),
J.Zhang
153
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Factors for time optimal motion - arc length Introduction to Robotics
Factors for time optimal motion - arc length
then the arc length L between p
0
and p
1
the integral:
L =
Z
L
0
ds =
Z
t
z
t
s
j _q(t)j dt
"
The trajectory parameters should be calculated in the way
that the arc length L has the shortest possible value.\
J.Zhang
154
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Factors for time optimal motion - curvature Introduction to Robotics
Factors for time optimal motion - curvature
At rst the unit vector of the curve q(t) can be dened as follows:
U =
dq(t)
ds
=
dq(t)=dt
ds=dt
=
_q(t)
j
_
q(t)j
If the s as the parameter of the arc length and U as the unit vector
are given,the curvature of curve q(t) can be dened:
(s) = j
dU
ds
j
If the parameter t,the rst derivation of _q = dq(t)=dt and the
second derivation of q = d _q(t)=dt for the curve q(t) are given,
then the arc length can be calculated from the following
representation:
J.Zhang
155
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Factors for time optimal motion - curvature Introduction to Robotics
Factors for time optimal motion - curvature
(t) =
j
_
q 

qj
j _q
3
j
=
(
_
q
2

q
2
(
_
q 

q)
2
)
1=2
j _qj
3=2
where
_
q 

q is the cross product and
_
q 

q is the dot product of
_
q
and q.
The bending energy of a smooth curve q(t) over the intervall
t 2 [0;T] is dened as
E =
Z
L
0
(s)
2
ds =
Z
T
0
(t)
2
j _q(t)j dt
where (t) is the curvature of q(t).
"
The bending energy E of a trajectory should be as small as
possible under consideration of the arc length.\
J.Zhang
156
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Factors for time optimal motion - motion time Introduction to Robotics
Factors for time optimal motion - motion time
If
u
i
= t
i +1
t
i
is the needed time for motion in the segment q
i
.
The total motion time is:
T =
n1
X
i =1
u
i
J.Zhang
157
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Dynamical constraints for all joints Introduction to Robotics
Dynamical constraints for all joints
The borders for the minimum motion time for the trajectory q
i
j
(t)
are dened over a dynamical parameter of all joints.
For the joint i this kind of constraint can be described as follows:
j _q
i
j
(t)j  _q
i
max
jq
i
j
(t)j  q
i
max
ju
i
j
(t)j  u
i
max
J.Zhang
158
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Dynamical constraints for all joints Introduction to Robotics
Dynamical constraints for all joints
where i (i = 1;:::;n) is a joint number,and j (j = 1;:::;m)
represent a number of a trajectory part.
u
i
is the moment of force for the joint i and can be calculated
from the dynamical equation (motion equation).
_q
i
max
,q
i
max
and u
i
max
represent the important parameters of the
dynamical capacity of the robot.
J.Zhang
159
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Diculties for the trajectory generation in cartesian space Introduction to Robotics
Diculties for the trajectory generation in cartesian space
I
Waypoints cannot be arrived
I
The velocities in the vicinity of singular congurations are too
high
I
Start and end congurations can be arrived at,but they
depend on dierent solutions.
J.Zhang
160
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Motion along a line Introduction to Robotics
Motion along a line < w
0
;w
1
>
The following algorithm should create a smallest set of waypoints
in the joint space with the given value  > 0.Therefore the
deviation between the trajectory and the given line < w
0
;w
1
>
must be smaller then .
Algorithm(Bounded
Deviation)
1.Calculation of possible congurations q
0
;q
1
aus w
0
;w
1
with
the help of equations of the inverse kinematics.
2.Calculation of the center in joint space:
q
m
=
q
0
+q
1
2
J.Zhang
161
Universitat Hamburg
MIN-Fakultat
Department Informatik
Trajectory planning - Motion along a line Introduction to Robotics
Motion along a line < w
0
;w
1
>
3.Calculation of the corresponding point of q
m
in the workspace
with usage of direct kinematics:
w
m
= W(q
m
)
4.Calculation of the center in the workspace:
w
M
=
w
0
+w
1
2
5.If the deviation jjw
m
w
M
jj  ,then cancel;else add the w
M
as node point between w
0
and w
1
.
6.Recursive application of the algorithm for two new segments
(w
0
;w
M
) und (w
M
;w
1
).
J.Zhang
162