NUMERICALLY CONTROLLED DEVICE WITH WORKING SIMULATION FUNCTION

Abstract: A numerically controlled device wherein, during working simulation, both a work and a tool are constantly displayed on a display screen at a proper variable display magnification, so that both of a change in shape of the work and movement of the tool can be constantly properly checked. The numerically controlled device is provided with a processor (11) for numerical control and a processor (31) for automatic programming. The processor (11) determines a scale so as to display the work over the full display screen of a display device (18), calculates a scale so that both of the work and the tool are contained within the display screen on the basis of the current position of the tool each time a numerical control program is executed on a block basis for working simulation, further, discriminates the necessity of a scale change on the basis of the result of comparison between the predetermined scale and a calculated scale and the scale used in displaying the previous program block, and changes the scale as necessary. The processor (31) performs working simulation on the display screen at a display magnification matching the determined scale.

Description: The present invention relates to a numerical control apparatus having a work simulation function. There has been known an interactive numerical control apparatus which executes a work simulation by use of a graphic animation in compliance with a numerical control program so that an operator can check whether the program is good or bad. This kind of apparatus carries out the work simulation by selectively changing its display magnification. For example, one of the display scales (first scale) is set to display both the workpiece and the tool locating at a shift starting position together on a display screen. And, another one (second scale) is set to display an enlarged view of, for example, the workpiece. Also, in the conventional apparatus, the display scale is not changeable during the work simulation. Therefore, where the overall shift trace of the tool is to be checked mainly, the first scale is preferable for executing the work simulation. In this case, however, the configuration change of the workpiece resulting from the cutting operation of the workpiece cannot be checked precisely. On the other hand, where the workpiece configuration change (or the workpiece cutting process) is to be checked chiefly, the second scale is preferable for executing the work simulation; however, it would be impossible to check the overall shift movement if the tool should shift beyond the scope of display. The purpose of the present invention is to provide a numerical control apparatus having a work simulation function capable of displaying both the workpiece and the tool movement with respect to the workpiece at any time during the work simulation on a display screen at an adequate display magnification, so that both the workpiece configuration change and the tool shift movement can always be checked adequately. There is disclosed in the document ZWF Zeitschrift für Wirtschaftliche Fertigung und Automatisierung; vol. 83, No 2, February 1988, München, pages 68 - 73, a numerical control apparatus which displays a workpiece configuration change and a tool shift movement on the same display screen in accordance with the execution of numerical control program. In addition, JP-A-58-158713 discloses a method of deciding the scale and display position of a workpiece automatically, so that a processing program can be monitored and displayed with the maximum size. According to the present invention there is provided a numerical control apparatus having a work simulation function capable of displaying both a workpiece configuration change and a tool shift movement on the same display screen in accordance with the execution of a numerical control program, said numerical control apparatus comprising: a scaling means for determining a predetermined scale suitable for displaying the workpiece configuration change; and an arithmetic means for calculating a scale by which both the workpiece, and the tool at its present shifted position, can be displayed together on the same display screen, in compliance with the execution of the numerical control program, characterised in that the arithmetic means is operable to calculate said calculated scale based on a present shifted position of the tool which is remote from the workpiece, whereby the calculated scale is smaller than the predetermined scale, with both the predetermined scale and the calculated scale referring to the workpiece being displayed in a same direction; and there is provided a magnification determining means for determining a display magnification based on the result of a comparison of said predetermined scale and said smaller calculated scale so that the work simulation can be executed by a thus determined display magnification. As is described above, in accordance with the present invention, the work simulation is carried out by the use of the display magnification obtained by taking into consideration both the predetermined scale suitable for displaying the workpiece configuration change in detail, and the scale calculated based on the present shifted position of the tool as a result of the execution of the numerical control program. Therefore, during the work simulation, both the workpiece and the tool shifting with respect to the workpiece can always and adequately be displayed on the display screen. Thus, it becomes possible not only to check the workpiece configuration change in detail during the work simulation, but also to adequately check the overall shifting locus of the tool. Accordingly, the program check can accurately be executed throughout the work simulation. BRIEF DESCRIPTION OF DRAWINGS Fig. 1 is a schematic block diagram showing a numerical control apparatus in accordance with one embodiment of the present invention; Fig. 2 is a flow chart showing a scale determining procedure in the work simulation utilizing a graphic animation display controlled by the numerical control apparatus; Fig. 3 is a view showing a display screen at the moment of the initiation of the graphic animation; Fig. 4 is a view showing a display screen at the moment of the initiation of the work simulation; Fig. 5 is a view showing a display screen in course of performing of the work simulation; and, Fig. 6 is a view showing a display screen at the moment of the termination of the work simulation. With reference to Fig. 1, an interactive numerical control apparatus equipped with a computer in accordance with one embodiment of the present invention comprises a control function for actuating an NC machine tool 40, an auto-programming function for automatically programming an NC program in the form of an interactive communication with an operator, and a work simulation function for checking whether the NC program is good or bad. The machine tool 40 comprises, for example, a spindle motor for rotating a workpiece, actuators such as axis servo-motors each equipped with a pulse coder for shifting a tool, a sensor for detecting operational conditions of the machine, and a machine operation board provided with operation switches. The numerical control apparatus (Hereinafter, referred to as a CNC apparatus) comprises a numerical control processor (NCCPU) 11, a read only memory 12 such as an EPROM or an EEPROM storing a system program used for an overall control of the numerical control apparatus and a scaling program used for a later-described scale determining process and so on, a random access memory 13 such as an SRAM used for temporarily memorizing various data, and a non-volatile memory 14 such as a CMOS backedup by a battery. Memories 12-14 are connected through a bus 20 to the NCCPU 11. The non-volatile memory 14 stores data to be reserved even after an electric power is turned off, for example, various parameters, tool correction amounts, pitch error correction amounts, predetermined scales used in the scale determining process. Furthermore, the CNC apparatus includes a manual data input apparatus 15. The data input apparatus 15 comprises a keyboard 16 having symbolic keys and numerical keys etc. for manually inputting various commands, drawing data, NC data and so on, a graphic control circuit 17 for generating image signals based on digital signals supplied from the NCCPU 11 or digital data such as the drawing data and the NC data supplied from a later-described automatic programming processor 31 during the preparation of NC program or the work simulation, a CRT or a liquid crystal display devise 18 having a display screen 18a (For example, Figs. 3 to 6) for displaying images based on the image signals. Under the display screen 18a, there is provided a plurality of soft keys 19. Each soft key is assigned a different functions so that it can be used selectively depending on the operational modes of the CNC apparatus. Thus, the soft keys can be used for the functions whose number is more than the total number of the soft keys 19. Elements 16, 17, and 19 are connected to the bus 20. Further, the numerical control apparatus includes the number of spindle control circuits provided more than that of spindle of the machine tool 40 and servo-amplifiers provided in the same number as that of the spindle control circuits. A reference numeral 21 denotes one of the axis control circuits, and a reference numeral 22 denotes one of the servo-amplifier associated with the spindle control circuit 22. Each of the spindle control circuits is connected to the bus 20 so as to control, through the servo-amplifier, corresponding one of the servo-motors of the machine tool 40 in response to shift commands fed from the NCCPU 11. Moreover, the CNC apparatus is connected to the NCCPU 11 via the bus 20, and has a programmable machine controller (PMC) 23 connected through an input/output unit (not shown) to the operation switches of the machine tool 40, actuators, and sensors. The PMC 23 accommodates a sequence program edited in compliance with a ladder method. The PMC 23 is constituted to process the control outputs from the NCCPU 11 relating to a support function, a main spindle function, and a tool function (i.e. M function, S function, and T function) in accordance with the sequence program. The signals obtained by processing of the sequence program are sent out to the machine tool 40 so as to start the actuator. Further, the PMC 23 executes a sequence processing of the signals obtained from the sensors and operation switch and, in turn, sends them to the NCCPU 11. The CNC apparatus is connected through an interface 24 to external devices such as a paper tape reader, a paper tape puncher, a printer, a floppy disk drive unit etc. (not shown), so that, the work program can be read from the paper tape reader to the CNC apparatus and an edited work program can be outputted from the CNC apparatus to the paper tape puncher. Furthermore, the CNC apparatus comprises an auto-programming processor (APCPU) 31 connected to the bus 20, a ROM 32 storing a program for the auto-programming operation and data for generating an interactive data input screen, an SRAM 33 for temporarily memorizing various data, and a non-volatile memory 34 storing tool data, workpiece configuration data etc., which are required for the auto-programming operation. Memories 32-34 are connected through the bus 35 to the APCPU 31. In the above-described CNC apparatus, during an auto-programming operation through the interactive method with the operator, not only an interactive data input screen is displayed on the display screen 18a but also the work capable of being carried out or data capable of being set on the display screen 18a are displayed in the form of a menu. If the operator manipulates the keyboard 16 or the soft keys 19 to manually input data or menu items, the APCPU 31 carries out a data processing. During the edition of the NC program, the work simulation is carried out by use of a background animation in accordance with the NC program data which has already been created. Further, when the NC program is accomplished, the created NC program is stored in the non-volatile memory 34, and is transferred to the non-volatile memory 14. Then, if the operator selects the work simulation function from the menu, the NCCPU 11 and the APCPU 31 cooperate with each other to execute the work simulation by use of foreground animation in accordance with the created NC program. More particularly, the NCCPU 11 reads out the NC program registered in the non-volatile memory 14 block by block and, in turn, writes it in the RAM 33. The APCPU 31 carries out the work simulation using a graphic animation on the display screen 18a in compliance with the NC program written in the RAM 33. The operator checks the quality of the editing NC program or the created NC program with reference to the work simulation. In this case, in order to let the operator not only finely check the workpiece configuration change during the work simulation but also roughly check the overall shift trace of the tool, the work simulation is executed, as described in detail later, on the basis of a display magnification determined as the result of comparison between a predetermined scale suitable for displaying the workpiece configuration change and a scale calculated based on a present shift position of the tool in accordance with the execution of the NC program. Hereinafter, referring now to Figs. 2 to 6, the scale determination processing carried out by the NCCPU 11 and the APCPU 31 and also the simulation of cutting process carried out by the APCPU 31 on the basis of the T function code will be explained in detail. If the operator operates the soft key to select the work simulation function, the APCPU 31 calculates a scale a by which the workpiece is displayed widely on the whole area of the display screen 18a. This scale a is set in the register accommodated in the APCPU 31 and transferred to the RAM 33. And, flag data (hereinafter, referred to as flag) F1, F2 in a first and a second flag memories are initialized to "0", respectively (Step S1). In accordance with the selection of the work simulation function, the APCPU 31 displays on the display screen 18a an initial screen at the moment of initiation of the graphic animation as shown in Fig. 3. The initial screen displays an outline of a workpiece 42 held by a chuck 41 at a depict magnification corresponding to the predetermined scale a, for example, 0.922. And, the NC data are displayed at the right end portion of the initial screen. In the NC data shown in Fig. 3, a symbol O denotes a program number; a symbol N denotes a block number; an X-AXIS and a Z-AXIS coordinate data representing a tool position; a symbol S a spindle speed data; a symbol T a tool selection code; and a symbol M a support function code. Furthermore, the display screen 18a displays various functions assigned to the soft keys 19, that is, "check start", "material restoration", " trace on", "depict range", and "end". By operating a soft key having a depict range determining function, any scale can be determined at any time. Returning to Fig. 2, the NCCPU 11 starts block by block execution of the NC program when a program check command is inputted through the soft key 19. That is, the initial block of NC program is executed and written in the RAM 33 (Step S2). Next, the APCPU 31 reads in a present position of the tool (Step S3). A scale b is determined so that both the workpiece 42 and the tool (shown by a reference numeral 43 in Figs. 4-6) can be displayed together on the same display screen 18a on the basis of the present tool position, and the obtained scale b is stored in the RAM 33 (Step S4). Then, it is checked whether or not the block executed in the step S2 is the last block (Step S5). If the judgment in the step S5 is NO, the APCPU 31 further checks whether or not the predetermined scale a is larger than the scale b calculated in the step S4 (Step S6). Immediately after the program check command has been inputted, the tool is located far from the work starting position (i.e. a machine origin point uniquely determined based on a machine type of each machine tool 40). Therefore, the calculated scale b is smaller than the predetermined scale a, and thus, the judgement in the step S6 becomes YES. In this case, the APCPU 31 judges whether the second flag F2 is "0" or "1" (Step S9). The value "1" for the flag F2 means that an animation display relating to the previous block has been carried out by the scale a. If the judgment in the step S9 is for that the second flag F2=0, it is further checked whether the first flag F1 is "0" or "1" (Step S10). The value "1" for the flag F1 means that an animation display relating to the previous block has been carried out by the scale b. In this stage, the flags have remained unchanged from the initialized condition of F1 = F2 = 0. Therefore, the APCPU 31 next checks whether or not a T code is included in the block executed in the step S2. (Step S11). If it is judged in the step S11 that the T code, which is shown as an example shown in Fig. 4, is included, the APCPU 31 stores in the RAM 33 the scale b, which is calculated in the step S4 and smaller than the predetermined scale a. And then, the APCPU 31 sets the first flag F1 to "1" and the second flag F2 to "0" (Step S12). Thus, the APCPU 31 selects a small depict magnification such as 0.387 corresponding to the calculated scale b calculated based on the NC data block written in the RAM 33 by the NCCPU 11 in the step S2, so that the tool 43 located at a work starting position and the workpiece 42 gripped by the chuck 41 can be displayed together on the same display screen 18a (Fig. 4). Next, after the work simulation advances to successively execute the latest block of the NC program, read in a present position of the tool, calculate the scale b, and judge that the block is not the final one (in the step S2-S5), if the scale b calculated in the step S4 is judged to be greater than the predetermined scale a in the step S6, the APCPU 31 subsequently checks whether or not the first flag F1 is "1". That is, the APCPU 31 checks if an animation display relating to the previous block has been carried out by the scale b, which is smaller than the predetermined scale a (Step S7). If the judgment in the step S7 is YES, that is, when it is judged that the workpiece configuration change cannot be precisely monitored in the case where the animation display is carried out by the previously calculated smaller scale b, and on the other hand, both the tool and the workpiece can be fully displayed together on the same display screen 18a even by the predetermined scale a, which is smaller than the presently calculated scale b, the APCPU 31 writes the predetermined scale a into the RAM 33 instead of the previously calculated scale b, and the first flag F1 is reset to "0" and the second flag F2 is set to "1", which shows that the animation display is carried out by the predetermined scale a (Step S8). The APCPU 31 displays a condition of the workpiece 42 being cut by the tool 43 on the display screen 18a by a large depict magnification 0.922 corresponding to the predetermined scale a (Fig. 5). In such a manner, if the tool 43 moves from the work starting position towards the workpiece 42 in accordance with the progress of the work simulation, the workpiece 42 can be displayed together with the tool 43 on the display screen 18a even if the workpiece 42 is widely displayed at the large magnification. Thus, it becomes possible for the operator to finely check the workpiece configuration change without interfering with the check of tool shift movement during the work simulation. After that, in an ending stage of the cutting process in the work simulation, the work simulation progresses to successively execute the latest block of the NC program, read in a present position of the tool, calculate the scale b, and judge whether or not the block is the final block (in the step S2 -S5). Then, the scale b calculated in the step S4 is judged to be smaller than the predetermined scale a in the step S6. And further, it is judged in the step S9 that the second flag F2 is F2=1. In this case, when the predetermined scale a is applied for the animation display, the image of the tool cannot be contaimed within the screen. Thus, the smaller scale b calculated in step 4 is written into RAM 33 instead of the predetermined scale a. Then, the first flag F1 is set to "1", the value representing the animation display by scale b, and the second flag F2 is set to "2" (step 12). The APCPU 31 displays the condition of the tool 43 together with the chuck 41 and the workpiece 42 on the same display screen 18a by the small depict magnification 0.387 corresponding to the calculated scale b (Fig. 6). In such a manner, when the tool 43 returns to the work starting position, the depict magnification is automatically reduced to the smaller magnification so that the check of the tool shift trace can be executed without any interference. As is explained in the foregoing description, the procedure of the step S3 and the following steps are executed every time when a new program block is read in, the step S2 showing the scale determination process. The scale for determining the depict magnification is automatically changed selectively between the small scale b by which the tool shift trace display can be carried out without any interference, and the large predetermined scale a by which the workpiece configuration change can be precisely displayed, based on the tool shift position. As a result, an overall tool shift movement and the workpiece cutting condition are adequately displayed. By the way, after being judged in the step S6 that a newly calculated scale b is smaller than the predetermined scale a in the scale determining procedure of Fig. 2, if the first flag F1 is judged to be "0" in the step S7 or if it is judged that the animation display with respect to the previous block is carried out by the small scale change is not necessary, and thus the scale change will not be made. In the same manner, the scale will not be changed when the first flag F1 is judged to be "1" in the step S10, or when it is judged in the step S11 that the T code is not included in the program block.

