Real-time surface interpolator for 3-D parametric surface machining on 3-axis machine tools

Real-time surface interpolator for 3-D parametric surface machining on 3-axis machine tools

International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526 Real-time surface interpolator for 3-D parametric surface machining on 3-axi...

430KB Sizes 0 Downloads 44 Views

International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

Real-time surface interpolator for 3-D parametric surface machining on 3-axis machine tools Rong-Shine Lin Department of Mechanical Engineering, National Chung Cheng University, Chia-Yi, Ming-Hsiung 621, Taiwan, ROC Received 7 November 1998; received in revised form 16 December 1999; accepted 23 December 1999

Abstract The conventional approaches for surface machining use a sequence of straight lines to approximate the part surface. These straight lines are subsequently translated into linear g-codes by a post processor, and then sent to the CNC system. This process limits the surface machining capability of CNC systems. For example, the CNC machine tool can be controlled only to follow these approximated straight lines since the machine loses the surface information. In contrast, this research utilised a real-time approach for 3-D parametric surface machining on 3-axis CNC machine tools. This real-time approach, called CNC surface interpolator, can read surface g-codes and perform surface machining interpolation. The input to the CNC surface interpolator is the surface g-code, which contains geometric information, such as the coefficients of the parametric surface, as well as cutting conditions. This results in better machining feedrate controls, interpolates more precise machining commands, and requires less machining time compared to that produced by off-line approaches.  2000 Elsevier Science Ltd. All rights reserved. Keywords: CNC; Surface machining; Interpolator

1. Introduction Simple part surfaces, such as cylindrical and conical surfaces, can be machined on NC machine tools by manually typing part programs and tediously calculating a sequence of tool positions. However, for a general parametric surface, or free-form surface, machining using this method is inefficient and error prone. Free-form surfaces can even be impossible to machine because of their complicated nature. More advanced methods use off-line interpolators or so-called CAD interpolators to generate cutter location (CL) files in the CAD/CAM systems, either from plaster E-mail address: [email protected] (R.-S. Lin).

0890-6955/00/$ - see front matter  2000 Elsevier Science Ltd. All rights reserved. PII: S 0 8 9 0 - 6 9 5 5 ( 0 0 ) 0 0 0 0 2 - X

1514

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

templates or through mathematical modelling [1–5]. A schematic off-line interpolator is shown in Fig. 1. The major result of CL file generation is the decomposition of the surface into curves, and subsequently into short straight lines. The CL file describes the tool-paths using a sequence of straight lines in the Cartesian coordinate system. The major drawback of this method is that the machined surface accuracy depends upon the size of the CL file. The larger the CL file, the more precise the final machined surface. However, large CL files result in unacceptably long processing and milling time. Bedi [6] mentioned that a typical 200×200 mm2 surface expressed in g-codes is approximately one megabyte in size. Such long files cannot be handled by the limited storage capabilities of modern controllers. In addition, when using off-line methods the cutter accelerates and decelerates at each line segment, which causes machining feedrate variations, increases machining inaccuracy and substantially increases the cutting time. The major work of the CAD surface interpolator is tool-path planning. Tool-path planning determines a sequence of paths, or tool trajectories, that guide cutting tools to generate the desired part surface. As shown in Fig. 2, a set of tool-paths is planned to produce the 3-D parametric surface in terms of the u and v parameters. The common methods for tool-path planning are (1) the Automatically Programmed Tools (APT) based tool-path planning method [7], (2) the Cartesian tool-path planning method [8], and (3) the parametric tool-path planning method [9]. In the first method, APT programming, three surfaces (part, drive, and check surfaces) control the tool motion. The tool-end moves on the part surface, the tool slides along the drive surface, and the tool motion continues until the tool encounters the check surface. Choi et al. [1] mentioned that the main disadvantage of this method is that it is time consuming and unstable in the iterative computation. The Cartesian tool-path planning method is used for the surfaces defined by implicit or explicit equations, which begins with planning the tool-paths to be parallel straight lines in the xy-plane [8]. In other words, the tool-path is the intersection curve between the part surface and a vertical plane. The parametric tool-path planning method is commonly used for free form sur-

Fig. 1. Scheme of the CAD surface interpolator approach.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

Fig. 2.

1515

Illustration of the tool-paths and the parametric surface.

faces, or parametric surfaces machining. However, current implementations use off-line approaches, which cannot control the machining feedrate accurately. Instead of decomposing a surface into a sequence of straight lines inside the CAD system (offline approach), this paper presents a real-time approach for 3-D surface machining that precisely controls the machining feedrate and requires substantially less machining time compared to the off-line approach. This method utilises Computer Numerical Control (CNC) interpolation architecture, called a CNC surface interpolator, which can read a surface g-code and perform the surface machining interpolation. The input to the CNC surface interpolator is the surface g-code, which contains surface geometric information and cutting conditions. This real-time approach adopts the second order approximation of Taylor’s expansion which precisely controls the machining feedrate. This feedrate control cannot be modelled in the current off-line methods. The first process for parametric surface machining is the determination of the tool paths, called parametric tool-path planning. In order to simplify the implementation process, this research chose the isoparametric curves of the surface as the tool-paths. The isoparametric curves, on a freeform surface S(u,v) are obtained by keeping one parameter (either u or v) constant. Normally, one of the boundary curves (u=0, u=1, v=0, or v=1) is chosen for the first tool path. Fig. 3 shows the isoparametric curves Ci(v), i=1…n, on a surface S(u,v), 0ⱕu,vⱕ1. To determine the accurate parametric interval, ⌬u, between two successive isoparametric curves, the tool-path intervals along the first tool-path must be calculated. Usually, the minimum tool-path interval is chosen for the next increment in order to place the next tool-path. The reason for choosing the minimum interval is to keep the scallop heights under the required tolerance. A procedure is needed to convert the minimum tool-path interval into the parametric domain [9]. Based on the accurate tool-path interval calculation, tool-paths can be determined for a given machining accuracy. The tool-paths for

1516

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

Fig. 3. Isoparametric curves on the parametric surface S(u,v).

the entire surface can be found by repeating this procedure until the tool-path meets the other boundary curve. The detailed processes for the real-time approach are described in the following sections. 2. Real-time surface interpolator This research uses a real-time approach, called a CNC surface interpolator, in which surface machining is performed using surface g-code instructions. Fig. 4 shows the architecture of the

Fig. 4. Architecture of the real-time surface interpolator.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

1517

proposed real-time surface interpolator. The input to the real-time surface interpolator is the gcode type of NC part program, which contains geometric information, such as the coefficients of the parametric surface, as well as cutting conditions. Cutting conditions include the feedrate, the spindle speed, and the specific cutting tool, etc. The tool-path planning portion determines the tool-paths based on the isoparametric tool-path planning method in order to simplify the realtime implementation process. The obtained tool paths will be transmitted to the trajectory planning portion, a real-time procedure to calculate the tool position at each sampling [11]. The tool-path intervals along this tool-path are also calculated in the trajectory planning. Among these tool-path intervals, the minimum interval is chosen for determining the next toolpath. The next tool-path can be found by offsetting the previous path with a constant parametric interval, the minimum tool-path interval chosen before. The tool-path planning stops when the determined tool-path reaches the other boundary curve. A flow chart of the real-time surface interpolator is shown in Fig. 5. In this flow chart, the tool-path direction is assumed to be in the v-direction, and the u-direction is for the tool-path interval. The trajectory-planning algorithm generates the locations for the cutting tools based on the part geometry and the specified feedrate, which are obtained from the g-code part program. The trajectory planning performs the curve interpolation inside the CNC computer, which is the same

Fig. 5.

Flow chart for real-time surface interpolator program.

1518

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

