The present invention provides a
motor control device capable of operating a
robot properly without stopping a motor that operates the
robot even when an instantaneous
voltage drop occurs. The
motor control device 10 that controls the
robot operating motor 102 is equipped with the subtraction unit 109 that calculates the position deviation for which the actual rotational position is subtracted from the position command, the
position control unit 110 that converts the position deviation to the speed command, the subtraction unit 111 that calculates the speed deviation for which the actual rotational
speed measurement is subtracted from the speed command, the speed
control unit 112 that converts the speed deviation to a torque command, the
limiter 113 that sets the
maximum level of the torque command, the driver 114 that drives the motor 102, and the
voltage fluctuation detection unit 115 that detects the
voltage fluctuation of the power source 103; in the
motor control device 101, when an instantaneous
voltage drop is detected by the
voltage fluctuation detection unit 115, the position command output unit 108 varies the position command so as to reduce the rotational speed of the motor 102, and the
position control unit 110 limits the speed command to be output.