METHOD OF CORRECTING MACHINING PROGRAM

Abstract: A method of correcting machining program to correct during the working the machining program carried out by a numerical control apparatus. The operation is carried out to check the machining program that is prepared and stored in memory (5). A single block is stopped at a place (2) where error is found in the machining program, and the machining program is operated in the reverse direction until a predetermined block (P1) is reached and where the machining program is corrected to execute the operation of the machining program.

Description: The present invention relates to a method of correcting a machining program for a numerical control device, and more particularly, to a machining program correcting method which permits an easy correction of a machining program during an execution thereof. Machining programs for a numerical control device must be checked after they are created. Particularly when the created machining program is long and complicated, a strict program check is required. Conventionally, therefore, a machining program is displayed on the display screen of the numerical control device by graphic animation, or a CNC machine tool is operated in dry run mode without setting a workpiece, to thereby check the machining program. According to the conventional program checking method, however, when an error is discovered the machining program must be executed again from the beginning thereof, after the error is corrected. Accordingly, even though the program part preceding the error has been checked, the entire program must be reexecuted, to thereby cause a waste of time during the program check. The present invention was contrived in view of the above circumstances, and an object thereof is to provide a machining program correcting method which permits an easy correction of a machining program during an execution thereof. The Proceedings of the 8th Annual Meeting and Technical Conference of the Numerical Control Society, March 1971, pages 171-183 (W Haitz) discloses a program editor for NC machines which can pause a machine program to allow editing of the program. JP-A-59-165106 discloses a system in which, if an operator makes a mistake during teaching of a robot manipulator, the system can trace the operation back so that the operation can be retaught. According to the present invention, there is provided a method of correcting a machining program for a numerical control device during an execution of the machining program, the method comprising the steps of: executing a created machining program for a program check; and, correcting the machining program, after discovery of an error, and then executing the machine program from a certain point; characterised by: effecting a single block stop at a portion at which the error is discovered in the machining program; executing, after discovery of the error, the machining program in reverse to a predetermined block. When an error is found, the program is executed in reverse to the block concerned, usually to the beginning thereof and, after correcting that block, the program is executed from the beginning of the block. Accordingly, it is not necessary to return to the beginning of the program for a reexecution thereof. In the drawings: Fig. 1 is a conceptual diagram illustrating a machining program correcting method according to the present invention; Fig. 2 is a flowchart for carrying out the machining program correcting method according to the invention; Figs. 3(a) and 3(b) are flowcharts showing a process of a numerical control device for carrying out the machining program correcting method according to the invention; and Fig. 4 is a diagram illustrating an arrangement of hardware of a numerical control device (CNC) for carrying out the present invention. An embodiment of the present invention will be described with reference to the drawings. Figure 1 is a conceptual diagram illustrating a machining program correcting method according to the present invention. Here it is assumed that a machining program is being executed in dry run mode, the pulse distribution for a path 1 having a sequence number N010 has been completed, and that an error is discovered in the machining program during the pulse distribution for a machining path 2 having a sequence number N011. At this time, a programmer turns on a single block stop switch, whereby a numerical control device effects a single block stop at an end point P2 of the machining path 2 (N011). The programmer then turns on a reverse switch, and when the reverse switch is turned on, the numerical control device carries out a reverse pulse distribution of the machining path 2, to thereby return to a point P1 along a path 3. The programmer corrects the machining program at this point, and then pushes a cycle start button, whereby the numerical control device restarts the program from the point P1. To permit the reverse execution of a program, an auxiliary memory 6 is provided in the numerical control device, in addition to a memory 5 for storing the machining program, so that movement data for which the pulse distribution has been completed is stored in the auxiliary memory 6. In Fig. 1, the program is illustrated as if it is stored in the auxiliary memory 6 in units of blocks, but in practice, since instructions corresponding to one block are subdivided for the pulse distribution, movement data is stored in the auxiliary memory 6 upon each pulse distribution. When the reverse switch is pushed, a reverse pulse distribution is carried out by using the movement data stored in the auxiliary memory 6, to thereby effect a reverse execution of the program. Although in the above description the program is checked in a dry run mode, it may be checked by drawing a workpiece and a tool on a display screen by graphic animation. Figure 2 is a flowchart for carrying out the machining program correcting method according to the present invention. In the figure, the numbers following "S" represent step numbers. [S1] A machining program is started for a program check, and movement data is stored in the auxiliary memory 6 every time the pulse distribution is effected. [S2] The program is checked for error; if no error is discovered, execution of the program is continued. If an error is discovered, the flow proceeds to S3. [S3] The single block switch is turned on, whereby the numerical control device effects a single block stop. [S4] The programmer turns on the reverse switch on an operator panel, whereby the program is executed in reverse by using the movement data stored in the auxiliary memory 6. [S6] The necessary correction is made. [S7] The program is restarted from the block to which the program has been retraced. Namely, the machining program is executed in reverse to a predetermined block, corrected, and restarted from that block, and accordingly, it is not necessary to return to the beginning of the machining program and restart the program from that point every time an error is corrected, whereby a correction of the machining program, and accordingly, a program check, are simplified. A flowchart of a process executed by the numerical control device will be now described. Figures 3(a) and 3(b) illustrate flowcharts for the numerical control device, according to the machining program correcting method of the invention. In the figures, the numbers following "S" represent step numbers. [S11] One block of a machining program is read. [S12] If the machining program is not ended, the flow proceeds to S13. [S13] Movement data is created for pulse distribution. [S14] The movement data is stored in the auxiliary memory 6. [S15] If no reverse command is input, the flow proceeds to S16. If a reverse command is input, the flow proceeds to S17. [S16] Pulse distribution is executed for movement. (Referring to Fig. 3(b)) [S17] Data stored in the auxiliary memory 6 during the execution of the program is read. [S18] The program is executed in reverse in accordance with the read data. [S19] The pointer of the program is returned based on the executed data. [S20] It is determined whether or not the reverse command is ended; if it is not ended, the flow returns to S17 to continue the reverse execution of the program. The hardware for carrying out the present invention will be now described. Figure 4 is a schematic diagram of hardware of a numerical control device (CNC) for carrying out the present invention. In Fig. 4, numeral 11 denotes a processor for global control; 12 denotes a ROM for storing a control program; 13 denotes a RAM for storing various data; 14 denotes a nonvolatile memory for storing a machining program and parameters, etc., such as a CMOS backed up by a battery, or the like; and 14a denotes a machining program. Numeral 15 denotes a PMC (programmable machine controller) which converts received commands, such as M-function and T-function, etc., into signals for controlling a machine tool, in accordance with a sequence program 15a, and outputs the converted signals. Numeral 16 denotes a display control circuit for converting a digital signal into a display signal; 16a denotes a display device comprising a CRT, liquid-crystal display unit, or the like; and 17 denotes a keyboard used for inputting various data. Numeral 18 denotes a position control circuit for controlling a servomotor; 19 denotes a servo amplifier for controlling the speed of the servomotor; 20 denotes the servomotor; 21 denotes a tachometer generator for effecting a speed feedback; and 22 denotes a position detector comprising a pulse coder, optical scale, or the like. The required number of these elements corresponds to the number of axes, but only those necessary for one axis are illustrated. Numeral 23 denotes an input/output circuit which transfers digital signals with respect to an external unit and is connected to a machine side control circuit. A signal SBK from the single block switch and a signal RVS from the reverse switch are supplied to the input/output circuit 23 from a machine side operator panel. Numeral 24 denotes a manual pulse generator mounted on the machine operator panel, for digitally moving individual axes. The above embodiment uses only one processor, but a multi-processor system including a plurality of processors may be used instead, depending on the system configuration. According to the present invention, as described above, when an error is found in a machining program, the program is executed in reverse to the predetermined part, the error is corrected, and the program is restarted. Accordingly, it is not necessary to return to the beginning of the machining program every time a correction is made, thus facilitating the correction of machining programs, and accordingly, the program check.

