6
Path generation for industrial robots * M. Nystr ¨ om 1 , M. Norrl ¨ of 2 Department of Electrical Engineering, Link¨ oping University, SE-581 83 Link¨ oping, Sweden 1. e-mail: [email protected] 2. e-mail: [email protected] 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]. 1

10.1.1.150.5358

Embed Size (px)

Citation preview

  • Path generation for industrial robots

    M. Nystrom1, M. Norrlof2

    Department of Electrical Engineering,Linkoping University, SE-581 83 Linkoping, Sweden

    1. e-mail: [email protected]. e-mail: [email protected]

    Abstract

    Path generation in Cartesian space is discussed and theidea of using lines and arcs to create general paths ispresented. To make smooth paths in Cartesian spacezones are introduced and two different ways to inter-polate zones are given. An algorithm for transforminga Cartesian path into a cubic spline representation injoint space is presented and also evaluated in an ex-ample. An important aspect of the proposed algorithmis that the resulting path in joint-space has a boundedCartesian 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 bythe increasing need for improved motion perfor-mance in several robot applications such as lasercutting, laser welding, machining, assembly andmaterial 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 inputto the next step, the trajectory planning and opti-mization, it does have an impact on the resultingtrajectory. The two problems are often consid-ered as one, see for example [4, 1, 2, 6]. Many ofthe early contributions only covers point-to-pointThis work was supported by the VINNOVA Compe-

    tence Center ISIS at Linkoping University

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

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

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

    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 theresults presented in [8], [9], and [7].

    1

  • 2 The path in Cartesian spaceThe first step in path generation is to create a pathin Cartesian space. Here it will be assumed thatthe 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 (ortool) is in general composed by connecting anumber of lines and arcs, where each line andarc is referred to as a segment. Each segment hasa parametric representation p(lc) where lc is thelength of the segment (in m). A line segment isrepresented by a first order spline and the arc isrepresented by p(lc) = Tp(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 framewith origin in the center of the circle. r is the ra-dius of the circle and lc is the index varying fromzero to the length of the arc. T is a homogeneoustransformation matrix (see e.g. [10]) expressingthe coordinate transformation between the localcoordinate frame and the global coordinate frame.

    2.2 Introduction of zones

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

    zon 1

    zon 2

    segment 1segment 2

    segment 3

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

    During the interpolation a normalized index isused. This means that each segment is given anew index l, where l [0, 1]. In the intersectionpoint with zone j, index for segment i, li, has thevalue 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 indexof the second segment of the zone. For zone 1 inFigure 1 this means that lz is 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 thedistance from the beginning of the zone to theconnection point could be seen as a braking dis-tance. The distance from the connection point tothe end of the zone could similarly be consideredas acceleration distance. If the braking and the ac-celeration take place simultaneously during a time , then a point pi,1 should be reached on the firstsegment and a point p(i+1),1 on the second seg-ment. If these two points are seen as vectors fromthe connection point of the two segments, the cor-responding point on the interpolated path is givenby pi,1 + p(i+1),1, see Figure 2. This procedurecontinues until, on the first segment, the connec-tion point is reached, and on the second segment,the end point of the zone is reached.

    y0O 0

    z0

    x0

    p1,1

    p2,1

    pp

    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 accelerationalong the path can be used as an interpretation ofthe process of interpolation. The index and theindex lzj of zone j are related through

    = 1 +lzj

    l(j+1)zj, (2)

    which gives [0, 2]. For a given and a given

    2

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

    dli+1d . Two different choices of

    these derivatives will be presented below.

    2.3 Examples of zone path interpolationA fundamental requirement when constructingthe zone path is that the resulting path should becontinuous with continuous derivative and prefer-ably a continuous second derivative. These re-quirements can be transformed into requirementson the second derivatives d2li

    d2and d

    2li+1d2

    .

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

    A constant second derivative of index l, withrespect to , gives the first derivatives of index l asthe solid lines shown in Figure 3. This method ofzone interpolation will be referred to as Method1. The values of the normalized indices li and li+1are given by the integrations

    li = 1 2

    dlidx

    dx, (3)

    li+1 =

    0

    dli+1dx

    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 ofthe second derivative of the index at = 0 and = 2, the second derivative of the path, d

    2p(lc)dl2c

    ,

    will not be continuous at the beginning and theend of the zone. A smaller discontinuity can beachieved with the derivative of the index as thedash-dotted lines shown in Figure 3 and this in-terpolation method will be referred to as Method2. The indices are here calculated according to (5)and (6).

    li = 1 2

    ((1 lizi)(1 x2 ) + (1 lizi)

    12(cos(

    pix2 ) + 1) (1 x2 )()

    )dx

    (5)

    0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

    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

    d2and d

    2li+1d2

    (described in(5), (6), and (7)).

    li+1 =

    0

    (l(i+1)zix

    2+ l(i+1)zi

    12(cos(

    pix2 + pi) + 1) x2()

    )dx

    (6)

    Here () is constructed as two connected secondorder polynomials.

    () ={k2 + 1 when 1k( 2)2 + 1 when > 1 (7)

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

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

    3.1 An algorithm for path generation injoint space

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

    Algorithm 1 requires that index lc is used. Asdescribed in Section 2.3, index lz , which is basedon the normalized index l [0, 1] is used in the

    3

  • Algorithm 1 Joint path interpolation.n = number of breakpoints in each splinelc = 0hlc = distance between breakpointswhile not end of section do

    for i = 0 to n 1 doCompute pi for index lc + hlci and com-pute the corresponding joint angle qi withinverse kinematics.

    end forCalculate dq0dlc and

    dq(n1)dlc

    .

    Compute the complete cubic spline q(lc).Adjust the spline interpolation length basedupon the computed error P(lc)P(lc).

    end while

    interpolation of the zone paths. The relationshipbetween index lc and lz can be approximated by

    lc =lzlz

    P(lz + lz)P(lz) . (8)

    Since no inverse function of (8) can be found eas-ily, this equation also, by iterations, gives the so-lution to an index lz for a specific lc. In order forthe transformation to succeed, it is important thatthe approximation error in (8) is kept small.

    In Algorithm 1 the maximum deviation of theactual path from the desired path is used to eval-uate each computed spline. This deviation canbe approximated with the deviation in betweeneach two adjacent breakpoints of the spline func-tion, i.e. points given by index lc + hlc2 , . . . , lc +(2n 3)hlc2 . The joint angles correspondingto these indices are transformed into Cartesianspace using forward kinematics, and then com-pared to the desired Cartesian path. To computethe splines in joint space a complete spline isused, see e.g. [5].

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

    given by

    maxxixxi+1

    |s(x) f(x)| < 5384

    Mh4 , (9)

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

    |f (4)(x)| M , xi 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 thelength of the spline can be constructed.

    Large values of and in Algorithm 2 resultin a smaller value of h, i.e. a shorter length be-tween the breakpoints, when the current deviationis close to the specified maximum value, .

    Algorithm 2 Adjust the spline length. = P(lc) P(lc) = maximum value of x = /if x > 1 then

    i = x1/4

    if i > thenh = h i

    elsekeep h

    end ifelse

    r = 1x1/4if r > thenh = h r

    elseh = h

    end ifend if

    4 An example

    The algorithms presented in this paper will nowbe 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. Formore details on the robot and the kinematics see[8].

    4

  • Link/joint i ai i dii [rad] [m] [rad] [m]1 pi/2 0.15 0 0.4752 0 0.6 pi/2 03 pi/2 0.72 0 0

    Table 1: Denavit Hartenberg parameters for athree-link robot.

    The line is defined by a start and end point, p1and 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.5

    )p2 =

    (0.7 0.2 0.5

    )p3 =

    (0.85 0.35 0.5

    )p4 =

    (0.74 0.49 0.5

    ) (11)The segments, together with the two differenttypes of zone paths, can be seen in Figure 4.The dotted zone path is generated according tointerpolation method 1 and the solid zone pathis generated with method 2. The path is next

    0.650.7

    0.750.8

    0.850.9

    0.951

    00.1

    0.20.3

    0.40.5

    0.34

    0.36

    0.38

    0.4

    0.42

    0.44

    0.46

    0.48

    xy

    z

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

    transformed into cubic spline functions in jointspace (Algorithm 1) using two breakpoints in ev-ery spline function [8]. The maximum alloweddeviation error is set to 105 meters. The resultsof the transformation can be seen in Figures 5to 7. In Figure 5 the knots for the splines gen-erated by the algorithm in joint space is shownwhen the zone is generated according to interpo-lation method 1, a similar result but with somemore knots is achieved for method 2. In Figure 6

    the resulting d2q(lc)dl2c

    using the two zone interpola-tion methods from Section 2.3 is shown. Method1 has a lower peak value of the second derivativewith respect to lc while method 2 gives a continu-ous second derivative. In Figure 7 the path error isevaluated for the two different interpolation meth-ods and it is shown that the error is kept inside theupper bound, 105 meter, along the path in bothcases. Notice that since the interpolated path isdifferent in the zone the total length of the path isdifferent in the two cases.

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.71.5

    1

    0.5

    0

    0.5

    1

    1.5

    2

    2.5

    lcq(lc)

    Figure 5: Location of breakpoints for the splinesin joint space for the zone interpolation accordingto method 1.

    5 ConclusionsThe idea of dividing the trajectory genera-tion problem into two sub-problems, pathplanning/generation and dynamic plan-ning/optimization, is presented. The firstproblem is solved and is shown how it is possibleto create a general path using lines and arcs. Thegeneration of a smooth path in Cartesian space isdiscussed and two different approaches to zoneinterpolation are presented. An algorithm forpath generation in joint-space is formulated basedupon the idea of representing the joint path withcubic splines. Finally an example shows how aCartesian path can be generated and transformedinto 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

  • 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7120

    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.7150

    100

    50

    0

    50

    100

    lc

    (b) Method 2.

    Figure 6: d2q(lc)dl2c

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

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

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

    [3] Chang, Y.-H., Lee, T.-T., and Liu, C.-H.(1992). On-line approximate cartesian pathtrajectory 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:1928.

    [5] de Boor, C. (1978). A Practical Guide toSplines. Springer-Verlag.

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.70

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1x 105

    lc

    (a) Zone interpolation method 1.

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.70

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1x 105

    lc

    (b) Zone interpolation method 2.

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

    [6] Luh, J. and Lin, C. (1981). Optimum pathplanning for mechanical manipulators. Trans-actions of the ASME, 102:142150.

    [7] Norrlof, M. (2003). On path planning andoptimization using splines. Technical ReportLiTH-ISY-R-2490, Department of ElectricalEngineering, Linkopings universitet.

    [8] Nystrom, M. (2003). Path generation for in-dustrial robots. Masters thesis, Linkoping In-stitute of Technology (LiTH), Linkoping, Swe-den. In Swedish.

    [9] Nystrom, M. and Norrlof, M. (2003). Re-sultat fran simuleringar av splinebaseradebangenereringsalgoritmer. Technical Re-port LiTH-ISY-R-2505, Institutionen for Sys-temteknik, Linkopings universitet.

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

    6