Realization Methodology of a 5-axis Spline Interpolator in ... - CiteSeerX

7 downloads 0 Views 698KB Size Report
NURBS curve into the numerical control (NC) file inclusive of NURBS ..... X47.7773 Y71.0202 Z58.8006 U47.8066\ .... B.S. degree from HIT in 1999, and became.
Chinese

Chinese Journal of Aeronautics 20(2007) 362-369

Journal of Aeronautics

www.elsevier.com/locate/cja

Realization Methodology of a 5-axis Spline Interpolator in an Open CNC System Wang Yongzhang, Ma Xiongbo*, Chen Liangji, Han Zhenyu School of Electromechanical Engineering, Harbin Institute of Technology, Harbin 150001, China Received 7 September 2006; accepted 15 January 2007

Abstract By making use of the advantages of non-uniform rational B-spline (NURBS) curves to represent spatial curves, an instruction format with double NURBS curves suitable for 5-axis coordinated real-time interpolation is presented to replace the current 5-axis coordinated linear interpolation method defective in low-speed, low-accuracy and enormous numerical control (NC) files in sculptured surface machining. A generation procedure of the NC files with the presented format is introduced and the method to realize the interpolation in an open computer numerical control (CNC) system is developed by ourselves. These illustrated the feasibility of the proposed method and its capability of avoiding all the shortages of 5-axis linear interpolation method. Keywords: open CNC system; sculptured surface; 5-axis machining; NURBS; interpolation

1 Introduction *

Nowadays, the method of producing sculptured surface on workpieces is of great importance to the industries of aerospace, automobile, steamboat, cutter and die-making etc. The controllable high-speed and high-accuracy machining processes are generally carried out on 5-axis coordinated computer numerical control (CNC) machine tools. In CAD/CAM softwares, the design of sculptured surfaces of a workpiece is usually described in noniniform rational B-spline (NURBS)[1]. Therefore, the CNC system should be able to directly generate 5-axis coordinated NURBS curves in real time. Today, though NURBS technology has found wide application in CAD/CAM, its uses in CNC seem to lag behind. So far, there are only a few top grade CNC systems like FANUC and SIEMENS support-

*Corresponding author. Tel.: +86-451-86413812. E-mail address: [email protected] Foundation item: Key Development Program of Science and Technology of Heilongjiang Province, China (GB05A501)

ing NURBS spline curve interpolation[1-2]. As shown in Ref.[3], the NURBS interpolation has many advantages over the linear interpolation, so it is of great value to study it. However, at present, studies in connection with NURBS interpolation is mostly focused on 3-axis coordinated motion[1-5]. Although a few reports have been published related to the 5-axis coordinated NURBS interpolator, some foreign CNC system manufacturers have claimed their CNC systems possessive of the function of 5-axis NURBS interpolation, which, to our disappointment, are now banned from exporting to China. Aimed at filling this void, this paper makes an attempt to realize a NURBS interpolator during developing a 5-axis coordinated CNC system. Here comes a format suitable for a 5-axis coordinated double NURBS curve interpolator together with the generalization and interpolation process proposed.

2 NURBS Surface Representation The general form to describe a parametric

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

curve in the 3-D space is as follows[6] C(u)=x(u)i + y(u)j + z(u)k 0≤u≤1 (1) where u is an arbitrary parameter; i, j, k are the unit vectors of axis orientation of x, y, z respectively. A p-degree NURBS curve is defined as[7] n

C (u ) = [ x(u ) y (u ) z (u )]T =

∑N i =0 n

∑N i =0

n

∑ Pi Ri, p (u )

i, p

(u )Wi Pi

i, p

=

(u )Wi

0≤u≤1

(2)

i =0

where

Ri , p (u ) =

Ni , p (u )Wi n

∑ Ni, p (u )Wi

(3)

i =0

