JP4742808B2 - Position measuring apparatus and position measuring method - Google Patents

Position measuring apparatus and position measuring method Download PDF

Info

Publication number
JP4742808B2
JP4742808B2 JP2005309746A JP2005309746A JP4742808B2 JP 4742808 B2 JP4742808 B2 JP 4742808B2 JP 2005309746 A JP2005309746 A JP 2005309746A JP 2005309746 A JP2005309746 A JP 2005309746A JP 4742808 B2 JP4742808 B2 JP 4742808B2
Authority
JP
Japan
Prior art keywords
signal
count value
bit counter
phase signal
level
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
JP2005309746A
Other languages
Japanese (ja)
Other versions
JP2007120970A (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.)
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
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2005309746A priority Critical patent/JP4742808B2/en
Publication of JP2007120970A publication Critical patent/JP2007120970A/en
Application granted granted Critical
Publication of JP4742808B2 publication Critical patent/JP4742808B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Ink Jet (AREA)
  • Handling Of Cut Paper (AREA)
  • Character Spaces And Line Spaces In Printers (AREA)
  • Optical Transform (AREA)
  • Controlling Sheets Or Webs (AREA)

Description

本発明は、位置計測装置及び位置計測方法に関する。   The present invention relates to a position measuring device and a position measuring method.

従来、制御対象の制御量を検出するために、例えば、リニアエンコーダ又はロータリーエンコーダ等が用いられている。   Conventionally, for example, a linear encoder or a rotary encoder is used in order to detect a control amount to be controlled.

このようなエンコーダのうち、例えば、ロータリーエンコーダの分解能を向上させる方法としては、特許文献1に示すような技術が開示されている。
特開昭63−69323号公報(要約書、図1、図2参照)
Among such encoders, for example, as a method for improving the resolution of a rotary encoder, a technique as disclosed in Patent Document 1 is disclosed.
Japanese Patent Laid-Open No. 63-69323 (abstract, see FIGS. 1 and 2)

制御対象の動作速度が速くなると、エンコーダから出力される信号に基づいて正しくカウントを行うことができなくなるおそれがある。また、カウントが行えなくなる事態が重なると、検出誤差が累積するおそれもある。   If the operation speed of the control target is increased, there is a possibility that the count cannot be performed correctly based on the signal output from the encoder. In addition, if the situation in which counting cannot be performed overlaps, detection errors may accumulate.

そこで、本発明は、制御対象の動作速度が速くなっても、エンコーダの出力に基づいて正しくカウント可能な位置計測装置を提供することを目的とする。   Accordingly, an object of the present invention is to provide a position measuring apparatus that can correctly count based on the output of an encoder even when the operation speed of a control target increases.

