Quintic splines for kinematic design

Quintic splines for kinematic design

Quintic splines for kinematic design B L MacCarthy The paper introduces a very general spiine construction useful in kinematic design. Given kinematic...

584KB Sizes 21 Downloads 257 Views

Quintic splines for kinematic design B L MacCarthy The paper introduces a very general spiine construction useful in kinematic design. Given kinematic data in the form of values and derivatives, a spline formulation is employed where knot positions can be used as design parameters to alter the characteristics of the motion satisfying the kinematic constraints. The quintic spline provides sufficient smoothness in most applications. A B-spline basis is employed for this construction because it is the most flexible and computationally stable. Examples in cam mechanism motion specification are discussed. This method gives an infinite number of solutions for most problems and can provide a very significant design aid in many situations. computer-aided design, kinematics, quintic splines

derivative constraints. The use of spline tunctions has been studied for this problem ~ and the quintic spline was shown to have distinct advantages. This paper focuses on the construction of spline functions satisfying interpolation and derivative conditions, using a B-spline basis. This construction has many advantages in the context of kinematic design: • It allows a priori conditions to be stated and tested to determine if a particular problem has a solution. • It is a flexible construction, in particular allowing knot positions to be varied and used as design parameters to control the characteristics of the motions. • It is a simple, numerically stable representation that (:an be evaluated and differentiated accurately and easily. PROBLEM

The specification of motion curves is a fundamental problem in many engineering disciplines, including mechanism design, .obotics and highway design. These problems require motion curves that impart acceptable dynamic characteristics t o the system being controlled but that satisfy precise kinematic constraints. It is often difficult to satisfy these constraints with standard kinematic curves ..... in particular to control acceleration characteristics. For example, consider the problem of specifying the motion of a translating follower in a simple radial cam mechanism, as illustrated in Figure 1. In the absence of dynamic behaviour of the members, the output motion of tile follower is determined by the form of the input motion supplied by the cam profile. In any real system, however, the follower response will be dynamic and depend on materials, load, flexibility, lubrication and speed of the mechanism and the velocity, acceleration, and possibly higher order characteristics of the input motion. The designer tries to meet the precise kinematic requirements with a motion that has acceptable dynamic characteristics. Standard kinematic curves may be employed for specific applications t. However, problems arise if other than simple motions are required ~. In particular, control of acceleration may be limited or impossible. The central problem in this and many other kinematic design areas is one of univariate interpolation with

Department of Production Engineeringand ProductionManagement, Universityof Nottingham, UniversityPark.Nott ngham NG7 2RD,UK

406

AND

SOLUTION

Consider a problem in univariate interpolation where the following information is prescribed: • a non-decreasing sequence of real numbers tIXi I ~n

I

• a corresponding sequence of integers i'r

I;'= I

where

,,=max{/:x=

=x,

• a sequence of real numbers

An interpolating function, f, is required such that (x,) = v,

i = 1..... n

!1 I

[his very general problem occurs in many kinematic design situations. It is a Hermite-Birkhoff interpolation problem and its solution in the context of polynomials is discussed in such texts as Watson 4. This paper is concerned with its solution in terms of polynomial spline functions. Eidson and Schumaker ~ have studied this problem for splines with knot positions fixed at the data abscissae, using a piecewise polynomial representation. Cox" had discussed the problem ol

0010 4485,88, 070406 i0 $03.00 ,(b 1988BtJtterworth & Co iPublishers) Ltd

conlputer-,~,ide(i design

spline interpolation with derivative boundary conditions using a B-spline bases. In this section, a very general polynomial spline definition is given and the solution of problem (1)is discussed in this context. For the solution, a B-spline basis is used and the constraints on the number and position of knots are discussed. The construction of a robust algorithm and its application to kinematic design problems are discussed in the remaining sections. Let A = {gb,}~+0~ be a sequence of real numbers partitioning the closed interval [x~,x~] defined in problem (1)

a sequence of positive integers

can be defined that specifies the multiplicity of each knot. Any spline in Sk,~(A) has a unique representation of the form I+k

s(x)= ~ciBi, k(x) Xl = ~)O < (~)l < (~)2 < . . . < ~pg <~ ~t~g+ l = Xn

and let # = (#~, #2 . . . . . # S

be a vector of positive integers with 1 ~<#i< k, for some positive integer k > 1. A polynomial spline s of order k is defined as a function that is a polynomial of order k (degree ~< k - 1)on [ q ~ , ~ + ~ ) , i = 0 , 1 , . . . , g - 1 and on [q~,q~+l], and which is continuous and has continuous derivatives up to k - 1 - / ~ at ~, i = 1, 2,..., g. If /~--1, for i = 1,2,...,g, then s is of maximum continuity on [Xl, xn] and is in C~k-2~[x~, x,]. The general definition, however, includes functions of less than maximum continuity. The space of all polynomial splines of order k defined on A, with continuity specified by /~, is denoted by Sk.~(A). This is a linear space of dimension I + k where g i-1

as discussed by de Boor 7 and Schumaker 8. B-splines provide the most convenient computational basis for this space 9. To define the full set of I + k B-splines necessary to represent a function in Sk,~(A), it is necessary to define another sequence of real numbers

(4)

i=1

(2)

where B~,k(x) is the ith normalized B-spline of order k defined on (/~,-k .... ,,~) and q is a real coefficient. Problems of type (1) are required to be solved with functions of the form of expression (4). There is a total of n interpolation conditions. If a spline of order k is fitted to this data by defining n - k interior knots and 2k exterior knots consistent with expressions (3a) and (3b), then a linear system of equations of order n is obtained Ac = y

(5)

where the i,jth element of A is given by (6)

aij = Bj,k(r')(Xi)

and c and y are the vectors of spline coefficients and specified ordinates, respectively. If the restriction is imposed that no more than k - 1 interpolation conditions are defined at any point (r~ < k, for all i), then the matrix A may be shown to be nonsingular if and only if xie(Zi_k, hi),

i = 1 .... , n

(7)

where the left-hand interval endpoint in formula (7) is included if (8)

ri > k - vi_ k

thus: Z1--k ~ ')~2--k ~ "'" ~ )t'0 = (~0 2i+k /~ ~l+k-1 ~ "'' /~ 21+1

~--

(3a)

(3b)

(~g+l ....

.....

(3c) where/~ represents the frequency of ~ . This is termed a knot sequence. The knots in expressions (3a) and (3b) are called exterior knots and those in expression (3c) are called interior knots. At any point ~ , v~ knots may coincide (I ~< v~ ~ k). Each knot at q~ then has multiplicity v~. Corresponding to the knot sequence

volume 20 number 7 september 1988

This result may be deduced as a corollary to theorem 4.6 in Schumaker 8. It is more convenient, in the design context, to replace these n conditions on the data abscissae with n + k equivalent conditions on the knots, thus ~i(~( - - 00, Xi+k) ,

= 1 --k, 2 - - k , . . . , 0

~'i~(X i , Xi + k),

--1 ..... n - k

2~(xi, + oo),

i=n-k+l

(9) (10)

..... n

(11)

where the right-hand interval endpoints in expressions (9) and (10) are included if vi~> k - - ri+k

(12)

Any nondecreasing knot sequence satisfying expressions

407

(9) (11) guarantees a unique solution to the problem. Fhe knot sequence must also satisfy the conditions that it is nondecreasing and that no more than k knots coincide at any point, implicit in earlier definitions. The exterior knots in expressions (9) and (11) may be chosen arbitrarily without affecting the solution. These conditions allow the k exterior knots in expression (9) to be chosen so that they are coincident at x~. Although the conditions, as stated, seem to preclude a similar possibility at x,, for the k exterior knots in expression (11), it can be shown that this is allowable g. There are distinct computational advantages to choosing coincident exterior knots in this manner ~°. This choice is always made in the following. Thus

}, ~=},~ A =£o=x~, )~n=)~,~_~=...=£,, ~.~=x~ (13) may be assumed. The conditions on the placement of interior knots are governed by expressions (3), (10) and (12) and their choice does affect the solution. For all nontrivial cases, this gives an infinite family of solutions and provides the basis for the use of knots as design parameters.

A L G O R I T H M TO SOLVE THE P R O B L E M Section 2 demonstrated that problems of type (1) could be solved using splines with a B-spline basis subject to certain restrictions on the number and position of interior knots. To construct an algorithm to solve problems of this type, the following steps must be carried out.

Step 4 t orrll the linear system ()1 equations: the required lineal ~ystem is that given by equations (~ and (6). The itl~ row of the system is given by s". Ix,)= y,

116:,

Given the data and a knot sequence, all possible nonzero B-splines of order k, and their derivatives up to k - 1 may be computed at any point using simple recurrence relations".

Step 5 Solve the system of linear equations: in spline interpolation without derivatives, the linear system is always totally positive and may be solved by Gaussian Elimination without pivoting ~. However, in this case, with the presence of derivative constraints, pivoting will usually be required. The system is generally small in this application (n < 30 in many cases) and time or storage is not usually a problem. An LU decomposition with pivoting and iterative refinement 1~provides a satisfactory solution method. Step 6 Evaluate the spline and its derivatives: once the coefficients have been determined the spline and its derivatives may be evaluated efficiently using the methods discussed in Step 4. A routine incorporating the above features has been written in Fortran by tile author.

G E N E R A L C O M M E N T S AND E X A MP L E S Step 1 Specify the data: the data is most conveniently specified in form (1) with n interpolation conditions in total. Step 2 Specify the order k: the order must exceed the maximum number of interpolation conditions at any point k > max r,

(14)

Step 3 Specify the knots: define k coincident exterior knots at x~ and xn, as in formula (13). Then specify I interior knots where I=n-k

(15)

The sequence of I knots must be consistent with expressions (3), (10) and (12) with no more than k coincident knots at any point. Once the knot sequence has been specified these conditions must always be checked. Any further reference to knots in this paper refers to interior knots.

408

It should be emphasized that the spline function discussed in the previous two sections is, in every sense, a piecewise polynomial. The use of B-splines is a computational tool to facilitate the construction of a flexible and robust algorithm. The user need not be concerned with these computational aspects. For a particular problem, the constraints on the spiine solutions affect the number of polynomial pieces, the position of the joins or knots and the continuity at the knots. A number of general comments are worth noting concerning these constraints.

Control of acceleration Once the data in the problem has been specified, tile minimum order may be obtained from formula (14). In many kinematic design situations, control of acceleration is critical. This is directly related to the second derivative of the displacement motion. Employing quintic splines (k = 6) yields a second derivative which is a cubic sptine. This offers sufficient smoothness and flexibility in many cases ~2. The examples given here use quintic splines but the solution methods described in the previous two sections are applicable to arbitrary order splines, subject to the minimum constraint mentioned above.

computer-aided design

Knot sequence The number of knots is determined explicitly by the order and the number of interpolation conditions and is given by equation (15). The knot sequence must satisfy conditions (10) and (12). An increase in the number of interpolation conditions increases the number of knots required for a solution and effectively reduces the length of interval within which some knots may be placed. The first and last interior knots ,;~ and ,;~t may not be placed at the endpoints x~ and Xn as no more than k knots may coincide. Conditions (10) and (12) preclude the positioning of the ith knot Z, at the ith data abscissae x~ and restrict its positioning at x~+ k. However, ";.i-k+1 . . . . .

"~i 1 m a y b e p l a c e d a t x i a n d ~ i + l

.....

)~i+k

1

may be placed at x~+k.

Continuity If all knots are of multiplicity 1 (none coincident) then a spline of order k will be continuous and have k - 2 continuous derivatives on [x~,x,]. An increase in multiplicity by 1 at any knot reduces the number of continuous derivatives by I at that knot. Thus, a quintic spline without coincident knots would be continuous up to and including the fourth derivative on [Xl,X,]. However, at a double knot it would be continuous only up to the third derivative and, similarly, at a treble knot it would be continuous up to the second derivative.

third derivatives of the normalized displacement function may be considered as geometric velocity, acceleration and jerk. The requirements for this particular normalized motion is that velocity and acceleration vanish at the start and end of the rise motion and that the point (0.4, 0.4) is on the displacement curve with a geometric velocity of 1.5 at this point. The data for this problem, using a quintic spline, is xl = 0.0 x2 = 0.0 x3 = 0.0

r1 = 0 r2 = 1 r3= 2

Yl = 0.0 Y2 = 0.0 Y3 = 0.0

x4 = x~ = x6 = x7 = x8 =

r4 = r5 = r6 = r7 = r8 =

Y4 = y~ = Y6 = Y7 = Y8 =

0.4 0.4 1.0 1.0 1.0

0 1 0 1 2

0.4 1.5 1.0 0.0 0.0

n=8,

k=6--~l=

2

This construction gives three polynomial pieces, the first on the interval [x~, )~], the second on the interval [ ~ , ~-2) and the third on the interval [,~2, xs]. The constraints on the knot positions are Z~e(x~,xT) Xs)