Pi is the ith 3-D control point; Wi is the corresponding weight factor of Pi; (n+1) is the number of control points; and Ni,p(u) is the so-called normalized B-spline basis function, where p is its degree which can be calculated by the following recursive formula ⎫ ⎧1 (ui ≤ u < ui +1 ) Ni ,0 = ⎨ ⎪ ⎩0 ( otherwise ) ⎪ ⎪ u − ui Ni , p (u ) = Ni , p −1 (u ) + ⎪ ui + p − ui ⎪ (4) ⎬ ui + p +1 − u ⎪ Ni +1, p −1 (u ) ⎪ ui + p +1 − ui +1 ⎪ ⎪ 0 = 0 (prescribed) ⎪ 0 ⎭

· 363 ·

the part program and executes the NURBS interpolation. Compared with approach ①, ②is more accurate because none of fit error occurs in the conversion of cutter trajectory in it. Therefore, the way ② will be under discussion in this paper. Fig.1 shows the typical part program format. Till now, there is no standard uniform format in the existing 3-axis NURBS command. The program segment begins with G06.2, which is regarded as the starting flag of NURBS interpolation. The CNC system reads the three groups of data that follows and executes the related NURBS interpolation command. But the information provided by this part program format is far from enough to implement a 5-axis coordinated interpolation. The tool-axis direction is determined without any need for considering the tool-axis orientation in a 3-axis CNC interpolator. The axis orientation in 5-axis coordinated machining must be given in each real-time interpolation. Thus data information with the tool-axis orientation unit vectors must be included in NURBS part program. In the process of programming in a CAM system with the generating method of tool path and based on the given inclination and tilt, the

where [ui , ⋅⋅⋅, ui + p +1 ] is the knot vector.

3 Format of Double NURBS Curve Interpolator There are two ways to realize NURBS interpolator in CNC systems: ① first fit the linear machining trajectory generated in CAM software into cutter trajectory of NURBS interpolation within the allowed tolerances, and second make the CNC system execute the real-time NURBS interpolation. This method is called “fairing interpolation” by GE-FANUC system. ② Convert directly the geometry model defined in a CAD system with NURBS curve into the numerical control (NC) file inclusive of NURBS interpolation code when programming in a CAM system. The CNC system reads the part program and executes the NURBS

Fig.1

Current 3-axis NURBS interpolation format.

coordinator of cutter center point and tool-axis orientation unit vectors can be calculated after interference checking and modification. The proposed double NURBS curve interpolation method is developed on the basis of the existing 3-axis NURBS command format added by an NURBS spline representing orientation. Fig.2 shows the 5-axis double NURBS curve interpolation command format. Beginning with G06.5, the proposed format has the coordinator of the cutter center point spline control point denoted by X_ Y_ Z, and the control point coordinator of orientation spline is expressed in the

· 364 ·

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

key words U, V, W. Its corresponding weights and knot vectors defining the spline are the same as those of the cutter center point spline.

vectors, which are then fitted[11] into cutter center point spline and orientation spline in the post-process procedure. And, thus, the NC code expressed by the proposed double NURBS spline curve interpolation format is generated.

5 Disposing of Double NURBS Curve Data Stream in the Open CNC System 5.1 Realization of the translator Fig.2

Proposed 5-axis double NURBS interpolation format.

4 Tool Path Fitting and NC Codes Generation As the general CAD/CAM software like Unigraphics is unable to generate NC code (part program) expressed by the proposed 5-axis coordinated double NURBS spline interpolation format, it is necessary to develop a CAD/CAM module on our own. Fig.3 shows the flow chart of generating an NC code with the help of the thus developed CAD/CAM module.

Fig.4 shows the modular structure of the open software CNC system of ourselves, in which the Task Generator module responsible for the translation of part programs is realized with Microsoft COM technology and the Axis Group module responsible for the real-time interpolation and other real-time tasks with Ventur Com’s RTDLL (realtime dynamical link library) technology.

Fig.4

Fig.3

Generation of NC codes.

The CAD part in the module provides interfaces which connect with other powerful CAD/ CAM softwares to make full use of the geometry modeling functions of the softwares. After preprocess procedure such as tool path generation[8-9] and interference checking[10], the CAM part in the module serves to calculate the cutter center point coordinates and the corresponding tool-axis unit

