METHOD AND APPARATUS FOR CREATING NC PROGRAMS

Abstract: Disclosed are a method and apparatus for creating a numerical control program containing plural items of numer­ ical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program. The method includes transporting the movable machine element to a prescribed position on the basis of numerical control program data already created, selecting a teach mode, positioning the movable machine element manually at a newly taught position, and either modifying the numerical control program data based on the present position of the movable machine element, or inserting new numerical control data, by pressing a key corresponding to at least one of the address words X, Y, Z indicating axes of movement, followed by pressing a modification key, or by pressing the key corresponding to the address word followed by pressing a numerical data insertion key.

Description: METHOD AND APPARATUS FOR CREATING NC PROGRAMS This invention relates to a method and apparatus for creating numerical control (NC) programs. A known method of creating an NC program includes steps of placing an NC device in a playback mode (teach mode), transporting a movable machine element such as a table or tool to a desired position by a manual operation, keying in an address word X, Y or Z at said position for specifying an axis (the address word being a letter of the alphabet for specifying the nature of a numerical value which follows the address word), subsequently pressing an INSERT key for creating NC data XPx, YPy, ZPz using the present position (Px, Py, Pz) of the movable machine element, namely the position at which the element is located when the key is pressed, storing the NC data in an NC program (part program) storage area, and repeating the foregoing steps to create an NC program comprising plural items of NC data. While the foregoing method is convenient in view of the fact that programming is unnecessary, difficulties are encountered when modifying a portion of the created NC data or when adding new NC data. Furthermore, NC data created by the conventional method is primarily position command data. Accordingly, when it is desired to bore equidistantly spaced bolt holes at (n+l)-number of positions Ao, Al,..., An on a prescribed straight line Ln, as shown in Fig. 1, the operator must undertake the troublesome task of teaching each one of the positions Ao, Al,..., An. Even more work is required when the pattern shown in Fig. 1 is included in a single NC program at several locations, for the operator must then teach the aforementioned positions each time. The method adopted most widely for creating numerical control programs in recent numerical control systems relies upon a subprogram such as a user macro function. A user macro (also referred to as a custom macro) is a function, composed of a group of instructions, that is previously registered in memory just as a subprogram would be. The registered function is represented by a single instruction inserted in the NC program in advance, and the operation specified by the function is executed when the instruction, referred to as a macro call instruction, is eventually read from the numerical control program. The chief advantages of the user macro are (a) variables can be used in the macro, (b) arithmetic operations among the variables are possible, these being referred to as inter-variable calculations, and (c) the variables can be set to actual numerical values. Fig. 2 is an explantory view useful in describing the relation between an ordinary NC prqgram, indicated at numeral 1, and a user macro shown at numeral 2. It will be seen that a user macro call instruction has been inserted in the NC program at a suitable location. The instruction is given by: G65 P###... # +100... #101--- #102... #103... #104..., ... (1) The user macro 2 having the user macro identification ... . is programmed to have an instruction for forming bolt holes in a workpiece at (n+1-)-number of equidistantly spaced positions Ao, Al, A2,... An located on a straight line Ln connecting a starting point P (100, & um;101) and an end point Pe(#102, #103), as shown in Fig. 1, the number n+l being specified by a variable #104. An instruction M99 is inserted at the end of the user macro to effect the return to the NC program 1. When the user macro call instruction given by (1) shown above is read during the course of processing executed based on the NC program, the numerical control device calls the user macro 2 corresponding to the macro identification P D ... .= and executes processing for the machining of the bolt holes shown in Fig. 1 by setting the variables &num;100, #101, 102, &num;103, #104 in the user macro to values specified in the call instruction. After completing the machining processing, the NC device reads M99 and returns to processing based on the NC program 1. Thus, NC machining processing conforming to predetermined patterns can be executed by previously registering a number of user macros in a memory, and inserting the user macro call instruction G65 in the NC program, followed by the user macro identification and the values which specify the variables. The above-described user macro function is extremely useful because a machine tool can be made to perform operations tailored to the particular needs of the user, and because programming is simplified. As mentioned above, the conventional NC data creating method using a playback (teach) mode is basically confined to the creation of position command data, so that it has not been possible with this method to incorporate a pattern playback function, using the increasingly popular subprograms and user macros, in an NC program. Consequently, there is a limitation upon processing efficiency in the conventional method of creating an NC program using the playback (teach) mode. It is desirable to provide a method and apparatus for creating an NC program in which NC data can be modified simply and new NC data inserted in a playback (teach) mode, and in which a pattern playback function can be readily incorported in an NC program. An embodiment of the present invention can be made to provide a method and apparatus for creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program. The method includes transporting the movable machine element to a prescribed position on the basis of numerical control program data already created, selecting a teach mode, positioning the movable machine element manually at a newly taught position, and either modifying the numerical control program data based on the present position of the movable machine element, or inserting new numerial control data, by pressing a key corresponding to at least one of the address words X, Y, Z indicating axes of movement, followed by pressing a modification key, or by pressing the key corresponding to the address word followed by pressing a numerical data insertion key. Reference will now be made, by way of example, to the accompanying drawings, in which: Fig. 1 is a diagram of a pattern capable of being programmed by a subprogram or user macro; Fig. 2 is an explanatory view for describing the relationship between an ordinary NC program and a user macro; Fig. 3 is a block diagram illustrating an embodiment of an apparatus for creating an NC program according to the present invention; Fig. 4 is a view useful in describing an manual data input (MDI) unit; and Figs. 5 and 6 are views useful in describing the modification and addition of NC data according to the present invention. With reference to Fig. 3 illustrating an embodiment of the present invention, there is shown a central processor CPU for executing NC data creation processing, described later, when a mode selection switch on an operator's panel OPN is set to the playback (teach) mode. Jog feed buttons PJX, NJX, PJY, NJY are provided on the operator's pendant OPN for performing a jog-feed along the X axis in the positive and negative directions and along the Y axis in the positive and negative directions, respectively. Pressing a jog button in the playback mode causes a corresponding AND gate PGX, NGX, PGY, or NGY to open, so that pulses Ps generated by a pulse generator PGC are delivered as +X, -X, +Y, -Y manual feed pulses PX, NX, PY, Ny, respectively. The pulses PX, NX enter an adder CPX and a reversible counter RCX, and the pulses PY, NY enter an adder CPY and a reversible counter RCY. The adder CPX adds the pulses PX, NX and applies the resulting pulse train to an X-axis servo unit XSU for driving an X-axis motor XM. Likewise, the adder CPY adds the pulses P?, NY and applies the resulting pulse train to a Y-axis servo unit YSU for driving a Y-axis motor YM. Whenever the X- and Y-axis motors XM, YM rotate by a predetermined amount, corresponding pulse coders PCX, PCY issue a single feedback pulse PFX, PFY, respectively, these being fed back to the respective Xand Y-axis servo units XSU, YSU. Each servo unit controls the corresponding motor in such a manner that the difference between the number of pulses input thereto and the number of feedback pulses approaches zero. Concurrently, as described above, the manual pulses¯are applied to the reversible counters RCX, RCY, which serve as X- and Y-axis present position counters, respectively. Specifically, the +X and -X manual pulses PX, NX are applied to the upcount (+) and downcount (-) terminals, respectively, of the reversible counter RCX, and the +Y and -Y manual pulses P?, NY are applied to the upcount (+) and downcount (-) terminals, respectively, of the reversible counter RCY. The reversible counter RCX is counted up each time a +X manual pulse PX is generated, and is counted down each time a -X manual pulse NX is generated, so that the contents of the counter will always indicate the present position along the X axis. Likewise, the reversible counter RCY is counted up each time a +Y manual pulse PY is generated, and is counted down each time a -Y manual pulse NY is generated, so that the contents of the counter will always indicate the present position along the Y axis. Through the foregoing series of operations, a movable machine element is manually positioned at a desired position P1, the coordinates whereof are xl, y1. Following positioning, the operator goes to the manual data input unit MDI (Fig. 4) and presses the following keys in the order mentioned: "X", "INSRT", "Y", "INSRT" ";". The central processor CPU responds by using the present position (x1, Y1) stored in the reversible counters RCX, RCY, to create the NC data Xxl, Yyl, the latter then being stored in a part program memory PPM. The foregoing steps are repeated in like fashion to create items of NC data and store the NC data in the part program memory. After the movable machine element is positioned at a prescribed point, such as the point Ps in Fig. 1, a user macro call instruction is inserted for producing n-number of equidistantly spaced bolt holes on the straight line Ln. Specifically, using the manual data input unit MDI, the operator enters G65 Pa D ... , causing the CRT of the MDI unit to display the user macro variables indicated by the macro identification Pa ..-cz, and in addition, to display the particular pattern as shown in Fig. 4 whenevever necessary. Next, the operator selects the variable #100 for which a value is to be set, and presses the "X" key and then the "INPUT" key on the MDI unit, whereby the variable having variable number #100 is specified by the present position along the X axis. This is followed by selecting the variable number i101 and pressing the "y" key and then the "INPUT key to specify the variable having variable number i101 by the present position along the Y axis. Upon completing the foregoing steps, the movable machine element is manually positioned at the point Pe (Fig. 1). The operator then selects the variable number i102 for which a value is to be set, and presses the "X" key and then the "INPUT" key on the MDI unit, whereby the variable having variable number i102 is specified by the present position along the X axis. This is followed by selecting the variable number #103 and pressing the Y key and then the "INPUT" key to specify the variable having variable number µ102 by the present position along the Y axis. Finally, the operator selects the variable number #104 and enters a partitioning number n. This creates a user macro for playing back the pattern shown in Fig. 1, and stores the user macro in the part program memory PPM. Thus, unlike the conventional method which requires the teaching of n+l points, only two points and the partitioning number need be commanded according to the present invention, thereby facilitating the operator's task. The foregoing operations are repeated in the same manner to create and store the desired part program in the part program memory. Following the completion of the part program, an automatic running mode is selected by the mode changeover switch on the operator's panel OPN. This is followed by pressing a cycle start button, which will cause the central processor CPU to call instructions from the part program memory PPM one at a time and to execute numerical control processing based on these instructions. When an item of position command data is encountered in the data read out of the memory PPM, incremental values AX, AY are computed and applied to a pulse distributor PDC. The latter performs a pulse distribution computation based on ssX and AY, thereby producing distributed pulses XP, YP that are applied to the X- and Y-axis servo units XSU, YSU, respectively. (It should be noted that the lines for carrying these pulses from the pulse distributor to the servo units are not shown in the drawing.) The servo units XSU, YSU drive the motors XM, YM into rotation, thereby transporting the movable machine element, such as the table or tool. When the central processor CPU reads a user macro call instruction out of the part program memory PPM, the processor goes to a user macro memory UMM and reads out the user macro specified by the user macro identification in the user macro call instruction. The variable numbers #100 through #104 in the user macro are then replaced by the values indicated in the part program. NC processing thus is performed in accordance with the pattern shown in Fig. 1. The foregoing is an example wherein a user macro call instruction is inserted in an NC program in the playback (teach) mode. Described next will be the partial modification of an already created NC program, as well as the addition of new NC data to the program. We will assume that an NC program for transporting a movable machine element such as a tool along the pattern ABCDFA indicated by the solid line in Fig. 5, has been stored in the part program memory PPM of Fig. 3. The following steps are performed to modify this NC program into an NC program for transporting the tool along the patch ABCD'E'FA: First, the operator, using the operator's panel, places a single block switch (not shown) in the ON position and presses the cycle start button. This causes the element to come to rest each time one block of movement is completed under the control of the processor CPU. This is referred to as single-block operation. When the element stops, the operator presses the cycle start button again to initiate movement based on the next block of data. In this manner the movable machine element is moved along the solid-line path in Fig. 5 up to point C. After the element is positioned at the point C, the operator selects the teach mode by the the mode changeover switch and then proceeds to position the element at point D' by manual feed. As the foregoing steps are being performed, the NC program shown in Fig. 6(A) is displayed on the CRT of the manual data input unit MDI. The operator therefore positions a cursor at the portion (a) displayed on the CRT screen and presses keys "Y", "ALTER" in the order mentioned, these keys being located on the MDI unit. This causes the NC data at sequence number N50 to be altered from "X6.0 ?6.0;" to "X6.0 ?8.0;", as shown in Fig. 8(B). In other words, the commanded value along the Y axis is modified by replacing 6.0 with the Y-axis present position (Y coordinate) 8.0 stored in the reversible counter RCY. The operator then positions the machine element at the point E by the manual feed operation and brings the cursor to the portion (b) displayed on the CRT screen. Next, using the MDI unit, the operator keys in a sequence number, e.g, N55, and presses the "INSRT" key to enter sequence number. This is followed by pressing the keys "X", "INSRT" (insert), "Y", "INSRT", "EOP" (end of block) and "INSRTn in the order mentioned, using the MDI unit. As a result, new NC data "N55 X8.0 ?6.0;" is created using the present position, i.e., coordinates, (8.0, 6.0) of the point E', and the data is inserted between sequence numbers N50 and N60, as shown in Fig. 6(B). Next, the operator positions the cursor at (c), selects the automatic mode by means of the mode changeover switch, and presses the cycle start button. This will cause the old NC program shown in Fig. 6(A) to be modified into the new NC program data shown in Fig. 6(B). Since NC data can thus be partially modified and supplemented according to a feature of the present invention, it is no longer necessary to teach all of the points A, B, C, D', E' and F, as opposed to the prior art. In accordance with the present invention as described and illustrated hereinabove, an NC program can be partially modified and supplemented, and a pattern playback function can be inserted in the NC program. This makes it very simple to create an NC program in the playback or teach mode. As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims.

