METHOD AND APPARATUS FOR NUMERICAL CONTROL HAVING AN OVERRIDE PLAYBACK FUNCTION

Abstract: An NC device (10) comprises a CPU (11), a ROM (12), a RAM (13), a non-volatile memory (14), a CRT display data input device (CRT/MD1) (15), a machine operation board interface (16), a servio interface (17), a servo circuit (18), a bus (19) and a servo motor (20). When a teaching instruction is given by an operator during the execuiton of an NC program, and an oierride function is set manually, the override valve is written onto the end of a block of the NC prgram. Thereafter, when the NC program is executed, the same override operation is aitomatically carried out by using the written data.

Description: The present invention relates to a numerical control method and a system therefor in which it is possible to carry out numerical control automatically repeatedly in accordance with a numerical control program modified by utilization of an override function. There is a numerical control system (hereinafter referred to as "NC system") of type which is provided with an override function for modifying, during operation of the NC system, control condition parameter values designated by an NC program (part program). Hitherto, for example, in a machine tool controlled by the NC system of this kind, the override function is utilized, during operation of the machine tool, to adjust a cutting feed speed and a spindle speed designated in an NC work program so as to increase and decrease these speeds in compliance with a workpiece working configuration, workpiece material and an actual working state. However, the conventional speed adjustment using the override function is performed by manual operation of override switches (override dials) provided on the NC system, and is effective only for work which is in the course of being carried out. Accordingly, if an attempt is made to continue to work under the previously modified working conditions, whilst using the same NC work program, the override switches must again be manually operated in like manner at the point of time at which the feed speed and the spindle speed were previously modified, in order to modify these speeds. In this connection JP-A-59-142616 discloses a numerical controller for a machine tool in which speed data may be rewritten into a memory immediately, whenever a speed rewrite command switch is turned on whilst an override switch is in an 'on' state. A motor may be operating at a given feed speed for processing a given workpiece. The operator may then depress a speed rewrite command switch in order to obtain an override feed speed. This causes a rewrite permission signal to be generated which is fed through an AND gate in combination with other signals. The output of the AND gate causes the rewriting of the contents of a designated address into a specific memory table containing speed data and thus effects teaching of an override value of the feed speed to the system. It is an object of the invention to provide a numerical control method and a system therefor having an override playback function, in which once the override function has been utilised to modify a statement of an NC control program, numerical control can be performed automatically repeatedly in accordance with the modified program and in which it is possible for example to allow for only a portion of a given command block to be run using the override value of feed speed, instead of imposing this override value on the whole block. In order to achieve the above-mentioned object, according to a first aspect of the invention, there is provided a numerical control method having an override recall function, comprising the steps of (a) judging whether or not a teaching mode has been entered during execution of a numerical control program, (b) judging whether or not a predetermined command is given in said teaching mode, and (c) when it is judged that said predetermined command is given in said teaching mode, additionally inserting manually set override conditions into a corresponding block of the numerical control program, thereby automatically carrying out numerical control in accordance with the set override conditions at that and subsequent execution of the numerical control program, and characterised by the step of additionally inserting, as a condition for override, a distance between a moving position of an axis, at generation of said predetermined command, of an apparatus to be controlled by said numerical control program and a moving target position of said axis at completion of execution of said corresponding block, into said corresponding block. According to a second aspect of the invention there is provided a numerical control system having an override playback function, comprising memory means for storing therein a numerical control program in a read/write random-access manner, setting means for manually setting override conditions, manually operable command means for giving a predetermined command, and manually operable teaching command means for operating said numerical control system in a teaching mode, and characterised by program editing means for additionally inserting said set override conditions into a corresponding block of the numerical control program when said predetermined command is given in said teaching mode and for writing the numerical control program including said inserted override conditions, to said memory means and wherein the numerical control system is mounted on an apparatus to be controlled having an axis controlled by said numerical control system, and wherein when said predetermined command is given in said teaching mode, said program editing means additionally inserts, amongst said conditions, a distance between a moving position of said axis at generation of said predetermined command and a moving target position of said axis at completion of execution of said corresponding block, into said corresponding block, to control use of said conditions. As described above, the arrangement of the invention is such that the program, set in the teaching mode, is modified by inserting the override parameter into the corresponding block of the numerical control program and is then used to perform subsequent numerical control. With such an arrangement, it is possible to carry out numerical control automatically and repeatedly under conditions equivalent to those during the teaching. Accordingly, for example, when products of the same configuration are worked in large quantities, it is unnecessary to operate various kinds of override switches for setting working conditions every time another product is worked. Consequently it is possible to increase productivity. In addition, since working is carried out under the same conditions each time, it is possible to produce uniform products in large quantities. For a better understanding of the invention and to show how the same may be carried into effect, reference will now be made, by way of example, to the accompanying drawings in which:- Fig. 1 is a block circuit diagram showing a numerical control system according to an embodiment of the invention; Fig.2 is a flow chart of override processing executed in a teaching mode; Fig.3 is a flow chart showing program edition processing in Fig.2; and Fig.4 is a flow chart of a control program for executing the edited NC work program. In Fig. 1, the reference numeral 10 denotes an NC system which is mounted to an NC machine tool (illustration omitted) having a plurality of axes controlled by the system. The NC system 10 comprises a central processor unit (hereinafter referred to as "CPU") 11, a ROM 12 having stored therein a monitor program for executing a teaching processing, an override processing and the like shown in Figs. 2 through 4, a RAM 13 forming various kinds of registers subsequently to be described and utilized for temporal storage of data and the like, and a nonvolatile memory 14 formed by a bubble memory and having stored therein an NC work program and various kinds of setting values. The NC system 10 further comprises a data input device with a CRT display unit (hereinafter referred to as "CRT/MDI") 15, a machine operating panel interface 16 and a servo-interface 17. The above-mentioned elements 11 through 17 are connected to each other by a bus 19. Connected to the interface 16 is a machine operating panel 30 provided on the machine tool. Connected to the interface 17 are servo circuits (one of which is designated by the reference numeral 18) which correspond respectively to a plurality of axes of the machine tool. Connected respectively to the servo circuits are servomotors (one of which is designated by the reference numeral 20) for driving their respectively corresponding axes. In the embodiment, the override processing is executed in which the override function of the NC system 10 is utilized in the teaching mode to modify the statement of the work program. The subject (hereinafter referred to as "override parameter") of the processing concerned is a cutting feed speed and a spindle speed. To this end, the machine operating panel 30 has provided thereon conventionally known override switches (both illustration omitted) for manually setting respectively override values of the respective cutting feed speed and spindle speed. Moreover, predetermined ones of a predetermined number of soft keys arranged on the CRT/MDI 15 serve respectively as a teaching command soft key for giving a command to set the NC system 10 to the teaching mode and an override storage command soft key for giving a command to store the override values into registers subsequently to be described. Specifically, the NC system 10 according to the embodiment is so constructed as to vary the corresponding relationship between the respective soft keys and functions of the NC system 10 in compliance with an operator's selection on a screen such that all of a multiplicity of functions of the NC system 10 can be selected by the predetermined number of soft keys. As the operator operates the predetermined soft keys to select the teaching screen, it is displayed on the screen which soft keys should be used as the teaching command soft key and the override storage command soft key. Further, the machine operating panel 30 has arranged thereon a teaching command button, a cutting feed speed override storage command button, a spindle speed override storage command button (all illustration omitted). The operation of the NC system 10 constructed as above will be described below with reference to Figs. 2 through 4. The NC system 10 reads out the NC work program stored in the nonvolatile memory 14, and then carries out a so-called memory operation in which the NC system 10 controls the machine tool in accordance with the program to cause the machine tool to carry out requisite working. During the memory operation, when the operator judges that the cutting feed speed and/or the spindle speed should be adjusted so as to be increased and decreased, based on results of observation of, for example, cutting work circumstances, the operator manually operates the corresponding override switches to set required override values or value. As a result, the override is executed. Further, when the same override should continuously be applied to working of a multiplicity of products, the teaching command soft key of the CRT/MDI 15 or the teaching command button on the machine operating panel 30 is first operated manually to send out a teaching command to the CPU 11. Required override values are then set in a manner like that described above and, subsequently, the feed speed override storage command soft key of the CRT/MDI 15 or a corresponding button on the operating panel 30 and/or the spindle speed override storage command soft key of the CRT/MDI 15 or a corresponding button on the operating panel 30 are/is manually operated to send out feed speed and/or spindle speed override storage commands or command. In response to the above-described manual operation by the operator, the multitask processable NC system 10 carries out, during the memory operation, processings shown respectively in Figs. 2 and 3 which are tasks different in level (hierarchy) from the tasks relating to the NC work program, in the following manner in a predetermined cycle. The CPU 11 of the NC system 10 first monitors whether or not the teaching command is inputted (step S1). When it is judged at the step S1 that the teaching command is inputted, it is judged whether or not the feed speed override storage command is inputted (step S2). When this command is inputted, the CPU 11 reads out the override value set by the feed speed override switch, and stores the override value into a feed speed override storage register R·F (step S3). The CPU 11 also transfers a distance to an end point of a block in course of being currently executed, stored in the predetermined register, that is, a residual moving distance of a major axis in case of straight working, or a residual central angle in case of arcuate working, to a residual quantity storage register R·D to store therein the distance (step S4). Further, the CPU 11 sets a flag FF1 indicative of whether or not the feed speed override storage command has already been inputted, to "1", and also sets a flag FF2 indicative of whether or not the feed speed override storage command has been inputted in the block in course of being executed, to "1", to store inputting of both the commands (step S5). Subsequently, it is judged whether or not the spindle speed override storage command is inputted (step S6). If inputted, the CPU 11 reads out the override value set by the spindle speed override switch, and stores the override value into a spindle speed override storage register R·S (step S7). The CPU 11 sets a flag FS indicative of whether or not the spindle speed override storage command has been inputted, to "1" to store inputting of this command (step S8). Until a pulse distribution of the block concerned is completed (step S9), the processings on and after the step S2 are repeated. In the meantime, if the feed speed override storage command and/or the spindle speed override storage command are/is again inputted, the stored values or value in corresponding ones or one of the feed speed override storage register R·F, the residual quantity storage register R·D and the spindle speed override storage register R·S are/is rewritten each time. After all, the override values commanded lastly during execution of the block concerned are stored respectively in the registers R·F and R·S, and the residual quantity at inputting of the last command is stored in the register R·D. Thus, as the pulse distribution of the block concerned is completed (step S9), the CPU 11 then performs a program edition processing (S10). In the program edition processing (Fig. 3), it is first judged whether or not the flag FF1 is "1", that is, whether or not the feed speed override storage command has already been inputted (step SB1). If the flag FF1 is not "1", it is judged whether or not the flag FS is "1", that is, the spindle speed override storage command has been inputted (step SB9). If the flag FS is not "1", modification of the program is unnecessary and, therefore, the program is returned to the step S1 in Fig. 2 to stand by for inputting of the teaching command. If the CPU 11 judges at the step SB1 that the flag FF1 is "1", the CPU 11 judges whether or not the override command program "L1F···R···" (subsequently to be described in detail) is stated in the block completed in the pulse distribution (step SB2). If this statement does not exist in the block concerned, the CPU 11 judges whether or not the flag FF2 is "1", that is, whether or not the feed speed override storage command has been inputted during execution of this block (step SB3). If the flag FF2 is "1", the CPU 11 writes, into the end of this block, an override command code L1, the feed speed override value F having been stored in the feed speed override storage register R·F at the step S3, and the residual moving quantity R having been stored in the residual quantity storage register R·D at the step S4, in the mentioned order. That is, the CPU 11 writes ", L1F (R·F) R (R·D) into the end of this block concerned, thereby editing the program (step SB4). Usually, the NC program is stored in the nonvolatile memory so as to be divided into pages every certain fixed quantity. Accordingly, the above-mentioned edition is performed in such a fashion that, if insertion of the override command program ", L1F···R···" into the NC program results in an excess of the storage information over the capacity of the page in which the block concerned has been stored, the continuation is written to empty pages such that writting proceeds to a page next to the page in which the previous block information concerned has been stored. Thus, as the override command program ", L1F···R···" is inserted into the end of the block concerned to edit the program, the flag FF2 is then brought to "0" (step SB8), to store completion of the processing of the feed speed override storage commanded block. On the other hand, if it is judged at the step SB3 that the flag FF2 is "0", that is, if the feed speed override storage command has already been inputted (FF = 1) into the block preceding the block in course of being currently executed, and if the override command program ", L1F···R···" is not stated in the current block, the override command acts in a modal fashion so that the program proceeds to the step SB9 without any edition of the program. If it is judged at the step SB2 that the program ", L1F···R···" of the override command is stated in the end of the block, and if the flag FF2 is "1" (step SB5), that is, if the feed speed override storage command has been inputted during execution of the block concerned to which the feed speed override value has already been written, the override command acts in a modal fashion so that a new override value F obtained by multiplication of the feed speed override value F stated in the current block by the override value lately commanded in substitution for the override value F and stored in the feed speed override storage register R·S is stored in a corresponding area of the memory 14. That is, supposing, for example, that the override value F stated in the program is 80 % and the value lately stored in the feed speed override storage register R·S is 90%, then 72% is stored as the new feed speed override value F. Further, the already written residual moving quantity R is rewritten to the newly commanded residual quantity stored in the residual quantity storage register R·D, to thereby carry out edition of the program (step SB6). The flag FF2 is then brought to "0", to store completion of processing of the block concerned having inputted thereinto the feed speed override storage command (step SB8) and, subsequently, the program proceeds to the step SB9. On the other hand, when, at the steps SB2 and SB5, the override command program has already existed in the block concerned and the override storage command has been inputted at the block prior to the block concerned (FF1 = 1, FF2 = 0), the program proceeds to a step SB7. At the step SB7, the override command acts in a modal fashion so that the feed speed override value F is rewritten to a new override value F x R·F, and then the program proceeds to the step SB9. The program edition with respect to the feed speed override storage command is completed by the processings of the above-mentioned steps SB1 through SB8, and program edition processing is then performed with respect to the spindle speed override storage command. That is, if the flag FS is "1", in other words, if the spindle speed override storage command has been inputted (step SB9), it is judged whether or not the spindle speed override command program ", L1S···" (subsequently to be described) has already been stated in the block concerned (step SB10). If this statement does not exist, the override command code L1 and the spindle speed override value S which has been stored in the spindle speed override value storage register R·S at the step S7 are written in the mentioned order into the end of the block concerned, specifically, into a corresponding predetermined area in the memory 14, thereby carrying out edition of the program (step SB11). If the statement of the spindle speed override value command program ", L1S···" has already existed in the end of the block (step SB10), the spindle speed override value S stated in the program is rewritten to a new override value S obtained by multiplication of the value S by the value stored in the spindle speed override value storage register R·S (step SB12). Thus, the program edition processing (step S10) is completed, and the processings on and after the S1 are repeated. The flags FF1, FF2 and FS are set respectively to "0" by the initial setting at a point of time execution of the NC work program is started. In this manner, the override conditions including the override command L1, the cutting feed speed override value F, the distance R to the end point of block concerned through which the feed speed override is effective, and the spindle speed override value S are stated with the format ", L1F···R···, L1S··· ;", and are programmed. When working is carried out by the NC program having the override conditions programmed, the CPU 11 performs a processing shown in Fig. 4, and executes working accompanied with requisite modification of the feed speed and/or the spindle speed. That is, the CPU 11 reads one block out of the NC work program (step S100), and successively judges whether or not the override command programs or program ", L1F···R···" and/or ", L1S···" are/is stated in the block (steps S101 and S103). If both the statements of the respective override command programs do not exist, the program proceeds to a step S105 where it is judged whether or not a flag FF3 is "1". Subsequently to be described, the flag FF3 is designed to be set to "1" when the feed speed override program command is given (step S102), and is set to "0" by the initial setting. Accordingly, the program proceeds to a step S109 where the CPU 11 reads out the override values set by the feed speed and spindle speed override switches provided on the machine operating panel 30, and stores respectively into a feed speed override value storage register Fovr and a spindle speed override value storage register Sovr. Subsequently, new override values obtained respectively by multiplication of the override values stored in the respective registers Fovr and Sovr, by corresponding feed speed and spindle speed override values commanded by the program and stored in respective registers AF and AS are stored respectively into the registers Fovr and Sovr (step S110). The CPU 11 outputs a feed speed and a spindle speed obtained respectively by multiplication of both the stored values by the cutting feed speed and the spindle speed commanded by the program, and working is carried out (step S111). Since 100% is stored in the registers AF and AS at the initial setting, the stored values of the respective registers Fovr and Sovr are equal respectively to the override values set by the override switches, if the statement of the override command does not exist in the program. Until a pulse distribution of the block concerned is completed (step S112), processings on and after the step 105 are carried out. That is, such steps of procedure are repeated that if the override command program is not contained in the block to be executed of the program, the steps S105 and S109 through S112 are repeated until a pulse distribution at the block concerned is completed, after the processings of the steps S100, S101 and S103 have been executed, and as the distribution has been completed, the subsequent block is read in. As a result, if the override values are set by the override switches on the machine operating panel 30, the feed speed and the spindle speed are overriden in accordance with the set values to execute the NC work program. On the other hand, if the feed speed override command program ", L1F···R···" exists in the read-in block (step S101), the override value F stated in this command program is stored into a register BF, and a flag FF3 is set to "1" in order to indicate that the feed speed override program command is given (step S102). The flag FF3 is set to "0" at the initial setting. In addition, if the spindle speed override command program ", L1S···" exists in the block (step S103), the spindle speed override value S stated in this command program is stored into a program-designated override value storage register AS (step S104). Subsequently, it is judged at the step S105 whether or not the flag FF3 is set to "1", that is, it is judged whether or not the feed speed override is commanded by the program. If the flag FF3 is "1", it is judged whether or not the statement of the residual moving quantity R exists in the command program of this block (step S106). If the statement of the residual moving quantity R does not exist, the program proceeds to a step S108 where the program-commanded feed speed override value stored in the register BF is transferred to a register AF and is stored therein, and the flag FF3 is set to "0". On the other hand, if the statement of the residual moving quantity R exists and if the residual moving quantity in the block in course of being executed is larger than this residual moving quantity R set by the command program, the program proceeds to the step S109 without execution of the processing at the step S108, that is, without the program-commanded feed speed override value of the register BF being transferred to the register AF, in order to invalidate the program-commanded feed speed override value. Subsequently, as the residual moving quantity becomes smaller than the program-commanded residual moving quantity R, the program-commanded override value is transferred from the register BF to the register AF at the step S108, in order to validate the program-commanded override value. Further, at the step S110, the program-commanded override value is multiplied by the override value set by the override switch on the machine operating panel 30, to calculate a new override value. With regard to the spindle speed override, since the program-commanded override value is written to the register AS at the step S104, the program-commanded override value is applied from the beginning of the block. Thus, programming is made to teach the requisite override values to the NC work program. Accordingly, when the NC program is executed, if the override switch on the machine operating panel 30 is brought to 100%, working of the same configuration is carried out under the same working conditions as those when the override values were taught, that is, at the same cutting feed speed and spindle speed. Thus, when the same products are produced in large quantities, it is unnecessary to operate the override switches each time one product is worked, to adjust the working conditions so as to bring them into identity with the previous ones, making it possible to produce uniform and same products. In the above-described embodiment, teaching is not made with respect to the initiating position of the spindle speed override, but the override is validated from the beginning of the block concerned into which the spindle speed override storage command as been inputted. However, a position where the spindle speed override is validated may be taught by processing like that of the feed speed override storage command, to thereby validate the program-commanded spindle speed override from that position. In addition, in the above-described embodiment, when the feed speed override storage commands are inputted several times at the same block, the finally commanded position and the override value are programmed. However, the override value code L1 may be provided in plural such as L2, L3 ... such that the override values and the residual moving quantities R are programmed with respect respectively to the override storage commands successively inputted at the same block. Further, in the above-described embodiment, the soft keys or the command buttons provided on the machine operating panel are operated to input the feed speed override storage command and the spindle speed override storage command. However, alteration of the dials of the respective feed speed and spindle speed override switches provided on the machine operating panel may be detected to cause the alteration to serve as override storage commands of the respective feed speed and spindle speed. Moreover, in the above-described embodiment, the program edition processings are carried out successively after completion of one block. However, when the feed speed override storage command or the spindle speed override storage command is inputted, the program number and the block number at inputting of the storage command may also be stored. In this case, these program number and block number and the feed speed override value and the residual moving quantity of the block in course of being executed, as well as the program number and the block number and the spindle speed override value are stored, and the program edition is made collectively at completion of working. Furthermore, although the embodiment has been described as being applied to control of the NC machine tool, the invention should not be limited to this specific form.

