METHOD OF PROCESSING NC APPARATUS

Abstract: The apparatus comprises a microprocessor (1), a memory (2), a tape reader (3), a key board (5), control units for main and X,Y,Z-axes (6-9) with drive circuits (10-13), motors (15,19-21), chucks (16,17), a work )18), position detectors (22-24), tables (26,27), a cutter (25), a drill (29) and an output unit (30). When a synchronising control instruction is given in NC data, two motors (15,16) holding the work (18) are moved synchronously so that machining can be d one by the cutter (25). When a single control instruction is given, the two motors (15,16) are moved independently so that drilling can be done by rotating the work to the opposite side.

Description: This invention relates to an NC unit processing method and, more particularly, to an NC unit processing method through which a single processor executes numerical control processing based on a numerical control program, and sequence control processing based on a sequence program, at predetermined times on a time-sharing basis. In a numerical control system such as disclosed in US-A-4,314,329, the processor of the NC unit (1) executes numerical control processing under the control of a numerical control program based on NC data (part program data) to transport a movable machine element (a tool or table), and (2) executes sequence processing under the control of a sequence program in accordance with M-, S- and T-function instructions contained in the NC data and contact signals from a machine tool to control the various mechanical elements of the machine tool on the basis of the results of this processing. The processor executes the numerical control processing based on the numerical control program and the sequence control processing based on the sequence program at predetermined times on a time-sharing basis. Fig. 5 is a block diagram of an NC unit in which a single processor executes numerical control processing and sequence program processing on a time-sharing basis. Numeral 1 denotes the NC unit, and numeral 2 designates a machine tool. Numeral 101 denotes an NC tape in which NC data (part program data) are punched, 102 a tape reader (though another medium and reading device may be used), 103 a RAM for storing the NC data punched in the NC tape as well as the results of processing, 104 a ROM in which a numerical control program has been stored, 105 a processor (CPU), 106 a pulse distributing circuit for executing pulse distribution computations upon having amounts of travel X₀, Y₀ along the respective axes per predetermined lengths of time inputted thereto, 107 a bus line, 108 a manual data input unit (MDI unit), 109 an interface circuit, 110 a parameter memory for storing various parameters, and 111 an EROM (erasable ROM). The EROM 111 stores (a) a sequence program and (b) a correspondence table of correspondence between symbols (operands) and storage locations in the RAM 103 at which the logic values ("1" or "0") of these operands are stored. The sequence program is one in which the functions of a magnetics circuit that administers the exchange of data between the NC unit 1 and machine tool 2 are programmed logically in the form of instruction codes and operands. The functions are programmed as shown in Fig. 6, by way of example. In the sequence program, RD, OR, AND, WRT, AND NOT, OR NOT and so forth are instruction codes, in which RD is a read instruction, AND a logical product instruction, WRT a write instruction, OR a logical sum instruction, AND NOT an instruction of a logical product with a negative value, and OR NOT an instruction of a logical sum with a negative value. Further, MF, M28, ..., AUT, M03, ... CRA are operands expressed by symbols, the logic values ("1" or "0") of which are stored at predetermined addresses and predetermined bits of the RAM 103. The processor 105 executes numerical control processing based on the numerical control program and sequence control processing based on the sequence program at predetermined times on a time-sharing basis. In sequence control processing, the instructions of the sequence program are executed successively starting from the first instruction. The larger the system, e.g. the larger the number of controlled axes, the longer the time required for numerical control processing. For this reason, the conventional practice is to decide a time T₁ for execution of numerical control processing and a time T₂ for execution of sequence processing upon presupposing the size of the largest system, and execute the numerical control processing (T₁) and sequence processing (T₂) on this time-sharing basis every predetermined time T (T > T₁ + T₂) . With this method of processing, however, the length of time T₂ for execution of sequence processing is fixed even if the time required for numerical control processing is shortened by reducing the size of the system. The problem that results is that the processor is not used efficiently. Accordingly, an object of the present invention is to provide an NC unit processing method so adapted that numerical control processing time and sequence processing time can be varied in dependence upon the system configuration. According to the present invention there is provided an NC unit processing method for executing numerical control processing based on a numerical control program, and sequence control processing based on a sequence program, at predetermined times on a time-sharing basis employing timer interrupts, characterized in that: first timer interrupts are generated at a fixed period T for instigating execution of processing at a first level; second timer interrupts are generated at a fixed time after respective ones of the first timer interrupts, for instigating execution of highest priority processing at a second level; starting at each first timer interrupt, numerical control processing is performed for a time which is the total period of time necessary for numerical control processing; then sequence processing is performed for a time until the next second timer interrupt is generated, in response to which the location is stored of a sequence program to be executed next in a predetermined storage area; then processing is performed at the second level followed by processing at a level lower than the first level; then the next first timer interrupt is generated followed by numerical control processing for a time; and then sequence program processing from said location is performed until the next second timer interrupt is generated. Fig. 1 is a block diagram showing the principal portions of an NC unit for practicing the processing method in accordance with the invention; Fig. 2 is a time chart of timer interrupt processing; Figs. 3 and 4 are explanatory views of processing according to the invention; and Fig. 5 and 6 are explanatory views of sequence processing. In Fig. 1, numeral 11 denotes a processor, 12 a memory for storing various programs, 12a a numerical control program, 12b a sequence program, 12c an input/output control program for a CRT, keyboard and the like, 12d an interrupt processing program, 12e a part program, 13 a RAM, 14 a stack, 15 an interrupt controller, and 16 a timer. It should be noted that units necessary for NC control of an axis controller, CRT & MDI unit and the like are partially omitted. Input/output control of the CRT, keyboard and the like and other processing which is permissible to be delayed are given a level (n-1), numerical control processing and sequence processing absolutely essential for such NC control as the reading of NC data and axis control are given a level n, processing from that of level n having the highest priority is given a level (n+1), a timer interrupt IRQ n for executing the processing of level n is denoted by IRQ n , and an interrupt for executing the processing of level (n+1) is denoted by IRQ n+1 . The degree of priority is IRQ n+1 > IRQ n . As shown in Fig. 2, the timer interrupt IRQ n is generated at a period T (T is fixed), and the timer interrupt IRQ n+1 is generated upon passage of a time T n (fixed) from generation of the timer interrupt IRQ n . At generation of the timer interrupt IRQ n while the processing of level (n-1) is being executed, the processor 11 executes the processing of level n until the timer interrupt IRQ n+1 is generated. The processing of level (n+1) is executed in response to generation of the timer interrupt IRQ n+1 , and then the processing of level (n-1) is executed. It should be noted that the processing of level (n+1) is for causing the processor 11 to execute the processing of level (n-1) at wind-up of the processing of level n. In the processing of level (n), the processor 11 first performs numerical control processing (T₁) under the control of the numerical control processing program 12a, then performs sequence processing (T₂) under the control of the sequence program 12b. The numerical processing time T₁ is the total period of time necessary for numerical control processing and varies in dependence upon the system configuration. If the system configuration increases in size, then the numerical control processing time T₁ naturally becomes longer (the sequence processing time T₂ becomes shorter). If the system configuration decreases in size, then T₁ becomes shorter (the sequence processing time T₂ becomes longer). (a) If the timer 16 generates the timer interrupt IRQ n when the processing of level (n-1) is being executed on the basis of the input/output control program 12c, the interrupt controller 15 inputs an interrupt request IRQ and the interrupt level (n) thereof to the processor 11. (b) In response, the processor 11 executes predetermined interrupt processing under the control of the interrupt processing program 12d. More specifically, the contents of various registers and a program pointer indicative of location of the input/output program 12c to be executed later are successively stored in the stack 14 [see Fig. 3(A)]. (c) Next, the processor 11 executes numerical control processing (T₁) based on the numerical control program 12a. (d) A command for referring to the contents of a predetermined address of the RAM 13 is included at the end of the numerical control program 12a. It should be noted that a location (program pointer) SPNO. of the sequence program 12b to be executed next is stored at the abovementioned address, as will be described below. Accordingly, the processor 11 reads the program pointer SPNO. after the conclusion of numerical control processing. (e) The processor 11 restarts sequence processing (T₂) in accordance with the sequence program 12b from the location indicated by the program pointer SPNO. (f) Sequence processing is executed until the timer interrupt IRQ n+1 is generated. (g) If the timer interrupt IRQ n+1 is generated by the timer 16 during the execution of sequence processing, the interupt controller 15 inputs the interrupt request IRQ and the interrupt level (n+1) thereof to the processor 11. (h) In response, the processor 11 suspends sequence processing and stores the contents of various registers and a program pointer indicative of location of the input/output program 12c to be executed later in the stack 14 [see n in Fig. 3(B)]. (i) Thereafter, the processor 11 stores the saved data, which conforms to the level n, from the stack 14 in the predetermined storage area 13a of the RAM 13 [Fig. 3(C)]. (j) Next, the processor 11 cancels the interrupt flags of the timer interrupts IRQ n , IRQ n+1 , restores the data conforming to the (n-1) level to the various registers from the stack 14, and returns to IRQ n-1 to execute CRT display and key-in processing, etc., on the basis of the input/output program 12c. If the timer interrupt IRQ n is generated, processing form step (a) onward is repeated thereafter. Thus, as shown in Fig. 4, input/output control program processing → numerical control program processing → sequence program processing are executed sequentially in the order indicated by the numbered arrows. Though a stack is used in the foregoing, a stack area can be provided in the RAM and stack pointers indicating read/write addresses can be prepared instead of using a stack. Thus, the arrangement is such that a command for referring to the location of a sequence program to be executed next is inserted beforehand at the end of a numerical control processing program, and the processing executed shifts from numerical control processing to sequence processing in response to the command. Therefore, the time (numerical control processing time T₁) up to execution of the command varies in dependence upon the system configuration, so that the sequence processing time also varies accordingly. This makes it possible to improve the efficiency at which the processor is used.

