The present invention relates to a tool radius compensation method for a numerically controlled apparatus, and more particularly to a tool radius compensation method for a numerically controlled apparatus which is suitable for use in cutting a workpiece while offsetting a tool in a direction normal to a three-dimensional surface of the workpiece.
Numerically controlled (NC) apparatus usually have a tool radius compensation function. The tool radius compensation function corrects a cutting error due to a tool radius by defining as the passage of movement of a tool center a path that is displaced a distance equal to the tool radius rightward or leftward from a programmed path specified by numerical control information. With such a tool radius compensation method, however, the tool cuts into a corner formed between straight lines or a straight line and an arcuate line if it were not for preventive measures. There have heretofore been proposed various measures for moving the tool along corners to effect accurate tool radius compensation.
Assuming that there are two programmed paths defined along straight lines L.sub.1 and L.sub.2 extending at an angle .alpha. ranging from 90.degree. to 180.degree. as shown in FIG. 1, the process of tool radius compensation is carried out as follows. A movement command for a current block b.sub.1 and a movement command for a next block b.sub.2 are read in advance, and straight lines L.sub.1 ' and L.sub.2 ', which are offset by a tool radius r.sub.1 from the straight lines L.sub.1 and L.sub.2, respectively, are determined for the current and next blocks b.sub.1 and b.sub.2. The coordinates of a point S.sub.1 where the straight lines L.sub.1 ' and L.sub.2 ' intersect, as in FIG. 1(a), are then computed. By moving the tool from a final point S.sub.0 in a previous block to the point S.sub.1 through pulse distribution, the center of the tool follows a passage that is offset a distance equal to the radius r from the properly commanded programmed path for thereby cutting the workpiece in accordance with the command.
Where the angle .alpha. is 90.degree. or smaller, movement commands for the current and next blocks b.sub.1 and b.sub.2 are read beforehand, and straight lines L.sub.1 ' and L.sub.2 ' that are offset by a tool radius from straight lines L.sub.1 and are formed L.sub.2. Then, the coordinates of a point S.sub.1 where the straight lines L.sub.1 ' and L.sub.2 intersect, and the coordinates of a point S.sub.1 ' where the straight lines L.sub.1 and L.sub.2 ' intersect, as in FIG. 1(b), are computed. The workpiece can be cut to the command by moving the tool from a final point S.sub.0 in a previous block to the point S.sub.1, then from the point S.sub.1 to the point S.sub.1 ', and finally from the point S.sub.1 ' to a final point S.sub.2 in the block b.sub.2. FIG. 1(c) is illustrative of an example in which a straight line and an arcuate line which are to be cut are joined abruptly.
Where NC systems have such a tool compensation function, programming is quite simple as it is not necessary to take into account the tool radius in preparing an NC data tape. When the tool radius varies due to wear or use of a different tool, the workpiece can be cut correctly by using a tool radius setting dial on an NC system panel to make a tool radius setting, or supplying a tool radius input through a MDI (manual data input) terminal.
The foregoing illustrates an application in which the cutting of a corner in a two-dimensional plane is prevented by the tool radius compensation function. The same problem (the problem of cutting a corner) is caused when cutting a three-dimensional shape with a tool drive by a simultaneous triaxial drive system. FIG. 2 is a diagram explanatory of such a problem. Designated therein at P.sub.1, Pc and P.sub.2 are commanded points to be cut on a programmed path, P.sub.1 ' and Ps are positions which are offset respectively from the starting point P.sub.1 and the ending point Pc on a first surface SF.sub.1 to be cut (P.sub.1 P.sub.1 ', PcPs indicate offset vectors), and Pe and P.sub.2 ' are positions which are offset respectively from the starting point Pc and the ending point P.sub.2 on a second surface SF.sub.2 to be cut (PcPe, P.sub.2 P.sub.2 ' indicate offset vectors). When the center of a tool as shown in FIG. 3(a) or (b) is moved along a path P.sub.1 'Ps to cut the first surface SF.sub.1, and then the tool center is moved along a path PsP2" without effecting tool position compensation at the corner, the tool cuts into the corner and fails to cut the workpiece correctly. To prevent this, the tool position needs to be corrected at the corner after the first surface SF.sub.1 has been cut. One method of carrying out such tool position correction comprises the steps of finding the offset vector PcPe at the starting point on the second surface SF.sub.2, then moving the tool center from the point Ps to the point Pe along an arc PsPe which has the starting point Ps, the ending point Pe, and a radius of curvature equal to a tool radius r, and which lies on a plane formed by the offset vectors PcPs and PcPe of the first and second surfaces SF.sub.1 and SF.sub.2, and subsequently moving the tool center along an interval PeP.sub.2 '. This method could prevent the tool from cutting into the corner, but would leave a cutter mark on the corner since the paths P.sub.1'Ps and PeP.sub.2 ' of movement of the tool center and the arc PsPe would not be joined smoothly.