To stop the drive of motor to detect accurate origin of a print head when the vibrating condition generated with contact to a contact object becomes the preset constant number of rotations.
After comparison with the motor rotating direction in the preceding slit interruption, for example, in the slit interruption process (S22), when the rotating direction is identical, the slit interruption process is completed, and when the rotating direction is not identical, number of changes of direction is updated (S23). Namely, the number of changes of direction is compared with Y (minimum number of changes of direction to determine that the print head has reached the origin position) (S24). As a result, when the number of changes of direction is higher than Y, motor control is completed (S25) When the print head is in the vibrating condition generated as it is in contact with the origin position of side wall with this process, the number of changes of direction increases. Therefore, such vibrating condition can be detected by detecting that the number of changes of direction to be updated reaches the minimum number of changes of direction Y.