Claims: A numerical control apparatus having a work simulation function capable of displaying both a workpiece (42) configuration change and a tool (43) shift movement on the same display screen (18a) in accordance with the execution of a numerical control program, said numerical control apparatus comprising: a scaling means (31) for determining a predetermined scale (a) suitable for displaying the workpiece (42) configuration change (Fig. 5); and an arithmetic means (31) for calculating a scale (b) by which both the workpiece (42), and the tool (43) at its present shifted position, can be displayed together on the same display screen (18a), in compliance with the execution of the numerical control program, characterised in that: the arithmetic means (31) is operable to calculate said calculated scale (b) based on a present shifted position (Figs. 4, 6) of the tool (43) which is remote from the workpiece (42), whereby the calculated scale (b) is smaller than the predetermined scale (a), with both the predetermined scale (a) and the calculated scale (b) referring to the workpiece (42) being displayed in a same direction; and there is provided a magnification determining means for determining a display magnification based on the result of a comparison of said predetermined scale (a) and said smaller calculated scale (b) so that the work simulation can be executed by a thus determined display magnification. A numerical control apparatus in accordance with claim 1, in which said magnification determining means includes a comparison means for comparing said predetermined scale (a) and said calculated scale (b), and a magnification change means for changing the display magnification based on the result of the comparison by the comparison means. A numerical control apparatus in accordance with claim 1 or 2, in which said scaling means (31) determines said predetermined scale (a) so that the workpiece (42) can be displayed widely on the display screen (18a) by said predetermined scale (a). A numerical control apparatus in accordance with any preceding claim, in which said arithmetic means (31) calculates a scale (b) by which the tool (43) located at a work starting position can be displayed together with the workpiece (42) on the display screen (18a). A numerically controlled apparatus in accordance with claim 2, or claim 3 or 4 when appended to claim 2, in which said numerical control apparatus is constituted to execute work simulation by carrying out said numerical control program block by block, and said magnification change means changes the display magnification with reference to a flag data representing the scale used for the work simulation relating to the previous program block.

Inventors: FUJITA NAOKI, MATSUMURA TERUYUKI, MURATA KOICHI, FUJITA, NAOKI, MATSUMURA, TERUYUKI, MURATA, KOICHI, FUJITA, NAOKI, ROOM 6-203, FANUC MANSHONHARIMOMI, MATSUMURA, TERUYUKI, FANUC DAI-3 VIRA-KARAMATSU, MURATA, KOICHI, ROOM 10-204, FANUC MANSHONHARIMOMI
Applicants: FANUC LTD, FANUC LTD.
Application year: 1991
Main classification: B23Q15
IPC codes: G05B19, B23Q15, B23Q17