METHOD OF PREPARING PROGRAM FOR DRILLING HOLES

Abstract: A method of preparing a program for machining holes, which makes it possible to reduce the number of times of exchanging the tools, comprising the steps of: (a) preparing PERT programs (P1 to P3) in which records covering tools (A to K) to be used are arranged in the order of machining steps for each of the holes having different shapes; (b) finding a tool ("C") that is commonly and most frequently used in PERT program (P1 to P3); (c) dividing the PERT programs that include the common tool ("C") as a tool to be used into ·PERT program portions (Pi1 = 1, 2...) that precede the common tool and PERT program portions (Pi2, i = 1, 2...) that acceed the common tool, and further making the order of selecting the tools to be a group of tools to be used in the preceding PERT program portions →com­ mon tool ("C")→a group of tools to be used in the succeed­ ing PERT program portions; (d) repeating the second and third steps (steps (b) and (c)) until there is no more common tool used in the preceeding PERT program portions (Pi1) and the succeeding PERT program portions (Pi2), in order to determine the order of selecting the tools (A→B→F→­ H→I→C→D→G→E→J→K→); and (e) preparing, as the fifth step, a synthetic PERT program in which the records are arranged in the order of selecting the tools.

Description: This invention relates to a method of creating an NC program for drilling holes. An automatic programming apparatus which automatically creates NC programs for drilling holes is available. With such an automatic programming apparatus, data are entered in a conversational mode using a graphic display screen and an NC program for drilling holes is created from a design drawing through a simple operation. Conventionally, an NC program for drilling holes is created in such a manner that a number of holes are divided into a plurality of groups classified by holes of the same shape (holes of an identical depth, size and type), and all holes constituting one group are drilled followed by drilling all holes in the next group. This process is performed in a similar manner thereafter until all holes are drilled. Ordinarily, a plurality of tools are used to form a single hole. For example, a screw hole is formed by sequentially executing a centre boring step using a centre drill, a drilling step using a drill, a countersinking step using a countersink, and a tapping step using a tapper. Accordingly, taking into consideration solely the tool use sequence for each group, we have:- where T11 and so forth represent tool numbers. The tools used to form the holes of a certain group are also used to form the holes of other groups. Accordingly, if the tool use sequence of tools employed in drilling the holes is skilfully decided, the number of times tools are changed can be made small to shorten machining time. However, since the conventional arrangement is such that after the drilling of all holes constituting one group is completed, the holes of the next group are drilled, the same tool is selected a number of times. This leads to a large number of tool changes and prolongs machining time. GB-A-2 109 129 discloses a method of controlling lineup of tools in an NC machine tool having the features of the preamble of accompanying claim 1. According to the present invention, there is provided a method of automatically creating a hole drilling program in an automatic programming apparatus, comprising steps of:- (a) Creating a part program for every hole of a different shape, each part program comprising records arranged in a machining process sequence each specifying at least a tool to be used and a machining depth; (b) Deciding a tool use sequence that brings a number of tool changes close to a minimum value; (c) Creating a combined part program comprising said records arranged in said decided tool use sequence; and (d) Creating a hole drilling NC program using said combined part program; characterised in that step (b) comprises:- (i) Identifying that common tool, i.e. a tool specified by more than one part program, specified in common by the greatest number of part programs; (ii) Separating each part program which specifies said common tool into an anterior part program section before the record specifying said common tool, and a posterior part program section following that record, and defining the following tool selection sequence: tools specified in the anterior part program sections, said common tool, tools specified in the posterior part program sections; and (iii) Repeating steps (i) and (ii) for the anterior part program sections, i.e. identifying that common tool specified in common by the greatest number of anterior part program sections and defining a tool selection sequence for the anterior part program sections and also for the posterior part program sections, until all common tools are accounted for, and deciding said tool use sequence as a combination of the tool selection sequences defined in step (ii); whereby in said tool use sequence, the order of tool-use defined by each part program is maintained. Thus an embodiment of the invention can provide a method of creating an NC program for drilling holes in which a tool use sequence is decided in such a manner that the number of times tools are changed is made close to a minimum value while maintaining the tool use sequence specified by a part program created for each one of holes having different shapes, and the holes are drilled in the tool use sequence decided. Reference is made, by way of example, to the accompanying drawings in which:- Fig. 1 is a schematic explanatory view of the method of the present invention; Fig. 2 is a block diagram of an automatic programming apparatus to which the present invention can be applied; Fig. 3 is a flowchart of processing according to the present invention; Fig. 4 is a part program explanatory view; Fig. 5 is a combined part program explanatory view; and Fig. 6 is an explanatory view of processing for revising a hole drilling program. Fig. 1 illustrates a method of creating an NC program for drilling holes using the present invention. If a number of holes are divided into a plurality of groups classified according to holes of the same shape (holes of the same depth, size and type), there will be cases where a tool used in forming the holes of a certain group can also be used to form the holes in another group. In such a case, if the machining using this common tool is performed successively for each group, then the number of times tools are changed can be reduced in comparison with the prior-art method, by (M-1) tool changes if M groups use the common tool. As an example, first, second and third part programs P1 to P3 are created for holes of different shape, each part program comprising records arranged in a machining process sequence and including at least a tool to be used and a machining depth [see Fig. 1(a)]. In Fig. 1, letters "A" to "K" may be thought of as records or as tools. When creation of the first, second and third part programs P1 to P3 is completed, it is checked whether there are tools which will be used commonly in each hole machining operation, and the tool used most commonly is found. In the example of Fig. 1(A), tool "C" is most often used. Next, each of the part programs P1 to P3 which includes the found common tool "C" is separated at the record specifying the common tool into an anterior part program section Pi1 (i = 1 to 3) and a posterior part program section Pi2 (i = 1 to 3), and the following tool selection sequence is adopted: tool group used in the anterior part program section Pi1 → common tool "C" → tool group used in the posterior part program section Pi2 [see Fig. 1(B)]. Thereafter, the above steps are repeated for each anterior part program section Pi1 (i = 1 to 3) and each posterior part program section Pi2 (i = 1 to 3) until all the common tools are accounted for. The result is a tool selection sequence (A → B → F → H → I) of a group of tools used in the anterior part program section Pi1 and a tool selection sequence (D → G → E → J → K) of a group of tools used in the posterior part program section Pi2 [see (C) - (E) of Fig. 1]. Finally, a tool selection sequence A → B → F → H → I → C → D → G → E → J → K is decided for all tools used in all of the part programs P1 - P3 having the common tool "C" [see Fig. 1(F)]. It should be noted that this tool selection sequence does not disrupt the tool use sequence for each hole, namely the tool use sequence in each of the part programs P1 - P3 illustrated in Fig. 1(A). Next, a combined part program is created comprising the records arranged in the above tool selection sequence. If a part program which does not include the common tool "C" exists, similar processing is applied to this part program and the combined part program to decide a tool selection sequence for all hole machining operations, and a drilling program is created comprising records arranged in this tool selection sequence. Fig. 2 is a block diagram of an automatic programming apparatus to which the present invention can be applied. In the Figure, numeral 11 denotes a main unit constituted by a computer and having a processor 11a, ROM 11b and RAM 11c. Numeral 12 denotes a keyboard, 13 a display unit and 14 a disk controller for controlling two floppy disk drives 14a, 14b. Though not shown, a printer, data reader/puncher, magnetic tape unit and other input/output units are suitably connected to the above. The automatic programming apparatus can be made to perform processing for creating a hole drilling NC program if a floppy FD1 storing a system program for NC program creation is set in the floppy disk drive FD1 before automatic programming is executed, followed by starting a loading program stored in the ROM 11b to read the loading program into the RAM 11c. The created NC program for drilling is preserved on the floppy FD2. Processing for creating the drilling NC program in accordance with the invention will now be described in accordance with the flowchart of Fig. 3. (1) A part program is created for every hole having a different shape. The part program is created by the following processing, which serves as an example: (a) First, a machining process for cutting a hole having a predetermined shape is selected. For example, if the hole is a screw hole, the hole will be cut in the following sequence: center boring, drilling, countersinking and tapping. Therefore, center boring is selected first. (b) Next, the tool number of a tool used in the hole cutting process selected in step (a) is inputted. It should be noted that a suitable tool can be decided automatically based on the hole dimensions. (c) Following the entry of the tool number, such information as the depth to which the hole is to be cut by the tool is inputted. (d) Next, it is checked whether all machining processes have been specified. If all processes have not been specified, then processing from step (a) onward is repeated. (e) when all machining processes have been specified, hole position is inputted. If holes of the same shape and depth are plural in number, the positions of all of these holes are inputted. (f) Thereafter, it is checked whether there are holes having other shapes. If there are such holes, the processing from step (a) onward is performed. Eventually, a part program will be created for every hole having a different shape. Fig. 4 is an explanatory view of part programs. Pi (i = 1, 2, ...) represents an i-th part program, Rij (i = 1, 2, ...; j = 1, 2, ...;) denotes a record, and PNij stands for a point register for storing two types of pointers. Each record Rij is composed of a tool number Tij, cutting depth (hole depth) Lij, tool feedrate Fij, spindle rotating speed Sij, etc. The pointers are a pointer for designating the record Rij and a pointer for designating the pointer register PNij. A pointer register PNoo designates an address Bo of a pointer register PN10 of the first part program P1, the first pointer of the pointer register PN10 designates an address B1 of a pointer register PN20 of the posterior part program P2, and a second pointer of the pointer register PN10 designates an address A11 of a pointer register PN11. The first hole part program P1 is composed of pointer registers P10, PN11 - PNln and records R11 - R1a. The first pointer of pointer register PNlj (j = 1, 2, ...) designates the first address Dlj (or record number) of record Rlj. The second pointer of pointer register PNlj designates the address of the pointer register corresponding to the record of the next machining process. Accordingly, in the example of Fig. 4, the first part program P1 commands that the tools be changed in the sequence T11, T12, . . . . . T1a to cut a hole by the first through a-th machining processes. Operation is similar for the second, third ... m-th part programs. (2) When creation of the part programs for the holes of different shapes is completed, the tool most commonly used in these part programs is obtained. Let M be the total number of part programs. If there is a tool used commonly in all M part programs, this is the tool obtained. If a tool used commonly in all M past programs does not exist, a tool used in (M-1) of the part programs is the tool looked for. The tool having the highest frequency of common use is thus determined. (3) Next, each part program which includes the found common tool T1c as a tool used is separated at the common tool into an anterior part program section and a posterior part program section. (4) The following tool selection sequence is adopted: tool group used in the anterior part program section → common tool T1c → tool group used in the posterior part program section. For example, if there are two part programs and the tool selection sequences of the respective part programs are T11, T12, T13, ... T1i, T1c, T1(i+1), ... T1n T21, T22, T23, ... T2i, T1c, T2(i+1), ... T2m then T1c is the common tool, T11 - T1i, T21 - T2j are the groups of tools used in the anterior part program sections, and T1(i+1) - T1n, T2(j+1) - T2m are the groups of tools used in the posterior part program sections. (5) Thereafter, a tool selection sequence for the tool groups used in the anterior part program sections is decided by repeating steps (2) through (4) until tools common to the anterior part program sections no longer exist. (6) Next, a tool selection sequence for the tool groups used in the posterior part program sections is decided by repeating steps (2) through (4) until tools common to the posterior part program sections no longer exist. Thus, a tool use sequence for tools contained in all of the part programs having the tool T1c as a common tool is decided. It should be noted that this tool use sequence does not disrupt the tool use sequence for each hole specified by the respective part program. (7) When a tool use sequence has been decided in the above manner, a combined part program is created by rearranging the records Rij (Fig. 4) in the tool use sequence decided. It should be noted that the rearranging of the records is performed by rearranging the sequence of the pointer registers storing pointers indicating the starting positions (or record numbers) of the records, without altering the storage location of each record. (8) Next, it is checked whether part programs exist that do not possess the common tool T1c as a tool to be used. If such a part program exists, processing from step (2) onward is repeated by using this part program (not limited to a single part program) and the combined part program. (9) If a part program not having the common tool T1c as the tool used does not exist, then processing for automatically deciding the tool use sequence ends, after which the NC program for drilling holes is created by using the combined part program and hole position data. As shown in Fig. 5, the final combined part program is a continuous row of the records Ri (i = 1, 2, ...), which specify the respective hole machining processes, arranged in order of tool use. The order of the machining processes (records) in the row is specified by the second pointer of the pointer registers PNi. Thus, processing for creating a hole drilling NC program may be classified broadly into the following steps: (A) a step of creating a part program for every hole of a different shape; (B) a step of automatically deciding a tool use sequence for tools used in machining all holes; and (C) a step of creating an NC program for drilling holes in accordance with the tool use sequence. Each part program and the combined part program shown in Figs. 4 and 5 are stored in the floppy FD2 or RAM 11c upon completion of processing for creating the hole drilling NC program. Let us now describe the present invention in detail with reference to Fig. 1. Assume that the tool use sequences of the first, second and third part programs P1, P2 and P3 are respectively as follows [see Fig. 1(A)]: P1: A, B, C, D, E P2: A, F, C, G, E P3: H, I, C, J, K Since the tool "C" is used in all of the part programs P1 - P3, the tool C is determined by the processing of the second step described above. As a result, in step 3, the anterior part program sections P11, P21, P31 are respectively as follows: P11: A, B P21: A, F P31: H, I and the posterior part program sections P21, P22, P32 are respectively as follows: P21: D, E P22: G, E P32: J, K Further, the tool selection sequence is as follows, in accordance with the fourth step [see Fig. 1(B)]: [A, B: A, F: H, I] → C → [D, E: G, E: J, K] When processing from the second step onward is performed for the anterior part program sections in accordance with the fifth step, the tool A is found to be the tool whose common use is most frequent. Accordingly, the tool selection sequence for the anterior part program sections P11, P21 is as follows [Fig. 1(C)]: A → B → F (or A → F → B) Since the combined tool selection sequence (A --> B → F) of the anterior part program sections P11, P21 and the anterior part program section P31 do not have a tool in common, the final tool use sequence for all of anterior part program sections is as follows [Fig. 1(D)): A → B → F → H → I (or H → I → A → B → F) Similarly, the tool selection sequence for the posterior part program sections is as follows [Figs. 1(E), (F)]: D → G → E → J → K (or J → K → D → G → E) The tool selection sequence for machining all of the holes is as follows: A → B → F → H → I → C → D → G → E → J → K Thus, tools are changed ten times. A total of 14 tool changes is required in the conventional method. There are cases where it is desired to revise the hole drilling NC program created through the above-described method. For example, there are cases where a programming error is discovered by tape check processing performed after the program has been created, or where it is desired to read out and partially revise an already created hole drilling NC program in order to create a new hole drilling NC program. Such revision processing will now be, described in accordance with the flowchart of Fig. 6. (1) A part program Pi (see Fig. 4) is designated through a conversational method, the contents of a desired record Rij are modified, the desired record is deleted or a new record is added. (2) When revision processing ends, a check is made of whether the revision affects the tool use sequence. A change in the type of tool used, addition of a new tool (addition of a new record) and deletion of a tool (deletion of a record) are revisions which affect the tool use sequence, while revisions of feed rate, spindle rotating speed, hole depth, hole position and the like have no influence upon the tool use sequence. (3) If a revision affects the tool use sequence, a new hole drilling NC program is created by performing steps (2) to (9) of the above hole part program creation processing, namely the processing for automatically deciding tool use sequence, creating a hole drilling NC program, etc., using all the part programs including the revised part program. (4) If the revision has no effect on the tool sequence, a new hole drilling NC program conforming to the revision is created without again determining the tool use sequence. In other words, a new hole drilling NC program is created using the combined part program of Fig. 5 in which the contents of a desired record are revised. Thus, by means of the present invention, the number of tool changes can be reduced to shorten machining time. In addition, since a hole part program is created by rearranging pointers, which designate the storage locations of respective records, in the tool selection sequence, it is easy to modify the tool use sequence. If a created hole drilling program has been revised, it is determined whether the revision is one which influences the tool use sequence. If it is, a new hole drilling NC program is created by redetermining the tool use sequence using the revised part program. If it is not, a new hole drilling NC program is created without redetermining the tool use sequence. This makes it possible to minimise the number of times tools are changed, and to perform revision processing not affecting the tool use sequence, in a short period of time.

Claims: A method of automatically creating a hole drilling program in an automatic programming apparatus, comprising steps of:- (a) Creating a part program (P₁, P₂, ...) for every hole of a different shape, each part program comprising records (R₁₁, R₁₂, ..., R₂₁, R₂₂, ...) arranged in a machining process sequence each specifying at least a tool (A, B, C, ...) to be used and a machining depth; (b) Deciding a tool use sequence that brings a number of tool changes close to a minimum value; (c) Creating a combined part program comprising said records arranged in said decided tool use sequence; and (d) Creating a hole drilling NC program using said combined part program; characterised in that step (b) comprises:- (i) Identifying that common tool (e.g. C), i.e. a tool specified by more than one part program, specified in common by the greatest number of part programs; (ii) Separating each part program (P₁, P₂, ...) which specifies said common tool into an anterior part program section (P₁₁, P₂₁, ...) before the record specifying said common tool, and a posterior part program section (P₁₂, P₂₂, ...) following that record, and defining the following tool selection sequence: tools specified in the anterior part program sections, said common tool, tools specified in the posterior part program sections; and (iii) Repeating steps (i) and (ii) for the anterior part program sections (P₁₁, P₁₂, ...), i.e. identifying that common tool specified in common by the greatest number of anterior part program sections and defining a tool selection sequence for the anterior part program sections and also for the posterior part program sections (P₂₁, P₂₂, ...), until all common tools are accounted for, and deciding said tool use sequence as a combination of the tool selection sequences defined in step (ii); whereby in said tool use sequence, the order of tool-use defined by each part program is maintained. A method according to claim 1, wherein if a part program exists which does not include the most-commonly specified tool identified in step (i), step (iii) is carried out for that part program in addition to said anterior and posterior part program sections (P₁₁, P₁₂, ..., P₂₁, P₂₂, ...). A method according to claim 1 or 2, wherein the records (R₁₁, R₁₂, ..., R₂₁, R₂₂, ...) of the part programs are stored in a memory, and wherein step (c) is performed by rearranging pointers (PN₁, PN₂, ...) designating storage locations of respective records. A method according to claim 3, wherein said rearranging of the pointers (PN₁, PN₂, ...) designating the locations of the records (R₁₁, R₁₂, ..., R₂₁, R₂₂, ...) is performed by using a set of further pointers. A method according to any preceding claim, further comprising steps of:- (e) Revising a record (R ij ) in a desired part program (P i ); (f) Determining whether said revision affects the tool use sequence; (g) Creating a new hole drilling program by repeating step (b) using the revised part program (P i ), if the revision does affect the tool use sequence; and (h) Creating a new hole drilling program without repeating step (b) if the revision does not affect the tool use sequence. A method according to claim 5, wherein in step (f), if a modification of a tool, addition of a tool or deletion of a tool is present in the revised record (R ij ), it is determined that the revision affects the tool use sequence.

Inventors: ONISHI, YASUSHI, TANAKA, KUNIO
Applicants: FANUC LTD.
Application year: 1986
Main classification: G05B19
IPC codes: G05B19