METHOD AND DEVICE FOR INTERPOLATING FREE-FORM SURFACE

Abstract: A pre-processing arithmetic means (2) interprets an NC program (1) containing an interpolation command for an NURBS curve expressed by the function of a parameter (t) and calculates the distance ΔL of movement during an interpolating period T. A parameter value variation calculating means (3a) calculates the amount of change Δt of the parameter (t) caused by the movement of the distance ΔL from the present position specified by the present value t 1 of the parameter (t). An amount-of-movement calculating means (3b) calculates the position when the value of the parameter (t) becomes (t i +Δt) by using the defining equation of the NURBS curve. Then the means (3b) calculates the amount of movement to the position along each axis and outputs an interpolation pulse for each axis.

Description: The present invention relates to a free-form curve interpolation method for a numerical control unit, and in particular, to a free-form curve interpolation method of a curve represented by a NURBS (Non-Uniform Rational B-Spline). In order to machine a workpiece with machine tools, NC programs commanded to a computer numerical control (CNC) unit are in many instances created by automatic programming function based on the form drawn by CAD (Computer Aided Design), etc. In this case, one who designs a profile of a workpiece can freely draw various curves using various functions of a CAD system. However, it is difficult to smoothly connect free-form curves for expressing complicated profiles with one another. To deal with this, a free-form curve is divided into relatively simple intervals called segments, in order to represent the curve. There is a Base Spline curve as one of the functions for defining the free-form curve, and it is commonly called a B-Spline curve. The B-Spline curve can be defined by a plurality of control vectors. Moreover, a parameter corresponding to a junction between segments of a B-Spline curve is called a knot. The value of the knot gradually increases from the knot. The value of the knot gradually increases from the start point toward the end point of the B-Spline curve. Then, the B-Spline curve which is nonuniform in the increase rate of knot is rationalized, and a curve thus obtained is called a NURBS (Non-Uniform Rational B-Spline) curve. In the CAD system for a design of industrial products, etc., it is becoming popular to represent profiles of a curve and a curved surface with NURBS. This NURBS curve is adopted, as a form for representing a free-form curve, in a standard of CAD data exchange, i.e., an IGES (Initial Graphics Data Exchange Specification). On the other hand, in interpolating the free-form curve using a conventional CNC, it is necessary to do so by combining small blocks such as small straight lines, small circular arcs, etc. Therefore, in general, CAD data represented by the NURBS curve is approximated to small straight lines, small circular arcs of the. free-form curve designed by the CAD system in the stage before the CNC unit prepares command formats. However, as movement command blocks for the purpose of improving machining accuracy of industrial products are made smaller; various problems have arisen. For example, there are problems such as delay of command program transmission speed between a host computer and a CNC unit due to influence caused by hugeness of total amount of command blocks, and a delay of command program analysis processing speed of the CNC unit, etc. As described above, the NURBS curve drawn by the CAD system has to be decomposed into smaller blocks in order to be processed by the numerical control unit for interpolation of NURBS curve by the numerical control unit. For this reason, complicated processing tends to stand between them, thereby causing problems such as lowering of processing speed, etc. DE A 41 36 843 and DE A 43 10 126 relate to machining control employing a NURBS curve. DE A 41 36 843 in particular, discloses a numerical control method and device employing a B-Spline interpolator employing a conventional interpolation procedure. An object of the present invention is to provide a free-form curve interpolation method and an apparatus thereof for a numerical control unit, which are capable of performing an interpolation of a NURBS curve by commanding data for specifying the NURBS curve directly to the numerical control unit. A free-form curve interpolation method according to the present invention repeats a series of following processings: first, recognizing a NURBS curve interpolation command included in NC programs; calculating a distance to move during an interpolation period used as unit period, on the basis of a feed rate command in the recognized interpolation command; calculating a change in a parameter brought on when moving by the calculated distance from a current position specified by a current value of the parameter; calculating a position to be specified by the parameter as the sum of the calculated change of the parameter and the current parameter, based on the defining formula of the aforesaid NURBS curve; calculating a movement amount of each axis for moving to the calculated position; and outputting an interpolation pulse to each axis. A free-form curve interpolation apparatus according to the present invention comprises: preprocessing calculation means for reading NC programs including an interpolation command of a NURBS curve expressed by a function using a specific parameter as a variable, and calculating movement amount per unit time on the basis of a feed rate command in the interpolation command of the NURBS curve, thus outputting a movement command; parameter change calculation means for calculating a change in the parameter brought on when moving by the movement amount; and movement calculation means for obtaining a coordinate value to be interpolated next by substituting a value, as the sum of the change rate and a current value of the parameter, for the function of the NURBS curve, in order to calculate movement amount of each axis. In the present invention, with the features as described above, a CNC is set so that it calculates a function of the NURBS curve on the basis of data given to the CNC to obtain an interpolation path. Therefore, a programmer can give a command of data for the NURBS curve drawn by the CAD or the like directly to the CNC, so that the interpolation of the NURBS curve can be executed in the CNC. As a result, NC programs can be simplified, so that program transmission and program analysis processing can be performed at a high speed, and machining accuracy can be improved as well. Brief Description of the Drawings Fig. 1 is a block diagram schematically showing one construction of an embodiment of the present invention; Fig. 2 is a flowchart showing a process for designing a profile having a NURBS curve by a CAD system, and for executing the profile machining with a machine tool; Fig. 3 is a diagram showing an example of a command format of the NURBS curve; Fig. 4 is a diagram showing a movement amount in an interpolation period; Fig. 5 is a diagram showing an example of an NC program for executing the interpolation of NURBS curve; Fig. 6 is a diagram showing the relationship between control points and the NURBS curve; and Fig. 7 is a diagram showing an interpolation path drawn according to the NC programs shown in Fig. 5. Fig. 1 is a block diagram schematically showing a construction of a preferred embodiment of the present invention. There is prepared an NC program 1 including an interpolation command of a NURBS (Non-Uniform Rational B-Spline) curve. The profile of the NURBS curve is specified by data such as weight, and expressed by a function using a parameter "t" as a variable. Thus, if the value of parameter "t" at any time is determined, the coordinate value at that time is specified by a defining formula of the NURBS curve. A preprocessing calculation means 2 reads the NC program 1. Recognizing an interpolation command of the NURBS curve, the preprocessing calculation means 2 calculates a distance ΔL to move during an interpolation period used as unit period, on the basis of a feed rate command in the interpolation command. The distance ΔL, together with other data for creating a function of the NURBS curve, is inputted to an interpolation means 3. The interpolation means 3 comprises parameter change calculation means 3a and movement calculation means 3b. The parameter change calculation means 3a calculates a change Δt in the parameter "t" brought on when moving by the distance ΔL from the current position specified by the current value "t i " of the parameter "t". The movement calculation means 3b calculates a position at which the value of parameter "t" becomes "t i + Δt" by the defining formula of the NURBS curve. Subsequently, the movement calculation means 3b calculates a movement amount of each axis for moving to the position, and outputs interpolation pulses ΔX, ΔY and ΔZ corresponding to respective axes. Then, the value of "t i + Δt" is transmitted to the parameter change calculation means 3a as a value of "t i +1". Interpolation pulses ΔX, ΔY and ΔZ are individually inputted to each of corresponding axis control circuits 4a, 4b and 4c. The axis control circuits 4a, 4b and 4c respectively outputs a movement command to each of corresponding servo amplifiers 5a, 5b and 5c, whereupon servo amplifiers 5a, 5b and 5c respectively control rotation of each of the servo motors 6a, 6b and 6c according to the movement command. In the manner as described above, data for specifying the NURBS curve drawn by the CAD system or the like is commanded directly to the CNC, so that a free-form curve interpolation of the NURBS curve can be executed. Next, detailed descriptions on the NURBS curve will be given in the following. In order to indicate that a symbol shown in a numerical equation is a vector, the symbol is surrounded with angle brackets "< >". The NURBS curve of rank "j" (j - 1 degrees) is defined by the following equation (1): 〈P(t)〉 = ∑ n i=o N i,j ( t )· w i < P i > ∑ n i=0 N i,j ( t )· w i As seen from the above explanation, the NURBS curve is a function using the parameter "t" as a variable, and is represented by a vector <P(t)>. Also, a basic function N is expressed by the following equations. For example, 1 rank basic function N i,1 (t) is expressed as follows: Also, k rank basic function N i,k (t) is expressed as follows: N i , k ( t ) = ( t - x i ) N i,k - 1 ( t ) x i + k - 1 - x i + ( x i + k - t ) N i+1 , k-1 ( t ) x i + k - x i +1 In the above equations (1) to (3), <P i > is a control point vector (0 ≤ i ≤ n), and represents a control point inputted according to NC programs. Wi is weight (0 ≤ i ≤ n) ; on the other hand, X i is knot (X i ≤ X i+1 ). A sequence [x 0 , X 1 , X 2 , .... X m ] is a knot vector. In this case, the following relational equation is established, that is, "control point (n + 1) + rank (j) = number of knot (m + 1)" Fig. 2 shows a process for designing a profile of the NURBS curve by the CAD system and for executing profile machining with the machine tool. More specifically, first, a design of molds, etc., are made by the CAD function (Step S1). In this case, a free-form curve is represented on .the basis of the NURBS curve. Next, NC part programs are prepared by the function of CAM (Step S2). In this case, the CNC converts the NURBS curve into a predetermined NC program format, and prepares a NURBS curve interpolation command. Subsequently, the CNC executes NC programs including the NURBS curve interpolation command so that machine tool can machine workpieces such as molds, etc.(Step S3). Fig. 3 shows an example of a NURBS curve command format. An NC program 20 is prepared on the basis of the format as shown in Fig. 3, whereby the NURBS curve interpolation is commanded to the CNC. In this example, "G06.2" denotes a NURBS curve interpolation start command, "P" denotes rank, each of "X", "Y" and "Z" denotes a control point, "K" denotes knot, "R" denotes weight, "F" denotes velocity and "G01" denotes a linear interpolation command. "j", "X i " and "W i " in the above equations (1), (2) and (3) are given as values of these "P", "K" and "R", respectively. In order to specify the NURBS curve, there is a need of knot which in number is equivalent to the sum of the number of ranks and the number of control points. For this reason, in this example, when commanding a control point, knot is simultaneously commanded, and further, knot equivalent to the number of rank is commanded in another block. If weight is not commanded, the value of weight is regarded as "1". The NURBS curve interpolation command is canceled by other interpolation start command such as linear interpolation start command (G01), etc. When the NC program as described above is inputted to the CNC, the NURBS interpolation start command is recognized by the preprocessing calculation means included in the CNC. A distance ΔL to move during interpolation period is calculated on the basis of a feed rate "F". Subsequently, a change Δt in the current parameter "t" for moving by the distance ΔL is obtained from the following equation (4) on the basis of the distance ΔL. Δ t = ΔL |< P'(t) >| In the above equation (4), a denominator |<P'(t)>| is an absolute value obtained by differentiating the vector <P(t)> by the parameter "t". A value of the vector P (t + Δt) obtained by substituting for the above equation (1) a sum of a parameter change Δt obtained from the above equation (4) and a value of current parameter "t" is the next interpolation point. Fig. 4 is a diagram showing a movement amount during interpolation period. In Fig. 4, the current position P(t) on a commanded NURBS curve 10 is a point represented by a vector <P(t)>. Differentiating the vector <P(t)> by the parameter "t", a vector <P'(t)> is obtained. Thus, a point on the NURBS curve 10 separated from the vector <P(t)> by the distance ΔL is a point P (t + Δt) represented by the vector <P(t)>. Then, the movement calculation means 3b (shown in Fig. 1) calculates a movement amount of each axis from the point <P(t)> to the point P (t + Δt), and outputs interpolation pulse to each axis, whereby interpolation can be executed on a path along the NURBS curve 10. The following is the detailed description on the case where a fourth rank (3rd order) NURBS curve interpolation is executed. Fig. 5 is a diagram showing an example of NC programs for executing the NURBS curve interpolation. In an NC program 21, a NURBS curve interpolation start command (G06.2) designates six control points. The coordinate of the first control point is (X0, Z0), the coordinate of the second control point is (X300, Z100.), the coordinate of the third control point is (X700, Z100.), the coordinate of the fourth control point is (X1300, Z-100.), the coordinate of the fifth control point is (X1700, Z-100.), and the coordinate of the sixth control point is (X2000, Z0). On the other hand, the knot is designated in the following named order, "0", "0", "0", "0", "0.5", "0.5", "1.0", "1.0", "1.0" and "1.0". Subsequently, the NURBS curve interpolation start command (G06.2) is given after linear interpolation command (G01, Y100.). At this time, six control points are designated. The coordinate of the seventh control point is (X2000, Z0), the coordinate of the eighth control point is (X1700, Z-100.), the coordinate of the ninth control point is (X1300, Z-100.), the coordinate of the tenth control point is (X700, Z100.), the coordinate of the eleventh control point is (X300, Z100.), and the coordinate of the twelfth control point is (X0, Z0). On the other hand, the knot is designated in the following named order, "0", "0", "0", "0", "0.5", "0.5", "1.0", "1.0", "1.0" and "1.0" The NURBS curve interpolation start command is cancelled by linear interpolation command (G01, Y100). In the example case shown in Fig. 5, "j" is 4, and "n" is 5; therefore, the denominator and fraction of the vector <P(t)> defining the NURBS curve are expressed as follows on the basis of the equation (1). [Fraction]: N 0.4 (t)<P 0 > + N 1.4 (t)<P 1 > + N 2.4 (t)<P 2 > ... N 5.4 (t)<P 5 > [Denominator]: N 0.4 (t) + N 1.4 (t) + N 2.4 (t) .... N 5.4 (t) In this case, it is commonly known that the value of denominator becomes "1" because Wi is always "1". Therefore, the vector <P(t)> is expressed by the following equation (5). <P(t)> = N 0.4 (t)<P 0 > + N 1.4 (t)<P 1 > + N 2.4 (t)<P 2 > .... N 5.4 (t)<P 5 > where, X 0 ≤ t < X 9 . Also, in Fig. 5, X 0 = 0.0, X 1 = 0.0, X 2 = 0.0, X 3 = 0.0, X 4 = 0.5, X 5 = 0.5, X 6 = 1.0, X 7 = 1.0, X 8 = 1.0, X 9 = 1.0 Although the parameter "t" changes in the interval X 0 ≤ t < X 9 , the intervals where the parameter actually change are X 3 ≤ t < X 4 and X5 ≤ t < X 6 . In the interval 0 = X 3 ≤ t < X 4 = 0.5, calculating first rank basic function on the basis of the equation (2), we obtain N 0.1 = 0, N 1.1 = 0, N 2.1 = 0, N 3.1 = 1, N 4.1 = 0, N 5.1 = 0, N 6.1 = 0, N 7.1 = 0, N 8.1 = 0 Substituting the above data for the equation (3) and calculating cases of k = 2 and k = 3 in the equation (3) in order, values of N 0.4 (t), N 1.4 (t), N 2.4 (t), .... N 5.4 (t) in the above equation (5) can be obtained (in the calculation of the equation (3), when the denominator of the first or second term in the right side of the equation become zero "0", the fraction thereof inevitably become zero "0"; in this case, the calculation is made as 0/0 =. 0). Specifically, N 0.4 (t) = -8t 3 + 12t 2 - 6t + 1 N 1.4 (t) = 24t 3 - 24t 2 + 6t N 2.4 (t) = -20t 3 + 12t 2 N 3.4 (t) = 4t 3 N 4.4 (t) = 0 N 5.4 (t) = 0 In the interval X 3 ≤ t < X 4 , the initial value t = 0 is set, and |<P'(0)>| is calculated, and then, Δt 1 is obtained from the equation (4). Whereupon, from the equation (5), the vector of the interpolation point <P(t + Δt 1 ) = <P(Δt 1 )> is as follows: <P(Δt1)> = N 0.4 (Δt 1 )<P 0 > + N 1.4 (Δt 1 )<P 1 > + N 2.4 (Δt 1 )<P 2 > .... N 5.4 (Δt 1 )<P 5 > From the interpolation point thus obtained, |<P'(Δt 1 )>| is calculated, and Δt 2 is calculated from the equation (4), in order to obtain a vector <P(t + Δt 1 + Δt 2 )> = <P(Δt 1 + Δt 2 )> which is the vector of a new interpolation point. Likewise, if interpolation points are successively calculated, from the equation (5), these interpolation points are as follows: <P(0)> (initial value) <P(Δt 1 )>; <P(Δt 1 + Δt 2 )>; <P(Δt 1 + Δt 2 + Δt 3 )>; <P(Δt 1 + Δt 2 + Δt 3 ... ... + Δt i )>. In this case, if the value of Δt 1 + Δt 2 + Δt 3 ... ... + Δt i exceeds 0.5, P(0.5) is set. Also, vectors in the case of the interval X 5 ≤ t < X 6 can be calculated in the same manner as the aforesaid interval. Fig. 6 is a diagram showing the relationship between control points and the NURBS curve. This diagram shows a NURBS curve interpolated according to the first NURBS curve interpolation start command of NC programs shown in Fig. 5. Further, in the diagram, the first through sixth control points are represented by P 0 through P 5 , respectively. In this manner, a smooth curved line is formed in accordance with positions of respective control points. Fig. 7 is a diagram showing an interpolation path according to NC programs shown in Fig. 5. According to the first NURBS curve interpolation start command, the interpolation from the first control point P 0 to the sixth control point P 5 is executed. Then, the linear interpolation to the control point P 6 is executed, and thereafter, the interpolation from the seventh control point P 6 to the twelfth control point P 7 is executed according to the next NURBS curve interpolation start command. Further, the interpolation to the thirteenth control point P 8 which is the next NURBS curve interpolation start position is executed, and subsequently, an interpolation is executed likewise. As described above, the NURBS curve interpolation can be instructed to the CNC by specifying the smallest data necessary for identifying a profile of the NURBS curve. Therefore, there is no need of dividing a free-form curve represented by the NURBS curve into small straight lines, small circular arcs, etc., as is necessary in the case of the prior art, so that NC programs can be simplified. Thus, NC programs are simplified to reduce the amount of the data, so that data transmission between the host computer and the CNC can be performed at a high speed. In addition, NC program analysis processing in the CNC can also be performed at a higher speed. Moreover, in determining the interpolation path of a free-form curve, there is no need of executing an approximation calculation, so that machining accuracy can be improved.

