JP4453712B2 - Setting method and motor control device - Google Patents

Setting method and motor control device Download PDF

Info

Publication number
JP4453712B2
JP4453712B2 JP2007094722A JP2007094722A JP4453712B2 JP 4453712 B2 JP4453712 B2 JP 4453712B2 JP 2007094722 A JP2007094722 A JP 2007094722A JP 2007094722 A JP2007094722 A JP 2007094722A JP 4453712 B2 JP4453712 B2 JP 4453712B2
Authority
JP
Japan
Prior art keywords
motor
operation amount
control
cycle
motors
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007094722A
Other languages
Japanese (ja)
Other versions
JP2008253110A (en
Inventor
茂樹 秋山
雅敏 平野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2007094722A priority Critical patent/JP4453712B2/en
Priority to US12/055,278 priority patent/US8026678B2/en
Publication of JP2008253110A publication Critical patent/JP2008253110A/en
Application granted granted Critical
Publication of JP4453712B2 publication Critical patent/JP4453712B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Control Of Multiple Motors (AREA)

Description

本発明は、複数のモータを制御するモータ制御装置に関する。   The present invention relates to a motor control device that controls a plurality of motors.

従来より、モータ制御装置としては、異なる駆動対象を駆動する複数のモータを、単一の制御部(マイクロコンピュータ等)で制御するモータ制御装置が知られている。この種のモータ制御装置では、例えば、モータの回転に応じてパルス信号を出力するエンコーダからの入力信号に基づき、モータに対する操作量を算出し、この操作量をモータ駆動回路に設定する処理(以下、「制御処理」と称する。)を繰返し、モータ毎に実行することにより、モータ制御を実現する。但し、単一の制御部では、複数モータの上記制御処理を夫々、並列に実行することができない。このため、従来のモータ制御装置では、繰返し、各モータに対する制御処理を、順に実行することで、仮想的に各モータを並列制御している。   2. Description of the Related Art Conventionally, as a motor control device, a motor control device that controls a plurality of motors that drive different driving targets with a single control unit (such as a microcomputer) is known. In this type of motor control device, for example, based on an input signal from an encoder that outputs a pulse signal in accordance with the rotation of the motor, a process for calculating an operation amount for the motor and setting the operation amount in a motor drive circuit (hereinafter referred to as a motor drive circuit) , Referred to as “control processing”) and repeated for each motor to realize motor control. However, a single control unit cannot execute the control processes for a plurality of motors in parallel. For this reason, in the conventional motor control apparatus, each motor is virtually controlled in parallel by repeatedly executing the control processing for each motor in order.

この他、複数モータにより異なる駆動対象を駆動する場合には、モータ毎に、適切な制御周期(換言すると、操作量の更新周期)が異なる場合も多い。このため、従来装置では、複数のモータの全てについての制御処理を、同周期で繰返し実行するのではなく、各モータの制御処理を、異なる周期で実行することが行われている。   In addition, when different driving objects are driven by a plurality of motors, an appropriate control cycle (in other words, an operation amount update cycle) is often different for each motor. For this reason, in the conventional apparatus, the control process for all of the plurality of motors is not repeatedly executed in the same cycle, but the control process for each motor is executed in a different cycle.

具体的には、図11に示すように、制御周期の最適値が最小のモータについての当該制御周期を、処理の実行周期Tsに定め、他のモータの制御周期を、処理実行周期Tsの整数倍に定めて、処理実行時刻が到来する度、制御周期が到来したモータについての上記制御処理を順に実行することで、従来装置では、仮想的に、各モータを異なる制御周期で、並列制御している(例えば、特許文献1参照)。制御周期がM×Tsのモータについては、処理実行時刻の到来回数がMの整数倍となる度、上記制御処理を実行するといった具合である。
特開2002−186288号公報
Specifically, as shown in FIG. 11, the control cycle for the motor having the minimum optimal control cycle is set as the process execution cycle Ts, and the control cycle of the other motor is set as an integer of the process execution cycle Ts. When the processing execution time arrives, the control processing for the motors that have reached the control cycle is executed in order, and the conventional device virtually controls each motor in parallel at different control cycles. (For example, refer to Patent Document 1). For a motor having a control cycle of M × Ts, the control process is executed every time the number of times the process execution time arrives is an integral multiple of M.
JP 2002-186288 A

しかしながら、従来装置では、処理実行周期Tsを、制御周期の最適値が最小のモータの当該制御周期に定めていたため、他のモータの制御周期が、上記最適値が最小のモータの制御周期Tsに、拘束されるといった問題があった。   However, in the conventional apparatus, the process execution cycle Ts is set to the control cycle of the motor having the minimum optimal control cycle, so the control cycle of the other motor is set to the control cycle Ts of the motor having the minimum optimal value. There was a problem of being restrained.

即ち、従来手法では、制御周期の最適値が最小のモータについての当該制御周期Tsに拘束されて、他のモータに対し、最適な制御周期を設定することができないといった問題があった。また、これが原因で、複数モータを単一の制御部で制御するモータ制御装置においては、一部モータの制御性能が劣化するといった問題があった。   That is, in the conventional method, there is a problem that the optimum control period cannot be set for other motors because the optimum value of the control period is restricted by the control period Ts for the motor having the smallest value. In addition, due to this, in the motor control device that controls a plurality of motors with a single control unit, there is a problem that the control performance of some motors deteriorates.

勿論、このような問題は、制御部を、モータ毎に設けることで解決することができる。しかしながら、制御部をモータ毎に設けると、装置の製造コストが大幅に上昇するといった問題があった。   Of course, such a problem can be solved by providing a control unit for each motor. However, when the control unit is provided for each motor, there is a problem that the manufacturing cost of the apparatus is significantly increased.

本発明は、こうした問題に鑑みなされたものであり、単一の制御部にて、従来よりも適切に、複数モータを制御可能な技術を提供することを目的とする。   The present invention has been made in view of these problems, and an object of the present invention is to provide a technique capable of controlling a plurality of motors more appropriately than before with a single control unit.

かかる目的を達成するためになされた第一の発明は、複数のモータを制御するモータ制御装置であって、設定された操作量に対応する操作をモータに加えて当該モータを駆動するモータ駆動手段及びモータの回転量を検出する回転量検出手段をモータ毎に備えると共に、操作量の算出結果を記憶するための操作量記憶手段、及び、予め定められた周期で到来する処理実行時刻が到来する度、制御周期が到来した各モータについて、回転量検出手段から回転量についての検出値を取得する処理と、取得した検出値に基づきモータに対する操作量を算出し、算出した操作量を操作量記憶手段に記憶させる処理と、モータ駆動手段に対し操作量記憶手段から読み出した操作量を設定する処理と、を実行する操作量設定手段を備えるモータ制御装置に対し、次のように、処理実行時刻の到来周期である処理実行周期及び各モータの制御周期を設定するようにした方法の発明である(請求項1)。
尚、上記操作量設定手段は、処理実行時刻が到来した時点で「制御周期が到来したモータについて、モータ毎に、対応する回転量検出手段から回転量についての検出値を取得すると共に、所定回前に算出された当該モータの操作量を、操作量記憶手段から読み出し、読み出した操作量を、このモータに対応するモータ駆動手段に設定する入出力処理」を実行し、この入出力処理の実行後、制御周期が到来したモータについて、モータ毎に、「対応する回転量検出手段から取得した検出値に基づき、このモータに対する操作量を算出し、算出した操作量を、操作量記憶手段に記憶させる算出記録処理」を実行する。
First aspect of the present invention made for achieving the above object, a plurality of a motor control apparatus for controlling a motor, a motor driving means for driving the motor by adding the operation corresponding to the operation amount set to the motor And a rotation amount detection means for detecting the rotation amount of the motor for each motor, an operation amount storage means for storing a calculation result of the operation amount, and a process execution time that arrives at a predetermined cycle arrives. For each motor whose control cycle has arrived, a process for acquiring a detection value for the rotation amount from the rotation amount detection means, and an operation amount for the motor is calculated based on the acquired detection value, and the calculated operation amount is stored in the operation amount a process of storing in the unit, the process of setting the operation amount read from the operation amount storing means to the motor drive unit, the motor control device comprising a operation amount setting means for executing the And, as follows, an invention of the method to set the process execution period is coming period in the process execution time and control cycle of the motor (claim 1).
The operation amount setting means obtains a detected value for the rotation amount from the corresponding rotation amount detection means for each motor at the time when the processing execution time has arrived, and for a predetermined number of times. Execute the input / output process that reads the operation amount of the motor calculated before from the operation amount storage means and sets the read operation amount in the motor drive means corresponding to this motor. After that, for each motor for which the control cycle has arrived, the operation amount for this motor is calculated for each motor based on the detection value acquired from the corresponding rotation amount detection means, and the calculated operation amount is stored in the operation amount storage means. The calculation recording process to be performed ”is executed.

この発明では、複数のモータの内、最適な制御周期が最小のモータの当該制御周期を基準周期として、当該基準周期のN(但し、値Nは2以上の整数である。)分の一の時間間隔を、処理実行周期に設定し、上記最適な制御周期が最小のモータの当該制御周期を、設定した処理実行周期のN倍に設定すると共に、複数のモータの内、最適な制御周期が最小のモータ以外の各モータの制御周期を、設定した処理実行周期のM倍(但し、値Mは、値N以上の整数である。)に設定する。   In the present invention, the control cycle of the motor having the minimum optimal control cycle among the plurality of motors is used as a reference cycle, and is one-Nth of the reference cycle (however, the value N is an integer of 2 or more). The time interval is set to the processing execution cycle, the control cycle of the motor with the minimum optimal control cycle is set to N times the set processing execution cycle, and the optimal control cycle of the plurality of motors is The control cycle of each motor other than the smallest motor is set to M times the set processing execution cycle (however, the value M is an integer greater than or equal to the value N).

このような方法で、処理実行周期及び制御周期を設定すれば、従来のように、最適な制御周期が最小のモータの当該制御周期を、処理実行周期に定めるよりも、各モータの制御周期を、適切な値に設定することができる。   If the process execution cycle and the control cycle are set in this way, the control cycle of each motor can be set rather than setting the control cycle of the motor with the minimum optimal control cycle as the process execution cycle as in the past. Can be set to an appropriate value.

即ち、本発明の設定方法によれば、最適な制御周期が最小のモータの当該制御周期の整数分の一を、処理実行周期に設定するので、従来手法よりも、自由度高く、各モータの制御周期を設定することができ、結果として、各モータの制御周期を、最適値又はその近似値に設定することができる。   That is, according to the setting method of the present invention, since an integral part of the control cycle of the motor having the minimum optimal control cycle is set as the processing execution cycle, the degree of freedom of each motor is higher than that of the conventional method. The control cycle can be set, and as a result, the control cycle of each motor can be set to an optimal value or an approximate value thereof.

また、上記モータ制御装置では、処理実行周期毎に、制御周期が到来したモータを検出し制御周期が到来した各モータについての操作量を更新するといった動作で、各モータを制御周期毎に制御するので、単一の制御部(マイクロコンピュータ等)で、複数のモータを、簡単な手順で制御することができる。即ち、このモータ制御装置では、処理実行周期で統制せずに、各モータを個別に制御するモータ制御装置よりも、簡単に、複数モータを制御することができる。従って、本発明の設定方法によれば、簡単な制御系で、複数のモータを高精度に制御することができる。   In the motor control device, each motor is controlled at each control cycle by detecting the motor that has reached the control cycle and updating the operation amount for each motor at which the control cycle has arrived. Therefore, a plurality of motors can be controlled by a simple procedure with a single control unit (microcomputer or the like). That is, in this motor control device, it is possible to control a plurality of motors more easily than a motor control device that individually controls each motor without controlling the processing execution cycle. Therefore, according to the setting method of the present invention, a plurality of motors can be controlled with high accuracy by a simple control system.

また、具体的に、処理実行周期は、最適な制御周期が最小のモータの当該制御周期の整数分の一であって、各モータの最適な制御周期の最大公約数に定められるとよい。処理実行周期を必要以上に短くすると、制御周期が到来したモータが存在しないのにも拘わらず、制御周期が到来したモータの検出動作を、操作量設定手段が高頻繁に実行しなければならなくなり、操作量設定手段の処理負荷が増大する。一方、処理実行周期を、各モータの最適な制御周期の最大公約数に定めれば、各モータを最適な周期で制御することのできる最大長さの周期を、処理実行周期に定めることができ、操作量設定手段の処理負荷を効率的に抑えることができる。   Further, specifically, the processing execution cycle may be set to an integral fraction of the control cycle of the motor having the minimum optimal control cycle and to the greatest common divisor of the optimal control cycle of each motor. If the processing execution cycle is shortened more than necessary, the operation amount setting means must execute the detection operation of the motor that has reached the control cycle very frequently, even though there is no motor that has reached the control cycle. The processing load of the operation amount setting means increases. On the other hand, if the processing execution cycle is set to the greatest common divisor of the optimal control cycle of each motor, the maximum length cycle that can control each motor at the optimal cycle can be set as the processing execution cycle. The processing load of the operation amount setting means can be efficiently suppressed.