Claims: CLAIMS. 1. A method of creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program, comprising the steps of: transporting the movable machine element to a prescribed position on the basis of numerical control program data already created; selecting a teach mode; positioning the movable machine element manually at a newly taught position; and modifying the numerical control program data based on the present position of the movable machine element by pressing a key corresponding to at least one of address words X, Y, Z indicating axes of movement, followed by pressing a modification key. 2. The method according to claim 1, wherein the movable machine element is transported to said prescribed position by being moved one block at a time by a single-block operation based on the numerical control program data already created. 3. A method of creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program, comprising the steps of: transporting the movable machine element to a prescribed position on the basis of numerical control program data already created; selecting a teach mode; positioning the movable machine element manually at a newly taught position; and inserting new numerical control data by pressing a key corresponding to at least one of address words X, Y, Z indicating axes of movement, followed by pressing an insertion key. 4. The method according to claim 3, wherein the movable machine element is transported to said prescribed position by being moved one block at a time by a single-block operation based on the numerical control program data already created. 5. A method of creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program, comprising the steps of: : storing in memory one or more subprograms creating by using variables, and inserting in the numerical control program numerical control data for controlling the movable machine element on the basis of a prescribed subprogram and specific values, by entering an identification of said subprogram and specifying variables, which are used in said subprogram, by the present position of the movable machine element. 6. The method according to claim 5, further comprising steps of entering a variable number assigned to a variable and sequentially pressing a key corresponding to an address word and an input key, thereby specifying the variable of said variable number by the present position of the movable machine element along an axis indicated by the address word. 7. An apparatus for creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program, said apparatus comprising: : mode selection means for selecting a mode of a numerical control device; a key corresponding to at least one of address words X, Y, Z indicating axes of movement; a key for modifying numerical control data; means for transporting the movable machine element to a prescribed position on the basis of numerical control program data already created; means responsive to said mode selection means for selecting a teach mode; means for manually positioning the movable machine element at a newly taught position; and means for modifying the numerical control program data based on the present position of the movable machine element by pressing the key corresponding to said word address followed by pressing said modification key. 8. An apparatus for creating a numerical control program containing plural items of numerical control data, wherein the present position of a movable machine element is stored in memory, the movable machine element is transported to a desired position, an item of numerical control data is created based on the present position of the movable machine element, and the foregoing sequence is repeated to create plural items of numerical control data constituting the numerical control program, said apparatus comprising: : mode selection means for selecting a mode of a numerical control device; a key corresponding to at least one of address words X, Y, Z indicating axes of movement; a key for inserting numerical control data; means for transporting the movable machine element to a prescribed position on the basis of numerical control program data already created; means responsive to said mode selection means for selecting a teach mode; means for manually positioning the movable machine element at a newly taught position; and means for inserting new numerical control data by pressing pressing the key corresponding to said address word, followed by pressing said insertion key.

Inventors: NOBUYUKI, KIYA, NOZAWA, RYOICHIRO, YOSHINO, MOTOAKI
Applicants: FANUC LTD
Application year: 1983
Main classification: G05B19
IPC codes: G05B19, B23Q15