Modular structure of an open CNC system.

Because of its openness, integrating a 5-axis NURBS interpolator into the system is quite simple, for only the Task Generator module and the Axis Group module need changing. Data structures (described in C++) used in the Task Generator module are given as follows. typedef enum {LINE, DNURBS} SingleStep_ TYPE; // defining motion segment type typedef struct dnurbs_struct{ double start_rate,traverse_rate, end_rate; // feed rate of the motion segment int p; // degree of the NURBS curve double r[20],kv[26]; // array for storing weight and knot // vector double clx[20],cly[20],clz[20];

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

// array for storing coordinates // of cutter center control point double tclx[20],tcly[20],tclz[20]; // array for storing coordinates of // tool-axis orientation control point

where E (tk +1 − tk ) 2 is the first order approximation error. The interpolation period is Ts, and the feed rate along the curve is defined by

⋅⋅⋅

} dnurbs; typedef struct singleStep_struct{ SingleStep_TYPE singleStep_type; line line_struct; // structure for storing linear motion // information dnurbs dnurbs_struct; // structure for storing double // NURBS motion information

V (u ) =

que; The “dnurbs” structure added in the module is for the translation of 5-axis NURBS code. The information extracted from each motion segment after translation is input into “singleStep” deque and converted into the Axis Group module for interpolation. 5.2 Realization of the interpolator The task of double NURBS spline curve real-time interpolation is to calculate the knot vector value uk+1 in next interpolation period based on the corresponding knot vector value uk of interpolation in current period, and convert the calculated tool-axis vector into the tilting and rotating angles A and C of the table (Here the machine tool is of table-rotating/ tilting type as shown in Fig.5). The assumption is made that C(u) is the cutter center point spline, CT(u) the orientation spline which both are constructed with the same knot vectors. The time function u is the curve parameter and u(tk) = uk, u(tk+1) = uk+1 . By means of Taylor’s expansion of the parameter u with respect to time t to obtain the first order approximation interpolation algorithm, the first order approximation up to the first derivatives is[12] du uk +1 = uk + |t =t ⋅ (tk +1 − tk ) + E (tk +1 − tk ) 2 (5) dt k

dC (u ) ⎛ dC (u ) ⎞ ⎛ du ⎞ =⎜ ⎟⎜ ⎟ dt ⎝ du ⎠ ⎝ dt ⎠ V (uk ) =

Since the curve speed

dC (u ) dt

(6) (7) u = uk

the first derivative of u with respect to t is obtained as du dt

⋅⋅⋅

} singleStep; typedef std::deque singleStep_de-

· 365 ·

V (uk ) dC (u ) du u =uk

= t = tk

(8)

Consequently, by substituting Eq.(8) into Eq.(5), and neglecting the higher order terms, the first-order approximation interpolation algorithm Eq.(5) takes the following form uk +1 = uk +

V (uk )Ts dC (u ) du u =uk

(9)

Also, the second-order approximation interpolation algorithm will be uk +1 = uk +

V (uk )Ts − dC (u ) du u =uk

⎛ dC (u ) d 2C (u ) ⎞ V 2 (uk )Ts 2 ⎜ ⋅ ⎟ du 2 ⎠ ⎝ du 2

dC (u ) du

(10) u = uk

4 u = uk

The first and second derivatives of C(u) with respect to u are respectively obtained as n

n

dC (u ) = ∑ Pi R'i , p (u ) = du i =0

∑ N'i, p (u )Wi Pi i =0 n

∑ Ni, p (u )Wi i =0

n

n

∑ N'i, p (u )Wi ∑ Ni, p (u )Wi Pi i =0

i =0

⎛ ⎞ ⎜ ∑ Ni , p (u )Wi ⎟ ⎝ i =0 ⎠ n

2



(11)

· 366 ·

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369 n

2

d C (u ) du 2

=

n

∑ Ni, p (u )Wi ∑ N''i, p (u )Wi Pi i =1

i =0

⎛ ⎞ ⎜ ∑ N i , p (u )Wi ⎟ ⎝ i =0 ⎠ n

