METHOD AND APPARATUS FOR PREVENTING COLLISON OF TOOLS

Abstract: The program checking process comprises the steps of storing a program in a memory and executing the program block by block with an animation image displayed on a screen. When an interference occurs between the two tools, a waiting M-code is inserted in a corresponding position of the program, depending on a priority parameter. The priority parameter specifies the priority between the two tools. When the first tool has a priority, a waiting M-code for the second tool is inserted, and visa versa. Thus the program is automatically corrected to prevent any interference.

Description: Technical Field The present invention relates to a method of and an apparatus for preventing tool collision to avoid interference between movable members such as a plurality of tool posts by automatically altering a machining program when such interference occurs. Background Art Machine tools are numerically controlled for automatically machining workpieces. To machine a workpiece to a design drawing with a numerically controlled machine tool, numerical control commands in a prescribed format, i.e., a machining program must be input to a numerical control apparatus. A machining program for such a numerical control apparatus makes it possible to control a multiaxis lathe for moving two tool posts, i.e., tool rests independently to enable the two tool rests to cut the workpiece simultaneously. For example, a four-axis lathe shown in Fig. 2 has two tool rests TP1, TP2 and moves the tool rests TP1, TP2 independently along X- and Z- axes for machining a workpiece WK. By controlling the positions and paths of these tool rests TP1, TP 2 according to a machining program comprising independent programs for the respective tool rests, the workpiece WK can be machined to a desired shape in a much shorter period of time than would be possible with an ordinary two-axis lathe. Since, however, the single workpiece WK is simultaneously machined by the two tool rests TP1, TP2, an accident may possibly occurs due to interference between the tool rests TP1, TP2. The machining programs for the respective tool rests should be of such a nature that they will prevent collision of the tool rests TP1, TP2. To check such an interference, an actual machining process according to the machining programs to be checked is simulated on an animated screen. A tool interference checking process is effected by visually observing the simulation and determining that a collision or interference is caused when the paths of movement of the two tool rests intersect with each other. The machining program comprises a program for a tool rest 1 and a program for a tool rest 2 as shown in Fig. 3(a). Denoted in Fig. 3(a) at N100, N101, N102, N103, ... are date items for numerically controlling the movement of the tool rest 1, that is, blocks of a format of numerical control commands, and N200, N201, N202, N203, ... blocks of a format of numerical control commands for numerically controlling the movement of the tool rest 2. Fig. 3(b) illustrates the paths of movement of the tool rests 1, 2 displayed on the animated screen of a display unit during simulation of an actual machining effected by executing the tool rest programs. As shown in Fig. 3(b), the path of the tool rest 1 crosses the path of the tool rest 2 in the block N102 for the tool rest 1 and the block N202 for the tool rest 2. It can therefore be confirmed on the display screen that the tool rests 1, 2 will actually collide with each other at the intersection of the tool rest paths, as shown in Fig. 4. As described above, it has heretofore been known to effect a tool interference checking process by simulating an actual machining process according to a machining program on a display screen and checking the tool rests for their mutual interference. If an interference occurs in the tool interference checking process, then the program is altered or corrected manually by the operator. Therefore, the operator is required to think each time an interference happens, or always understand accurately, what part of the machining program is to be revised and how it is to be modified. Therefore, much labour and time have been needed in preparing a machining program. GB-A-2 117 929 discloses prevention of tool collision when numerically controlling a machine tool having two tool rests controlled by respective programs. The paths of movement of the two tool rests are simulated and displayed in advance of an actual machining process. When, observing the display, an operator judges that there is a risk of interference, he can select one of the tool rests and cause that tool rest to be temporarily stopped, whilst the other tool rest continues to move in the simulation. A waiting command is written into the program controlling the tool rest which is stopped. When the operator judges, from the display, that the possibility of interference has been cleared he can release the stopped tool rest. A waiting dismissal command is then written into the program controlling the tool rest which was stopped. It is an object of the present invention to provide method and apparatus for preventing tool collision by avoiding tool interference in advance by automatically altering a machining program when tool rests interfere with each other during machining simulation on animated display, through utilisation of a conventional tool interference checking process on animated display. According to the present invention there is provided a method of preventing tool collision when numerically controlling a machine tool having first and second movable members controlled by respective programs, the method comprising:- simulating and displaying the paths of movement of the first and second movable members in advance of an actual machining process, selecting priorities as between the first and second movable members, whereby that one of the members selected to have higher priority is to be moved, whilst the member selected to have lower priority is to be temporarily stopped, when an interference between the paths of movement of the first and second movable members occurs in the simulation, correcting the programs controlling the first and second movable members, to avoid the interference, by inserting into the program controlling the movable member of lower priority a command for temporarily stopping that member, characterised in that the command for temporarily stopping the movable member of lower priority is a dwelling code which specifies the length of time for which that member is to be stopped and which is automatically inserted into the program controlling that member, and in that a corresponding dwelling code, commanding stopping of the movable member of higher priority for a similar length of time, is automatically provided subsequently in the program for controlling the movable member of higher priority, whereby synchronism is maintained between the programs. According to the present invention there is provided apparatus for automatically preventing tool collision in a numerically controlled machine tool having first and second movable members controlled by respective programs, the apparatus comprising:- a simulator, for simulating and displaying the paths of movement of the first and second movable members in advance of an actual machining process, priority selecting means, for selecting priorities as between the first and second movable members whereby that one of the members selected to have higher priority is to be moved, whilst the member selected to have lower priority is to be temporarily stopped, when an interference between the paths of movement of the first and second movable members occurs in the simulation, program correcting means, for correcting the programs controlling the first and second movable members, to avoid the interference, by inserting into the program controlling the movable member of lower priority a command for temporarily stopping that member, characterised in that the program correcting means are operable to provide, as the command for temporarily stopping the movable member of lower priority, a dwelling code which specifies the length of time for which that member is to be stopped and which is automatically inserted into the program controlling that member, and are further operable automatically to provide subsequently a corresponding dwelling code commanding stopping of the movable member of higher priority for a similar length of time, in the program for controlling the movable member of higher priority, whereby synchronism is maintained between the programs. In accordance with the present invention, the conventional problems are solved by a method of preventing tool collision, including the steps of simulating and displaying the paths of movement of a plurality of movable members driven by respective independent programs in advance of an actual machining process, selecting the movable member to be moved at first and the movable member to be stopped when an interference occurs, and correcting the programs to avoid the interference between the movable members by inserting a dwelling code into the programs. With the method of the invention, in the event of an interference between tool rests during machining simulation on animated display, machining programs are automatically altered in order to avoid such an interference. Therefore, labor and time required for the operator to alter the machining programs are reduced, and actual damage of tools which would otherwise result from the execution of the machining programs can be avoided. Brief Description of the Drawings Fig. 1 is a block diagram of a system for carrying out a method of the present invention; Fig. 2 is a schematic view of a four-axis lathe; Fig. 3(a) is a diagram showing, by way of example, a machining program for a four-axis lathe; Fig. 3(b) is a diagram showing an animated screen displaying paths of movement of two tool rests; Fig. 4 is a view explaining an interference between tool rests in an actual machining process; Fig. 5 is a diagram of system parameters required by an automatic collision prevention program; Fig. 6 is a flowchart of an operation sequence of the automatic collision prevention program; Figs. 7(a), 7(b), 7(c), and 7(d) are diagrams showing, by way of example, modifications of machining programs by using dwelling M codes; and Fig. 8 is a view explaining an interference between tool rests in an actual machining process. Best Mode for Carrying Out the Invention An embodiment of the present invention will hereinafter be described in specific detail with reference to the drawings. Fig. 1 is a block diagram showing, by way of example, an NC system for controlling a four-axis lathe. Denoted in Fig. 1 at 10 is a processor for effecting numerical control by executing programs, 11 a programmable controller for programmed execution of operation of an electric power circuit which carries out sequence control of a four-axis lathe, and 12 a program memory storing various control programs to be executed by the processor 10, the memory 12 also storing an automatic collision prevention program for automatically altering machining programs according to the present invention. A data memory 13 stores data required for executing the programs for the processor 10 such as machining programs composed of data formats of numerical control commands. A working memory 14 serves to temporarily store the results of arithmetic operations effected by the processor 10. A paper tape puncher 15 records data on a paper tape by punching the same. A paper tape reader 16 reads numerical control commands (NC commands) punched in an NC tape. A pulse distributor 17 effects an arithmetic operation to distribute pulses according to a motion command from the processor 10 and issues distributed pulses commensurate with the commanded amount. Denoted at 18x1, 18z1, 18x2, 18z2 are servo circuits for driving tool rests TP1, TP2 in the directions of X- and Z-axes by controlling X1, Z1 axes and X2, Z2 axes of a four-axie lathe 19. A parameter memory 20 stores system parameters required for executing the automatic collision prevention program. A display controller 21 has input keys for setting the system parameters and the like. A display unit 22 serves to display the paths of movement of the tool rests on an animated screen as shown in Fig. 3(b). An address data bus (hereinafter referred to as a "bus") 23 allows data to be transmitted between the processor 10 and the memories 12, 13, 14, 20, and an input/output device. The automatic collision prevention program stored in the program memory 12 will be described with reference to Figs. 4 through 6. During simulation of an actual machining process according to machining programs, and if an interference occurs between the tool rests 1, 2 in a block N102 for the tool rest 1 and a block N202 for the tool rest 2, as shown in Fig. 4, the automatic collision prevention program automatically inserts dwelling M codes into prescribed positions in machining programs in order to move the tool rest of higher priority at first and temporarily stop the tool rest of lower priority. In order to start executing the automatic collision prevention program, it is necessary for system parameters as shown in Fig. 5 to be preset. The system parameters include a tool rest priority parameter, a dwelling M code parameter for stopping movement of a tool rest and determining the interval of stoppage of the tool rest, and a repetitive execution parameter for determining whether a machining program is to be repeatedly executed until no interference occurs. An initial value for the tool rest priority parameter is "0". If the tool rest priority parameter is "0", the operator can set it to "1" or "2" when an interference occurs between the tool rests during execution of the machining programs. When the priority parameter is "1", the tool rest 1 has higher priority, and when the priority parameter is "2", the tool 2 has higher priority. The stoppage interval of the M code parameter has an initial value of "200", and can be selected in the range of from "100" to "999". The repetitive execution parameter has an initial value of "0". When the repetitive execution parameter is "0", dwelling M codes are automatically inserted into prescribed positions in the machining programs, and then the machining programs are rewound to restart the machining programs from their starting ends. When the repetitive execution parameter is "1", a dwelling M code is automatically inserted into prescribed positions in the machining programs, and then the machining programs are rewound to stop program execution. If the above system parameters are properly established, the automatic collision prevention program will be executed according to the flowchart shown in Fig. 6. Machining programs to be checked are prepared in the data memory 13 in a step (1) by entering the machining programs through the tape reader 16, for example. Thereafter, the four-axis lathe 19 is switched to a memory mode, i.e., a mode in which the programmable controller 11 and the pulse distributor 17 are disconnected from the bus 23 in Fig. 1 for data transfer only between the data memory 13 and the display controller 21, in a step (2). Then, an animated screen is displayed on the display unit 22, and the machining programs are started from their first addresses to begin simulation of an actual machining process in a step (4). The machining programs are successively executed block by block in a step (4). Whether an interference has occurred between the tool rests is checked during the execution of the machining program in a step (5). If no interference is caused, then control returns to the step (4), and the machining programs are executed. If an interference is experienced, then control goes to a step (6) which ascertains whether the priority parameter is "0" or not. If the priority parameter is not "0", then it is "1" or "2". Therefore, a dwelling M code is inserted into prescribed positions in the machining programs, as described in detail later on, dependent on the value of the priority parameter, in a step (7). If the priority parameter is "0" in the step (6), then an inquiry as to a priority tool base is displayed on the display unit in a step (8). The operator then enters, through a key, a tool rest priority parameter "1" or "2" in a step (9). then, control goes to the step (7). After the dwelling M code has been inserted in the step (7), the machining programs are rewound back to their first addresses in a step 10. Then, whether the repetitive execution parameter is "0" or "1" is ascertained in a step (11). If "0", then the execution of the machining programs is completed in a step (12). If "1", control goes back to the step (3) to execute the machining programs again. The step (7) will be described in detail with reference to Figs. 7(a) through 7(d). In the event of an interference shown in Fig. 4 with the tool rest 1 having higher priority than the tool rest 2 (i.e., if the priority parameter is "1"), the automatic collision prevention program automatically inserts a dwelling M code M201 after the block N102 of the machining program for the tool rest 1 and before the block N202 of the machining program for the tool rest 2, as shown in Fig. 7(a). When the machining programs thus corrected are executed again, the tool rest 2 is stopped during a period specified by the dwelling M code M201 while the tool rest 1 is moving under a numerical control command of the block N102. Therefore, the tool rests are prevented from colliding with each other. The dwelling M code is inserted after the block N102 of the machining program for the tool rest 1 because synchronism should be kept between the block N103 of the machining program for the tool rest 1 and the block N202 of the machining program for the tool rest 2. Conversely, when the tool rest 2 has higher priority than the tool rest 1, (i.e., when the priority parameter is "2"), a dwelling M code M201 is automatically inserted before the block N102 of the machining program for the tool rest 1 and after the block N202 of the machining program for the tool rest 2, as shown in Fig. 7(b). If a dwelling M code M201 is inserted when the priority parameter is "1" as shown in Fig. 7(a), and if, after the machining programs are executed from their first addresses, there is an interference occurring in the block N103 of the machining program for the tool rest 1 and the block N202 of the machining program for the tool rest 2, then, as shown in Fig. 7(c), a dwelling M code having a different period than that of the dwelling M code 201, e.g., a dwelling M code 202 is inserted after the block N103 and before the block N202, and the dwelling M code 201 is deleted. With this modification, while the blocks N102, N103 are being executed, the tool rest 1 is stopped during the period specified by the different dwelling M code 202 for avoiding collision between the tool rests. Where a dwelling M code M201 is inserted when the priority parameter is "1" and the machining programs are executed again from their first addresses, if an interference occurs between the tool rest 2 stopped after the execution of the block N201 and the tool rest 1 moved by the execution of the block N102, as shown in Fig. 8, then the inserted dwelling M mode M201 is deleted, and a dwelling M mode having a different period than that of the dwelling M mode M201, e.g., a dwelling M mode M202 is inserted after the block N102 and before the block N201. While the tool rest 1 is moving according to the blocks N101, N102, the tool rest 2 is stopped in its initial position and hence prevented from interfering with the tool rest 1. Therefore, the automatic collision prevention program can automatically prepare a machining program which is free from the danger of interferences during an actual machining process by automaticay inserting a dwelling M code into prescribed positions in machining programs, through the use of a tool interference checking process utilizing an animated screen. The present invention is also effective in preparing a machining program which prevents collision between movable members of a general NC machine tool in addition to a four-axis lathe as described above. Industrial Applicability According to the present invention, as described above, the paths of movement of movable members such as a plurality of tool rests are displayed on an animated screen for simulating an actual machining process and checking the tool rests for their mutual interference. If an interference occurs on the screen, then the machining programs are automatically altered to avoid any interference in the actual machining process. Therefore, the machining programs can be rewritten with utmost ease, and tools can relaibly be prevented from damage.