また、上記目的を達成するためになされた第二の発明は、設定された操作量に対応する操作をモータに加えて当該モータを駆動するモータ駆動手段及びモータの回転量を検出する回転量検出手段をモータ毎に備えると共に、操作量の算出結果を記憶するための操作量記憶手段、及び、予め定められた周期で到来する処理実行時刻が到来する度、制御周期が到来した各モータについて、回転量検出手段から回転量についての検出値を取得する処理と、取得した検出値に基づきモータに対する操作量を算出し、算出した操作量を操作量記憶手段に記憶させる処理と、モータ駆動手段に対し操作量記憶手段から読み出した操作量を設定する処理と、を実行する操作量設定手段を備えるモータ制御装置であって、処理実行時刻の到来周期が、制御周期が最小のモータの当該制御周期とは異なる値であって、各モータに対し設定された制御周期の公約数に、定められてなるモータ制御装置の発明である(請求項2)。
尚、操作量設定手段は、処理実行時刻が到来した時点で「制御周期が到来したモータについて、モータ毎に、対応する回転量検出手段から回転量についての検出値を取得すると共に、所定回前に算出された当該モータの操作量を、操作量記憶手段から読み出し、読み出した操作量を、このモータに対応するモータ駆動手段に設定する入出力処理」を実行し、この入出力処理の実行後、制御周期が到来したモータについて、モータ毎に、「対応する回転量検出手段から取得した検出値に基づき、このモータに対する操作量を算出し、算出した操作量を、操作量記憶手段に記憶させる算出記録処理」を実行する。
The second invention which has been made in order to achieve the above object, the rotation amount detection that detects a rotation amount of the motor drive means and a motor for driving the motor by adding the operation corresponding to the operation amount set to the motor For each motor provided with a means for each motor, an operation amount storage means for storing a calculation result of the operation amount, and each motor for which a control cycle has arrived each time a processing execution time that arrives at a predetermined cycle arrives. A process for acquiring a detection value for the rotation amount from the rotation amount detection unit, a process for calculating an operation amount for the motor based on the acquired detection value, a process for storing the calculated operation amount in the operation amount storage unit, and a motor drive unit a motor control apparatus to obtain Bei an operation amount setting means for executing a process of setting the operation amount read from the operation amount storing means against the arrival period of the processing execution time, the control cycle A value different from that of the control period of the smallest motor, the common divisor of the control period set for each motor, an invention of a motor control device in which defined (claim 2).
The operation amount setting means obtains a detection value for the rotation amount from the corresponding rotation amount detection means for each motor for each motor when the processing execution time has arrived, The operation amount calculated for the motor is read out from the operation amount storage means, and the input / output process for setting the read operation amount in the motor drive means corresponding to the motor is executed. For each motor for which the control cycle has arrived, for each motor, “calculate the operation amount for this motor based on the detection value acquired from the corresponding rotation amount detection means, and store the calculated operation amount in the operation amount storage means. "Calculation recording process" is executed.

上述したように、処理実行周期を基準として各モータを制御する手法では、単一の制御部(マイクロコンピュータ等)で複数モータを制御する場合に、その制御手順及び制御系
の構成を、処理実行周期で統制しない手法と比較して、簡単にすることができるといった利点がある。しかしながら、処理実行周期を基準として各モータを制御する手法では、従来、各モータの制御周期が、制御周期の最適値が最小のモータの当該制御周期に、拘束されるといった問題があった。
As described above, in the method of controlling each motor on the basis of the process execution cycle, when a plurality of motors are controlled by a single control unit (microcomputer or the like), the control procedure and control system configuration are executed. There is an advantage that it can be simplified as compared with a method not controlled by a cycle. However, the method of controlling each motor on the basis of the processing execution cycle has conventionally had a problem that the control cycle of each motor is constrained to the control cycle of the motor having the smallest control cycle value.

本発明は、こうした問題に鑑み、各モータの制御周期の公約数に、処理実行周期(処理実行時刻の到来周期)を定めて、モータ制御装置を構成したものである。各モータの制御周期の公約数に、処理実行周期を定めれば、各モータの制御周期が、制御周期の最適値が最小のモータの当該制御周期に拘束されずに済む。即ち、本発明のようにモータ制御装置を構成すれば、処理実行周期を基準として各モータを制御する手法を採用しつつ、各モータの操作量を適切な周期で更新することができ、各モータを高精度に制御することができる。従って、本発明によれば、安価に高性能なモータ制御装置を構築することができる。   In view of such a problem, the present invention configures a motor control device by determining a processing execution cycle (arrival cycle of processing execution time) as a common divisor of the control cycle of each motor. If the process execution cycle is defined as the common divisor of the control cycle of each motor, the control cycle of each motor does not have to be constrained to the control cycle of the motor with the minimum control cycle value. That is, if the motor control device is configured as in the present invention, the operation amount of each motor can be updated at an appropriate cycle while adopting a method of controlling each motor based on the processing execution cycle. Can be controlled with high accuracy. Therefore, according to the present invention, a high-performance motor control device can be constructed at low cost.

尚、このモータ制御装置において、処理実行周期は、各モータの制御周期の最大公約数に定められるとよい。このように、処理実行周期を、各モータの制御周期の最大公約数に定めれば、上述したように、操作量設定手段の処理負荷を抑えることができ、操作量設定手段としての機能をマイクロコンピュータにて実現する場合に、安価なマイクロコンピュータを用いることができる。   In this motor control device, the process execution cycle may be set to the greatest common divisor of the control cycle of each motor. Thus, if the processing execution cycle is set to the greatest common divisor of the control cycle of each motor, as described above, the processing load of the operation amount setting means can be suppressed, and the function as the operation amount setting means can be reduced. In the case of realizing with a computer, an inexpensive microcomputer can be used.

また、操作量設定手段では、制御周期が到来したモータを検出する必要があるが、このモータの検出動作は、具体的に、次のようにして実現されるとよい。
即ち、モータ制御装置には、基点からの経過時間を計測する計時手段を設けて、操作量設定手段は、処理実行時刻が到来する度、複数のモータの夫々について、計時手段の計測値をモータの制御周期で除算して除算後の余りを算出し、当該余りが規定値であるか否かを判断することによって、制御周期が到来したモータを検出する構成にされるとよい(請求項3)。このようにモータ制御装置を構成すれば、簡単な動作で制御周期が到来したモータを検出することができる。尚、規定値は、例えば、値ゼロに設定することができる。
Further, the operation amount setting means needs to detect the motor whose control cycle has arrived, and this motor detection operation may be specifically realized as follows.
That is, the motor control device is provided with a time measuring means for measuring the elapsed time from the base point, and the operation amount setting means determines the measured value of the time measuring means for each of the plurality of motors every time the processing execution time arrives. And calculating a remainder after the division, and determining whether the remainder is a specified value, thereby detecting a motor that has reached the control period. ). By configuring the motor control device in this way, it is possible to detect a motor whose control cycle has been reached with a simple operation. The specified value can be set to the value zero, for example.

また、本発明のモータ制御装置のように、入出力処理の実行後に算出記録処理を実行することで、操作量の演算前に、検出値の取得動作、及び、操作量の設定動作を実行すれば、操作量の演算時間が揺動する場合でも、高精度に一定周期(予め定められたモータの制御周期)で、操作量をモータ駆動手段に対して設定することができる。また、高精度に一定周期で各モータの回転量についての検出値を取得し、これに基づく操作量の算出動作を実行することができる。 In addition, like the motor control device of the present invention, the calculation recording process is executed after the input / output process is executed, so that the detection value acquisition operation and the operation amount setting operation can be executed before the operation amount calculation. For example, even when the operation time of the operation amount fluctuates, the operation amount can be set to the motor driving means with a high accuracy and at a constant cycle (a predetermined motor control cycle). In addition, it is possible to acquire a detection value for the rotation amount of each motor at a constant cycle with high accuracy, and to perform an operation amount calculation operation based on the detection value.

即ち、従来装置では、処理実行時刻が到来すると、モータの回転量を取得して、この取
得値に基づき、モータに対する操作量を算出し、算出後に、当該算出の結果得られた操作量を、モータ駆動手段に設定して、操作量を更新するといった制御処理を実行していたため、一定周期で上記制御処理を開始しても、操作量の演算時間の揺動により、操作量の演算後に行われる操作量の設定動作については、安定して一定周期で実行することができないといった問題があった。
That is, in the conventional apparatus, when the processing execution time arrives, the rotation amount of the motor is acquired, the operation amount for the motor is calculated based on the acquired value, and the operation amount obtained as a result of the calculation is calculated after the calculation, Since control processing such as setting the motor drive means and updating the operation amount was executed, even if the control processing is started at a fixed period, the control amount is changed after the operation amount is calculated due to fluctuations in the operation amount calculation time. There has been a problem that the operation for setting the manipulated variable cannot be executed stably at a constant cycle.

また、制御周期が到来したモータが複数ある場合には、処理実行時刻の到来を契機として、上記複数モータの制御処理を、優先度の高いモータから、順に実行することになるが、この場合には、優先度の低いモータの制御処理の実行開始時刻が、先に実行された優先度の高いモータについての制御処理の遅延を受けて安定しないため、操作量の設定動作だけでなく、回転量の検出値の取得動作についても、一定周期で精度よく実行することができないといった問題があった。そして、従来装置では、このような操作量の設定動作及び検出値の取得動作の実行周期の揺動が、モータの制御性能の劣化に繋がっていた。   In addition, when there are a plurality of motors that have reached the control cycle, the control processing of the plurality of motors is executed in order from the motor with the highest priority in response to the arrival of the processing execution time. Because the execution start time of the control process for the low priority motor is not stable due to the delay of the control process for the high priority motor executed earlier, not only the operation amount setting operation but also the rotation amount There is also a problem that the operation of acquiring the detected value cannot be executed accurately at a constant period. In the conventional apparatus, the fluctuation of the execution period of the operation amount setting operation and the detection value acquisition operation has led to deterioration of the control performance of the motor.

これに対し、本発明のモータ制御装置では、操作量の演算前に、検出値の取得動作、及び、操作量の設定動作を実行するので、操作量の演算時間の揺動が、検出値の取得動作及び操作量の設定動作の実行時期に影響を与えることがなく、安定的に、一定周期で、検出値の取得動作及び操作量の設定動作を実行することができる。従って、本発明によれば、各モータを高精度に制御することができるモータ制御装置を提供することができる。   On the other hand, in the motor control device of the present invention, the detection value acquisition operation and the operation amount setting operation are executed before the operation amount is calculated. The detection value acquisition operation and the operation amount setting operation can be executed stably and at constant intervals without affecting the execution timing of the acquisition operation and the operation amount setting operation. Therefore, according to this invention, the motor control apparatus which can control each motor with high precision can be provided.

また、モータ制御装置は、処理実行時刻が到来してから次の処理実行時刻が到来するまでの期間に、入出力処理及び算出記録処理の全てが終了するように、構成されるのが好ましいが、操作量の演算時間が延びて、算出記録処理が次の処理実行時刻までに終了しない場合も考えられるので、このような場合を想定してモータ制御装置を構成する場合には、具体的に、操作量設定手段を次のように構成するとよい。   In addition, the motor control device is preferably configured such that all of the input / output processing and the calculation recording processing are completed in a period from the arrival of the processing execution time to the arrival of the next processing execution time. Since the calculation time of the operation amount is extended and the calculation recording process may not be completed by the next process execution time, when configuring the motor control device assuming such a case, The operation amount setting means may be configured as follows.

即ち、操作量設定手段は、算出記録処理を、次の処理実行時刻の到来時までに終えることができなかった場合、次の処理実行時刻の到来時点で、この算出記録処理を中断すると共に、処理実行時刻の到来を契機として入出力処理を実行した後、中断された算出記録処理を再開する構成にされるとよい(請求項4)。算出記録処理が次の処理実行時刻までに終了しない事態も考えられるモータ制御装置において、このように、操作量設定手段を構成すれば、上記事態が発生した場合でも、優先的に入出力処理が実行されるので、適切に検出値の取得動作及び操作量の設定動作を一定周期で実行することができ、安定したモータ制御を実現することができる。 That is, the operation amount setting means interrupts the calculation recording process when the next process execution time arrives when the calculation recording process cannot be completed by the arrival of the next process execution time. after executing the output processing in response to arrival of the processing execution time, it may be to resume configure interrupted calculated recording process (claim 4). In the motor control apparatus in which the calculation recording process may not be completed by the next process execution time, if the operation amount setting unit is configured in this way, even when the above situation occurs, the input / output process is preferentially performed. Since it is executed, the detection value acquisition operation and the operation amount setting operation can be appropriately executed at a constant period, and stable motor control can be realized.