n

2

Suppose the tool-axis unit vector is T, then

n

∑ N''i, p (u )Wi ∑ Ni, p (u )Wi Pi i =0

i =0

n

2

n

n

n

i =0

i =0

i =0 3

⎛ ⎞ ⎜ ∑ Ni , p (u )Wi ⎟ ⎝ i =0 ⎠



2∑ N'i , p (u )Wi ∑ N i , p (u )Wi ∑ N'i , p (u )Wi Pi ⎛ ⎞ ⎜ ∑ Ni , p (u )Wi ⎟ ⎝ i =0 ⎠ n

n

n



n

2∑ N'i , p (u )Wi ∑ Ni , p (u )Wi Pi ∑ N'i , p (u )Wi i =0

T C (u ) − C (uk +1 ) T = ⎡⎣Tx Ty Tz ⎤⎦ = T k +1 C T (uk +1 ) − C (uk +1 )



i =0

⎛ n ⎞ ⎜ ∑ Ni , p (u )Wi ⎟ ⎝ i =0 ⎠

i =0

3

(12)

where, the general algorithm for order derivative of Ni , p (u ) is ⎡ Nim, p−1 (u )

⎤ − Ni(,mp ) (u ) = p ⎢ ⎥ ⎢⎣ ui + p − ui ui + p +1 − ui +1 ⎥⎦

(13)