Claims: A numerical control method having an override recall function, comprising the steps of (a) judging whether or not a teaching mode has been entered during execution of a numerical control program, (b) judging whether or not a predetermined command is given in said teaching mode, and (c) when it is judged that said predetermined command is given in said teaching mode, additionally inserting manually set override conditions into a corresponding block of the numerical control program, thereby automatically carrying out numerical control in accordance with the set override conditions at that and subsequent execution of the numerical control program, and characterised by the step of additionally inserting, as a condition for override, a distance between a moving position of an axis, at generation of said predetermined command, of an apparatus to be controlled by said numerical control program and a moving target position of said axis at completion of execution of said corresponding block, into said corresponding block. A numerical control method according to claim 1, wherein said override conditions include an override command, a classification of a control parameter to be override-processed and an override value, and wherein a control parameter value obtained by correction, by the corresponding override value, of a command value of the control parameter initially stated in the numerical control program containing said override conditions, is employed to execute the numerical control. A numerical control method according to claim 2, wherein said control parameter is a working condition parameter of a machine tool controlled by said numerical control program. A numerical control method according to claim 3, wherein said working condition parameter includes at least one of a cutting feed speed and a spindle speed. A numerical control method according to any one of the preceding claims wherein at execution of the numerical control program including said set override conditions, said set override conditions are invalidated only when a distance between the moving position of said axis and the moving target position is larger than said additionally inserted axis distance. A numerical control method according to any one of the preceding claims, including the step of writing the numerical control program edited at said step (c), to memory means in a read/write random-access manner. A numerical control method according to claim 6, wherein in said step (c), said set override conditions are initially stored in second memory means, and then are transferred to a corresponding area of said memory means and stored therein, thereby additionally stating said set override conditions. A numerical control system having an override playback function, comprising memory means for storing therein a numerical control program in a read/write random-access manner, setting means for manually setting override conditions, manually operable command means for giving a predetermined command, and manually operable teaching command means for operating said numerical control system in a teaching mode, and characterised by program editing means for additionally inserting said set override conditions into a corresponding block of the numerical control program when said predetermined command is given in said teaching mode and for writing the numerical control program including said inserted override conditions, to said memory means and wherein the numerical control system is mounted on an apparatus to be controlled having an axis controlled by said numerical control system, and wherein when said predetermined command is given in said teaching mode, said program editing means additionally inserts, amongst said conditions, a distance between a moving position of said axis at generation of said predetermined command and a moving target position of said axis at completion of execution of said corresponding block, into said corresponding block, to control use of said conditions. A numerical control system according to claim 8, wherein said override conditions include an override command, a classification of a control parameter to be override-processed, and an override value, wherein said numerical control system includes means for correcting a command value of the control parameter initially stated in the numerical control program including said override conditions, by a corresponding override value, and wherein numerical control is executed by the use of said corrected control parameter value. A numerical control system according to claim 8, further including second memory means for storing therein said set override conditions, wherein said program editing means transfers said set override conditions from said second memory means to a corresponding area of said memory means to store said set override conditions into said memory means, thereby additionally stating said set override conditions. A numerical control system according to any one of claims 8 to 10, further including means for invalidating said set override conditions only when an actual distance between said moving position and said moving target position of said axis is larger than said additionally stated distance, when the numerical control program including said set override conditions is executed. A numerical control system according to any one of claims 8 to 10, wherein said control parameter comprises at least one of a cutting feed speed and a spindle speed.

Inventors: KAWAMURA HIDEAKI, MATSUURA SYUJI, SASAKI TAKAO, KAWAMURA, HIDEAKI, MATSUURA, SYUJI, SASAKI, TAKAO
Applicants: FANUC LTD, FANUC LTD.
Application year: 1987
Main classification: G05B19
IPC codes: G05B19