また、操作量設定手段としての機能は、操作量設定手段としての機能をマイクロコンピュータに実現させるためのプログラムを、モータ制御装置が備える単一のマイクロコンピュータに、実行させることにより、実現することができる(請求項5)。単一のマイクロコンピュータにて操作量を演算する従来のモータ制御装置では、上述したように、操作量の演算時間の揺動から、精度よく一定周期で、回転量の検出値(制御量)の取得動作及び操作量の設定動作を実行することができないといった問題があったが、本発明を、このようなモータ制御装置に適用すれば、検出値の取得動作及び操作量の設定動作を一定周期で実行することができ、安定したモータ制御を実現することが可能なモータ制御装置を構成することができる。 The function as the operation amount setting means can be realized by causing a single microcomputer provided in the motor control device to execute a program for causing the microcomputer to realize the function as the operation amount setting means. ( Claim 5 ). In the conventional motor control device that calculates the operation amount with a single microcomputer, as described above, the detected value (control amount) of the rotation amount is accurately and periodically determined from the fluctuation of the operation amount calculation time. There was a problem that the acquisition operation and the operation amount setting operation could not be executed. However, if the present invention is applied to such a motor control device, the detection value acquisition operation and the operation amount setting operation are performed at a constant cycle. Therefore, it is possible to configure a motor control device that can be executed and can realize stable motor control.

以下、本発明の実施例について、図面と共に説明する。
図1は、本発明が適用された制御システム1の構成を表すブロック図である。本実施例の制御システム1は、複数のモータA,B,Cを、単一の制御部10にて制御するもので
あり、例えば、インクジェットプリンタにおける印字機構100の制御システムに用いられる。図2は、印字機構100の構成を表す概略断面図である。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a control system 1 to which the present invention is applied. The control system 1 according to the present embodiment controls a plurality of motors A, B, and C by a single control unit 10, and is used, for example, in a control system for a printing mechanism 100 in an ink jet printer. FIG. 2 is a schematic cross-sectional view illustrating the configuration of the printing mechanism 100.

本実施例の制御システム1を、印字機構100の制御システムに適用する場合には、単一の制御部10にて、インクジェットヘッド101を搭載したキャリッジ103を主走査方向に駆動するCRモータ105、給紙トレイ111から用紙Pを給紙する給紙ローラ113を駆動するACFモータ115、給紙される用紙Pをピンチローラ121と挟持して印字位置へと搬送する用紙搬送ローラ123及び用紙搬送ローラ123に連結された排紙ローラ127であって用紙搬送ローラ123側から搬送されてくる用紙Pをピンチローラ125と挟持して排紙する排紙ローラ127を駆動するLFモータ129を制御することになる。   When the control system 1 of the present embodiment is applied to the control system of the printing mechanism 100, the CR motor 105 that drives the carriage 103 on which the inkjet head 101 is mounted in the main scanning direction by a single control unit 10, An ACF motor 115 that drives a paper feed roller 113 that feeds paper P from the paper feed tray 111, a paper transport roller 123 that sandwiches the paper P to be fed with a pinch roller 121 and transports it to a printing position, and a paper transport roller The sheet discharge roller 127 connected to the sheet transfer roller 127 controls the LF motor 129 that drives the sheet discharge roller 127 that sandwiches and discharges the sheet P conveyed from the sheet conveyance roller 123 side with the pinch roller 125. Become.

具体的に、図2に示す印字機構100において印字を実現するには、給紙ローラ113を回転させて、給紙トレイ111上の用紙Pを用紙搬送ローラ123側へと搬送し、用紙Pが用紙搬送ローラ123に到達した場合には、給紙ローラ113を回転させながらも、用紙搬送ローラ123を回転させて、用紙Pを印字位置まで搬送する必要がある。また、印字を開始するに当たっては、インクジェットヘッド101のノズルを洗浄するため、インクを吐き出すフラッシング動作を行う必要があり、この際には、キャリッジ103をフラッシング位置まで移動させる必要がある。そして、この場合には、CRモータ105及びACFモータ115及びLFモータ129を、同時期に制御する必要がある。   Specifically, in order to realize printing in the printing mechanism 100 shown in FIG. 2, the paper feed roller 113 is rotated to transport the paper P on the paper feed tray 111 toward the paper transport roller 123, and the paper P When the paper transport roller 123 is reached, it is necessary to transport the paper P to the printing position by rotating the paper transport roller 123 while rotating the paper feed roller 113. In order to start printing, it is necessary to perform a flushing operation for discharging ink in order to wash the nozzles of the inkjet head 101. In this case, it is necessary to move the carriage 103 to the flushing position. In this case, it is necessary to control the CR motor 105, the ACF motor 115, and the LF motor 129 at the same time.

図3は、横軸を時間、縦軸をモータ速度としたグラフを記したものであり、図3上段は、印字処理開始時のCRモータ105の動作を表すグラフ、中段は、ACFモータ115の動作を表すグラフ、下段は、LFモータ129の動作を表すグラフである。図3に示すように、CRモータ105、ACFモータ115及びLFモータ129は、特定の期間において同時制御される必要がある。本実施例の制御システム1は、このような複数モータを備える制御システムに適用され、単一の制御部10にて、これら複数モータを制御する。   FIG. 3 shows a graph with time on the horizontal axis and motor speed on the vertical axis. The upper part of FIG. 3 is a graph showing the operation of the CR motor 105 at the start of printing processing, and the middle part is that of the ACF motor 115. The graph showing the operation, the lower part is a graph showing the operation of the LF motor 129. As shown in FIG. 3, the CR motor 105, the ACF motor 115, and the LF motor 129 need to be controlled simultaneously in a specific period. The control system 1 of the present embodiment is applied to such a control system including a plurality of motors, and these single motors are controlled by a single control unit 10.

具体的に、本実施例の制御システム1は、モータA,B,Cを制御する制御部10を備えると共に、図1に示すように、制御対象のモータA,B,C毎に、エンコーダ21、エンコーダ信号処理回路23、及び、モータ駆動回路25を備える。また、この制御システム1は、制御部10に割込み信号Irを所定周期Tsで入力するタイマ27を備える。以下では、モータAのエンコーダ21及びエンコーダ信号処理回路23及びモータ駆動回路25を、特に、エンコーダ21a及びエンコーダ信号処理回路23a及びモータ駆動回路25aと記し、モータBのエンコーダ21及びエンコーダ信号処理回路23及びモータ駆動回路25を、エンコーダ21b及びエンコーダ信号処理回路23b及びモータ駆動回路25bと記し、モータCのエンコーダ21及びエンコーダ信号処理回路23及びモータ駆動回路25を、エンコーダ21c及びエンコーダ信号処理回路23c及びモータ駆動回路25cと記す。   Specifically, the control system 1 of the present embodiment includes a control unit 10 that controls the motors A, B, and C, and an encoder 21 for each of the motors A, B, and C to be controlled as shown in FIG. And an encoder signal processing circuit 23 and a motor drive circuit 25. The control system 1 also includes a timer 27 that inputs an interrupt signal Ir to the control unit 10 at a predetermined cycle Ts. Hereinafter, the encoder 21, the encoder signal processing circuit 23, and the motor driving circuit 25 of the motor A are referred to as an encoder 21a, an encoder signal processing circuit 23a, and a motor driving circuit 25a, respectively, and the encoder 21 and the encoder signal processing circuit 23 of the motor B are described. The motor drive circuit 25 is referred to as an encoder 21b, an encoder signal processing circuit 23b, and a motor drive circuit 25b. The encoder 21, the encoder signal processing circuit 23, and the motor drive circuit 25 of the motor C are referred to as an encoder 21c, an encoder signal processing circuit 23c, and This is referred to as a motor drive circuit 25c.

この制御システム1が備えるモータA,B,Cのエンコーダ21は、周知のロータリーエンコーダ若しくはリニアエンコーダであり、対応するモータA,B,Cの回転に応じてパルス信号を出力する。パルス信号は、対応するモータA,B,Cのエンコーダ信号処理回路23に入力され、エンコーダ信号処理回路23は、このパルス信号に基づき、所定の時点(リセットされた時点)を基準としたモータA,B,Cの回転量(位置座標)X及びモータの回転速度Vを算出する。当該制御システム1を、上記印字機構100の制御システムに適用した場合、モータAの回転量は、キャリッジの位置座標を表し、モータB,Cの回転量は、用紙Pの搬送量を表すこととなる。   The encoders 21 of the motors A, B, and C included in the control system 1 are known rotary encoders or linear encoders, and output pulse signals according to the rotations of the corresponding motors A, B, and C. The pulse signal is input to the encoder signal processing circuit 23 of the corresponding motor A, B, C. The encoder signal processing circuit 23 is based on this pulse signal, and the motor A is based on a predetermined time (reset time). , B, C rotation amounts (position coordinates) X and motor rotation speed V are calculated. When the control system 1 is applied to the control system of the printing mechanism 100, the rotation amount of the motor A represents the position coordinate of the carriage, and the rotation amounts of the motors B and C represent the conveyance amount of the paper P. Become.

また、制御部10は、各モータA,B,Cのエンコーダ信号処理回路23で算出された回転量X及び回転速度Vを、制御量の情報としてエンコーダ信号処理回路23から取得し、この情報X,Vに基づき、モータをフィードバック制御する構成にされている。ここでは、フィードバック制御の具体的な態様についての説明を省略するが、制御部10は、周知の手法で、モータA,B,Cの回転量及び回転速度を、フィードバック制御する構成にすることができる。   In addition, the control unit 10 acquires the rotation amount X and the rotation speed V calculated by the encoder signal processing circuit 23 of each motor A, B, C from the encoder signal processing circuit 23 as control amount information, and this information X , V based on feedback control of the motor. Here, a description of a specific aspect of the feedback control is omitted, but the control unit 10 may be configured to perform feedback control on the rotation amount and the rotation speed of the motors A, B, and C by a known method. it can.

この制御部10は、各種演算処理を行うCPU11、CPU11が実行するプログラムを記憶するROM13、及び、プログラム実行時に作業領域として使用されるRAM15を有し、CPU11にてROM13が記憶するプログラムを実行することにより、各モータA,B,Cに対する操作量を算出し、これを対応するモータA,B,Cのモータ駆動回路25に設定して、モータ制御を実現する。   The control unit 10 includes a CPU 11 that performs various arithmetic processes, a ROM 13 that stores a program executed by the CPU 11, and a RAM 15 that is used as a work area when the program is executed. The CPU 11 executes a program stored in the ROM 13. Thus, the operation amount for each of the motors A, B, and C is calculated and set in the motor drive circuit 25 of the corresponding motors A, B, and C to realize motor control.

具体的に、本実施例の制御システム1は、各モータA,B,CをPWM制御する構成にされており、制御部10は、操作量として、PWM値を、モータ駆動回路25に設定する。換言すると、本実施例では、モータ駆動回路25が、設定された操作量(PWM値)に対応したデューティー比で、モータA,B,Cをオン/オフすることにより、モータの回転量及び回転速度が、操作量に対応した量に調整され、モータ制御が実現される。   Specifically, the control system 1 of the present embodiment is configured to perform PWM control on each of the motors A, B, and C, and the control unit 10 sets a PWM value as an operation amount in the motor drive circuit 25. . In other words, in this embodiment, the motor drive circuit 25 turns on and off the motors A, B, and C at a duty ratio corresponding to the set operation amount (PWM value), so that the motor rotation amount and rotation The speed is adjusted to an amount corresponding to the operation amount, and motor control is realized.

そして、このような制御により回転するモータA,B,Cの回転量X及び回転速度Vは、上述したように、対応するエンコーダ21及びエンコーダ信号処理回路23を通じて検出される。制御部10では、この検出値に基づき、新たな操作量が演算され、これがモータ駆動回路25に設定される。本実施例の制御システム1では、このような動作によって、各モータA,B,Cについてのモータ制御が実現される。   Then, the rotation amount X and the rotation speed V of the motors A, B, and C rotating by such control are detected through the corresponding encoder 21 and encoder signal processing circuit 23 as described above. In the control unit 10, a new operation amount is calculated based on this detection value, and this is set in the motor drive circuit 25. In the control system 1 of the present embodiment, motor control for each of the motors A, B, and C is realized by such an operation.

ここで、制御システム1にて実現されるモータ制御について、更に具体的に説明すると、本実施例では、タイマ27から制御部10に対し周期的に割込み信号Irを入力する。そして、制御部10に、割込み信号Irが入力される度、制御周期の到来したモータを検出させて、制御周期の到来したモータ毎に、制御量(エンコーダ信号処理回路23にて算出された回転量X,回転速度V)の取得動作、及び、モータ駆動回路25に対する操作量の設定動作を、実行させる。   Here, the motor control realized by the control system 1 will be described more specifically. In the present embodiment, the interrupt signal Ir is periodically input from the timer 27 to the control unit 10. Then, each time the interrupt signal Ir is input to the control unit 10, the motor that has reached the control cycle is detected, and the control amount (the rotation calculated by the encoder signal processing circuit 23) is determined for each motor that has reached the control cycle. The operation for obtaining the amount X and the rotation speed V) and the operation for setting the operation amount for the motor drive circuit 25 are executed.

