an unconstrained nonlinear least-square method of optimization of rrrr planar path generators

11
Mech. Mach. Theory Vol. 23, No. 5, pp. 343-353, 1988 0094-114X/88 $3.00+0.00 Printed in Great Britain. All rights reserved Copyright © 1988PergamonPress pie AN UNCONSTRAINED NONLINEAR LEAST-SQUARE METHOD OF OPTIMIZATION OF RRRR PLANAR PATH GENERATORS JORGE ANGELES, ANDREAS ALIVIZATOS and RALPH AKHRAS Department of Mechanical Engineering, Robotic Mechanical Systems Laboratory, McGill Research Centre for Intelligent Machines, McGill University, Montr6al, Qu6bec, Canada H3A 2A7 (Received l0 November 1986; in revised form 17 May 1988) Al~traet--A novel method of optimum synthesis of planar RRRR linkages for path generation is presented here. The method allows the formulation of the problem as one of unconstrained nonlinear least-square optimization. This is achieved by (i) computing the values of the input angle at the various configurations, associated with the given discrete set of trajectory points, separately from the optimization iterations; (ii) using the Cartesian coordinates of the joint centers, in a reference configuration, as design variables; and (iii) applying the Newton-Gauss method with Householder reflections, damping, and continuation. In this way the number of design variables is equal to eight, regardless of the number of given trajectory points, and inequality constraints are avoided. Moreover, problems of branching are eliminated. The examples included here show attractive convergence properties. I. INTRODUCTION The applicability of the four-bar linkage has encour- aged the investigation of a variety of optimization methods and formulation techniques[I-5]. In this context, a performance index is defined that repre- sents the linkage performance quantitatively. This is to be minimized by a proper choice of the linkage dimensions. Then, a set of simultaneous nonlinear equations is formed that represents the relationships between dependent and independent parameters and, finally, the performance index is minimized to obtain the optimum values of the said linkage dimensions. Fox and Gupta[6] provided an overall review and summary of the relationship between optimization methods and mechanism synthesis. It is apparent from that review that, due to the highly nonlinear nature of the resulting optimization problem, the techniques used are often very cumbersome and computationally costly to apply. On the other hand, Angeles[7] and, more recently, Wilde[8] designed function-generating mechanisms using a nonlinear regression procedure referred to as error linearization or Newton-Gauss method. Paradis and Willmert[5], in turn, introduced a constrained Gauss technique for solving the problem via linear inequality constraints while satisfying the Kuhn-Tucker conditions. It is quite evident from the above that numerous linkage- optimization techniques have been devised to design optimum linkages for rigid-body guidance, function- generation and path-generation tasks. However, almost all of the above techniques utilize inequality constraints and, thus, ad hoc methods must be intro- duced for each individual design or application. Furthermore, a serious drawback of optimization problems with inequality constraints is that their solutions are not continuous functions of the data. On the contrary, the solutions of least-squares prob- lems, whether linear or nonlinear and constrained or unconstrained, are continuous functions of the data. Hence, knowing the solution of a least-square prob- lem for a given set of data, the solution of the same problem with slightly changed data is, correspond- ingly, slightly different from the solution of the original problem. Hence, a technique known as con- tinuation, described in detail in Section 4, can be applied, which guarantees convergence of the pro- cedure to a solution, regardless of how far from the solution the initial guess lies. This paper addresses the problem of determining the optimum dimensions of a four-bar RRRR planar linkage, Fig. 1, so that a point, P, of its coupler link describes a trajectory passing as closely as possible to a given discrete set of points {Ql}~'. To this end, a simplified approach to the linkage-optimization problem is introduced, that is based on the elimi- nation of inequality constraints from the outset. This is achieved by using the eight Cartesian coordinates of points A, B, C and D (see Fig. 1) as design parameters. A unique input angle ~,i is evaluated separately for each given trajectory point Q~ at each iteration, thereby eliminating these angles from the set of unknowns in the optimization problem. The objective function to be minimized is the sum of the squares of the differences between desired and gener- ated point coordinates. Moreover, a normality condi- tion is used as an implicit equality constraint, which is verified independently from the optimization pro- cedure and permits the straightforward deter- mination of angles {~i}~'. This allows the formulation of the problem as an unconstrained overdetermined nonlinear algebraic system of equations, whose least- 343 M.M.T. 23/5---B

Upload: jorge-angeles

Post on 25-Aug-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Mech. Mach. Theory Vol. 23, No. 5, pp. 343-353, 1988 0094-114X/88 $3.00+0.00 Printed in Great Britain. All rights reserved Copyright © 1988 Pergamon Press pie

AN UNCONSTRAINED NONLINEAR LEAST-SQUARE METHOD OF OPTIMIZATION OF RRRR

PLANAR PATH GENERATORS

J O R G E A N G E L E S , A N D R E A S A L I V I Z A T O S and R A L P H A K H R A S Department of Mechanical Engineering, Robotic Mechanical Systems Laboratory, McGill Research

Centre for Intelligent Machines, McGill University, Montr6al, Qu6bec, Canada H3A 2A7

(Received l0 November 1986; in revised form 17 May 1988)

Al~traet--A novel method of optimum synthesis of planar RRRR linkages for path generation is presented here. The method allows the formulation of the problem as one of unconstrained nonlinear least-square optimization. This is achieved by (i) computing the values of the input angle at the various configurations, associated with the given discrete set of trajectory points, separately from the optimization iterations; (ii) using the Cartesian coordinates of the joint centers, in a reference configuration, as design variables; and (iii) applying the Newton-Gauss method with Householder reflections, damping, and continuation. In this way the number of design variables is equal to eight, regardless of the number of given trajectory points, and inequality constraints are avoided. Moreover, problems of branching are eliminated. The examples included here show attractive convergence properties.

I. INTRODUCTION

The applicability of the four-bar linkage has encour- aged the investigation of a variety of optimization methods and formulation techniques[I-5]. In this context, a performance index is defined that repre- sents the linkage performance quantitatively. This is to be minimized by a proper choice of the linkage dimensions. Then, a set of simultaneous nonlinear equations is formed that represents the relationships between dependent and independent parameters and, finally, the performance index is minimized to obtain the optimum values of the said linkage dimensions.

Fox and Gupta[6] provided an overall review and summary of the relationship between optimization methods and mechanism synthesis. It is apparent from that review that, due to the highly nonlinear nature of the resulting optimization problem, the techniques used are often very cumbersome and computationally costly to apply. On the other hand, Angeles[7] and, more recently, Wilde[8] designed function-generating mechanisms using a nonlinear regression procedure referred to as error linearization or Newton-Gauss method. Paradis and Willmert[5], in turn, introduced a constrained Gauss technique for solving the problem via linear inequality constraints while satisfying the Kuhn-Tucker conditions. It is quite evident from the above that numerous linkage- optimization techniques have been devised to design optimum linkages for rigid-body guidance, function- generation and path-generation tasks. However, almost all of the above techniques utilize inequality constraints and, thus, ad hoc methods must be intro- duced for each individual design or application. Furthermore, a serious drawback of optimization problems with inequality constraints is that their

solutions are not continuous functions of the data. On the contrary, the solutions of least-squares prob- lems, whether linear or nonlinear and constrained or unconstrained, are continuous functions of the data. Hence, knowing the solution of a least-square prob- lem for a given set of data, the solution of the same problem with slightly changed data is, correspond- ingly, slightly different from the solution of the original problem. Hence, a technique known as con- tinuation, described in detail in Section 4, can be applied, which guarantees convergence of the pro- cedure to a solution, regardless o f how far from the solution the initial guess lies.

This paper addresses the problem of determining the optimum dimensions of a four-bar RRRR planar linkage, Fig. 1, so that a point, P, of its coupler link describes a trajectory passing as closely as possible to a given discrete set of points {Ql}~'. To this end, a simplified approach to the linkage-optimization problem is introduced, that is based on the elimi- nation of inequality constraints from the outset. This is achieved by using the eight Cartesian coordinates of points A, B, C and D (see Fig. 1) as design parameters. A unique input angle ~,i is evaluated separately for each given trajectory point Q~ at each iteration, thereby eliminating these angles from the set of unknowns in the optimization problem. The objective function to be minimized is the sum of the squares of the differences between desired and gener- ated point coordinates. Moreover, a normality condi- tion is used as an implicit equality constraint, which is verified independently from the optimization pro- cedure and permits the straightforward deter- mination of angles {~i}~'. This allows the formulation of the problem as an unconstrained overdetermined nonlinear algebraic system of equations, whose least-

343 M.M.T. 23/5---B

Page 2: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

344 JORGE ANGELES et al.

Q,t~.. ~,)

~ . r C(=c,~c)

Fig. I. RRRR planar path-generating linkage.

square approximation will produce the optimum linkage. The Newton-Gauss scheme was adopted to solve efficiently the above numerical problem. In the sections that follow a detailed analysis of the solution is included. Numerical examples pertaining to the generation of a line segment and a portion of a circular arc are given.

2. PROBLEM FORMULATION

The objective of the kinematic-synthesis problem discussed here is to design a four-bar R R R R planar linkage whose coupler point generates a trajectory with the minimum root-mean-square (r.m.s.) error. Figure 2 shows a four-bar linkage in its ith prescribed configuration, where X Y is a fixed reference plane, AB is the input link, BC is the coupler link, CD is the follower and AD is the fixed link. Points B, P~ and C define a rigid body, P~(x~, y~) being the coupler point of interest, and the input angle is denoted by ~k~. The coupler angle 0,. can be expressed in terms of the linkage dimensions al, a2, a3, a4 and the input angle ~,~. A detailed analysis, similar to that of Freudenstein [9], yields the following relation:

LI + L3 cos 0~ + L2 cos ~b~ = cos(0~ - ~,~), (la)

which produces the two following values of 0~:

O~"= 2arctan(B~ + ~ A~C!) At

i -- I . . . . . . m (lb)

where

Ai = LI - L3 + (L2 + 1) cos ~i (2a)

B, = sin g,, (2b)

C = Ll + L3 + (/,2 - 1) cos ~ , (2c)

and

a l - a 2 , L2=- - , L3=- - . (3) L , = a ~ - 2 ~ -a ] a, a~ 2aza3 a 3 a z

The overall linkage parameters are, a~, a 2, a3, a4, as, ~1, ~2, xA and YA. Rather than using these as design parameters, an alternate set will be adopted. The reason for this choice is that the first seven of the foregoing parameters require the following inequality constraints:

a~>0 for k = l . . . . . 5'

and 0~<~/~<2n for j = 1 , 2 ,

which introduce computational complexities and solution discontinuities, as pointed out in the Intro- duction, and hence, are to be avoided.

Dimensions al . . . . , as, ~, ~2 are now expressed in terms of the Cartesian coordinates of points A, B, C, D and P0. Since the input angles ~ are unknown, the set of unknown variables in the formulation of the linkage-optimization problem contains the Cartesian coordinates of points A, B, C and D plus the m values of angle ~ defining the m corresponding points {Q~}7, namely {~'t}~'- Note that ~b 0, corresponding to P0, has not been included as an unknown. This is so because, in this formulation, P0 is defined as {20, which is a key step of the method introduced here. In fact, this is what allows the uncoupling of the set {~b~}7' from the set of linkage parameters.

Certain considerations which served as design cri- teria in further simplifying the formulation of the problem are now discussed. The primary concern is twofold: (a) to reduce the number of unknown vari- ables from those described above, and (b) to avoid

Page 3: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Optimization of RRRR planar path generators 345

4(XA YA L l ~ a ~ zD'~ID)

x

Fig. 2. Configuration-dependent and configuration-independent parameters of path generating linkage.

the introduction of inequality constraints which will require cumbersome numerical methods and intro- duce, in turn, solution discontinuities. The set of unknown parameters, as described above, would require the introduction of additional inequality con- straints in order to ensure that the radical of equation (1) is always greater than or equal to zero. To avoid this commonly used approach[8], the present formu- lation will treat input angle ~r separately and thus eliminate the evaluation of ~r within the optimization iterations. The total number of design parameters is then reduced to eight and grouped in the 8-dimensional vector x, i.e.

x = [x~, y~, xs, ys, x c, Yc, xo, yn] r. (4)

The components of vector x are referred to as the design parameters, and are to be distinguished from the linkage parameters a~ . . . . . as, ~ , cq, xa and ya, although, obviously, the two sets have two common elements. Note that the design-parameter set is that upon which the linkage is to be optimized, and does not contain the set {~k/}~'.

2.1. Computation o f input angles ~O i

Given a linkage defined by the parameter vector x and point P0 of its coupler link, as shown in Fig. 1, a point Pr is determined on the coupler curve F lying closest to a given point Qr, of Cartesian coordinates (~r, q~), for i = 1 . . . . . m. Angle 0r is determined as that defining a particular position of coupler point P, P~, which is characterized by the fact that line QrP~ is perpendicular to the tangent to F at P~, as shown in Fig. 3, while distance QrP, is a global minimum over all possible values of ~O. The coordinates of the coupler point P(x, y ) can be expressed in terms of the

linkage dimensions as follows:

X = X A ~- a 2 COS(0~ 1 ,-~ • ) --[- a 5 cos (~1 + ~2 + 0); (5)

Y = YA + a2 s i n ( ~ + ¢ ) + a5 sin (~ + ~2 + 0) . (6)

The distance between Qr and Pr, dr, is defined in terms of the Euclidean norm of the ith error vector ei, defined in turn as:

er = [x - ~;, y - ~h]r; (7a)

and hence,

d~ -= er(¢)rer(¢) = (x - ~r) 2 + (y - ~/r) 2. (7b)

Therefore, the problem of finding ¢~ is solved via minimizing 4 over ~, i.e., one has to solve the following problem:

z,(¢) - 2 _ ere, ~ min dr - (8)

Furthermore, at point Pr the derivative of z,(#) must vanish. This condition is the normality condition of this problem. The derivative of zr(~b) is given as:

0z,(q/) z~(q,) = <T(~) ~ = o, (9)

where e~(~) is defined as:

(lO) e~(~)=Ld(v ~,)Id~J LJ(~)J" From equations (5) and (6),

x'(~b) = - a 2 sin(~ + ~,)

- a s s i n ( ~ l + ~ + O ) O ' ( # ) , ( l l a )

y'(~k) = a2 COS(~l + ~)

+ a5 cos(~l + ~2 + 0)0'(~k), (11 b)

Page 4: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

346 JORGE ANGELES et al.

P0 ~ Oo{~o,etao} f Q2(¢2,~2} _

~B(,~.y~ (*c, vc)

~...,x, ° ~ ~ D , ~ o )

Fig. 3. Normality condition of points of coupler curve whose distance to given trajectory points is a minimum.

where 0'(~b) is calculated as described in detail in the Appendix. The final form of the equation deter- mining ~b~ becomes:

g,(~'i) = (x - ~)x'(@,) + (y - r/~)y'(~b~) = 0. (12)

In order to avoid the use of higher order deriva- tives, and to account for the singularities of equation (9), a combination of the secant and bisection meth- ods [10] is adopted to solve equation (12). It should also be noted that a special numerical treatment is needed when the driving link is not a crank and P~ lies close to a dead-end position since both components of e;(~) vanish at that extreme point. However, cusps [11] present no particular numerical difficulty. An important feature of the foregoing method is that the resolved input angle ~b~ remains within range, that is, the radical of equation (1), B~-A~Ci, is always greater than or equal to zero. Thus, when evaluating the coupler angle 0~ from the quadratic equation (1), two real roots 0~, and 0~2 are always identified, each pertaining to one of the two conjugate configurations of the linkage, one for each sign of the solution of the said quadratic equation. Which configuration to choose is explained next: as shown in Fig. 3, initially an RRRR planar linkage is given with coupler point P0 generating a trajectory F. This can be either unicursal or bicursal, as discussed in [12]. In the first case, then, the proper configuration is chosen simply as that minimizing d~ for both signs of the solution. In the second case, the proper configuration is chosen depending upon the sign associated with the configuration at P0, thereby avoiding the problem of branching: Details of the foregoing discussion are given in [13].

2.2. Computation of the linkage parameters

A discrete set of trajectory points, as indicated in Fig. 3, is prescribed, namely,

Q0(¢0, r/0), Q,(~l, r/l) . . . . . Q,(~,,, r/m).

Furthermore, an initial guess of the eight design parameters xA, YA, XB, Ya, XC, YO XD and YD is assumed to be available. In the absence of such an initial guess, the user can specify one arbitrarily. Point P0 is now defined as Q0(~0, r/0), thereby completing a linkage configuration at that position (see Fig. 3). The next step is to determine points P~, . . . , Pm of F that lie closest to the corresponding trajectory points QI . . . . . Q,~, as shown in the previous section, from the corresponding input angles ~,~ . . . . . @m. With all input angles evaluated, the problem then consists of computing a new set of design parameters that will diminish the error between the required and the generated positions. The above procedure is per- formed iteratively until no further improvement is possible, which means that satisfactory convergence is accomplished.

The problem at hand consists of computing eight design parameters given in equation (4) which will produce a minimum least-square error h(x) defined next. We rewrite equations (5) and (6) for any coupler-point position as

xt -- xA + a2 cos(~q + ~'i) + as cos(a, + ~ + 0~) (13)

y~ = y~ + a2 sin(,,, + ¢J~) + as sin(~,, + ~'2 + 0~);

i ---- 1 . . . . . m. (14)

Now let,

p = [xl, x2 . . . . . x,.,yl, Y2 . . . . . ym] r , (15)

Page 5: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Optimization of RRRR planar path generators

q _ [¢~, ~: . . . . . ¢,,, q~, r h . . . . . r/,,] r, (16)

where p is a 2m-dimensional vector of coordinates of coupler points P~ and q is a 2m-dimensional vector of coordinates of given trajectory points {Q~}T.

The proposed kinematic problem reduces then to the following unconstrained minimization problem:

h(x) = }(p - q)rW'(p - q) --, rain, (17)

where W serves as a weighting factor of the objective function and is of the following form:

W = diag(w~, w: . . . . . w:,,);

0 < w i < l ; i = 1 . . . . ,2m. (18)

Matrix W accounts for possible scalings and nor- malizations that may be necessary in order to render h(x) nondimensional. In this formulation, we are interested in the r.m.s, error and thus, W is chosen as

1 W = ~m 1, (19)

where 1 is the identity 2m × 2m matrix. Hence, the problem is reduced to finding the least-square ap- proximation of the following overdetermined non- linear algebraic system:

1 fix) = ~ (p - q) = O. (20)

The total number of equations is 2m and the total number of unknowns is 8 + m. Thus, if the number of prescribed points is greater than eight an over- determined nonlinear system of equations arises. If m = 8--equal numbers of equations and unknowns--the problem is determined but a unique solution is not guaranteed due to the nonlinear nature of the problem. In fact, by virtue of the Roberts-Chebyshev Theorem[Ill, this problem is known to admit three distinct solutions, which thus define three cognate mechanisms. If m < 8--more unknowns than equations--infinitely many solutions can be expected. In this case, the designer has the freedom to choose the best linkage out of all the feasible ones by taking into account factors such as cost, space availability, weight, etc. Alternatively, the designer could increase the number of trajectory points by interpolation from the given data. In what follows we will be concerned with the case m t> 8, and so, will regard the solution of equation (20) as one of least-square approximations. The least- square approximation sought is found using the Newton-Gauss procedure[14, 15] with Householder reflections[16], continuation[17], and damping[18].

The Newton--Gauss procedure requires the evalu- ation of the Jacobian matrix J(x) where

Of 1 Op (21) s ( x ) = 0--; = ~ 0 x

347

The following scheme is adopted to evaluate the Jacobian matrix J(x): From equations (13, 14 and 19),

d f [dx~ da2 dx = ~ + ~ x c ° s (~ l + ~k~) - a2 sin(~, + ~k~)

/'d~l d~b~'X da5 × + cos( , + + 0,)

- as sin(~ + ~ + 0,)

[ d ~ d~: dO~\q/ (22)

df +" = [-dY" + - ~ sin(~t +~O,) dx LaX a x

+ a~ c°s(~' + ~b~)(~--~ + d~b'~ ~ x ]

da~ + ~ sin(~ + ~2 + Oi)

+ a5 cos(~ + ~2 + 0~)

~.dx +~xx + w/2-m;

i = 1 . . . . . m, (23)

where a2, as, ~ and ~2 are expressed in terms of x and thus da2/dx, das/dx, d~l/dX and d~Jdx are evaluated explicitly, as shown in the Appendix. 0~ is a function of x and g% ¢, being itself an implicit function of x. Therefore,

dOi OOi OOi d~bi - + (24)

dx 0x 0~btdx

In order to evaluate d~bJdx we use the function g~ defining ~k, in equation (12), except that, now, ~b is not the only variable of g, Indeed, it contains x as a parameter and additional arguments, depending upon ~,~, namely 0(~b,) and 0 '(~). Now, equation (12) defines the set {~b,}T for the given set {Q~}~', via vector x. Hence, ~b~, as produced by equation (12), is, in fact, a function of x. The latter functional relations are not direct, but via function ~b,(x), i.e. one has

g, = g,(x; ~0,, 0,, 0~) = O. (25)

What we need in the following discussion is the derivative of ~O~ with respect to x, which can be obtained by differentiation of equation (25) with respect to x, namely,

dg, Og, Og, dOi Og, dO, Og, dO;=o. (26) dx = 0x + + + 00--7 d x

Now, since 0~ is a function of x, ~, and 0~,d0~/dx becomes:

d0~ 00~ d0~dd/, 00~d0, (27) dx - 8x ~- ~ ~ x -~ dO, d x '

where

aO_~; = 020, (28)

Page 6: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

348 JORGE ANGELES et al.

and

O0; 020i 80---~ = ~ , (29)

00~ 020i c30-- T = O0, c3~," (30)

Combining equations (26 and 27), d$~/dx is evaluated as:

d~ki ni . . . . , (31) dx Di

where n~ is an 8-dimensional vector, whereas the denominator D~ is, of course, a scalar. These are:

g,8O, 8o; n,= - \ O x + ~ x x + O - - ~ - x 4 dO, dOg'x]" (32a)

and

£3gi + Ogi ~Oi Ogi 80~ 8g i 00~ t30 i

thereby completing all the computations required to evaluate the Jacobian. The foregoing derivations allow the computation of the design parameters. The linkage parameters are then computed from these via the formulae included in the Appendix.

3. N U M E R I C A L S C H E M E

The Newton--Gauss method can be readily applied to find the least-square approximation of f (x)= 0. This is an iterative procedure with attractive con- vergence properties[7] that produces a mono- tonically-decreasing sequence S of h values, namely.

S: h ( x 0 ) > h ( x l ) > ' ' ' > h ( x k ) > h ( xk + l ) > ' ' '

to a first-order approximation. Moreover, near a minimum point:

Ah -= (Vh)r Ax ,~0 (33)

The convergence criteria are next stated. For func- tion h(x) to reach a minimum, it must first reach a stationary point, i.e. its gradient must vanish. It was shown that Vh = j r f and thus, from equation (33), the two convergence criteria are:

(a) Vh(x k) = Jr(xk)f(x~) = 0; (b) Ax k ~ 0.

The overall iterative procedure is the following:

(i) Read: (i.1) initial guess

x ° = [x~, YA, xB, YB, Xo Yo xo, YD]r; (i.2) trajectory data {Q,}g'.

(ii) Set Po =-- Qo and evaluate the linkage dimen- sions at, • • • , as, ~1, ~2.

(iii) Evaluate the input angles $~ and coupler angles 0~ with proper configuration choice---

(xiii) (xiv ) (xv)

( xvii )

i.e. proper choice of sign in equation (1)---, corresponding to points Pi closest to tra- jectory points Q~, for i = 1 . . . . , m.

(iv) Evaluate fix). (v) Evaluate the maximum norm of f(x), rather

than its Euclidean norm, for economy of computations.

(vi) Test if the number of iterations at this point exceeds the maximum allowable. If it does, stop the procedure; otherwise, go to next step.

(vii) Evaluate the Jacobian matrix d(x). (viii) Evaluate Ax using Householder reflections

and back substitution. (ix) Evaluate the maximum norm of Ax. (x) Evaluate the gradient Vh and its maximum

n o r m .

(xi) If the maximum norms of Vh and Ax are less than given tolerances, the procedure has converged and it stops. Otherwise,

(xii) update x and re-evaluate dimensions al, . • • , 05, ~1, ~2. Update f(x). Evaluate the maximum norm of f(x). If the norm of step (xiv) is less than the given tolerance, the procedure has con- verged to a global minimum, namely to a zero error minimum, and it stops--in gen- eral, this is not expected to occur, but in some instances it happens; for example, when m = 8, the system of equations (20) is determined, and a zero-error approxi- mation is possible. Otherwise,

(xvi) if the norm of step (xiv) is less than the norm in step (v), go to step (v) and the iteration count is incremented. Otherwise, perform damping on Ax to reduce the step size of Ax and go to step (xii). This is needed whenever the presence of higher- order terms of h(x) becomes relevant and the sequence S fails to be monotonically decreasing.

As to the computational complexity of the pro- cedure, which is measured in number of floating- point operations, it should be pointed out that this grows linearly with the number of given trajectory points to be matched, i.e. with m. In fact, steps (iii), (iv), (vii), (viii), (x) and (xiii) involve computations which clearly grow linearly with m. The crucial step of evaluating Ax in step (viii) involves a linear complexity in m, but this is not as apparent. It will become clear by recalling the number of operations required by each step of the Householder algorithm in finding the least-square approximation of an overdetermined linear algebraic system. The said steps and their computational requirements are the following[16]:

(a) To reduce an arbitrary m × n matrix to upper- triangular form, M a multiplications and A a additions

Page 7: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Optimization of RRRR planar path generators

are needed, these figures being given below:

n + 3n 2 - n 3 M. = 3 b n2m'

5n + 3n 2 - 2n 3 As = 6 Jr n 2m.

(b) The application of n Householder reflections to an arbitrary m-dimensional vector requires M b multi- plications and Ab additions, which figures are given next:

Mb = 3n --nE + 2nm, Ab = n --n2 + 2nm.

(c) The back-substitution introduced in solving an n x n lower-triangular system requires M c multi- plications and Ac additions, these figures being as follows:

n(n + 1) n(n + 1) Me= , A ~ - - - -

2 2

If, in the foregoing formulae, n is replaced by 8, which is the number of unknowns, regardless of the number of prescribed points, then, the following figures are derived:

M a = 6 4 m - 1 0 4 , A a = 6 4 m - 1 3 2

Mb = 16m -- 40, Ab = 16m -- 56

M c = 36, A c = 36.

From the foregoing discussion, it is clear that the computational complexity of the algorithm is linear in the number of trajectory points to be matched.

The likelihood and the speed of convergence of the foregoing procedure are enhanced by the intro- duction of continuation, an item that is briefly discussed in the next Section.

4. CONTINUATION

Both the Newton-Raphson and the Newton- Gauss methods are known to have a quadratic con- vergence rate near a solution[14]. The idea behind continuation is to exploit this property and hence accelerate the convergence rate of a Newton-type method. This is needed because, in any practical situation, a given initial guess will most likely lie away from a solution. Continuation works as follows: write function f(x), whose Euclidean norm is to be mini- mized as f(x; s), thereby showing explicitly the de- pendence of f upon a set of p parameters grouped in the p-dimensional vector s. For example, in the problem under study, s will be composed of the 2(m + 1) Cartesian coordinates of the problem data {Q~}g'. Moreover, assume that an arbitrary linkage, represented by x °, is given as an initial guess. The coupler curve of this l inkage can be readily deter- mined. From this, a set of points {R~}g' can be found, whose distance to the corresponding points in the given set {Q~}g' is a global minimum, and a vector s o can be defined as being composed of the 2(m + 1)

349

Cartesian coordinates of {R~}g'. Then, obviously, x ° is the least-square approximation to the following overdetermined nonlinear algebraic system:

f (x ; s °) -- O, (34)

Now, let

As _= (s -- s°)/v, (35)

for an integer value of v, s being the original problem data. Further, define the following sequence of non- linear overdetermined algebraic systems:

f,(x) - f(x; s ~) = 0, (36a)

where

s i = s °+ /As , i = l . . . . . v. (36b)

If v is chosen suitably--usually between 5 and 10---then s I lies close to s °, and an initial guess for problem (36a) that lies close to its solution will be x ° =- x(s°), where x(s °) represents the known solution to problem (35). Hence, a solution x(s l) to problem (36a) for i = 1 will be rather easy to calculate. The procedure is repeated for i = 2 . . . . , v, using as an initial guess for problem (35), for arbitrary i, the solution to the (i - l)st problem. When i = v, equa- tion (36a) will represent the given original problem.

5. EXAMPLES

In this section, three examples are presented, two for straight-line and one for circular-arc generation. An arbitrary number of trajectory points could be assigned, as long as m is greater than 8. For purposes of illustration, m was chosen as 20, i.e. the number of given trajectory points was given as 21. The effect of varying m affects mostly the time it takes to compute the desired solution, but, as described in Section 3, that time will vary linearly with the number of trajectory points to be matched.

5. I. Example 1: straight-line generation

(i) The well-known Roberts mechanism[l l] con- tains a point on its coupler link which produces a coupler curve containing a portion that approximates a straight line very accurately. The applicability of this method is illustrated by prescribing a set of 21 points along the coupler curve of a Roberts mech- anism. An initial guess is given that is far from producing a coupler curve containing the given tra- jectory points. Both the data and the initial guess are shown in Fig. 4. From the initial guess, the solution was approached with 5 continuation steps, i.e. by setting v defined in Section 4, equal to 5. In the average, less than four iterations were required within each continuation step in order to produce con- vergence. The solution was found with an r.m.s, error of 0.9465 × 10 -6. The normality condition, equation (33), was verified with a tolerance of 10 -5 in the last continuation step. However, at intermediate steps less accuracy was required. The optimum solution is

Page 8: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

350 JORGE ANGELES et al.

Fig. 4. Discrete trajectory with a straight-line segment, given by 21 points, and initial-guess linkage.

Fig. 6. Discrete trajectory with a straight-line segment, given by 21 points, and initial-guess linkage.

shown in Fig. 5. In that figure, the line defined by points A and B is matched exactly by the Roberts mechanism at the midpoint of segment AB, a well- known result. Notice that, rather than obtaining the original Roberts mechanism, one of its cognates is produced with this method. Clearly, which of the three mechanisms, the Roberts mechanism and its two cognates, is obtained, depends on the initial guess, which is apparent in this example. The total number of iterations was 19.

(ii) A second example for straight-line generation is described next. An initial linkage is first selected that describes an arbitrary coupler curve. Then, two points are chosen on this coupler curve and are joined by a line. Next, a sample of 21 points of this line is chosen, as shown in Fig. 6, and a linkage is sought whose coupler link would trace a curve approaching those 21 trajectory points with the least possible rms error. Five continuation steps were used and con- vergence was reached with an average of 7 iterations per continuation step, while the r.m.s, error was of

Fig. 5. Optimum linkage and coupler curve approaching the given trajectory points with a minimum r.m.s, error.

the order of 10 -5 . The optimum linkage is shown in Fig. 7. Notice that the initial guess is far from resembling the solution, but convergence is guaran- teed because of the use of continuation. Furthermore, the total number of iterations, 35, is a reasonable figure for this type of problem.

5.2. Example 2: circular-arc generation

A sample of 21 points from a trajectory containing a circular-arc segment is shown in Fig. 8, together with an initial-guess linkage whose coupler curve is far from the given set. The procedure was applied to find the linkage that best approximates the given discrete trajectory. Convergence was obtained within 35 iterations, the rms error obtained being of 0.5646 x 10 -s. The optimum linkage is shown in Fig. 9.

5.3. Discussion o f the results

The results of the three foregoing problems present the following features: the first and the third examples

Fig. 7. Optimum linkage and coupler curve approaching the given trajectory points with a minimum r.m.s, error.

Page 9: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Optimization of RRRR planar path generators 351

Fig. 8. Discrete trajectory with a circular-arc segment, given by 21 points, and initial-guess linkage.

produced a virtually zero r.m.s, error. In general, this is not to be expected, but in these cases this happened because the sets of given trajectory points were taken from actual coupler curves. On the other hand, the first example converged with slightly over half the number of iterations required by the second and third examples. This is explained as follows: the condition number of the Jacobian matrix[16] was estimated following a procedure described in detail in[19]. The condition number of a matrix is a measure of its ill-conditioning, so that the larger this number is, the more ill-conditioned the matrix is. The best condi- tioned matrices have a condition number of 1, whereas singular matrices have an infinitely large condition number. The maximum condition number recorded for the Jacobian matrix of Example 1 was 25, whereas a condition number as high as 50,000 was recorded for the second example. For the third example, a maximum condition number of 600 was recorded, thereby explaining the difference in convergence behaviour amongst the three examples.

6. CONCLUSIONS

A simplified method has been developed to deter- mine the optimum dimensions of an R R R R planar linkage whose coupler link describes a trajectory passing as closely as possible to a given discrete set of points. The objective, when formulating the

Fig. 9. Optimum linkage and coupler curve approaching the given trajectory points with a minimum r.m.s, error.

linkage-optimization problem, was to eliminate in- equality constraints that usually arise in this context. Thus, computationally expensive methods required to handle inequality constraints in mathematical pro- gramming were avoided. The particular feature of the aforementioned approach is to separate the variables defining the linkage, which are therefore con- figuration-independent, from those defining each configuration. This was accomplished by determining a coupler point that lies closest to each given tra- jectory point. The eight configuration-independent variables defining the linkage were expressed in terms of the planar Cartesian coordinates of the centers of the four joints defining the R R R R planar linkage. These were evaluated iteratively--starting from an arbitrary initial guess--using the Newton-Gauss method. The problem was formulated as an over- determined unconstrained nonlinear system of alge- braic equations and the objective function to be minimized was the sum of the squares of the difference between the desired and the generated coordinates of point positions. Continuation and damping techniques were integrated together with the Newton~Gauss procedure and, thus, monotonic con- vergence was accomplished for the numerical exam- ples. The total number of iterations was relatively low for these examples. The condition numbers of the Jacobian matrix were reasonably low in general. However, the second example led to a high condition number, which can be attributed to the large dimen- sional unbalance of the solution. Nevertheless, the procedure was capable of convergence even in this unfavourable situation.

Acknowledgements--The research work reported here was possible under NSERC (Natural Sciences and Engineering Research Council, of Canada) Grant No. A4532, FCAR (Fonds pour la formation de chercheurs et raide fi la recherche, of Quebec) Grant No. EQ3072 and IRSST (Institut de recherche en sant6 et en srcurit6 du travail du Qurbec) Grant No. RS-87-06.

REFERENCES

1. R. L. Fox and K. D. Willmert, Trans. ASME J. Engng Ind. 89, 144 (1967).

2. G. H. Sutherland and N. R. Karwa, Mech. Mach. Theory 13, 311 (1978).

3. B. Klein, Mech. Mach. Theory 16, 567 (1981). 4. P. W. Jensen, Mech. Mach. Theory 19, 149 (1984). 5. M. J. Paradis and K. D. Willmert, Trans. ASME J.

Mech. Transmiss. Autom. Des. 105, 187 (1983). 6. R. L. Fox and K. C. Gupta, Trans ASME J. Engng

Indust. 95, 657 (1973). 7. J. Angeles, Proc. V Wld Congr. on TMM, Montreal,

8-13 July, 1, 111 (1979). 8. D. J. Wilde, Trans. ASME J. Mech. Des. 104, 881

(1982). 9. F. Freudenstein, Trans. ASME 77, 853 0955).

10, R. L. Burden, J. D. Faires and A. C. Reynolds, Numerical Analysis, Second edn. Prindle Weber and Schmidt, Boston (1981).

I 1. R. S. Hartenberg and J. Denavit, Kinematic Synthesis o f Linkages. McGraw-Hill, New York (1964).

Page 10: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

352 JORGE ANGELES et al.

12. K. H. Hunt, Kinematic Geometry o f Mechanisms. Clarendon Press, Oxford (1978).

13. J. Angeles and O. Ma, Mech. Mach. Theory 23, 257 (1988).

14. G. Dahlquist and A. Bj6rck, Numerical Methods. Prentice-Hall, Englewood Cliffs, N.J. (1974).

15. J. Angeles, M. Habib and C. L6pez-Cajfin, Int. J. Robotics Autom. 2, 106 (1988).

16. G. H. Golub and L. C. Van, Matrix Computations. Johns Hopkins University Press, Baltimore (1983).

17. A. P. Morgan, A C M Trans. Math. Software 9, I (1983). 18. J. Angeles, Spatial Kinematics Chains. Analysis, Syn-

thesis and Optimization. Springer, Berlin (1982). 19. J. Angeles, K. Anderson, B. Chen and X. Cyril, A S M E

J. Dynamic Systems, Measmt Control 110(3), 246. (1988).

A P P E N D I X

Computation o f the Jacobian matrix J(x)

Parameters a~ . . . . , as, ~z, % can be expressed in terms of the Cartesian coordinates given in vector x as follows (See Fig. 1):

ai = ~/(xo - xa) z + (Yo - YA) 2,

a2 : , / ~ . - x : + Cv~-L3~,

a3 = ~/(Xc - xs) 2 + (Yc - Yn) 2,

a, = ~ ~ o -- Yc) 2,

a~ = ~/ (¢o - x~) ~ + (~o - y 9 2

~t = arc tan( y ° - Y~], \ x o - x ~ l

~ = arctan ( ~ ° - ~ Y ~ - a r c t a n ( y c - Y___~ \ ~ 0 - x n / \ x c - x ~ /

Derivatives of the foregoing quantities with respect to x are next shown:

da,dx [ x°-XAa, ' Y°-Ya'o'o'o'o'X°-xa'yn~YA]rai al ai .J

da2-[dxx Xs--XAa-~' Ys--Yaa2, Xs--xA'yn--YA'o'o'o'O]Ta2 a2 .J

[ IT _ _ = Xc--Xs Yc--YB Xc--Xs Yc- -Ys 0 0 da3 0 ,0 , - - - , - - -, - - , , dx a 3 a3 as a3 d

da':l-o o o,o, _.xo-Xc yo-y xo-xc, yo-yc]" dx L ' ' a4 a4 ' a4 a4 ..]

d a ' = [ 0 ¢ ° - x s r/° ", 0,0,0, 0 dx L ' 0 ' as

Now, let

Yo - Ya qo -- Ys Fc -- Ys r - , s = o _ X ~, t = "

X o -- X A XC -- Xo '

and

1 1

r ' - (1 + r 2 ) ( x o - XA)' S" - - (1 + s2)(~o - xB)'

1 IP~

(I + t 2 ) ( X c - - xs)"

Thus,

d ~ I - - = r ' [ r , - 1 , 0 , 0 , 0 , 0 , - r , 1] r, dx

O, O, [- s t 1 1 t 1 ] r = s,t,L +

t" s" t" s " s" s S 'O'Oj "

Moreover,

dx~ 1 dyA -~-x = [ , 0, 0, 0, 0, 0, 0, 0Y, ~ x = [0, 1, 0, 0, 0, 0, 0, 0y.

Computation o f O20 /dx dl#, 0201&P 2 and 020 /O0 3l#

Differentiating equation (la) with respect to $ and x, we derive c'~0/3$ and 00/dx, as follows:

00 N ~30 n

where

N = sin(l# - 0) - L 2 sin l#

OL i OL s dL 2 n = TX-x + T x cos 0 + ~ x cos~'

D = sin(l# - 0) + Lssin 0.

Thus,

Hence,

0N 0L 2 , 0x ~x sin ~,

ON - - = cos(l# - 0) - L 2 cos l#, 0l#

0N - cos(l# - 0 )

00

0D 0L 3 0x - ~x sin 0,

3 D = c o s ( 0 - ¢ ) ,

0l#

0D - - = - cos(0 - l#) + L 3 cos 0. ~0

Ox O~k D

o2o l(ON

020 ,(0N oool# O ~ 3 S ~ )

Evaluation o f gi(~k i) The equation defining l#~ for each trajectory point to be

matched can be written as

d0, g~(l#~) = a2c~ + asd i - - - asa2e ~ sin #~ = 0, Ol#,

where

c i = v~ sin 2i + w~ cos 2 i

d~ = vi sin v~ + w~ cos vi

e i = ~ i - - 1,

Page 11: An unconstrained nonlinear least-square method of optimization of RRRR planar path generators

Optimization of R R R R planar path generators 353

and

wi = Ya - rh

l ~ = v i - - A i

2i = g/ i + ~tt

Vi = Oi + Ctl "J~ ~2"

P a r t i a l der iva t ives o f gi (~b i)

Now, the partial derivatives ofg~ with respect to x, O k, O' k and ~k; are evaluated. These are

t3g; 6qa2 C3Ci 630 i t3d i c3a 5 ~ 0 i

~x = d--x c' ÷ a2 d x ÷ a s-c3~i c3 x - "6 ~ x ~ di

rda5 da2- ] d u i - L~x a2 + a~ ~ x J ei sin #i -- asa2ei cos #i ~ x = O.

where

tgci dr; tgw; &q ~x = ~xx sin 2i + ~ x cos 2~ + (vi cos )-i - wi sin 2) ~ x

0°,. ~xx = ~x sin v i + ~ x cos v, + (v, COS v i -- w i sin v,) \ d x + e x J

do--2' = [ - 1, 0, 0, 0, 0, 0, 0, 0]r dx

Ow~" = [1, O, O, O, O, O, O, o]r O x

O#, 0~2

Moreover,

dgi C30i d d i - - = a 5 - - - - - - a s a 2 e i c o s ]/i = 0 gOk a~,i ~Ok

where 04 - - = v i cos v i - w i sin v i. t30k

Furthermore,

dg; c~O~ = asc' - asa2 sin it;,

and

- - = a2(v i cos 2; - w~ sin 2;) + asa2e ~ cos v;,

thereby completing all derivatives required to evaluate the Jacobian matrix of the system of equations.

M I ~ T H O D E D ' O P T I M I S A T I O N D E M I ~ C A N I S M E S P L A N S A Q U A T R E

B A R R E S A R T I C U L I ~ E S P O U R L A S Y N T H I ~ S E D E T R A J E C T O I R E S

B A S l ~ E S U R L E S M O I N D R E S C A R R I E S S A N S C O N T R A I N T E S

R6sum6--Les auteurs pr6sentent une nouvelle m6thode d'optimisation de m6canismes plans ~ quatre barres articul6es pour la synth6se de trajectoires. Le probl6me se r6duit au calcul de huit inconnues d6finissant un m6canisme dont la bielle trace une courbe contenant un ensemble de rn + l points qui se trouvent aussi proches que possible d 'un ensemble de m + 1 points donn6s d 'une trajectoire d6finie discr6tement. Les inconnues sont calcu16es au moyen d 'une solution de moindres carr6s des 6quations cin6matiques, ayant comme param6tres un ensemble de rn valeurs {$i}~' de l 'angle $ d6finissant la position du membre entrainant. Cet ensemble est d6termin6 hors des it6rations se rapportant au calcul des param6tres du m6canisme, ce qui r6duit le nombre d ' inconnues ~ un nombre fixe, c'est-fi-dire fi huit, car les angles ~b i ne font pas partie des variables de d6cision lors de l 'optimisation du m6canisme. De plus, on calcule les param6tres de ce dernier au travers des coordonn6es cart6siennes des centres des articulations lorsque le m6canisme se trouve dans une configuration de r6f6rence. Par cons6quent, les inconnues sont les coordonn6es qui ne sont soumises fi aucune contrainte, ce qui permet de formuler le probl6me comme un probl6me d'optimisation sans contraintes lib fi un syst6me alg6brique de 2m 6quations non-lin6aires

huit inconnues, o6 m I> 8. Puisque le syst6me alg6brique est, en g6n6ral, surdimensionn6, on le r6soud par la m6thode de Newton-Gauss, avec amortissement et continuation, ce qui permet de garantir une convergence acc616r6e, m6me si l 'on part des valeurs des inconnues se trouvant " loin" d 'une solution. Le hombre de condition de la matrice Jacobienne des 6quations cin6matiques a 6t6 estim6 fi chaque it6ration, ce qui permet de contr61er la pr6cision de la solution. Dans les exemples on a trouv6 des nombres de condition relativement petits, en raison de la pr6sence d'6quations redondantes. Enfin, ces exemples d6montrent l'efficacit6 de la m6thode pr6sent6e.