dC (u ) = ( x' )2 + ( y' ) 2 + ( z' )2 du

(14)

And where

Nim+1,−1p (u )

(16)

In the paper, the workpiece coordinator system (XYZ)W and the machine coordinator system (XYZ)M are supposed to be well-matched, as shown in Fig.5. The 5-axis CNC machine tool is of table-rotating/ tilting type with the cutter moving up and down along Z axis, and the tilting table and the rotating table revolving round the tilting and rotating pivot Ps in the designated direction (A, C). The rotation angles A and C can be determined by the following two sets of equations ① When Tz ≠ 1 , sin A ≠ 0 and ⎧⎪ A = arccos Tz A ∈ [ −π / 2, 0 ) ∪ ( 0, π / 2] ⎨ ⎪⎩C = arctan (−Tx / T y )

(17)

② When Tz = 1 , Tx = Ty = 0 and ⎧A = 0 ⎨ ⎩C = 0

(18)

x = C x (u ), y = C y (u ), z = C z (u ),

x' =

dC y (u ) dCx (u ) dCz (u ) , y' = , z' = du du du

(15)

Using Eqs.(11), (12), (13), and (15), can be calculated x' , y' , z' , x'' , y'' , z'' . Again, uk+1 can be calculated using the values of x' , y' , z' and Eqs.(9), (11), (14). This is called the first order NURBS approximation interpolation algorithm. Similarly, the second one is achieved by use of the x' , y' , z' , x'' , y'' , z'' values and Eqs.(10), (11), (12), (14) to calculate uk+1. Thus, to cope with the feed rate V(uk), parameter u is updated in each interpolation period. Then the target position is calculated using Eq.(15), where V(uk) might be the feed rate command, the specified speed profiles of ACC/DEC, or any required speed in a general machining process[3-4]. C(uk+1) and CT(uk+1) are obtained by substituting the calculated uk+1 into C(u) and CT(u).

Fig.5

Table-rotating/tilting type of 5-axis CNC machine tool.

5.3 Flow of the data stream The proposed format’s double NURBS NC code is generated in the CAD/CAM part of ourselves first and then disposed by the translator. The obtained data are sent to the interpolator in which they are disposed according to the given interpolation period with the calculated target position followed by treatments abiding by the control law. As the SoftSERCANS technology[13] (IEC61491-SERCOS technology’s software realization adopted in the CNC system, as shown in Fig.4) is adopted, the final data are input into an internal telegram buffer (a block of shared memory), and the SoftSERCANS

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

· 367 ·

plug-in card exchanges data with it. Then the data telegrams inclusive of moving instructions are sent to drivers by SoftSERCANS through fiber optic ring to drive motors. Fig.6 shows the whole procedure.

Fig.7

Double-NURBS curve interpolation and identification of tool-axis orientation.

6.2 Comparison of NC code’s sizes

Fig.6

Flow of the data stream.

6 Illustration 6.1 Identification of tool-axis orientation The tool path calculated in the preprocess procedure of CAM is composed of 20 line segments (i-i+1), and the tool-axis orientation of each end point, is shown in Fig.7, is fitted into both cutter center point spline C(u) and orientation spline CT(u). By interpolating C(u) and CT(u) using the interpolation method given above, the interpolation point and its related tool-axis orientation can be figured out. From Fig.7, it can be seen that after double NURBS interpolation, the tool-axis orientation accords with the tool-axis orientation in the end point of a line segment which confirms the capability of proposed double NURBS interpolation method to ensure the agreement of the interpolated tool-axis orientation with the tool-axis orientation calculated by CAM.

An NC code will consists of 20 segments if the tool path in Fig.7 is expressed in 5-axis linear interpolation method, and it may be reduced to only one segment if the proposed double NURBS interpolator is adopted. The NC code is shown as follows: N30 G06.5 P3 X47.7773 Y71.0202 Z58.8006 U47.8066\ V71.9791 W59.0828 R1.0000 K0.0000 F400 X44.3229 Y75.6066 Z54.4778 U44.3651\ V76.5494 W54.8138 R1.0000 K0.0000 X37.2164 Y84.6443 Z44.5755 U37.2554\ V85.5421 W45.0342 R1.0000 K0.0000 X28.7567 Y101.5653 Z29.7151 U28.7081\ V102.3535 W30.3361 R1.0000 K0.0000 X-1.6963 Y163.6796 Z5.8369 U-1.8572\ V163.9906 W6.7762 R1.0000 K0.5046 K1.0000 K1.0000 K1.0000 K1.0000 It is obvious that the proposed method can greatly reduce the volume of NC files; especially when in high precision machining, the size change will be more obvious. Meanwhile, since in CNC systems, pre-reading one part program segment equals pre-reading tens or even hundreds of linear interpolation segments, the “prospective property” of CNC system can be solved easily. 6.3 Real-time test The real-time property of the proposed method

· 368 ·

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

is tested in a computer (Pentium IV 2.4 GHz, RAM 512 MB) and the results are shown in Fig.8. The calculation is accomplished on the base of the proposed second-order approximation 5-axis coordinated double NURBS interpolation algorithm with the beginning of a time segment being the start of the calculation basic function and the ending being the calculated final position of each axis. It can be found the average run time in a double NURBS interpolation period is near 28 μs which occupies a quite small proportion in a CNC system, where the interpolation period amounts to 2 ms or even as short as 500 μs.

Fig.8

Run time of the proposed method.

6.4 Machining error analysis and experiment Interpolation accuracy is an important criterion to evaluate an interpolation method. Traditional linear interpolation segments are obtained by dispersing a curve in CAM part, while the proposed double NURBS interpolation method entails direct interpolation of a curve. Although they both approximate a curve in chords with associated occurrence of chord errors, the proposed method will result in a more accurate machined surface because it approximates a curve in interpolation step lengths which are several times shorter than the lengths of lines representing segments in the linear method. The curve inflection point of the tool trajectory in Fig.7 is close to the parameter (knot vector) u = 0.42, representing the smallest curvature against all the others. The tool trajectory is interpolated with either double NURBS or traditional linear interpolation method with the calculated chord errors within the circle of curvature in each interpolation point. The data are collected to form an error chart shown in Fig.9, from which it follows that, compared to the tradi-

tional linear approximation machining method, the proposed one is able to greatly enhance the machining performance, improve machining accuracy which is far less affected by the curve curvature change.

Fig.9

Error comparison of two methods.

The sample-workpieces of the machined rotor blades are shown in Fig.10, where the left was machined using the traditional linear interpolation method with the interpolation period being 2 ms, the feed rate 300 mm/min, and the right was machined using the proposed double NURBS interpolation method with the interpolation period being 2 ms and the feed rate 400 mm/min. The results show that the proposed method excels the traditional method in both machining efficiency and accuracy.

Fig.10

Machined sample-workpieces.

7 Conclusions In order to overcome the short-comings of the existing 5-axis linear interpolation method used to machine sculptured surface, a 3-axis coordinated NURBS interpolation format is developed with introduction of a spline expressing the tool-axis orientation, and a double NURBS curve interpolation method is proposed. Moreover, an NC code generation method is presented, and the method to realize the interpolation function in an open CNC system is devised on our own. The tool-axis orientation of each interpolation point preferably accords with the orientation calculated by CAM; meanwhile com-

Wang Yongzhang et al. / Chinese Journal of Aeronautics 20(2007) 362-369

pared with linear interpolation, the machining accuracy and efficiency, and the volume of NC file are greatly increased. Therefore, the proposed double NURBS interpolation method, besides its application in the real CNC system, also shows a great promise in the future.

· 369 ·

CNC machining. International Journal of Machine Tools and Manufacture 1999; 39: 471- 488. [10]

Mahadevan B, Sanjay E S, Krzyztof M, et al. Collision-free finishing toolpaths from visibility data. Computer-aided Design 2003; 35: 359-374.

[11]

Yang C Q, Qin D T, Shi W K. Tool path in terms of NURBS curves for five-axis sculptured surface Machining using flat-end

References

tools. Journal of Chongqing University 2003; 26(2): 82-85. [in [1]

Marchenko M, Tae J K, Lee S H, et al. NURBS interpolator for constant material removal rate in open NC machine tools. Interna-

Chinese] [12]

tional Journal of Machine Tools and Manufacture 2004; 44:

able-feedrate CNC curve interpolators. Computer-Aided Design

237-245. [2]

You Y P, Wang M, Zhu J Y. An interpolator for NURBS curve machining with high-speed and high accuracy. Journal of Computer-aided Design and Computer Graphics 2001; 13(10): 943947. [in Chinese]

[3]

Yeh S S, Hsu P L. Adaptive-feedrate interpolation for parametric curves with a confined chord error. Computer-aided Design 2002; 34: 229-237.

[4]

Tsehaw Y, Ranga N. A parametric interpolator with confined chord errors, acceleration and deceleration for NC machining. Computer-aided Design 2003; 35: 1249-1259.

[5]

Zhang Q G, Greenway R B. Development and implementation of a NURBS curve motion interpolator. Robotics and ComputerIntegrated Manufacturing 1998; 14: 27-36.

[6]

Wang Y Z, Chen L J. A real-time NURBS surface interpolator for 5-axis surface machining. Chinese Journal of Aeronautics 2005;

Farouki R T, Tsai Y F. Exact Taylor series coefficient for vari-

2001; 33: 155-165. [13]

Liang H B, Wang Y Z. SoftSERCANS technology and its application to CNC system. Computer Integrated Manufacturing Systems 2004; 10(11): 1433-1436. [in Chinese]

Biographies: Wang Yongzhang

Born in 1941, he is a

professor and doctorial tutor of Harbin Institute of Technology (HIT) and has completed 22 scientific research projects and 5 monographs, with more than 70 academic papers published in recent years. Now, his research interests include NC technology, application of computer in machining and design, machining, controlling of modern manufacturing systems. E-mail: [email protected]

18(3): 263-272. [7]

Piegl L. On NURBS: a survey. IEEE Computer Graphics and Application 1991; 11(1): 55-71.

[8]

Lee Y S. Non-isoparametric tool path planning by machining strip evaluation for 5-axis sculptured surface machining. Computer-aided Design 1998; 30: 559-570.

[9]

Lo C C. Real-time generation and control of cutter path for 5-axis

Ma Xiongbo

Born in 1976, he received

B.S. degree from HIT in 1999, and became a Ph.D. candidate of HIT in 2004. And now, his research interests include open architecture CNC system and CIMS. E-mail: [email protected]

Suggest Documents