METHOD OF CALCULATING AXIAL DIRECTION OF TOOL

Abstract: A method of calculating the axial direction of a tool, wherein the direction of the tool axis is determined during side cutting on a numerically controlled five-axis machine. A normal vector (Ri) is obtained at a split point (Pi) on the top surface of a free curved surface (2), and another normal vector (Si) at a split point (Qi) on the botton surface (5). Subsequently, intermediate vectors (Ni) having a magnitude equal to the radius of the tool is obtained in a direction between the normal lines (Ri) and (Si). Offset points (Xi, Yi) are obtained from the intermediate vectors (Ni), and a vector (Zi) interconnecting the offset points (Xi, Yi) is obtained to indicate the direction of the tool axis. The tool axis is oriented close to a generating line in this manner so that a nearly desired free curved surface can be obtained by side cutting.

Description: The present invention relates to a tool axis direction calculation method used in an automatic programming apparatus for creating NC data (machining program) for cutting a sculptured surface of a metal mold, and more specifically, to a tool axis direction calculation method of determining a direction vector of a tool axis in a side cut carried out by a 5-axes numerically controlled machine tool. BACKGROUND ART Automatic programming apparatuses for creating NC data for cutting a sculptured surface of a metal mold are provided with software for creating various NC data, and this software can simultaneously determine offset data for a tool. Also, 5-axes numerically controlled machine tools having B- and C-axes for inclining a tool axis in addition to the usual X-, Y- and Z-axes, are available and can cut a side of a workpiece by using a flat end mill. When making this side cut, a direction vector of a tool axis is generally determined, see e.g. JP-A-60 118 451, by the following calculation method; (a) determining dividing points corresponding to the upper and lower surfaces of a curved surface to be cut; (b) determining respective normal vectors at these dividing points; (c) determining points obtained by offsetting the radius of a tool to the directions of the respective normal vectors; and (d) creating a vector by connecting these points and using the thus created vector as the direction vector of the tool axis. Nevertheless, this method has the following drawbacks. First, the direction of the normal vector of the upper surface of a curved surface to be cut does not always coincide with the direction of the normal vector of the lower surface thereof, and thus the direction vector of a tool axis may not be parallel to the generating line of the curved surface and may be twisted. Second, the tool axis may not be on the line segment (generating line of the curved surface) obtained by connecting the points corresponding to the upper and lower surfaces, respectively, of the curved surface to be cut. More specifically, the tool axis is on the generating line only when the normal vector of the upper surface is equal to the normal vector of the lower surface. As a result, a sculptured to be determined is different from an actual machined surface, i.e., a workpiece is bitten or partially not cut. DISCLOSURE OF THE INVENTION Taking the above into consideration, an object of the present invention is to provide a tool axis direction calculation method of determining the direction vector of a tool axis by which a machining surface can be made closer to a generating line. To attain the above object, according to the present invention, there is provided a tool axis direction calculation method of determining a direction vector of the tool axis when a side is cut by a 5-axes numerically controlled machine tool, which comprises the steps of determining a first normal vector at a first dividing point of the upper surface of a curved surface, determining a second normal vector at a second dividing point of the lower surface of said curved surface, determining an intermediate vector having a direction between said first normal vector and said second normal vector and a size equal to the radius of a tool, determining a first offset point from said first dividing point and said intermediate vector, determining a second offset point from said second dividing point and said intermediate vector, and determining a vector connecting said first offset point and said second offset point as said direction vector of said tool axis. When a normal vector of an upper surface is different from a normal vector of a lower surface, the direction vector of a tool axis does not coincide with a generating line. Therefore, an intermediate vector located between the normal vector of the upper surface and the normal vector of the lower surface is determined, and the direction vector of the tool axis is determined from the intermediate vector, whereby a direction vector of the tool axis is determined by which a machining surface can be made closer to a generating line. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a diagram showing an example of a workpiece having a sculptured surface, for explaining a tool axis direction calculation method according to the present invention; Figure 2 is a flowchart of the processing effected by the tool axis direction calculation method according to the present invention; and Figure 3 shows a block diagram of hardware of an automatic programming apparatus embodying the present invention. BEST MODE OF CARRYING OUT THE INVENTION An embodiment of the present invention will be described below with reference to the drawings. Figure 1 is a diagram showing an example of a workpiece having a sculptured surface, for explaining a tool axis direction calculation method according to the present invention, wherein a workpiece 1 has a sculptured surface 2, a curved line 4 formed by an upper surface 3 and the sculptured surface 2, and a curved line 6 formed by a lower surface 5 and the sculptured surface 2. Here, the direction vector of a tool axis need only be parallel with the generating line Li formed on the sculptured surface made by connecting an i-th dividing point Pi on the curved line 4 and an i-th dividing point Qi on the curved line 6. Note that a normal vector Ri is determined as the outer product of a tangent vector TPi and the generating line Li. A normal vector Si is also determined as the outer product of a tangent vector TQi and the generating line Li. In general, however, the direction of the normal vector Ri at the dividing point Pi does not coincide with the direction of the normal vector Si at the dividing point Qi. Therefore, even if a tool axis vector is created from the normal vectors Ri and Si, the direction vector of a tool axis parallel to the generating line Li cannot be obtained. To cope with this problem, according to the present invention, an intermediate vector Ni located between the normal vector Ri and the normal vector Si is determined. Namely, a point obtained by extending an intermediate vector Ni from the dividing point Pi is assumed to be an offset point Xi, and a point obtained by extending an intermediate vector Ni from the dividing point Qi is assumed to be an offset point Yi. A vector obtained by connecting the offset point Xi and offset point Yi is assumed to be Zi, which is used as the direction vector of the tool axis. Accordingly, a direction vector more parallel to the generating line Li can be obtained. A first method of determining the intermediate vector Ni is to obtain the arithmetic mean of the normal vector Ri and normal vector Si. Further, as a second method, the intermediate vector Ni can be obtained by the following formula, Ni = (1 - k) Ri + kSi where k is a distribution ratio previously given as a parameter and 0 ≦ k ≦ 1. When the distribution ratio k is smaller, the intermediate vector approaches the normal vector Ri, and as the distribution ratio k becomes larger, the intermediate vector approaches the normal vector Si. The distribution ratio k is set as the parameter by a user, by determining which normal vector is preferably located closest to the intermediate vector. When the distribution ratio k is not set, an arithmetic mean is used. Data constituting the sculptured surface 2 can be obtained by processing a language created by an automatic programming, or by data input through an interactive mode with a curved surface creation module or the like. Therefore, the calculation for determining the direction vector of the tool axis according to the present invention is processed by a prepost processor. The thus-obtained result is supplied to a post processor to create a final NC data, i.e., a machining program composed of an NC language. Figure 2 is a flowchart of the processing effected by the tool axis direction calculation method according to the present invention, wherein numerals prefixed with an "S" indicate the numbers of steps of the process and these steps are processed by the processor of an automatic programming apparatus to be described later: [S1] the i-th dividing point Pi on the upper surface 3 is input; [S2] the i-th dividing point Qi on the lower surface 5 is input; note that the data input at steps S1 and S2 is processed by the curved surface creation module; [S3] the normal vector Ri at the dividing point Pi is determined to be the outer product of the tangent vector TPi and the generating line Li; [S4] the normal vector Si at the dividing point Qi is determined to be the outer product of the tangent vector TQi and the generating line Li; [S5] it is determined whether or not the distribution ratio k is input, and when input, the process goes to step S7, and when not input, the process goes to step S6; [S6] since the distribution ratio k is not input, the arithmetic mean of the normal vectors Ri and Si is determined as the intermediate vector Ni; [S7] since the distribution ratio k is input, the intermediate vector Ni is determined by using the aforesaid formula Ni = (1 - k) Ri + kSi ; [S8] the intermediate vector Ni is normalized by being divided by an absolute value; [S9] the offset point Xi is determined from the dividing point Pi and intermediate vector Ni; [S10] the offset point Yi is determined from the dividing point Qi and intermediate vector Ni; and [S11] the direction vector of the tool axis Zi is determined by determining the vector Zi connecting the offset points Xi and Yi and further normalizing the vector Zi. As a result, even if the normal vector of the upper surface does not coincide with the normal vector of the lower surface, a curved surface closer to a sculptured surface can be machined by determining the direction vector of the tool axis as described above. Figure 3 shows a block diagram of hardware of an automatic programming apparatus embodying the present invention, wherein a processor 21 controls the automatic programming apparatus as a whole. A system program is stored in a ROM 22 and the processor 21 determines the aforesaid direction vector Zi of the tool axis in accordance with the system program. Intermediate data necessary for determining the direction vector Zi of the tool axis is stored in a RAM 23. A non-volatile memory 24 stores parameters such as the distribution ratio k and the like, which must be maintained operative even after a power supply is cut off, and thus is supplied with a back-up power source such as a battery. A display control circuit 25 converts the data stored in the RAM 23 to a display signal, which is supplied to a display unit 26 and displayed thereat. A CRT, liquid crystal display or the like is used as the display unit. A keyboard 27 is composed of software keys, function keys having predetermined functions, and operation keys composed of numeric keys and alphabet keys. A floppy disk drive 28 sequentially writes created NC data (machining program) to a floppy disk 28a. Further, the created NC data may be printed-out to an externally connected printer or the like through an interface 29. These elements are interconnected to a bus 30, respectively. As described above, according to the present invention, since an intermediate vector is determined from a normal vector of an upper surface and a normal vector of a lower surface, and the direction vector of a tool axis is determined from the intermediate vector, even if the direction of the normal vector of the upper surface is different from the direction of the normal vector of the lower surface, a direction vector of the tool axis closest to a generating line can be obtained, and as a result, a side cut closest to a desired sculptured surface can be carried out.

