Patent attributes
When motor drive is initiated, firstly a PWM value at time of driving initiation is set to an initial setting value start_pwm1, and gradually increased by a specified amount in specified period. When an encoder edge is detected, the PWM value is reset to the initial setting value, and increased again in the same manner. From second edge detection, next PWM initial value is set corresponding to a PWM value at the time of edge detection. If the PWM value at the time of edge detection is larger than det_pwm_max owing to load on the motor becoming large and thereby driving velocity becoming slower, a PWM value which is larger than previous PWM initial value is set as a new PWM initial value. The driving target can be driven stably irrelevant to fluctuation of the load on the motor.