Claims: A free-form curve interpolation method, comprising steps of: (1) recognizing a NURBS (Non-Uniform Rational B-Spline) curve interpolation command included in an NC program; (2) calculating a distance to move during an interpolation period used as unit period, on the basis of a feed rate command in said recognized interpolation command; (3) calculating a change in a parameter brought on when moving by the distance calculated in said step (2) from a current position specified by a current parameter value; (4) calculating a position to be specified by a parameter which is obtained by adding the amount of the change of the parameter calculated in said step (3) to the current parameter of said step (3), on the basis of a defining formula of said NURBS curve; (5) calculating a movement amount of each axis for moving to said position calculated in said step (4), and then outputting an interpolation pulse to each axis; and (6) repeating processes following said step (3) using said position of said step (4) as a "current value". A method of designing a workpiece and generating, movement commands along the surface of the workpiece, comprising steps of: (1) designing a workpiece by representing a free-form curve with a NURBS curve by means of a CAD system; (2) creating an NC program by a CAM system with a format capable of instructing the interpolation of said NURBS curve to a CNC; (3) inputting said created NC program to said CNC, whereupon said CNC executes steps of: (3-1) recognizing a NURBS curve interpolation start command; (3-2) calculating a distance to move during an interpolation period, on the basis of a speed (feed rate) command of said NC program; (3-3) calculating a change in a parameter for moving by the distance calculated in said step (3-2) from a current position specified by a value of said parameter used as a function expressing said NURBS curve; (3-4) calculating a position specified by substituting a parameter obtained by adding the parameter value calculated in said step (3-3) to the calculated change of parameter, for said function expressing said NURBS curve, as a point to be interpolated next, so as to obtain the next position on said NURBS curve separated. from said current position along said NURBS curve by the distance calculated in said step (3-2); (3-5) calculating a movement amount of each. axis from said current position to said next position, and outputting interpolation pulses corresponding to said calculated movement amount to each axis driving means; and (3-6) repeating the processes following said step (3-3) using said position of said step (3-4) as a "current valve"; thereby executing an interpolation on a path along said NURBS curve. A free-form curve interpolation system for a numerical control unit which controls axis movement of various machine tools, comprising: preprocessing calculation means for reading NC programs including an interpolation command of a NURBS curve expressed by a function using a specific parameter as a variable, calculating a movement amount per unit time on the basis of a feed rate command in the interpolation command of the NURBS curve and outputting a movement command; parameter change calculation means for calculating a change in said parameter brought on when moving by said movement amount; and movement amount calculation means for obtaining a coordinate value to be interpolated next by substituting a value which is obtained by adding the value of said parameter change to a current value of said parameter, for a function expressing said NURBS curve, so as to calculate a movement amount of each axis corresponding to said coordinate values. The free-form curve interpolation system according to claim 3, wherein said preprocessing calculation means recognizes a NURBS curve to be interpolated when data, such as a plurality of control points, weights whose number is equal to the number of said control points, and the knots whose number is equal to a number equivalent to the sum of the number of rank of a curve and the number of said control points, are commanded according to said NC programs. The free-form curve interpolation system according to claim 4, wherein said preprocessing calculation means recognizes said weight as a predetermined arbitrary value if said weight is omitted.

Inventors: KOZAI HARUHIKO, OTSUKI TOSHIAKI, WAKINOTANI YOSHIYUKI, KOZAI, HARUHIKO, OTSUKI, TOSHIAKI, WAKINOTANI, YOSHIYUKI, KOZAI, Haruhiko Fanuc Manshonharimomi Room 6-107, WAKINOTANI, Yoshiyuki Fanuc Dai-3 Vira-karamatsu
Applicants: FANUC LTD
Application year: 1996
Main classification: G05B19
IPC codes: G05B19