上記目的を達成するための主たる発明は、(1)スリットと検出器とを有し、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するエンコーダと、(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力する第1カウンタと、(3)前記第1カウント値が更新されたときに、前記第1カウンタから出力される前記第1カウント値に基づいて第1情報が設定され、前記エンコーダから出力される第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報が設定され、設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力する
第2カウンタと、を備えることを特徴とする。
The main invention for achieving the above object is (1) having a slit and a detector, wherein the first signal, the second signal, the third signal, and the fourth signal are set according to the position of the slit with respect to the detector. (2) a first counter that increments or decrements a first count value based on the first signal and the third signal, and (3) the first count value is updated. First information is set based on the first count value output from the first counter, and based on the first signal, the second signal, the third signal, and the fourth signal output from the encoder. Second information corresponding to the positional relationship between the slit and the detector is set, and the second count value including the set first information and the second information is set as the second signal and the fourth signal. Based on There characterized in that it comprises a second counter and outputting the incremented or decremented, the by.

本発明の他の特徴については、本明細書及び添付図面の記載により明らかにする。   Other features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

本明細書及び添付図面の記載により、少なくとも、以下の事項が明らかとなる。   At least the following matters will become clear from the description of the present specification and the accompanying drawings.

(1)スリットと検出器とを有し、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するエンコーダと、
(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力する第1カウンタと、
(3)前記第1カウント値が更新されたときに、前記第1カウンタから出力される前記第1カウント値に基づいて第1情報が設定され、前記エンコーダから出力される第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報が設定され、
設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力する
第2カウンタと、
を備える位置計測装置。
(1) an encoder that has a slit and a detector, and outputs a first signal, a second signal, a third signal, and a fourth signal according to the position of the slit with respect to the detector;
(2) a first counter that increments or decrements and outputs a first count value based on the first signal and the third signal;
(3) When the first count value is updated, first information is set based on the first count value output from the first counter, and the first signal output from the encoder, second Second information corresponding to the positional relationship between the slit and the detector is set based on the signal, the third signal, and the fourth signal,
A second counter that increments or decrements and outputs a second count value composed of the set first information and the second information based on the second signal and the fourth signal;
A position measuring device comprising:

このような位置計測装置によれば、正しいカウント値を出力できる。   According to such a position measuring apparatus, a correct count value can be output.

また、前記第1信号、前記第2信号、前記第3信号、前記第4信号の順に、位相がずれていることが望ましい。これにより、第1カウンタのカウント値を正しい値に保つことができる。   In addition, it is desirable that the phases are shifted in order of the first signal, the second signal, the third signal, and the fourth signal. Thereby, the count value of the first counter can be kept at a correct value.

また、前記第1情報に基づいて、前記第2カウント値の上位の桁の値が決定され、前記第2情報に基づいて、前記第2カウント値の下位の桁の値が決定されることが望ましい。これにより、第2カウント値の整合性を保つことができる。前記第2情報に基づいて、前記第2カウント値の最下位ビットが決定されることが望ましい。これにより、制御対象が双方向のいずれの方向に相対位置変化しても、第2カウント値の整合性を保つことができる。   Further, the value of the upper digit of the second count value is determined based on the first information, and the value of the lower digit of the second count value is determined based on the second information. desirable. Thereby, the consistency of the second count value can be maintained. Preferably, the least significant bit of the second count value is determined based on the second information. As a result, the consistency of the second count value can be maintained even if the relative position of the controlled object changes in either direction.

また、前記第1カウンタの前記第1カウント値は、任意の値に設定可能であることが望ましい。また、前記スリットと前記検出器との相対的な位置が変化していないときに、前記第1カウンタの前記第1カウント値が任意の値に設定されることが好ましい。これにより、制御対象が停止中であっても、第2カウント値を設定できる。   Further, it is desirable that the first count value of the first counter can be set to an arbitrary value. Moreover, it is preferable that the first count value of the first counter is set to an arbitrary value when the relative position between the slit and the detector is not changed. Thereby, even if the controlled object is stopped, the second count value can be set.

また、前記エンコーダは、ロータリー式であることが望ましい。これにより、回転運動を行う制御対象の位置変化量を正確に検出できる。また、前記エンコーダは、リニア式であることが望ましい。これにより、直線運動を行う制御対象の位置変化量を正確に検出できる。   The encoder is preferably a rotary type. Accordingly, it is possible to accurately detect the position change amount of the control object that performs the rotational motion. The encoder is preferably a linear type. This makes it possible to accurately detect the amount of change in position of the control target that performs linear motion.

(1)スリットと検出器とを用いて、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するステップと、
(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力するステップと、
(3)前記第1カウント値が更新されたときに、前記第1カウント値に基づいて第1情報を設定し、前記第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報を設定し
設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力するステップと、
を有する位置計測方法。
(1) Using the slit and the detector, outputting each of the first signal, the second signal, the third signal, and the fourth signal according to the position of the slit with respect to the detector;
(2) a step of incrementing or decrementing a first count value based on the first signal and the third signal and outputting the first count value;
(3) When the first count value is updated, first information is set based on the first count value, and based on the first signal, the second signal, the third signal, and the fourth signal, Based on the second signal and the fourth signal, the second information is set according to the positional relationship between the slit and the detector, and the set second count value including the first information and the second information is set. Incrementing or decrementing and outputting;
A position measurement method.

このような位置計測装置によれば、正しいカウント値を出力できる。   According to such a position measuring apparatus, a correct count value can be output.

===印刷システムの構成===
まず、位置計測装置であるエンコーダの説明を行なう前に、エンコーダを備えるプリンタとコンピュータとを有する印刷システムについて、図面を参照しながら説明する。なお、以下の実施形態の記載には、コンピュータプログラム、及び、コンピュータプログラムを記録した記録媒体等に関する実施形態も含まれている。
=== Configuration of Printing System ===
First, before describing an encoder that is a position measuring device, a printing system including a printer including a encoder and a computer will be described with reference to the drawings. Note that the description of the following embodiments includes embodiments relating to a computer program and a recording medium on which the computer program is recorded.

図1は、印刷システムの外観構成を示した説明図である。この印刷システム100は、プリンタ1と、コンピュータ110と、表示装置120と、入力装置130と、記録再生装置140とを備えている。プリンタ1は、紙、布、フィルム等の媒体に画像を印刷する印刷装置である。コンピュータ110は、プリンタ1と通信可能に接続されており、プリンタ1に画像を印刷させるため、印刷させる画像に応じた印刷データをプリンタ1に出力する。   FIG. 1 is an explanatory diagram showing an external configuration of a printing system. The printing system 100 includes a printer 1, a computer 110, a display device 120, an input device 130, and a recording / reproducing device 140. The printer 1 is a printing apparatus that prints an image on a medium such as paper, cloth, or film. The computer 110 is communicably connected to the printer 1 and outputs print data corresponding to the image to be printed to the printer 1 in order to cause the printer 1 to print an image.

コンピュータ110にはプリンタドライバがインストールされている。プリンタドライバは、表示装置120にユーザインタフェースを表示させ、アプリケーションプログラムから出力された画像データを印刷データに変換させるためのプログラムである。このプリンタドライバは、フレキシブルディスクFDやCD−ROMなどの記録媒体(コンピュータ読み取り可能な記録媒体)に記録されている。または、このプリンタドライバは、インターネットを介してコンピュータ110にダウンロードすることも可能である。なお、このプログラムは、各種の機能を実現するためのコードから構成されている。   A printer driver is installed in the computer 110. The printer driver is a program for causing the display device 120 to display a user interface and converting image data output from the application program into print data. This printer driver is recorded on a recording medium (computer-readable recording medium) such as a flexible disk FD or a CD-ROM. Alternatively, the printer driver can be downloaded to the computer 110 via the Internet. In addition, this program is comprised from the code | cord | chord for implement | achieving various functions.

なお、「印刷装置」とは、媒体に画像を印刷する装置を意味し、例えばプリンタ1が該当する。また、「印刷制御装置」とは、印刷装置を制御する装置を意味し、例えば、プリンタドライバをインストールしたコンピュータが該当する。また、「印刷システム」とは、少なくとも印刷装置及び印刷制御装置を含むシステムを意味する。   The “printing apparatus” means an apparatus that prints an image on a medium, and corresponds to the printer 1, for example. The “printing control device” means a device that controls the printing device, for example, a computer in which a printer driver is installed. The “printing system” means a system including at least a printing apparatus and a printing control apparatus.

===プリンタの構成===
<インクジェットプリンタの構成について>
図2は、プリンタ1の全体構成のブロック図である。また、図3Aは、プリンタ1の全体構成の概略図である。また、図3Bは、プリンタ1の全体構成の横断面図である。以下、本実施形態のプリンタの基本的な構成について説明する。
=== Configuration of Printer ===
<Inkjet printer configuration>
FIG. 2 is a block diagram of the overall configuration of the printer 1. FIG. 3A is a schematic diagram of the overall configuration of the printer 1. FIG. 3B is a cross-sectional view of the overall configuration of the printer 1. Hereinafter, the basic configuration of the printer of this embodiment will be described.

本実施形態のプリンタ1は、搬送ユニット20、キャリッジユニット30、ヘッドユニット40、検出器群50、及びコントローラ60を有する。外部装置であるコンピュータ110から印刷データを受信したプリンタ1は、コントローラ60によって各ユニット(搬送ユニット20、キャリッジユニット30、ヘッドユニット40)を制御する。コントローラ60は、コンピュータ110から受信した印刷データに基づいて、各ユニットを制御し、紙に画像を印刷する。プリンタ1内の状況は検出器群50によって監視されており、検出器群50は、検出結果をコントローラ60に出力する。コントローラ60は、検出器群50から出力された検出結果に基づいて、各ユニットを制御する。   The printer 1 of this embodiment includes a transport unit 20, a carriage unit 30, a head unit 40, a detector group 50, and a controller 60. The printer 1 that has received print data from the computer 110, which is an external device, controls each unit (the conveyance unit 20, the carriage unit 30, and the head unit 40) by the controller 60. The controller 60 controls each unit based on the print data received from the computer 110 and prints an image on paper. The situation in the printer 1 is monitored by a detector group 50, and the detector group 50 outputs a detection result to the controller 60. The controller 60 controls each unit based on the detection result output from the detector group 50.

搬送ユニット20は、媒体(例えば、紙Sなど)を所定の方向(以下、搬送方向という)に搬送させるためのものである。この搬送ユニット20は、給紙ローラ21と、搬送モータ22(PFモータとも言う)と、搬送ローラ23と、プラテン24と、排紙ローラ25とを有する。給紙ローラ21は、紙挿入口に挿入された紙をプリンタ内に給紙するためのローラである。搬送ローラ23は、給紙ローラ21によって給紙された紙Sを印刷可能な領域まで搬送するローラであり、搬送モータ22によって駆動される。プラテン24は、印刷中の紙Sを支持する。排紙ローラ25は、紙Sをプリンタの外部に排出するローラであり、印刷可能な領域に対して搬送方向下流側に設けられている。   The transport unit 20 is for transporting a medium (for example, paper S) in a predetermined direction (hereinafter referred to as a transport direction). The transport unit 20 includes a paper feed roller 21, a transport motor 22 (also referred to as a PF motor), a transport roller 23, a platen 24, and a paper discharge roller 25. The paper feed roller 21 is a roller for feeding the paper inserted into the paper insertion slot into the printer. The transport roller 23 is a roller that transports the paper S fed by the paper feed roller 21 to a printable area, and is driven by the transport motor 22. The platen 24 supports the paper S being printed. The paper discharge roller 25 is a roller for discharging the paper S to the outside of the printer, and is provided on the downstream side in the transport direction with respect to the printable area.

キャリッジユニット30は、ヘッドを所定の方向(以下、移動方向という)に移動(「走査」とも呼ばれる)させるためのものである。キャリッジユニット30は、キャリッジ31と、キャリッジモータ32(CRモータとも言う)とを有する。キャリッジ31は、移動方向に往復移動可能であり、キャリッジモータ32によって駆動される。また、キャリッジ31は、インクを収容するインクカートリッジを着脱可能に保持している。   The carriage unit 30 is for moving (also referred to as “scanning”) the head in a predetermined direction (hereinafter referred to as a moving direction). The carriage unit 30 includes a carriage 31 and a carriage motor 32 (also referred to as a CR motor). The carriage 31 can reciprocate in the moving direction and is driven by a carriage motor 32. Further, the carriage 31 detachably holds an ink cartridge that stores ink.

ヘッドユニット40は、紙にインクを吐出するためのものである。ヘッドユニット40は、複数のノズルを有するヘッド41を備える。このヘッド41はキャリッジ31に設けられているため、キャリッジ31が移動方向に移動すると、ヘッド41も移動方向に移動する。そして、ヘッド41が移動方向に移動中にインクを断続的に吐出することによって、移動方向に沿ったドットライン(ラスタライン)が紙に形成される。   The head unit 40 is for ejecting ink onto paper. The head unit 40 includes a head 41 having a plurality of nozzles. Since the head 41 is provided on the carriage 31, when the carriage 31 moves in the movement direction, the head 41 also moves in the movement direction. Then, by intermittently ejecting ink while the head 41 is moving in the moving direction, dot lines (raster lines) along the moving direction are formed on the paper.

検出器群50には、リニアエンコーダ51、ロータリーエンコーダ52、紙検出センサ53、および光学センサ54等が含まれる。リニアエンコーダ51は、キャリッジ31の移動方向の位置を検出する。ロータリーエンコーダ52は、搬送ローラ23の回転量を検出する。紙検出センサ53は、給紙中の紙の先端の位置を検出する。光学センサ54は、キャリッジ31に取付けられている発光部と受光部により、紙の有無を検出する。そして、光学センサ54は、キャリッジ31によって移動しながら紙の端部の位置を検出し、紙の幅を検出することができる。また、光学センサ54は、状況に応じて、紙の先端(搬送方向下流側の端部であり、上端ともいう)・後端(搬送方向上流側の端部であり、下端ともいう)も検出できる。   The detector group 50 includes a linear encoder 51, a rotary encoder 52, a paper detection sensor 53, an optical sensor 54, and the like. The linear encoder 51 detects the position of the carriage 31 in the moving direction. The rotary encoder 52 detects the amount of rotation of the transport roller 23. The paper detection sensor 53 detects the position of the leading edge of the paper being fed. The optical sensor 54 detects the presence or absence of paper by a light emitting unit and a light receiving unit attached to the carriage 31. The optical sensor 54 can detect the position of the edge of the paper while being moved by the carriage 31 to detect the width of the paper. The optical sensor 54 also detects the leading end (the end on the downstream side in the transport direction, also referred to as the upper end) and the rear end (the end on the upstream side in the transport direction, also referred to as the lower end) depending on the situation. it can.

コントローラ60は、プリンタの制御を行うための制御ユニット(制御部)である。コントローラ60は、インターフェース部61と、CPU62と、メモリ63と、ユニット制御回路64とを有する。インターフェース部61は、外部装置であるコンピュータ110とプリンタ1との間でデータの送受信を行う。CPU62は、プリンタ全体の制御を行うための演算処理装置である。メモリ63は、CPU62のプログラムを格納する領域や作業領域等を確保するためのものであり、RAM、EEPROM等の記憶素子を有する。CPU62は、メモリ63に格納されているプログラムに従って、ユニット制御回路64を介して各ユニットを制御する。例えば、CPU62は、目標搬送量をユニット制御回路64へ指令し、この指令に基づいてユニット制御回路64は搬送ユニット20の搬送モータ22を駆動する。   The controller 60 is a control unit (control unit) for controlling the printer. The controller 60 includes an interface unit 61, a CPU 62, a memory 63, and a unit control circuit 64. The interface unit 61 transmits and receives data between the computer 110 which is an external device and the printer 1. The CPU 62 is an arithmetic processing unit for controlling the entire printer. The memory 63 is for securing an area for storing a program of the CPU 62, a work area, and the like, and includes storage elements such as a RAM and an EEPROM. The CPU 62 controls each unit via the unit control circuit 64 in accordance with a program stored in the memory 63. For example, the CPU 62 commands the target transport amount to the unit control circuit 64, and the unit control circuit 64 drives the transport motor 22 of the transport unit 20 based on this command.

印刷を行うとき、プリンタ1は、移動方向に沿って移動するヘッドからインクを断続的に吐出させ、紙上にドットを形成するドット形成処理と、紙を搬送方向に搬送する搬送処理と、を交互に繰り返す。   When performing printing, the printer 1 alternately discharges ink from a head that moves in the movement direction to form dots on the paper and a conveyance process that conveys the paper in the conveyance direction. Repeat.

<搬送ユニットの構成について>
図4は、搬送ユニット20の構成の説明図である。
<Conveyor unit configuration>
FIG. 4 is an explanatory diagram of the configuration of the transport unit 20.

搬送ユニット20は、コントローラ60からの搬送指令に基づいて、所定の駆動量にて搬送モータ22を駆動させる。搬送モータ22は、指令された駆動量に応じて回転方向の駆動力を発生する。搬送モータ22は、この駆動力を用いて搬送ローラ23を回転させる。つまり、搬送モータ22が所定の駆動量を発生すると、搬送ローラ23は所定の回転量にて回転する。搬送ローラ23が所定の回転量にて回転すると、紙は所定の搬送量にて搬送される。   The transport unit 20 drives the transport motor 22 by a predetermined drive amount based on a transport command from the controller 60. The conveyance motor 22 generates a driving force in the rotation direction according to the commanded driving amount. The transport motor 22 rotates the transport roller 23 using this driving force. That is, when the transport motor 22 generates a predetermined drive amount, the transport roller 23 rotates by a predetermined rotation amount. When the transport roller 23 rotates with a predetermined rotation amount, the paper is transported with a predetermined transport amount.

紙の搬送量は、搬送ローラ23の回転量に応じて定まる。本実施形態では、搬送ローラ23が1回転すると、紙が1インチ搬送されるものとする。このため、搬送ローラ23が1/4回転すると、紙は1/4インチ搬送されることになる。   The carry amount of the paper is determined according to the rotation amount of the carry roller 23. In the present embodiment, it is assumed that when the transport roller 23 rotates once, the paper is transported for 1 inch. For this reason, when the transport roller 23 rotates 1/4, the paper is transported by 1/4 inch.

したがって、搬送ローラ23の回転量が検出できれば、紙の搬送量も検出可能である。そこで、搬送ローラ23の回転量を検出するため、ロータリーエンコーダ52が設けられている。   Therefore, if the rotation amount of the conveyance roller 23 can be detected, the conveyance amount of the paper can also be detected. Therefore, a rotary encoder 52 is provided to detect the rotation amount of the transport roller 23.

===ロータリーエンコーダ===
<2相ロータリーエンコーダと位置計測について(参考例)>
図5は、2相ロータリーエンコーダの構成の説明図である。ロータリーエンコーダ52は、スケール521と検出部522とを有する。
=== Rotary encoder ===
<About 2-phase rotary encoder and position measurement (reference example)>
FIG. 5 is an explanatory diagram of the configuration of the two-phase rotary encoder. The rotary encoder 52 includes a scale 521 and a detection unit 522.

スケール521は、所定の間隔毎に設けられた多数のスリットを有する。このスケール521は、搬送ローラ23に設けられている。つまり、スケール521は、搬送ローラ23が回転すると、一緒に回転する。そして、搬送ローラ23が回転すると、スケール521の各スリットが検出部522を順次通過する。   The scale 521 has a large number of slits provided at predetermined intervals. The scale 521 is provided on the transport roller 23. That is, the scale 521 rotates together when the transport roller 23 rotates. When the transport roller 23 rotates, the slits of the scale 521 sequentially pass through the detection unit 522.

検出部522は、スケール521と対向して設けられており、プリンタ本体側に固定されている。検出部522は、発光ダイオード522Aと、コリメータレンズ522Bと、検出処理部522Cとを有しており、検出処理部522Cは、複数(例えば、4個)のフォトダイオード522Dと、信号処理回路522Eと、2個のコンパレータ522Fa、522Fbとを備えている。   The detection unit 522 is provided to face the scale 521 and is fixed to the printer main body side. The detection unit 522 includes a light emitting diode 522A, a collimator lens 522B, and a detection processing unit 522C. The detection processing unit 522C includes a plurality of (for example, four) photodiodes 522D and a signal processing circuit 522E. Two comparators 522Fa and 522Fb are provided.

発光ダイオード522Aは、両端の抵抗を介して電圧Vccが印加されると光を発し、この光はコリメータレンズに入射される。コリメータレンズ522Bは、発光ダイオード522Aから発せられた光を平行光とし、スケール521に平行光を照射する。スケールに設けられたスリットを通過した平行光は、固定スリット(不図示)を通過して、各フォトダイオード522Dに入射する。フォトダイオード522Dは、入射した光を電気信号に変換する。各フォトダイオードから出力される電気信号は、コンパレータ522Fa、522Fbにおいて比較され、比較結果がパルスとして出力される。そして、コンパレータ522Faから出力されるA相信号(パルスENC−A)、及びコンパレータ522Fbから出力される及びB相信号(パルスENC−B)が、ロータリーエンコーダ52の出力となる。   The light emitting diode 522A emits light when a voltage Vcc is applied through resistances at both ends, and this light enters the collimator lens. The collimator lens 522B converts the light emitted from the light emitting diode 522A into parallel light, and irradiates the scale 521 with the parallel light. The parallel light that has passed through the slit provided in the scale passes through a fixed slit (not shown) and enters each photodiode 522D. The photodiode 522D converts incident light into an electrical signal. The electric signals output from the photodiodes are compared in the comparators 522Fa and 522Fb, and the comparison result is output as a pulse. The A-phase signal (pulse ENC-A) output from the comparator 522Fa and the B-phase signal (pulse ENC-B) output from the comparator 522Fb are output from the rotary encoder 52.

図6Aは、搬送モータ22が正転しているときの出力信号の波形のタイミングチャートである。図6Bは、搬送モータ22が反転しているときの出力信号の波形のタイミングチャートである。   FIG. 6A is a timing chart of the waveform of the output signal when the transport motor 22 is rotating forward. FIG. 6B is a timing chart of the waveform of the output signal when the conveyance motor 22 is reversed.

A相信号及びB相信号は、搬送モータ22の回転に応じて、L(ロー)レベル又はH(ハイ)レベルの信号に切り替わる。搬送モータ22の正転時及び反転時のいずれの場合であっても、A相信号がLレベルからHレベルに変化してから、次にA相信号がLレベルからHレベルに変化するまでの間に、スリット1つ分だけ搬送ローラ23が回転する。ここでは、A相信号がLレベルからHレベルに変化してから、次にA相信号がLレベルからHレベルに変化するまでの間に、搬送ローラ23が1/180回転し、紙が1/180インチ搬送されることになる。また、搬送モータ22の正転時及び反転時のいずれの場合であっても、A相信号がHレベルからLレベルに変化してから、次にA相信号がHレベルからLレベルに変化するまでの間に、スリット1つ分だけ搬送ローラ23が回転する。B相信号もA相信号と同様である。   The A phase signal and the B phase signal are switched to an L (low) level signal or an H (high) level signal according to the rotation of the transport motor 22. In either case of forward rotation or reverse rotation of the conveyance motor 22, after the A-phase signal changes from the L level to the H level, until the next A-phase signal changes from the L level to the H level. In the meantime, the transport roller 23 rotates by one slit. Here, after the A-phase signal changes from the L level to the H level and until the next A-phase signal changes from the L level to the H level, the transport roller 23 rotates 1/180 and the paper is 1 / 180 inches are conveyed. Further, regardless of whether the conveyance motor 22 is rotating forward or reverse, the A phase signal changes from H level to L level and then the A phase signal changes from H level to L level. In the meantime, the transport roller 23 rotates by one slit. The B phase signal is the same as the A phase signal.

図に示された通り、搬送モータ22の正転時及び反転時のいずれの場合であっても、A相信号とB相信号は、位相がほぼ90度ずれている。搬送モータ22が正転しているとき、すなわち、紙Sが搬送方向に搬送されているときは、A相信号は、B相信号よりもほぼ90度だけ位相が進んでいる。一方、搬送モータ22が反転しているとき、すなわち、紙Sが搬送方向とは逆方向に搬送されているときは、A相信号は、B相信号よりもほぼ90度だけ位相が遅れている。   As shown in the figure, the phase of the A-phase signal and the B-phase signal are shifted by approximately 90 degrees regardless of whether the conveyance motor 22 is rotating forward or reversing. When the transport motor 22 is rotating forward, that is, when the paper S is transported in the transport direction, the phase of the A phase signal is advanced by approximately 90 degrees relative to the B phase signal. On the other hand, when the transport motor 22 is reversed, that is, when the paper S is transported in the direction opposite to the transport direction, the phase of the A phase signal is delayed by approximately 90 degrees from the B phase signal. .

なお、同じ信号の同じ変化点間(例えばA相信号がLレベルからHレベルに変化してから、次にA相信号がLレベルからHレベルに変化するまでの間)では、スリット1つ分だけ搬送ローラ23が回転していることが保障されている。しかし、異なる信号の変化点間(例えばA相信号がLレベルからHレベルに変化してから、次にB相信号がLレベルからHレベルに変化するまでの間)では、搬送ローラ23の回転量は厳密には保障されていない。つまり、A相信号とB相信号の位相のずれは、正確な90度に保障されているわけではない(若干の誤差があるかも知れない)。   Note that between the same change points of the same signal (for example, after the A-phase signal changes from the L level to the H level and then the A-phase signal changes from the L level to the H level), it corresponds to one slit. It is guaranteed that the conveying roller 23 is rotating only. However, between the change points of different signals (for example, from the time when the A-phase signal changes from L level to H level to the time when the B-phase signal changes from L level to H level), the rotation of the transport roller 23 The quantity is not strictly guaranteed. That is, the phase shift between the A-phase signal and the B-phase signal is not guaranteed to be accurate 90 degrees (there may be some error).

A相信号及びB相信号に基づいて、搬送ローラ23が正転しているのか、反転しているのかが判別可能である。   Based on the A-phase signal and the B-phase signal, it can be determined whether the transport roller 23 is rotating forward or reverse.

図7は、正転及び反転の判別の説明図である。判別の基準時は、A相信号又はB相信号が変化したときである。   FIG. 7 is an explanatory diagram of forward rotation and inversion discrimination. The reference time is when the A phase signal or the B phase signal changes.

例えば、(1)A相信号がL(ロー)レベルからH(ハイ)レベルに変化したときに、B相信号がLレベルの場合、(2)B相信号がLレベルからHレベルに変化したときに、A相信号がHレベルの場合、(3)A相信号がHレベルからLレベルに変化したときに、B相信号がHレベルの場合、(4)B相信号がHレベルからLレベルに変化したときに、A相信号がLレベルの場合、いずれの場合も搬送ローラ23が正転していると判別される。   For example, (1) when the A phase signal changes from L (low) level to H (high) level and the B phase signal is L level, (2) the B phase signal changes from L level to H level When the A phase signal is at the H level, (3) When the A phase signal changes from the H level to the L level, and when the B phase signal is at the H level, (4) the B phase signal is changed from the H level to the L level. If the A-phase signal is at the L level when the level is changed, it is determined that the transport roller 23 is rotating forward in any case.

また、例えば、(5)B相信号がLレベルからHレベルに変化したときに、A相信号がLレベルの場合、(6)A相信号がLレベルからHレベルに変化したときに、B相信号がHレベルの場合、(7)B相信号がHレベルからLレベルに変化したときに、A相信号がHレベルの場合、(8)A相信号がHレベルからLレベルに変化したときに、B相信号がLレベルの場合、いずれの場合も搬送ローラ23が反転していると判別される。   Also, for example, (5) when the B phase signal changes from L level to H level, and when the A phase signal is L level, (6) when the A phase signal changes from L level to H level, When the phase signal is H level, (7) When the B phase signal changes from H level to L level, when the A phase signal is H level, (8) The A phase signal changes from H level to L level When the B phase signal is at the L level, it is determined that the transport roller 23 is reversed in any case.

そこで、A相信号又はB相信号が変化したときに、上記(1)〜(4)に対応する場合にはカウンタのカウント値をインクリメントし、上記(5)〜(8)に対応する場合にはカウンタのカウント値をデクリメントすれば、コントローラ60は、カウント値に基づいて、搬送ローラ23の回転位置を検出できる。   Therefore, when the A-phase signal or the B-phase signal changes, the count value of the counter is incremented when corresponding to the above (1) to (4), and when corresponding to the above (5) to (8). If the counter value is decremented, the controller 60 can detect the rotational position of the transport roller 23 based on the count value.

図8は、カウント値の説明図である。   FIG. 8 is an explanatory diagram of the count value.

カウント値が0の状態においてA相信号がLレベルからHレベルに変化したとき、B相信号はLレベルなので上記(1)の通り正転していると判別され、カウント値が0から1にインクリメントされる。次に、カウント値が1の状態においてB相信号がLレベルからHレベルに変化したとき、A相信号はHレベルなので上記(2)の通り正転していると判別され、カウント値が1から2にインクリメントされる。このように、上記(1)〜(4)に対応する場合にはカウント値がインクリメントされて、図中ではカウント値が5までインクリメントされている。   When the A phase signal changes from the L level to the H level in the state where the count value is 0, the B phase signal is at the L level, so that it is determined as normal rotation as in (1) above, and the count value is changed from 0 to 1 Incremented. Next, when the B phase signal changes from the L level to the H level in the state where the count value is 1, since the A phase signal is at the H level, it is determined that the rotation is normal as in (2) above, and the count value is 1. Is incremented from 2. Thus, the count value is incremented in cases corresponding to the above (1) to (4), and the count value is incremented to 5 in the figure.

また、カウント値が5の状態においてA相信号がHレベルからLレベルに変化したとき、B相信号はLレベルなので上記(8)の通り反転していると判別され、カウント値が5から4にデクリメントされる。次に、カウント値が4の状態においてB相信号がLレベルからHレベルに変化したとき、A相信号はLレベルなので上記(5)の通り反転していると判別され、カウント値が4から3にデクリメントされる。このように、上記(5)〜(8)に対応する場合にはカウント値がデクリメントされて、図中ではカウント値が2までデクリメントされている。   Further, when the A-phase signal changes from the H level to the L level in the state where the count value is 5, since the B-phase signal is at the L level, it is determined that the signal is inverted as described in (8) above. Will be decremented. Next, when the B-phase signal changes from the L level to the H level in the state where the count value is 4, since the A-phase signal is at the L level, it is determined that the signal is inverted as described in (5) above. Decremented to 3. Thus, the count value is decremented when it corresponds to the above (5) to (8), and the count value is decremented to 2 in the figure.

このように、A相信号又はB相信号が変化したときに、上記(1)〜(4)に対応する場合にはカウンタのカウント値をインクリメントし、上記(5)〜(8)に対応する場合にはカウンタのカウント値をデクリメントすれば、カウンタのカウント値は搬送ローラ23の回転位置を示す値になる。   As described above, when the A-phase signal or the B-phase signal is changed, the count value of the counter is incremented in the case of corresponding to the above (1) to (4), and corresponding to the above (5) to (8). In this case, if the count value of the counter is decremented, the count value of the counter becomes a value indicating the rotational position of the transport roller 23.

<4相ロータリーエンコーダについて>
図9は、4相ロータリーエンコーダの構成の説明図である。前述の2相ロータリーエンコーダと同様に、4相ロータリーエンコーダはスケール521と検出部522を有する。ここでは検出部522の構成の説明は省略するが、検出部522からはA相信号、B相信号、C相信号及びD相信号が出力される。
<About the 4-phase rotary encoder>
FIG. 9 is an explanatory diagram of a configuration of a four-phase rotary encoder. Similar to the above-described two-phase rotary encoder, the four-phase rotary encoder includes a scale 521 and a detection unit 522. Although the description of the configuration of the detection unit 522 is omitted here, the detection unit 522 outputs an A-phase signal, a B-phase signal, a C-phase signal, and a D-phase signal.

図10は、正転時のA相信号〜D相信号と、カウンタのカウント値のタイミングチャートである。正転時において、A相信号はB相信号よりも45度だけ位相が進んでおり、B相信号はC相信号よりも45度だけ位相が進んでおり、C相信号はD相信号よりも45度だけ位相が進んでおり、D相信号はA相信号よりも45度だけ位相が進んでいる。このようなA相信号〜D相信号を4相ロータリーエンコーダは出力する。   FIG. 10 is a timing chart of the A-phase signal to D-phase signal and the count value of the counter during normal rotation. During forward rotation, the phase of the A phase signal is 45 degrees ahead of the phase B signal, the phase of the B phase signal is 45 degrees ahead of the phase C signal, and the phase C signal is ahead of the phase D signal. The phase is advanced by 45 degrees, and the phase of the D phase signal is advanced by 45 degrees relative to the phase A signal. The 4-phase rotary encoder outputs such A-phase signal to D-phase signal.

<4相ロータリーエンコーダによる参考例の位置計測について>
参考例では、カウンタは、2相の場合とほぼ同様な方法により、A相信号〜D相信号のいずれかの信号が変化するタイミングで単にカウント値をインクリメントする。すなわち、(1)A相信号がLレベルからHレベルに変化したときに、B相信号(又はC相信号やD相信号)がLレベルの場合、(2)B相信号がLレベルからHレベルに変化したときに、A相信号がHレベル(又はC相信号やD相信号がLレベル)の場合、(3)C相信号がLレベルからHレベルに変化したときに、D相信号がLレベル(又はA相信号やB相信号がHレベル)の場合、(4)D相信号がLレベルからHレベルに変化したときに、C相信号(又はA相信号やB相信号)がHレベルの場合、(5)A相信号がHレベルからLレベルに変化したときに、B相信号(又はC相信号やD相信号)がHレベルの場合、(6)B相信号がHレベルからLレベルに変化したときに、A相信号がLレベル(又はC相信号やD相信号がHレベル)の場合、(7)C相信号がHレベルからLレベルに変化したときに、D相信号がHレベル(又はA相信号やB相信号がLレベル)の場合、(8)D相信号がLレベルからHレベルに変化したときに、C相信号(又はA相信号やB相信号)がLレベルの場合、いずれかの場合にカウンタはカウント値をインクリメントする。
<Regarding the position measurement of a reference example using a 4-phase rotary encoder>
In the reference example, the counter simply increments the count value at the timing when any one of the A-phase signal to the D-phase signal is changed by the same method as in the case of two phases. That is, (1) when the B phase signal (or C phase signal or D phase signal) is at L level when the A phase signal changes from L level to H level, (2) the B phase signal is changed from L level to H level. If the A phase signal is at the H level (or the C phase signal or the D phase signal is at the L level) when the level is changed, (3) the D phase signal is changed when the C phase signal is changed from the L level to the H level. Is L level (or A phase signal or B phase signal is H level), (4) C phase signal (or A phase signal or B phase signal) when D phase signal changes from L level to H level (5) When the A phase signal changes from the H level to the L level and the B phase signal (or C phase signal or D phase signal) is at the H level, (6) The B phase signal is When the H level changes to the L level, the A phase signal is at the L level (or the C phase signal and the D phase signal are at the H level. In the case of (7) when the C phase signal changes from H level to L level and the D phase signal is H level (or the A phase signal or B phase signal is L level), (8) the D phase signal is When the C-phase signal (or the A-phase signal or the B-phase signal) is at the L level when changing from the L level to the H level, the counter increments the count value in either case.

なお、説明は省略するが、参考例のカウンタは、2相の場合とほぼ同様な方法により、A相信号〜D相信号のいずれかの信号が変化するタイミングで単にカウント値をデクリメントもする。
このようなカウンタのカウント値でも搬送ローラ23の回転位置を示す値になる。
Although explanation is omitted, the counter of the reference example simply decrements the count value at the timing when any one of the A-phase signal to the D-phase signal is changed by a method almost the same as in the case of two phases.
Even the count value of such a counter is a value indicating the rotational position of the transport roller 23.

<参考例の位置計測の問題点>
2相ロータリーエンコーダは、4相ロータリーエンコーダと比べて、分解能が低くなるという問題がある。一方、参考例のカウンタでは、以下の問題がある。
<Problems of position measurement in the reference example>
The two-phase rotary encoder has a problem that the resolution is lower than that of the four-phase rotary encoder. On the other hand, the counter of the reference example has the following problems.

各相信号が変化する部分(各相信号のLレベルからHレベルへの立ち上がり部分及びHレベルからLレベルへの立ち下がり部分、(以下、「エッジ」とも称する))は、搬送ローラ23の回転速度が速くなると、各相信号のエッジが近接する。そして、エッジが近接しすぎると、A相信号に対するB相信号の遅延や、回路の遅延などによって、カウント値を正しくインクリメント又はデクリメントできないことがある。例えば、搬送ローラ23の回転速度が速い場合、A相信号がLレベルからHレベルに変化した直後にB相信号がLレベルからHレベルに変化するため、B相信号の変化をカウンタが検出できなくなるおそれがある。さらに、カウント値のインクリメント又はデクリメントができない事態が重なると、検出誤差が累積してしまうという問題が生じる。   The portion where each phase signal changes (the rising portion of each phase signal from L level to H level and the falling portion from H level to L level (hereinafter also referred to as “edge”)) is the rotation of the transport roller 23. As the speed increases, the edges of each phase signal approach. If the edges are too close, the count value may not be correctly incremented or decremented due to the delay of the B phase signal relative to the A phase signal or the delay of the circuit. For example, when the rotation speed of the transport roller 23 is fast, the B phase signal changes from the L level to the H level immediately after the A phase signal changes from the L level to the H level, so that the counter can detect the change in the B phase signal. There is a risk of disappearing. Furthermore, when the situation in which the count value cannot be incremented or decremented overlaps, there arises a problem that detection errors accumulate.

===第1実施形態の位置計測===
<位置計測部の構成について>
図11は、第1実施形態の位置計測部70の構成の説明図である。この位置計測部70は、コントローラ60のユニット制御回路64(図2参照)に設けられている。この位置計測部70は、ロータリーエンコーダ52のA相信号〜D相信号に基づいて、搬送ローラ23の回転位置を示すカウント値を出力するものである。なお、位置計測部70の出力するカウント値はユニット制御回路64の搬送モータドライバ(不図示)に出力され、搬送モータドライバは位置計測部70のカウント値に応じて搬送モータ22を制御する。この位置計測部70は、第一回転方向判定回路71と、第二回転方向判定回路72と、スリット位置判定回路73と、32ビットカウンタ74と、33ビットカウンタ75とを有する。
=== Position Measurement in First Embodiment ===
<About the configuration of the position measurement unit>
FIG. 11 is an explanatory diagram of a configuration of the position measurement unit 70 of the first embodiment. The position measuring unit 70 is provided in the unit control circuit 64 (see FIG. 2) of the controller 60. The position measuring unit 70 outputs a count value indicating the rotational position of the transport roller 23 based on the A-phase signal to the D-phase signal of the rotary encoder 52. Note that the count value output by the position measuring unit 70 is output to a transport motor driver (not shown) of the unit control circuit 64, and the transport motor driver controls the transport motor 22 according to the count value of the position measuring unit 70. The position measurement unit 70 includes a first rotation direction determination circuit 71, a second rotation direction determination circuit 72, a slit position determination circuit 73, a 32-bit counter 74, and a 33-bit counter 75.

第一回転方向判定回路71は、ロータリーエンコーダ52のA相信号とC相信号とに基づいて、搬送ローラ23が正転しているのか、反転しているのかを判別し、正転していればパルス信号であるACU信号を出力し、反転していればパルス信号であるACD信号を出力する。なお、以下に説明する通り、第一回転方向判定回路71は、A相信号又はC相信号が変化するタイミングでACU信号又はACD信号を出力する。
図12は、第一回転方向判定回路71の判定結果と出力信号の説明図である。(1)A相信号がL(ロー)レベルからH(ハイ)レベルに変化したときに、C相信号がLレベルの場合、(2)C相信号がLレベルからHレベルに変化したときに、A相信号がHレベルの場合、(3)A相信号がHレベルからLレベルに変化したときに、C相信号がHレベルの場合、(4)C相信号がHレベルからLレベルに変化したときに、A相信号がLレベルの場合、いずれの場合も搬送ローラ23が正転していると判別される。このため、第一回転方向判定回路71は、このような場合にパルス信号であるACU信号を出力する。
また、(5)C相信号がLレベルからHレベルに変化したときに、A相信号がLレベルの場合、(6)A相信号がLレベルからHレベルに変化したときに、C相信号がHレベルの場合、(7)C相信号がHレベルからLレベルに変化したときに、A相信号がHレベルの場合、(8)A相信号がHレベルからLレベルに変化したときに、C相信号がLレベルの場合、いずれの場合も搬送ローラ23が反転していると判別される。このため、第一回転方向判定回路71は、このような場合にパルス信号であるACD信号を出力する。
Based on the A phase signal and the C phase signal of the rotary encoder 52, the first rotation direction determination circuit 71 determines whether the transport roller 23 is rotating forward or reversely, and is rotating forward. For example, an ACU signal that is a pulse signal is output, and if it is inverted, an ACD signal that is a pulse signal is output. As will be described below, the first rotation direction determination circuit 71 outputs an ACU signal or an ACD signal at the timing when the A phase signal or the C phase signal changes.
FIG. 12 is an explanatory diagram of determination results and output signals of the first rotation direction determination circuit 71. (1) When the A phase signal changes from L (low) level to H (high) level, when the C phase signal is L level, (2) When the C phase signal changes from L level to H level When the A phase signal is at the H level, (3) When the A phase signal changes from the H level to the L level, and when the C phase signal is at the H level, (4) the C phase signal is changed from the H level to the L level. When the change occurs, if the A-phase signal is at the L level, it is determined that the transport roller 23 is rotating in any case. Therefore, the first rotation direction determination circuit 71 outputs an ACU signal that is a pulse signal in such a case.
Further, (5) when the C phase signal changes from L level to H level, when the A phase signal is L level, (6) when the A phase signal changes from L level to H level, Is H level, (7) when the C phase signal is changed from H level to L level, and when the A phase signal is H level, (8) when the A phase signal is changed from H level to L level. When the C-phase signal is at the L level, it is determined that the transport roller 23 is reversed in any case. Therefore, the first rotation direction determination circuit 71 outputs an ACD signal that is a pulse signal in such a case.

第二回転方向判定回路72は、ロータリーエンコーダ52のB相信号とD相信号とに基づいて、搬送ローラ23が正転しているのか、反転しているのかを判別し、正転していればパルス信号であるBDU信号を出力し、反転していればパルス信号であるBDD信号を出力する。
図13は、第二回転方向判定回路72の判定結果と出力信号の説明図である。前述の第一回転方向判定回路とほぼ同様なので説明を省略するが、第二回転方向判定回路72は、このようにBDU信号とBDD信号を出力する。第二回転方向判定回路72は、B相信号又はD相信号が変化するタイミングでBDU信号又はBDD信号を出力する。
Based on the B-phase signal and D-phase signal of the rotary encoder 52, the second rotation direction determination circuit 72 determines whether the conveyance roller 23 is rotating forward or reversely, and is rotating forward. For example, a BDU signal that is a pulse signal is output, and if inverted, a BDD signal that is a pulse signal is output.
FIG. 13 is an explanatory diagram of the determination result of the second rotation direction determination circuit 72 and the output signal. The second rotation direction determination circuit 72 outputs the BDU signal and the BDD signal in this manner, though the description thereof is omitted because it is almost the same as the first rotation direction determination circuit described above. The second rotation direction determination circuit 72 outputs a BDU signal or a BDD signal at a timing when the B phase signal or the D phase signal changes.

スリット位置判定回路73は、ロータリーエンコーダ52のA相信号〜D相信号に基づいて、検出部522に対するスケール521のスリットの位置を判別し、OE信号を出力する。   The slit position determination circuit 73 determines the position of the slit of the scale 521 relative to the detection unit 522 based on the A-phase signal to the D-phase signal of the rotary encoder 52, and outputs an OE signal.

図14は、スリット位置判定回路73の判定結果とOE信号の説明図である。以下、図10も参照しながら説明を行なう。
あるスリットが検出部522に対して特定位置にあるときにA相信号〜D相信号が全てLレベルだとすると、隣のスリットが検出部522に対して特定位置になりA相信号〜D相信号が全てLレベルになるまでの間(スリット1つ分だけ搬送ローラ23が回転する間)に、A相信号〜D相信号は8通りに変化する。言い換えると、A相信号〜D相信号は、検出部522に対するスケール521のスリットの位置を8段階で示している。
FIG. 14 is an explanatory diagram of the determination result of the slit position determination circuit 73 and the OE signal. Hereinafter, description will be made with reference to FIG.
If the A phase signal to the D phase signal are all at the L level when a certain slit is at a specific position with respect to the detection unit 522, the adjacent slit becomes a specific position with respect to the detection unit 522, and the A phase signal to the D phase signal are The A-phase signal to the D-phase signal change in eight ways until they all become L level (while the transport roller 23 rotates by one slit). In other words, the A-phase signal to the D-phase signal indicate the position of the slit of the scale 521 with respect to the detection unit 522 in eight stages.

そして、図10のカウント値が理想的な値を示していると仮定するならば、A相信号とB相信号が同じレベルで且つC相信号とD相信号が同じレベルのとき、正転時・反転時に関わらず、カウント値は奇数であるべきである。逆に言えば、カウント値が奇数であるべきならば、正転時・反転時に関わらず、A相信号とB相信号が同じレベルで且つC相信号とD相信号が同じレベルのはずである。同様に、図10のカウント値が理想的な値を示していると仮定するならば、A相信号とB相信号が異なるレベル又はC相信号とD相信号が異なるレベルのとき、正転時・反転時に関わらず、カウント値は偶数であるべきである。逆に言えば、カウント値が偶数であるべきならば、正転時・反転時に関わらず、A相信号とB相信号が異なるレベル又はC相信号とD相信号が異なるレベルのはずである。   If it is assumed that the count value in FIG. 10 shows an ideal value, when the A phase signal and the B phase signal are at the same level and the C phase signal and the D phase signal are at the same level, • The count value should be odd regardless of the inversion. In other words, if the count value should be an odd number, the A phase signal and the B phase signal should be at the same level and the C phase signal and the D phase signal should be at the same level regardless of whether it is forward rotation or inversion. . Similarly, assuming that the count value in FIG. 10 shows an ideal value, when the A phase signal and the B phase signal are at different levels or when the C phase signal and the D phase signal are at different levels, during forward rotation • The count value should be even, regardless of the inversion. Conversely, if the count value should be an even number, the A-phase signal and the B-phase signal should be at different levels or the C-phase signal and the D-phase signal should be at different levels regardless of whether the count value is normal or inverted.

そこで、スリット位置判定回路73は、図14に示すように、8通りのA相信号〜D相信号の組み合わせに応じて、検出部522に対してスリットが偶数位置にあるか奇数位置にあるかを示すOE信号を出力する。例えば、A相信号〜D相信号のすべてがLレベルのときのように検出部522に対してスリットが奇数位置にある場合、スリット位置判定回路73はHレベルのOE信号を出力する。一方、A相信号だけHレベルでB相信号〜D相信号がLレベルのときのように検出部522に対してスリットが偶数位置にある場合、スリット位置判定回路73はLレベルのOE信号を出力する。なお、後述するが、OE信号がLレベルならば位置計測部70のカウント値(33ビットカウンタ75のカウンタ値)は偶数になり、OE信号がHレベルならば位置計測部70のカウント値は奇数になる。   Therefore, as shown in FIG. 14, the slit position determination circuit 73 determines whether the slit is in the even position or the odd position with respect to the detection unit 522 according to the combination of the eight A-phase signals to the D-phase signals. Is output. For example, when the slits are at odd positions with respect to the detection unit 522 as in the case where all of the A phase signal to the D phase signal are at the L level, the slit position determination circuit 73 outputs an OE signal at the H level. On the other hand, when the slit is in an even position with respect to the detection unit 522 as in the case where only the A phase signal is at the H level and the B phase signal to the D phase signal are at the L level, the slit position determination circuit 73 outputs the OE signal at the L level. Output. As will be described later, if the OE signal is at the L level, the count value of the position measurement unit 70 (count value of the 33-bit counter 75) is an even number, and if the OE signal is at the H level, the count value of the position measurement unit 70 is an odd number. become.

32ビットカウンタ74は、ACU信号が入力されたときにカウント値をインクリメントし、ACD信号が入力されたときにカウント値をデクリメントするカウンタである。これにより、32ビットカウンタ74のカウント値は、前述の2相ロータリーエンコーダのカウンタのカウント値と同様になる。   The 32-bit counter 74 is a counter that increments the count value when the ACU signal is input and decrements the count value when the ACD signal is input. As a result, the count value of the 32-bit counter 74 becomes the same as the count value of the counter of the above-described two-phase rotary encoder.

また、32ビットカウンタ74のカウント値は、CPU62により任意の値に書き換えることができる。この場合、CPU62は、CE信号及びアドレス信号によって32ビットカウンタ74を選択し、WR信号によって書き込みを指示しながらデータ信号を供給し、32ビットカウンタ74のカウント値を書き換える。   Further, the count value of the 32-bit counter 74 can be rewritten to an arbitrary value by the CPU 62. In this case, the CPU 62 selects the 32-bit counter 74 by the CE signal and the address signal, supplies a data signal while instructing writing by the WR signal, and rewrites the count value of the 32-bit counter 74.

そして、32ビットカウンタ74は、32ビットのカウント値を出力する。また、32ビットカウンタ74は、カウント値が更新されたとき、すなわちACU信号又はACD信号が入力されたときやCPU62からWR信号が入力されたとき、33ビットカウンタへWR信号を出力する。   The 32-bit counter 74 outputs a 32-bit count value. The 32-bit counter 74 outputs a WR signal to the 33-bit counter when the count value is updated, that is, when an ACU signal or an ACD signal is input or when a WR signal is input from the CPU 62.

33ビットカウンタ75は、33ビットのカウント値を出力するカウンタである。この33ビットカウンタ75には、32ビットカウンタ74から32ビットのカウント値とWR信号が入力され、第二回転方向判定回路72からBDU信号とBDD信号が入力され、スリット位置判定回路73からOE信号が入力される。そして、33ビットカウンタ75は、BDU信号が入力されたとき33ビットのカウント値をインクリメントし、BDD信号が入力されたとき33ビットのカウント値をデクリメントする。また、33ビットカウンタ75は、32ビットカウンタ74からWR信号が入力されたとき、32ビットのカウント値とOE信号とに基づいて33ビットのカウント値を更新する。   The 33-bit counter 75 is a counter that outputs a 33-bit count value. The 33-bit counter 75 receives a 32-bit count value and a WR signal from the 32-bit counter 74, receives a BDU signal and a BDD signal from the second rotation direction determination circuit 72, and receives an OE signal from the slit position determination circuit 73. Is entered. The 33-bit counter 75 increments the 33-bit count value when the BDU signal is input, and decrements the 33-bit count value when the BDD signal is input. When the WR signal is input from the 32-bit counter 74, the 33-bit counter 75 updates the 33-bit count value based on the 32-bit count value and the OE signal.

図15は、WR信号が入力されたときの33ビットのカウント値の更新の説明図である。図中の四角印は、カウント値を示すためのレジスタである。
33ビットカウンタ75にWR信号が入力されたとき、33ビットのカウンタ値の上位32ビットを示すレジスタに、32ビットカウンタ74からの32ビットのカウント値が設定される。言い換えると、WR信号が入力されたとき、32ビットカウンタ74の32ビットのカウント値が、1ビットだけ桁をシフトして、33ビットカウンタ75のレジスタに格納される。
FIG. 15 is an explanatory diagram of updating the 33-bit count value when the WR signal is input. The square marks in the figure are registers for indicating count values.
When the WR signal is input to the 33-bit counter 75, the 32-bit count value from the 32-bit counter 74 is set in the register indicating the upper 32 bits of the 33-bit counter value. In other words, when the WR signal is input, the 32-bit count value of the 32-bit counter 74 is shifted by 1 bit and stored in the register of the 33-bit counter 75.

また、33ビットカウンタ75にWR信号が入力されたとき、33ビットのカウンタ値の最下位ビットを示すレジスタに、OE信号に応じた値が設定される。OE信号がLレベルの場合、このレジスタに0が設定され、OE信号がHレベルの場合、このレジスタに1が設定される。   When the WR signal is input to the 33-bit counter 75, a value corresponding to the OE signal is set in the register indicating the least significant bit of the 33-bit counter value. When the OE signal is at L level, 0 is set in this register, and when the OE signal is at H level, 1 is set in this register.

つまり、OE信号がLレベルのときに33ビットカウンタ75にWR信号が入力すると、32ビットカウンタ74のカウント値の2倍の値が、33ビットカウンタ75のカウント値になる。また、OE信号がHレベルのときに33ビットカウンタ75にWR信号が入力すると、32ビットカウンタ74のカウント値の2倍の値に1を加算した値が、33ビットカウンタ75のカウント値になる。   That is, when the WR signal is input to the 33-bit counter 75 when the OE signal is at the L level, a value twice the count value of the 32-bit counter 74 becomes the count value of the 33-bit counter 75. If the WR signal is input to the 33-bit counter 75 when the OE signal is at the H level, a value obtained by adding 1 to a value twice the count value of the 32-bit counter 74 becomes the count value of the 33-bit counter 75. .

<位置計測部の動作1>
図16は、位置計測部の各信号のタイミングチャートである。以下、図11も参照しながら説明を行なう。なお、ここではCPU62が32ビットカウンタ74に初期値として0を設定したとき、A相信号〜D相信号はいずれもLレベルであるものとする。
<Operation 1 of the position measurement unit>
FIG. 16 is a timing chart of each signal of the position measurement unit. Hereinafter, description will be made with reference to FIG. Here, it is assumed that when the CPU 62 sets 0 as an initial value in the 32-bit counter 74, the A-phase signal to the D-phase signal are all at the L level.

まず、CPU62が32ビットカウンタのカウント値に0を書き込むと、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力される。これにより、33ビットカウンタのカウント値の上位32ビットは全て0に設定される。一方、このときのA相信号〜D相信号はいずれもLレベルなので、スリット位置判定回路73から33ビットカウンタへHレベルのOE信号が出力される。これにより、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力されたとき、すなわち33ビットカウンタのカウント値の上位32ビットが設定されたとき、33ビットカウンタ75のカウント値の最下位ビットが1に設定される。この結果、33ビットカウンタ75のカウント値は1になる。   First, when the CPU 62 writes 0 to the count value of the 32-bit counter, a WR signal is output from the 32-bit counter 74 to the 33-bit counter 75. As a result, the upper 32 bits of the count value of the 33-bit counter are all set to 0. On the other hand, since the A-phase signal to the D-phase signal at this time are all at the L level, an H level OE signal is output from the slit position determination circuit 73 to the 33-bit counter. Thus, when the WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, that is, when the upper 32 bits of the count value of the 33-bit counter are set, the least significant bit of the count value of the 33-bit counter 75 is changed. Set to 1. As a result, the count value of the 33-bit counter 75 becomes 1.

なお、CPU62が32ビットカウンタのカウント値に0を書き込んだとき、搬送ローラ23が停止中であっても、搬送ローラ23が正転中又は反転中であっても、速やかに33ビットカウンタ75のカウント値が1に設定される。すなわち、CPU62が32ビットカウンタのカウント値に0を書き込んだ後、A相信号〜D相信号が変化しなくても、33ビットカウンタ75のカウント値が1に設定される。   When the CPU 62 writes 0 to the count value of the 32-bit counter, even if the transport roller 23 is stopped, or the transport roller 23 is rotating forward or reverse, the 33-bit counter 75 The count value is set to 1. That is, after the CPU 62 writes 0 to the count value of the 32-bit counter, the count value of the 33-bit counter 75 is set to 1 even if the A-phase signal to the D-phase signal do not change.

搬送ローラ23が正転すると、まずA相信号がLレベルからHレベルに変化する。これにより、第一回転方向判定回路71から32ビットカウンタ74へACU信号が出力され、32ビットカウンタ74のカウント値が1にインクリメントされる。32ビットカウンタ74のカウント値がインクリメントされると、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力され、32ビットカウンタ74のカウント値が1桁シフトして33ビットカウンタ75のレジスタに格納される。一方、このときA相信号だけがHレベルでB相信号〜D相信号はLレベルなので、スリット位置判定回路73から33ビットカウンタ75へLレベルのOE信号が出力される。これにより、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力されたとき、33ビットカウンタ75の最下位ビットが0に設定される。この結果、33ビットカウンタ75のカウント値は2になる。   When the transport roller 23 rotates normally, the A-phase signal first changes from L level to H level. As a result, the ACU signal is output from the first rotation direction determination circuit 71 to the 32-bit counter 74, and the count value of the 32-bit counter 74 is incremented to 1. When the count value of the 32-bit counter 74 is incremented, a WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, and the count value of the 32-bit counter 74 is shifted by one digit and stored in the register of the 33-bit counter 75. Is done. On the other hand, since only the A-phase signal is H level and the B-phase signal to D-phase signal are L level at this time, the L-level OE signal is output from the slit position determination circuit 73 to the 33-bit counter 75. Thus, when the WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, the least significant bit of the 33-bit counter 75 is set to 0. As a result, the count value of the 33-bit counter 75 becomes 2.

さらに搬送ローラ23が正転すると、B相信号がLレベルからHレベルに変化する。これにより、第二回転方向判定回路72から33ビットカウンタ75へBDU信号が出力され、33ビットカウンタ75のカウント値がインクリメントされる。この結果、33ビットカウンタ75のカウント値は3になる。   When the transport roller 23 further rotates forward, the B phase signal changes from the L level to the H level. As a result, the BDU signal is output from the second rotation direction determination circuit 72 to the 33-bit counter 75 and the count value of the 33-bit counter 75 is incremented. As a result, the count value of the 33-bit counter 75 becomes 3.

さらに搬送ローラ23の正転が続くと、C相信号がLレベルからHレベルに変化する。これにより、第一回転方向判定回路71から32ビットカウンタ74へACU信号が出力され、32ビットカウンタ74のカウント値が2にインクリメントされる。32ビットカウンタ74のカウント値がインクリメントされると、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力され、32ビットカウンタ74のカウント値が1桁シフトして33ビットカウンタ75のレジスタに格納される。一方、このときD相信号だけがLレベルでA相信号〜C相信号はHレベルなので、スリット位置判定回路73から33ビットカウンタ75へLレベルのOE信号が出力される。これにより、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力されたとき、33ビットカウンタ75の最下位ビットが0に設定される。この結果、33ビットカウンタ75のカウント値は4になる。   When the forward rotation of the transport roller 23 continues, the C phase signal changes from L level to H level. As a result, the ACU signal is output from the first rotation direction determination circuit 71 to the 32-bit counter 74, and the count value of the 32-bit counter 74 is incremented to 2. When the count value of the 32-bit counter 74 is incremented, a WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, and the count value of the 32-bit counter 74 is shifted by one digit and stored in the register of the 33-bit counter 75. Is done. On the other hand, since only the D-phase signal is L level and the A-phase signal to C-phase signal are H level at this time, the L-level OE signal is output from the slit position determination circuit 73 to the 33-bit counter 75. Thus, when the WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, the least significant bit of the 33-bit counter 75 is set to 0. As a result, the count value of the 33-bit counter 75 becomes 4.

以上のような動作によって、搬送ローラ23が正転を続けたときの33ビットカウンタ75のカウント値が設定される。   By the operation as described above, the count value of the 33-bit counter 75 when the conveyance roller 23 continues normal rotation is set.

次に、搬送ローラ23が途中で反転したときについて説明する。ここでは、33ビットカウンタのカウント値が17のとき(図中の時刻T1のとき)、搬送ローラ23が正転から反転に回転方向を変化させているものとする。なお、このときのA相信号〜D相信号はいずれもLレベルであり、32ビットカウンタのカウント値は8である。   Next, the case where the conveyance roller 23 is reversed halfway will be described. Here, when the count value of the 33-bit counter is 17 (at time T1 in the figure), it is assumed that the conveyance roller 23 changes the rotation direction from normal rotation to reverse rotation. At this time, the A-phase signal to the D-phase signal are all at the L level, and the count value of the 32-bit counter is 8.

反転後、まずD相信号がLレベルからHレベルに変化する。これにより、第二回転方向判定回路72から32ビットカウンタ74へBDD信号が出力され、33ビットカウンタ75のカウント値がデクリメントされる。この結果、33ビットカウンタ75のカウント値は16になる。   After inversion, the D-phase signal first changes from L level to H level. As a result, the BDD signal is output from the second rotation direction determination circuit 72 to the 32-bit counter 74, and the count value of the 33-bit counter 75 is decremented. As a result, the count value of the 33-bit counter 75 becomes 16.

さらに搬送ローラ23の反転が続くと、C相信号がLレベルからHレベルに変化する。これにより、第一回転方向反転回路71から32ビットカウンタ74へACD信号が出力され、32ビットカウンタ74のカウント値が7にデクリメントされる。32ビットカウンタ74のカウント値がデクリメントされると、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力され、32ビットカウンタ74のカウント値が1桁シフトして33ビットカウンタ75のレジスタに格納される。一方、このときA相信号及びB相信号はLレベルでありC相信号とD相信号はHレベルなので、スリット位置判定回路73から33ビットカウンタ75へHレベルのOE信号が出力される。これにより、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力されたとき、33ビットカウンタ75の最下位ビットが1に設定される。この結果、33ビットカウンタ75のカウント値は15になる。   When the conveyance roller 23 continues to be reversed, the C-phase signal changes from L level to H level. As a result, the ACD signal is output from the first rotation direction inversion circuit 71 to the 32-bit counter 74, and the count value of the 32-bit counter 74 is decremented to 7. When the count value of the 32-bit counter 74 is decremented, a WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, and the count value of the 32-bit counter 74 is shifted by one digit and stored in the register of the 33-bit counter 75. Is done. On the other hand, since the A phase signal and the B phase signal are at the L level and the C phase signal and the D phase signal are at the H level at this time, an H level OE signal is output from the slit position determination circuit 73 to the 33-bit counter 75. Thus, when the WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, the least significant bit of the 33-bit counter 75 is set to 1. As a result, the count value of the 33-bit counter 75 becomes 15.

このような動作によって、搬送ローラ23が反転を続けたときの33ビットカウンタ75のカウント値が設定される。   By such an operation, the count value of the 33-bit counter 75 when the conveyance roller 23 continues to be reversed is set.

次に、搬送ローラ23が反転から正転に戻ったときについて説明する。ここでは、33ビットカウンタのカウント値が13のとき(図中の時刻T2のとき)、搬送ローラ23が反転から正転に回転方向を変化させているものとする。なお、このときのA相信号〜D相信号はいずれもHレベルであり、32ビットカウンタのカウント値は6である。   Next, the case where the conveyance roller 23 returns from reverse to normal rotation will be described. Here, when the count value of the 33-bit counter is 13 (at time T2 in the figure), it is assumed that the conveyance roller 23 changes the rotation direction from reverse to normal. At this time, the A-phase signal to the D-phase signal are all at the H level, and the count value of the 32-bit counter is 6.

搬送ローラ23の回転方向が正転に戻った後、まずA相信号がHレベルからLレベルに変化する。これにより、第一回転方向判定回路71から32ビットカウンタ74へACU信号が出力され、32ビットカウンタ74のカウント値が7にインクリメントされる。32ビットカウンタ74のカウント値がインクリメントされると、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力され、32ビットカウンタ74のカウント値が1桁シフトして33ビットカウンタ75のレジスタに格納される。一方、このときA相信号だけがLレベルでB相信号〜D相信号はHレベルなので、スリット位置判定回路73から33ビットカウンタ75へLレベルのOE信号が出力される。これにより、32ビットカウンタ74から33ビットカウンタ75へWR信号が出力されたとき、33ビットカウンタ75の最下位ビットが0に設定される。この結果、33ビットカウンタ75のカウント値は14になる。   After the rotation direction of the transport roller 23 returns to normal rotation, the A-phase signal first changes from H level to L level. As a result, the ACU signal is output from the first rotation direction determination circuit 71 to the 32-bit counter 74, and the count value of the 32-bit counter 74 is incremented to 7. When the count value of the 32-bit counter 74 is incremented, a WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, and the count value of the 32-bit counter 74 is shifted by one digit and stored in the register of the 33-bit counter 75. Is done. On the other hand, since only the A phase signal is at the L level and the B phase signal to the D phase signal are at the H level at this time, the L level OE signal is output from the slit position determination circuit 73 to the 33-bit counter 75. Thus, when the WR signal is output from the 32-bit counter 74 to the 33-bit counter 75, the least significant bit of the 33-bit counter 75 is set to 0. As a result, the count value of the 33-bit counter 75 is 14.

さらに搬送ローラ23が正転すると、B相信号がHレベルからLレベルに変化する。これにより、第二回転方向判定回路72から33ビットカウンタ75へBDU信号が出力され、33ビットカウンタ75のカウント値がインクリメントされる。この結果、33ビットカウンタ75のカウント値は15になる。   When the transport roller 23 further rotates forward, the B phase signal changes from H level to L level. As a result, the BDU signal is output from the second rotation direction determination circuit 72 to the 33-bit counter 75 and the count value of the 33-bit counter 75 is incremented. As a result, the count value of the 33-bit counter 75 becomes 15.

このような動作によって、搬送ローラ23が反転から正転に戻った後の33ビットカウンタ75のカウント値が設定される。   By such an operation, the count value of the 33-bit counter 75 after the conveyance roller 23 returns from the reverse rotation to the normal rotation is set.

<位置計測部の動作2>
次に、エッジが近接して33ビットカウンタ75のカウント値がインクリメント又はデクリメントできない場合について説明する。
<Operation 2 of the position measurement unit>
Next, a case where the edge is close and the count value of the 33-bit counter 75 cannot be incremented or decremented will be described.

図17は、位置計測部の各信号のタイミングチャートである。以下、図11も参照しながら説明を行なう。なお、前述の図16の場合と同様に、ここではCPU62が32ビットカウンタ74に初期値として0を設定したとき、A相信号〜D相信号はいずれもLレベルであるものとする。   FIG. 17 is a timing chart of each signal of the position measurement unit. Hereinafter, description will be made with reference to FIG. As in the case of FIG. 16 described above, when the CPU 62 sets 0 as the initial value in the 32-bit counter 74, it is assumed that all of the A-phase signal to the D-phase signal are at the L level.

33ビットカウンタ75のカウント値が9になるまでの間、搬送ローラ23は一定の回転速度で正転を続けている。この間の33ビットカウンタ75のカウント値の設定は既に説明した通りである。このため、33ビットカウンタ75のカウント値が9になるまでの説明は省略し、その後の動作について説明する。   Until the count value of the 33-bit counter 75 reaches 9, the transport roller 23 continues normal rotation at a constant rotational speed. The setting of the count value of the 33-bit counter 75 during this period is as described above. Therefore, the description until the count value of the 33-bit counter 75 reaches 9 is omitted, and the subsequent operation will be described.

33ビットカウンタ75のカウント値が9になった後、搬送ローラ23の回転速度が徐々に速くなっている。この結果、各相信号のエッジが近接してくる。例えば、D相信号がHレベルからLレベルに変化してからA相信号がLレベルからHレベルに変化するまでの時間が近接している。なお、特にB相信号がLレベルからHレベルに変化してからC相信号がLレベルからHレベルに変化するまでの時間が近接している(図17のB相信号とC相信号の矢印の付されたエッジを参照)。   After the count value of the 33-bit counter 75 reaches 9, the rotation speed of the transport roller 23 is gradually increased. As a result, the edges of the respective phase signals come close to each other. For example, the time from when the D phase signal changes from H level to L level until the A phase signal changes from L level to H level is close. In particular, the time from when the B phase signal changes from the L level to the H level until the C phase signal changes from the L level to the H level is close (the arrows of the B phase signal and the C phase signal in FIG. 17). (See edge marked with).

このように各相信号のエッジが近接してくると、ACU信号の出力のタイミングと、BDU信号の出力のタイミングとが近接してくる。特に、図17のB相信号とC相信号の矢印の付されたエッジが近接しているため、このときのBDU信号の出力のタイミングとACU信号の出力のタイミングとが近接している。そして、もしA相信号に対するB相信号の遅延や、第二回転方向判定回路72などの回路の遅延などがあると、BDU信号の出力のタイミングと、ACU信号に基づく32ビットカウンタのWR信号の出力のタイミングとがほぼ同時になるおそれがある。   When the edges of the respective phase signals come close to each other in this way, the output timing of the ACU signal and the output timing of the BDU signal come close to each other. In particular, since the edges of the B-phase signal and the C-phase signal indicated by arrows in FIG. 17 are close to each other, the output timing of the BDU signal and the output timing of the ACU signal are close to each other. If there is a delay of the B phase signal with respect to the A phase signal, a delay of the circuit such as the second rotation direction determination circuit 72, etc., the output timing of the BDU signal and the WR signal of the 32-bit counter based on the ACU signal There is a possibility that the output timing is almost the same.

ところで、ACU信号が出力されると、これに応じて32ビットカウンタ74のカウント値がインクリメントされて、33ビットカウンタ75にWR信号が入力されて、32ビットカウンタのカウント値に応じたカウント値が33ビットカウンタ75に設定される。また、BDU信号が出力されると、これに応じて33ビットカウンタ75のカウント値がインクリメントされる。   By the way, when the ACU signal is output, the count value of the 32-bit counter 74 is incremented accordingly, and the WR signal is input to the 33-bit counter 75, and the count value corresponding to the count value of the 32-bit counter is obtained. The 33-bit counter 75 is set. When the BDU signal is output, the count value of the 33-bit counter 75 is incremented accordingly.

このため、ACU信号の出力のタイミングと、BDU信号の出力のタイミングとが近接してくると、33ビットカウンタの更新のタイミングが速くなる。つまり、搬送ローラ23の回転速度が速くなると、32ビットカウンタのカウント値に基づく33ビットカウンタ75のカウント値の設定から、BDU信号に基づく33ビットカウンタ75のカウント値のインクリメントまでの時間が短くなる。そして、回路の遅延があると、32ビットカウンタ74のカウント値に基づく33ビットカウンタ75のカウント値の設定から、BDU信号に基づく33ビットカウンタ75のカウント値のインクリメントまでの時間がほとんどなくなる。このような事態になると、33ビットカウンタ75のカウント値をインクリメント又はデクリメントできなるおそれがある。例えば、図17の33ビットのカウント値の矢印の付された部分において、33ビットカウンタ75のカウント値が正しく11にならないおそれがある。   For this reason, when the output timing of the ACU signal comes close to the output timing of the BDU signal, the update timing of the 33-bit counter is accelerated. That is, when the rotation speed of the transport roller 23 increases, the time from the setting of the count value of the 33-bit counter 75 based on the count value of the 32-bit counter to the increment of the count value of the 33-bit counter 75 based on the BDU signal is shortened. . If there is a circuit delay, there is almost no time from setting the count value of the 33-bit counter 75 based on the count value of the 32-bit counter 74 to incrementing the count value of the 33-bit counter 75 based on the BDU signal. In such a situation, there is a possibility that the count value of the 33-bit counter 75 cannot be incremented or decremented. For example, there is a possibility that the count value of the 33-bit counter 75 may not be 11 correctly in the portion indicated by the arrow of the 33-bit count value in FIG.

但し、本実施形態において、32ビットカウンタ74は、位相が90度ずれているA相信号及びC相信号に基づくACU信号によって、カウント値をインクリメントしている。すなわち、32ビットカウンタ74は、45度よりも大きく位相のずれた信号に基づいて、カウント値をインクリメントしている。このため、たとえ搬送ローラ23の回転速度が速くなったとしても、32ビットカウンタ74は正確に動作する。つまり、32ビットカウンタのカウント値は、分解能が低いものの、搬送ローラ23の回転位置を正確に示す値になっている。   However, in this embodiment, the 32-bit counter 74 increments the count value by the ACU signal based on the A-phase signal and the C-phase signal whose phases are shifted by 90 degrees. That is, the 32-bit counter 74 increments the count value based on a signal whose phase is larger than 45 degrees. For this reason, even if the rotation speed of the transport roller 23 increases, the 32-bit counter 74 operates accurately. That is, the count value of the 32-bit counter is a value that accurately indicates the rotational position of the transport roller 23 although the resolution is low.

このため、図17の33ビットのカウント値の矢印の付された部分において、たとえ33ビットカウンタ75のカウント値が11にならなかったとしても、32ビットカウンタ74のカウント値は正しい値になっている。このため、32ビットカウンタ74のカウント値が6にインクリメントされると、このカウント値が1桁シフトして33ビットカウンタ75のレジスタに格納されるとともに、LレベルのOE信号に応じて33ビットカウンタ75の最下位ビットが0に設定され、この結果、33ビットカウンタ75のカウント値は再び正確な値である12を示すことになる。つまり、このとき33ビットカウンタ75のカウント値が正しい値に復活する。   Therefore, even if the count value of the 33-bit counter 75 does not become 11 in the portion indicated by the arrow of the 33-bit count value in FIG. 17, the count value of the 32-bit counter 74 becomes a correct value. Yes. Therefore, when the count value of the 32-bit counter 74 is incremented to 6, this count value is shifted by one digit and stored in the register of the 33-bit counter 75, and at the same time, the 33-bit counter according to the L level OE signal. The least significant bit of 75 is set to 0. As a result, the count value of the 33-bit counter 75 again indicates 12 which is an accurate value. That is, at this time, the count value of the 33-bit counter 75 is restored to a correct value.

===第2実施形態の位置計測===
前述の実施形態では、ロータリーエンコーダ52は4相信号を出力している。しかし、これに限られるものではない。例えば、ロータリーエンコーダ52が8相信号を出力しても良い。
=== Position Measurement in Second Embodiment ===
In the above-described embodiment, the rotary encoder 52 outputs a four-phase signal. However, it is not limited to this. For example, the rotary encoder 52 may output an 8-phase signal.

<8相ロータリーエンコーダについて>
図18は、正転時のA相信号〜H相信号のタイミングチャートである。正転時において、例えばA相信号はB相信号よりも22.5度だけ位相が進んでいる。このように22.5度ずつ位相のずれたA相信号〜H相信号をロータリーエンコーダ52は出力している。
<About 8-phase rotary encoder>
FIG. 18 is a timing chart of the A-phase signal to the H-phase signal during normal rotation. At the time of forward rotation, for example, the phase of the A phase signal is advanced by 22.5 degrees relative to the B phase signal. Thus, the rotary encoder 52 outputs the A-phase signal to the H-phase signal whose phases are shifted by 22.5 degrees.

<位置計測部の構成について>
図19は、第2実施形態の位置計測部170の構成の説明図である。この位置計測部170は、第一回転方向判定回路171と、第二回転方向判定回路172と、第一スリット位置判定回路173と、32ビットカウンタ174と、33ビットカウンタ175と、第三回転方向判定回路176と、第二スリット位置判定回路177と、34ビットカウンタ178とを有する。
<About the configuration of the position measurement unit>
FIG. 19 is an explanatory diagram of a configuration of the position measurement unit 170 according to the second embodiment. The position measurement unit 170 includes a first rotation direction determination circuit 171, a second rotation direction determination circuit 172, a first slit position determination circuit 173, a 32-bit counter 174, a 33-bit counter 175, and a third rotation direction. A determination circuit 176, a second slit position determination circuit 177, and a 34-bit counter 178 are included.

第2実施形態の第一回転方向判定回路171、第二回転方向判定回路172、第一スリット位置判定回路173、32ビットカウンタ174及び33ビットカウンタ175は、第1実施形態の第一回転方向判定回路71、第二回転方向判定回路72、スリット位置判定回路73、32ビットカウンタ74及び33ビットカウンタ75と同様の構成及び接続関係である。このため、これらの説明は省略する。なお、33ビットカウンタ175は、33ビットのカウント値を34ビットカウンタ178へ出力する。また、33ビットカウンタ175は、カウント値が更新されたとき、すなわちCGU信号又はCGD信号が入力されたときや32ビットカウンタ174からWR信号が入力されたとき、34ビットカウンタへWR信号を出力する。   The first rotation direction determination circuit 171, the second rotation direction determination circuit 172, the first slit position determination circuit 173, the 32-bit counter 174, and the 33-bit counter 175 of the second embodiment are the first rotation direction determination of the first embodiment. The circuit 71, the second rotation direction determination circuit 72, the slit position determination circuit 73, the 32-bit counter 74, and the 33-bit counter 75 have the same configuration and connection relationship. Therefore, these descriptions are omitted. The 33-bit counter 175 outputs a 33-bit count value to the 34-bit counter 178. The 33-bit counter 175 outputs the WR signal to the 34-bit counter when the count value is updated, that is, when the CGU signal or the CGD signal is input or when the WR signal is input from the 32-bit counter 174. .

第三回転方向判定回路176は、ロータリーエンコーダ52のB相信号、D相信号、F相信号及びH相信号に基づいて、搬送ローラ23が正転しているのか、反転しているのかを判別し、正転していればパルス信号であるBDFHU信号を出力し、反転していればパルス信号であるBDFHD信号を出力する。第三回転方向判定回路176による正転及び反転の判別方法については説明を省略するが、第三回転方向判定回路176は、B相信号、D相信号、F相信号及びH相信号のいずれかの信号が変化するたびにBDFHU信号又はBDFHD信号を出力する。このため、第三回転方向判定回路176の出力は、第一回転方向判定回路171や第二回転方向判定回路172の出力よりも2倍の分解能になる。   The third rotation direction determination circuit 176 determines whether the transport roller 23 is rotating forward or reversed based on the B phase signal, D phase signal, F phase signal, and H phase signal of the rotary encoder 52. If the rotation is normal, a BDFHU signal that is a pulse signal is output, and if inverted, a BDFHD signal that is a pulse signal is output. The description of the forward rotation and inversion determination method by the third rotation direction determination circuit 176 is omitted, but the third rotation direction determination circuit 176 is any one of the B phase signal, the D phase signal, the F phase signal, and the H phase signal. The BDFHU signal or the BDFHD signal is output each time the signal changes. For this reason, the output of the third rotation direction determination circuit 176 has a resolution twice that of the outputs of the first rotation direction determination circuit 171 and the second rotation direction determination circuit 172.

第二スリット位置判定回路177は、ロータリーエンコーダ52のA相信号〜H相信号に基づいて、検出部522に対するスケール521のスリットの位置を判別し、OE2信号を出力する。この第二スリット位置判定回路177は、16通りのA相信号〜H相信号の組み合わせに応じて、検出部522に対してスリットが偶数位置にあるか奇数位置にあるかを示すOE2信号を出力する。   The second slit position determination circuit 177 determines the position of the slit of the scale 521 with respect to the detection unit 522 based on the A-phase signal to the H-phase signal of the rotary encoder 52, and outputs an OE2 signal. The second slit position determination circuit 177 outputs an OE2 signal indicating whether the slit is at an even position or an odd position to the detection unit 522 according to 16 combinations of A-phase signal to H-phase signal. To do.

34ビットカウンタ178は、34ビットのカウント値を出力するカウンタである。この34ビットカウンタ178には、33ビットカウンタ175から33ビットのカウント値とWR信号が入力され、第三回転方向判定回路176からBDFHU信号とBDFHD信号が入力され、第二スリット位置判定回路177からOE2信号が入力される。そして、34ビットカウンタ178は、BDFHU信号が入力されたときに34ビットのカウント値をインクリメントし、BDFHD信号が入力されたときに34ビットのカウント値をデクリメントする。また、34ビットカウンタ178は、33ビットカウンタ175からWR信号が入力されたときに33ビットのカウント値とOE信号とに基づいて33ビットのカウント値を更新する。   The 34-bit counter 178 is a counter that outputs a 34-bit count value. The 34-bit counter 178 receives the 33-bit count value and the WR signal from the 33-bit counter 175, receives the BDFHU signal and the BDFHD signal from the third rotation direction determination circuit 176, and receives the second slit position determination circuit 177. The OE2 signal is input. The 34-bit counter 178 increments the 34-bit count value when the BDFHU signal is input, and decrements the 34-bit count value when the BDFHD signal is input. The 34-bit counter 178 updates the 33-bit count value based on the 33-bit count value and the OE signal when the WR signal is input from the 33-bit counter 175.

34ビットカウンタ178にWR信号が入力されたとき、34ビットのカウンタ値の上位33ビットを示すレジスタに、33ビットカウンタ175からの33ビットのカウント値が設定される。言い換えると、WR信号が入力されたとき、33ビットカウンタ175の33ビットのカウント値が、1ビットだけ桁をシフトして、34ビットカウンタ178のレジスタに格納される。   When the WR signal is input to the 34-bit counter 178, the 33-bit count value from the 33-bit counter 175 is set in the register indicating the upper 33 bits of the 34-bit counter value. In other words, when the WR signal is input, the 33-bit count value of the 33-bit counter 175 is shifted by 1 bit and stored in the register of the 34-bit counter 178.

また、34ビットカウンタ178にWR信号が入力されたとき、34ビットのカウンタ値の最下位ビットを示すレジスタに、OE2信号に応じた値が設定される。OE2信号がLレベルの場合、このレジスタに0が設定され、OE2信号がHレベルの場合、このレジスタに1が設定される。   When the WR signal is input to the 34-bit counter 178, a value corresponding to the OE2 signal is set in the register indicating the least significant bit of the 34-bit counter value. When the OE2 signal is at L level, 0 is set in this register, and when the OE2 signal is at H level, 1 is set in this register.

つまり、OE2信号がLレベルのときに34ビットカウンタ178にWR信号が入力すると、33ビットカウンタ175のカウント値の2倍の値が、34ビットカウンタ178のカウント値になる。また、OE2信号がHレベルのときに34ビットカウンタ178にWR信号が入力すると、33ビットカウンタ175のカウント値の2倍の値に1を加算した値が、34ビットカウンタ178のカウント値になる。   That is, when the WR signal is input to the 34-bit counter 178 when the OE2 signal is at the L level, a value twice the count value of the 33-bit counter 175 becomes the count value of the 34-bit counter 178. When the WR signal is input to the 34-bit counter 178 when the OE2 signal is at the H level, a value obtained by adding 1 to a value twice the count value of the 33-bit counter 175 becomes the count value of the 34-bit counter 178. .

この位置計測部170の動作については説明を省略するが、前述の第1実施形態と同様の効果を当然奏することができる。   Although description of the operation of the position measurement unit 170 is omitted, the same effects as those of the first embodiment described above can be naturally obtained.

===第3実施形態の位置計測===
前述の第1実施形態では、スリット位置判定回路73は、1ビットのデータを示すOE信号を出力する。また、前述の第2実施形態の第一スリット位置判定回路173や第二スリット位置判定回路177も、1ビットのデータを示すOE1信号やOE2信号を出力する。つまり、前述のスリット位置判定回路は、1ビット信号を出力している。そして、この1ビット信号に基づいて、カウンタ(33ビットカウンタ75、33ビットカウンタ175、34ビットカウンタ178)の最下位ビットが決定されている。しかし、これに限られるものではない。例えば、スリット位置判定回路から2ビット信号が出力され、この2ビット信号に基づいてカウンタの下位2ビットが決定されても良い。
=== Position Measurement of Third Embodiment ===
In the first embodiment described above, the slit position determination circuit 73 outputs an OE signal indicating 1-bit data. Further, the first slit position determination circuit 173 and the second slit position determination circuit 177 of the second embodiment also output an OE1 signal and an OE2 signal indicating 1-bit data. That is, the above-described slit position determination circuit outputs a 1-bit signal. Based on this 1-bit signal, the least significant bit of the counter (33-bit counter 75, 33-bit counter 175, 34-bit counter 178) is determined. However, it is not limited to this. For example, a 2-bit signal may be output from the slit position determination circuit, and the lower 2 bits of the counter may be determined based on the 2-bit signal.

図20は、第3実施形態の位置計測部270の構成の説明図である。この位置計測部270は、第一回転方向判定回路271と、第二回転方向判定回路272と、スリット位置判定回路273と、32ビットカウンタ274と、34ビットカウンタ278とを有する。   FIG. 20 is an explanatory diagram of a configuration of the position measurement unit 270 of the third embodiment. The position measurement unit 270 includes a first rotation direction determination circuit 271, a second rotation direction determination circuit 272, a slit position determination circuit 273, a 32-bit counter 274, and a 34-bit counter 278.

第3実施形態の第一回転方向判定回路271及び32ビットカウンタ274は、第1実施形態の第一回転方向判定回路71及び32ビットカウンタ74と同様の構成及び接続関係である。このため、これらの説明は省略する。   The first rotation direction determination circuit 271 and the 32-bit counter 274 of the third embodiment have the same configuration and connection relationship as the first rotation direction determination circuit 71 and the 32-bit counter 74 of the first embodiment. Therefore, these descriptions are omitted.

第二回転方向判定回路272は、ロータリーエンコーダ52のB相信号〜D相信号及びF相信号〜H相信号に基づいて、搬送ローラ23が正転しているのか、反転しているのかを判別し、正転していればパルス信号であるBCDFGHU信号を出力し、反転していればパルス信号であるBCDFGHD信号を出力する。第二回転方向判定回路272による正転及び反転の判別方法については説明を省略するが、第二回転方向判定回路272は、B相信号〜D相信号及びF相信号〜H相信号のいずれかの信号が変化するたびにBCDFGHU信号又はBCDFGHD信号を出力する。   The second rotation direction determination circuit 272 determines whether the transport roller 23 is rotating forward or reverse based on the B phase signal to D phase signal and the F phase signal to H phase signal of the rotary encoder 52. If the rotation is normal, a BCFDGHU signal that is a pulse signal is output, and if inverted, a BCDFGHD signal that is a pulse signal is output. Although description of the forward rotation and inversion determination method by the second rotation direction determination circuit 272 is omitted, the second rotation direction determination circuit 272 is any one of the B phase signal to the D phase signal and the F phase signal to the H phase signal. Each time the signal changes, a BCDFGHU signal or a BCDFGHD signal is output.

スリット位置判定回路273は、ロータリーエンコーダ52のA相信号〜H相信号に基づいて、検出部522に対するスケール521のスリットの位置を判別し、2ビット信号を出力する。このスリット位置判定回路273は、16通りのA相信号〜H相信号の組み合わせに応じて、検出部522に対してスリットが第1位置〜第4位置のいずれの位置にあるかを示す2ビット信号を出力する。   The slit position determination circuit 273 determines the position of the slit of the scale 521 relative to the detection unit 522 based on the A-phase signal to the H-phase signal of the rotary encoder 52, and outputs a 2-bit signal. The slit position determination circuit 273 is a 2-bit indicating whether the slit is in the first position to the fourth position with respect to the detection unit 522 according to 16 combinations of the A phase signal to the H phase signal. Output a signal.

34ビットカウンタ278は、34ビットのカウント値を出力するカウンタである。この34ビットカウンタ278には、32ビットカウンタ274から32ビットのカウント値とWR信号が入力され、第二回転方向判定回路272からBCDFGHU信号とBCDFGHD信号が入力され、スリット位置判定回路273から2ビット信号が入力される。そして、34ビットカウンタ278は、BCDFGHU信号が入力されたときに34ビットのカウント値をインクリメントし、BCDFGHD信号が入力されたときに34ビットのカウント値をデクリメントする。また、34ビットカウンタ278は、32ビットカウンタ274からWR信号が入力されたときに32ビットのカウント値と2ビット信号とに基づいて34ビットのカウント値を更新する。   The 34-bit counter 278 is a counter that outputs a 34-bit count value. The 34-bit counter 278 receives the 32-bit count value and the WR signal from the 32-bit counter 274, receives the BCFDGHU signal and the BCFDFGHD signal from the second rotation direction determination circuit 272, and receives 2 bits from the slit position determination circuit 273. A signal is input. The 34-bit counter 278 increments the 34-bit count value when the BCFDGHU signal is input, and decrements the 34-bit count value when the BCDFGHD signal is input. The 34-bit counter 278 updates the 34-bit count value based on the 32-bit count value and the 2-bit signal when the WR signal is input from the 32-bit counter 274.

図21は、WR信号が入力されたときの34ビットのカウント値の更新の説明図である。図中の四角印は、カウント値を示すためのレジスタである。
34ビットカウンタ278にWR信号が入力されたとき、34ビットのカウンタ値の上位32ビットを示すレジスタに、32ビットカウンタ274からの32ビットのカウント値が設定される。言い換えると、WR信号が入力されたとき、32ビットカウンタ274の32ビットのカウント値が、2ビットだけ桁をシフトして、34ビットカウンタ278のレジスタに格納される。
FIG. 21 is an explanatory diagram of updating the 34-bit count value when the WR signal is input. The square marks in the figure are registers for indicating count values.
When the WR signal is input to the 34-bit counter 278, the 32-bit count value from the 32-bit counter 274 is set in the register indicating the upper 32 bits of the 34-bit counter value. In other words, when the WR signal is input, the 32-bit count value of the 32-bit counter 274 is shifted by 2 bits and stored in the register of the 34-bit counter 278.

また、34ビットカウンタ278にWR信号が入力されたとき、34ビットのカウンタ値の下位2ビットを示す2個のレジスタに、2ビット信号に応じた値が設定される。2ビット信号が00の場合このレジスタに00が設定され、2ビット信号が01の場合このレジスタに01が設定され、2ビット信号が10の場合このレジスタに10が設定され、2ビット信号が11の場合このレジスタに11が設定される。   When the WR signal is input to the 34-bit counter 278, values corresponding to the 2-bit signal are set in the two registers indicating the lower 2 bits of the 34-bit counter value. When the 2-bit signal is 00, this register is set to 00. When the 2-bit signal is 01, this register is set to 01. When the 2-bit signal is 10, the register is set to 10, and the 2-bit signal is 11 In this case, 11 is set in this register.

つまり、34ビットカウンタ278にWR信号が入力すると、32ビットカウンタ274のカウント値の4倍の値に2ビット信号の値を加算した値が、34ビットカウンタ278のカウント値になる。   That is, when the WR signal is input to the 34-bit counter 278, a value obtained by adding the value of the 2-bit signal to a value four times the count value of the 32-bit counter 274 becomes the count value of the 34-bit counter 278.

この位置計測部270の動作については説明を省略するが、前述の第1実施形態及び第2実施形態と同様の効果を当然奏することができる。   Although description of the operation of the position measurement unit 270 is omitted, the same effects as those of the first embodiment and the second embodiment described above can be naturally obtained.

===第4実施形態の位置計測===
前述の実施形態では、ロータリーエンコーダ52の出力に基づく位置計測(搬送ローラ23の回転位置計測)について説明している。しかし、これに限られるものではない。
=== Measurement of Position of Fourth Embodiment ===
In the above-described embodiment, position measurement based on the output of the rotary encoder 52 (rotational position measurement of the transport roller 23) has been described. However, it is not limited to this.

リニアエンコーダ51は、プリンタ本体側に固定されたリニアスケールと、キャリッジ31に設けられた検出部とによって構成されている。このようなリニアエンコーダ51の出力に基づいてキャリッジ31の位置を計測するための位置計測部を、前述の実施形態と同様に構成しても良い。この場合、位置計測部の出力するカウント値はユニット制御回路64のキャリッジモータドライバ(不図示)に出力され、キャリッジモータドライバは位置計測部のカウント値に応じてキャリッジモータ32を制御する。   The linear encoder 51 is configured by a linear scale fixed to the printer main body side and a detection unit provided on the carriage 31. A position measurement unit for measuring the position of the carriage 31 based on the output of the linear encoder 51 may be configured in the same manner as in the above-described embodiment. In this case, the count value output by the position measurement unit is output to a carriage motor driver (not shown) of the unit control circuit 64, and the carriage motor driver controls the carriage motor 32 according to the count value of the position measurement unit.

===その他の実施の形態===
上記の実施形態では、一実施形態としてのプリンタ等を説明したが、上記の実施形態は本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明は、その趣旨を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれることは言うまでもない。
=== Other Embodiments ===
In the above embodiment, a printer or the like as one embodiment has been described. However, the above embodiment is intended to facilitate understanding of the present invention and is not intended to limit the present invention. . The present invention can be changed and improved without departing from the gist thereof, and it is needless to say that the present invention includes equivalents thereof.

===まとめ===
(1−1)前述の第1実施形態の位置計測部70は、ロータリーエンコーダ52と、32ビットカウンタ74と、33ビットカウンタ75とを備えている。ロータリーエンコーダ52は、A相信号、B相信号、C相信号及びD相信号を、検出部522に対するスリットの位置に応じて出力する。32ビットカウンタ74は、A相信号及びC相信号に基づくACU信号及びACD信号に応じて、32ビットのカウント値をインクリメント又はデクリメントして出力する。
=== Summary ===
(1-1) The position measuring unit 70 according to the first embodiment includes the rotary encoder 52, the 32-bit counter 74, and the 33-bit counter 75. The rotary encoder 52 outputs an A phase signal, a B phase signal, a C phase signal, and a D phase signal according to the position of the slit with respect to the detection unit 522. The 32-bit counter 74 increments or decrements the 32-bit count value according to the ACU signal and the ACD signal based on the A-phase signal and the C-phase signal, and outputs the result.

32ビットカウンタ74のカウント値が更新されたとき、32ビットカウンタ74は33ビットカウンタ75へWR信号を出力する。33ビットカウンタ75にWR信号が入力されると、33ビットのカウンタ値の上位32ビットを示すレジスタに、32ビットカウンタ74からの32ビットのカウント値が設定される。また、33ビットカウンタ75にWR信号が入力されると、33ビットのカウンタ値の最下位ビットを示すレジスタに、OE信号に応じた値が設定される。なお、このOE信号は、A相信号〜D相信号に基づいてスリットと検出部522との位置関係に応じた位置情報を示す信号である。   When the count value of the 32-bit counter 74 is updated, the 32-bit counter 74 outputs a WR signal to the 33-bit counter 75. When the WR signal is input to the 33-bit counter 75, the 32-bit count value from the 32-bit counter 74 is set in the register indicating the upper 32 bits of the 33-bit counter value. When the WR signal is input to the 33-bit counter 75, a value corresponding to the OE signal is set in the register indicating the least significant bit of the 33-bit counter value. The OE signal is a signal indicating position information corresponding to the positional relationship between the slit and the detection unit 522 based on the A-phase signal to the D-phase signal.

そして、33ビットカウンタ75は、このように設定された33ビットのカウント値を、B相信号及びD相信号に基づくBDU信号及びBDD信号に応じて、インクリメント又はデクリメントして出力する。   The 33-bit counter 75 increments or decrements the 33-bit count value set in this way in accordance with the BDU signal and the BDD signal based on the B-phase signal and the D-phase signal, and outputs the result.

このような構成により、33ビットカウンタ75のカウント値に検出誤差を累積させずに済む。また、たとえ33ビットカウンタ75のカウント値に検出誤差が発生しても、32ビットカウンタ74のカウント値が正しければ、33ビットカウンタ75のカウント値が正しい値を示すように復活させることができる。   With this configuration, it is not necessary to accumulate detection errors in the count value of the 33-bit counter 75. Even if a detection error occurs in the count value of the 33-bit counter 75, if the count value of the 32-bit counter 74 is correct, it can be restored so that the count value of the 33-bit counter 75 shows a correct value.

(1−2)また、前述の第2実施形態の位置計測部170は、ロータリーエンコーダ52と、32ビットカウンタ174と、33ビットカウンタ175とを備えている。ロータリーエンコーダ52は、A相信号、C相信号、E相信号及びG相信号を、検出部522に対するスリットの位置に応じて出力する。32ビットカウンタ174は、A相信号及びE相信号に基づくAEU信号及びAED信号に応じて、32ビットのカウント値をインクリメント又はデクリメントして出力する。 (1-2) The position measurement unit 170 according to the second embodiment includes the rotary encoder 52, the 32-bit counter 174, and the 33-bit counter 175. The rotary encoder 52 outputs an A phase signal, a C phase signal, an E phase signal, and a G phase signal according to the position of the slit with respect to the detection unit 522. The 32-bit counter 174 increments or decrements a 32-bit count value according to the AEU signal and AED signal based on the A-phase signal and the E-phase signal, and outputs the result.

32ビットカウンタ174のカウント値が更新されたとき、32ビットカウンタ174は33ビットカウンタ175へWR信号を出力する。33ビットカウンタ175にWR信号が入力されると、33ビットのカウンタ値の上位32ビットを示すレジスタに、32ビットカウンタ174からの32ビットのカウント値が設定される。また、33ビットカウンタ175にWR信号が入力されると、33ビットのカウンタ値の最下位ビットを示すレジスタに、OE1信号に応じた値が設定される。なお、このOE1信号は、A相信号、C相信号、E相信号及びG相信号に基づいてスリットと検出部522との位置関係に応じた位置情報を示す信号である。   When the count value of the 32-bit counter 174 is updated, the 32-bit counter 174 outputs a WR signal to the 33-bit counter 175. When the WR signal is input to the 33-bit counter 175, the 32-bit count value from the 32-bit counter 174 is set in the register indicating the upper 32 bits of the 33-bit counter value. When the WR signal is input to the 33-bit counter 175, a value corresponding to the OE1 signal is set in the register indicating the least significant bit of the 33-bit counter value. The OE1 signal is a signal indicating positional information corresponding to the positional relationship between the slit and the detection unit 522 based on the A phase signal, the C phase signal, the E phase signal, and the G phase signal.

そして、33ビットカウンタ175は、このように設定された33ビットのカウント値を、C相信号及びG相信号に基づくCGU信号及びCGD信号に応じて、インクリメント又はデクリメントして出力する。   Then, the 33-bit counter 175 increments or decrements and outputs the 33-bit count value set in this way according to the CGU signal and the CGD signal based on the C-phase signal and the G-phase signal.

このような構成により、33ビットカウンタ175のカウント値に検出誤差を累積させずに済む。また、たとえ33ビットカウンタ175のカウント値に検出誤差が発生しても、32ビットカウンタ174のカウント値が正しければ、33ビットカウンタ175のカウント値が正しい値を示すように復活させることができる。   With this configuration, it is not necessary to accumulate detection errors in the count value of the 33-bit counter 175. Even if a detection error occurs in the count value of the 33-bit counter 175, if the count value of the 32-bit counter 174 is correct, the count value of the 33-bit counter 175 can be restored so as to indicate a correct value.

(1−3)前述の第2実施形態の位置計測部170は、ロータリーエンコーダ52と、33ビットカウンタ175と、34ビットカウンタ178とを備えている。ロータリーエンコーダ52は、A相信号、C相信号、E相信号及びG相信号を、検出部522に対するスリットの位置に応じて出力する。33ビットカウンタ175は、A相信号及びE相信号に基づいて、33ビットのカウント値をインクリメント又はデクリメントして出力する。 (1-3) The position measurement unit 170 according to the second embodiment includes the rotary encoder 52, the 33-bit counter 175, and the 34-bit counter 178. The rotary encoder 52 outputs an A phase signal, a C phase signal, an E phase signal, and a G phase signal according to the position of the slit with respect to the detection unit 522. The 33-bit counter 175 increments or decrements the 33-bit count value based on the A-phase signal and the E-phase signal and outputs the result.

33ビットカウンタ175のカウント値が更新されたとき、33ビットカウンタ175は34ビットカウンタ178へWR信号を出力する。34ビットカウンタ178にWR信号が入力されると、34ビットのカウンタ値の上位33ビットを示すレジスタに、33ビットカウンタ175からの33ビットのカウント値が設定される。また、34ビットカウンタ178にWR信号が入力されると、34ビットのカウンタ値の最下位ビットを示すレジスタに、OE2信号に応じた値が設定される。なお、このOE2信号は、A相信号、C相信号、E相信号及びG相信号を含むA相信号〜H相信号に基づいてスリットと検出部522との位置関係に応じた位置情報を示す信号である。   When the count value of the 33-bit counter 175 is updated, the 33-bit counter 175 outputs a WR signal to the 34-bit counter 178. When the WR signal is input to the 34-bit counter 178, the 33-bit count value from the 33-bit counter 175 is set in the register indicating the upper 33 bits of the 34-bit counter value. When the WR signal is input to the 34-bit counter 178, a value corresponding to the OE2 signal is set in the register indicating the least significant bit of the 34-bit counter value. The OE2 signal indicates positional information corresponding to the positional relationship between the slit and the detection unit 522 based on the A phase signal to the H phase signal including the A phase signal, the C phase signal, the E phase signal, and the G phase signal. Signal.

そして、34ビットカウンタ178は、このように設定された34ビットのカウント値を、C相信号及びG相信号に基づくBDFHU信号及びBDFHD信号に応じて、インクリメント又はデクリメントして出力する。   Then, the 34-bit counter 178 increments or decrements the 34-bit count value thus set according to the BDFHU signal and the BDFHD signal based on the C-phase signal and the G-phase signal, and outputs the result.

このような構成により、34ビットカウンタ178のカウント値に検出誤差を累積させずに済む。また、たとえ34ビットカウンタ178のカウント値に検出誤差が発生しても、33ビットカウンタ175のカウント値が正しければ、34ビットカウンタ178のカウント値が正しい値を示すように復活させることができる。なお、前述の第2実施形態によれば、33ビットカウンタ175のカウント値に検出誤差が生じても、32ビットカウンタ174のカウント値が正しければ、33ビットカウンタ175のカウント値が正しい値を示すように復活できるので、34ビットカウンタ178のカウント値も正しい値を示すように復活させることができる。   With this configuration, it is not necessary to accumulate detection errors in the count value of the 34-bit counter 178. Even if a detection error occurs in the count value of the 34-bit counter 178, if the count value of the 33-bit counter 175 is correct, the count value of the 34-bit counter 178 can be restored so as to indicate a correct value. According to the second embodiment described above, even if a detection error occurs in the count value of the 33-bit counter 175, if the count value of the 32-bit counter 174 is correct, the count value of the 33-bit counter 175 indicates a correct value. Thus, the count value of the 34-bit counter 178 can be restored so as to show a correct value.

(1−4)前述の第3実施形態の位置計測部270は、ロータリーエンコーダ52と、32ビットカウンタ274と、34ビットカウンタ278とを備えている。ロータリーエンコーダ52は、A相信号、C相信号、E相信号及びG相信号を、検出部522に対するスリットの位置に応じて出力する。32ビットカウンタ274は、A相信号及びE相信号に基づくAEU信号及びAED信号に応じて、32ビットのカウント値をインクリメント又はデクリメントして出力する。 (1-4) The position measurement unit 270 of the third embodiment described above includes the rotary encoder 52, the 32-bit counter 274, and the 34-bit counter 278. The rotary encoder 52 outputs an A phase signal, a C phase signal, an E phase signal, and a G phase signal according to the position of the slit with respect to the detection unit 522. The 32-bit counter 274 increments or decrements the 32-bit count value according to the AEU signal and AED signal based on the A-phase signal and the E-phase signal, and outputs the result.

32ビットカウンタ274のカウント値が更新されたとき、32ビットカウンタ274は34ビットカウンタ278へWR信号を出力する。34ビットカウンタ278にWR信号が入力されると、34ビットのカウンタ値の上位32ビットを示すレジスタに、32ビットカウンタ274からの32ビットのカウント値が設定される。また、34ビットカウンタ278にWR信号が入力されると、34ビットのカウンタ値の下位2ビットを示すレジスタに、2ビット信号に応じた値が設定される。なお、この2ビット信号は、A相信号、C相信号、E相信号及びG相信号を含むA相信号〜H相信号に基づいてスリットと検出部522との位置関係に応じた位置情報を示す信号である。   When the count value of the 32-bit counter 274 is updated, the 32-bit counter 274 outputs a WR signal to the 34-bit counter 278. When the WR signal is input to the 34-bit counter 278, the 32-bit count value from the 32-bit counter 274 is set in the register indicating the upper 32 bits of the 34-bit counter value. When the WR signal is input to the 34-bit counter 278, a value corresponding to the 2-bit signal is set in the register indicating the lower 2 bits of the 34-bit counter value. The 2-bit signal has positional information corresponding to the positional relationship between the slit and the detection unit 522 based on the A phase signal to the H phase signal including the A phase signal, the C phase signal, the E phase signal, and the G phase signal. It is a signal to show.

そして、34ビットカウンタ278は、このように設定された34ビットのカウント値を、B相信号及びD相信号に基づくBCDFGHU信号及びBCDFGHD信号に応じて、インクリメント又はデクリメントして出力する。   Then, the 34-bit counter 278 increments or decrements and outputs the 34-bit count value set in this way in accordance with the BCFDGHU signal and the BCFDFGHD signal based on the B-phase signal and the D-phase signal.

このような構成により、34ビットカウンタ278のカウント値に検出誤差を累積させずに済む。また、たとえ34ビットカウンタ278のカウント値に検出誤差が発生しても、32ビットカウンタ274のカウント値が正しければ、34ビットカウンタ278のカウント値が正しい値を示すように復活させることができる。   With this configuration, it is not necessary to accumulate detection errors in the count value of the 34-bit counter 278. Even if a detection error occurs in the count value of the 34-bit counter 278, if the count value of the 32-bit counter 274 is correct, the count value of the 34-bit counter 278 can be restored so as to indicate a correct value.

(2)前述の第1実施形態では、A相信号、B相信号、C相信号、D相信号の順に、位相がずれている。つまり、A相信号のエッジとC相信号のエッジとの間隔は、A相信号のエッジとB相信号のエッジとの間隔よりも、離れている。このため、搬送ローラ23の回転速度が速くなっても、32ビットカウンタ74のカウント値を正しい値に保つことができる。 (2) In the first embodiment described above, the phases are shifted in the order of the A phase signal, the B phase signal, the C phase signal, and the D phase signal. That is, the interval between the edge of the A phase signal and the edge of the C phase signal is farther than the interval between the edge of the A phase signal and the edge of the B phase signal. For this reason, even if the rotation speed of the transport roller 23 increases, the count value of the 32-bit counter 74 can be kept at a correct value.

また、前述の第2実施形態及び第3実施形態では、A相信号、C相信号、E相信号及びG相信号の順に、位相がずれている。そして、搬送ローラ23の回転速度が速くなっても、32ビットカウンタ174や32ビットカウンタ274のカウント値を正しい値に保つことができる。   In the second and third embodiments described above, the phases are shifted in the order of the A phase signal, the C phase signal, the E phase signal, and the G phase signal. Even when the rotation speed of the transport roller 23 increases, the count values of the 32-bit counter 174 and the 32-bit counter 274 can be kept at correct values.

(3)前述の第1実施形態では、32ビットのカウント値に基づいて33ビットのカウント値の上位32ビットの値が決定され、OE信号に基づいて33ビットのカウント値の最下位ビットの値が決定される。 (3) In the first embodiment described above, the value of the upper 32 bits of the 33-bit count value is determined based on the 32-bit count value, and the value of the least significant bit of the 33-bit count value is determined based on the OE signal. Is determined.

また、前述の第3実施形態では、32ビットのカウント値に基づいて34ビットのカウント値の上位32ビットの値が決定され、2ビット信号に基づいて34ビットのカウント値の下位2ビットの値が決定される。   In the third embodiment, the upper 32 bits of the 34-bit count value is determined based on the 32-bit count value, and the lower 2-bit value of the 34-bit count value is determined based on the 2-bit signal. Is determined.

(4)なお、前述の第1実施形態では、正転時に32ビットカウンタ74のカウント値が更新されれば、このときのOE信号はLレベルなので、33ビットカウンタ75のカウント値は、32ビットカウンタ74のカウント値の2倍の値になる。また、反転時に32ビットカウンタ74のカウント値が更新されれば、このときのOE信号はHレベルなので、33ビットカウンタ75のカウント値は、32ビットカウンタ74のカウント値の2倍の値に1を加算した値になる。これにより、正転及び反転を繰り返した場合であっても、33ビットカウンタ75のカウント値の整合性を保つことができる。 (4) In the first embodiment described above, if the count value of the 32-bit counter 74 is updated during normal rotation, the OE signal at this time is L level, so the count value of the 33-bit counter 75 is 32 bits. The value becomes twice the count value of the counter 74. Further, if the count value of the 32-bit counter 74 is updated at the time of inversion, the OE signal at this time is at the H level, so the count value of the 33-bit counter 75 is 1 twice the count value of the 32-bit counter 74. It becomes the value which added. Thereby, even when normal rotation and inversion are repeated, the consistency of the count value of the 33-bit counter 75 can be maintained.

つまり、OE信号は1ビット信号で足り、OE信号に基づいて33ビットカウンタ75のカウント値の最下位ビットを決定すれば、33ビットカウンタ75のカウント値の整合性を保つことができる。   In other words, a 1-bit signal is sufficient for the OE signal, and if the least significant bit of the count value of the 33-bit counter 75 is determined based on the OE signal, the consistency of the count value of the 33-bit counter 75 can be maintained.

(5)ロータリーエンコーダ52は、スリットと検出部522との相対的な位置の変化量を検出するものである。このため、カウント値が初期値からどれくらい変化したかが重要なのであり、カウント値がスリットと検出部522との位置関係を直接示すわけではない。 (5) The rotary encoder 52 detects the amount of change in the relative position between the slit and the detection unit 522. Therefore, it is important how much the count value has changed from the initial value, and the count value does not directly indicate the positional relationship between the slit and the detection unit 522.

このため、前述の実施形態では、32ビットカウンタのカウント値をCPU62が任意の初期値に設定することができるようになっている。   For this reason, in the above-described embodiment, the CPU 62 can set the count value of the 32-bit counter to an arbitrary initial value.

なお、前述の実施形態では、CPU62は32ビットカウンタ74に初期値として0を設定している。しかし、32ビットカウンタ74のカウント値が0の状態で搬送ローラ23が反転すると、32ビットカウンタ74のカウント値が最大値を示すおそれがあり、搬送ローラ23の回転量を検出できないおそれがある。このため、本来であれば、初期値は0ではない方が良い。   In the above-described embodiment, the CPU 62 sets 0 as the initial value in the 32-bit counter 74. However, if the conveyance roller 23 is reversed while the count value of the 32-bit counter 74 is 0, the count value of the 32-bit counter 74 may indicate the maximum value, and the rotation amount of the conveyance roller 23 may not be detected. For this reason, it is better that the initial value is not 0.

(6)前述の実施形態では、スリットと検出部522との相対的な位置が変化していないときに、すなわち搬送ローラ23が停止中のときに、CPU62が32ビットカウンタ74に初期値を設定しても、33ビットカウンタ75に33ビットのカウント値が設定される。つまり、CPU62が32ビットカウンタ74に初期値を設定した後、A相信号〜D相信号が変化しなくても、搬送ローラ23の回転位置に応じた33ビットのカウント値が33ビットカウンタ75に設定される。 (6) In the above-described embodiment, the CPU 62 sets an initial value in the 32-bit counter 74 when the relative position between the slit and the detection unit 522 is not changed, that is, when the conveyance roller 23 is stopped. Even so, a 33-bit count value is set in the 33-bit counter 75. That is, after the CPU 62 sets an initial value in the 32-bit counter 74, even if the A-phase signal to the D-phase signal do not change, the 33-bit count value corresponding to the rotation position of the transport roller 23 is stored in the 33-bit counter 75. Is set.

(7)前述の第1実施形態〜第3実施形態では、ロータリーエンコーダ52の出力に基づく位置計測(搬送ローラ23の回転位置計測)について説明している。 (7) In the first to third embodiments described above, position measurement based on the output of the rotary encoder 52 (rotational position measurement of the transport roller 23) has been described.

(8)しかし、ロータリーエンコーダ52に限られるものではなく、リニアエンコーダ51による位置計測の際に、前述の第1実施形態〜第3実施形態の構成を適用しても良い。 (8) However, the configuration is not limited to the rotary encoder 52, and the configurations of the first to third embodiments described above may be applied when the position is measured by the linear encoder 51.

(9)前述の実施形態の構成の全てを含む位置計測部であれば、上記に記載した全ての効果を奏することができるので望ましい。但し、カウント値を正しくするという効果を得る際に、必ずしも前述の全ての構成が必要なわけではない。 (9) A position measurement unit that includes all of the configurations of the above-described embodiments is desirable because all the effects described above can be achieved. However, in order to obtain the effect of making the count value correct, all the above-described configurations are not necessarily required.

(10)なお、前述の実施形態には、位置計測部を含むプリンタの開示があるだけでなく、位置計測方法に関する開示が含まれている。 (10) The above-described embodiment includes disclosure of a position measurement method as well as disclosure of a printer including a position measurement unit.

印刷システムの全体構成の説明図である。It is explanatory drawing of the whole structure of a printing system. プリンタ1の全体構成のブロック図である。1 is a block diagram of an overall configuration of a printer 1. FIG. 図3Aは、プリンタ1の全体構成の概略図である。また、図3Bは、プリンタ1の全体構成の横断面図である。FIG. 3A is a schematic diagram of the overall configuration of the printer 1. FIG. 3B is a cross-sectional view of the overall configuration of the printer 1. 搬送ユニット20の構成の説明図である。4 is an explanatory diagram of a configuration of a transport unit 20. FIG. 2相ロータリーエンコーダの構成の説明図である。It is explanatory drawing of a structure of a two-phase rotary encoder. 図6Aは、搬送モータ22が正転しているときの出力信号の波形のタイミングチャートである。図6Bは、搬送モータ22が反転しているときの出力信号の波形のタイミングチャートである。FIG. 6A is a timing chart of the waveform of the output signal when the transport motor 22 is rotating forward. FIG. 6B is a timing chart of the waveform of the output signal when the conveyance motor 22 is reversed. 2相ロータリーエンコーダの正転及び反転の判別の説明図である。It is explanatory drawing of discrimination | determination of normal rotation and inversion of a two-phase rotary encoder. 2相ロータリーエンコーダのカウント値の説明図である。It is explanatory drawing of the count value of a two-phase rotary encoder. 4相ロータリーエンコーダの構成の説明図である。It is explanatory drawing of a structure of a 4-phase rotary encoder. 4相ロータリーエンコーダの正転時のA相信号〜D相信号と、カウンタのカウント値のタイミングチャートである。It is a timing chart of the A phase signal-D phase signal at the time of forward rotation of a 4-phase rotary encoder, and the count value of a counter. 第1実施形態の位置計測部70の構成の説明図である。It is explanatory drawing of a structure of the position measurement part 70 of 1st Embodiment. 第一回転方向判定回路71の判定結果と出力信号の説明図である。It is explanatory drawing of the determination result of the 1st rotation direction determination circuit 71, and an output signal. 第二回転方向判定回路72の判定結果と出力信号の説明図である。It is explanatory drawing of the determination result of the 2nd rotation direction determination circuit 72, and an output signal. スリット位置判定回路73の判定結果とOE信号の説明図である。It is explanatory drawing of the determination result of the slit position determination circuit 73, and OE signal. WR信号が入力されたときの33ビットのカウント値の更新の説明図である。It is explanatory drawing of the update of a 33-bit count value when a WR signal is input. 位置計測部の各信号のタイミングチャートである。It is a timing chart of each signal of a position measurement part. 位置計測部の各信号のタイミングチャートである。It is a timing chart of each signal of a position measurement part. 8相ロータリーエンコーダの正転時のA相信号〜H相信号のタイミングチャートである。It is a timing chart of A phase signal-H phase signal at the time of forward rotation of an 8-phase rotary encoder. 第2実施形態の位置計測部170の構成の説明図である。It is explanatory drawing of a structure of the position measurement part 170 of 2nd Embodiment. 第3実施形態の位置計測部270の構成の説明図である。It is explanatory drawing of a structure of the position measurement part 270 of 3rd Embodiment. 第3実施形態において、WR信号が入力されたときの34ビットのカウント値の更新の説明図である。In 3rd Embodiment, it is explanatory drawing of update of the count value of 34 bits when a WR signal is input.

符号の説明Explanation of symbols

1 プリンタ、
20 搬送ユニット、21 給紙ローラ、22 搬送モータ(PFモータ)、
23 搬送ローラ、24 プラテン、25 排紙ローラ、
30 キャリッジユニット、31 キャリッジ、
32 キャリッジモータ(CRモータ)、
40 ヘッドユニット、41 ヘッド、
50 検出器群、51 リニアエンコーダ、52 ロータリーエンコーダ、
521 スケール、 522 検出部、
53 紙検出センサ、54 光学センサ、
60 コントローラ、61 インターフェース部、62 CPU、
63 メモリ、64 ユニット制御回路
70 位置計測部、71 第一回転方向判定回路、72 第二回転方向判定回路、
73 スリット位置判定回路、74 32ビットカウンタ、
75 33ビットカウンタ、
170 位置計測部、
171 第一回転方向判定回路、172 第二回転方向判定回路、
173 第一スリット位置判定回路、174 32ビットカウンタ、
175 33ビットカウンタ、176 第三回転方向判定回路、
177 第二スリット位置判定回路、178 34ビットカウンタ、
270 位置計測部、
271 第一回転方向判定回路、272 第二回転方向判定回路、
273 スリット位置判定回路、274 32ビットカウンタ、
278 34ビットカウンタ、
100 印刷システム、
110 コンピュータ、120 表示装置、130 入力装置、140 記録再生装置
1 printer,
20 transport unit, 21 paper feed roller, 22 transport motor (PF motor),
23 transport roller, 24 platen, 25 discharge roller,
30 Carriage unit, 31 Carriage,
32 Carriage motor (CR motor),
40 head units, 41 heads,
50 detector groups, 51 linear encoder, 52 rotary encoder,
521 scale, 522 detector,
53 Paper detection sensor, 54 Optical sensor,
60 controller, 61 interface unit, 62 CPU,
63 memory, 64 unit control circuit 70 position measurement unit, 71 first rotation direction determination circuit, 72 second rotation direction determination circuit,
73 Slit position determination circuit, 74 32-bit counter,
75 33-bit counter,
170 position measurement unit,
171 First rotation direction determination circuit, 172 Second rotation direction determination circuit,
173 First slit position determination circuit, 174 32-bit counter,
175 33-bit counter, 176 third rotation direction determination circuit,
177 Second slit position determination circuit, 178 34 bit counter,
270 position measurement unit,
271 First rotation direction determination circuit, 272 Second rotation direction determination circuit,
273 Slit position determination circuit, 274 32-bit counter,
278 34-bit counter,
100 printing system,
110 computer, 120 display device, 130 input device, 140 recording / reproducing device

Claims (10)

(1)スリットと検出器とを有し、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するエンコーダと、
(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力する第1カウンタと、
(3)前記第1カウント値が更新されたときに、前記第1カウンタから出力される前記第1カウント値に基づいて第1情報が設定され、前記エンコーダから出力される第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報が設定され、
設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力する
第2カウンタと、
を備える位置計測装置。
(1) an encoder that has a slit and a detector, and outputs a first signal, a second signal, a third signal, and a fourth signal according to the position of the slit with respect to the detector;
(2) a first counter that increments or decrements and outputs a first count value based on the first signal and the third signal;
(3) When the first count value is updated, first information is set based on the first count value output from the first counter, and the first signal output from the encoder, second Second information corresponding to the positional relationship between the slit and the detector is set based on the signal, the third signal, and the fourth signal,
A second counter that increments or decrements and outputs a second count value composed of the set first information and the second information based on the second signal and the fourth signal;
A position measuring device comprising:
請求項1に記載の位置計測装置であって、
前記第1信号、前記第2信号、前記第3信号、前記第4信号の順に、位相がずれていることを特徴とする位置計測装置。
The position measuring device according to claim 1,
The position measuring device, wherein the phase is shifted in the order of the first signal, the second signal, the third signal, and the fourth signal.
請求項1又は2に記載の位置計測装置であって、
前記第1情報に基づいて、前記第2カウント値の上位の桁の値が決定され、
前記第2情報に基づいて、前記第2カウント値の下位の桁の値が決定される
ことを特徴とする位置計測装置。
The position measuring device according to claim 1 or 2,
Based on the first information, an upper digit value of the second count value is determined,
A position measurement apparatus, wherein a lower digit value of the second count value is determined based on the second information.
請求項3に記載の位置計測装置であって、
前記第2情報に基づいて、前記第2カウント値の最下位ビットが決定されることを特徴とする位置計測装置。
The position measuring device according to claim 3,
The position measuring apparatus, wherein the least significant bit of the second count value is determined based on the second information.
請求項1〜4のいずれかに記載の位置計測装置であって、
前記第1カウンタの前記第1カウント値は、任意の値に設定可能であることを特徴とする位置計測装置。
The position measuring device according to any one of claims 1 to 4,
The position measurement device according to claim 1, wherein the first count value of the first counter can be set to an arbitrary value.
請求項5に記載の位置計測装置であって、
前記スリットと前記検出器との相対的な位置が変化していないときに、前記第1カウンタの前記第1カウント値が任意の値に設定されることを特徴とする位置計測装置。
The position measuring device according to claim 5,
The position measuring device, wherein the first count value of the first counter is set to an arbitrary value when the relative position between the slit and the detector is not changed.
請求項1〜6のいずれかに記載の位置計測装置であって、
前記エンコーダは、ロータリー式であることを特徴とする位置計測装置。
The position measuring device according to claim 1,
The position measuring device is characterized in that the encoder is a rotary type.
請求項1〜6のいずれかに記載の位置計測装置であって、
前記エンコーダは、リニア式であることを特徴とする位置計測装置。
The position measuring device according to claim 1,
The position measuring device is characterized in that the encoder is of a linear type.
位置計測装置を備える印刷装置であって、
(A)前記位置計測装置は、
(1)スリットと検出器とを有し、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するエンコーダと、
(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力する第1カウンタと、
(3)前記第1カウント値が更新されたときに、前記第1カウンタから出力される前記第1カウント値に基づいて第1情報が設定され、前記エンコーダから出力される第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報が設定され、
設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力する
第2カウンタと、
を備え、
(B)前記第1信号、前記第2信号、前記第3信号、前記第4信号の順に、位相がずれており、
(C)前記第1情報に基づいて、前記第2カウント値の上位の桁の値が決定され、前記第2情報に基づいて、前記第2カウント値の下位の桁の値が決定され、
(D)前記第2情報に基づいて、前記第2カウント値の最下位ビットが決定され、
(E)前記第1カウンタの前記第1カウント値は、任意の値に設定可能であり、
(F)前記スリットと前記検出器との相対的な位置が変化していないときに、前記第1カウンタの前記第1カウント値が任意の値に設定され、
(G)前記エンコーダは、ロータリー式である
ことを特徴とする印刷装置。
A printing apparatus including a position measuring device,
(A) The position measuring device includes:
(1) an encoder that has a slit and a detector, and outputs a first signal, a second signal, a third signal, and a fourth signal according to the position of the slit with respect to the detector;
(2) a first counter that increments or decrements and outputs a first count value based on the first signal and the third signal;
(3) When the first count value is updated, first information is set based on the first count value output from the first counter, and the first signal output from the encoder, second Second information corresponding to the positional relationship between the slit and the detector is set based on the signal, the third signal, and the fourth signal,
A second counter that increments or decrements and outputs a second count value composed of the set first information and the second information based on the second signal and the fourth signal;
With
(B) The phase is shifted in the order of the first signal, the second signal, the third signal, and the fourth signal,
(C) The value of the upper digit of the second count value is determined based on the first information, the value of the lower digit of the second count value is determined based on the second information,
(D) Based on the second information, the least significant bit of the second count value is determined,
(E) The first count value of the first counter can be set to an arbitrary value,
(F) When the relative position between the slit and the detector has not changed, the first count value of the first counter is set to an arbitrary value,
(G) The printing apparatus is characterized in that the encoder is a rotary type.
(1)スリットと検出器とを用いて、第1信号、第2信号、第3信号及び第4信号を、前記検出器に対する前記スリットの位置に応じてそれぞれ出力するステップと、
(2)前記第1信号及び前記第3信号に基づいて第1カウント値をインクリメント又はデクリメントして出力するステップと、
(3)前記第1カウント値が更新されたときに、前記第1カウント値に基づいて第1情報を設定し、前記第1信号、第2信号、第3信号及び第4信号に基づいて前記スリットと前記検出器との位置関係に応じた第2情報を設定し
設定された前記第1情報及び前記第2情報からなる第2カウント値を、前記第2信号及び前記第4信号に基づいてインクリメント又はデクリメントして出力するステップと、
を有する位置計測方法。

(1) Using the slit and the detector, outputting each of the first signal, the second signal, the third signal, and the fourth signal according to the position of the slit with respect to the detector;
(2) a step of incrementing or decrementing a first count value based on the first signal and the third signal and outputting the first count value;
(3) When the first count value is updated, first information is set based on the first count value, and based on the first signal, the second signal, the third signal, and the fourth signal, Based on the second signal and the fourth signal, the second information is set according to the positional relationship between the slit and the detector, and the set second count value including the first information and the second information is set. Incrementing or decrementing and outputting;
A position measurement method.

JP2005309746A 2005-10-25 2005-10-25 Position measuring apparatus and position measuring method Expired - Fee Related JP4742808B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005309746A JP4742808B2 (en) 2005-10-25 2005-10-25 Position measuring apparatus and position measuring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005309746A JP4742808B2 (en) 2005-10-25 2005-10-25 Position measuring apparatus and position measuring method

Publications (2)

Publication Number Publication Date
JP2007120970A JP2007120970A (en) 2007-05-17
JP4742808B2 true JP4742808B2 (en) 2011-08-10

Family

ID=38144990

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005309746A Expired - Fee Related JP4742808B2 (en) 2005-10-25 2005-10-25 Position measuring apparatus and position measuring method

Country Status (1)

Country Link
JP (1) JP4742808B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5477292B2 (en) 2008-08-26 2014-04-23 株式会社ニコン Encoder system and signal processing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2697919B2 (en) * 1989-09-29 1998-01-19 キヤノン株式会社 Signal interpolation circuit and displacement measuring device provided with the circuit
JP3195117B2 (en) * 1993-04-19 2001-08-06 株式会社トプコン Rotary encoder
JP4716463B2 (en) * 2000-09-14 2011-07-06 ハイデンハイン株式会社 Multi-turn absolute encoder
JP2007057453A (en) * 2005-08-26 2007-03-08 Seiko Epson Corp Positional information generation system, printer, and positional information generation method

Also Published As

Publication number Publication date
JP2007120970A (en) 2007-05-17

Similar Documents

Publication Publication Date Title
US7221114B2 (en) Conveyance control apparatus and image forming apparatus
US7086714B2 (en) Method for finding recording-start position
JP2008105347A (en) Inkjet recording device and control method thereof
JP4742808B2 (en) Position measuring apparatus and position measuring method
EP1598643B1 (en) Encoder error correction circuit
JP2005041086A (en) Printer, and its controlling method
US10300694B2 (en) Printing apparatus and printing method
JP5115521B2 (en) Printing apparatus and printing method
JP2007021933A (en) Printing device
JP3951877B2 (en) Conveying apparatus, printing apparatus, conveying method, program, and computer system
JP5741645B2 (en) Image processing apparatus, image forming apparatus, and image processing program
JP4720103B2 (en) Printing apparatus and test pattern manufacturing method
JP4440673B2 (en) Control device for printer device
JP3937910B2 (en) Printing apparatus, program, and computer system
JP4572579B2 (en) Printing apparatus, test pattern manufacturing method, and printing system
JP2007057453A (en) Positional information generation system, printer, and positional information generation method
JP2019048401A (en) Recording device and recording method
JP4515734B2 (en) Control device for printer device
JP3582750B2 (en) Recording device
JP2004202963A (en) Inkjet printer
JP4788347B2 (en) Speed detection device and speed detection method
JP4115191B2 (en) Motor control device and control method
JP2008070127A (en) Speed measuring apparatus and method, and printer
JP2007045625A (en) Carrying device and image forming device
JP2006218756A (en) Recorder

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080710

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110304

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110425

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

Free format text: PAYMENT UNTIL: 20140520

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4742808

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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