JP2001186785A - Device and method for controlling motor and/or storage medium with recorded control program of motor - Google Patents

Device and method for controlling motor and/or storage medium with recorded control program of motor

Info

Publication number
JP2001186785A
JP2001186785A JP36802999A JP36802999A JP2001186785A JP 2001186785 A JP2001186785 A JP 2001186785A JP 36802999 A JP36802999 A JP 36802999A JP 36802999 A JP36802999 A JP 36802999A JP 2001186785 A JP2001186785 A JP 2001186785A
Authority
JP
Japan
Prior art keywords
motor
encoder
speed
rotation
reverse rotation
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.)
Granted
Application number
JP36802999A
Other languages
Japanese (ja)
Other versions
JP3705061B2 (en
Inventor
Hirotomo Tanaka
中 啓 友 田
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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
Priority to JP36802999A priority Critical patent/JP3705061B2/en
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to EP06075410A priority patent/EP1681173B1/en
Priority to AT00311536T priority patent/ATE339320T1/en
Priority to DE60040494T priority patent/DE60040494D1/en
Priority to AT06075410T priority patent/ATE410309T1/en
Priority to DE60030667T priority patent/DE60030667T2/en
Priority to EP00311536A priority patent/EP1110744B1/en
Priority to US09/742,107 priority patent/US6418274B2/en
Publication of JP2001186785A publication Critical patent/JP2001186785A/en
Application granted granted Critical
Publication of JP3705061B2 publication Critical patent/JP3705061B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Indicating Or Recording The Presence, Absence, Or Direction Of Movement (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

PROBLEM TO BE SOLVED: To accurately detect speed even if backward rotation occurs at the mounting part of an encoder when a motor is activated. SOLUTION: An inversion detection part 6q, a first pulse counter 6r, and a speed operation part 6d are provided. The backward rotation detection part 6q detects whether backward rotation occurs at a mounting part 65 of an encoder when a motor is activated or not based on the output pulse of an encoder 13 rotating according to the rotation of a motor 1. The first pulse counter 6r counts the edge of the output pulse of the encoder after the rotation of the mounting part of the encoder is changed from backward rotation to forward one, and outputs a start command when the count value reaches a first specific value. The speed operation part 6d calculates the speed of the motor based on the output pulse of the encoder if a start command is received when the backward rotation occurs at the mounting part of the encoder.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はモータの制御装置お
よび制御方法ならびにモータの制御プログラムを記録し
た記録媒体に関し、特に紙送りの制御に用いられる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control device and a control method for a motor, and a recording medium on which a control program for a motor is recorded.

【0002】[0002]

【従来の技術】従来のモータの制御装置を図4乃至図1
0を参照して説明する。このモータの制御装置はインク
ジェットプリンタに用いられ、このインクジェットプリ
ンタの概略の構成を図4に示す。
2. Description of the Related Art A conventional motor control device is shown in FIGS.
0 will be described. The motor control device is used in an ink jet printer, and the schematic configuration of the ink jet printer is shown in FIG.

【0003】このインクジェットプリンタは、紙送りを
行う紙送りモータ(以下、PFモータともいう)1と、
この紙送りモータ1を駆動する紙送りモータドライバ2
と、キャリッジ3と、このキャリッジ3を駆動するキャ
リッジモータ(以下、CRモータともいう)4と、この
キャリッジモータ4を駆動するCRモータドライバ5
と、DCユニット6と、目詰まり防止のためのインクの
吸い出しを制御するポンプモータ7と、このポンプモー
タ7を駆動するポンプモータドライバ8と、キャリッジ
3に固定されて印刷紙50にインクを吐出するヘッド9
と、このヘッド9を駆動制御するヘッドドライバ10
と、キャリッジ3に固定されたリニア式エンコーダ11
と、所定の間隔にスリットが形成された符号板12と、
PFモータ1用のロータリ式エンコーダ13と、印刷処
理されている紙の終端位置を検出する紙検出センサ15
と、プリンタ全体の制御を行うCPU16と、CPU1
6に対して周期的に割込み信号を発生するタイマIC1
7と、ホストコンピュータ18との間でデータの送受信
を行うインタフェース部(以下IFともいう)19と、
ホストコンピュータ18からIF19を介して送られて
くる印字情報に基づいて印字解像度やヘッド9の駆動波
形等を制御するASIC20と、ASIC20およびC
PU16の作業領域やプログラム格納領域として用いら
れるPROM21,RAM22およびEEPROM23
と、印刷中の紙50を支持するプラテン25と、PFモ
ータ1によって駆動されて印刷紙50を搬送する搬送ロ
ーラ27と、CRモータ4の回転軸に取付けられたプー
リ30と、このプーリ30によって駆動されるタイミン
グベルト31と、を備えている。
This ink jet printer includes a paper feed motor (hereinafter also referred to as a PF motor) 1 for feeding paper,
A paper feed motor driver 2 for driving this paper feed motor 1
, A carriage 3, a carriage motor (hereinafter also referred to as a CR motor) 4 for driving the carriage 3, and a CR motor driver 5 for driving the carriage motor 4
A DC unit 6, a pump motor 7 for controlling suction of ink for preventing clogging, a pump motor driver 8 for driving the pump motor 7, and ink ejected to the printing paper 50 fixed to the carriage 3. Head 9
And a head driver 10 for driving and controlling the head 9
And a linear encoder 11 fixed to the carriage 3
And a code plate 12 having slits formed at predetermined intervals,
A rotary encoder 13 for the PF motor 1 and a paper detection sensor 15 for detecting the end position of the paper being printed
A CPU 16 for controlling the entire printer;
Timer IC1 that periodically generates an interrupt signal for
7, an interface unit (hereinafter, also referred to as IF) 19 for transmitting and receiving data to and from the host computer 18,
An ASIC 20 for controlling the printing resolution and the driving waveform of the head 9 based on the printing information sent from the host computer 18 via the IF 19;
PROM 21, RAM 22, and EEPROM 23 used as a work area and a program storage area of PU 16
A platen 25 supporting the paper 50 being printed, a transport roller 27 driven by the PF motor 1 to transport the print paper 50, a pulley 30 attached to the rotation shaft of the CR motor 4, and the pulley 30. And a driven timing belt 31.

【0004】なお、DCユニット6は、CPU16から
送られてくる制御指令、エンコーダ11,13の出力に
基づいて紙送りモータドライバ2およびCRモータドラ
イバ5を駆動制御する。また、紙送りモータ1およびC
Rモータ4はいずれもDCモータで構成されている。
The DC unit 6 drives and controls the paper feed motor driver 2 and the CR motor driver 5 based on control commands sent from the CPU 16 and outputs of the encoders 11 and 13. Further, the paper feed motors 1 and C
Each of the R motors 4 is constituted by a DC motor.

【0005】このインクジェットプリンタのキャリッジ
3の周辺の構成を図5に示す。
FIG. 5 shows a configuration around the carriage 3 of the ink jet printer.

【0006】キャリッジ3は、タイミングベルト31に
よりプーリ30を介してキャリッジモータ4に接続さ
れ、ガイド部材32に案内されてプラテン25に平行に
移動するように駆動される。キャリッジ3の印刷紙に対
向する面には、ブラックインクを吐出するノズル列およ
びカラーインクを吐出するノズル列からなる記録ヘッド
9が設けられ、各ノズル列はインクカートリッジ34か
らインクの供給を受けて印刷紙にインク滴を吐出して文
字や画像を印字する。
The carriage 3 is connected to the carriage motor 4 via a pulley 30 by a timing belt 31, and is driven by a guide member 32 to move in parallel with the platen 25. On the surface of the carriage 3 facing the printing paper, a recording head 9 composed of a nozzle row for discharging black ink and a nozzle row for discharging color ink is provided. Each nozzle row is supplied with ink from an ink cartridge 34. Prints characters and images by ejecting ink droplets on printing paper.

【0007】またキャリッジ3の非印字領域には、非印
字時に記録ヘッド9のノズル開口を封止するためのキャ
ッピング装置35と、図4に示すポンプモータ7を有す
るポンプユニット36とが設けられている。キャリッジ
3が印字領域から非印字領域に移動すると、図示しない
レバーに当接してキャッピング装置35は上方に移動
し、ヘッド9を封止する。
In the non-printing area of the carriage 3, a capping device 35 for sealing the nozzle opening of the recording head 9 during non-printing and a pump unit 36 having the pump motor 7 shown in FIG. 4 are provided. I have. When the carriage 3 moves from the print area to the non-print area, the capping device 35 moves upward by contacting a lever (not shown) to seal the head 9.

【0008】ヘッド9のノズル開口列に目詰まりが生じ
た場合や、カートリッジ34の交換等を行ってヘッド9
から強制的にインクを吐出する場合は、ヘッド9を封止
した状態でポンプユニット36を作動させ、ポンプユニ
ット36からの負圧により、ノズル開口列からインクを
吸い出す。これにより、ノズル開口列の近傍に付着して
いる塵埃や紙粉が洗浄され、さらにはヘッド9内の気泡
がインクとともにキャップ37に排出される。
When clogging occurs in the nozzle opening row of the head 9 or when the cartridge 34 is replaced or the like,
When the ink is forcibly ejected from the pump unit, the pump unit is operated while the head 9 is sealed, and the ink is sucked out from the nozzle opening row by the negative pressure from the pump unit. As a result, dust and paper dust adhering in the vicinity of the nozzle opening row are washed, and the air bubbles in the head 9 are discharged to the cap 37 together with the ink.

【0009】次に、キャリッジ3に取付けられたリニア
式エンコーダ11の構成を図6に示す。このエンコーダ
11は発光ダイオード11aと、コリメータレンズ11
bと、検出処理部11cとを備えている。この検出処理
部11cは複数(4個)のフォトダイオード11dと、
信号処理回路11eと、2個のコンパレータ11fA
11fBと、を有している。
Next, the configuration of the linear encoder 11 attached to the carriage 3 is shown in FIG. The encoder 11 includes a light emitting diode 11a and a collimator lens 11
b and a detection processing unit 11c. The detection processing unit 11c includes a plurality (four) of photodiodes 11d,
A signal processing circuit 11e and two comparators 11f A ,
It has a 11f B, and.

【0010】発光ダイオード11aの両端に抵抗を介し
て電圧Vccが印加されると、発光ダイオード11aか
ら光が発せられる。この光はコリメータレンズ11bに
よって平行にされて符号板12を通過する。符号板12
には所定の間隔(例えば1/180インチ(=1/18
02.54cm))毎にスリットが設けられた構成となっ
ている。
When a voltage Vcc is applied to both ends of the light emitting diode 11a via a resistor, light is emitted from the light emitting diode 11a. This light is made parallel by the collimator lens 11b and passes through the code plate 12. Code plate 12
At a predetermined interval (for example, 1/180 inch (= 1/18)
(0.254 cm)).

【0011】この符号板12を通過した平行光は、図示
しない固定スリットを通って各フォトダイオード11d
に入射し、電気信号に変換される。4個のフォトダイオ
ード11dから出力される電気信号が信号処理回路11
eにおいて信号処理される。この信号処理回路11eか
ら出力される信号がコンパレータ11fA,11fBにお
いて比較され、比較結果がパルスとして出力される。コ
ンパレータ11fA、11fB から出力されるパルスE
NC−A,ENC−Bがエンコーダ11の出力となる。
The parallel light that has passed through the code plate 12 passes through a fixed slit (not shown) to each photodiode 11d.
And is converted into an electric signal. The electric signals output from the four photodiodes 11d are applied to the signal processing circuit 11
The signal is processed in e. The signals outputted from the signal processing circuit 11e is a comparator 11f A, are compared in 11f B, the compared results are outputted as pulses. Pulse E output from comparators 11f A and 11f B
NC-A and ENC-B are outputs of the encoder 11.

【0012】パルスENC−AとパルスENC−Bは位
相が90度だけ異なっている。CRモータ4が正転すな
わちキャリッジ3が主走査方向に移動しているときは図
7(a)に示すようにパルスENC−AはパルスENC
−Bよりも90度だけ位相が進み、CRモータ4が逆転
しているときは図7(b)に示すようにパルスENC−
AはパルスENC−Bよりも90度だけ位相が遅れるよ
うにエンコーダ4は構成されている。そして、上記パル
スの1周期Tは符号板12のスリット間隔(例えば1/
180インチ(=1/180×2.54cm))に対応
し、 キャリッジ3が上記スリット間隔を移動する時間に
等しい。
The phases of the pulses ENC-A and ENC-B differ by 90 degrees. When the CR motor 4 is rotating forward, that is, when the carriage 3 is moving in the main scanning direction, the pulse ENC-A is changed to the pulse ENC as shown in FIG.
When the CR motor 4 is rotating in the reverse direction by 90 degrees from that of the pulse ENC-B as shown in FIG.
The encoder 4 is configured such that the phase of A is delayed by 90 degrees from the pulse ENC-B. One cycle T of the pulse is equal to the slit interval of the code plate 12 (for example, 1 /
180 inches (= 1/180 × 2.54 cm), which is equal to the time during which the carriage 3 moves through the slit interval.

【0013】一方、PFモータ1用のロータリ式エンコ
ーダ13は符号板がPFモータ1の回転に応じて回転す
る回転円板である以外は、リニア式エンコーダ11と同
様の構成となっており、2つの出力パルスENC−A,
ENC−Bを出力する。なおインクジェットプリンタに
おいては、PFモータ1用のエンコーダ13の符号板に
設けられている複数のスリットのスリット間隔は、1/
180インチ(=1/180×2.54cm)であり、P
Fモータ1が上記1スリット間隔だけ回転すると、1/
1440インチ(=1/1440×2.54cm)だけ紙
送りされるような構成となっている。
On the other hand, the rotary encoder 13 for the PF motor 1 has the same configuration as the linear encoder 11 except that the code plate is a rotating disk that rotates in accordance with the rotation of the PF motor 1. Output pulses ENC-A,
Outputs ENC-B. In the ink jet printer, the slit interval of a plurality of slits provided on the code plate of the encoder 13 for the PF motor 1 is 1 /.
180 inches (= 1/180 × 2.54 cm)
When the F motor 1 rotates by one slit interval, 1 /
The paper is fed by 1440 inches (= 1440 × 2.54 cm).

【0014】次に図4において示した紙検出センサ15
の位置について図8を参照して説明する。図8におい
て、プリンタ60の給紙挿入口61に挿入された紙50
は、給紙モータ63によって駆動される給紙ローラ64
によってプリンタ60内に送り込まれる。プリンタ60
内に送り込まれた紙50の先端が例えば光学式の紙検出
センサ15によって検出される。この紙検出センサ15
によって先端が検出された紙50はPFモータ1によっ
て駆動される紙送りローラ65および従動ローラ66に
よって紙送りが行われる。
Next, the paper detection sensor 15 shown in FIG.
Will be described with reference to FIG. In FIG. 8, the paper 50 inserted into the paper feed slot 61 of the printer 60 is shown.
Is a paper feed roller 64 driven by a paper feed motor 63
Is sent into the printer 60. Printer 60
The leading end of the paper 50 fed into the inside is detected by, for example, an optical paper detection sensor 15. This paper detection sensor 15
The paper 50 whose leading end is detected is fed by a paper feed roller 65 driven by the PF motor 1 and a driven roller 66.

【0015】続いてキャリッジガイド部材32に沿って
移動するキャリッジ3に固定された記録ヘッド(図示せ
ず)からインクが滴下されることにより印字が行われ
る。そして所定の位置まで紙送りが行われると、現在、
印字されている紙50の終端が紙検出センサ15によっ
て検出される。そしてPFモータ1によって駆動される
歯車67aにより、歯車67bを介して歯車67cが駆
動され、これにより、排紙ローラ68および従動ローラ
69が回転駆動されて、印字が終了した紙50が排紙口
62から外部に排出される。
Subsequently, printing is performed by dropping ink from a recording head (not shown) fixed to the carriage 3 that moves along the carriage guide member 32. When the paper is fed to a predetermined position,
The end of the printed paper 50 is detected by the paper detection sensor 15. The gear 67c driven by the PF motor 1 drives the gear 67c via the gear 67b, whereby the paper discharge roller 68 and the driven roller 69 are driven to rotate, and the paper 50 on which printing has been completed is discharged to the paper discharge port. It is discharged from 62 to the outside.

【0016】なお、紙送りローラ65の回転軸にはエン
コーダ13の符号板が取り付けられている。
A code plate of the encoder 13 is attached to a rotation shaft of the paper feed roller 65.

【0017】次に、この従来のインクジェットプリンタ
のPFモータ1の制御について図9および図10を参照
して説明する。このPFモータ1の制御はDCユニット
6によって行われ、このDCユニット6は図9に示すよ
うに位置カウンタ6aと、減算部6bと、目標速度演算
部6cと、速度演算部6dと、減算器6eと、比例要素
6fと、積分要素6gと、微分要素6hと、加算器6i
と、D/Aコンバータ6jと、タイマ6kと、加速制御
部6mとを備えている。
Next, control of the PF motor 1 of the conventional ink jet printer will be described with reference to FIGS. The control of the PF motor 1 is performed by a DC unit 6, which includes a position counter 6a, a subtraction unit 6b, a target speed calculation unit 6c, a speed calculation unit 6d, and a subtractor as shown in FIG. 6e, a proportional element 6f, an integral element 6g, a differential element 6h, and an adder 6i.
, A D / A converter 6j, a timer 6k, and an acceleration control unit 6m.

【0018】位置カウンタ6aはエンコーダ13の出力
パルスENC−A,ENC−Bの各々の立ち上がりエッ
ジ、立ち下がりエッジを検出し、検出されたエッジの個
数を計数し、この計数値に基づいて、PFモータ1によ
って送られる紙の送り量を演算する。この計数はPFモ
ータ1が正転しているときは1個のエッジが検出される
と「+1」を加算し、逆転しているときは、1個のエッ
ジが検出されると「−1」を加算する。パルスENC−
AおよびENC−Bの各々の周期は符号板のスリット間
隔に等しく、かつパルスENC−AとパルスENC−B
は位相が90度だけ異なっている。このため、上記計数
のカウント値「1」はエンコーダ13の符号板のスリッ
ト間隔の1/4に対応する。また、PFモータ1が1ス
リット間隔だけ回転すると、1/1440インチ(=1
/1440×2.54cm)だけ紙送りされるからこれに
より上記位置カウンタ6aの計数値に1/4×1/14
40インチ(=1/4×1/1440×2.54cm)を
乗算すれば、PFモータ1の、計数値が「0」に対応す
る位置すなわち起動開始位置からの紙送り量を求めるこ
とができる。このときエンコーダ13の解像度は1/5
760インチ(=1/5760×2.54cm)となる。
The position counter 6a detects the rising edge and the falling edge of each of the output pulses ENC-A and ENC-B of the encoder 13, counts the number of detected edges, and based on the count value, determines the PF. The amount of paper fed by the motor 1 is calculated. When the PF motor 1 is rotating forward, "+1" is added when one edge is detected, and when the PF motor 1 is rotating reversely, "-1" is added when one edge is detected. Is added. Pulse ENC-
Each period of A and ENC-B is equal to the slit interval of the code plate, and pulse ENC-A and pulse ENC-B
Are 90 degrees out of phase. Therefore, the count value “1” of the above-described count corresponds to 1 / of the slit interval of the code plate of the encoder 13. When the PF motor 1 rotates by one slit interval, 1/1440 inch (= 1
/1440×2.54 cm), so that the count value of the position counter 6a becomes 1/4 × 1/14
By multiplying by 40 inches (= 1 / 4.times.1 / 1440.times.2.54 cm), the paper feed amount from the position corresponding to the count value "0" of the PF motor 1, that is, the start position, can be obtained. . At this time, the resolution of the encoder 13 is 1/5.
It is 760 inches (= 1/5760 × 2.54 cm).

【0019】減算器6bは、目標位置と、位置カウンタ
6aのカウント値との位置偏差を演算する。
The subtractor 6b calculates a positional deviation between the target position and the count value of the position counter 6a.

【0020】目標速度演算部6cは、減算器6bの出力
である位置偏差に基づいてPFモータ1の目標速度を演
算する。この演算は位置偏差にゲインKpを乗算するこ
とにより行われる。このゲインKpは位置偏差に応じて
決定される。なお、このゲインKpの値は図示しないテ
ーブルに格納していても良い。
The target speed calculator 6c calculates a target speed of the PF motor 1 based on the position deviation output from the subtractor 6b. This calculation is performed by multiplying the position deviation by the gain Kp. This gain Kp is determined according to the position deviation. The value of the gain Kp may be stored in a table (not shown).

【0021】速度演算部6dはエンコーダ13の出力パ
ルスENC−A,ENC−Bに基づいてPFモータ1の
速度を演算する。この速度は次のようにして求められ
る。まずエンコーダ13の出力パルスENC−A,EN
C−Bの各々の立ち上がりエッジ、立ち下がりエッジを
検出し、エッジ間の時間間隔をタイマカウンタによって
カウントする。このカウント値をTとすると、速度は1
/Tに比例したものとなる。
The speed calculator 6d calculates the speed of the PF motor 1 based on the output pulses ENC-A and ENC-B of the encoder 13. This speed is determined as follows. First, the output pulses ENC-A, EN of the encoder 13
The rising edge and the falling edge of each of CB are detected, and the time interval between the edges is counted by a timer counter. If this count value is T, the speed is 1
/ T is proportional to / T.

【0022】減算器6eは、目標速度と、速度演算部6
dによって演算されたPFモータ1の実際の速度との速
度偏差を演算する。
The subtractor 6e has a target speed and a speed calculator 6
A speed deviation from the actual speed of the PF motor 1 calculated by d is calculated.

【0023】比例要素6fは上記速度偏差に定数Gpを
乗算し、乗算結果を出力する。積分要素6gは速度偏差
に定数Giを乗じたものを積算する。微分要素6hは現
在の速度偏差と、1つ前の速度偏差との差に定数Gdを
乗算し、乗算結果を出力する。なお比例要素6f、積分
要素6g、および微分要素6hの演算はエンコーダ13
の出力パルスENC−Aの1周期毎を、例えば出力パル
スENC−Aの立ち上がりエッジに同期して行う。
The proportional element 6f multiplies the speed deviation by a constant Gp and outputs the result of the multiplication. The integral element 6g integrates the value obtained by multiplying the speed deviation by a constant Gi. The differential element 6h multiplies the difference between the current speed deviation and the immediately preceding speed deviation by a constant Gd, and outputs the multiplication result. The calculation of the proportional element 6f, the integral element 6g, and the differential element 6h is performed by the encoder 13
Is performed in synchronization with, for example, the rising edge of the output pulse ENC-A.

【0024】比例要素6f、積分要素6g、および微分
要素6hの出力は加算器6iにおいて加算される。そし
て加算結果、すなわちPFモータ1の駆動電流がD/A
コンバータ6jに送られてアナログ電流に変換される。
このアナログ電流に基づいてドライバ10によってPF
モータ1が駆動される。
The outputs of the proportional element 6f, the integral element 6g, and the differential element 6h are added in an adder 6i. Then, the addition result, that is, the drive current of the PF motor 1 is D / A
The signal is sent to the converter 6j and converted into an analog current.
PF is determined by the driver 10 based on the analog current.
The motor 1 is driven.

【0025】また、タイマ6kおよび加速制御部6mは
加速制御に用いられ、比例要素6f、積分要素6g、お
よび微分要素6hを使用するPID制御は加速途中の定
速および減速制御に用いられる。
The timer 6k and the acceleration control section 6m are used for acceleration control, and the PID control using the proportional element 6f, the integral element 6g, and the differential element 6h is used for constant speed and deceleration control during acceleration.

【0026】タイマ6kはCPU16から送られてくる
クロック信号に基づいて所定時間毎にタイマ割込み信号
を発生する。
The timer 6k generates a timer interrupt signal at predetermined time intervals based on a clock signal sent from the CPU 16.

【0027】加速制御部6mは上記タイマ割込信号を受
ける度毎に所定の電流値(例えば20mA)を目標電流
値に積算し、積算結果すなわち加速時におけるPFモー
タ1の目標電流値がD/Aコンバータ6jに送られる。
PID制御の場合と同様に上記目標電流値はD/Aコン
バータ6jによってアナログ電流に変換され、このアナ
ログ電流に基づいてドライバ10によってPFモータ1
が駆動される。
The acceleration control unit 6m integrates a predetermined current value (for example, 20 mA) to the target current value every time the timer interrupt signal is received, and the integration result, that is, the target current value of the PF motor 1 during acceleration is D / D. It is sent to the A converter 6j.
As in the case of the PID control, the target current value is converted to an analog current by the D / A converter 6j, and based on the analog current, the PF motor 1
Is driven.

【0028】ドライバ10は、例えば4個のトランジス
タを備えており、D/Aコンバータ6jの出力に基づい
て上記トランジスタを各々ONまたはOFFさせること
により (a)PFモータ1を正転または逆転させる運転モード (b)回生ブレーキ運転モード(ショートブレーキ運転
モード、すなわちPFモータ1の停止を維持するモー
ド) (c)PFモータ1を停止させようとするモードを行わ
せることが可能な構成となっている。
The driver 10 includes, for example, four transistors, and turns on or off each of the transistors based on the output of the D / A converter 6j. (A) Operation for rotating the PF motor 1 forward or backward Mode (b) Regenerative brake operation mode (short brake operation mode, that is, a mode in which the PF motor 1 is kept stopped) (c) A configuration in which a mode in which the PF motor 1 is stopped can be performed. .

【0029】次に図11(a),(b)を参照してDC
ユニット6の動作を説明する。PFモータ1が停止して
いるときにCPU16からDCユニット6にPFモータ
1を起動させる起動指令信号が送られると、加速制御部
6mから起動初期電流値I0がD/Aコンバータ6jに
送られる。なお、この起動初期電流値I0は起動指令信
号とともにCPU16から加速制御部6mに送られてく
る。そしてこの電流値I0はD/Aコンバータ6jによ
ってアナログ電流に変換されてドライバ10に送られ、
このドライバ10によってPFモータ1が起動開始する
(図10(a),(b)参照)。
Next, referring to FIGS. 11A and 11B, DC
The operation of the unit 6 will be described. When the activation command signal for starting the PF motor 1 is transmitted, it launched from the acceleration controller 6m initial current value I 0 is fed to the D / A converter 6j from CPU16 in the DC unit 6 when the PF motor 1 is stopped . The starting initial current value I 0 is sent from the CPU 16 to the acceleration control unit 6m together with the starting command signal. The current value I 0 is converted into an analog current by the D / A converter 6j and sent to the driver 10,
The driver 10 starts the PF motor 1 (see FIGS. 10A and 10B).

【0030】起動指令信号を受信した後、所定の時間毎
にタイマ6kからタイマ割込信号が発生される。加速制
御部6mはタイマ割込信号を受信する度毎に、起動初期
電流値I0に所定の電流値(例えば20mA)を積算
し、積算した電流値をD/Aコンバータ6jに送る。す
るとこの積算した電流値はD/Aコンバータ6jによっ
てアナログ電流に変換されてドライバ10に送られる。
そしてPFモータ1に供給される電流の値が上記積算し
た電流値となるように、ドライバ5によってPFモータ
1が駆動されPFモータ1の速度は上昇する(図10
(b)参照)。このためPFモータ1に供給される電流
値は図10(a)に示すように階段状になる。
After receiving the start command signal, the timer 6k generates a timer interrupt signal at predetermined time intervals. Acceleration controller 6m each time receiving a timer interrupt signal, starts a predetermined current value to an initial current value I 0 by integrating (e.g. 20 mA), and sends the integrated current value to the D / A converter 6j. Then, the integrated current value is converted into an analog current by the D / A converter 6j and sent to the driver 10.
Then, the driver 5 drives the PF motor 1 so that the value of the current supplied to the PF motor 1 becomes the integrated current value, and the speed of the PF motor 1 increases (FIG. 10).
(B)). Therefore, the current value supplied to the PF motor 1 has a step shape as shown in FIG.

【0031】なお、このときPID制御系も動作してい
るが、D/Aコンバータ6jは加速制御部6mの出力を
選択して取込む。
At this time, the PID control system is also operating, but the D / A converter 6j selects and takes in the output of the acceleration control unit 6m.

【0032】加速制御部6mの電流値の積算処理は、積
算した電流値が一定の電流値ISとなるまで行われる。
時刻t1において積算した電流値が所定値ISとなると、
加速制御部6mは積算処理を停止し、D/Aコンバータ
6jに一定の電流値ISを供給する。これによりPFモ
ータ1に供給される電流の値が電流値ISとなるように
ドライバ10によって駆動される(図10(a)参
照)。
The accumulation process of the current value of the acceleration controller 6m is carried out until the integrated current value becomes a constant current value I S.
When the current value obtained by integrating at time t 1 becomes the predetermined value I S,
The acceleration control unit 6m stops the integration process and supplies a constant current value I S to the D / A converter 6j. Thus, the PF motor 1 is driven by the driver 10 so that the value of the current supplied to the PF motor 1 becomes the current value I S (see FIG. 10A).

【0033】そして、PFモータ1の速度がオーバーシ
ュートするのを防止するために、PFモータ1が所定の
速度V1になると(時刻t2 )になると、PFモータ1
に供給される電流を減小させるように加速制御部6mが
制御する。このときPFモータ1の速度は更に上昇する
が、PFモータ1の速度が所定の速度vcに達すると
(図10(b)の時刻t参照)、D/Aコンバータ6
jが、PID制御系の出力すなわち加算器6iの出力を
選択し、PID制御が行われる。
In order to prevent the speed of the PF motor 1 from overshooting, when the PF motor 1 reaches a predetermined speed V 1 (time t 2 ), the PF motor 1
Is controlled by the acceleration control unit 6m so as to reduce the current supplied to. In this case although the speed is further increased PF motor 1, (see time t 3 in FIG. 10 (b)) and the speed of the PF motor 1 reaches a predetermined speed v c, D / A converter 6
j selects the output of the PID control system, that is, the output of the adder 6i, and the PID control is performed.

【0034】すなわち、目標位置と、カウンタ6aのカ
ウント値との位置偏差に基づいて目標速度が演算され、
この目標速度と、エンコーダ13の出力から得られる実
際の速度との速度偏差に基づいて、比例要素6f、積分
要素6g、および微分要素6hが動作し、各々比例、積
分、および微分演算が行われ、これらの演算結果の和に
基づいて、PFモータ1の制御が行われる。なお、上記
比例、積分、および微分演算は、例えばエンコーダ13
の出力パルスENC−Aの立ち上がりエッジに同期して
行われる。これによりPFモータ1の速度は所望の速度
eとな るように制御される。なお、所定の速度vc
所望の速度veの70〜80%の値であることが好まし
い。
That is, the target speed is calculated based on the positional deviation between the target position and the count value of the counter 6a.
Based on the speed deviation between the target speed and the actual speed obtained from the output of the encoder 13, the proportional element 6f, the integral element 6g, and the differential element 6h operate, and perform proportional, integral, and differential operations, respectively. The control of the PF motor 1 is performed based on the sum of these calculation results. Note that the above-described proportional, integral, and differential operations are performed by, for example, the encoder 13.
In synchronization with the rising edge of the output pulse ENC-A. As a result, the speed of the PF motor 1 is controlled to a desired speed v e . Incidentally, it is preferable that the predetermined speed v c 70 to 80% of the value of desired speed v e.

【0035】時刻t4からPFモータ1は所望の速度ve
となる。その後、PFモータ1が目標位置に近づくと
(図10(b)の時刻t5参照)、PFモータ1の減速
が行われ、時刻t6にPFモータ1が停止する。
From time t 4 , the PF motor 1 starts operating at the desired speed v e.
Becomes Thereafter, the PF motor 1 approaches the target position (see time t 5 in FIG. 10 (b)), deceleration of the PF motor 1 is carried out, the PF motor 1 is stopped at time t 6.

【0036】[0036]

【発明が解決しようとする課題】このように構成された
インクジェットプリンタにおいては、図8で説明したよ
うに紙送りは、PFモータ1によって駆動される紙送り
ローラ65および従動ローラ66によって行われる。こ
の従動ローラ66は図11に示すようにバネ80によっ
て紙50を紙送りローラ65に押付けるように構成され
ている。
In the ink jet printer thus configured, the paper feed is performed by the paper feed roller 65 driven by the PF motor 1 and the driven roller 66 as described with reference to FIG. The driven roller 66 is configured to press the paper 50 against the paper feed roller 65 by a spring 80 as shown in FIG.

【0037】ところが、PFモータ1の起動時には、バ
ネ80によって紙50が通常の送り方向とは逆方向に移
動することが生じる。このため、紙送りローラ65が逆
転、すなわちこの紙送りローラ65に取り付けられたエ
ンコーダ13が逆転することが生じる。PFモータ1の
起動時に、エンコーダ13が取り付けられた取り付け部
65が逆転すると、エンコーダ13の出力に基づいて速
度を演算している速度演算部6dの出力が不正確とな
る、または速度演算部6dの速度演算に用いられるタイ
マカウンタがオーバーフローし、正確な速度を検出する
ことができないという問題が生じる。
However, when the PF motor 1 is started, the paper 50 is moved by the spring 80 in a direction opposite to the normal feeding direction. As a result, the paper feed roller 65 rotates in the reverse direction, that is, the encoder 13 attached to the paper feed roller 65 rotates in the reverse direction. When the mounting unit 65 to which the encoder 13 is mounted rotates reversely when the PF motor 1 is started, the output of the speed calculation unit 6d that calculates the speed based on the output of the encoder 13 becomes inaccurate, or the speed calculation unit 6d A problem arises that the timer counter used for the speed calculation overflows and an accurate speed cannot be detected.

【0038】本発明は上記事情を考慮してなされたもの
であって、モータの起動時に、エンコーダが取り付けら
れた取り付け部に逆転が生じても正確な速度検出を行う
ことのできるモータの制御装置および制御方法ならびに
モータの制御プログラムを記録した記録媒体を提供する
ことを目的とする。
The present invention has been made in view of the above circumstances, and provides a motor control device that can accurately detect a speed at the time of starting the motor even if reverse rotation occurs in a mounting portion on which an encoder is mounted. It is another object of the present invention to provide a recording medium storing a control program for a motor and a control program for a motor.

【0039】[0039]

【課題を解決するための手段】本発明によるモータの制
御装置は、モータの回転に従って回転するエンコーダの
出力パルスに基づいて、前記モータの起動時に前記エン
コーダが取り付けられた取り付け部にの逆転が生じたか
否かを検出する逆転検出部と、前記取り付け部に逆転が
生じた場合に、前記取り付け部の回転が逆転から正転に
変わった後の前記エンコーダの出力パルスのエッジをカ
ウントし、そのカウント値が第1の所定値になったとき
に開始指令を出力する第1のパルスカウンタと、前記取
り付け部に逆転が生じた場合に、前記開始指令を受けた
ときに、前記エンコーダの出力パルスに基づいて前記モ
ータの速度を演算する速度演算部と、を備えたことを特
徴とする。
According to the motor control apparatus of the present invention, when the motor is started, reverse rotation of the mounting portion to which the encoder is mounted occurs based on the output pulse of the encoder that rotates according to the rotation of the motor. A reverse rotation detection unit for detecting whether or not the rotation of the mounting unit has changed from a reverse rotation to a normal rotation when a reverse rotation has occurred in the mounting unit. A first pulse counter that outputs a start command when the value reaches a first predetermined value; and a reverse rotation occurs in the mounting portion. A speed calculating unit for calculating the speed of the motor based on the speed.

【0040】なお、前記モータの起動時に前記エンコー
ダの出力パルスのエッジをカウントし、そのカウント値
が第2の所定値になったときに開始指令を出力する第2
のパルスカウンタを更に備え、前記速度演算部は、前記
取り付け部に逆転が生じた場合には前記第1のパルスカ
ウンタから出力される開始指令に基づいて、逆転が生じ
なかった場合には前記第2のパルスカウンタから出力さ
れる開始指令に基づいて、速度演算を開始するように構
成しても良い。
Note that the edge of the output pulse of the encoder is counted when the motor is started, and a start command is output when the count value reaches a second predetermined value.
The speed calculation unit further includes a pulse counter based on a start command output from the first pulse counter when the attachment unit reversely rotates. The speed calculation may be started based on a start command output from the second pulse counter.

【0041】なお、前記モータは印刷装置の紙送りモー
タであるように構成しても良い。
The motor may be configured to be a paper feed motor of a printing apparatus.

【0042】なお、前記モータの目標速度と、前記速度
演算部によって演算された前記モータの速度との偏差に
基づいて前記モータの速度を制御する速度制御部を備え
るように構成しても良い。
[0042] It should be noted that a speed controller for controlling the speed of the motor based on a deviation between the target speed of the motor and the speed of the motor calculated by the speed calculator may be provided.

【0043】また、本発明によるモータの制御方法は、
モータの回転に従って回転するエンコーダの出力パルス
に基づいて、前記モータの起動時に前記エンコーダが取
り付けられた取り付け部に逆転が生じたか否かを検出す
るステップと、前記取り付け部に逆転が生じた場合に、
前記取り付け部の回転が逆転から正転に変わった後の前
記エンコーダの出力パルスのエッジをカウントし、その
カウント値が第1の所定値になったときに開始指令を出
力するステップと、前記開始指令を受けたときに前記エ
ンコーダの出力パルスに基づいて前記モータの速度を演
算するステップと、を備えたことを特徴とする。
Further, the motor control method according to the present invention
Based on an output pulse of an encoder that rotates according to the rotation of the motor, detecting whether or not a reverse rotation has occurred in a mounting portion to which the encoder is mounted when the motor is started, and when a reverse rotation occurs in the mounting portion. ,
Counting the edges of the output pulse of the encoder after the rotation of the mounting portion has changed from reverse rotation to normal rotation, and outputting a start command when the count value reaches a first predetermined value; Calculating a speed of the motor based on an output pulse of the encoder when receiving a command.

【0044】なお、前記モータの速度を演算するステッ
プの前に、前記エンコーダの出力パルスのエッジをカウ
ントし、そのカウント値が第2の所定値になるかまたは
前記取り付け部が逆転しなかったときに開始指令を出力
するステップを備えるように構成しても良い。
Before the step of calculating the speed of the motor, the edge of the output pulse of the encoder is counted, and when the count value becomes a second predetermined value or the mounting portion does not rotate in the reverse direction. May be configured to include a step of outputting a start command to the server.

【0045】なお、前記モータの速度を演算するステッ
プの後に、前記モータの目標速度と、前記演算された速
度との偏差に基づいて前記モータの速度を制御するステ
ップと、を備えるように構成しても良い。
It should be noted that, after the step of calculating the speed of the motor, a step of controlling the speed of the motor based on a deviation between the target speed of the motor and the calculated speed is provided. May be.

【0046】なお、前記モータは印刷装置の紙送りモー
タであるように構成しても良い。
The motor may be a paper feed motor of a printing apparatus.

【0047】また、本発明によるモータの制御プログラ
ムを記録した記録媒体は、モータの回転に従って回転す
るエンコーダの出力パルスに基づいて、前記モータの起
動時に前記エンコーダが取り付けられた取り付け部に逆
転が生じたか否かを検出する手順と、前記取り付け部に
逆転が生じた場合に、前記取り付け部の回転が逆転から
正転に変わった後の前記エンコーダの出力パルスのエッ
ジをカウントし、そのカウント値が第1の所定値になっ
たときに開始指令を出力する手順と、前記開始指令を受
けたときに前記エンコーダの出力パルスに基づいて前記
モータの速度を演算する手順と、を備えたことを特徴と
する。
In the recording medium storing the motor control program according to the present invention, when the motor is started, reverse rotation occurs in the mounting portion to which the encoder is mounted, based on the output pulse of the encoder that rotates in accordance with the rotation of the motor. And a step of detecting whether or not the rotation of the mounting portion, when reverse rotation occurs, counts the edge of the output pulse of the encoder after the rotation of the mounting portion changed from reverse rotation to normal rotation, the count value is A step of outputting a start command when the first predetermined value is reached, and a step of calculating a speed of the motor based on an output pulse of the encoder when receiving the start command. And

【0048】[0048]

【発明の実施の形態】本発明によるモータの制御装置の
一実施の形態を図1乃至図3を参照して説明する。この
実施の形態のモータの制御装置の構成を図1に示し、そ
の動作を図2のフローチャートに示す。この実施の形態
のモータの制御装置は、図9に示す従来のモータの制御
装置(DCユニット)6において、パルスカウンタ6
p,6rと、逆転検出部6qと、ANDゲート6sと、
ORゲート6tとを新たに付加した構成となっている。
パルスカウンタ6p,6r、逆転検出部6q、ANDゲ
ート6s、およびORゲート6t以外は図9で説明済の
ため説明を省略する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of a motor control device according to the present invention will be described with reference to FIGS. FIG. 1 shows the configuration of the motor control device according to this embodiment, and its operation is shown in the flowchart of FIG. The motor control device of this embodiment is different from the conventional motor control device (DC unit) 6 shown in FIG.
p, 6r, a reverse rotation detector 6q, an AND gate 6s,
An OR gate 6t is newly added.
The components other than the pulse counters 6p and 6r, the reverse rotation detector 6q, the AND gate 6s, and the OR gate 6t have already been described with reference to FIG.

【0049】次に本実施の形態の構成および作用を図1
乃至図3を参照して説明する。
Next, the configuration and operation of this embodiment will be described with reference to FIG.
This will be described with reference to FIGS.

【0050】今、起動指令信号が制御装置6に与えら
れ、PFモータ1が起動し始めた場合を考える。PFモ
ータ1が起動するとエンコーダ13から出力パルスEN
C−A,ENC−Bが出力される。するとこの出力パル
スENC−A,ENC−Bの立上がりエッジおよび立下
がりエッジの数がパルスカウンタ6pによってカウント
される。そしてそのカウント値が所定値N(例えばN
=7)になるとパルスカウンタ6pから指令信号がA
NDゲート6sに出力される(図2のステップF1参
照)。このとき、エンコーダ13が取り付けられている
取り付け部(紙送りローラ65)が逆転したか否かが、
エンコーダ13の出力に基づいて逆転検出部6qによっ
て検出される(図2のステップF2参照)。逆転しなか
った場合は逆転検出部6qからANDゲート6sに指令
信号が送られ後述する図2のステップF4に進む。
Now, consider a case where a start command signal is given to the control device 6 and the PF motor 1 starts to be started. When the PF motor 1 starts, the output pulse EN from the encoder 13 is output.
CA and ENC-B are output. Then, the number of rising edges and falling edges of output pulses ENC-A and ENC-B is counted by pulse counter 6p. Then, the count value becomes a predetermined value N 1 (for example, N 1
1 = 7), the command signal from the pulse counter 6p becomes A
The signal is output to the ND gate 6s (see step F1 in FIG. 2). At this time, it is determined whether or not the mounting portion (paper feed roller 65) on which the encoder 13 is mounted has rotated in the reverse direction.
It is detected by the reverse rotation detecting unit 6q based on the output of the encoder 13 (see step F2 in FIG. 2). If the reverse rotation has not been performed, a command signal is sent from the reverse rotation detector 6q to the AND gate 6s, and the process proceeds to step F4 in FIG.

【0051】逆転した場合は、エンコーダ13が取り付
けられた取り付け部の回転が逆転から正転に変わったと
きに逆転検出部6qからパルスカウンタ6rに指令信号
が送られる。この指令信号をパルスカウンタ6rが受信
すると、エンコーダ13の取り付け部の回転が逆転から
正転に変わってからの、エンコーダ13の出力パルスE
NC−A,ENC−Bのエッジの数をカウントする。
In the case of reverse rotation, a command signal is sent from the reverse rotation detecting section 6q to the pulse counter 6r when the rotation of the mounting section on which the encoder 13 is mounted changes from reverse rotation to normal rotation. When this command signal is received by the pulse counter 6r, the output pulse E of the encoder 13 after the rotation of the mounting portion of the encoder 13 changes from reverse rotation to normal rotation.
The number of edges of NC-A and ENC-B is counted.

【0052】そしてそのカウント値Nが所定値(例え
ば、5)以上となったときは指令信号がパルスカウンタ
6rからORゲート6tに出力される(図2のステップ
F3参照)。例えば図3に示すように時刻tでPFモ
ータ1が起動して、逆転した(t)後の正転が時刻t
で逆転検出部6qによって検出され、パルスカウンタ
6rに指令信号が送られる。そして次のパルスエッジが
生じたとき(時刻t)からパルスエッジの数がパルス
カウンタ6rによってカウントされ、そのカウント値N
がN=5になったとき(時刻t)にパルスカウン
タ6rからORゲート6tに指令信号が送られる。
[0052] The count value N 2 is predetermined value (e.g., 5) or more and became time the command signal is output from the pulse counter 6r to the OR gate 6t (see step F3 in FIG. 2). For example Start PF motor 1 at time t 0 as shown in FIG. 3, the forward rotation after reversed (t 1) the time t
In step 2 , the reverse rotation detection unit 6q detects the rotation, and sends a command signal to the pulse counter 6r. When the next pulse edge occurs (time t 3 ), the number of pulse edges is counted by the pulse counter 6r, and the count value N
When 2 becomes N 2 = 5 (time t 4 ), a command signal is sent from the pulse counter 6r to the OR gate 6t.

【0053】なお、エンコーダ13の取り付け部が逆転
しなかった場合は、パルスカウンタ6pおよび逆転検出
部6qから各々ANDゲート6sに指令信号が送られる
ため、ANDゲート6sから指令信号がORゲート6t
に出力される。
If the mounting portion of the encoder 13 does not rotate in reverse, a command signal is sent from the pulse counter 6p and the reverse rotation detecting portion 6q to the AND gate 6s, respectively, so that the command signal is sent from the AND gate 6s to the OR gate 6t.
Is output to

【0054】したがってエンコーダ13の取り付け部が
逆転しなかった場合はANDゲート6sから、逆転した
場合はパルスカウンタ6rから指令信号がORゲート6
tに入力される。すると、ORゲート6tから速度演算
の開始指令が速度演算部6dに送られる(図2のステッ
プF4参照)。
Therefore, when the mounting portion of the encoder 13 does not reverse, the command signal is supplied from the AND gate 6s, and when the mounting portion is reversed, the command signal is supplied from the pulse counter 6r.
t is input. Then, a speed calculation start command is sent from the OR gate 6t to the speed calculation unit 6d (see step F4 in FIG. 2).

【0055】この開始指令を受信して初めて、速度演算
部6dは図9で既に説明した速度演算を開始する。
Only after receiving the start command, the speed calculation section 6d starts the speed calculation already described with reference to FIG.

【0056】以上説明したように本実施の形態によれ
ば、PFモータ1の起動時にエンコーダ13の取り付け
部に逆転が生じた場合には、逆転から正転に変わった後
の所定値N個のパルスエッジまでが速度演算に用いら
れず、それ以降のパルスエッジが速度演算に用いられ
る。これにより、PFモータ1の起動時にエンコーダ1
3の取り付け部に逆転が生じても速度演算部6dの出力
は正確となる。
[0056] According to the present embodiment as described above, when the reverse rotation when starting the PF motor 1 to the mounting portion of the encoder 13 occurs, two predetermined values N after changed from the reverse rotation to the normal rotation Are not used for the speed calculation, and the subsequent pulse edges are used for the speed calculation. Thereby, when the PF motor 1 is started, the encoder 1
The output of the speed calculation unit 6d is accurate even if the attachment portion 3 is reversed.

【0057】また、逆転から正転に変わった後の所定値
個のパルスエッジまでが速度演算に用いられず、そ
れ以降のパルスエッジが速度演算に用いられるため、P
Fモータ1の起動時にエンコーダ13の取り付け部に逆
転が生じても速度演算部6dの速度演算に用いられるタ
イマカウンタがオーバーフローするのを防止することが
できる。
[0057] In addition, since the to a predetermined value N 2 pulses edge after changed from the reverse rotation to the normal rotation can not be used for speed calculation, and subsequent pulse edge it is used for speed calculation, P
Even when the mounting portion of the encoder 13 reversely rotates when the F motor 1 is started, it is possible to prevent the timer counter used for the speed calculation of the speed calculation unit 6d from overflowing.

【0058】なお、上記実施の形態ではDCモータにつ
いて説明したが本発明はこれに限定されるものではな
く、ACモータ等にも適用することができることは云う
までもない。
Although the DC motor has been described in the above embodiment, the present invention is not limited to this, and it goes without saying that the present invention can be applied to an AC motor or the like.

【0059】なお、所定値Nは印刷装置の使用頻度
等、環境状況によって変えるようにしても良い。
[0059] The predetermined value N 2 is frequently used, etc. of the printing apparatus may be changed by the environmental conditions.

【0060】次に、本発明によるモータの制御プログラ
ムを記録した記録媒体の一実施の形態について図12お
よび図13を参照して説明する。図12,図13は、本
実施の形態のモータの制御プログラムを記録した記録媒
体が用いられるコンピュータシステム130の一例を示
す斜視図およびブロック図である。図12において、コ
ンピュータシステム130は、CPUを含むコンピュー
タ本体131と、例えばCRT等の表示装置132と、
キーボードやマウス等の入力装置133と、印刷を実行
する印刷装置134と、を備えている。
Next, an embodiment of a recording medium on which a motor control program according to the present invention is recorded will be described with reference to FIGS. 12 and 13 are a perspective view and a block diagram, respectively, showing an example of a computer system 130 using a recording medium on which a motor control program according to the present embodiment is recorded. 12, a computer system 130 includes a computer main body 131 including a CPU, a display device 132 such as a CRT,
An input device 133 such as a keyboard and a mouse, and a printing device 134 for executing printing are provided.

【0061】コンピュータ本体131は、図13に示す
ように、RAMより構成される内部メモリ135と、内
蔵または外付け可能なメモリユニット136と、を備え
ており、メモリユニット136としてはフレキシブルま
たはフロッピディスク(FD)ドライブ137,CD−
ROMドライブ138,ハードディスクドライブ(H
D)ユニット139が搭載されている。図12に示すよ
うに、これらのメモリユニット136に用いられる記録
媒体140としては、FDドライブ137のスロットに
挿入されて使用されるフレキシブルディスクまたはフロ
ッピディスク(FD)141と、CD−ROMドライブ
138に用いられるCD−ROM142等が用いられ
る。
As shown in FIG. 13, the computer main unit 131 has an internal memory 135 composed of a RAM and a memory unit 136 that can be built in or externally mounted. The memory unit 136 is a flexible or floppy disk. (FD) drive 137, CD-
ROM drive 138, hard disk drive (H
D) A unit 139 is mounted. As shown in FIG. 12, as a recording medium 140 used in these memory units 136, a flexible disk or floppy disk (FD) 141 inserted into a slot of an FD drive 137 and a CD-ROM drive 138 are used. The used CD-ROM 142 or the like is used.

【0062】図12および図13に示すように、一般的
なコンピュータシステムに用いられる記録媒体140と
しては、FD141やCD−ROM142が考えられる
が、本実施の形態は特に印刷装置134の制御プログラ
ムに関するものであるので、例えば印刷装置134に内
蔵させる不揮発性メモリとしてのROMチップ143に
本発明のモータの制御プログラムを記録させるようにし
ても良い。
As shown in FIGS. 12 and 13, as the recording medium 140 used in a general computer system, an FD 141 or a CD-ROM 142 is considered. For example, the control program for the motor of the present invention may be recorded in a ROM chip 143 as a non-volatile memory built in the printing apparatus 134.

【0063】本実施の形態の記録媒体140は、モータ
の回転に従って回転するエンコーダの出力パルスに基づ
いて、前記モータの起動時に前記エンコーダの取り付け
部に逆転が生じたか否かを検出する手順と、前記エンコ
ーダの取り付け部に逆転が生じた場合に、前記エンコー
ダの取り付け部の回転が逆転から正転に変わった後の前
記エンコーダの出力パルスのエッジをカウントし、その
カウント値が第1の所定値になったときに開始指令を出
力する手順と、前記開始指令を受けたときに前記エンコ
ーダの出力パルスに基づいて前記モータの速度を演算す
る手順と、を少なくとも備えるものである。
The recording medium 140 according to the present embodiment has a procedure for detecting whether or not a reverse rotation has occurred in a mounting portion of the encoder when the motor is started, based on an output pulse of an encoder that rotates in accordance with the rotation of the motor. When reverse rotation occurs in the mounting portion of the encoder, the edge of the output pulse of the encoder after the rotation of the mounting portion of the encoder changes from reverse rotation to normal rotation is counted, and the count value is a first predetermined value. And a procedure for calculating a speed of the motor based on an output pulse of the encoder when the start command is received.

【0064】[0064]

【発明の効果】以上述べたように、本発明によれば、モ
ータの起動時にエンコーダの取り付け部に逆転が生じて
も正確な速度検出を行うことができる。
As described above, according to the present invention, accurate speed detection can be performed even if reverse rotation occurs in the mounting portion of the encoder when the motor is started.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明によるモータの制御装置の一実施の形態
の構成を示すブロック図。
FIG. 1 is a block diagram showing a configuration of an embodiment of a motor control device according to the present invention.

【図2】実施の形態の動作を説明するフローチャート。FIG. 2 is a flowchart illustrating operation of the embodiment.

【図3】パルスカウンタの動作を説明するタイミングチ
ャート。
FIG. 3 is a timing chart illustrating the operation of a pulse counter.

【図4】インクジェットプリンタの概略の構成を示す構
成図。
FIG. 4 is a configuration diagram illustrating a schematic configuration of an inkjet printer.

【図5】キャリッジ周辺の構成を示す斜視図。FIG. 5 is a perspective view showing a configuration around a carriage.

【図6】リニア式エンコーダの構成を示す模式図。FIG. 6 is a schematic diagram showing a configuration of a linear encoder.

【図7】エンコーダの出力パルスの波形図。FIG. 7 is a waveform diagram of an output pulse of an encoder.

【図8】紙検出センサの位置を説明するプリンタの概略
の斜視図。
FIG. 8 is a schematic perspective view of the printer illustrating the position of a paper detection sensor.

【図9】従来のモータの制御装置の構成を示すブロック
図。
FIG. 9 is a block diagram showing a configuration of a conventional motor control device.

【図10】従来のモータの制御装置の速度制御を説明す
るタイミングチャート。
FIG. 10 is a timing chart illustrating speed control of a conventional motor control device.

【図11】紙送り機構を説明する図。FIG. 11 is a diagram illustrating a paper feeding mechanism.

【図12】本発明によるモータの制御プログラムを記録
した記録媒体が用いられるコンピュータシステムの一例
を示す斜視図。
FIG. 12 is a perspective view showing an example of a computer system using a recording medium recording a motor control program according to the present invention.

【図13】本発明によるモータの制御プログラムを記録
した記録媒体が用いられるコンピュータシステムの一例
を示すブロック図。
FIG. 13 is a block diagram showing an example of a computer system using a recording medium recording a motor control program according to the present invention.

【符号の説明】[Explanation of symbols]

1 紙送りモータ(PFモータ) 2 紙送りモータドライバ 3 キャリッジ 4 キャリッジモータ(CRモータ) 5 キャリッジモータドライバ(CRモータドライバ) 6 DCユニット 6a 位置カウンタ 6b 減算器 6c 目標速度演算手段 6d 速度演算部 6e 減算器 6f 比例要素 6g 積分要素 6h 微分要素 6j D/Aコンバータ 6k タイマ 6m 加速制御部 6p パルスカウンタ 6q 逆転検出部 6r パルスカウンタ 6s ANDゲート 6t ORゲート 7 ポンプモータ 8 ポンプモータドライバ 9 記録ヘッド 10 ヘッドドライバ 11 リニア式エンコーダ 12 符号板 13 エンコーダ(ロータリ式エンコーダ) 15 紙検出センサ 16 CPU 17 タイマIC 18 ホストコンピュータ 19 インタフェース部 20 ASIC 21 PROM 22 RAM 23 EEPROM 25 プラテン 30 プーリ 31 タイミングベルト 32 キャリッジモータのガイド部材 34 インクカートリッジ 35 キャッピング装置 36 ポンプユニット 37 キャップ 50 記録紙 65 紙送りローラ 66 従動ローラ 68 排紙ローラ 69 従動ローラ 80 バネ 1 Paper feed motor (PF motor) 2 Paper feed motor driver 3 Carriage 4 Carriage motor (CR motor) 5 Carriage motor driver (CR motor driver) 6 DC unit 6a Position counter 6b Subtractor 6c Target speed calculator 6d Speed calculator 6e Subtractor 6f Proportional element 6g Integral element 6h Differential element 6j D / A converter 6k Timer 6m Acceleration controller 6p Pulse counter 6q Reverse rotation detector 6r Pulse counter 6s AND gate 6t OR gate 7 Pump motor 8 Pump motor driver 9 Recording head 10 Head Driver 11 Linear encoder 12 Code plate 13 Encoder (rotary encoder) 15 Paper detection sensor 16 CPU 17 Timer IC 18 Host computer 19 Interface unit 20 ASIC 21 PROM 22 RAM 23 EEPROM 25 Platen 30 Pulley 31 Timing belt 32 Guide member of carriage motor 34 Ink cartridge 35 Capping device 36 Pump unit 37 Cap 50 Recording paper 65 Paper feed roller 66 Follower roller 68 Discharge roller 69 Follower roller 80 Spring

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】モータの回転に従って回転するエンコーダ
の出力パルスに基づいて、前記モータの起動時に前記エ
ンコーダが取り付けられた取り付け部に逆転が生じたか
否かを検出する逆転検出部と、 前記取り付け部に逆転が生じた場合に、前記取り付け部
の回転が逆転から正転に変わった後の前記エンコーダの
出力パルスのエッジをカウントし、そのカウント値が第
1の所定値になったときに開始指令を出力する第1のパ
ルスカウンタと、 前記取り付け部に逆転が生じた場合に、前記開始指令を
受けたときに、前記エンコーダの出力パルスに基づいて
前記モータの速度を演算する速度演算部と、 を備えたことを特徴とするモータの制御装置。
1. A reverse rotation detecting section for detecting whether or not a reverse rotation has occurred in a mounting section to which the encoder is mounted when the motor is started, based on an output pulse of an encoder that rotates in accordance with rotation of the motor; When the reverse rotation occurs, the edge of the output pulse of the encoder after the rotation of the mounting portion changes from the reverse rotation to the normal rotation is counted, and the start command is issued when the count value becomes the first predetermined value. A first pulse counter that outputs, when a reverse rotation occurs in the mounting portion, a speed calculation unit that calculates the speed of the motor based on an output pulse of the encoder when receiving the start command; A control device for a motor, comprising:
【請求項2】前記モータの起動時に前記エンコーダの出
力パルスのエッジをカウントし、そのカウント値が第2
の所定値になったときに開始指令を出力する第2のパル
スカウンタを更に備え、 前記速度演算部は、前記取り付け部に逆転が生じた場合
には前記第1のパルスカウンタから出力される開始指令
に基づいて、逆転が生じなかった場合には前記第2のパ
ルスカウンタから出力される開始指令に基づいて、速度
演算を開始することを特徴とする請求項1記載のモータ
の制御装置。
2. The method according to claim 1, wherein when the motor is started, an edge of an output pulse of the encoder is counted.
A second pulse counter that outputs a start command when a predetermined value is reached, wherein the speed calculation unit starts outputting from the first pulse counter when the attachment unit reversely rotates. 2. The motor control device according to claim 1, wherein when the reverse rotation does not occur based on the command, the speed calculation is started based on a start command output from the second pulse counter.
【請求項3】前記モータは印刷装置の紙送りモータであ
ることを特徴とする請求項1乃至2のいずれかに記載の
モータの制御装置。
3. The motor control device according to claim 1, wherein the motor is a paper feed motor of a printing apparatus.
【請求項4】前記モータの目標速度と、前記速度演算部
によって演算された前記モータの速度との偏差に基づい
て前記モータの速度を制御する速度制御部を備えている
ことを特徴とする請求項1乃至3のいずれかに記載のモ
ータの制御装置。
4. A motor control apparatus according to claim 1, further comprising a speed controller for controlling the speed of said motor based on a deviation between a target speed of said motor and a speed of said motor calculated by said speed calculator. Item 4. A motor control device according to any one of Items 1 to 3.
【請求項5】モータの回転に従って回転するエンコーダ
の出力パルスに基づいて、前記モータの起動時に前記エ
ンコーダが取り付けられた取り付け部に逆転が生じたか
否かを検出するステップと、 前記取り付け部に逆転が生じた場合に、前記取り付け部
の回転が逆転から正転に変わった後の前記エンコーダの
出力パルスのエッジをカウントし、そのカウント値が第
1の所定値になったときに開始指令を出力するステップ
と、 前記開始指令を受けたときに前記エンコーダの出力パル
スに基づいて前記モータの速度を演算するステップと、 を備えたことを特徴とするモータの制御方法。
5. A step of detecting whether or not a reverse rotation has occurred in a mounting portion on which the encoder is mounted when the motor is started, based on an output pulse of an encoder that rotates according to the rotation of the motor; Occurs, the edge of the output pulse of the encoder after the rotation of the mounting portion has changed from reverse rotation to normal rotation is counted, and a start command is output when the count value reaches a first predetermined value. And a step of calculating a speed of the motor based on an output pulse of the encoder when receiving the start command.
【請求項6】前記モータの速度を演算するステップの前
に、前記エンコーダの出力パルスのエッジをカウント
し、そのカウント値が第2の所定値になるかまたは前記
取り付け部が逆転しなかったときに開始指令を出力する
ステップを備えたことを特徴とする請求項5記載のモー
タの制御方法。
6. An edge of an output pulse of the encoder is counted before the step of calculating a speed of the motor, and when the count value becomes a second predetermined value or the mounting portion does not rotate backward. 6. The method according to claim 5, further comprising the step of outputting a start command to the motor.
【請求項7】前記モータの速度を演算するステップの後
に、前記モータの目標速度と、前記演算された速度との
偏差に基づいて前記モータの速度を制御するステップ
と、 を備えたことを特徴とする請求項5乃至6のいずれかに
記載のモータの制御方法。
7. The method according to claim 1, further comprising: after the step of calculating the speed of the motor, controlling the speed of the motor based on a deviation between a target speed of the motor and the calculated speed. The method for controlling a motor according to claim 5.
【請求項8】前記モータは印刷装置の紙送りモータであ
ることを特徴とする請求項5乃至7のいずれかに記載の
モータの制御方法。
8. The method according to claim 5, wherein said motor is a paper feed motor of a printing apparatus.
【請求項9】モータの回転に従って回転するエンコーダ
の出力パルスに基づいて、前記モータの起動時に前記エ
ンコーダが取り付けられた取り付け部に逆転が生じたか
否かを検出する手順と、 前記取り付け部に逆転が生じた場合に、前記取り付け部
の回転が逆転から正転に変わった後の前記エンコーダの
出力パルスのエッジをカウントし、そのカウント値が第
1の所定値になったときに開始指令を出力する手順と、 前記開始指令を受けたときに前記エンコーダの出力パル
スに基づいて前記モータの速度を演算する手順と、 を備えたことを特徴とするコンピュータによってモータ
を制御するためのモータの制御プログラムを記録した記
録媒体。
9. A procedure for detecting whether or not a reverse rotation has occurred in a mounting portion on which the encoder is mounted when the motor is started, based on an output pulse of an encoder that rotates in accordance with rotation of the motor; Occurs, the edge of the output pulse of the encoder after the rotation of the mounting portion has changed from reverse rotation to normal rotation is counted, and a start command is output when the count value reaches a first predetermined value. A motor control program for controlling the motor by a computer, comprising: a step of calculating the speed of the motor based on an output pulse of the encoder when the start command is received. Recording medium on which is recorded.
JP36802999A 1999-12-24 1999-12-24 MOTOR CONTROL DEVICE, ITS CONTROL METHOD, AND RECORDING MEDIUM CONTAINING MOTOR CONTROL PROGRAM Expired - Fee Related JP3705061B2 (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
JP36802999A JP3705061B2 (en) 1999-12-24 1999-12-24 MOTOR CONTROL DEVICE, ITS CONTROL METHOD, AND RECORDING MEDIUM CONTAINING MOTOR CONTROL PROGRAM
AT00311536T ATE339320T1 (en) 1999-12-24 2000-12-21 DEVICE AND METHOD FOR ENGINE CONTROL
DE60040494T DE60040494D1 (en) 1999-12-24 2000-12-21 Device and method for engine control
AT06075410T ATE410309T1 (en) 1999-12-24 2000-12-21 DEVICE AND METHOD FOR ENGINE CONTROL
EP06075410A EP1681173B1 (en) 1999-12-24 2000-12-21 Motor control apparatus and motor control method
DE60030667T DE60030667T2 (en) 1999-12-24 2000-12-21 Device and method for engine control
EP00311536A EP1110744B1 (en) 1999-12-24 2000-12-21 Motor control apparatus and motor control method
US09/742,107 US6418274B2 (en) 1999-12-24 2000-12-22 Motor control apparatus and motor control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36802999A JP3705061B2 (en) 1999-12-24 1999-12-24 MOTOR CONTROL DEVICE, ITS CONTROL METHOD, AND RECORDING MEDIUM CONTAINING MOTOR CONTROL PROGRAM

Publications (2)

Publication Number Publication Date
JP2001186785A true JP2001186785A (en) 2001-07-06
JP3705061B2 JP3705061B2 (en) 2005-10-12

Family

ID=18490802

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36802999A Expired - Fee Related JP3705061B2 (en) 1999-12-24 1999-12-24 MOTOR CONTROL DEVICE, ITS CONTROL METHOD, AND RECORDING MEDIUM CONTAINING MOTOR CONTROL PROGRAM

Country Status (1)

Country Link
JP (1) JP3705061B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6794840B2 (en) 2002-03-22 2004-09-21 Brother Kogyo Kabushiki Kaisha Motor control method and motor control apparatus
US6812668B2 (en) 2002-03-25 2004-11-02 Brother Kogyo Kabushiki Kaisha Apparatus, method and program for controlling an electric motor
US7821216B2 (en) 2003-09-12 2010-10-26 Brother Kogyo Kabushiki Kaisha Motor control method and control device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6794840B2 (en) 2002-03-22 2004-09-21 Brother Kogyo Kabushiki Kaisha Motor control method and motor control apparatus
US6812668B2 (en) 2002-03-25 2004-11-02 Brother Kogyo Kabushiki Kaisha Apparatus, method and program for controlling an electric motor
US7821216B2 (en) 2003-09-12 2010-10-26 Brother Kogyo Kabushiki Kaisha Motor control method and control device

Also Published As

Publication number Publication date
JP3705061B2 (en) 2005-10-12

Similar Documents

Publication Publication Date Title
EP1602504B1 (en) Motor control device and motor control method
US7147299B2 (en) Control unit and method for controlling motor for use in printer, and storage medium storing control program
EP1681173B1 (en) Motor control apparatus and motor control method
US6528962B1 (en) Control unit and method for controlling motor for use in printer, and storage medium storing control program
JP4457456B2 (en) Printing device
US7431414B2 (en) Printer-control apparatus, printer-control method and printer
JP3832174B2 (en) Motor control device and control method
JP3570617B2 (en) DC motor control device and control method
US6967729B1 (en) Control unit and method for controlling motor for use in printer, and storage medium storing control program
JP3705061B2 (en) MOTOR CONTROL DEVICE, ITS CONTROL METHOD, AND RECORDING MEDIUM CONTAINING MOTOR CONTROL PROGRAM
JP4325151B2 (en) Printing apparatus and computer system
JP3893853B2 (en) Printer motor control apparatus and control method
JP3871181B2 (en) PRINT CONTROL DEVICE, CONTROL METHOD, AND RECORDING MEDIUM CONTAINING PRINT CONTROL PROGRAM
JP3849908B2 (en) Print control apparatus and print control method
JP4432055B2 (en) Printer motor control apparatus and control method
JP3812283B2 (en) PRINT CONTROL DEVICE, PRINT CONTROL METHOD, AND RECORDING MEDIUM CONTAINING PRINT CONTROL PROGRAM
JP2001224189A (en) Motor control method and control unit
JP3812351B2 (en) PRINT CONTROL DEVICE, PRINT CONTROL METHOD, AND RECORDING MEDIUM CONTAINING PRINT CONTROL PROGRAM
JP4026331B2 (en) Motor driving method, motor driving apparatus, printer, computer program, and computer system
JP3900401B2 (en) DC motor control method and control apparatus
JP2005200222A (en) Printing controller and printing control method and recording medium with printing control program recorded
JP2001078475A (en) Device and method for controlling motor
JP2002283559A (en) Print controller, method for controlling print, and recording medium having print control program recorded therein
JP2001088386A (en) Apparatus and method for controlling printing
JP2003023788A (en) Motor drive motor, motor drive device, printer, computer program, recording medium, and computer system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050407

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050412

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050613

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: 20050705

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050718

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080805

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090805

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090805

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100805

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110805

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120805

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130805

Year of fee payment: 8

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees