The invention will be described with reference to the accompanying drawings, wherein like numbers reference like elements.
An embodiment of the invention will be explained in detail hereinbelow while referring to the figures. Furthermore, like numbers reference like components, and duplicate explanations are omitted.
As shown in
Here, the CPU 10 is controlling means for controlling the overall operation of the motor controller 100, and treats RAM 14 as a work area, executes processing and commands in accordance with programs stored in ROM 12, and carries out drive control of a motor M. Further, the plurality of motors M are stepping motors used as the power sources for feeding paper and the like to a printer, and the respective motors M are subjected to drive control by the respective motor control blocks 18.
Further, the motor control unit 16 is an integrated circuit designed for use in motor control (ASIC), and, as shown in
Then, in a motor control block 18, pulse data values stored in the table buffer 24 are sequentially transmitted to the pulse generator 22, and the pulse generator 22 generates a motor control signal based on the transmitted pulse data values, and outputs same to the motor M. Thus, data transmission of a pulse data value from the table buffer 24 to the pulse generator 22 is performed without going through the CPU 10, and without being read out each time from an external memory, such as ROM 12 or RAM 14. Further, when a signal is outputted to a motor M, the pertinent signal is provided as feedback, and prompts the pulse generator 22 for the next data transmission. Furthermore, the data transmission of a pulse data value is commenced from an arbitrary buffer address of the table buffer 24, and can be ended at an arbitrary buffer address, and the pulse data value generates an interrupt to the CPU 10 subsequent to data transmission ending.
Furthermore, the motor control unit 16 comprises a reference clock circuit 26 for sending a reference clock for use in generating pulses to the respective pulse generators 22; and a start/stop circuit 28, which controls drive start and stop for a plurality of motors M, that is, the starting and stopping of the operations of the respective pulse generators 22. The reference clock circuit 26 and start/stop circuit 28 are shared by the plurality of motor control blocks 18, and an output signal of the reference clock circuit 26 and an output signal of the start/stop circuit 28 are respectively inputted to the plurality of motor control blocks 18. The reference clock circuit 26 provides a common reference clock for the respective motor control blocks 18. Further, the start/stop circuit 28 is constituted such that when the CPU 10 specifies a motor M, the driving of which is to be either started or stopped, to the start/stop circuit 28, a start/stop signal is sent from the start/stop circuit 28 to the respective motor control blocks 18, and the motor control blocks 18 either start or stop operations based on this signal. The output signal of the start/stop circuit 28 has a bit length equivalent to the number of motors M comprising the motor controller 100, and one motor M (motor control block 18) is allocated for each bit. Then, the motor control blocks 18 corresponding to the respective bits can, simultaneously and independently, be instructed to either start or stop operations by setting either a 1 or a 0 in each bit, and outputting same to the motor control blocks 18.
It is desirable that the table buffer 24 in this embodiment have a ring buffer configuration, which stores and manages data in a ring shape by linking together the beginning and end of a storage array. By using a ring buffer configuration, it becomes possible to set infinite length pulse data, enabling the infinite driving of a motor M. Further, it is possible to reduce the buffer size, leading to cost reductions as well.
Further, the table buffer 24 is constituted so as to be able to output an interrupt to the CPU 10 in a buffer empty near end or buffer end, which show that buffer end is approaching. Consequently, since the timing at which a buffer becomes empty can be notified to the CPU 10, the CPU 10 can write the pulse data values stored in either ROM 12 or RAM 14 to the table buffer 24 prior to the buffer becoming empty. Write (rewrite) timing can be decided by the processing speed of the CPU 10 or the size of the table buffer 24.
Furthermore, a function for reading out a buffer address that is currently being read out (being transmitted to the pulse generator 22) can be provided in the table buffer 24. Consequently, since the CPU 10 is able to ascertain the pulse data value up to which outputting has been carried out, it is possible to set subsequent data in a location for which pulse data value transmission is complete.
Further, instead of making the table buffer 24 a ring buffer configuration, the table buffer 24 can be a double buffer configuration, which alternately uses two storage arrays. Since using a double buffer configuration makes it possible to write a pulse data value to the one storage array while reading a pulse data value from the other storage array, motor M drive control can be carried out seamlessly.
An overview of the operation of a motor controller 100 constituted as described hereinabove will be explained.
First, the CPU 10 reads out from either ROM 12 or RAM 14 tables of pulse data values corresponding to the operating patterns of the respective motors M, and writes same to the table buffers 24, which are provided corresponding one-to-one with the respective motors M. When the plurality of motors M are subjected to drive control using respectively different operating patterns at this time, respectively different pulse data value tables are written to the respective table buffers 24. Then, when the CPU 10 specifies to the start/stop circuit 28 the motor M for which driving is to be commenced, a start signal is sent from the start/stop circuit 28 to the prescribed motor control block 18, and the motor control block 18 starts operation on the basis of this signal.
When the motor control block 18 starts operation, pulse data values are sequentially transmitted to the pulse generator 22 from the table buffer 24, and pulse signals indicated by the transmitted pulse data values are generated and outputted to the motor M. Thereafter, except for when the table buffer 24 is rewritten, data transmissions to the pulse generator 22 from the table buffer 24, and the generation and outputting of motor control signals, are carried out without going through the CPU 10. Furthermore, when the table buffer 24 detects a buffer empty near end or the like, the CPU 10 is notified, and the table of pulse data values in the table buffer 24 is rewritten.
When the driving of a motor M is to stop, the CPU 10 issues a command to the start/stop circuit 28 to stop driving the prescribed motor M. On the basis of this command, a stop signal is sent from the start/stop circuit 28 to the prescribed motor control block 18, and the motor control block 18 stops operation on the basis of this signal.
As described hereinabove, a motor controller of an aspect of the invention respectively provides table buffers 24 to a plurality of motor control blocks 18, making possible one-to-one data storage for the motors M and completely independent driving. Consequently, drive start and stop can simultaneously be controlled for a plurality of motors M.
Furthermore, the invention is not limited to the above-described embodiment, and can be put into practice in a variety of other forms within a scope that does not deviate from the gist of the invention. Thus, the above-described embodiment in all respects is simply an example, and is not a restrictive interpretation.
For example, it is possible to either arbitrarily change the order of the operation overview described hereinabove in a scope that does not contradict the contents of the processing, or to execute same in parallel.
Number | Date | Country | Kind |
---|---|---|---|
2006-157611 | Jun 2006 | JP | national |