METHOD OF PREPARING NC PART PROGRAMS FOR LASER MACHINING

Abstract: Method of prepg. NC PERT programs for laser machining comprises input of graphics definition statements (11a) defining a shape and motion definition statemetns (11c) defining a laser beam path, conversion of these statements to an NC PERT program and prepn. of machining conditions change definition statements (11b) contg. data defining conditions change regions at corners and the machining conditions in these corner regions. The graphics and motion definition statements are prepd. disregarding the corner regions and machining conditions and when they are used to produce the NC PERT program each corner region is divided into two or more machining conditions change sections (11,12) and the machining conditions in each section are set by respective macros (12).

Description: This invention relates to a method of creating an NC part program for laser machining and, more particularly, to an NC part program creation method capable of improving machining precision at corners. In an automatic programming apparatus for creating NC data using an automatic programming language such as APT or FAPT, (a) a part program based on the automatic programming language is created by defining points, straight lines and circular arcs using simple symbols (this is referred to as "figure definition"), and then defining a tool path using the defined points, straight lines and circular arcs (referred to as "motion statement definition"), and (b) the part program based on the automatic programming language is subsequently converted, by using an NC data output table, into NC data comprising NC data (EIA codes or ISO codes) in a format capable of being executed by an NC unit. It should be noted that the tools used include, in addition to ordinary tools, the wire in a wire-cut electrical discharge machine, the laser beam in a laser processing machine, etc. For example, in the creation of a part program for moving a tool (laser beam) RB along a profile comprising straight lines and circular arcs shown in Fig. 9, figure definition is performed by defining a tool starting point P₁, cutting starting point P₂, straight lines S₁, S₂ and circular arc C₁ ... as follows: PART, @ REIDAI (1) MCHN, LASER, ABS (2) P₁ = x₁, y₁ P₂ = x₂, y₂ P₃ = x₃, y₃ S₁ = P₂, P₃ (3) C₁ = x₄, y₄, r₁ (4) P₅ = x₅, y₅ S₂ = P₅, C₁, B (5) Thereafter, by using these defined points, straight lines and circular arc, a motion statement is defined in automatic programming language, the motion statement being in line with the following and the tool path: CUTTER, 0.3 (6) S0800 (7) TLLFT (8) FROM, P₁ (9) RPD, TO, S₁, P₂ (10) FCOD, 500 (11) S₁ C₁ S₂ ..... FINI PEND When this is inputted to an automatic programming unit, the latter subsequently creates and outputs NC data having an EIA code or ISO code execution format automatically while referring to an NC data output table. In the foregoing, (1) instructs the start of the part program, with "REIDAI" being the header. (2) indicates the type of NC machine. "MILL" is used in case of milling, "TURN" in case of turning, "CUT" in case of a wire-cut electrical discharge machine, and "LASER" in case of laser machining. "ABS" indicates an absolute command. ("INCR" would be used for an incremental command.) (3) signifies a straight line passing through points P₂, P₃. (4) signifies a circular arc of center (x₄,y₄) and radius r₁. (5) signifies a lower tangent line (straight line) of two tangent lines passing through point P₅ and contacting the circular arc c₁. In the case of the upper tangent line, the alphabetic character A would be used instead of B. (6) represents a beam command which commands a beam diameter of 0.3 mm. (7) represents a command indicating that the laser power is 800 W. (8) is a command for offsetting the tool (laser beam) to the left of the direction of movement. ("TLRGT" would be used to offset the tool to the right of the direction of movement.) (9) is a coordinate system setting command which indicates that the starting point is P₁. (10) is a command for positioning the tool in such a manner that the tool will contact the straight line S₁ at point P₂ without passing this straight line. (11) is a velocity command indicating that the feed velocity is 500 mm/min. When a tool path includes a corner, the tool feed velocity in the vicinity of the corner generally cannot be held constant because of the characteristics of the machine, etc. For example, if an i-th block b i and an (i+1)th block b i+1 of the tool path intersect perpendicularly, as shown in Fig. 10, the tool feed velocity is as shown in Fig. 11. Thus, deceleration and acceleration are required when passing the corner portion. In other words, in the vicinity of the corner, the feed velocity along the X axis is reduced from the commanded velocity V c and attains a value of zero, after which the feed velocity V y along the Y axis is increased to reattain the commanded velocity V c . This deceleration and acceleration of feed at the corner portion has a deleterious effect upon the machining precision of the part. In particular, altering the feed velocity causes machining droop and has considerable influence upon machining precision in cases where a high machining velocity is required, as in laser machining. Accordingly, it is necessary that an NC part program be created in such a manner that the machining precision at the corner portion does not suffer. To this end, the conventional practice is to check whether or not it is necessary to alter machining conditions at a corner portion each time and create a figure definition statement and motion definition statement depending on whether or not alteration of machining conditions is necessary. However, creating an NC program in accordance with this conventional method is a major undertaking. Accordingly, in International Application PCT/JP87/00626 (international filing date: August 26, 1987), and corresponding application EP-A-0 282 599, which falls within the Article 54(3) field, the inventors proposed a novel method of creating an NC part program for laser machining. However, this international application does not give a detailed disclosure concerning a method of specifying machining condition modification intervals and machining conditions. An object of the present invention is to provide a method of simply creating an NC part program for laser machining in which machining precision at corner portions can be maintained. Another object of the present invention is to provide a method of creating an NC part program for laser machining in which a machining condition modification interval and machining conditions can be simply specified and revised. According to the present invention there is provided a method of creating an NC part program as defined in the attached claim 1. Thus, a machining condition modification definition statement is created, in an automatic programming language, specifying a machining condition modification interval at a corner portion of a part and machining conditions in this interval. A figure definition statement and a motion definition statement are created in accordance with part shape without taking the machining condition modification interval and machining conditions into consideration. When these definition statements are converted into an NC part program for laser machining executable by an NC unit, the corner portion of the part is divided into two or more machining condition modification intervals in accordance with the machining condition modification definition statement, and an NC part program for laser machining is created in such a manner that the set machining conditions will prevail in each of the intervals. Brief Description of the Drawings Fig. 1 is a view for describing the general features of the present invention, in which (a) is a view for describing a part program using an automatic programming language, and (b) is a view of a machined shape; Fig. 2 is a block diagram of an automatic programming apparatus for practicing the present invention; Fig. 3 is a view for describing an NC data output table; Fig. 4 is a view showing the correlation between function codes and NC data output formats; Fig. 5 is a flowchart of processing according to the invention; Fig. 6 is a view for describing a machining condition modification definition statement in a case where a corner is formed by two linear elements; Fig. 7 is a view for describing a machining condition modification definition statement in a case where a corner is a circular arc; Fig. 8 is a view for describing machining condition modification interval data relating to various corner shapes; Fig. 9 is a view for describing automatic programming according to the prior art; and Figs. 10 and 11 are views for describing a disadvantage of the prior-art method. Fig. 1 is a view for describing the general features of the present invention, in which (a) is a view for describing a part program using an automatic programming language, and (b) is a view of a machined shape. Numeral 11 denotes a part program, 11a a figure definition statement, 11b a machining condition modification definition statement, 11c a motion definition statement, 12 a macro, 13 a rectangular part comprising linear elements S1 - S4, RB a laser beam, CN a corner portion, and P the end point of an i-th block b i . An interval QP is a first machining condition modification interval, and an interval PR is a second machining condition modification interval. These intervals have respective lengths ℓ₁, ℓ₂ measured from the end point P. The machining conditions (laser beam feed velocity, laser power value, laser output method, etc.) at the corner portion CN [Fig. 1(b)] are specified by M-, S- and F-codes and the like and are registered in advance as the macro 12. A plurality of such macros are registered in accordance with the machining condition modification intervals and machining conditions. The machining condition modification definition statement 11b is generated. This statement includes the data (lengths ℓ₁, ℓ₂) specifying the machining condition modification intervals QP, PR at corner portion CN, and the name of the macro specifying the machining conditions in these intervals. This machining condition modification definition statement is inputted to an automatic programming apparatus together with the figure definition statement 11a and motion definition statement 11c, which are prepared without taking into consideration the machining condition modification intervals and the machining conditions in these intervals. In converting the definition statements created using automatic programming language into an NC part program executable by an NC unit, the automatic programming apparatus divides the corner portion CN into two or more machining condition modification intervals QP, PR by using the machining condition modification definition statement, and creates an NC part program in such a manner that the machining conditions set by the macro 12 will prevail in each of the intervals. More specifically, NC data are created for effecting movement at predetermined machining conditions (machining conditions specified by the motion definition statement) up to the point Q, NC data are created for effecting movement from point Q to point P at the machining conditions set by the macro 12, and NC data are similarly created for effecting movement from point P to point R at the machining conditions set by the macro 12. Fig. 2 is a block diagram of an automatic programming apparatus according to an embodiment of the present invention. Numeral 101 denotes a ROM storing a loading program and the like, 102 a processor for executing automatic programming processing, and 103 a RAM. The RAM 103 has a storage area 103a for storing a system program STPR read in from a floppy disc, a storage area 103b for storing an NC data output table, a storage area 103c for storing a correlation FNT between function codes and ND data output formats, a storage area 103d for storing various macros MCM, and a working area 103e. The NC data output table NCDT stored in the storage area 103b has a plurality of function codes F1 - F9 specifying NC data output formats for each command, as shown in Fig. 3. Each function code is expressed by four hexadecimal digits. NC data having one execution format are specified by a set of several of these function codes. Some correlations between function codes stored in storage area 103c and NC output formats are shown in Fig. 4. A coordinate system setting NC data output format in the NC data output table NCDT of Fig. 3 is 8502, 0001, 0101, 0201, 0004 Therefore, the NC data having the execution format for setting the coordinate system is G50X x Y y Z z EOB (a) This is obtained by referring to the correlations between function codes and output formats in Fig. 4. The NC data output format for positioning/linear cutting is The NC data having the execution format for positioning/linear cutting is G90(G91)G00(G01)X x Y y Z z F f EOB (b) This is obtained by referring to the correlations between function codes and output formats in Fig. 4. The NC data output format for circular arc cutting is The NC data having the execution format for circular arc cutting is G90(G91)G02(G02)X x Y y I i J j EOB (c) This is obtained by referring to the correlations between function codes and output formats in Fig. 4. Returning to Fig. 2, numeral 104 denotes an NC data memory for storing the NC data created, 105 a keyboard, 106 a display unit (CRT), 107 a disc controller, and FL a floppy disc. Fig. 5 is a flowchart of processing according to the present invention, Fig. 6 is a view for describing a machining condition modification definition statement in a case where a corner is formed by two linear elements, Fig. 7 is a view for describing a machining condition modification definition statement in a case where a corner is a circular arc, and Fig. 8 is a view for describing machining condition modification interval data relating to various corner shapes. Processing according to the present invention will now be described with reference to Figs. 1 through 8. It is assumed that the system program for creating an NC part program for laser machining, the NC data output table NCDT, the correlations FNT between the function codes and NC data output formats, and various macros specifying machining conditions have been stored in the storage areas 103a - 103d of the RAM 103 from the floppy disc FL. As shown in Fig. 1(a), macros are composed of a macro name MAC, machining conditions MCD and a macro end (MEND), and machining conditions are specified by an F-code indicating laser beam feed velocity, an S-code indicating laser beam power, and an M-code indicating laser output format (continuous or intermitten oscillation). A corner portion is divided into n-number of machining condition modification intervals. If the machining conditions in each interval differ, then a total of n sets of machining conditions are specified by one macro to correspond to each interval. If the machining conditions are the same in each interval, then only one set of machining conditions is specified by one macro. (1) First, the machining condition modification definition statement 11b (see Fig. 1) is created. This statement includes the data specifying the machining condition modification intervals at the corner portion, and the name of the macro specifying the machining conditions in these intervals. The figure definition statement 11a and motion definition state 11c are prepared without taking into consideration the machining condition modification intervals and the machining conditions, and these are inputted to the automatic programming apparatus. In response, the processor 201 performs the operation 1 → i. It should be noted that the machining condition modification definition statement 11b is composed of as shown in Fig. 1. Except for "CORN, COND, ON or OFF", the characters denote parameters, in which the machining condition modification intervals are specified by ℓ₁, ℓ₂, and corner shape conditions which determine whether machining conditions are to be modified are specified by a₁, a₂ and r₁. More specifically, if a corner portion is composed of two linear elements (see Fig. 6), machining condition modification intervals are specified by the distances ℓ₁, ℓ₂ from a point P at which offset paths intersect. If the corner portion is a circular arc (see Fig. 7), then machining condition modification intervals are specified by the distances ℓ₁, ℓ₂ from the starting point P₁ of the circular arc and the end point P₂ of the circular arc, respectively. Further, a maximum opening angle A MAX of the corner portion and a minimum opening angle A MIN of the corner portion are specified by a₁, a₂, respectively. If the corner angle A satisfies the relation A MIN <A<A MAX , then the machining conditions are modified in the machining condition modification intervals. The radius R s of the corner arc is specified by r₁. If the corner arc radius R satisfies the relation R<R s , the machining conditions are modified in the machining condition modification intervals. Machining condition modification processing for the corner portion is executed in response to "ON", and machining condition modification processing is not executed if "OFF" is in effect. (2) A check is performed to determine whether the i-th block is the final block. (3) If the i-th block is the final block, then processing for NC part program creation is terminated upon creating the i-th block of NC data. (4) If the i-th block is not the final block at step (2), then it is determined whether the (i+1)th block is a circular arc. (5) If this block is a circular arc, the corner radius R is calculated; if not, the program jumps to the tenth step. (6) When the radius R of the corner arc has been found, it is determined whether R<R s holds by using the arc radius R s contained in the machining condition modification definition statement 11b. (7) If R≧R s holds, the i-th block (straight line) and (i+1)th block (circular arc) of NC data are created without performing machining condition modification. The reason for not modifying the machining conditions when R≧R s holds is that there is little change in laser beam feed velocity at the corner and, hence, little appreciable influence upon machining precision. (8) If R<R s holds, however, three machining condition modification intervals QP₁, P₁P₂, P₂R (see Fig. 7) are obtained using ℓ₁, ℓ₂ contained in the machining condition modification definition statement 11b and NC data are created in such a manner that the machining conditions specified by the macro will prevail in each interval. More specifically, NC data are created for effecting movement at predetermined machining conditions (machining conditions specified by the motion definition statement) up to the point Q, NC data are created for effecting movement from point Q to point P₁ at first machining conditions designated by the macro, NC data are similarly created for effecting movement from point P₁ to point P₂ at second machining conditions designated by the macro, and NC data are created for effecting movement from point P₂ to point R at third machining conditions designated by the macro. If the machining conditions are the same in each of the intervals, it will suffice to specify one set of machining conditions by the macro. Therefore, the first through third machining conditions will be identical. (9) At the end of the processing for steps (7) and (8), i is incremented by the operation i+2 → i and then the processing from step (2) onward is repeated. (10) If the result of the determination made at the fourth step is that the (i+1)th block is a straight line, the angle A (see Fig. 6) at which the i-th block and (i+1)th block intersect is computed. (11) Next, it is determined whether A MIN ≦ A ≦ A MAX holds by using the maximum opening angle A MAX and minimum opening angle A MIN contained in the machining condition modification statement 11b. (12) If A MIN ≦ A ≦ A MAX does not hold, the i-th block of NC data is created without modifying the machining conditions. The reason for not modifying the machining conditions is that if the corner angle A is acute and fairly large, there is little change in velocity at the corner and, hence, little appreciable influence upon machining precision. (13) If A MIN ≦ A ≦ A MAX holds, however, machining condition modification intervals QP, PR (see Fig. 6) are obtained using ℓ₁, ℓ₂ contained in the machining condition modification definition statement 11b, and NC data are created in such a manner that the machining conditions specified by the macro will hold in each of the intervals. More specifically, NC data are created for effecting movement at predetermined machining conditions (machining conditions specified by the motion definition statement) up to the point Q, NC data are created for effecting movement from point Q to point P at first machining conditions designated by the macro, and NC data are created for effecting movement from point P to point R at second machining conditions designated by the macro. If the machining conditions are the same in each of the intervals, it will suffice to specify one set of machining conditions by the macro. Therefore, the first and second machining conditions will be identical. (14) At the end of the processing for steps (12) and (13), i is incremented by the operation i+1 → i and processing from step (2) onward is repeated. Though the distances ℓ₁, ℓ₂ are given as the distances from the point of intersection P between the offset paths in the case of Fig. 6, these can be given in the form of distances ℓ₁', ℓ₂' from an apex of the actual shape, as shown in Figs. 8(a), (c). In accordance with the present invention, machining condition modification intervals and machining conditions at a corner portion are specified in advance by a machining condition modification definition statement, whereby figure definition and motion definition can be performed without taking these machining condition modification intervals and machining conditions into consideration. As a result, programs using an automatic programming language can be simplified. In addition, since the arrangement is such that machining conditions are specified in the machining condition modification definition statement by a macro, machining conditions can be modified merely by altering the contents of the macro, and it is unnecessary to modify the body of the part program written in the automatic programming language. Furthermore, since it is so arranged that machining conditions are set by a macro, machining conditions based on the know-how of the user can be specified in such a manner that they will not become the knowledge of other parties.