Claims: An NC unit processing method for executing numerical control processing based on a numerical control program, and sequence control processing based on a sequence program, at predetermined times on a time-sharing basis employing timer interrupts (IRQ n , IRQ n+1 ), characterised in that: first timer interrupts (IRQ n ) are generated at a fixed period T for instigating execution of processing at a first level (n); second timer interrupts (IRQ n+1 ) are generated at a fixed time (Tn) after respective ones of the first timer interrupts (IRQ n ), for instigating execution of highest priority processing at a second level (n+1); starting at each first timer interrupt (IRQ n ), numerical control processing is performed for a time (T₁) which is the total period of time necessary for numerical control processing; then sequence processing is performed for a time (T₂) until the next second timer interrupt (IRQ n+1 ) is generated, in response to which the location is stored of a sequence program to be executed next in a predetermined storage area (13a); then processing is performed at the second level (n+1) followed by processing at a level (n-1) lower than the first level (n); then the next first timer interrupt (IRQ n ) is generated followed by numerical control processing for a time (T₁); and then sequence program processing from said location is performed until the next second timer interrupt (IRQ n+1 ) is generated. An NC unit processing method according to claim 1, characterised by: inserting a command which refers to the location of the sequence program to be executed next at the end of said numerical control program; reading the sequence program execution position, which is stored in said storage area, in response to said command; and executing sequence program processing from said position. An NC unit processing method according to claim 1 or 2, characterised by: executing processing based on an input/output program after processing of said sequence program is suspended; suspending input/output processing in response to the next first timer interrupt (IRQ n ); and thereafter executing numerical control processing based on said numerical control program

Inventors: IKEDA YOSHIAKI, KUWASAWA MITSURU, IKEDA, YOSHIAKI, KUWASAWA, MITSURU
Applicants: FANUC LTD, FANUC LTD.
Application year: 1987
Main classification: G05B19
IPC codes: G05B19