Claims: A tool axis direction calculation method of determining the direction vector of a tool axis when a curved surface (2) of a side of a workpiece is cut by a tool of a 5-axes numerically controlled machine tool, comprising the steps of: determining a first normal vector (Ri) at a first dividing point (Pi) of the upper surface (3) of said curved surface (2); determining a second normal vector (Si) at a second dividing point (Qi) of the lower surface (5) of said curved surface (2); characterized by determining an intermediate vector (Ni) having a direction between said first normal vector (Ri) and said second normal vector (Si) and a size equal to the radius of said tool; determining a first offset point (Xi) from said first dividing point (Pi) and said intermediate vector (Ni); determining a second offset point (Yi) from said second dividing point (Qi) and said intermediate vector (Ni); and determining a vector (Zi) connecting said first offset point (Xi) and said second offset point (Yi) as said direction vector of said tool axis. A tool axis direction calculation method according to claim 1, wherein said intermediate vector (Ni) is determined as the arithmetic mean of said first normal vector (Ri) and said second normal vector (Si). A tool axis direction calculation method according to claim 1, wherein said intermediate vector is determined by a formula Ni = (1 - k) Ri + kSi where Ni is an intermediate vector, k is a distribution ratio previously given as a parameter, Ri is a first normal vector, and Si is a second normal vector.

Inventors: HANAOKA OSAMU FANUC MANSION HA, SEKI MASAKI, HANAOKA, OSAMU, FANUC MANSION HARIMOMI 9-304, SEKI, MASAKI
Applicants: FANUC LTD, FANUC LTD.
Application year: 1991
Main classification: G05B19
IPC codes: G05B19, B23Q15