according to an aspect of the invention , a centrifuge includes : a rotor for separating samples ; a motor for driving and rotating the rotor ; a drive shaft for connecting together the motor and the rotor ; a rotation sensor for detecting at least one of the rotation speed of the motor and the rotor ; and a displacement sensor for detecting the swinging motion of the rotor or the drive shaft , wherein , after one of speed of the motor and the rotor is accelerated up to previously set rotation speed , when the swinging amount of the rotor or the drive shaft is equal to or more than preset allowable value , the supply of power to the motor is stopped to decelerate the motor , wherein , during the deceleration , signal from the displacement sensor is compared with the preset allowable value , and wherein when the signal from the displacement sensor becomes equal to or less than the preset allowable value , the motor is accelerated .