Claims: A method of correcting a machining program for a numerical control device during an execution of the machining program, the method comprising the steps of: executing a created machining program for a program check; correcting the machining program, after discovery of an error, and then executing the machine program from a certain point; characterised by: effecting a single block stop at a portion at which the error is discovered in the machining program; and executing, after discovery of the error, the machining program in reverse to a predetermined block. A method according to claim 1, wherein the reverse execution of the machining program is effected by a reverse switch provided on an operator panel. A method according to claim 1, wherein movement data is stored in an auxiliary memory during the execution of the machining program for a program check, and the reverse execution of the machining program is effected in accordance with the machining program stored in the auxiliary memory. A method according to claim 1, wherein the execution of the machining program for a program check is effected in a dry run mode without using a workpiece. A method according to claim 1, wherein the execution of the machining program for a program check is effected by displaying a workpiece and a tool on a display screen by graphic animation.

Inventors: EGUCHI RYOUJI FANUC MANSHION H, OTSUKI TOSHIAKI, SASAKI TAKAO ESTATE HACHIOJI -, EGUCHI, RYOUJI FANUC MANSHION HARIMOMI 7-109, OTSUKI, TOSHIAKI, SASAKI, TAKAO ESTATE HACHIOJI 2-502
Applicants: FANUC LTD, FANUC LTD.
Application year: 1989
Main classification: G05B19
IPC codes: G05B19