1. Field of the Invention
The present invention relates to a numerical controller having a function of animation plotting a tool path.
2. Description of Related Art
In a numerical controller having an animation plotting function, a tool path is drawn by the animation plotting by performing graphics processing on all motion commands given by an NC program. Even when blocks containing commands giving minute motions are in succession, graphics processing is performed on each of these motion commands for the animation plotting.
In the animation plotting, graphics processing required for displaying a tool path takes time. Even when blocks containing minute motion commands are in succession, the animation plotting is performed in the manner that graphics processing is performed for each of the motion commands. Hence, there is a problem that the animation plotting takes time.
Meanwhile, in a display such as a CRT display or a liquid crystal display on which the animation plotting is displayed, the minimum unit of display is determined by a dot. Hence, when a minute motion amount given by a command in a block of an NC program is smaller than the minimum display unit, namely one dot, even if graphics processing is performed on this command for drawing the tool path, an image drawn based on this command comes on what was drawn based on a command in the preceding block, and no new image is displayed. Hence, graphics processing on the command in the present block is a waste.
The invention provides a numerical controller capable of shortening the time taken for animation plotting a tool path of an NC program including minute motion commands.
According to one aspect of the invention, the numerical controller comprises: means for successively reading motion commands from the NC program and successively obtaining motion amounts by the motion commands; and means for performing animation plotting each time when an accumulated value of commanded motion distances from a position where the animation plotting is last performed reaches a predetermined value.
According to another aspect of the invention, the numerical controller comprises: means for successively reading motion commands from the NC program and successively obtaining motion amounts by the motion commands; means for obtaining and storing an accumulated value of commanded motion distances from a position where the animation plotting is last performed by accumulating the motion amounts; means for determining whether or not the accumulated value of the commanded motion distances reaches a predetermined value; and means for performing the animation plotting to draw a tool path and clearing the accumulated value when it is determined that the accumulated value reaches the predetermined value. The predetermined value may be set by a parameter or a command in the NC program.
When minute motion commands are in succession, there can be such cases that, because of the minimum unit of display, even if an image is drawn based on the present command, it is indistinguishable from what was drawn before. In such cases, it is a waste to draw the tool path based on the present command. Thus, the animation plotting is not performed based on the present command, and hence graphics processing on the present command is omitted. Since the graphics processing on such commands can be omitted, the time taken for the animation plotting can be shortened.
Each of the axis control circuits 15 controls a servomotor 20 for its associated feed axis of a machine tool to be controlled by the numerical controller 10. Specifically, the axis control circuits 15 are servo control circuits each feedback-controlling the position, speed, current, etc. for its associated servomotor 20. The spindle control circuit 16 drive-controls a spindle motor 21 of the machine tool. The interface 17 connects an external storage medium to the numerical controller. Through the interface 17, NC programs etc. are entered from the external storage medium.
The above-described structure of the numerical controller 10 does not differ from the structure of numerical controllers conventionally known. Only, in the present embodiment, software for animation plotting a tool path given by NC programs is stored in the memory 12.
First, one block is read from the NC program (Step S1) and it is determined whether or not a command in the block is a motion command (Step S2). If the command is not a motion command, it is then determined whether or not the command is a program end command (Step S7). If not, the procedure returns to Step S1 and the next block is read. If the command is a motion command, a motion amount is obtained from the motion command, and the obtained motion amount is added to a register storing an accumulated value of commanded motion distances from a position where the plotting is performed last time, to update the accumulated value of the commanded motion distances (Step S3). Then it is determined whether or not the accumulated value stored in the resistor is less than a predetermined value (Step S4). The predetermined value is set through the manual data input device 14 as a parameter. Alternatively, the predetermined value may be set by a command programmed in the NC program.
If it is determined in Step S4 that the accumulated value stored in the resister is the predetermined value or greater, the register is cleared (Step S5), and a tool position commanded in the present block is plotted to draw a tool path up to the present position of the tool as animation (Step S6). Then, the procedure returns to Step S1.
In the case where blocks containing commands giving minute motions smaller than a predetermined distance in succession and it is determined in Step S4 that the accumulated value of the commanded motion distances from the last plotted tool position obtained in Step S3 has not reached the predetermined value, the procedure returns to Step S1 without performing Steps S5 and S6, so that no image is drawn. When the accumulated value stored in the resistor becomes the predetermined value or greater, the processing of Steps S5 and S6 is performed so that the tool path up to the commanded position is drawn.
As stated above, when minute motion commands are in succession such that the accumulated value of the commanded motion distances from the last position of animation plotting does not reach the predetermined value, an image is not drawn, and therefore graphics processing is omitted. There are such cases that even if an image is drawn, it is indistinguishable from what was drawn before. In the case where the predetermined value is set to be a distance corresponding to one dot, namely the minimum display unit for the display 13, if the accumulated value from the last position of animation plotting has not reached the predetermined value, i.e. the distance corresponding to one dot, image drawing is not performed. In this case, even if the animation plotting is performed, the resulting image is same as the image drawn last time, because the distance to move is smaller than one dot. This is meaningless because no new part of a tool path is drawn. The present embodiment does not perform such meaningless image drawing, and omits the processing for this image drawing. By this, the time taken for the animation plotting is shortened.
It is to be noted that the predetermined value, by which whether or not the animation plotting should be performed is determined, may be set by an operator to be a desired value equal to or greater than the minimum unit of display, so that accuracy of tool-path drawing can be selected by the operator. The greater the predetermined value, the more roughly the tool path is displayed, and the smaller the reference distance, the more finely the tool path is drawn.
Number | Date | Country | Kind |
---|---|---|---|
349449/2003 | Oct 2003 | JP | national |