• No results found

Path Generation for Industrial Robots

N/A
N/A
Protected

Academic year: 2021

Share "Path Generation for Industrial Robots"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Path generation for industrial robots

Maria Nystr¨om, Mikael Norrl¨of Division of Automatic Control Department of Electrical Engineering

Link¨opings universitet, SE-581 83 Link¨oping, Sweden WWW: http://www.control.isy.liu.se E-mail: nystrom@isy.liu.se, mino@isy.liu.se

11th August 2003

AUTOMATIC CONTROL

COM

MUNICATION SYSTEMS

LINKÖPING

Report no.: LiTH-ISY-R-2529

Submitted to Mekatronikm¨ote 2003, G¨oteborg, Sweden

Technical reports from the Control & Communication group in Link¨oping are available athttp://www.control.isy.liu.se/publications.

(2)

Abstract

Path generation in Cartesian space is discussed and the idea of using

lines and arcs to create general paths is presented. To make smooth

paths in Cartesian space zones are introduced and two different ways to interpolate zones are given. An algorithm for transforming a Cartesian path into a cubic spline representation in joint space is presented and also evaluated in an example. An important aspect of the proposed algorithm is that the resulting path in joint-space has a bounded Cartesian space error.

Keywords: zone interpolation, cartesian path, joint path, cubic splines

(3)

Path generation for industrial robots

M. Nystr¨om1, M. Norrl¨of2

Department of Electrical Engineering,

Link¨oping University, SE-581 83 Link¨oping, Sweden 1. e-mail: nystrom@isy.liu.se

2. e-mail: mino@isy.liu.se

Abstract

Path generation in Cartesian space is discussed and the idea of using lines and arcs to create general paths is presented. To make smooth paths in Cartesian space zones are introduced and two different ways to inter-polate zones are given. An algorithm for transforming a Cartesian path into a cubic spline representation in joint space is presented and also evaluated in an ex-ample. An important aspect of the proposed algorithm is that the resulting path in joint-space has a bounded Cartesian space error.

1

Introduction

There is a growing interest in academia and indus-try for new algorithms, methods and tools in gen-eration and optimization of trajectories for indus-trial robots [4]. This development is motivated by the increasing need for improved motion perfor-mance in several robot applications such as laser cutting, laser welding, machining, assembly and material handling.

The trajectory generation problem can be di-vided into two separate problems. The first, which is covered here, deals with the path plan-ning or path generation. This is a strictly geo-metrical problem but since it serves as an input to the next step, the trajectory planning and opti-mization, it does have an impact on the resulting trajectory. The two problems are often consid-ered as one, see for example [4, 1, 2, 6]. Many of the early contributions only covers point-to-point This work was supported by the VINNOVA Compe-tence Center ISIS at Link¨oping University

motion while in many real applications where in-dustrial robots are used the complete path must be specified. In [3] the Cartesian path is approx-imated by line segments. From line segments it is easy to take the step to represent the path using general splines, this is discussed in e.g. [7]. To control the manipulator it is necessary to trans-form the Cartesian path into a joint space repre-sentation. This step can also include the dynamic optimization as described in [3, 2].

In the first part of this contribution path gen-eration in Cartesian space using lines and circle segments is discussed. One problem in Cartesian space is how the lines and circles should be con-nected to each other to create a smooth path. The solution is based upon the introduction of zones in which an interpolation between the two lines, the two circles or the circle and the line can be done.

The second part of this contribution deals with the generation of paths in joint space. This in-cludes transforming the Cartesian path to joint space using the kinematic model [10, 8] of the robot and also to interpolate a path in joint space using splines. An algorithm for spline interpo-lation is presented and ideas on how to adjust the length of the splines in order to keep a cer-tain level of path accuracy in Cartesian space are given.

Finally an example is presented where the algo-rithms for path generation are applied to a Carte-sian line-circle path. This paper is based upon the results presented in [8], [9], and [7].

(4)

2

The path in Cartesian space

The first step in path generation is to create a path in Cartesian space. Here it will be assumed that the robot has only 3 degrees of freedom (DOF) and therefore only the position of the path is con-sidered.

2.1 Path primitives

The path followed by the robot end effector (or tool) is in general composed by connecting a number of lines and arcs, where each line and arc is referred to as a segment. Each segment has a parametric representation p(lc) where lc is the

length of the segment (in m). A line segment is represented by a first order spline and the arc is represented by p(lc) = T˜p(lc) where

˜

p(lc) = r cos(lc/r) r sin(lc/r) 0 1 T

(1) and ˜p(lc) is expressed in a local coordinate frame

