PURPOSE: To stop an attachment spindle at a predetermined position after completion of machining, by comparing the rotating angle of the spindle memorized in a detector with the angular position of an attachment body so that the spindle is rotated until the attachment spindle comes to the predetermined position.
CONSTITUTION: When an instruction for stopping a spindle at a predetermined position after completion of machining, a timer 51 is actuated to rotate a spindle drive motor 13 at a low speed, and a comparator 52 compares the content in a memory 53 which memorizes, as an angular position of the spindle, the angular position of an attachment body just after rotary indexing, with data from an encoder 50 which detects the angular position of the spindle that indirectly indicates the rotary indexed angle of the attachment body. When both coincides together, a stopping instruction is issued to a spindle motor drive circuit 54 to stop an attachment spindle, a tool, etc. As a result, it is not necessary to change the program of travelling of a spindle head before and after the rotary indexing.
HASEGAWA HISAFUMI
NISHIDA YOSHIHIKO