また、本実施例では、このようにして複数のモータA,B,Cを制御するに先駆け、設計段階で、タイマ27から入力する割込み信号の入力周期Tsと、各モータA,B,Cの制御周期とを、次のようにして定める。図4は、割込み信号Irの入力周期Ts、モータAの制御周期Ts1、モータBの制御周期Ts2、及び、モータCの制御周期Ts3の設定手順を示した説明図である。   Further, in this embodiment, prior to controlling the plurality of motors A, B, and C in this way, the input period Ts of the interrupt signal input from the timer 27 and the motors A, B, and C at the design stage. The control cycle is determined as follows. FIG. 4 is an explanatory diagram showing a procedure for setting the input cycle Ts of the interrupt signal Ir, the control cycle Ts1 of the motor A, the control cycle Ts2 of the motor B, and the control cycle Ts3 of the motor C.

周期Ts,Ts1,Ts2,Ts3を設定するに当っては、図4に示すように、各モータA,B,Cの最適な制御周期Tr_A,Tr_B,Tr_Cの最大公約数Tmを導出し(手順[1])、導出した最大公約数Tmを、割込み信号の入力周期Tsに決定する(手順[2])。尚、最適な制御周期Tr_A,Tr_B,Tr_Cは、制御システム1に設定されるべき制御周期の理想値であり、設計者が試験や卓上計算により定めることができる。但し、ここでは、最大公約数Tmといった概念を用いるため、最大公約数Tmの導出に当っては、制御周期Tr_A,Tr_B,Tr_Cを、整数値のスケールに置換して、最大公約数Tmを導出する。   In setting the periods Ts, Ts1, Ts2, and Ts3, as shown in FIG. 4, the optimal common divisor Tm of the optimum control periods Tr_A, Tr_B, and Tr_C of the motors A, B, and C is derived (procedure). [1]), the derived greatest common divisor Tm is determined as the input period Ts of the interrupt signal (procedure [2]). Note that the optimum control cycles Tr_A, Tr_B, and Tr_C are ideal values of the control cycle to be set in the control system 1 and can be determined by a designer through a test or desktop calculation. However, since the concept such as the greatest common divisor Tm is used here, the greatest common divisor Tm is derived by substituting the control cycles Tr_A, Tr_B, and Tr_C with integer scales in deriving the greatest common divisor Tm. To do.

このようにして、最大公約数Tmを導出し入力周期Tsを決定すると、入力周期Tsは、最適な制御周期が最小のモータAの当該制御周期Tr_Aの整数(N)分の一となる。但し、本実施例では、モータAの最適な制御周期Tr_A、モータBの最適な制御周期T
r_B、モータCの最適な制御周期Tr_Cが、Tr_A≦Tr_B≦Tr_Cの関係を有しているものとする。
In this way, when the greatest common divisor Tm is derived and the input cycle Ts is determined, the input cycle Ts becomes an integer (N) of the control cycle Tr_A of the motor A having the minimum optimal control cycle. However, in this embodiment, the optimal control cycle Tr_A of the motor A and the optimal control cycle T of the motor B
It is assumed that the optimal control cycle Tr_C of r_B and motor C has a relationship of Tr_A ≦ Tr_B ≦ Tr_C.

Ts=Tr_A/N
ここで、モータB,Cの最適な制御周期Tr_B,Tr_Cが、制御周期Tr_Aの整数倍である場合には、パラメータNは、値1(N=1)に設定されることになる。しかしながら、3以上のモータを制御するシステムを構築する場合に、モータB,Cの最適な制御周期が、モータAの最適な制御周期Tr_Aの整数倍となることはまれであるので、入力周期Tsは、一般的に、制御周期Tr_Aの整数分の一であって、二分の一以下に設定されることになる。本実施例においては、この点が、割込み信号の入力周期Tsを、最適な制御周期が最小のモータAの当該制御周期Tr_Aに設定する従来技術と異なる点である。
Ts = Tr_A / N
Here, when the optimal control periods Tr_B and Tr_C of the motors B and C are integer multiples of the control period Tr_A, the parameter N is set to a value 1 (N = 1). However, when constructing a system that controls three or more motors, the optimal control cycle of the motors B and C is rarely an integer multiple of the optimal control cycle Tr_A of the motor A, and therefore the input cycle Ts. Is generally an integral part of the control period Tr_A and is set to a half or less. In the present embodiment, this point is different from the prior art in which the input cycle Ts of the interrupt signal is set to the control cycle Tr_A of the motor A having the minimum optimal control cycle.

本実施例では、このようにして、入力周期Tsを決定した後、決定した入力周期Tsを基準として、その整数倍に、モータA,B,Cの制御周期Ts1,Ts2,Ts3を定める。   In this embodiment, after determining the input period Ts in this way, the control periods Ts1, Ts2, and Ts3 of the motors A, B, and C are determined to be an integral multiple of the determined input period Ts.

具体的には、モータAの制御周期Ts1を、入力周期Tsの(Tr_A/Ts)倍に決定し、モータBの制御周期Ts2を、入力周期Tsの(Tr_B/Ts)倍に決定し、モータCの制御周期Ts3を、入力周期Tsの(Tr_C/Ts)倍に決定する(手順[3])。   Specifically, the control cycle Ts1 of the motor A is determined to be (Tr_A / Ts) times the input cycle Ts, the control cycle Ts2 of the motor B is determined to be (Tr_B / Ts) times the input cycle Ts, and the motor The C control cycle Ts3 is determined to be (Tr_C / Ts) times the input cycle Ts (procedure [3]).

また、手順[3]の終了後には、これらの決定内容に従って、割込み信号の入力周期Ts、モータAの制御周期Ts1、モータBの制御周期Ts2、モータCの制御周期Ts3を設定してなる制御システム1を構成する(手順[4])。   Further, after the completion of the procedure [3], the control is performed by setting the interrupt signal input cycle Ts, the motor A control cycle Ts1, the motor B control cycle Ts2, and the motor C control cycle Ts3 in accordance with these determination contents. The system 1 is configured (procedure [4]).

例えば、モータAの最適な制御周期Tr_Aに対し、モータBの最適な制御周期Tr_Bが(4・Tr_A/3)であり、モータCの最適な制御周期Tr_Cが(5・Tr_A/3)である場合には、割込み信号の入力周期をTs=Tr_A/3に設定し、モータAの制御周期をTs1=3・Tsに設定し、モータBの制御周期をTs2=4・Tsに設定し、モータCの制御周期をTs3=5・Tsに設定する。   For example, the optimal control cycle Tr_B of the motor B is (4 · Tr_A / 3) and the optimal control cycle Tr_C of the motor C is (5 · Tr_A / 3) with respect to the optimal control cycle Tr_A of the motor A. In this case, the input cycle of the interrupt signal is set to Ts = Tr_A / 3, the control cycle of the motor A is set to Ts1 = 3 · Ts, the control cycle of the motor B is set to Ts2 = 4 · Ts, The control cycle of C is set to Ts3 = 5 · Ts.

図5(a)は、上記のように周期Ts,Ts1,Ts2,Ts3を設定した際に、制御部10で算出される、モータAに対する操作量U1の演算期間T_a、モータBに対する操作量U2の演算期間T_b、モータCに対する操作量U3の演算期間T_c、のパターンを、時間軸に沿って記したタイムチャートである。上記のように周期Ts,Ts1,Ts2,Ts3が設定された場合、本実施例の制御システム1では、制御部10が、初回の割込みを0回目として、割込み回数CNTが3の倍数になる度、モータAに対する操作量を演算し、割込み回数CNTが4の倍数となる度、モータBに対する操作量を演算し、割込み回数CNTが5の倍数となる度、モータCに対する操作量を演算することになる。   FIG. 5A shows the calculation period T_a of the operation amount U1 for the motor A and the operation amount U2 for the motor B, which are calculated by the control unit 10 when the periods Ts, Ts1, Ts2, and Ts3 are set as described above. 5 is a time chart in which a pattern of the calculation period T_b of the motor C and the calculation period T_c of the operation amount U3 for the motor C is described along the time axis. When the periods Ts, Ts1, Ts2, and Ts3 are set as described above, in the control system 1 according to the present embodiment, the control unit 10 sets the number of interruptions CNT to be a multiple of 3 with the first interruption as the 0th. The operation amount for the motor A is calculated, the operation amount for the motor B is calculated every time the interrupt count CNT is a multiple of 4, and the operation amount for the motor C is calculated every time the interrupt count CNT is a multiple of 5. become.

但し、本実施例では、従来装置とは異なり、操作量の演算後に操作量を設定するのではなく、操作量を演算する前に、入出力処理(図6及び図7参照)を実行して、前もって算出したモータの操作量をモータ駆動回路25に設定する。図5(b)は、図5(a)に示す各モータの操作量の演算期間に、入出力処理の実行期間T_ioを組み込んだ実際の制御部10の動作態様を示したタイムチャートであり、各処理の実行期間T_io,T_a,T_b,T_cのパターンを記したタイムチャートである。   However, in this embodiment, unlike the conventional device, the input / output process (see FIGS. 6 and 7) is executed before the operation amount is calculated, instead of setting the operation amount after the operation amount is calculated. Then, the motor operation amount calculated in advance is set in the motor drive circuit 25. FIG. 5B is a time chart showing an actual operation mode of the control unit 10 in which the input / output processing execution period T_io is incorporated in the operation amount calculation period of each motor shown in FIG. It is a time chart which described the pattern of execution period T_io, T_a, T_b, T_c of each process.

即ち、本実施例では、周期Tsでタイマ27から割込み信号Irが入力される度、制御部10が、CPU11にて、図6及び図7に示す入出力処理を、割込み処理(例外処理)
として実行することにより、操作量の演算動作に優先した操作量の設定動作が実現される。図6及び図7は、制御部10が実行する入出力処理を表すフローチャートである。
In other words, in this embodiment, every time the interrupt signal Ir is input from the timer 27 at the cycle Ts, the control unit 10 causes the CPU 11 to perform the input / output processing shown in FIGS. 6 and 7 as interrupt processing (exception processing).
As a result, the operation amount setting operation with priority over the operation amount calculation operation is realized. 6 and 7 are flowcharts showing input / output processing executed by the control unit 10.

制御部10は、図6に示す入出力処理を開始すると、まず、制御周期がTs1=M1・TsのモータAについて、モータAの制御周期が到来したか否かを判断するため、割込み回数CNTを値M1で除算し、余りRを算出する(S110)。尚、制御部10は、割込み回数CNTの初期値をゼロとして、割込み信号Irが入力される度、S310で割込み回数CNTをカウントアップし、初回割込みを0回目とした割込み回数CNTをRAM15に記憶する構成にされている。   When the control unit 10 starts the input / output process shown in FIG. 6, first, for the motor A whose control cycle is Ts1 = M1 · Ts, the control unit 10 determines whether the control cycle of the motor A has arrived. Is divided by the value M1, and the remainder R is calculated (S110). The control unit 10 sets the initial value of the interrupt count CNT to zero, and whenever the interrupt signal Ir is input, the control section 10 increments the interrupt count CNT in S310, and stores the interrupt count CNT with the first interrupt as the zeroth in the RAM 15. It is configured to be.

そして、余りRの算出後には、S120に移行し、余りRが値ゼロであるか否かを判断することにより、モータAの制御周期が到来したか否かを判断する。
例えば、制御周期Ts1=3・Tsである場合には、割込み回数CNTを3で除算して余りRを算出し、余りRがゼロであるか否かを判断することにより、割込み回数CNTが3の倍数であるか否かを判断する。そして、余りRがゼロである場合には、割込み回数CNTが3の倍数であり、制御周期が到来したと判断して(S120でYes)、S130に移行する。一方、余りRがゼロではない場合には、制御周期が到来していないと判断して(S120でNo)、S160に移行する。
Then, after calculating the remainder R, the process proceeds to S120, and it is determined whether the control period of the motor A has arrived by determining whether the remainder R is zero.
For example, when the control cycle Ts1 = 3 · Ts, the interrupt count CNT is calculated by dividing the interrupt count CNT by 3 to calculate the remainder R, and determining whether the remainder R is zero. It is determined whether it is a multiple of. If the remainder R is zero, it is determined that the interrupt count CNT is a multiple of 3 and the control period has arrived (Yes in S120), and the process proceeds to S130. On the other hand, if the remainder R is not zero, it is determined that the control cycle has not arrived (No in S120), and the process proceeds to S160.

また、S160に移行すると、制御部10は、RAM15に記憶するモータAの処理開始フラグFG_Aをゼロにリセットし(FG_A=0)、その後、S170に移行する。
一方、S130に移行すると、制御部10は、RAM15に記憶されたモータAに対する操作量U1を、RAM15から読み出し、これをモータAのモータ駆動回路25aに設定する。
In S160, the control unit 10 resets the process start flag FG_A of the motor A stored in the RAM 15 to zero (FG_A = 0), and then proceeds to S170.
On the other hand, when the process proceeds to S <b> 130, the control unit 10 reads the operation amount U <b> 1 for the motor A stored in the RAM 15 from the RAM 15 and sets it in the motor drive circuit 25 a of the motor A.

