PURPOSE: To rapidly return an origin through prevention of the occurrence of an obstacle by a method wherein when a rotation range is limited, an origin is returned after movement of a machine rotary axis to an intermediate point, and when the rotation range is not limited, return to an origin is effected after movement in a direction determined as an origin return direction without moving the machine rotary axis to the intermediate point.
CONSTITUTION: The memory content of a rotation range limit memory means is decided by an origin return selecting means and when it is stored that a rotation range is limited, return to an origin is effected by a second origin return means. Namely, return to an origin is effected after the machine rotary axis is moved over an absolute coordinate to the intermediate point. Thus, movement over the rotation range is not effected and abnormality is prevented from occurring to a machine. Further, when it is stored at a rotation range limit memory means that the rotation range is not limited, return to the origin is effected by a first origin returning means. Namely, return to the origin is effected through movement in a direction determined as an origin return direction without moving a machine rotary axis to the intermediate point.