Claims: A method of preventing tool collision when numerically controlling a machine tool (19) having first and second movable members (TP1, TP2) controlled by respective programs, the method comprising:- simulating and displaying the paths of movement of the first and second movable members (TP1, TP2) in advance of an actual machining process, selecting priorities as between the first and second movable members (TP1, TP2), whereby that one of the members selected to have higher priority is to be moved, whilst the member selected to have lower priority is to be temporarily stopped, when an interference between the paths of movement of the first and second movable members (TP1, TP2) occurs in the simulation, correcting the programs controlling the first and second movable members (TP1, TP2), to avoid the interference, by inserting into the program controlling the movable member of lower priority a command (M201, M202) for temporarily stopping that member, characterised in that the command for temporarily stopping the movable member of lower priority is a dwelling code (M201, M202) which specifies the length of time for which that member is to be stopped and which is automatically inserted into the program controlling that member, and in that a corresponding dwelling code (M201, M202), commanding stopping of the movable member of higher priority for a similar length of time, is automatically provided subsequently in the program for controlling the movable member of higher priority, whereby synchronism is maintained between the programs. A method as claimed in claim 1, wherein the programs are continuously corrected, by inserting and/or deleting dwelling codes, until all interferences between the first and second movable members (TP1, TP2) are removed. Apparatus for automatically preventing tool collision in a numerically controlled machine tool (19) having first and second movable members (TP1, TP2) controlled by respective programs, the apparatus comprising:- a simulator, for simulating (10 to 14) and displaying (21, 22) the paths of movement of the first and second movable members (TP1, TP2) in advance of an actual machining process, priority selecting means (20, 21), for selecting priorities as between the first and second movable members (TP1, TP2), whereby that one of the members selected to have higher priority is to be moved, whilst the member selected to have lower priority is to be temporarily stopped, when an interference between the paths of movement of the first and second movable members (TP1, TP2) occurs in the simulation, program correcting means (12), for correcting the programs controlling the first and second movable members (TP1, TP2), to avoid the interference, by inserting into the program controlling the movable member of lower priority a command (M201, M202) for temporarily stopping that member, characterised in that the program correcting means (12) are operable to provide, as the command for temporarily stopping the movable member of lower priority, a dwelling code (M201, M202) which specifies the length of time for which that member is to be stopped and which is automatically inserted into the program controlling that member, and are further operable automatically to provide subsequently a corresponding dwelling code (M201, M202), commanding stopping of the movable member of higher priority for a similar length of time, in the program for controlling the movable member of higher priority, whereby synchronism is maintained between the programs. Apparatus as claimed in claim 3, wherein the simulator comprises display means (21, 22) for displaying the paths of movement of the tip ends of tool on the movable members. Apparatus as claimed in claim 3 or 4, wherein the priority selection means (20, 21) enable priorities, as between the first and second movable members (TP1, TP2), to be selected each time an interference occurs.

Inventors: KAWAMURA, HIDEAKI, MATSUMURA, TERUYUKI, SHIMA, ATSUSHI
Applicants: FANUC LTD.
Application year: 1987
Main classification: B23Q15
IPC codes: G05B19, B23Q11