尚、本実施例の制御システム1は、モータ制御に先立って、制御部10により初期化処理を実行し、モータAに対する操作量U1、モータBに対する操作量U2、モータCに対する操作量U3として、初期値ゼロを設定し、これをRAM15に記憶する構成にされている。   Prior to motor control, the control system 1 according to the present embodiment executes initialization processing by the control unit 10, and includes an operation amount U1 for the motor A, an operation amount U2 for the motor B, and an operation amount U3 for the motor C. An initial value of zero is set and stored in the RAM 15.

従って、制御部10は、初回のS130の実行時、モータ駆動回路25aに対して操作量ゼロを設定することになる。一方、本実施例において、RAM15が記憶する操作量U1は、モータ制御の実行過程で、逐次更新される。従って、2回目以降については、更新された操作量U1が、制御部10の動作により、モータ駆動回路25aに設定されることになる。   Therefore, the control unit 10 sets the operation amount to zero for the motor drive circuit 25a during the first execution of S130. On the other hand, in this embodiment, the operation amount U1 stored in the RAM 15 is sequentially updated in the process of executing motor control. Accordingly, for the second and subsequent times, the updated operation amount U1 is set in the motor drive circuit 25a by the operation of the control unit 10.

S130で、操作量としてゼロより大きい値がモータ駆動回路25aに設定された場合、モータ駆動回路25aは、操作量に対応するデューティー比でモータAをオン/オフして、モータAを駆動する。一方、操作量として値ゼロが設定された場合、モータ駆動回路25aは、実質的に、モータAを駆動することなく、操作量が更新されるまで待機する。   In S130, when a value larger than zero is set as the operation amount in the motor drive circuit 25a, the motor drive circuit 25a drives the motor A by turning on / off the motor A at a duty ratio corresponding to the operation amount. On the other hand, when a value of zero is set as the operation amount, the motor drive circuit 25a waits until the operation amount is updated without actually driving the motor A.

S130での処理を終えると、制御部10は、S140に移行し、モータAのエンコーダ信号処理回路23aから、エンコーダ信号処理回路23aが保持するモータAの回転量X及び回転速度Vを取得し、これをRAM15に記憶する。尚、エンコーダ信号処理回路23aにて算出されるモータAの回転量X及び回転速度Vを、以下では、回転量X1及び回転速度V1と表記する。   When the processing in S130 is completed, the control unit 10 proceeds to S140, and acquires the rotation amount X and the rotation speed V of the motor A held by the encoder signal processing circuit 23a from the encoder signal processing circuit 23a of the motor A, This is stored in the RAM 15. The rotation amount X and the rotation speed V of the motor A calculated by the encoder signal processing circuit 23a are hereinafter referred to as a rotation amount X1 and a rotation speed V1.

また、S140での処理を終えると、制御部10は、S150に移行し、モータAの処
理開始フラグFG_Aを値1にセットする(FG_A=1)。その後、S170に移行する。
When the process in S140 is completed, the control unit 10 proceeds to S150, and sets the process start flag FG_A of the motor A to a value 1 (FG_A = 1). Thereafter, the process proceeds to S170.

また、S170に移行すると、制御部10は、制御周期がTs2=M2・TsのモータBについて、S110の処理と同様の処理を実行する。即ち、制御部10は、モータBの制御周期が到来したか否かを判断するために、割込み回数CNTを値M2で除算し、余りRを算出する(S170)。そして、余りRの算出後には、S180に移行し、余りRが値ゼロであるか否かを判断することにより、モータBの制御周期が到来したか否かを判断する。   In S170, the control unit 10 executes the same process as the process of S110 for the motor B whose control cycle is Ts2 = M2 · Ts. That is, in order to determine whether or not the control cycle of the motor B has arrived, the control unit 10 divides the interrupt count CNT by the value M2 and calculates the remainder R (S170). Then, after calculating the remainder R, the process proceeds to S180, and it is determined whether the control period of the motor B has arrived by determining whether the remainder R is zero.

例えば、制御周期Ts2=4・Tsである場合には、割込み回数CNTを4で除算して余りRを算出し、余りRがゼロであるか否かを判断することにより、割込み回数CNTが4の倍数であるか否かを判断する。そして、余りRがゼロである場合には、割込み回数CNTが4の倍数であり、モータBの制御周期が到来したと判断して(S180でYes)、S190に移行する。一方、余りRがゼロではない場合には、制御周期が到来していないと判断して(S180でNo)、S220に移行する。   For example, when the control cycle Ts2 = 4 · Ts, the interrupt count CNT is calculated by dividing the interrupt count CNT by 4 to calculate the remainder R, and determining whether the remainder R is zero. It is determined whether it is a multiple of. If the remainder R is zero, it is determined that the interrupt count CNT is a multiple of 4 and the control cycle of the motor B has arrived (Yes in S180), and the flow proceeds to S190. On the other hand, if the remainder R is not zero, it is determined that the control cycle has not arrived (No in S180), and the process proceeds to S220.

また、S220に移行すると、制御部10は、RAM15に記憶するモータBの処理開始フラグFG_Bをゼロにリセットし(FG_B=0)、その後、S230に移行する。一方、S190に移行すると、制御部10は、RAM15に記憶されたモータBに対する操作量U2を、RAM15から読み出し、これをモータBのモータ駆動回路25bに設定する。   In S220, the control unit 10 resets the motor B processing start flag FG_B stored in the RAM 15 to zero (FG_B = 0), and then proceeds to S230. On the other hand, when the process proceeds to S190, the control unit 10 reads the operation amount U2 for the motor B stored in the RAM 15 from the RAM 15, and sets it in the motor drive circuit 25b of the motor B.

具体的に、制御部10は、初回のS190の実行時、モータ駆動回路25bに対して操作量ゼロを設定する。一方、RAM15が記憶する操作量U2については、モータ制御の実行過程で逐次更新されるので、2回目以降では、更新された操作量U2を、モータ駆動回路25bに設定する。   Specifically, the control unit 10 sets the operation amount to zero for the motor drive circuit 25b during the first execution of S190. On the other hand, since the operation amount U2 stored in the RAM 15 is sequentially updated in the course of motor control, the updated operation amount U2 is set in the motor drive circuit 25b in the second and subsequent times.

S190で、操作量としてゼロより大きい値がモータ駆動回路25bに設定された場合、モータ駆動回路25bは、操作量に対応するデューティー比でモータBをオン/オフして、モータBを駆動する。一方、操作量として値ゼロが設定された場合、モータ駆動回路25bは、実質的に、モータBを駆動することなく、操作量が更新されるまで待機する。   In S190, when a value larger than zero is set as the operation amount in the motor drive circuit 25b, the motor drive circuit 25b drives the motor B by turning on / off the motor B at a duty ratio corresponding to the operation amount. On the other hand, when a value of zero is set as the operation amount, the motor drive circuit 25b waits until the operation amount is updated without actually driving the motor B.

S190での処理を終えると、制御部10は、S200に移行し、モータBのエンコーダ信号処理回路23bから、エンコーダ信号処理回路23bが保持するモータBの回転量X及び回転速度Vを取得し、これをRAM15に書き込む。尚、エンコーダ信号処理回路23bにて算出されるモータBの回転量X及び回転速度Vを、以下では、回転量X2及び回転速度V2と表記する。   When the processing in S190 is completed, the control unit 10 proceeds to S200, acquires the rotation amount X and the rotation speed V of the motor B held by the encoder signal processing circuit 23b from the encoder signal processing circuit 23b of the motor B, This is written into the RAM 15. In addition, the rotation amount X and the rotation speed V of the motor B calculated by the encoder signal processing circuit 23b are expressed as a rotation amount X2 and a rotation speed V2 below.

また、S200での処理を終えると、制御部10は、S210に移行し、モータBの処理開始フラグFG_Bを値1にセットする(FG_B=1)。その後、S230に移行する。   When the process in S200 ends, the control unit 10 proceeds to S210, and sets the process start flag FG_B of the motor B to a value 1 (FG_B = 1). Thereafter, the process proceeds to S230.

また、S230に移行すると、制御部10は、制御周期がTs3=M3・TsのモータCについて、S110の処理と同様の処理を実行する。即ち、制御部10は、モータCの制御周期が到来したか否かを判断するために、割込み回数CNTを値M3で除算し、余りRを算出する(S230)。そして、余りRの算出後には、S240に移行し、余りRが値ゼロであるか否かを判断することにより、モータCの制御周期が到来したか否かを判断する。   When the process proceeds to S230, the control unit 10 executes the same process as the process of S110 for the motor C whose control cycle is Ts3 = M3 · Ts. That is, in order to determine whether the control cycle of the motor C has arrived, the control unit 10 divides the number of interruptions CNT by the value M3 and calculates the remainder R (S230). Then, after calculating the remainder R, the process proceeds to S240, and it is determined whether or not the control period of the motor C has arrived by determining whether or not the remainder R is zero.

例えば、制御周期Ts3=5・Tsである場合には、割込み回数CNTを5で除算して余りRを算出し、余りRがゼロであるか否かを判断することにより、割込み回数CNTが5の倍数であるか否かを判断する。そして、余りRがゼロである場合には、割込み回数CNTが5の倍数であり、モータCの制御周期が到来したと判断して(S240でYes)、S250に移行する。一方、余りRがゼロではない場合には、制御周期が到来していないと判断して(S240でNo)、S280に移行する。   For example, when the control cycle Ts3 = 5 · Ts, the interrupt count CNT is calculated by dividing the interrupt count CNT by 5 to calculate the remainder R, and determining whether the remainder R is zero. It is determined whether it is a multiple of. If the remainder R is zero, it is determined that the number of interruptions CNT is a multiple of 5 and the control cycle of the motor C has arrived (Yes in S240), and the flow proceeds to S250. On the other hand, if the remainder R is not zero, it is determined that the control period has not arrived (No in S240), and the process proceeds to S280.

また、S280に移行すると、制御部10は、RAM15に記憶するモータCの処理開始フラグFG_Cをゼロにリセットし(FG_C=0)、その後、S290に移行する。一方、S250に移行すると、制御部10は、RAM15に記憶されたモータCに対する操作量U3を、RAM15から読み出し、これをモータCのモータ駆動回路25cに設定する。   When the process proceeds to S280, the control unit 10 resets the process start flag FG_C of the motor C stored in the RAM 15 to zero (FG_C = 0), and then the process proceeds to S290. On the other hand, when the process proceeds to S250, the control unit 10 reads the operation amount U3 for the motor C stored in the RAM 15 from the RAM 15, and sets this in the motor drive circuit 25c of the motor C.

具体的に、制御部10は、初回のS250の実行時、モータ駆動回路25cに対して操作量ゼロを設定する。一方、RAM15が記憶する操作量U3については、モータ制御の実行過程で、更新されるので、2回目以降については、更新された操作量U3を、モータ駆動回路25cに設定する。   Specifically, the control unit 10 sets the operation amount to zero for the motor drive circuit 25c when executing S250 for the first time. On the other hand, since the operation amount U3 stored in the RAM 15 is updated in the course of motor control, the updated operation amount U3 is set in the motor drive circuit 25c for the second and subsequent times.

S250で、操作量としてゼロより大きい値がモータ駆動回路25cに設定された場合、モータ駆動回路25cは、操作量に対応するデューティー比でモータCをオン/オフして、モータCを駆動する。一方、操作量として値ゼロが設定された場合、モータ駆動回路25cは、実質的に、モータCを駆動することなく、操作量が更新されるまで待機する。   In S250, when a value larger than zero is set as the operation amount in the motor drive circuit 25c, the motor drive circuit 25c drives the motor C by turning on / off the motor C at a duty ratio corresponding to the operation amount. On the other hand, when a value of zero is set as the operation amount, the motor drive circuit 25c waits until the operation amount is updated without actually driving the motor C.

S250での処理を終えると、制御部10は、S260に移行し、モータCのエンコーダ信号処理回路23cから、エンコーダ信号処理回路23cが保持するモータCの回転量X及び回転速度Vを取得し、これをRAM15に書き込む。尚、エンコーダ信号処理回路23cにて算出されるモータCの回転量X及び回転速度Vを、以下では、回転量X3及び回転速度V3と表記する。   When the processing in S250 is completed, the control unit 10 proceeds to S260, acquires the rotation amount X and the rotation speed V of the motor C held by the encoder signal processing circuit 23c from the encoder signal processing circuit 23c of the motor C, This is written into the RAM 15. Note that the rotation amount X and the rotation speed V of the motor C calculated by the encoder signal processing circuit 23c are hereinafter referred to as a rotation amount X3 and a rotation speed V3.

また、S260での処理を終えると、制御部10は、S270に移行し、モータCの処理開始フラグFG_Cを値1にセットする(FG_C=1)。その後、S290に移行する。   When the process in S260 is completed, the control unit 10 proceeds to S270, and sets the process start flag FG_C of the motor C to a value 1 (FG_C = 1). Thereafter, the process proceeds to S290.