computer that controls the machine axes in real time (Fig. 4). This real-time approach has to generate the reference position for each controller at each sampling time interval (e.g., 1–10 ms). With this approach, the CNC machine can keep a constant feedrate during machining, producing substantially smoother surfaces and requiring less machining time. 2.1. Tool position calculation To produce smooth surfaces, the machining feedrate (V) must be constant when the cutting tool tracks the cutting trajectory. To keep the constant feedrate, the cutting tool has to move a constant distance relative to the workpiece in each sampling period (T). In other words, the realtime interpolator has to divide the curved tool path into small uniform segments for constant feedrate machining. However, the constant changes in the parameter ⌬u in the parametric domain do not guarantee a constant length in the Cartesian domain, and consequently does not guarantee a constant feedrate. Therefore, the relationship between the parameter u and the sampling time (T) has to be derived, in order to obtain the constant machining feedrate. The geometric information of a tool path expressed by Eq. (1) is represented in terms of a unitless quantity u. The 3-D parametric curve shown in Eq. (1) will be used for the representations of the reference positions that maintain constant feedrate machining and satisfy the precision requirement. → C(u)⫽x(u)iˆ⫹y(u)jˆ⫹z(u)kˆ where 0ⱕuⱕ1

(1)

The derivation method used in this paper is similar to that of [12] where the first order Taylor’s expansion was adopted. Their interpolation result performs well when the curve does not have small curvature radii. If the curve contains small curvature radii, the first order approximation results in large feedrate variations. In this study, the second order approximation was chosen for the solution that produces more accurate results. The detailed derivations are shown below. First of all, Taylor’s expansion is utilised to expand the function u at the neighbourhood in time tk, 1 u(tk+1)⫽u(tk)⫹u˙(tk)·⌬t⫹ u¨(tk)·⌬t2⫹% 2

(2)

d2u du where u˙⫽ , u¨⫽ 2 , and ⌬t⫽tk+1⫺tk. dt dt Terms higher than the second order can be neglected because ⌬t3 and above are very small. ⌬t in Eq. (2) is the sampling time (T) for CNC systems, i.e. ⌬t=T. Therefore, tk+1 and tk can be denoted as Tk+1 and Tk, respectively. By rearranging Eq. (2), the following expression is obtained 1 uk+1⬇uk⫹u˙k·T⫹ u¨k·T 2 2

(3)

where the subscripts k and k+1 indicate the current and next sampling times. Eq. (3) describes the relationship between the parameter u and the sampling time T. However, two terms u˙k and u¨k must be expressed more explicitly. The constant feedrate V along the curve is defined as the derivative of the constant distance c with respect to time t.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

1519



→ dc V⫽ where c ⫽[x(u),y(u),z(u)] dt

(4)

The scalar c is the arc length, in which the cutter moves at one sampling time. Using the chain rule and rearranging, Eq. (5) can be obtained. V du ⫽u˙⫽ → dt dc du

(5)

From differential geometry,

冪冉



冊冉冊冉冊

dx 2 dy 2 dz + + du du du

dc ⫽ du

2

u˙ can be calculated by substituting Eq. (4) into Eq. (5) u˙⫽

冪冉

V

冊冉冊冉冊 2

dx dy 2 dz + + du du du

(6)

2

To obtain u¨, Eq. (5) is differentiated with respect to time t.

冉 冊 冉 冊 冉 冊 冉 冊 →

d dc −V· −V· 2 dt du du ⫽ u¨⫽ 2 ⫽ → dt 2 dc du



d2 c du · du2 dt →

dc du

(7)

2

By substituting Eq. (5) into Eq. (7), u¨ can be obtained

冉 冊 冉 冊 →

d2 c −V· du2 u¨⫽ → dc 3 du

(8)

where 2



d c ⫽ du2

dx d2x dy d2y dz d2z · + · + · du du2 du du2 du du2

冪冉

冊冉冊冉冊

dx 2 dy 2 dz + + du du du

2

(9)

By substituting Eq. (9) and Eq. (6) into Eq. (3), the solution of parameter u at the (k+1)th sampling time can be obtained and is shown below.

1520

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

