A motor control device, wherein the motor control device comprises: a main circuit that includes a converter portion configured to convert an alternating-current power from an alternating-current power source into a direct-current power, a smoothing capacitor, and an inverter portion configured to convert the direct-current power into an alternating-current power to drive a motor; a voltage detection portion configured to detect a direct-current voltage of the main circuit; and a control part that includes a position control part configured to generate a speed command (Vr) based on a position deviation (ε) between a first position command from a master controller and a motor position (Pfb), characterized in that the control part further includes a speed control part configured to generate a torque command (Tr) based on a speed deviation (Ve) between the speed command (Vr) and a motor speed (Vfb) and is configured to control the inverter portion based on the torque command (Tr), the control part including: a torque limiting portion configured to start torque limiting which limits a command torque by the torque command (Tr) to a predetermined torque (Tlim) or less when the voltage detection portion detects that the direct-current voltage falls below a predetermined voltage and to cancel the torque limiting when the voltage detection portion detects that the direct-current voltage exceeds the predetermined voltage; and a speed matching instruction portion (21, 28) configured to match the speed command (Vr) with a first position command speed, which is a time differential value of the first position command, when the motor speed (Vfb) matches the first position command speed after the cancellation of the torque limiting. a main circuit that includes a converter portion configured to convert an alternating-current power from an alternating-current power source into a direct-current power, a smoothing capacitor, and an inverter portion configured to convert the direct-current power into an alternating-current power to drive a motor; a voltage detection portion configured to detect a direct-current voltage of the main circuit; and a control part that includes a position control part configured to generate a speed command (Vr) based on a position deviation (ε) between a first position command from a master controller and a motor position (Pfb), characterized in that the control part further includes a speed control part configured to generate a torque command (Tr) based on a speed deviation (Ve) between the speed command (Vr) and a motor speed (Vfb) and is configured to control the inverter portion based on the torque command (Tr), the control part including: a torque limiting portion configured to start torque limiting which limits a command torque by the torque command (Tr) to a predetermined torque (Tlim) or less when the voltage detection portion detects that the direct-current voltage falls below a predetermined voltage and to cancel the torque limiting when the voltage detection portion detects that the direct-current voltage exceeds the predetermined voltage; and a speed matching instruction portion (21, 28) configured to match the speed command (Vr) with a first position command speed, which is a time differential value of the first position command, when the motor speed (Vfb) matches the first position command speed after the cancellation of the torque limiting. a torque limiting portion configured to start torque limiting which limits a command torque by the torque command (Tr) to a predetermined torque (Tlim) or less when the voltage detection portion detects that the direct-current voltage falls below a predetermined voltage and to cancel the torque limiting when the voltage detection portion detects that the direct-current voltage exceeds the predetermined voltage; and a speed matching instruction portion (21, 28) configured to match the speed command (Vr) with a first position command speed, which is a time differential value of the first position command, when the motor speed (Vfb) matches the first position command speed after the cancellation of the torque limiting.