This invention relates to a motor control device that controls at least one motor.
One type of a conventionally known motor control device controls a plurality of motors which drive different driven targets by means of a single control unit (such as a microcomputer). More particularly, this type of motor control device achieves motor control as follows. That is, a manipulated variable for a motor is calculated, for example based on input signals from an encoder that outputs pulse signals in accordance with rotation of the motor. Then, a process for setting the manipulated variable to a motor driving circuit (hereinafter, referred to as a “control process”) is repeated per motor. However, the single control unit is not capable of executing the control process of the plurality of motors in parallel. Accordingly, the conventional motor control device repeatedly performs the control process to each motor in sequence so as to virtually control each motor in parallel.
Also, in such a conventional motor control device, a different control cycle is defined per each motor. Each motor is controlled by the control process of each motor which is executed per control cycle of the corresponding motor.
One example of such a motor control device is provided with a plurality of timers each provided corresponding to each motor. More particularly in this example, interruption signals are supplied from the plurality of timers to a control unit in cycles predetermined in the plurality of timers. Each time the interruption signal is supplied, the control unit executes the control process of the corresponding motor so that the plurality of motors are controlled in the corresponding cycles.
In another example, control cycle of a motor having the shortest optimal control cycle out of control cycles of a plurality of motors is set to an execution cycle Ts of the control process. Each time the execution cycle Ts arrives, the interruption signal is supplied to a control unit from one timer.
Particularly, as shown in FIG. 11, the control cycle of the motor having the shortest optimal control cycle is defined as the execution cycle Ts of the control process. The control cycles of other motors are defined as integral multiples of the execution cycle Ts. Each time the execution cycle Ts arrives, the control process of the motor of which control cycle has arrived is carried out in sequence. In this manner, each motor is virtually controlled in parallel in a different control cycle. That is, the above control process is executed to the motor having the same control cycle as the execution cycle Ts each time the execution cycle Ts arrives, while, with respect to a motor having a control cycle of M (M: an integer of two and above) times as long as the execution cycle Ts, the control process is executed each time the number of times of arrival of the execution cycle Ts reaches an integral multiple of M.