uk+1⫽uk⫹



冊 冉冉 冊 冉 冊 冉 冊 冊

dx d2x dy d2y dz d2z ·(VT)2 · + · + · V·T 1 du du2 du du2 du du2 ⫹ 2 dx 2 dy 2 dz 2 2 dx 2 dy 2 dz 2 + + + + du du du du du du u=uk u=uk

冪冉

冊冉冊冉冊

|

|

(10)

The next reference position can be obtained by substituting the determined uk+1 value into Eq. (1), which provides a constant feedrate machining. The real-time interpolating accuracy depends on the machining feedrate, system sampling time, and the part curvature radius. The error between the desired curve and the interpolated trajectory is the contour error, which represents the interpolation accuracy. Fig. 6 shows the contour error caused by the interpolating result. The feedrate error and the contour error analyses will be described in the next section. The above derivation calculates the trajectory on the part surface, which is the cutter contact (CC) trajectory or path. In 3-D surface machining, ball-end cutters are usually utilised. Therefore, the actual tool path or tool position is an offset of the CC path by a distance equal to the cutter radius with the orientation of the surface normal. Therefore, the tool position can be calculated using, ∂S ∂S × ∂u ∂v P(x,y,z)⫽S(ui,vj )⫹r· ∂S ∂S × ∂u ∂v

| |

(11)

ui,vj

where P(x,y,z) is the tool position determined by the real-time surface interpolator, S(ui,vj) is the CC path, and r is the cutter radius.

3. Experimental results and discussion Based on the real-time approach, the computer simulation for contour errors and the experimental result for feedrate variations are discussed in this section. Let a curved tool path be described as

Fig. 6. The contour error caused by the interpolating result.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526





1521

x(u)=−5u3−15u+25

C⫽ y(u)=−5u3−15u+25

0ⱕuⱕ1

(12)

z(u)=−32u3+45u2−15u

To examine the contour errors caused by the real-time approach, the example shown in Eq. (12) is used as an illustration. The computer simulation results of the contour errors caused by these two types of interpolators are plotted in Fig. 7 where the machining feedrate is 10 mm/s and the sampling time is 10 ms. The maximum contour error caused by the real-time interpolator approach in this example is 0.44 µm, which is located at the point where the curve has the minimum radius of curvature. The contour error depends on the system sampling time, the machining feedrate, and the curvature of the tool paths. Usually, the sampling time is fixed in a system. The feedrate is changed depending on the machining conditions. The shorter the feedrate, the smaller the contour error will be. On the other hand, the contour error is proportional to the curvature, the reciprocal of the radius of curvature. The contour error discussed above is only the portion of the error contributed by the interpolator. The actual machining contour error is larger because of control loops and machine tool errors. The simulation results by the off-line approach are also plotted in Fig. 7 for comparison. In this off-line method (CAD interpolator), 92 straight lines are used, keeping the contour errors less than 1 µm. Clearly, the real-time approach interpolates the curve more accurately than the off-line one. In off-line approaches, one possible way to increase the interpolating accuracy is

Fig. 7. Contour errors caused by the real-time and the off-line interpolators.

1522

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

increasing the number of approximated straight lines. However, this will cause very large feedrate variations, which create machine vibration and result in a rough surface. In addition to the interpolation contour error that causes inaccurate machining, the feedrate error also produces non-smooth surfaces. The feedrate error indicates that the actual feedrate deviates from the desired feedrate. Lin and Koren [10] mentioned that using CAD interpolators for CNC machining cannot maintain constant feedrate machining. Using this approach, the machine must move according to the linear g-codes; therefore, the machining feedrates are not constant at each line segment, which requires acceleration and deceleration motions. The nonconstant feedrate machining substantially produces non-smooth curves and the acceleration and deceleration motions waste considerable machining time. In contrast, using a real-time interpolator approach produces fewer feedrate errors. Using the same example in Eq. (12), the simulation results of the feedrate variations caused by the real-time approach are shown in Fig. 8, where the specific feedrate is 10 mm/s. The feedrate errors caused by the second order Taylor expansion method, Eq. (10), are less than 0.016% of the desired feedrate, which is negligible. The feedrate errors caused by the first order method are also shown in Fig. 8, which are about 1.2%. For the curves without small curvature radii, the first order Taylor’s expansion is accurate enough for actual machining. If the curves contain large curvature, the second order method should be used. As shown in Eq. (10), the computation load for the first order approximation is much simpler than that of the second order. The contour errors caused by the first order approximation are almost the same as those of the second order approximation. Therefore, the contour error discussed in Fig. 7 is valid for both the first and second order methods. 4. g-Codes for surface machining The g-code format for the real-time surface interpolator must be defined to machine the 3-D parametric surface, either for manual programming inputs or for data transmitting inputs from

