Abstract:
A method of controlling a comb-cutter lathe in which one face of a tool rest (TBS) is provided with two or more juxtaposed tools (TL1, TL2) for subjecting a workpiece (WK) to machining by using: (1) predetermined tools in succession, (2) part dimensions, (3) a tool selection sequence, (4) a machining start location for each tool, and (5) mounting dimension information measured from a reference point on the tool rest to a distal end of each tool. Machining is sequentially performed based on this information by predetermined tools at machining locations (P 5  -P 4  -P 3  -P 2  -P 1  ; P 6  -P 7  -P 8  -P 9  -P 10 ) assigned to the tools, and after machining is completed by a first tool (TL1), the tool rest (TBS) is moved to position the next tool (TL2) at a machining location and machining is performed by that tool. The method includes moving the tool rest along a Z axis to a point P r  at which none of the tools (TL1, TL2) will contact the workpiece (WK) when the tool rest (TBS) is moved in a direction (X-axis direction) at right angles to the longitudinal direction (Z-axis direction) of the workpiece, and thereafter moving the tool rest along the X axis to a point P t  at which an X-axis position of a selected tool coincides with an X-axis coordinate value of a position at which machining is to be started by the selected tool, and thenforth performing machining using the selected tool.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
     This application is related to copending U.S. patent application U.S. Ser. No. 621,927. 
     BACKGROUND OF THE INVENTION 
     This invention relates to a method of controlling a comb-cutter lathe in which one face of a tool rest is provided with two or more juxtaposed tools for subjecting a workpiece to machining by using predetermined tools in succession. 
     When it becomes necessary to change tools in an ordinary turret lathe, the turret is moved to a position where the tools will not interfere with a stationary part of the machine or with the workpiece even when the turret is rotated. The turret is then rotated to select the desired tool, and the selected tool is positioned at a machining starting point. Machining is then performed by the selected tool. Since a turret lathe thus requires moving the turret to a tool changing position, selecting a tool by rotation of the turret, and positioning the turret at a machining starting point, a comparatively long period of time is needed to select a tool. In machining a small article that requires a machining time of from 10 seconds to several minutes, the amount of time needed for tool selection cannot be ignored. In particular, where a large number of lots are concerned, a reduction in the tool selection time is desired. To achieve a machining time reduction a comb-cutter lathe has come into use because it has a plurality of tools provided in juxtaposition on one face of a tool rest, with predetermined ones of the tools being used one after another to machine a workpiece. An advantage of a comb-cutter lathe of this kind is that tool selection time is shortened since it is unnecessary to rotate the tool rest when selecting a tool. With a comb-cutter lathe, however, it is necessary to slide the tool rest when selecting a tool, and to arrange the tools so that they do not interfere with the workpiece when sliding takes place. 
     SUMMARY OF THE INVENTION 
     Accordingly, an object of the present invention is to provide a method of controlling a comb-cutter lathe wherein a tool will not interfere with a workpiece when a tool rest is slid during tool selection. 
     Another object of the present invention is to provide a method of controlling a comb-cutter lathe wherein the path of a tool rest at the time of a tool selection is generated automatically. 
     A further object of the present invention is to provide a method of controlling a comb-cutter lathe wherein the path of a tool rest at the time of a tool selection can be shortened to enable a reduction in the time needed for the tool selection. 
     The present invention provides a method of controlling a comb-cutter lathe wherein machining at machining locations assigned to respective tools mounted on a tool rest is performed in sequential fashion, and after completion of machining performed by one tool, the tool rest is moved in order to position a subsequent tool at a machining location where machining is to be performed by that tool. The method includes: (1) moving the tool rest along a Z axis (longitudinal direction) to a point P r  at which none of the tools will contact the workpiece when the tool rest is moved in a direction (X-axis direction) at right angles to the longitudinal direction (Z-axis direction) of the workpiece, and (2) thereafter moving the tool rest along the X axis to a point P t  at which an X-axis position of a selected tool will coincide with an X-axis coordinate value of a position at which machining is to be started by the tool, and thenceforth performing machining using a selected tool. According to the invention, a tool will not interfere with the workpiece when a tool is selected, and tools can be changed along the shortest path. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1(A)-1(D) illustrate the machining performed by a comb-cutter lathe; 
     FIG. 2 is a block diagram of an automatic programming apparatus to which the present invention appertains; 
     FIGS. 3(A)-3(C) illustrate a flowchart of the processing for creating a part program according to the present invention; 
     FIG. 4 illustrates a tool path according to the present invention; 
     FIG. 5 illustrates the final contour of a part as displayed on a CRT; 
     FIG. 6 shows an example of data input for each machining process for machining the contour shown in FIG. 5; 
     FIG. 7 shows tool mounting positions on a comb-cutter tool rest; 
     FIG. 8 shows according to the present invention a created part program; 
     FIG. 9 is a block diagram of an NC apparatus; and 
     FIG. 10 is a flowchart for the processing to accomplish the machining performed by a comb-cutter lathe according to the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIGS. 1(A)-1(D) illustrate machining performed by a comb-cutter lathe in which one face of a tool rest TBS is provided with two tools TL1 and TL2 in juxtaposition. We will assume that a workpiece WK having a stock contour indicated by the dashed line is to be machined into the part contour indicated by the solid line, and that the portion P 1  -P 2  -P 3  -P 4  -P 5  of the part contour is to be subjected to coarse machining in the first quadrant by the tool TL1, which is for coarse machining, and that the portion P 6  -P 7  -P 8  -P 9  -P 10  of the part contour is to be subjected to fine machining in the fourth quadrant by the tool TL2, which is for fine machining. The workpiece WK has a turning axis which coincides with the Z axis shown in FIGS. 1(A)-1(D). 
     First, the tool TL1 is moved as in turning work performed by an ordinary turret lathe (see the fine lines in the first quadrant of FIG. 1(A)) to provide a coarse machined part contour indicated by P 1  -P 2  . . . -P 5   (see FIG. 1(B)). 
     Next, assuming that fine machining must be performed in the fourth quadrant by the tool TL2, a Z-axis position P r  (FIG. 1(B)) determined so that the tools TL1 and TL2 will not contact the workpiece WK when the tool rest TBS is moved along the X axis. The tool rest TBS is then moved to the position P r  (FIG. 1(C)). 
     Thereafter, the tool rest TBS is transported along the X axis to a point P t  [FIG. 1(D)] where the X-axis position of the tool TL2 for fine machining coincides with the X-axis coordinate value of a position P 6  where machining performed by the tool is to start. Thenceforth, the tool rest is transported along the path P 6  →P 7  →P 8  →P 9  →P 10  to perform fine machining with the selected tool TL2. 
     To perform the foregoing control in accordance with the present invention, NC data is created from: (1) the part dimensions, (2) the tool selection sequence, (3) the machining location of each tool and reference positions of the respective tools. The data is stored in memory and control is effected by reading the NC data out of the memory one block at a time. 
     The method of controlling a comb-cutter lathe according to the present invention now be described in two parts, namely (I) processing for creating an NC part program, and (II) processing for machining performed by a comb-cutter lathe. 
     (I) Processing for creating an NC part program 
     (1) First, a keyboard 101 and display unit 102 shown in FIG. 2 are used to enter data specifying (1) the external shape of the workpiece WK, e.g., coordinate values x m , z m  (see FIG. 4) of a point P m , (2) part contour, e.g., coordinate values x i , z i  of a point P i  (i=1, 2 . . . 10), coordinate values x o , z o  of an initial position P o  of a tool, a clearance distance c used during coarse machining, a finishing allowance t, depth of cut d for one pass, finishing increment u, coarse cutting speed f c , and fine cutting speed f c  &#39;. These data are stored in a RAM 103. Stock contour and part contour are displayed on the display unit 102, as shown in FIG. 5. 
     (2) Next, as shown in FIG. 6, the tool to be used (e.g., T1), the tool mounting position (e.g., ΔX1, ΔZ1) and the location to be machined by the tool (e.g., P 5 , P 4 , P 3 , P 2 , P 1 ) are entered and stored in the RAM 103 in the desired order of machining. The tool used is expressed by the letter of the alphabet &#34;T&#34; and a one-digit numerical value following &#34;T&#34;. The tool mounting position, as shown in FIG. 7, is expressed by the distance (actually incremental values along the corresponding axes) from a reference point R on the tool rest TBS to the tool respective noses of tools TL1, TL2, TL3. The tool used and the mounting position of the tool are specified by entering a tool number &#34;T□&#34; and incremental values &#34;ΔXi, ΔZi&#34; for each of the prescribed tools. The location to be machined by each tool is specified by point numbers P 1 , P 2  . . . P 24  (FIG. 5). Specifically, a machining location is specified by entering these numbers into RAM 103 from the keyboard 101. Thus, information for first, second and third machining processes is stored in the RAM 103 and is given by the following: 
     T 1  :ΔX 1 , ΔZ 1  :P 5 , P 4 , P 3 , P 2 , P 1  ; 
     T 2  :ΔX 2 , ΔZ 2  :P 6 , P 7 , P 8 , P 9 , P 10  ; 
     T 3  :ΔX 3 , ΔZ 3  :P 21 , P 22 , P 23 , P 24   
     assuming that coarse machining is to be performed along P 5  through P 1  by the tool TL1 for coarse machining, fine machining is to be performed along P 6  through P 10  by the tool TL2 for fine machining, and grooving is to be performed along P 21  through P 24  by the grooving tool TL3. It should be noted that T 1 , T 2 , T 3  are the tool numbers of the tools TL1, TL2, TL3. 
     (3) When all data necessary for NC part program creation are entered through steps (1) and (2) above, a control program for creating a part program which is stored in a ROM 104 of FIG. 2 starts to run, and a processor 105, through processing described below, creates a subprogram for each machining process, creates a main program for calling the subprograms in the desired machining process order, and creates, in a RAM 106, an NC part program obtained by combining the created subprograms and main programs. The processing for creating both the subprograms and the main program will now be described. 
     (3a-1) The processor 105 determines whether a j-th machining process (where the initial value of j is 1) exists. If it does, the category of machining process (coarse machining, fine machining, grooving, threading, etc.) is recognized from the tool used in the process. A table 107 in FIG. 2 stores the correlation between machining category and the tool used to perform the machining. The processor 105 identifies the category of the j-th machining process based on the information in the table 107. 
     (3a-2) In order to create a subprogram for rough machining, which is the first machining process (j=1), the processor 105 generates a subprogram number for the j-th machining process, namely: 
     
         O000j 
    
     The processor stores the number in the RAM 106 and then uses the initial position (x o , z o ) of the tool rest TBS stored in the RAM 103 to create NC data for setting the coordinate system, namely: 
     
         G50Xx.sub.o Zz.sub.o ; 
    
     The processor stores this data in the RAM 106. 
     (3a-3) The processor 105 then calculates the position x s , z s  of the tool rest TBS that will exist when the nose of the tool TL1 is situated at the machining starting point P 2 , which is spaced from the point P m  (FIG. 4) by the clearance c along both the X and Z axes. This position of the tool rest is calculated using the following equations where c is the clearance distance for coarse machining: 
     
         X.sub.m +c+ΔX.sub.1 →x.sub.s 
    
     
         z.sub.m +c+ΔZ.sub.1 →z.sub.s 
    
     When the coordinates of the machining starting point P s  have been calculated, the processor creates the following data for effecting positioning from the initial position to the machining starting point P s  : 
     
         G00Xx.sub.s Zz.sub.s ; 
    
     and stores the data in the RAM 106. 
     (3a-4) Next, the processor 105 performs the operation 1→i and calculates the position x a , z a  of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P ai  (=P a1 ), which is spaced from the machining starting point P s  by (c+d) (where c is the clearance distance for coarse machining and d is th depth of cut) along the -X axis. This position of the tool rest is calculated from the following equations: 
     
         x.sub.m -d+ΔX.sub.1 →x.sub.a 
    
     
         z.sub.m +c+ΔZ.sub.1 →z.sub.a 
    
     (3a-4) After x a , z a  are calculated, the processor 105 determines whether the following holds: 
     
         x.sub.a &#39;≧(x.sub.5 +t) 
    
     (where x a  &#39;, x 5  are the X-axis coordinate values of points P ai  (=P a1 ) and P 5 , respectively). 
     (3a-5) If x a  &#39;≧(x 5  +t) holds, the processor 105 obtains a point P bi  (=P b1 ), which is where a straight line L 1i  parallel to the Z axis and passing through the point P ai  (Pa 1 ) intersects the part contour, and then obtains the position x b , z b  of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P b1  &#39;, which is spaced from the point of intersection P b1  by the finishing margin t along the +Z axis. The processor also calculates the coordinate values x c , z c  of a point P c1  which is spaced from the point P b1  &#39; by (d+u) along the +X axis, where u is the finish cut increment. These coordinate values are calculated from the following equations: 
     
         x.sub.b &#39;+d+u→x.sub.c 
    
     
         z.sub.b &#39;→z.sub.c 
    
     (where x b  &#39;, z b  &#39; are the coordinate values of the point P b1  &#39;). 
     (3a-6) The processor 105 then determines whether a straight line L 21  (=L 21 ) parallel to the Z axis and passing through the point P c1  intersects the part contour. 
     (3a-7) If the straight line L 21  does not intersect the part contour, the processor 105 obtains the point of intersection P d1  between the straight line L 21  and the extension of a straight line segment P 2  P 1  containing the point P b1 , which straight line segment is from among the straight line segments P 5  P 4 , P 4  P 3 , P 3  P 2 , P 2  P 1  that specify the part contour. Thereafter, the processor calculates the position x d , z d  of the tool rest that will exist when the nose of the tool TL1 is at a point P d1  &#39;, which is spaced from the point of intersection P d1  by the finishing margin t. 
     (3a-8) Next, the processor 105 calculates the position x s , z s  of the tool rest TBS that will exist when the nose of the tool TL1 is at the next machining starting point P s1 . This position is calculated from the following equations: 
     
         x.sub.c +ΔX.sub.1 →x.sub.s 
    
     
         z.sub.m +c+ΔZ.sub.1 →z.sub.s 
    
     (3a-9) When the coordinate values of each of the points occupied by the tool rest TBS have been found through the foregoing steps, the processor 105 uses these coordinate values to create and store the following in the RAM 106: 
     G00Xx a  Zz a  ; 
     G01Xx b  Zz b  Ff c  ; 
     Xx d  Zz d  ; 
     G00Xx s  Zz s  ; 
     (3a-10) The processor 105 then performs the operation i+1→i and calculates the position x a , z a  of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P ai  (=P a2 ), which is spaced from the machining starting point P s1  by (2d+u) along the -X axis. This position of the tool rest is calculated from the following equations: 
     
         x.sub.s -(2d+u)→x.sub.a 
    
     
         z.sub.s →z.sub.a 
    
     Thereafter, the processor repeats the process steps from step (3a-4) onward. 
     (3a-11) If the straight line L 2i  (e.g., straight line L 22 ) is found to intersect the part contour at a point P di  in step (3a-6), then the processor calculates the position x d , z d  of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P di  &#39;, which is spaced from the point of intersection P di  (along the Z axis) by the finishing margin t. 
     (3a-12) Next, the processor 105 determines whether points P 1  through P 5 , which specify the part contour, are located between points P bi  and P di . If the points P 1  through P 5  are not located between P bi  and P di , then processing from step (3a-8) onward is repeated. 
     (3a-13) If at least one of the points P 1  through P 5  (P 2 , P 3 ) is found to lie between point P bi  and point P di  in executing step (3a-12), then the processor obtains the positions x 3  &#39;, z 3  &#39; and x 2  &#39;, z 2  &#39; of the tool rest TBS that will exist when the nose of the tool TL1 is respectively at points P 3  &#39;, P 2  &#39;, which are respectively spaced from the points P 3  and P 2  by the finishing margin t along both the +X and +Z axes. These positions are obtained from the following equations: 
     
         x.sub.3 +t+ΔX.sub.1 →x.sub.3 &#39; 
    
     
         z.sub.3 +t+ΔZ.sub.1 →z.sub.3 &#39; 
    
     
         x.sub.2 +t+ΔX.sub.1 →x.sub.2 &#39; 
    
     
         z.sub.2 +t+ΔZ.sub.1 →z.sub.2 &#39; 
    
     The processor 105, through processing similar to that of step (3a-8), then obtains the position x s , z s  of the tool rest TBS that will exist when the nose of the tool TL1 is at the next machining starting point P si . Thereafter, the processor uses the coordinate values of each of the positions occupied by the tool rest to create and store the following data in the RAM 106: 
     G00Xx a  Zz a  ; 
     G01Xx b  Zz b  Ff c  ; 
     X x3  &#39; Z z3  &#39;; 
     X x2  &#39; Z z2  &#39;; 
     X xd , Z zd  ; 
     G00Xx s  Zz s  ; 
     This is followed by repeating processing from step (3a-10) onward. 
     (3a-14) If x a  &lt;(x 5  +t) is found to hold in step (3a-4), the processor calculates the position x 5  &#39;, z 5  &#39; of the tool rest TBS that will exist when the nose of the tool TL1 is situated at the point P 5  &#39;, which is spaced from the point P 5  by the finishing margin t along the +X axis and by the clearance c along the +Z axis. This position of the tool rest is calculated from the following equations: 
     
         x.sub.5 +t+ΔX.sub.1 →x.sub.5 &#39; 
    
     
         z.sub.5 +c+ΔZ.sub.1 →z.sub.5 &#39; 
    
     The processor also calculates the position x 4  &#39;, z 4  &#39; of the tool rest TBS that will prevail when the nose of the tool TL1 is situated at the point P 4  &#39;, which is spaced from the point P 4  by the finishing margin t along both the +X and +Z axes. This position of the tool rest is calculated from the following equations: 
     
         x.sub.4 +t+ΔX.sub.1 →x.sub.4 &#39; 
    
     
         z.sub.4 +t+ΔZ.sub.1 →z.sub.4 &#39; 
    
     This is followed by obtaining the coordinate values x c , z c  of a point P cn , which is spaced from the point P 4  &#39; by (d+u) along the +X axis. These coordinate values are obtained from the following equations: 
     
         x.sub.4 +t+d+u→x.sub.c 
    
     
         z.sub.4 +t→z.sub.c 
    
     The processor then obtains the position x d  &#39;, z d  &#39; of a point P dn  at which the part contour is intersected by a straight line L2n parallel to the Z axis and passing through the point P cn , followed by the coordinate values x d , z d  and x e , z e  of the tool rest TBS that will exist when the nose of the tool TL1 is respectively at points P dn  &#39; (=P cn  &#39;), P e  which are spaced from the point P dn  by the finishing margin t and by the clearance c, along the +Z axis. These coordinate values are obtained from the following equations: 
     
         x.sub.d &#39;+ΔX.sub.1 →x.sub.d 
    
     
         z.sub.d &#39;+t+ΔZ.sub.1 →z.sub.d 
    
     
         x.sub.d →x.sub.e 
    
     
         z.sub.d &#39;+c+ΔZ.sub.1 →z.sub.e 
    
     The processor then obtains the position x f , z f  of the tool rest TBS that will exist when the nose of the tool TL1 is at the machining end point P f , the position being found from the equations: 
     
         x.sub.m +c+66 X.sub.1 →x.sub.f 
    
     
         z.sub.e →z.sub.f 
    
     When the coordinate values of the tool rest TBS at each of the points have been found through the foregoing steps, the processor 105 creates and stores the following in the RAM 106: 
     G00 Xx 5  &#39; Zz 5  &#39;; 
     G01 Xx 4  &#39; Zz 4  &#39; Ff c  ; 
     Xx d  Zz d  ; 
     Xx e  Zz e  ; 
     G00 Xx f  Zz f  ; 
     M99 
     Note that M99 denotes the end of the subprogram. 
     The foregoing ends processing for creating the subprogram of the first machining process (coarse machining). 
     Upon completing processing for creating the subprogram for the first machining operation, the processor 105 executes processing to create a subprogram SP2 for the second machining process for performing fine machining, which subprogram includes fine machining work and control of tool rest movement. 
     When coarse machining is completed, the tool rest TBS is retracted along the +Z axis from the coarse machining end point P f  to the point P r  shown in FIG. 1(C), and is then transported along the -X axis from point P r  to point P t  shown in FIG. 1(D). Moving the tool rest in this manner positions the fine machining tool TL2 at the fine machining starting point along the shortest traveling distance without the tools striking the workpiece WK. 
     (3b-1) Accordingly, the processor 105 generates, and stores in the RAM 106, the following subprogram number of the second machining process: 
     
         O 0002 
    
     (3b-2) The processor then obtains the maximum tool length (ΔZ 2 ) from among ΔZ 1 , ΔZ 2 , ΔZ 3  and subsequently calculates the coordinate values x r , z r  of the point P r  from the following equations: 
     
         x.sub.m +c→x.sub.r 
    
     
         z.sub.6 +ΔZ.sub.2 +c→z.sub.r 
    
     It should be noted that z 6  is the Z-axis coordinate value of the point P6. 
     (3b-3) The processor 105 also calculates the coordinates values x t , z t  of the point P t  from the following equations: 
     
         -(x.sub.6 +ΔX.sub.2)→x.sub.t 
    
     
         z.sub.r →z.sub.t 
    
     It should be noted that x 6  is the X-axis coordinate value of the point P 6 . 
     (3b-4) When the points P r  and P t  have been found, the processor creates and stores the following NC data in the RAM 106: 
     G00 Xx r  Zz r  ; 
     Xx t  Zz t  ; 
     Thus, the processor creates NC data for movement along the +Z axis from point P f  to point P r , and NC data for movement along the -X axis from point P r  to point P t . 
     (3b-5) Next, the processor 105 calculates the positional coordinate values x i  &#39;, z i  &#39; (i=7, 8 . . . 12) of the tool rest TBS that will exist when the nose of the tool TL2 (as shown in FIG. 4) is situated at points P 7 , P 8 , P 9 , P 10 , P 11 , P 12 , respectively. These coordinate values are calculated from the following equations: 
     
         x.sub.i -ΔX.sub.2 →x.sub.i &#39; 
    
     
         z.sub.i -ΔZ.sub.2 →z.sub.i &#39; 
    
     (where i=7, 8, 9, 10) 
     
         x.sub.10 -c-ΔX.sub.2 →x.sub.11 &#39; 
    
     
         z.sub.11 +ΔZ.sub.2 →z.sub.11 &#39; 
    
     
         x.sub.11 &#39;→x.sub.12 &#39; 
    
     
         z.sub.6 +c+ΔZ.sub.2 →z.sub.12 &#39; 
    
     where z 11  is the Z-axis coordinate value of the point of intersection between straight lines P 9  P 10 , P 11  P 12 . 
     (3b-6) When the coordinates x i  &#39;, z i  &#39; have been obtained, the processor creates, and stores in the RAM 106, the following path data for transporting the tool TL2 along the fine machining path: 
     G01 Xx 7  &#39; Zz 7  &#39; Ff c  ; 
     Xx 8  &#39; Zz 8  &#39;; 
     Xx 9  &#39; Zz 9  &#39;; 
     Xx 11  &#39; Zz 11  &#39;; 
     G00 Xx 12  &#39; Zz 12  &#39;; 
     Xx t  Zz t  ; 
     M99; 
     Thus, performing steps (3b-1) through (3b-6) ends processing for the creation of a subprogram for the second machining process (fine machining). 
     (3c) Thereafter, a subprogram SP3 for the third machining process, which program includes grooving machining work and control of tool rest movement for cutting a groove, is created through steps similar to those used to create the subprogram SP2. This completes the processing for the creation of all subprograms. 
     (3d) When all subprograms have been created, the processor 105 creates the following main program for calling the subprograms in machining process order: 
     O1234 
     M98 P0001; 
     M98 P0002; 
     M98 P0003; 
     M30; 
     and ends creation of the part program by arranging the part program in the RAM 106 in the order shown in FIG. 8, namely in the order of the main program MP, subprogram SP1, subprogram SP2 and subprogram SP3. The part program stored in the RAM 106 is subsequently delivered as an output to a tape puncher or magnetic unit 201. Note that &#34;M98&#34; denotes a subprogram call instruction for calling the subprogram having the program under which follows the letter of the alphabet &#34;P&#34;, &#34;M99&#34; denotes end of the subprogram, and &#34;M30&#34; denotes end of the program. 
     (II) Machining Processing 
     Machining processing performed by a comb-cutter lathe will now be described with reference to FIG. 9 which is a block diagram of an NC apparatus, and FIG. 10 which is a flowchart of machining processing. 
     An NC tape 301 records NC data created by the NC tape creating apparatus of FIG. 2. A processor 302 responds to a read request produced by an operator&#39;s panel 303 by actuating an NC data reading device 304 to store, in a RAM 305, all of the NC data recorded on the NC tape 301. 
     (1) When a start button on the operator&#39;s panel 303 is pressed under these conditions, the processor 302, under the control of a control program stored in a ROM 306, sets the sequence number i of the main program to 1, stores the sequence number in a general-purpose register 302a and reads the i-th block of NC data constituting the main program out of the RAM 305. 
     (2) The processor 302 determines whether the read NC data is an instruction &#34;M30&#34; indicative of the end of the program. If it is, the processor ends NC processing. 
     (3) If the NC data is not &#34;M30&#34;, on the other hand, the processor 302 sets the sequence number j of a subprogram to 1 and stores the sequence number in a general-purpose register 302b. The processor 302 then goes to the RAM 305 and, from among the NC data read in step (1), reads out NC data belonging to the j-th block of the subprogram designated by the subprogram number which follows the letter of the alphabet &#34;P&#34; stored in a general-purpose register 302c. 
     (4) The processor 302 determines whether the NC data belonging to the j-th block of the subprogram is &#34;M99&#34;. 
     (5) If the NC data is &#34;M99&#34;, the following operation is performed: 
     
         i+1→i 
    
     after which the NC data belonging to the i-th block of the main program is read. Processing from step (2) onward is repeated. 
     (6) If the NC data belonging to the i-th block of the subprogram is NC data for path control rather than &#34;M99&#34;, however, ordinary path control processing is carried out. For example, if the NC data is data such as: 
     G00 Xx r  Zz r  ; 
     for moving the tool rest TBS from point P f  (FIG. 4) to point P r , then the processor 303 calculates incremental values X j , Z j  along the respective axes from point P f  to point P r  (actually, X j  =0). 
     Thereafter, velocity components F x , F z  along the respective axes are calculated in accordance with the following equations from rapid-traverse velocity F r  and X j , Y j , which are stored in a parameter memory 307: ##EQU1## Next, in accordance with the following equations, there are obtained traveling distances ΔX, ΔZ for movement along the respective axes during a period of time ΔT sec (=8 msec) which is stored in the parameter memory 307: 
     
         ΔX=F.sub.x ·ΔT 
    
     
         ΔZ=F.sub.z ·ΔT 
    
     Values are stored in a working memory 308. When ΔX, ΔZ have been obtained, the processor 303 applies them as inputs to a pulse distributor 309 every ΔT sec. Based on the input data ΔX, ΔZ, the pulse distributor 309 performs simultaneous two-axis pulse distribution computations to generate distributed pulses X p , Z p , which are applied as inputs to X- and Z-axis servomotors 310X, 310Z. As a result, X- and Z-axis motors 311X, 311Z, respectively, for driving the tool rest, are rotated to transport the tool rest toward the point P r . 
     The processor 303, in accordance with the following formulae, updates the present position X a , Z a  along the respective axes every ΔT sec, the updated values of X a  and Z a  being stored in the working memory 303: 
     
         X.sub.a ±ΔX→X.sub.a 
    
     
         Z.sub.a ±ΔZ→Z.sub.a 
    
     The sign depends upon the direction of movement. Similarly, in accordance with the following formulae, the processor updates remaining traveling distances remaining to be travelled X r , Z r  (the initial values of which are X i , Z i , respectively) every ΔT sec, the updated values of X r  and Z r  being stored in the working memory 308: 
     
         X.sub.r-Δ X→X.sub.r 
    
     
         Z.sub.r-Δ Z→Z.sub.r 
    
     When the tool rest TBS arrives as the point P r  and the following condition is established, X r  =Z r  =0 (i.e., the distance remaining to be travelled is zero) the processor 303 ends path control processing. 
     (7) The processor 303 increments the sequence number j of the subprogram by performing the following operation: 
     
         j+1→j 
    
     reads the NC data belonging to the j-th block of the subprogram designated by the subprogram number stored in the general-purpose register 302c, and repeats processing from step (4) onward. If the NC data read next is path control NC data for moving the tool rest from point P r  to point P t  and path control processing similar to the foregoing is to be performed thereafter, the tool rest is positioned at point P t . 
     Thus, according to the present invention, the arrangement is such that when changing tools in a comb-cutter lathe, the tool rest is temporarily retracted along the Z axis so that a tool will not interfere with the workpiece when moved along the X axis, and the tool rest is then moved along the X axis to position a selected toll at the X coordinate of a point at which machining is be started by the tool. In changing tools, therefore, a tool will not interfere with the workpiece even when the tool rest is moved along the axis. 
     Further, according to the present invention, an NC part program for a comb-cutter lathe can be created merely by entering part dimensions, a tool selection sequence, machining location and tool mounting position, etc., and the path followed by a tool rest can be generated automatically without specifying the path of the tool rest when selecting a tool. 
     In addition, the present invention makes it possible to minimize the traveling distance of a tool rest during tool selection so that the total time required to change tools can be reduced. 
     While the foregoing description relates to a case where the two tools TL1 and TL2 are provided in juxtaposition on the tool rest, the invention is not limited to two tools but can be applied to three or more tools mounted on a tool rest. Further, though the description given above regards a transition from machining in the first quadrant to machining in the fourth quadrant, the invention is not limited to such but can be applied to various configurations in which machining is exercised from the fourth to the first quadrant or within one and the same quadrant, etc. 
     In numerically controlling a comb-cutter lathe, the present invention prevents a tool from interfering with a workpiece, enables the path of a tool rest at the time of a tool change to be generated automatically, and minimizes the length of the tool path. The invention is therefore well-suited for application to control of a comb-cutter lathe.