with origin in the center of the circle. r is the ra-dius of the circle and lc is the index varying from

zero to the length of the arc. T is a homogeneous transformation matrix (see e.g. [10]) expressing the coordinate transformation between the local coordinate frame and the global coordinate frame.

2.2 Introduction of zones

In order to make the path smooth, a circular zone is introduced around the intersection points of ev-ery two adjacent segments, as shown in Figure 1. Within this zone, the path is allowed to deviate from the segments as long as the path does not leave the zone. The actual path is interpolated from the two adjacent segments.

zon 1

zon 2

segment 1 segment 2

segment 3

Figure 1: Three segments, an arc and two lines. The two zones used in the interpolation of a smooth path are shown as dashed circles.

During the interpolation a normalized index is used. This means that each segment is given a new index l, where l ∈ [0, 1]. In the intersection point with zone j, index for segment i, li, has the

value lizj where j = i or j = i− 1.

The path inside the zone j uses an internal in-dex lzj, which is based on the normalized index

of the second segment of the zone. For zone 1 in Figure 1 this means that lzis based on the

normal-ized index for segment 2. In general for a zone j: lzj ∈ [−l(j+1)zj, l(j+1)zj].

If the robot was programmed to stop at the con-nection point of two adjacent segments, then the distance from the beginning of the zone to the connection point could be seen as a braking dis-tance. The distance from the connection point to the end of the zone could similarly be considered as acceleration distance. If the braking and the acceleration takes place simultaneously during a time τ , then a point ˜pi,1should be reached on the

first segment and a point ˜p(i+1),1 on the second segment. If these two points are seen as vectors from the connection point of the two segments, the corresponding point on the interpolated path is given by ˜pi,1+ ˜p(i+1),1, see Figure 2. This

pro-cedure continues until, on the first segment, the connection point is reached, and on the second segment, the end point of the zone is reached.

y0 O0 z0 x0 p1,1 p2,1 p p p2

Figure 2: Illustration of how the zone path is cre-ated.

Clearly τ does not correspond to time in prac-tice but the idea of deceleration and acceleration along the path can be used as an interpretation of the process of interpolation. The index τ and the index lzjof zone j are related through

τ = 1 + lzj l(j+1)zj

, (2)

(5)

zone j = i the normalized index for each seg-ment, li and li+1, are computed through

integra-tion of dli

and dli+1

. Two different choices of

these derivatives will be presented below.

2.3 Examples of zone path interpolation

A fundamental requirement when constructing the zone path is that the resulting path should be continuous with continuous derivative and prefer-ably a continuous second derivative. These re-quirements can be transformed into rere-quirements on the second derivatives d2li

2 and

d2l i+1

2 .

To get a continuous second derivative of the path at the beginning and the end of the zone, the second derivatives of l should be close to zero near these points. Also, to minimize the acceler-ation of the robot end effector along the path, the second derivative of l should be kept small within the zone.

A constant second derivative of index l, with respect to τ , gives the first derivatives of index l as the solid lines shown in Figure 3. This method of zone interpolation will be referred to as Method 1. The values of the normalized indices liand li+1

are given by the integrations li = 1 Z 2 τ dli dxdx, (3) li+1= Z τ 0 dli+1 dx dx . (4)

This means that for zone i, li∈ [lizi, 1] and li+1∈ [0, l(i+1)zi]. As a result of the nonzero value of

the second derivative of the index at τ = 0 and τ = 2, the second derivative of the path, d2p(lc)

dl2 c , will not be continuous at the beginning and the end of the zone. A smaller discontinuity can be achieved with the derivative of the index as the dash-dotted lines shown in Figure 3 and this in-terpolation method will be referred to as Method 2. The indices are here calculated according to (5) and (6). li = 1 Z 2 τ  (1− lizi)(1−x 2) + (1− lizi)· 1 2(cos( πx 2 ) + 1)− (1 − x 2) ϕ(τ ) ! dx (5) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 τ

Figure 3: Example of linear (solid) and non-linear (dashed) choice of d2li 2 and d2l i+1 2 (described in (5), (6), and (7)). li+1= Z τ 0 l (i+1)zix 2 + l(i+1)zi ·12(cos( πx 2 + π) + 1)− x 2 ϕ(τ ) ! dx (6)

Here ϕ(τ ) is constructed as two connected second order polynomials.

ϕ(τ ) = 

2+ 1 when τ ≤ 1

k(τ− 2)2+ 1 when τ > 1 (7)

A small value of k in (7) gives a deeper zone path with smaller discontinuities, but with a larger sec-ond derivative. By changing the function ϕ(τ ), different zone paths can be created.