Fig. 8. Feedrate errors caused by using the proposed real-time interpolator.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

1523

CAD/CAM systems. Therefore, the g-code must contain the surface geometry information. In order to make the surface interpolator suitable for any kind of mathematical representation, the bi-cubic parametric form was adopted for the surface representation in this g-code. The reason for using polynomial equations is that they are easy to convert from other surface representations, such as Ferguson surfaces, Be’zier surfaces, and B-spline surfaces. Although high-order polynomials can describe complex surfaces, they require a larger number of coefficients, whose physical significance is difficult to grasp. Thus, high-order polynomials are an inappropriate tool for the designer. Most design methods are implemented using bi-cubic parametric surfaces, which are a good compromise in most applications. A surface S(u,v) with a bi-cubic parametric form is given below

冘冘 冘冘 冘冘 3



3

aij uivj

x(u,v)=

j⫽0i⫽0 3

3

S(u,v)⫽ y(u,v)= z(u,v)=

bij uivj

(13)

j⫽0i⫽0 3

3

cij uivj

j⫽0i⫽0

where aij, bij, and cij are the coefficients of the cubic polynomials. Eq. (13) shows that 48 coefficients are needed to construct a parametric cubic surface where each direction (x, y, or z) needs 16 coefficients. If we examine these coefficients in the x-direction, the following equation can be obtained from the first scalar equation of Eq. (13)

冤 冥冤 冥 a b c d u3

x(u,v)⫽[v3 v2 v 1]

e h i j

u2

k l n o u

⫽VAU

(14)

p q r s 1

where V=[v3 v2 v 1] and U=u3 u2 u 1]T. A is a 4×4 matrix, including 16 coefficients, which define the parametric surface in the x-direction. Therefore, we need a surface g-code, g53, to match these coefficients in the x-direction, g53 aFbFcFdFeFhFiFjFkFlFnFoFpFqFrFsF

(15)

Two equations similar to Eq. (14) can be obtained from the other two scalar equations of Eq. (13), which are in the y-direction and z-direction. Likewise g54 and g55 can be defined as the coefficients in the y- and z-directions, respectively, which are shown below g54 aFbFcFdFeFhFiFjFkFlFnFoFpFqFrFsF

(16)

g55 aFbFcFdFeFhFiFjFkFlFnFoFpFqFrFsF

(17)

The new g-codes, g53 to g54, represent a parametric cubic surface, which contains the geo-

1524

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

metric information needed for the surface interpolator. A parametric surface, which is defined by two parameters (u and v), can be machined from either direction, u or v. Therefore, in our system two variables (u and v) are added in g-code g52: if u=1, CNC machining begins from the u direction; if v=1, machining begins from the v direction. In g52 the variable d is to specify the cutter diameter. 4.1. Example of surface g-codes The parametric surface shown in Fig. 9 is defined by the surface g-code. The programming parameters used in the g-code format are in Basic Length Units (BLU). In this example BLU equals to 0.01 mm. g53 b⫺14000 c14000 h21000 i⫺21000 p⫺3000 q1000 r7000 g54 a⫺2000 b3000 d⫺10000 e2000 h⫺3000 j14000 o1000 g55 a⫺12000 b18000 c⫺8000 e24000 h⫺36000 i12000 j⫺5000 k⫺8000 l12000 o4000 p ⫺2000 r1000 s1000 Before CNC machining can be processed, “g52 d400 v1” or “g52 d400 u1” is needed in the part program to specify the machining direction and the cutter size. In this example, a ball-end cutter, 4 mm in diameter, was used for machining. The interpolation results of the tool paths created by the real-time surface interpolator are shown in Figs. 10 and 11 for the tool paths in the v and u directions, respectively. In order to see the tool paths clearly, a larger surface scallop height, 0.5 mm, was specified for this figure.

