A motor driving device comprising: a speed control portion configured to perform a deceleration control of decelerating a rotation speed of a driving motor from a predetermined target rotation speed to zero based on a first pulse signal for the deceleration control that includes a plurality of pulses whose pulse width corresponds to each commanded speed to the driving motor; a pulse signal output portion configured to generate the first pulse signal and a second pulse signal and output the second pulse signal to the speed control portion after outputting the first pulse signal to the speed control portion, the pulse width of the first pulse signal changing by obeying a predetermined rule that corresponds to a deceleration tendency of the rotation speed during the deceleration control, the second pulse signal not obeying the predetermined rule; a determination processing portion configured to determine whether or not the second pulse signal is included in an input signal that is input from the pulse signal output portion to the speed control portion; and an end processing portion configured to, when the determination processing portion determines that the second pulse signal is included in the input signal, end the deceleration control by the speed control portion, wherein the predetermined rule is that a duty ratio of the first pulse signal is constant and the pulse width of the pulses of the first pulse signal and a cycle of the first pulse signal have an increase tendency in response to the deceleration tendency, characterized in that the second pulse signal is any of: a signal whose duty ratio is different from the duty ratio of the first pulse signal; a signal whose duty ratio is the same as the duty ratio of the first pulse signal and which includes at least one pulse whose pulse width is smaller than a pulse width of a last pulse of the first pulse signal; or a signal which includes at least one pulse whose pulse width is the same as the pulse width of the last pulse of the first pulse signal. a speed control portion configured to perform a deceleration control of decelerating a rotation speed of a driving motor from a predetermined target rotation speed to zero based on a first pulse signal for the deceleration control that includes a plurality of pulses whose pulse width corresponds to each commanded speed to the driving motor; a pulse signal output portion configured to generate the first pulse signal and a second pulse signal and output the second pulse signal to the speed control portion after outputting the first pulse signal to the speed control portion, the pulse width of the first pulse signal changing by obeying a predetermined rule that corresponds to a deceleration tendency of the rotation speed during the deceleration control, the second pulse signal not obeying the predetermined rule; a determination processing portion configured to determine whether or not the second pulse signal is included in an input signal that is input from the pulse signal output portion to the speed control portion; and an end processing portion configured to, when the determination processing portion determines that the second pulse signal is included in the input signal, end the deceleration control by the speed control portion, wherein the predetermined rule is that a duty ratio of the first pulse signal is constant and the pulse width of the pulses of the first pulse signal and a cycle of the first pulse signal have an increase tendency in response to the deceleration tendency, characterized in that the second pulse signal is any of: a signal whose duty ratio is different from the duty ratio of the first pulse signal; a signal whose duty ratio is the same as the duty ratio of the first pulse signal and which includes at least one pulse whose pulse width is smaller than a pulse width of a last pulse of the first pulse signal; or a signal which includes at least one pulse whose pulse width is the same as the pulse width of the last pulse of the first pulse signal. a signal whose duty ratio is different from the duty ratio of the first pulse signal; a signal whose duty ratio is the same as the duty ratio of the first pulse signal and which includes at least one pulse whose pulse width is smaller than a pulse width of a last pulse of the first pulse signal; or a signal which includes at least one pulse whose pulse width is the same as the pulse width of the last pulse of the first pulse signal.