また、S290に移行すると、制御部10は、上述の処理にて、処理開始フラグFG_A,FG_B,FG_Cのいずれかがセットされた(値1に設定された)か否かを判断し、処理開始フラグFG_A,FG_B,FG_Cのいずれかがセットされた(値1に設定された)と判断すると(S290でYes)、S300に移行し、実行待ちキューに、操作量演算処理タスク(詳細後述。図8参照)を登録する。   In S290, the control unit 10 determines whether or not any of the process start flags FG_A, FG_B, and FG_C is set (set to value 1) in the above-described process, and starts the process. If it is determined that any of the flags FG_A, FG_B, and FG_C is set (set to a value of 1) (Yes in S290), the process proceeds to S300, and an operation amount calculation processing task (details will be described later) is placed in the execution waiting queue. 8) is registered.

尚、制御部10は、割込み信号を受けて例外処理(入出力処理等)を実行するとき以外は、基本的に、実行待ちキューに登録されたタスクを、登録順に実行する構成にされている。また、割込み信号を受けて例外処理を実行する場合には、実行中のタスクを一旦中断して、例外処理を優先的に実行した後、中断したタスクを再開する構成にされている。   The control unit 10 is basically configured to execute the tasks registered in the execution queue in the order of registration except when executing exception processing (input / output processing, etc.) in response to an interrupt signal. . When exception processing is executed in response to an interrupt signal, a task being executed is temporarily interrupted, the exception processing is preferentially executed, and then the interrupted task is resumed.

S300での処理を終えると、制御部10は、S310に移行する。一方、S290で、処理開始フラグFG_A,FG_B,FG_Cが全てリセットされている(値0に設定されている)と判断すると(S290でNo)、S300の処理を実行することなく、S310に移行する。   After finishing the process in S300, the control unit 10 proceeds to S310. On the other hand, if it is determined in S290 that the process start flags FG_A, FG_B, and FG_C are all reset (set to 0) (No in S290), the process proceeds to S310 without executing the process of S300. .

また、S310に移行すると、制御部10は、割込み回数CNTを1加算した値に更新
し(CNT←CNT+1)、その後、割込み回数CNTが値M1,M2,M3の最小公倍数であるか否かを判断する(S320)。尚、本実施例では、割込み信号の入力周期Tsが上述のように設定される関係上、M1,M2,M3に1以外の公約数は存在しないので、ここでは、具体的に、割込み回数CNTが、M1・M2・M3であるか否かを判断する。
In S310, the control unit 10 updates the interrupt count CNT to a value obtained by adding 1 (CNT ← CNT + 1), and then determines whether the interrupt count CNT is the least common multiple of the values M1, M2, and M3. Judgment is made (S320). In the present embodiment, since the interrupt signal input cycle Ts is set as described above, there is no common divisor other than 1 in M1, M2, and M3. Is determined to be M1, M2, or M3.

そして、制御部10は、割込み回数CNTが値M1,M2,M3の最小公倍数であると判断すると(S320でYes)、S330に移行し、割込み回数CNTを値ゼロに更新した後、当該入出処理を終了する。一方、割込み回数CNTが値M1,M2,M3の最小公倍数ではないと判断すると(S320でNo)、S330の処理を実行することなく、当該入出力処理を終了する。   When the control unit 10 determines that the interrupt count CNT is the least common multiple of the values M1, M2, and M3 (Yes in S320), the control unit 10 proceeds to S330, updates the interrupt count CNT to the value zero, and then performs the entry / exit processing. Exit. On the other hand, when it is determined that the interrupt count CNT is not the least common multiple of the values M1, M2, and M3 (No in S320), the input / output process is terminated without executing the process of S330.

以上に、入出力処理の手順を説明したが、制御部10は、上記入出力処理を、割込み信号Irがタイマ27から入力される度、他のタスクに優先して実行する。従って、本実施例の制御システム1においては、図5(b)に示すように、周期Ts毎に、制御量の取得動作及び操作量の設定動作が遅延なく実行されることになる。   Although the input / output processing procedure has been described above, the control unit 10 executes the input / output processing with priority over other tasks each time the interrupt signal Ir is input from the timer 27. Therefore, in the control system 1 of the present embodiment, as shown in FIG. 5B, the control amount acquisition operation and the operation amount setting operation are executed without delay every cycle Ts.

この他、本実施例の制御システム1では、制御周期の到来したモータが存在する場合、上述したように、入出力処理にて、操作量演算処理タスクを、実行待ちキューに登録するので、この入出力処理の実行後には、制御部10にて、操作量演算処理タスクが実行されることになる。図8は、制御部10のCPU11により実行される操作量演算処理タスクの処理手順を表すフローチャートである。   In addition, in the control system 1 of the present embodiment, when there is a motor that has reached the control cycle, as described above, the operation amount calculation processing task is registered in the execution queue in the input / output processing. After the input / output process is executed, the control unit 10 executes an operation amount calculation processing task. FIG. 8 is a flowchart illustrating a processing procedure of an operation amount calculation processing task executed by the CPU 11 of the control unit 10.

操作量演算処理タスクを開始すると、制御部10は、まず、入出力処理にて設定された処理開始フラグFG_Aの値を、ローカルフラグFL_Aに設定すると共に、処理開始フラグFG_Bの値を、ローカルフラグFL_Bに設定し、更に、処理開始フラグFG_Cの値を、ローカルフラグFL_Cに設定する(S410)。   When the operation amount calculation processing task is started, the control unit 10 first sets the value of the processing start flag FG_A set in the input / output processing to the local flag FL_A, and sets the value of the processing start flag FG_B to the local flag. The value is set to FL_B, and the value of the processing start flag FG_C is set to the local flag FL_C (S410).

その後、S420に移行して、フラグFL_Aが値1に設定されているか否かを判断し、フラグFL_Aが値1に設定されていると判断すると(S420でYes)、モータAの制御周期が到来しているとして、S430に移行し、入出力処理にてエンコーダ信号処理回路23aから読み出されたモータAの回転量X1及び回転速度V1の情報に基づき、目標回転量及び目標回転速度に対応したモータAに対する操作量U1を算出する。そして、算出した操作量U1を、RAM15に記録する(S435)。その後、S440に移行する。   Thereafter, the process proceeds to S420, where it is determined whether or not the flag FL_A is set to the value 1, and when it is determined that the flag FL_A is set to the value 1 (Yes in S420), the control cycle of the motor A has arrived. As a result, the process proceeds to S430, and the target rotation amount and the target rotation speed are handled based on the information about the rotation amount X1 and the rotation speed V1 of the motor A read from the encoder signal processing circuit 23a in the input / output process. An operation amount U1 for the motor A is calculated. Then, the calculated operation amount U1 is recorded in the RAM 15 (S435). Thereafter, the process proceeds to S440.

一方、S420で、フラグFL_Aが値ゼロに設定されていると判断すると(S420でNo)、制御部10は、S430,S435の処理を実行することなく、S440に移行する。   On the other hand, if it is determined in S420 that the flag FL_A is set to zero (No in S420), the control unit 10 proceeds to S440 without executing the processes of S430 and S435.

また、S440に移行すると、制御部10は、フラグFL_Bが値1に設定されているか否かを判断し、フラグFL_Bが値1に設定されていると判断すると(S440でYes)、モータBの制御周期が到来しているとして、S450に移行し、上記入出力処理でエンコーダ信号処理回路23bから読み出されたモータBの回転量X2及び回転速度V2の情報に基づき、目標回転量及び目標回転速度に対応したモータBに対する操作量U2を算出する。そして、算出した操作量U2を、RAM15に記録する(S455)。その後、S460に移行する。   When the process proceeds to S440, the control unit 10 determines whether or not the flag FL_B is set to the value 1, and determines that the flag FL_B is set to the value 1 (Yes in S440), the motor B Assuming that the control cycle has arrived, the process proceeds to S450, and the target rotation amount and the target rotation are based on the information on the rotation amount X2 and the rotation speed V2 of the motor B read from the encoder signal processing circuit 23b in the input / output processing. An operation amount U2 for the motor B corresponding to the speed is calculated. Then, the calculated operation amount U2 is recorded in the RAM 15 (S455). Thereafter, the process proceeds to S460.

一方、S440で、フラグFL_Bが値ゼロに設定されていると判断すると(S440でNo)、制御部10は、S450,S455の処理を実行することなく、S460に移
行する。
On the other hand, if it is determined in S440 that the flag FL_B is set to zero (No in S440), the control unit 10 proceeds to S460 without executing the processes of S450 and S455.

また、S460に移行すると、制御部10は、フラグFL_Cが値1に設定されているか否かを判断し、フラグFL_Cが値1に設定されていると判断すると(S460でYes)、モータCの制御周期が到来しているとして、S470に移行し、上記入出力処理でエンコーダ信号処理回路23cから読み出されたモータCの回転量X3及び回転速度V3の情報に基づき、目標回転量及び目標回転速度に対応したモータCに対する操作量U3を算出する。そして、算出した操作量U3を、RAM15に記録する(S475)。その後、当該操作量演算処理タスクを終了する。   When the process proceeds to S460, the control unit 10 determines whether or not the flag FL_C is set to a value 1, and determines that the flag FL_C is set to a value 1 (Yes in S460), the motor C Assuming that the control cycle has arrived, the process proceeds to S470, and the target rotation amount and the target rotation are based on the information on the rotation amount X3 and the rotation speed V3 of the motor C read from the encoder signal processing circuit 23c in the input / output processing. An operation amount U3 for the motor C corresponding to the speed is calculated. Then, the calculated operation amount U3 is recorded in the RAM 15 (S475). Thereafter, the operation amount calculation processing task ends.

一方、S460で、フラグFL_Cが値ゼロに設定されていると判断すると(S460でNo)、制御部10は、S470,S475の処理を実行することなく、当該操作量演算処理タスクを終了する。   On the other hand, if it is determined in S460 that the flag FL_C is set to zero (No in S460), the control unit 10 ends the operation amount calculation processing task without executing the processing of S470 and S475.

以上、本実施例の制御システム1の構成及び動作について説明したが、本実施例の制御システム1では、上述したように、割込み信号Irが制御部10に入力されて、入出力処理が制御部10にて実行されたときに、操作量演算処理タスクが、実行待ちキューに登録され、この入出力処理の実行後に、実行される。   The configuration and operation of the control system 1 according to the present embodiment have been described above. However, in the control system 1 according to the present embodiment, as described above, the interrupt signal Ir is input to the control unit 10 and input / output processing is performed by the control unit. When executed at 10, the operation amount calculation processing task is registered in the execution waiting queue, and is executed after execution of this input / output processing.

具体的に、本実施例では、モータAの制御周期がTs1=3・Tsに設定され、モータBの制御周期がTs2=4・Tsに設定され、モータCの制御周期がTs3=5・Tsに設定されている場合、図5(b)に示すパターンで、制御部10が、入出力処理及び操作量演算処理タスクを実行する。尚、操作量演算処理タスクの実行期間は、図5(b)において、操作量の演算期間T_a,T_b,T_cのひとまとまりに対応する。   Specifically, in this embodiment, the control cycle of the motor A is set to Ts1 = 3 · Ts, the control cycle of the motor B is set to Ts2 = 4 · Ts, and the control cycle of the motor C is set to Ts3 = 5 · Ts. In the case shown in FIG. 5B, the control unit 10 executes an input / output process and an operation amount calculation process task in the pattern shown in FIG. The operation amount calculation processing task execution period corresponds to a group of operation amount calculation periods T_a, T_b, and T_c in FIG.

このように、本実施例では、制御周期の到来時に、次の制御周期の到来時に設定すべき操作量を予め算出して、RAM15に記録し、割込み信号Irが入力されたとき、優先的に入出力処理を実行して、制御量を取得すると共に、RAM15に記録しておいた操作量をモータ駆動回路25に設定する。従って、この制御システム1によれば、操作量の演算時間の揺動が、制御量の取得動作及び操作量の設定動作の実行時期に影響を与えることがなく、安定的に、一定周期で、制御量の取得動作及び操作量の設定動作を実行することができる。よって、本実施例によれば、各モータA,B,Cを、単一の制御部10にて精度よく制御することができる。   As described above, in this embodiment, when the control cycle arrives, the operation amount to be set when the next control cycle arrives is calculated in advance and recorded in the RAM 15, and when the interrupt signal Ir is input, it is preferentially used. An input / output process is executed to acquire a control amount, and an operation amount recorded in the RAM 15 is set in the motor drive circuit 25. Therefore, according to the control system 1, the fluctuation of the operation amount calculation time does not affect the execution timing of the control amount acquisition operation and the operation amount setting operation, and stably and at a constant cycle. A control amount acquisition operation and an operation amount setting operation can be executed. Therefore, according to the present embodiment, the motors A, B, and C can be accurately controlled by the single controller 10.

