G05B2219/42197

Motor control device, motor control method, and non-transitory computer-readable recording medium

A motor control device includes a control unit and a generation-method changer. The control unit generates a driving signal for driving a motor in accordance with a command signal and an encoder signal and outputs the generated driving signal to the motor, the command signal being a signal for setting the position of a moving part connected to the motor to a target position, the encoder signal indicating the position of the motor detected by an encoder. The generation-method changer changes a method used by the control unit to generate the driving signal in accordance with a position sensor signal indicating a detected target position that is the target position detected by a position sensor mounted on the moving part.