Fig. 9. An example of the parametric surface defined by a surface g-code.

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

1525

Fig. 10. The generated tool paths in the v-direction.

Fig. 11. The generated tool paths in the u-direction.

5. Conclusions The above simulation and experimental results show that the off-line (CAD) interpolator trades off between interpolation accuracy and feedrate variations. For instance, the surface can be approximated by more straight lines to increase the interpolation accuracy, or to reduce contour errors. However, the more straight lines that are used, the greater the feedrate variations will be. In machining, motors do not follow these feedrate variations produced by the off-line interpolator; but, motors will filter them according to the time constant. Feedrate variations will still be present in resulting axes motions and the average feedrate will be smaller than the desired feedrate. Therefore, off-line interpolators require longer machining time. Instead of decomposing a surface into a sequence of straight lines inside the CAD system (off-

1526

R.-S. Lin / International Journal of Machine Tools & Manufacture 40 (2000) 1513–1526

line approach), this paper presents a real-time approach for 3-D parametric surface machining. The input to the real-time surface interpolator is the g-code type of the NC part program, which contains surface geometric information and cutting conditions. Clearly, the real-time interpolator maintains better constant feedrate machining, generates smaller contour error, and requires less machining time compared to that of the off-line interpolator. To summarise, the real-time surface interpolator presents only advantages when compared to off-line interpolators. References [1] B. Choi, C. Lee, J. Hwang, C. Jun, Compound surface modelling and machining, Computer-Aided Design 20 (3) (1988) 127–136. [2] S. Kawabe, F. Kimura, T. Sata, Generation of NC commands for sculptured surface machining form 3-coordinate measuring data, CIRP Ann. 30 (1) (1981) 369–372. [3] G. Loney, T. Ozsoy, NC machining of free form surfaces, Computer-Aided Design 19 (2) (1987) 85–90. [4] D. Wysocki, J. Oliver, E. Goodman, Gouge detection algorithms for sculptured surface NC generation, in: ASME Winter Annual Meeting, Computer-aided Design and Manufacture of Cutting and Forming Tools, 1989, pp. 39–44. [5] H.T. Yau, C.H. Menq, Automated CMM path planning for dimensional inspection of dies and molds having complex surfaces, International Journal of Machine Tools and Manufacture 35 (6) (1995) 861–876. [6] S. Bedi, A multi-processor based surface machining system with interference checking, in: Proceedings of the Second International Conference on Advanced Manufacturing Systems and Technology, Trento, Italy, 1990, pp. 104–113. [7] Y. Koren, Computer Control of Manufacturing System, McGraw-Hill, New York, 1983. [8] J. Bobrow, NC machine tool path generation from CSG part representations, Computer-Aided Design 17 (2) (1985) 69–76. [9] R. Lin, Y. Koren, Efficient tool-path planning for machining free-form surfaces, ASME Journal of Engineering for Industry 118 (1996) 20–28. [10] R. Lin, Y. Koren, Real-time interpolators for multi-axis CNC machine tools, CIRP Journal of Manufacturing System 25 (2) (1996) 145–149. [11] Y. Koren, Control of machine tools, Journal of Manufacturing Science and Engineering 119 (1997) 749–755. [12] M. Shpitalni, Y. Koren, C. Lo, Real-time curve interpolator, Computer-Aided Design 26 (11) (1994) 832–838.