3

The path in joint space

The next step is to transform the path in Cartesian space into a path in joint space. The path in joint space is here supposed to be represented using cu-bic splines.

3.1 An algorithm for path generation in joint space

The general algorithm is given by Algorithm 1 (from [7, 8]).

Algorithm 1 requires that index lc is used. As

described in Section 2.3, index lz, which is based

on the normalized index l ∈ [0, 1] is used in the 3

(6)

Algorithm 1 Joint path interpolation. n = number of breakpoints in each spline lc = 0

hlc = distance between breakpoints while not end of section do

for i = 0 to n− 1 do

Compute pi for index lc+ hlci and com-pute the corresponding joint angle qiwith

inverse kinematics. end for Calculatedq0 dlc and dq(n−1) dlc .

Compute the complete cubic spline ˆq(lc).

Adjust the spline interpolation length based upon the computed errork ˆP(lc)− P(lc)k.

end while

interpolation of the zone paths. The relationship between index lcand lzcan be approximated by

lc = X lz≤lz

kP(lz+ ∆lz)− P(lz)k . (8) Since no inverse function of (8) can be found eas-ily, this equation also, by iterations, gives the so-lution to an index lzfor a specific lc. In order for

the transformation to succeed, it is important that the approximation error in (8) is kept small.

In Algorithm 1 the maximum deviation of the actual path from the desired path is used to eval-uate each computed spline. This deviation can be approximated with the deviation in between each two adjacent breakpoints of the spline func-tion, i.e. points given by index lc+h2lc, . . . , lc+ (2n − 3)hlc

2 . The joint angles corresponding

to these indices are transformed into Cartesian space using forward kinematics, and then com-pared to the desired Cartesian path. To compute the splines in joint space a complete spline is used, see e.g. [5].

3.2 Adjustment of the length of the spline

In order to keep a certain level of path accuracy, the length of each spline must be adjustable. This adjustment can be made in many ways. The com-plete cubic spline used here, has a maximum error

given by max xi≤x≤xi+1 |s(x) − f(x)| < 5 384M h 4, (9)

(see e.g. [5]) where the function f is assumed 4 times continuously differentiable on [xi, xi+1]

and

|f(4)(x)| ≤ M , x

i≤ x ≤ xi+1. (10) h is the maximum length of interval [xi, xi+1].

Using the upper bound of the error in (9) algo-rithms, such as Algorithm 2, for adjusting the length of the spline can be constructed.

Large values of α and β in Algorithm 2 result in a smaller value of h, i.e. a shorter length be-tween the breakpoints, when the current deviation is close to the specified maximum value, δ. Algorithm 2 Adjust the spline length.

µ =kP(lc)− ˆP(lc)k δ = maximum value of µ x = δ/µ if x > 1 theni= x1/4 if ∆i> α then h = h· ∆i else keep h end if else ∆r= x1/41 if ∆r> β then h = h· ∆r else h = h· β end if end if

4

An example

The algorithms presented in this paper will now be applied to a Cartesian line-circle path. A three-link robot with the Denavit Hartenberg [10] pa-rameters according to Table 1 will be used. For more details on the robot and the kinematics see [8].

(7)

Link/joint αi ai θi di

i [rad] [m] [rad] [m]

1 −π/2 0.15 0 0.475

2 0 0.6 −π/2 0

3 −π/2 0.72 0 0

Table 1: Denavit Hartenberg parameters for a three-link robot.

The line is defined by a start and end point, p1

and p2, while the circle is defined by a start point,

p2, an intermediate point, p3, and an end point,

p4. The points have the following coordinates:

p1= 1 0.02 0.35  p2= 0.7 0.2 0.4  p3= 0.85 0.35 0.45  p4= 0.74 0.49 0.5  (11)

The segments, together with the two different types of zone paths, can be seen in Figure 4. The dotted zone path is generated according to interpolation method 1 and the solid zone path is generated with method 2. The path is next

0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 0 0.1 0.2 0.3 0.4 0.5 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 x y z

Figure 4: The line-circle path with the two types of zone paths.

transformed into cubic spline functions in joint space (Algorithm 1) using two breakpoints in ev-ery spline function [8]. The maximum allowed deviation error is set to 10−5 meters. The results of the transformation can be seen in Figures 5 to 7. In Figure 5 the knots for the splines gen-erated by the algorithm in joint space is shown when the zone is generated according to interpo-lation method 1, a similar result but with some more knots is achieved for method 2. In Figure 6

the resulting d2q(lc)

dl2