~2~(x2,

or equivalently Z~,,~2e(0, 1)

Example 1

and

Two example problems are considered here, both of which arise in cam design. The first considers the specification of a simple lift motion for a radial plate cam, of the type shown in Figure 1. The requirement is for a dwell-rise-dwell motion 1, as indicated in Figure 2. It is useful to consider a normalized motion where a total lift of one unit is achieved in a unit of time. For a constant cam angular velocity, the first, second and

21<22 If two knots are specified at 0.4 and 0.6, a motion is obtained with the characteristics shown in Figure 3. The acceleration characteristics of this motion might be considered undesirable for vibrational response, particularly in the interval [0.3,0.7]. Changing the

Possible required motion

d3

E

Follower

E

d2

o

d~

Cam

tl

t2

t3

v t5

t4

Time F i g u r e 1. R a d i a l p l a t e c a m

volume 20 number 7 september 1988

409

Normalized motion Dwell d

1

-

E

m

£3

c~

Dwell

I tl

I

t2

Time

o

1 Time

Figure 2. Dwell-Rise-Dwell (DRD) cam motion

Velocity

Displacement 2.00

1.0

1.75 0.8

1.50

8 1.25 ~-

g 0.6

~3

1.00

I

~

0.4

g

L9

-- Interpolation point

0

z

/

0.75

i 0.50

0.2

--

/

/

Knot.

i p°siti°ns

0.25

I 0

0.2

0.4

0.6

0.8

1.0

0.2

0

0.4

Normalized input motion

0.6

0.8

1.0

Normalized input motion

Acceleration

Jerk

150

100

g

4

_~ 8 o

2

50

0 E-2

g

-4

I

~

-8

.0

_

E

o

~

4

06

~

10

(.9 -50

-100

-150 Normalized input motion

Normalized input motion

FiF,ure 3. Quintic spline solution k)r a DRD cam motion with displacement and velocity constraints - - knot choice "1

410

c o m p u t e r - a i d e d design

position of the first knot to 0.2 produces the motion with characteristics shown in Figure 4. The acceleration profile is considerably smoother in the required region and peak acceleration and deceleration values are similar. It is not possible to solve this problem with the standard harmonic segment curves ~2. Quintic splines, however, allow an infinite family of solutions. Example

2

The second example considers a problem in the design of latch cam system 3. The requirement here is for a highly asymmetrical rise and return motion. The data in normalized coordinates is

x1 =0.00 x2 =0.00 x3 =0.00 x 4 =0.31 x5 =0.48 x6 =0.48 x7 = 0 . 6 7 x8 = 0 . 7 3 x9 = 1.00 Xlo = 1.00 xll = 1.00

rl r2 r3 r4 r5 r6 r7 r8 r9 rio rll

=0 =1 = 2 =0 =0 =1 =0 =0

Yl Y2 Y3 Y4 Ys Y6 Y7 y,

= 0.00 = 0.00 = 10.00 = 0.74 = 1.00 = 0.00 = 0.78 = 0.77 Y9 = 0.00 Ylo = 0.00 Yl~ = 10.00

= 0

= 1 = 2

Again, zero velocities have been stipulated at the start, return and end points. For specific reasons in this application, the curvature of the cam in the region of

Displacement

1.0

Jerk 2.00

f

0.8 E

n=11, k=6-*l=5

1.75

--

1.50

-

1.25

0.6

"4

"O

1.00 0.4

O

z

0.75

O

z

0.50

0.2

J

0.25 ;kl 0.2

;k2

I I 0.4 0.6 0.8 Normalized input motion

o

1.0

o

0.2

0.4

0.6

0.8

1.0

Normalized input motion

Acceleration ,,

Velocit~ 150

100

.~

2

8 "-L0

Z

o

0.2

0.4 ~ 0 . 1 6

I

0.8

5o

o

1.0

0,2/.I

.

_jo.8I /

1.o

2

z

-50

--4

-6

-100 I

-8

4

-150 Normalized input motion Normalized input motion

Figure 4. Quintic spline solution for a DRD cam motion with displacement and velocity constraints - - knot choice 2

volume 20 number 7 september 1988

411

Displacement 1.0

0.8

E E 0.6 8¢o

0.4 O

z

0.2

I

0.2

7,1

I 0.4

X2, 7,3

I 0.6

X4

M

1 0.8

~

1.0

Normalized input motion Acceleration

80

40

tO

20

0

I

I

.0

oE - 2 0 (_9

'k./

-40

I -80

I Normalized input motion

Figure 5. Quintic spline solution for a dial latch needle can] system - - knot choi( e "1

the start and end points is controlled by a nonzero acceleration. The constraints on the knot positions are

Using knots placed at all the interior data points and a double knot at 0.48, i.e.

2~ff(0.0,0.67)

~, =0.31

22e(0.0,0.73)

Z2 = Z~ = 0.48

2~e(0.0,1.0)

24 = 0.67

24e(0.31,1.0)

Z~ = 0.73

2~(0.48,1.0)

412

the displacement and acceleration profiles in Figure 5

computer-aided design

Displacement 1.0

0.8

E

0,6

8 B "O

0.4

z O

0.2

0c 0

I XI

0.2

I

~k2

I ~-3

0.4 0.6 Normalizedinput motion

x4, xs I 0.8

~J £o

Acceleration

6O

4ol 20

I

0



.0

E g

L9 -2O

-40 t -60

Normalizedinput motion

Figure 6. Quintic spline solution for a dial latch needle cam system - - knot choice 2

are obtained. Note that a double knot still gives a smooth acceleration diagram. With an alternative choice of knots Z1 =0.155 22 = 0.55 Z3 = 0.575 Z4 = ,~s = 0•865 the acceleration profile can be smoothed in the interval

volume 20 number 7 september 1988

[0.3, 0.7] as shown in Figure 6. Very different acceleration diagrams could be obtained with another knot set, as shown in Figure 7; again demonstrating the flexibility of the spline construction. The choice of an optimum solution for a particular problem has not been discussed in this paper. This will depend on the particular requirements in any application and the model that the designer considers to be appropriate. The point that is emphasized here is the added flexibility given by the spline construction in many kinematic design situations and the ease with which this can be achieved•

413

Displacement

1.0

0.8 /

0.6

.8 "D .N

0.4

-

O

z

)`2

)'3

)`5

)`4

0.2

0

[

0

0.2

I 0.4 0.6 Normalized input motion

0.8

1.0

i

1.0

Acceleration

60

40

g

20

E g (.9

-20

-40

-60 Normalized input motion

Figure 7. Quintic spline solution for a dial latch needle cam system - - knot choice 3

CONCLUSIONS This paper has discussed the solution, using spline functions, to a very general interpolation problem that arises in kinematic design. The spline construction employed allows an infinite family of solutions to these problems in most practical cases. For any particular problem, the constraints on the solution determine the minimum order of spline that is allowable; the number of polynomial pieces in the spline; where the joins can occur between pieces; and the continuity at the joins. A simple and robust general algorithm using these methods has been implemented.

414

The techniques introduced here have advantages in many kinematic design situations. In cam design, quintic splines give continuity of velocity and acceleration in most cases, and these characteristics may be controlled and modified. Standard kinematic curves could not be employed in many of these problems. Higher order splines may be appropriate in some situations 12, but the limits on fabrication accuracy must be considered. The general kinematic design problem requires the specification of motion subject to constraints. The spline construction proposed here may provide a useful family of solutions in many applications, e.g. slider/crank

computer-aided design

mechanisms, linkages, robotics, and highway design. Other characteristics of the motion may be important in these applications e.g. curvature in highway design. The range of applications at present is limited to planar motion. Further work is being carried out to: • generalize the ideas and the computational methods for 3D design • determine the constraints that this method imposes on the form of the characteristics of the motion e.g. the minimum number of turning points possible for an acceleration diagram for a specific problem • determine optimization criteria for specific applications and implement optimization algorithms based on the location of knots to achieve optimal motions

REFERENCES

5 Eidson, H D and Schumaker, t / 'Computation of g-splines via a factorization method' Comm. ACM Vol 17 No 9 (1974) pp 526-530

6 Cox, M G 'The incorporation of boundary conditions in spline approximation problems' in Watson G A (ed) Lecture Notes in Mathematics 630: Numerical Analysis Springer-Verlag (1978) 7 de Boor C A practical guide to splines SpringerVerlag, Berlin, FRG (1978) 8 Schumaker, L L Spline functions: basic theory John Wiley (1981) 9 Cox, M G 'Practical spline approximation' in Turner, P R (ed) Lecture Notes in Mathematics 965 Springer-Verlag (1982) pp 79-112 10 Kozak, J 'On the choice of the exterior knots in a B-spline basis for a spline space' Report 2148 University of Wisconsin, Wl, USA (19~)

1 ESDU Item 82006 'Selection of DRD cam laws' Engineering Sciences Data Unit (Cam design chapter) (1982)

11 Wilkinson, J H and Reinsch, C Handbook for automatic computations Springer-Verlag, Berlin, FRG (1971)

2 Reeve, J E 'Mechanisms, cam laws 4-blending' Engineering (July 1979) pp 759-765

12 MacCarlhy, B t and Burns, N D 'An evaluation of spline functions for use in cam design' Proc. Institution. Mech. Eng. Vol 199 No C3 (1985) pp 239-248

3 MacCarthy, B L 'A kinematic and dynamic analysis of latch needle cam systems' PhD Thesis The University of Bradford, Bradford, UK (1986) 4 Watson, G A Approximation theory and numerical methods John Wiley (1980)

volume 20 number 7 september 1988

13 ESDU Item 83027 'The synthesis of cam motions by blending segments' Engineering Sciences Data Unit (Cam design chapter)(1983)

415