この点について、図9を用いて具体的に説明する。図9(a)は、本実施例の制御システム1における入出力処理の実行期間T_io、操作量U1の演算期間T_a、操作量U2の演算期間T_bの例を、横軸を時間軸として記したものである。一方、図9(b)は、従来の制御システムにおいて、制御部が算出するモータAに対する操作量U1の演算期間T_a、モータBに対する操作量U2の演算期間T_b、及び、制御量の取得期間T_i及び操作量の設定期間T_oの例を、横軸を時間軸として記したものである。   This point will be specifically described with reference to FIG. FIG. 9A shows an example of the input / output processing execution period T_io, the operation amount U1 calculation period T_a, and the operation amount U2 calculation period T_b in the control system 1 of the present embodiment, with the horizontal axis as the time axis. Is. On the other hand, FIG. 9B shows a calculation period T_a of the operation amount U1 for the motor A, a calculation period T_b of the operation amount U2 for the motor B, and a control amount acquisition period T_i calculated by the control unit in the conventional control system. In the example of the operation amount setting period T_o, the horizontal axis is a time axis.

図9(b)に示すように、従来システムでは、割込み信号が入力されると、制御部が、まず、モータAの制御量を取得して(期間T_i)、その後、モータAの操作量を算出し(期間T_a)、ここで算出した操作量をモータ駆動回路25aに設定し(期間T_o)、更に、制御周期の到来したモータが複数ある場合には、次のモータBの制御量を取得し(期間T_i)、その後、モータBの操作量を算出し(期間T_b)、その後、算出した操作量をモータ駆動回路25bに設定する(期間T_o)。   As shown in FIG. 9B, in the conventional system, when an interrupt signal is input, the control unit first obtains the control amount of the motor A (period T_i), and then determines the operation amount of the motor A. Calculate (period T_a), set the calculated operation amount in the motor drive circuit 25a (period T_o), and acquire the control amount of the next motor B when there are a plurality of motors whose control cycles have arrived. (Period T_i), then, the operation amount of the motor B is calculated (period T_b), and then the calculated operation amount is set in the motor drive circuit 25b (period T_o).

従って、従来システムでは、例えば、モータAについての操作量U1の演算が通常(図9(b)上段)よりも遅れると(図9(b)下段)、操作量U1の設定動作が遅れるばか
りでなく、後続のモータBについての制御量の取得動作及び操作量U2の設定動作までもが遅れ、各モータについての制御量の取得動作及び操作量の設定動作を一定周期Tsで、正確に実行することができない。特に、制御周期が到来したモータが、多数ある場合には、優先順位の低いモータについての制御量の取得動作及び操作量の設定動作の実行時期が、優先順位の高いモータについての操作量演算動作の延長によって、累積的に大きく変化する。従って、優先順位の低いモータについての制御性能は、従来システムの場合、大きく劣化する。
Therefore, in the conventional system, for example, if the calculation of the operation amount U1 for the motor A is delayed from the normal (the upper stage in FIG. 9B) (the lower stage in FIG. 9B), the setting operation of the operation amount U1 is only delayed. In addition, the control amount acquisition operation and the operation amount U2 setting operation for the subsequent motor B are delayed, and the control amount acquisition operation and the operation amount setting operation for each motor are accurately executed at a constant cycle Ts. I can't. In particular, when there are a large number of motors whose control cycle has arrived, the operation amount calculation operation for a motor with a high priority is performed when the control amount acquisition operation and the operation amount setting operation for a motor with a low priority are executed. By the extension of, it will change greatly cumulatively. Therefore, the control performance of a motor with a low priority is greatly deteriorated in the case of the conventional system.

一方、本実施例の制御システム1では、図9(a)に示すように、割込み信号が入力される度、制御量の取得動作及び操作量の設定動作(T_io)を、操作量の演算動作(T_a,T_b)に優先して実行するので、この制御システム1によれば、操作量の演算時間が通常(図9(a)上段)より延びても(図9(a)下段)、制御量の取得動作及び操作量の設定動作の実行周期を、一定に保つことができる。また、制御周期の到来したモータが複数ある場合でも、全モータの操作量の演算動作に先駆けて、入出力処理(T_io)を実行するので、他のモータの演算時間の延長により、各モータの制御量の取得動作及び操作量の設定動作の実行周期が揺動することがない。   On the other hand, in the control system 1 of this embodiment, as shown in FIG. 9A, every time an interrupt signal is input, the control amount acquisition operation and the operation amount setting operation (T_io) are performed as the operation amount calculation operation. (T_a, T_b) is executed with priority, and according to the control system 1, even if the operation amount calculation time is longer than normal (FIG. 9 (a) upper stage) (FIG. 9 (a) lower stage), control is performed. The execution cycle of the amount acquisition operation and the operation amount setting operation can be kept constant. Even when there are a plurality of motors that have reached the control cycle, the input / output process (T_io) is executed prior to the calculation operation of the operation amount of all the motors. The execution period of the control amount acquisition operation and the operation amount setting operation does not fluctuate.

従って、本実施例の制御システム1によれば、従来よりも精度よく、各モータの制御量の取得動作及び操作量の設定動作を、周期的に実行することができ、結果として、各モータを高精度に制御することができるのである。   Therefore, according to the control system 1 of the present embodiment, the control amount acquisition operation and the operation amount setting operation of each motor can be periodically executed with higher accuracy than before. It can be controlled with high accuracy.

また、本実施例では、操作量U1,U2,U3の算出に、通常より時間がかかり、次の割込み信号の入力時刻までに、操作量演算処理タスクが終了しない場合、実行中の操作量演算処理タスクを中断して、入出力処理を優先的に実行するようにした。従って、本実施例の制御システム1によれば、このような場合でも、操作量の演算時間の延びが、制御量の取得動作及び操作量の設定動作の実行時期に影響を与えることがなく、安定的に、一定周期で、制御量の取得動作及び操作量の設定動作を実行することができる。   In this embodiment, the calculation of the operation amount U1, U2, U3 takes more time than usual, and if the operation amount calculation processing task does not end by the input time of the next interrupt signal, the operation amount calculation being executed is performed. The processing task was interrupted and I / O processing was executed preferentially. Therefore, according to the control system 1 of the present embodiment, even in such a case, the extension of the operation amount calculation time does not affect the execution time of the control amount acquisition operation and the operation amount setting operation, The control amount acquisition operation and the operation amount setting operation can be executed stably and at regular intervals.

図10は、次の割込み信号の入力時刻までに、操作量演算処理タスクが終了しない場合の例を、横軸を時間軸とし、時間軸に沿って各処理の実行期間T_io,T_a,T_b,T_cを示して、記したものである。   FIG. 10 shows an example in which the operation amount calculation processing task does not end by the input time of the next interrupt signal, with the horizontal axis as the time axis, and the execution periods T_io, T_a, T_b, T_c is shown and described.

本実施例では、このような場合でも、図10下段に示すように、入出力処理を優先して実行することにより、制御量の取得動作及び操作量の設定動作を、時間Tsで周期的に実行する。また、本実施例では、操作量を時間Ts内に算出することができない場合でも、入出力処理の終了後、図10下段に示すように、操作量演算処理タスクを中断地点から再開する。   In this embodiment, even in such a case, the control amount acquisition operation and the operation amount setting operation are periodically performed at time Ts by performing the input / output processing with priority as shown in the lower part of FIG. Execute. Further, in this embodiment, even when the operation amount cannot be calculated within the time Ts, the operation amount calculation processing task is resumed from the interruption point as shown in the lower part of FIG.

従って、本実施例の制御システム1によれば、操作量の演算が長引いた場合でも、次回の制御周期の到来時までに、各モータの操作量U1,U2,U3を算出することができ、結果として、各モータA,B,Cを高精度に制御することができる。   Therefore, according to the control system 1 of the present embodiment, even when the operation amount calculation is prolonged, the operation amounts U1, U2, U3 of the respective motors can be calculated by the time of the next control cycle, As a result, each motor A, B, C can be controlled with high accuracy.

尚、図10に示す例では、モータCに対する操作量U3の演算が開始された後、割込み信号が入力されるので、制御部10は、この割込み信号の入力を契機として、操作量演算処理タスクを中断し、入出力処理を実行し終了した後、演算途中の操作量U3の中断した演算ステップから処理を再開して、操作量U3を算出することになる。   In the example shown in FIG. 10, since the interrupt signal is input after the calculation of the operation amount U3 for the motor C is started, the control unit 10 is triggered by the input of the interrupt signal. Is interrupted, the input / output process is executed, and the process is terminated. Then, the process is resumed from the interrupted calculation step of the operation quantity U3 during the calculation, and the operation quantity U3 is calculated.

また、入出力処理にて、他の操作量演算処理タスクが実行待ちキューに登録された場合、制御部10は、中断した操作量演算処理タスクを終えた後、上記実行待ちキューに登録された他の操作量演算処理タスクを、新たに実行することになる。よって、本実施例によ
れば、時間Ts内に操作量を算出することができない場合であっても、各モータA,B,Cを高精度に制御することができる。
In addition, when another operation amount calculation processing task is registered in the execution waiting queue in the input / output processing, the control unit 10 finishes the interrupted operation amount calculation processing task and then is registered in the execution waiting queue. Another operation amount calculation processing task is newly executed. Therefore, according to the present embodiment, each of the motors A, B, and C can be controlled with high accuracy even when the operation amount cannot be calculated within the time Ts.

また、本実施例では、上述した手法で、各モータの制御量取得動作及び操作量設定動作を一定周期Tsで実行可能としつつ、当該周期Tsを、各モータの最適な制御周期の最大公約数に設定することで、従来手法よりも、各モータの制御周期を適切に設定することができるようにし、単一の制御部10(CPU11)でも、プログラムにより、高精度にモータ制御を実現できるようにした。従って、本実施例では、安価で、高性能な制御システムを構築することができる。   Further, in this embodiment, the control amount acquisition operation and the operation amount setting operation of each motor can be executed at a constant cycle Ts by the above-described method, and the cycle Ts is the greatest common divisor of the optimum control cycle of each motor. Therefore, the control cycle of each motor can be set more appropriately than in the conventional method, and even a single control unit 10 (CPU 11) can realize motor control with high accuracy by a program. I made it. Therefore, in this embodiment, an inexpensive and high-performance control system can be constructed.

以上、本発明の実施例について説明したが、本発明のモータ駆動手段は、本実施例において、制御対象のモータA,B,Cの夫々に設けられたモータ駆動回路25に相当し、回転量検出手段は、制御対象のモータA,B,Cの夫々に設けられたエンコーダ21及びエンコーダ信号処理回路23に相当する。また、操作量設定手段は、本実施例において、タイマ27及び制御部10が実行する入出力処理及び操作量演算処理タスクにより実現されている。また、本発明の処理実行周期は、割込み信号Irの入力周期Tsに対応し、処理実行時刻は、割込み信号Irの入力時刻に対応する。また、計時手段は、制御部10が実行する入出力処理のS310の処理により実現され、操作量記憶手段は、RAM15に対応する。   Although the embodiment of the present invention has been described above, the motor drive means of the present invention corresponds to the motor drive circuit 25 provided in each of the motors A, B, and C to be controlled in this embodiment, and the rotation amount The detection means corresponds to the encoder 21 and the encoder signal processing circuit 23 provided in each of the motors A, B, and C to be controlled. Further, the operation amount setting means is realized by an input / output process and an operation amount calculation processing task executed by the timer 27 and the control unit 10 in this embodiment. Further, the processing execution cycle of the present invention corresponds to the input cycle Ts of the interrupt signal Ir, and the processing execution time corresponds to the input time of the interrupt signal Ir. The time measuring means is realized by the processing of S310 of the input / output processing executed by the control unit 10, and the operation amount storage means corresponds to the RAM 15.

また、本発明は、上記実施例に限定されるものではなく、種々の態様を採ることができる。例えば、上記実施例では、合計3個のモータを制御する制御システム1を例に挙げて説明したが、本発明は、モータが2個又は4個以上の制御システムにも適用することができる。また、上記実施例では、割込み回数CNTが、値M1,M2,M3の最小公倍数となる度に、S330にて、割込み回数CNTをゼロにリセットするようにしたが、上記実施例の制御システム1は、S330の処理を実行しない構成にされても、当然のことながら、構わない。   Further, the present invention is not limited to the above-described embodiments, and can take various forms. For example, in the above-described embodiment, the control system 1 that controls a total of three motors has been described as an example. However, the present invention can also be applied to a control system having two or four or more motors. In the above embodiment, every time the interrupt count CNT becomes the least common multiple of the values M1, M2, and M3, the interrupt count CNT is reset to zero in S330. Of course, even if it is configured not to execute the process of S330, it does not matter.