c using the two zone interpola-tion methods from Secinterpola-tion 2.3 is shown. Method 1 has a lower peak value of the second derivative with respect to lcwhile method 2 gives a

continu-ous second derivative. In Figure 7 the path error is evaluated for the two different interpolation meth-ods and it is shown that the error is kept inside the upper bound, 10−5 meter, along the path in both cases. Notice that since the interpolated path is different in the zone the total length of the path is different in the two cases.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 lc q (lc )

Figure 5: Location of breakpoints for the splines in joint space for the zone interpolation according to method 1.

5

Conclusions

The idea of dividing the trajectory genera-tion problem into two sub-problems, path planning/generation and dynamic plan-ning/optimization, is presented. The first problem is solved and is shown how it is possible to create a general path using lines and arcs. The generation of a smooth path in Cartesian space is discussed and two different approaches to zone interpolation are presented. An algorithm for path generation in joint-space is formulated based upon the idea of representing the joint path with cubic splines. Finally an example shows how a Cartesian path can be generated and transformed into a spline representation in joint-space.

References

[1] Bobrow, J., Dubowsky, S., and Gibson, J. (1985). Time-optimal control of robotic ma-nipulators along specified paths. The Interna-5

(8)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 −120 −100 −80 −60 −40 −20 0 20 40 60 80 lc (a) Method 1. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 −150 −100 −50 0 50 100 lc (b) Method 2. Figure 6: d2q(lc) dl2

c for the line-circle path using the two zone interpolation methods from Section 2.3.

tional Journal of Robotics Research, 4(3):3– 17.

[2] Cao, B., Dodds, G., and Irwin, G. (1997). Constrained time-efficient and smooth cu-bic spline trajectory generation for industrial robots. In IEE Proceedings Control Theory and Applications, volume 144, pages 467 – 475.

[3] Chang, Y.-H., Lee, T.-T., and Liu, C.-H. (1992). On-line approximate cartesian path trajectory planning for robotic manipulators. IEEE Transactions on Systems, Man and Cy-bernetics, 22(3):542 – 547.

[4] Chernousko, F. (1994). Optimization in con-trol of robots. International Series of Numeri-cal Mathematics, 115:19–28.

[5] de Boor, C. (1978). A Practical Guide to Splines. Springer-Verlag. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1x 10 −5 lc

(a) Zone interpolation method 1.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1x 10 −5 lc

(b) Zone interpolation method 2.

Figure 7: Evaluation of path error, k ˆP(lc) P(lc)k, for line-circle path.

[6] Luh, J. and Lin, C. (1981). Optimum path planning for mechanical manipulators. Trans-actions of the ASME, 102:142–150.

[7] Norrl¨of, M. (2003). On path planning and optimization using splines. Technical Report LiTH-ISY-R-2490, Department of Electrical Engineering, Link¨opings universitet.

[8] Nystr¨om, M. (2003). Path generation for in-dustrial robots. Master’s thesis, Link¨oping In-stitute of Technology (LiTH), Link¨oping, Swe-den. In Swedish.

[9] Nystr¨om, M. and Norrl¨of, M. (2003). Re-sultat fr˚an simuleringar av splinebaserade bangenereringsalgoritmer. Technical Re-port LiTH-ISY-R-2505, Institutionen f¨or Sys-temteknik, Link¨opings universitet.

[10] Spong, M. W. and Vidyasagar, M. (1989). Robot Dynamics and Control. Wiley.

References

Related documents

Although ecological studies have continued to reveal strong associations between characteristics of urban areas and the locations of certain types of offences,

“I think the idea generation process is very spontaneous … you cannot plan to get that creative idea” – Se Looking at the data there is an obvious need for flexibility in order

The safety margin generation, with its proposed polygon approximation algorithm, could be improved by canceling the restriction of having vertices of the resulting polygonal chain at

I wanted to place the mirror installation high enough for people to have to make an effort to look through it, so the looking becomes both a playful and physical action.. The

Abbreviations: 4D Flow MRI, Four dimensional flow magnetic resonance imaging; AAo, Ascending aorta; BSA, Body surface area; CI, Confidence interval; CMR, Cardiovascular

Det kan nämnas i relation till polisens befogenheter enligt tillsynslagen att också, för att hindra att en hund orsakar skada eller olägenhet, ett beslut om

Between February 2009 and February 2011, 53 patients who had undergone percutaneous coronary intervention (PCI), coronary artery bypass surgery (CABG) and/or pharmacological

The ambiguous space for recognition of doctoral supervision in the fine and performing arts Åsa Lindberg-Sand, Henrik Frisk &amp; Karin Johansson, Lund University.. In 2010, a