摘要 |
PROBLEM TO BE SOLVED: To highly accurately perform the drive control of a motor without using high-cost hardware.SOLUTION: A motor control device is configured to control at least either the rotational position or rotational speed of a motor following a drive command corresponding to an encode signal which periodically changes in accordance with the rotational position. First processing includes rotational position detection processing of detecting the rotational position on the basis of the encode signal, and the same processing is executed each time interruption processing occurs. Second processing includes at least processing of generating the drive command in accordance with the rotational position detected by the first processing, and different processing is selected each time the interruption processing occurs. During the interruption processing, the rotational position detection processing of the first processing is executed prior to the execution of the second processing. |