To appropriately detect overload which may break a motor or deform a body and
reduce the overload in the motor. The DC component of a load torque is derived
from the sum of absolute values of a torque applied to a link connected to the
output shaft of a motor and the generated torque of the motor, and it is determined
that overload has been applied when the DC component exceeds a first threshold
value for a prescribed period of time or longer. In addition, considering such
a characteristic that the variation of energy applied to the output shaft of a
motor is in proportion to a product of the torque and the angular velocity of the
motor, the AC component of the load torque is detected based on the variation of
energy, and it is predicted that overload will be applied when the AC component
exceeds a second threshold value.