PURPOSE: To provide an NC machine tool which allows costs to be constant, provides a stable machining precision for work pieces, and automatically carries out thermal correction thus being effective for unmanned operations.
CONSTITUTION: In an NC machine tool having a main control means 14 which instructs the rotational speed and position of a main shaft 1 having a built-in motor 30, a main shaft motor control means controlling the speed of the motor 30 based on the rotationanal speed instruction, a positioning control means 15 controlling the position of the main shaft 1 based on the direction instruction, a temperature detection means 11 detecting the temperature of the motor 30, and a protection means protecting the motor 30 based on the detected temperature signal, the temperature signal detected by the temperature detection means 11 is entered. The machine tool includes an automatic thermal displacement correction means 16 which corrects position instructions from the main control means 14 based on the entered temperature signal.