Claims: A method of creating an NC part program for laser machining in which a figure definition statement for defining a shape to be machined and a motion definition statement for defining a laser beam path are inputted in an automatic programming language, and these definition statements are converted, by using an NC data output table, into a laser machining NC part program executable by an NC unit, which NC part program is then outputted, said method characterized by: creating a machining condition modification definition statement, in an automatic programming language, which includes data specifying machining condition modification intervals at a corner portion of a part and machining conditions in said intervals; creating a figure definition statement and a motion definition statement without taking the machining condition modification interval and machining conditions into consideration; dividing the corner portion into two or more machining condition modification intervals using said machining condition modification definition statement when a laser machining NC part program executable by the NC unit is created using the definition statements; and creating the laser machining NC part program in such a manner that machining conditions set by the machining condition modification definition statement will prevail in each of the intervals; wherein machining conditions are specified by a macro in each of the machining condition modification intervals in advance, and data specifying the machining conditions in said machining condition modification definition statement is a predetermined macro name. A method of creating an NC part program for laser machining according to claim 1, characterized in that said machining conditions are at least a feed velocity and a laser power value. A method of creating an NC part program for laser machining according to claim 1 or 2, characterized in that conditions regarding corner shape for modifying machining conditions are included in said machining condition modification definition statement in advance, and machining conditions at the corner portion are modified only when said corner shape conditions are satisfied. A method of creating an NC part program for laser machining according to claim 3, characterized in that said corner shape conditions are a maximum opening angle A MAX and a minimum opening angle A MIN of the corner portion, and by: determining an angle A at the corner portion of the beam path, and creating the NC part program in such a manner that the set machining conditions will prevail in said machining condition modification intervals when A MIN ≦ A ≦ A MAX holds. A method of creating an NC part program for laser machining according to claim 3, characterized in that said corner shape condition is a radius R s of a corner arc, and when an arc is present at the corner of the beam path, a radius R of said arc is determined, the NC part program being created in such a manner that said set machining conditions will prevail in said machining condition modification intervals when R ≦ R s holds.

Inventors: MATSUNAKA, TORU, SEKI, MASAKI, TAKEGAHARA, TAKASHI
Applicants: FANUC LTD.
Application year: 1987
Main classification: G05B19
IPC codes: B23K26, G05B19