Servo motor control (101; 102), which controls a
servo motor (20) for driving a
machine tool, comprising: a speed command generation unit (1) configured to generate a speed command value of the
servo motor (20); a speed detection unit (2) configured to detect the speed of the
servo motor (20); a torque command generation unit (3) configured to generate a torque command value of the servo motor (20) based on the velocity command value and the detected velocity; a sinusoidal wave generation unit (4) configured to generate a sinusoidal disturbance wave; a
frequency response calculation unit (5) configured to add the sinusoidal disturbance value generated by the
sine wave generation unit (4) to the velocity command value, thereby generating a
frequency response based on an output from a velocity control loop (10). 1 is calculated when the sinusoidal disturbance value has been entered into the speed control loop (10), which includes the torque command generation unit (3) and the speed detection unit (2); a resonant
frequency detection unit (6) configured to detect a resonant frequency, which is a frequency at which an amplification of the calculated
frequency response 1 maximized; a resonant frequency storage unit (7) configured to store the resonant frequency detected by the resonant frequency acquisition unit (6); at least one filter (8) configured to attenuate a specific
frequency band component contained in the torque command value; and a
resonance frequency comparison unit (9) which is configured to measure the stiffness of a
machine tool on the basis of the
resonance frequency stored in the
resonance frequency storage unit (7) and to adjust the filter (8) with respect to the resonance frequency.