制御システム1の構成を表すブロック図である。1 is a block diagram illustrating a configuration of a control system 1. FIG. 印字機構100の構成を表す概略断面図である。2 is a schematic cross-sectional view illustrating a configuration of a printing mechanism 100. FIG. 印字機構100を駆動するモータ105,115,129の動作例を示した説明図である。FIG. 6 is an explanatory diagram showing an operation example of motors 105, 115, and 129 that drive the printing mechanism 100. 割込み信号Irの入力周期Ts及び各モータの制御周期Ts1,Ts2,Ts3の設定手順を示した説明図である。It is explanatory drawing which showed the setting procedure of the input period Ts of the interruption signal Ir, and control period Ts1, Ts2, Ts3 of each motor. 制御量の取得及び操作量の設定期間(T_io)並びに各モータA,B,Cに対する操作量の演算期間(T_a,T_b,T_c)を表したタイムチャートである。It is a time chart showing control amount acquisition and operation amount setting period (T_io) and operation amount calculation periods (T_a, T_b, T_c) for motors A, B, and C. 制御部10が実行する入出力処理を表すフローチャートである。4 is a flowchart illustrating an input / output process executed by a control unit 10. 制御部10が実行する入出力処理を表すフローチャートである。4 is a flowchart illustrating an input / output process executed by a control unit 10. 操作量演算処理タスクの処理手順を表すフローチャートである。It is a flowchart showing the process sequence of the operation amount calculation process task. 操作量の演算時間の揺動と、制御量の取得時期及び操作量の設定時期と、の関係を表す説明図である。It is explanatory drawing showing the relationship between fluctuation | variation of the operation amount calculation time, the acquisition amount of control amount, and the setting time of operation amount. 割込み信号の入力時刻までに、操作量演算処理タスクが終了しない場合の後処理の例を示した説明図である。It is explanatory drawing which showed the example of the post-processing when the operation amount arithmetic processing task does not end by the input time of the interrupt signal. 従来のモータ制御方法に関する説明図である。It is explanatory drawing regarding the conventional motor control method.

符号の説明Explanation of symbols

1…制御システム、10…制御部、11…CPU、13…ROM、15…RAM、21…エンコーダ、23…エンコーダ信号処理回路、25…モータ駆動回路、27…タイマ、100…印字機構、103…キャリッジ、105…CRモータ、113…給紙ローラ、11
5…ACFモータ、123…用紙搬送ローラ、127…排紙ローラ、129…LFモータ
DESCRIPTION OF SYMBOLS 1 ... Control system, 10 ... Control part, 11 ... CPU, 13 ... ROM, 15 ... RAM, 21 ... Encoder, 23 ... Encoder signal processing circuit, 25 ... Motor drive circuit, 27 ... Timer, 100 ... Printing mechanism, 103 ... Carriage, 105 ... CR motor, 113 ... feed roller, 11
5 ... ACF motor, 123 ... paper transport roller, 127 ... paper discharge roller, 129 ... LF motor

Claims (5)

複数のモータを制御するモータ制御装置であって、
前記複数のモータの夫々に対し、
モータの回転量を検出する回転量検出手段と、
設定された操作量に対応する操作をモータに加えて、モータを駆動するモータ駆動手段と、
備えると共に、
操作量の算出結果を記憶するための操作量記憶手段と、
予め定められた周期で到来する処理実行時刻が到来する度、前記複数のモータの内、制御周期が到来した各モータの前記モータ駆動手段に対して、操作量を設定する操作量設定手段と、
を備え、
前記操作量設定手段は、
前記処理実行時刻が到来した時点で、
前記制御周期が到来したモータについて、モータ毎に、対応する前記回転量検出手段から前記回転量についての検出値を取得すると共に、前記制御周期が到来したモータについて、モータ毎に、所定回前に算出された当該モータの操作量を、前記操作量記憶手段から読み出し、前記読み出した操作量を、このモータに対応する前記モータ駆動手段に設定する入出力処理
を実行し、この入出力処理の実行後、前記制御周期が到来したモータについて、モータ毎に、
対応する前記回転量検出手段から取得した前記検出値に基づき、このモータに対する操作量を算出し、前記算出した操作量を、前記操作量記憶手段に記憶させる算出記録処理
を実行するモータ制御装置
に対して、前記処理実行時刻の到来周期である処理実行周期及び前記各モータの制御周期を設定する方法であって、
前記複数のモータの内、最適な制御周期が最小のモータの当該制御周期を基準周期として、当該基準周期のN(但し、値Nは2以上の整数である。)分の一の時間間隔を、前記処理実行周期に設定し、前記最適な制御周期が最小のモータの当該制御周期を、前記設定した処理実行周期のN倍に設定すると共に、前記複数のモータの内、前記最適な制御周期が最小のモータ以外の各モータの制御周期を、前記設定した処理実行周期のM倍(但し、値Mは、値N以上の整数である。)に設定することを特徴とする設定方法。
A motor control device for controlling a plurality of motors,
For each of the plurality of motors,
A rotation amount detecting means for detecting a rotation amount of the motor;
Motor driving means for driving the motor by applying an operation corresponding to the set operation amount to the motor ;
With
An operation amount storage means for storing an operation amount calculation result;
An operation amount setting unit that sets an operation amount for the motor driving unit of each motor that has reached a control cycle, among the plurality of motors, when a processing execution time that arrives at a predetermined cycle arrives .
With
The operation amount setting means includes:
When the processing execution time arrives,
For each motor, the detection value for the rotation amount is acquired from the corresponding rotation amount detection means for each motor for which the control cycle has arrived. Input / output processing for reading the calculated operation amount of the motor from the operation amount storage unit and setting the read operation amount in the motor driving unit corresponding to the motor
After the execution of this input / output process, for each motor that has reached the control cycle,
A calculation recording process for calculating an operation amount for the motor based on the detected value acquired from the corresponding rotation amount detection unit, and storing the calculated operation amount in the operation amount storage unit
For the motor control device that executes the above-described process execution time and the control cycle of each motor,
Of the plurality of motors, with the control cycle of the motor having the smallest optimal control cycle as a reference cycle, a time interval equal to N (where the value N is an integer of 2 or more) of the reference cycle. , The process execution cycle is set, and the control cycle of the motor having the minimum optimal control cycle is set to N times the set process execution cycle, and among the plurality of motors, the optimal control cycle A setting method characterized in that the control cycle of each motor other than the motor with the smallest value is set to M times the set processing execution cycle (however, the value M is an integer greater than or equal to the value N).
複数のモータを制御するモータ制御装置であって、
前記複数のモータの夫々に対し、
モータの回転量を検出する回転量検出手段と、
設定された操作量に対応する操作をモータに加えて、モータを駆動するモータ駆動手段と、
備えると共に、
操作量の算出結果を記憶するための操作量記憶手段と、
予め定められた周期で到来する処理実行時刻が到来する度、前記複数のモータの内、制御周期が到来した各モータの前記モータ駆動手段に対して、操作量を設定する操作量設定手段と、
を備え、
前記操作量設定手段は、
前記処理実行時刻が到来した時点で、
前記制御周期が到来したモータについて、モータ毎に、対応する前記回転量検出手段から前記回転量についての検出値を取得すると共に、前記制御周期が到来したモータについて、モータ毎に、所定回前に算出された当該モータの操作量を、前記操作量記憶手段から読み出し、前記読み出した操作量を、このモータに対応する前記モータ駆動手段に設定する入出力処理
を実行し、この入出力処理の実行後、前記制御周期が到来したモータについて、モータ毎に、
対応する前記回転量検出手段から取得した前記検出値に基づき、このモータに対する操作量を算出し、前記算出した操作量を、前記操作量記憶手段に記憶させる算出記録処理
を実行する構成にされ、
前記処理実行時刻の到来周期は、前記複数のモータの内、制御周期が最小のモータの当該制御周期とは異なる値であって、前記各モータに対し設定された制御周期の公約数に、定められていることを特徴とするモータ制御装置。
A motor control device for controlling a plurality of motors,
For each of the plurality of motors,
A rotation amount detecting means for detecting a rotation amount of the motor;
Motor driving means for driving the motor by applying an operation corresponding to the set operation amount to the motor ;
With
An operation amount storage means for storing an operation amount calculation result;
An operation amount setting unit that sets an operation amount for the motor driving unit of each motor that has reached a control cycle, among the plurality of motors, when a processing execution time that arrives at a predetermined cycle arrives .
With
The operation amount setting means includes:
When the processing execution time arrives,
For each motor, the detection value for the rotation amount is acquired from the corresponding rotation amount detection means for each motor for which the control cycle has arrived. Input / output processing for reading the calculated operation amount of the motor from the operation amount storage unit and setting the read operation amount in the motor driving unit corresponding to the motor
After the execution of this input / output process, for each motor that has reached the control cycle,
A calculation recording process for calculating an operation amount for the motor based on the detected value acquired from the corresponding rotation amount detection unit, and storing the calculated operation amount in the operation amount storage unit
Is configured to run
The arrival period of the processing execution time is a value different from the control period of the motor having the smallest control period among the plurality of motors, and is set to a common divisor of the control period set for each motor. The motor control apparatus characterized by the above-mentioned.
基点からの経過時間を計測する計時手段
を備え、
前記操作量設定手段は、前記処理実行時刻が到来する度、前記複数のモータの夫々について、前記計時手段の計測値をモータの制御周期で除算して除算後の余りを算出し、当該余りが規定値であるか否かを判断することによって、制御周期が到来したモータを検出する構成にされていることを特徴とする請求項2記載のモータ制御装置。
Equipped with time measuring means to measure the elapsed time from the base point,
The manipulated variable setting means calculates the remainder after division by dividing the measured value of the time measuring means by the motor control period for each of the plurality of motors each time the processing execution time arrives. 3. The motor control device according to claim 2, wherein the motor control device is configured to detect a motor whose control cycle has arrived by determining whether or not the value is a specified value.
前記操作量設定手段は、前記算出記録処理を、次の前記処理実行時刻の到来時までに終えることができなかった場合、前記次の処理実行時刻の到来時点で、この算出記録処理を中断すると共に、前記処理実行時刻の到来を契機として前記入出力処理を実行した後、前記中断された前記算出記録処理を再開する構成にされていることを特徴とする請求項2又は請求項3記載のモータ制御装置。 The operation amount setting means interrupts the calculation recording process when the next process execution time comes when the calculation recording process cannot be completed by the next process execution time. 4. The configuration according to claim 2 , wherein the calculation recording process is resumed after the input / output process is executed in response to the arrival of the process execution time. 5. Motor control device. マイクロコンピュータと、
前記操作量設定手段としての機能を、前記マイクロコンピュータに実現させるためのプログラムと、
を備え、
前記操作量設定手段としての機能は、当該モータ制御装置が備える単一の前記マイクロコンピュータが、前記プログラムを実行することにより、実現されることを特徴とする請求項2〜請求項4のいずれかに記載のモータ制御装置。
A microcomputer,
A program for causing the microcomputer to realize the function as the operation amount setting means;
With
Functions as the operation amount setting means, a single of the microcomputer in which the motor control apparatus included in, by executing the program, any of claims 2 to 4, characterized in that it is implemented The motor control device described in 1.
JP2007094722A 2007-03-30 2007-03-30 Setting method and motor control device Expired - Fee Related JP4453712B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007094722A JP4453712B2 (en) 2007-03-30 2007-03-30 Setting method and motor control device
US12/055,278 US8026678B2 (en) 2007-03-30 2008-03-25 Motor control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007094722A JP4453712B2 (en) 2007-03-30 2007-03-30 Setting method and motor control device

Publications (2)

Publication Number Publication Date
JP2008253110A JP2008253110A (en) 2008-10-16
JP4453712B2 true JP4453712B2 (en) 2010-04-21

Family

ID=39977402

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007094722A Expired - Fee Related JP4453712B2 (en) 2007-03-30 2007-03-30 Setting method and motor control device

Country Status (1)

Country Link
JP (1) JP4453712B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5304815B2 (en) * 2011-02-28 2013-10-02 株式会社デンソー Microcomputer
JP5748126B2 (en) * 2011-09-13 2015-07-15 富士電機株式会社 Synchronous control system

Also Published As

Publication number Publication date
JP2008253110A (en) 2008-10-16

Similar Documents

Publication Publication Date Title
JP4886425B2 (en) Transport device
JP4453712B2 (en) Setting method and motor control device
JP2006273580A (en) Transport control device and image forming apparatus
JP4453713B2 (en) Motor control device
US7135831B2 (en) Method and device for controlling motor
US8026678B2 (en) Motor control device
JP4093191B2 (en) Motor control device and printer
JP2017068850A (en) Conveyance system, sheet processing system, and control device
EP2767403B1 (en) Transport Device And Inkjet Printing Apparatus Having The Same
JP2006109544A (en) Device and method for evaluating rotator, and device and method for setting amount of corrective operation, and controller and its method and program
JP2011041375A (en) Motor control apparatus and image forming apparatus
JP4781946B2 (en) Printer apparatus and control method thereof
JP2006338367A (en) Electronic equipment and control method for motor
CN103660626A (en) Printing apparatus and control method
JP2001078476A (en) Device and method for controlling dc motor
JP5061547B2 (en) Motor control apparatus, motor control method, and printing apparatus
JP5772018B2 (en) Rotation control device
JP3945362B2 (en) Printing apparatus having a DC motor
JP5845693B2 (en) Conveying apparatus and image forming apparatus
JP5387080B2 (en) Image processing apparatus, image processing method, and image processing program
JP2015194401A (en) control system
JP2021041659A (en) Driving system
JP2005111712A (en) Printer
JP2023169678A (en) Electronic apparatus
JP2012218360A (en) Inkjet recording apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090330

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090915

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091116

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100112

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100125

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130212

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4453712

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140212

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees