JPS636804B2 - - Google Patents

Info

Publication number
JPS636804B2
JPS636804B2 JP10369380A JP10369380A JPS636804B2 JP S636804 B2 JPS636804 B2 JP S636804B2 JP 10369380 A JP10369380 A JP 10369380A JP 10369380 A JP10369380 A JP 10369380A JP S636804 B2 JPS636804 B2 JP S636804B2
Authority
JP
Japan
Prior art keywords
signal
counting
pulse
count
output
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
Application number
JP10369380A
Other languages
Japanese (ja)
Other versions
JPS5729911A (en
Inventor
Susumu Makinochi
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.)
Nikon Corp
Original Assignee
Nippon Kogaku KK
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 Nippon Kogaku KK filed Critical Nippon Kogaku KK
Priority to JP10369380A priority Critical patent/JPS5729911A/en
Publication of JPS5729911A publication Critical patent/JPS5729911A/en
Publication of JPS636804B2 publication Critical patent/JPS636804B2/ja
Granted legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/12Analogue/digital converters
    • H03M1/22Analogue/digital converters pattern-reading type

Description

【発明の詳細な説明】 本発明は、計測装置等に用いる計数装置に関
し、例えば、測長、測角に用いるエンコーダ装置
と組み合わせて、パルス信号のパルス数等を計数
する装置に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a counting device used in a measuring device and the like, and for example, to a device that counts the number of pulses of a pulse signal in combination with an encoder device used for length measurement and angle measurement.

近年、測長、測角に用いるエンコーダとして
は、例えば光電式のものがある。光電式リニアエ
ンコーダ、又はロータリーエンコーダでは、一般
に移動体又は、回転体に取りつけて、一体に動く
主スケールと、この主スケールに対向するように
配置されたインデツクススケールを設け、さらに
この主スケールとインデツクススケールを共には
さみ込むように、光源と光電変換器が設けられ
る。そして、各スケールには、光の透過する部分
と遮光される部分を互いちがいにした、いわゆる
格子状パターンが設けられている。従つて測長、
又は測角する被測定物が、移動又は回転して、主
スケールの格子とインデツクススケールの格子の
遮光部同士が重なるときには、同時に光源からの
光は各スケールを透過して光電変換器に達する。
In recent years, as encoders used for length measurement and angle measurement, there are, for example, photoelectric type encoders. A photoelectric linear encoder or a rotary encoder is generally provided with a main scale that is attached to a moving body or a rotating body and moves together with the main scale, and an index scale that is arranged to face the main scale. A light source and a photoelectric converter are provided to sandwich the index scale. Each scale is provided with a so-called lattice pattern in which light transmitting parts and light blocking parts are different from each other. Therefore, length measurement,
Or, when the object to be measured moves or rotates and the light shielding parts of the main scale grating and the index scale grating overlap, the light from the light source passes through each scale and reaches the photoelectric converter at the same time. .

この時、光電信号は最大になる。また主スケー
ルとインデツクススケールの遮光部と透過部が重
なつた時、光源からの光はほとんど光電変換器に
達しないため、光電信号は最小になる。以上のよ
うにして、光電信号はパルス状の信号となる。一
般に各スケールの格子状パターンは一定ピツチで
設けられているから、この光電信号のパルス数を
計数すれば、移動量又は回転量が求められる。こ
のように出力された光電信号は、パルス状すなわ
ちデジタル信号に波形整形し、適当なデジタルカ
ウンタでこの信号のパルス数を計数し、例えばそ
の結果を表示するようにすれば計数装置が得られ
る。
At this time, the photoelectric signal is at its maximum. Furthermore, when the light shielding part and the transmitting part of the main scale and index scale overlap, almost no light from the light source reaches the photoelectric converter, so the photoelectric signal becomes minimum. As described above, the photoelectric signal becomes a pulsed signal. Generally, the lattice pattern of each scale is provided at a constant pitch, so by counting the number of pulses of this photoelectric signal, the amount of movement or rotation can be determined. A counting device can be obtained by shaping the photoelectric signal outputted in this way into a pulse, that is, a digital signal, counting the number of pulses of this signal using a suitable digital counter, and displaying the result, for example.

しかしながら、近年、このようなエンコーダに
よつて測長又は測角された値を、そのまま単に表
示するだけでなく、測定値を基にして所定の演
算、を行ない、その結果を表示したり、また所定
の測定値になつたかどうかの判別等の各種機能が
要求されるようになつた。このため、エンコーダ
は、適当な演算及び処理装置等と組み合わせて用
いられるようになつた。
However, in recent years, the values measured by length or angle with such encoders are not only displayed as they are, but also perform predetermined calculations based on the measured values and display the results. Various functions such as determining whether a predetermined measurement value has been reached have become required. For this reason, encoders have come to be used in combination with appropriate arithmetic and processing devices.

この演算処理装置は、多くはデジタル電子計算
機、すなわちコンピユータであるが、エンコーダ
の如き測定器では、演算、処理とも特定の仕事に
限られてくるため、演算能力、処理容量との兼ね
合いで、もつぱらマイクロコンピユータが使われ
ている。ところで、マイクロコンピユータにも各
種のものがあるが、少なくとも、一定の演算、処
理の方法を記述したプログラム、演算、処理のた
めにあらかじめ必要なデータ、又はプログラムに
従つて演算、処理して得られたデータ等を記憶す
る手段を有するものとする。
This arithmetic processing device is often a digital electronic computer, that is, a computer, but with measuring instruments such as encoders, both arithmetic and processing are limited to specific tasks, so there is a need for computation power and processing capacity. A paramicrocomputer is used. By the way, there are various types of microcomputers, but at least they have a program that describes a certain calculation or processing method, data required in advance for the calculation or processing, or data that can be obtained by calculation or processing according to the program. It shall have means for storing the data etc.

そこで、マイクロコンピユータを用いて、測
長、測角を行なうエンコーダについて簡単に説明
する。一般にマイクロコンピユータによる演算、
処理は、所定のビツト数、例えば4ビツト、8ビ
ツト等を単位にして行なわれる。すなわちパラレ
ルのデータである。ところが、前述の如く、エン
コーダからの信号は単なるパルス信号、すなわち
シリアルのデータである。そこで、エンコーダか
らのパルス信号を、マイクロコンピユータが直接
扱える信号に変換するために、従来からアツプダ
ウンカウンタが使われている。エンコーダでは、
移動又は回転の方向を判別するような信号を別に
出力している。従つて、この判別信号によつて、
アツプダウンカウンタをアツプカウンタ、又はダ
ウンカウンタに切り換えて、エンコーダのパルス
信号のパルス数を計数している。そして、マイク
ロコンピユータは、このアツプダウンカウンタの
計数データを、入力ポートから読み込むようにな
つている。しかしながら、マイクロコンピユータ
側では、先にも述べたように、計数データの読み
込み以外に、所定のプログラムに従つた演算、又
は処理動作を行なうため、割り込み処理が使われ
ていた。一般に、マイクロコンピユータでは割り
込み要求が起こると、それまで実行していた演
算、処理のプログラムを一時停止させて、他の仕
事(他のプログラム)を実行するようになつてい
る。そして割り込み処理が終了すると、再び元の
プログラムを続行する。従つて、従来のマイクロ
コンピユータとアツプダウンカウンタを用いた計
数装置では、アツプダウンカウンタがオーバーフ
ロー又はアンダーフローするまでは、直接カウン
タの計数データを読み込み、キヤリー、又はボロ
ー信号が出力されると、マイクロコンピユータは
割り込みをかけられて、計数データの上位桁を演
算していた。
Therefore, an encoder that measures length and angle using a microcomputer will be briefly described. Generally, calculations are performed by a microcomputer,
The processing is performed in units of a predetermined number of bits, for example 4 bits, 8 bits, etc. In other words, it is parallel data. However, as mentioned above, the signal from the encoder is just a pulse signal, that is, serial data. Therefore, up-down counters have traditionally been used to convert pulse signals from encoders into signals that can be directly handled by microcomputers. In the encoder,
A signal for determining the direction of movement or rotation is separately output. Therefore, by this discrimination signal,
The number of pulses of the encoder pulse signal is counted by switching the up-down counter to an up-counter or a down-counter. The microcomputer is adapted to read the count data of this up-down counter from the input port. However, as mentioned above, on the microcomputer side, in addition to reading count data, interrupt processing is used to perform calculations or processing operations according to a predetermined program. Generally, when an interrupt request occurs in a microcomputer, the calculation or processing program that was being executed is temporarily stopped, and other work (another program) is executed. When the interrupt processing is finished, the original program is resumed. Therefore, in a conventional counting device using a microcomputer and an up-down counter, the counting data of the up-down counter is directly read until the up-down counter overflows or underflows, and when a carry or borrow signal is output, the micro The computer was interrupted and was calculating the upper digits of the count data.

例えば、アツプダウンカウンタが4ビツトのバ
イナリ出力形式のものであるとすると、アツプダ
ウンカウンタはエンコーダからのパルス信号のパ
ルス数を計数して、16パルス毎にキヤリー又はボ
ロー信号を出力する。同時に、アツプダウンカウ
ンタは、パルス信号の計数を続行する。マイクロ
コンピユータは、アツプダウンカウンタのキヤリ
ー、又はボロー信号によつて割り込みをかけられ
ると、キヤリー信号のときには、それまでの上位
の計数データに1を加算し、ボロー信号のときに
はそれまでの上位の計数データから1を減算し、
アツプダウンカウンタの計数データとそれまでの
計数データを重ね合わせて、データを得るように
していた。
For example, if the up-down counter is of a 4-bit binary output format, the up-down counter counts the number of pulses of the pulse signal from the encoder and outputs a carry or borrow signal every 16 pulses. At the same time, the up-down counter continues counting pulse signals. When the microcomputer is interrupted by a carry or borrow signal of the up-down counter, it adds 1 to the previous high-order count data if it is a carry signal, and adds 1 to the previous high-order count data if it is a borrow signal. Subtract 1 from the data,
Data was obtained by overlapping the count data of the up-down counter with the count data up to that point.

ところが、エンコーダのパルス信号の単位時間
あたりのパルス数が多くなつてくると、マイクロ
コンピユータの割り込み処理時間が問題となつて
くる。即ち、割り込み処理時間はプログラムに大
きく依存するが、例えば、キヤリー信号の出るよ
うな位置でエンコーダのスケールが振動して、キ
ヤリー、及びボロー信号が短時間に繰り返し出力
された場合は、割り込み処理が追従しきれなくな
り、その結果、計数ミスを起こすという欠点が生
ずるのである。
However, as the number of pulses per unit time of the encoder pulse signal increases, the interrupt processing time of the microcomputer becomes a problem. In other words, the interrupt processing time largely depends on the program, but for example, if the encoder scale vibrates at a position where a carry signal is output and the carry and borrow signals are repeatedly output in a short period of time, the interrupt processing may take longer. This results in a drawback that the tracking becomes impossible and, as a result, a counting error occurs.

一方、アツプダウンカウンタとして計数容量の
十分あるものを用いると高価になるという欠点が
あつた。
On the other hand, if an up-down counter with sufficient counting capacity is used, it is expensive.

本発明は、これらの欠点を解決し、アツプダウ
ンカウンタ等の計数手段の容量を増すことなくか
つ計数ミスの生じない計数装置を得ることを目的
とする。
SUMMARY OF THE INVENTION An object of the present invention is to solve these drawbacks and provide a counting device that does not increase the capacity of counting means such as an up-down counter and does not cause counting errors.

その目的を達成するために、本発明の計数装置
は、計測量に応じた数のパルスを出力する計測手
段と、最大計測量に応じたパルス数よりも小なる
最大計数値とし、前記計測手段からのパルス数を
計数する計数手段と、前記計数手段の計数出力信
号を保持可能な保持手段と、前記計数手段による
計数値が最大計数値を越える前に開始信号を出力
し、該出力した後に前記保持手段にて保持された
計数出力信号の累算を行なうデジタル計算手段
と、前記開始信号に基づいて、前記保持手段に前
記計数手段の計数出力信号を保持せしめると共
に、該保持後でかつ又前記パルス信号が出力され
る前に前記計数出力信号を初期化する如く前記計
数手段をリセツトする制御手段とを備える。
In order to achieve the object, the counting device of the present invention includes a measuring means that outputs a number of pulses corresponding to a measured quantity, a maximum count value that is smaller than the number of pulses corresponding to the maximum measured quantity, and a measuring means that outputs a number of pulses corresponding to a measured quantity, a counting means for counting the number of pulses from the counting means, a holding means capable of holding a count output signal of the counting means, outputting a start signal before the count value by the counting means exceeds a maximum count value, and after outputting the start signal. digital calculation means for accumulating the count output signals held by the holding means; and digital calculation means for causing the holding means to hold the count output signals of the counting means based on the start signal; and control means for resetting the counting means to initialize the counting output signal before the pulse signal is output.

以下、本発明の実施例を図面を参照して説明す
る。
Embodiments of the present invention will be described below with reference to the drawings.

第1図は、本発明の実施例を示すブロツク図で
ある。主スケールを設けた、移動体と共に移動す
るスケール部1とインデツクススケールを設けた
検出部2により、リニアエンコーダが構成されて
いる。スケール部が移動すると、検出部2から
は、第1a図の如く検出信号が出力される。検出
信号は、ほぼ90゜の位相差を有する2つの正弦波
状の信号である。これは、スケール部1の移動方
向を検出できるようにしたもので、前述の如く主
スケールの格子状パターンを2組設けて、互いに
そのピツチを位相差90゜に相当する分だけずらし
てある。そこでたとえば、第1a図の如く、検出
信号S1の位相が検出信号S2の位相よりも遅れてい
るときは一方向に、位相関係が逆のときは他方向
に、スケール部1が移動したことになる。そし
て、検出信号S1,S2は増幅及び波形成形する回路
3によつて、第1b図の如く、デジタル処理が可
能な方形波状の信号S1′,S2′に変換される。信号
S1′,S2′のパルス数は、スケール部1の移動距離
に比例する。さらに信号S1′,S2′の周波数はスケ
ール部1の移動速度に比例する。この信号S1′,
S2′は、方向判別パルス化回路4によつて、次段
のアツプダウンカウンタ5に必要な、アツプカウ
ントパルスとダウンカウントパルスの2系列のパ
ルス信号に変換される。すなわち、方向を判別し
て、たとえば一方向に移動したときは、アツプカ
ウントパルスのみを出力し、他方向に移動したと
き、ダウンカウントパルスのみを出力する。さら
にこれらカウントパルスは、2相クロツク発振器
10が出力する第1のクロツク信号φ1と同期し
て出力される。詳細は後述するが、2相クロツク
信号の周波数は、マイクロコンピユータ7の基準
クロツクに準じた周波数であり、一般には信号
S1′,S2′の周波数よりも十分高く定められてい
る。アツプダウンカウンタ5は、前述のアツプカ
ウントパルスにより計数値を増加し、ダウンカウ
ントパルスにより計数値を減少するように動作す
る。
FIG. 1 is a block diagram showing an embodiment of the present invention. A linear encoder is constituted by a scale section 1 which is provided with a main scale and moves together with the moving object, and a detection section 2 which is provided with an index scale. When the scale section moves, the detection section 2 outputs a detection signal as shown in FIG. 1a. The detection signals are two sinusoidal signals with a phase difference of approximately 90°. This allows the direction of movement of the scale section 1 to be detected, and as described above, two sets of main scale lattice patterns are provided, and their pitches are shifted from each other by an amount corresponding to a phase difference of 90 degrees. For example, as shown in Figure 1a, when the phase of the detection signal S1 lags the phase of the detection signal S2, the scale section 1 moves in one direction, and when the phase relationship is reversed, the scale section 1 moves in the other direction. It turns out. The detection signals S 1 and S 2 are converted by the amplification and waveform shaping circuit 3 into square wave signals S 1 ' and S 2 ' that can be digitally processed, as shown in FIG. 1b. signal
The number of pulses S 1 ′ and S 2 ′ is proportional to the moving distance of the scale section 1. Furthermore, the frequencies of the signals S 1 ' and S 2 ' are proportional to the moving speed of the scale section 1. This signal S 1 ′,
S 2 ' is converted by the direction discrimination pulsing circuit 4 into two series of pulse signals, an up count pulse and a down count pulse, necessary for the up down counter 5 at the next stage. That is, by determining the direction, for example, when moving in one direction, only an up count pulse is output, and when moving in the other direction, only a down count pulse is output. Furthermore, these count pulses are output in synchronization with the first clock signal φ1 output from the two-phase clock oscillator 10. Although the details will be described later, the frequency of the two-phase clock signal is based on the reference clock of the microcomputer 7, and generally the frequency of the two-phase clock signal is based on the reference clock of the microcomputer 7.
The frequency is set sufficiently higher than the frequencies of S 1 ′ and S 2 ′. The up-down counter 5 operates to increase the count value by the above-mentioned up count pulse and to decrease the count value by the down count pulse.

尚、アツプダウンカウンタ5はリセツト信号に
よつてリセツトが可能である。アツプダウンカウ
ンタ5の計数データは、次段のラツチ回路6に入
力する。ラツチ回路6はラツチ信号により、入力
されたデータを保持する。この状態をラツチ状態
とする。また、ラツチ信号が入力されないとき
は、アツプダウンカウンタ5の計数データがその
ままラツチ回路6の出力に表われる。尚、この状
態をアクテイブ状態とする。マイクロコンピユー
タ7は、ラツチ回路6の出力データを入力ポート
部から入力する。マイクロコンピユータ7が読み
込んだ計数データは、所定の演算、処理を施され
て、その結果を表示部8により表示する。マイク
ロコンピユータ7が、この演算、処理等の仕事を
行なつている間、正確には、マイクロコンピユー
タ7が、入力ポート部を介してラツチ回路6の計
数データを読み込む時点から、マイクロコンピユ
ータ7は開始信号を同期回路9に出力する。同期
回路9は、2相クロツク発振器10の出力する第
2のクロツク信号φ2と開始信号を同期させて、
前述の如くリセツト信号とラツチ信号を出力す
る。
Incidentally, the up-down counter 5 can be reset by a reset signal. The count data of the up-down counter 5 is input to the latch circuit 6 at the next stage. The latch circuit 6 holds input data in response to a latch signal. This state is called a latched state. Further, when the latch signal is not input, the count data of the up-down counter 5 appears as is at the output of the latch circuit 6. Note that this state is referred to as an active state. The microcomputer 7 receives the output data of the latch circuit 6 from the input port section. The count data read by the microcomputer 7 is subjected to predetermined calculations and processing, and the results are displayed on the display section 8. While the microcomputer 7 is performing work such as calculations and processing, more precisely, the microcomputer 7 starts from the time when the microcomputer 7 reads the count data of the latch circuit 6 via the input port section. The signal is output to the synchronization circuit 9. The synchronization circuit 9 synchronizes the second clock signal φ2 output from the two-phase clock oscillator 10 with the start signal.
It outputs the reset signal and latch signal as described above.

マイクロコンピユータ7は、上述のように、入
力ポート部の計数データの読み込み直前に、開始
信号を出力するようなプログラムに従つて動作す
る。尚、詳細は後述する。
As described above, the microcomputer 7 operates according to a program that outputs a start signal immediately before reading the count data of the input port section. The details will be described later.

第2図は第1図のブロツク図における主要部を
具体的に示した回路図である。この回路の動作、
及び作用を第3図のタイムチヤートに基づいて説
明する。方向判別パルス化回路4は第16図のよ
うなパルス信号を端子11,12から入力する。
このパルス信号は第3図における信号A,Bに相
当する。なお、第3図中、時刻Tでスケール部1
の移動方向が反転したものとする。従つて、信号
A,Bの位相関係も、時刻Tから逆になる。信号
A,Bを入力するDフリツプフロツプ(以下D−
FF)13とD−FF14は、2相クロツク発振器
10の第1のクロツク信号φ1をCKから入力し
て、信号A,Bをクロツク信号φ1の立上がりに
同期した信号に変換して出力する。この変換して
出力される信号は、第3図の信号C,Dのように
なる。さらにD−FF15とD−FF16は、それ
ぞれ信号C,Dを入力し、クロツク信号φ1の立
上りで信号C,Dの状態をラツチする。従つて、
第3図に示す如くD−FF15の出力信号E及び
D−FF16の出力信号Fは、信号C,Dに対し
て、それぞれクロツク信号φ1の1クロツク分だ
け遅れた信号になる。すなわちD−FFによる同
期遅延回路を構成している。
FIG. 2 is a circuit diagram specifically showing the main parts in the block diagram of FIG. 1. The operation of this circuit,
The operation and operation will be explained based on the time chart shown in FIG. The direction determination pulse generation circuit 4 receives pulse signals as shown in FIG. 16 from terminals 11 and 12.
This pulse signal corresponds to signals A and B in FIG. In addition, in FIG. 3, at time T, scale section 1
Assume that the moving direction of is reversed. Therefore, the phase relationship between signals A and B also becomes reversed from time T. A D flip-flop (hereinafter referred to as D-) inputs signals A and B.
FF) 13 and D-FF 14 input the first clock signal φ1 of the two-phase clock oscillator 10 from CK, convert the signals A and B into signals synchronized with the rise of the clock signal φ1, and output the signals. The converted and output signals become signals C and D in FIG. 3. Furthermore, D-FF15 and D-FF16 input signals C and D, respectively, and latch the states of signals C and D at the rising edge of clock signal φ1. Therefore,
As shown in FIG. 3, the output signal E of the D-FF 15 and the output signal F of the D-FF 16 are delayed by one clock of the clock signal φ1 with respect to the signals C and D, respectively. In other words, it constitutes a synchronous delay circuit using D-FF.

各D−FFの出力信号は、NOT17,18、
AND19〜26、OR27,28によつてパルス
化されて、スケール部1の移動方向に従つて、
OR27,28により、2系列の信号を出力す
る。この2系列の信号は第3図中、信号G,Hの
ようになる。信号G,Hを以下カウントパルス
G,Hとする。カウントパルスG,Hは、入力さ
れた信号A,Bの状態が変化した時に、クロツク
信号φ1に同期するとともに、1クロツク周期の
長さだけ信号が出力される。ここでカウントパル
スGが出力されたときは、スケール部1が正方向
に移動し、カウントパルスHが出力されたとき
は、負方向に移動したものとする。
The output signals of each D-FF are NOT17, 18,
Pulsed by AND19-26 and OR27, 28, according to the moving direction of the scale section 1,
Two series of signals are outputted by OR27 and 28. These two series of signals are shown as signals G and H in FIG. The signals G and H are hereinafter referred to as count pulses G and H. Count pulses G and H are synchronized with clock signal φ1 when the states of input signals A and B change, and the signals are output for a length of one clock period. Here, when the count pulse G is output, it is assumed that the scale section 1 moves in the positive direction, and when the count pulse H is output, it is assumed that the scale section 1 moves in the negative direction.

このカウントパルスG,Hは、アツプダウンカ
ウンタ5によつてカウントされる。アツプダウン
カウンタ5の入力UCは、アツプカウント入力で
あり、入力DCはダウンカウント入力である。従
つてカウントパルスGが出力されると、アツプダ
ウンカウンタ5は、アツプカウント動作を行な
い、出力Q1〜Q4にバイナリ形式又はBCD形式で、
カウントパルスGのパルス数を加算した計数デー
タを出力する。尚、出力Q1はLSB、出力Q4
MSBとする。又、カウントパルスHが入力DCに
入力されると、アツプダウンカウンタ5はダウン
カウント動作を行ない、出力Q1〜Q4に、カウン
トパルスHのパルス数を減算した計数データを出
力する。アツプダウンカウンタ5は入力CLを
“H”レベルにすることによつて、出力Q1〜Q4
計数データをクリアする。
These count pulses G and H are counted by an up-down counter 5. The input UC of the up-down counter 5 is an up-count input, and the input DC is a down-count input. Therefore, when the count pulse G is output, the up-down counter 5 performs an up-count operation and outputs the outputs Q1 to Q4 in binary format or BCD format.
Outputs count data obtained by adding the number of pulses of count pulse G. Note that output Q 1 is LSB, output Q 4 is
MSB. Furthermore, when the count pulse H is input to the input DC, the up-down counter 5 performs a down-count operation and outputs count data obtained by subtracting the number of pulses of the count pulse H to the outputs Q1 to Q4 . The up-down counter 5 clears the count data of the outputs Q1 to Q4 by setting the input CL to "H" level.

アツプダウンカウンタ5の計数データは、ラツ
チ回路6の入力D1〜D4に入力される。ラツチ回
路6は、入力CKが“H”レベルのときは、ラツ
チ状態になる。従つて、入力CKが“L”レベル
のとき、入力D1〜D4の計数データは、そのまま
出力Q1〜Q4に表われる。そして、入力CKが
“H”レベルになつたときは、その時点の計数デ
ータを保持して、出力Q1〜Q4に出力する。
The count data of the up-down counter 5 is input to inputs D 1 to D 4 of the latch circuit 6. The latch circuit 6 is in a latch state when the input CK is at "H" level. Therefore, when the input CK is at the "L" level, the count data of the inputs D1 to D4 appear as they are on the outputs Q1 to Q4 . When the input CK reaches the "H" level, the count data at that time is held and output to the outputs Q1 to Q4 .

一方、マイクロコンピユータ7は、ラツチ回路
6の出力Q1〜Q4を入力ポート部PD1〜PD4に入力
する。一般に、マイクロコンピユータの入出力ポ
ート(I/Oポート)は、プログラムによつて制
御される。従つて、ただ単にポート部に入力のデ
ータを加えても、マイクロコンピユータは、内部
にそのデータを読み込むことはない。そこで、マ
イクロコンピユータ7は、ポート部PD1〜PD4
入力データを適宜読み込むようなプログラムに従
つて作動する。同時に、マイクロコンピユータ7
は、このポート部PD1〜PD4からの入力開始を表
わす信号をポートPCに出力する。この開始を表
わす信号を信号PCとする。信号PCは、前述の如
く、アツプダウンカウンタ5をクリアするための
信号Jとラツチ回路6をラツチするための信号I
を出力する同期回路9に入力する。この同期回路
9は、信号J、信号Iを出力するタイミングを、
カウントパルスG,H及び第2のクロツク信号φ
2と同期させる働きをする。尚、クロツク信号φ
2は、第3図に示すように、クロツク信号φ1と
約180゜の位相差を有している。
On the other hand, the microcomputer 7 inputs the outputs Q 1 to Q 4 of the latch circuit 6 to input port sections PD 1 to PD 4 . Generally, the input/output ports (I/O ports) of a microcomputer are controlled by a program. Therefore, even if input data is simply added to the port section, the microcomputer will not read that data internally. Therefore, the microcomputer 7 operates according to a program that reads input data from the ports PD 1 to PD 4 as appropriate. At the same time, microcomputer 7
outputs a signal representing the start of input from the port units PD 1 to PD 4 to the port PC. The signal representing this start is designated as signal PC. As mentioned above, the signal PC includes the signal J for clearing the up-down counter 5 and the signal I for latching the latch circuit 6.
is input to the synchronization circuit 9 which outputs. This synchronization circuit 9 determines the timing of outputting the signal J and the signal I.
Count pulses G, H and second clock signal φ
It works to synchronize with 2. In addition, the clock signal φ
2 has a phase difference of about 180° from the clock signal φ1, as shown in FIG.

この同期回路9は、負論理表記のNAND31,
32、によるR−Sフリツプフロツプ(以下R−
SFFとする。)とワンシヨツトマルチバイブレー
タ30等により構成されている。
This synchronous circuit 9 includes a NAND 31 in negative logic notation,
32, R-S flip-flop (hereinafter referred to as R-S flip-flop)
SFF. ), a one-shot multivibrator 30, etc.

NAND33は、クロツク信号φ2と、カウン
トパルスG,HのNOR演算するNOR34の出力
信号Kと、信号PCを入力する。NOR34の出力
信号KとNAND33の出力信号Lは第3図中、
信号KとLのようになる。信号PCはR−SFFの
リセツト入力となり、信号Lはセツト入力とな
る。従つて、R−SFFの出力信号Iは、信号PC
が“L”レベルのときには、NAND33の出力
信号Lの状態にかかわらず、“L”レベルである。
信号PCが“H”レベルになつた後、信号Lの状
態が初めて変化した時点から信号Iを“H”レベ
ルにして、ラツチ回路6のラツチ動作を行なう。
ワンシヨツトマルチバイブレータ30は信号Iの
立上りから一定時間tだけ“H”レベルになる信
号Jを出力して、この信号Jの“H”レベルでア
ツプダウンカウンタ5をクリアする。時間tは、
第3図中、信号Jに示すように、クロツク信号φ
2の1クロツク周期の半分よりも短く定められて
いる。これは、先にも述べたようにクロツク信号
φ1とφ2の位相差が約180゜であることによる。
すなわち、スケール部1が高速に移動して、信号
A,Bの状態変化が、ほぼクロツク信号φ1の2
クロツク周期毎に起こると、カウントパルスG,
Hはデユーテイレシオが約50%のパルス信号にな
る。従つて、信号Jが出力されるタイミングは、
クロツク信号φ2の立上りに同期しているから、
信号Jの“H”レベルの時間tがクロツク周期の
半分よりも長いと、カウントパルスG、又はHの
入力と、信号Jによるアツプダウンカウンタ5の
クリア時間が競合してしまい、その結果、計数ミ
スを起こしてしまう。そこで実施例においては、
時刻tを、クロツク周期の半分よりも短く定めて
ある。
The NAND 33 receives the clock signal φ2, the output signal K of the NOR 34 which performs a NOR operation on the count pulses G and H, and the signal PC. The output signal K of NOR34 and the output signal L of NAND33 are shown in Fig. 3.
The signals will look like K and L. The signal PC becomes the reset input of R-SFF, and the signal L becomes the set input. Therefore, the output signal I of R-SFF is the signal PC
When is at the "L" level, it is at the "L" level regardless of the state of the output signal L of the NAND 33.
After the signal PC goes to the "H" level, the signal I goes to the "H" level from the time when the state of the signal L changes for the first time, and the latch circuit 6 performs a latching operation.
The one-shot multivibrator 30 outputs a signal J that is at the "H" level for a certain period of time t after the rise of the signal I, and the up-down counter 5 is cleared by the "H" level of the signal J. The time t is
As shown in signal J in FIG.
It is set to be shorter than half of one clock period of 2. This is because, as mentioned earlier, the phase difference between the clock signals φ1 and φ2 is about 180°.
In other words, the scale section 1 moves at high speed, and the state changes of the signals A and B are almost equal to the 2nd half of the clock signal φ1.
When occurring every clock period, the count pulse G,
H is a pulse signal with a duty ratio of approximately 50%. Therefore, the timing at which signal J is output is
Since it is synchronized with the rising edge of clock signal φ2,
If the time t of the "H" level of the signal J is longer than half the clock cycle, the input of the count pulse G or H will conflict with the time for clearing the up-down counter 5 by the signal J, and as a result, the counting will be delayed. I end up making a mistake. Therefore, in the example,
Time t is set to be shorter than half the clock period.

上述のように、信号Iはラツチ信号、信号Jは
クリア信号となるが、第3図においては、この2
つの信号の出力タイミングは一致していて、ラツ
チ動作とクリア動作が競合するように見えるが、
信号Jはワンシヨツトマルチバイブレータ30を
介して得ているため、実際には、わずかの時間遅
れが生じ、ラツチ回路6のラツチ動作が開始され
た直後にアツプダウンカウンタ5のクリア動作が
行なわれる。
As mentioned above, signal I is a latch signal and signal J is a clear signal, but in FIG.
The output timings of the two signals match, and the latch operation and clear operation appear to be in conflict, but
Since the signal J is obtained via the one-shot multivibrator 30, there is actually a slight time delay, and the up-down counter 5 is cleared immediately after the latch circuit 6 starts latching.

こうして、マイクロコンピユータ7が信号PC
を出力すると、計数データは、ラツチ回路6に保
持される。そして、この保持されたデータを読み
込んで、それまでに計数したデータと累算する。
しかし、この間にアツプダウンカウンタ5は一度
クリアされると共に、計数動作を行なつている。
従つて、信号PCの出力が終了すると、ただちに
ラツチ回路6もアクテイブ状態になり、信号PC
が出力されていた期間に計数されたパルス数を、
ラツチ回路6の出力Q1〜Q4に出力する。
In this way, the microcomputer 7 receives the signal from the PC.
When outputted, the count data is held in the latch circuit 6. Then, this held data is read and accumulated with the data counted up to that point.
However, during this time, the up-down counter 5 is cleared once and is performing a counting operation.
Therefore, as soon as the output of the signal PC ends, the latch circuit 6 also becomes active, and the output of the signal PC becomes active.
The number of pulses counted during the period when was output is
It is output to the outputs Q 1 to Q 4 of the latch circuit 6.

以上のように、マイクロコンピユータ7の読み
込み開始は強制的にカウントパルスのパルスとパ
ルスの間でタイミングを取られ、かつ同時にアツ
プダウンカウンタを一度クリアしているので、カ
ウントパルスは確実に計数されることになる。
As described above, the start of reading by the microcomputer 7 is forcibly timed between the pulses of the count pulses, and at the same time the up-down counter is cleared once, so the count pulses are counted reliably. It turns out.

第4図は、本実施におけるマイクロコンピユー
タ7を上述の如く動作させるための、もつとも簡
単なプログラムのフローチヤートである。先にも
述べたようにマイクロコンピユータは累算器を有
し、通常演算は、この累算器によつて行なわれて
いる。
FIG. 4 is a flowchart of the simplest program for operating the microcomputer 7 in this embodiment as described above. As mentioned above, the microcomputer has an accumulator, and normal operations are performed by this accumulator.

第4図では、この累算器(以下レジスタとす
る)をReg、計数データを入力するポート部を
PD、開始信号PCを出力するポート部をPCとし
て表わす。以下、このフローチヤートを、第3図
のタイミングチヤートに基づいて説明する。この
プログラムのスタート時には、マイクロコンピユ
ータのレジスタRegをリセツトしておく必要があ
る。ここでは0リセツトにしてあるが、特定の値
にリセツトしてもよい。このリセツトのステツプ
40の終了後、アツプダウンカウンタ5の初期クリ
アのステツプ41を行なうが、先に述べたようにク
リア動作は信号PCの出力によつてなされるので、
ポートPCを一度“H”レベルにしてから“L”
レベルにすればよい。これで、エンコーダによる
計測が可能となる。その後、第3図のタイミング
チヤートに示すような信号A,Bがエンコーダか
ら出力されたとする。エンコーダは前述の如く、
正方向に移動して、カウントパルスGを出力す
る。アツプダウンカウンタ5は、第3図中、カウ
ントパルスGを1、2、3……と計数していく。
ところが、マイクロコンピユータ7は、カウント
パルスGの1パルス目の最中に読み込みの開始信
号PCを出力したものとする(第4図中、ステツ
プ42)。すると、1パルス目の終了を待つて、前
述の如くラツチ回路6が働いて、ラツチ回路6の
出力には、計数データ1に対応したバイナリ、又
はBCD形式の出力が保持される。同時にアツプ
ダウンカウンタ5は信号Jによつて0にクリアさ
れる。そして、第4図中、ステツプ43で、ポート
PDに印加され、ラツチされた計数データ1と、
それまでのレジスタRegの内容を加算して、その
結果をレジスタRegにおさめるので、この時点で
レジスタRegの内容は1になる。この演算実行中
にアツプダウンカウンタ5は、次のパルスから計
数を始める。すなわち、カウントパルスGの2パ
ルス目と3パルス目を計数して、出力は2にな
る。ところが、第3図中、時刻Tでエンコーダの
移動方向が変化する。時刻T以降では、カウント
パルスHが出力されるので、アツプダウンカウン
タ5は、4番目のパルスから減算動作を行なう。
従つて4番目のパルスが入力した時点で、アツプ
ダウンカウンタ5の出力は1になる。ステツプ43
の演算が終了して、ステツプ44で、信号PCが
“L”レベルになると、ラツチ回路6はアクテイ
ブ状態になり、その時のアツプダウンカウンタ5
の出力、すなわち1を出力する。その後ステツプ
45で、レジスタRegの内容、すなわち1に相当す
る距離を表示する動作を行なう。ステツプ45が開
始されて、再びステツプ42を実行する間、アツプ
ダウンカウンタ5はカウントパルスHを計数す
る。4番目のパルスが入力した時点で、アツプダ
ウンカウンタ5の出力は1であり、5番目のパル
スの入力により、出力は0になる。さらに6番目
のパルスの入力によつて、アツプダウンカウンタ
5はアンダーフローして、15(すなわち、4ビツ
トで全ビツトが“H”)を出力する。この15は、
2の補数表現された−1を意味する。そこで第3
図には示していないが、6番目のパルスが入力さ
れた後で、再びステツプ42が実行されると、同様
に、ラツチ回路6は、この15を保持し、レジスタ
Regの内容はそれまでの計数データ、ここでは1
と、この15を加算して、0(4ビツトであるから
オーバーフローする。)になる。すなわち、この
時点(6番目のパルス入力時)で、エンコーダの
移動距離は零であることが計測される。
In Figure 4, this accumulator (hereinafter referred to as a register) is designated as Reg, and the port section for inputting count data is designated as Reg.
The port unit that outputs PD and start signal PC is expressed as PC. This flowchart will be explained below based on the timing chart of FIG. When starting this program, it is necessary to reset the register Reg of the microcomputer. Although it is reset to 0 here, it may be reset to a specific value. This reset step
After step 40 is completed, step 41 for initial clearing of the up-down counter 5 is performed, but as mentioned earlier, the clearing operation is performed by the output of the signal PC.
Set the port PC to “H” level once, then “L”
You can set it to the level. Measurement using the encoder is now possible. After that, it is assumed that signals A and B as shown in the timing chart of FIG. 3 are outputted from the encoder. As mentioned above, the encoder is
It moves in the positive direction and outputs a count pulse G. The up-down counter 5 counts the count pulses G as 1, 2, 3, etc. in FIG.
However, it is assumed that the microcomputer 7 outputs the reading start signal PC during the first pulse of the count pulse G (step 42 in FIG. 4). Then, after waiting for the end of the first pulse, the latch circuit 6 operates as described above, and the binary or BCD format output corresponding to the count data 1 is held at the output of the latch circuit 6. At the same time, the up-down counter 5 is cleared to 0 by the signal J. Then, in step 43 in Figure 4, the port
Count data 1 applied to PD and latched;
Since the contents of the register Reg up to that point are added and the result is stored in the register Reg, the contents of the register Reg become 1 at this point. During execution of this calculation, the up-down counter 5 starts counting from the next pulse. That is, the second and third pulses of the count pulse G are counted, and the output is 2. However, at time T in FIG. 3, the direction of movement of the encoder changes. Since the count pulse H is output after time T, the up-down counter 5 performs a subtraction operation starting from the fourth pulse.
Therefore, when the fourth pulse is input, the output of the up-down counter 5 becomes 1. step 43
When the calculation is completed and the signal PC goes to "L" level in step 44, the latch circuit 6 becomes active, and the up-down counter 5 at that time
output, that is, 1. Then step
At step 45, an operation is performed to display the contents of the register Reg, that is, the distance corresponding to 1. Step 45 is started, and while step 42 is executed again, the up-down counter 5 counts the count pulses H. When the fourth pulse is input, the output of the up-down counter 5 is 1, and when the fifth pulse is input, the output becomes 0. Furthermore, upon input of the sixth pulse, the up-down counter 5 underflows and outputs 15 (that is, all 4 bits are "H"). These 15 are
It means -1 expressed in two's complement. Therefore, the third
Although not shown in the figure, when step 42 is executed again after the sixth pulse is input, the latch circuit 6 similarly holds this value 15 and registers it.
The contents of Reg are the counting data up to that point, here 1
Then, add this 15 and get 0 (there will be an overflow since it is 4 bits). That is, at this point (when the sixth pulse is input), the moving distance of the encoder is measured to be zero.

このように、第4図に示したフローチヤートの
如くプログラムを実行することによつて、計測が
行なわれるが、ステツプ42からステツプ45までの
実行時間は、エンコーダの所定の移動速度よりも
速くなるように定められている。すなわち、ステ
ツプ42で読み込みが開始されると、アツプダウン
カウンタ5はクリアされて、再び0から計数を開
始するが、次の読み込みが始まるまでに、アツプ
ダウンカウンタ15が0から1巡以上計数してし
まうと、当然、計数ミスを起こす。従つて、この
場合は実施例に示すアツプダウンカウンタ5、ラ
ツチ回路6を4ビツト以上、例えば8ビツト等の
ものにすればよい。そして、マイクロコンピユー
タ7も8ビツトを直接扱えるものにするか、また
は4ビツトのものでも、8ビツトのラツチ回路の
上位、下位4ビツトを分けて読み込み、プログラ
ムによつて8ビツト相当のデータに変換する等の
処理をすればよい。また、本実施例における2相
クロツク信号は、発振器10により作つている
が、マイクロコンピユータの基準クロツク信号と
兼用できることは言うまでもない。ただし、クロ
ツク信号φ1とφ2の位相差はかならず必要であ
る。又、本実施例では計測のために、マイクロコ
ンピユータを用いたが、単に、計測データを表示
させるだけなら、レジスタに相当する累算器と、
読み込み開始の信号PCを出力する回路とを設け
て、例えばクロツク信号φ1又はφ2の一定パル
ス数毎に、信号PCを発生して、累算器に計数デ
ータを読み込むようにすることもできる。
As described above, measurement is performed by executing the program as shown in the flowchart shown in FIG. 4, but the execution time from step 42 to step 45 is faster than the predetermined moving speed of the encoder. It is defined as follows. That is, when reading starts in step 42, the up-down counter 5 is cleared and starts counting again from 0, but by the time the next reading starts, the up-down counter 15 has counted from 0 more than once. Naturally, this will lead to counting errors. Therefore, in this case, the up-down counter 5 and the latch circuit 6 shown in the embodiment may have 4 bits or more, for example, 8 bits. The microcomputer 7 should either be able to handle 8 bits directly, or if it is 4 bits, the upper and lower 4 bits of the 8 bit latch circuit should be read separately and converted into 8 bit equivalent data using a program. What you need to do is to do something like Further, although the two-phase clock signal in this embodiment is generated by the oscillator 10, it goes without saying that it can also be used as a reference clock signal for a microcomputer. However, a phase difference between the clock signals φ1 and φ2 is always required. Furthermore, although a microcomputer is used for measurement in this embodiment, if the measurement data is simply to be displayed, an accumulator equivalent to a register,
It is also possible to provide a circuit for outputting a reading start signal PC, so that the signal PC is generated every fixed number of pulses of the clock signal φ1 or φ2, and the counted data is read into the accumulator.

尚、第4図に示したプログラムのフローチヤー
トは基本的な動作を説明するための簡単なもので
あり、現実的には、先に述べたような、最大の計
数速度(エンコーダの移動速度)に応じて他の仕
事(演算、処理)を実行させることができる。
Note that the program flowchart shown in Figure 4 is a simple one to explain the basic operation, and in reality, the maximum counting speed (encoder movement speed) as described above Other tasks (calculations, processing) can be performed depending on the situation.

以上のように、本発明による計数装置によれ
ば、割り込み処理を用いずにアツプダウンカウン
タ等の計数手段とラツチ回路等の保持手段を組み
合わせて、計数手段のそれまでの計数データを保
持手段により保持すると共に、計数手段はリセツ
トされて、直ちに次のパルスを計数している。従
つて、エンコーダ等の計測手段からのパルス信号
は確実に計数され、かつ計数手段はデジタル計算
手段が累算を行なつている間であつても計数を続
けているので、計測量が反転しても高速に計数で
きる利点を有する。そのため、特に非接触式であ
る光電式エンコーダに本発明を適用することによ
つて、その高速移動の特徴を十分に活用すること
ができる。
As described above, according to the counting device according to the present invention, counting means such as an up-down counter and holding means such as a latch circuit are combined without using interrupt processing, and the counting data up to that point of the counting means is stored in the holding means. At the same time, the counting means is reset and immediately counts the next pulse. Therefore, pulse signals from measuring means such as encoders are reliably counted, and since the counting means continues counting even while the digital calculating means is performing accumulation, the measured quantity is not reversed. It has the advantage of being able to count at high speed. Therefore, by applying the present invention to a non-contact type photoelectric encoder in particular, its high-speed movement characteristics can be fully utilized.

また、デジタル計算手段としてマイクロコンピ
ユータを用いると、マイクロコンピユータは、計
数データの読み込みに割り込み処理を使わないの
で、他の目的のために割り込み処理を用いること
ができる利点も有する。
Furthermore, when a microcomputer is used as the digital calculation means, the microcomputer does not use interrupt processing to read count data, so it has the advantage that interrupt processing can be used for other purposes.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明の実施例を示すブロツク図で
あり、第1a図は、第1図における検出部2の出
力信号を原理的に示す図であり、第1b図は、第
1a図における出力信号を波形成形した信号を示
す図である。第2図は、第1図に示したブロツク
図における主要ブロツクの回路接続図であり、第
3図は、第2図の回路における各部の信号を示し
たタイミングチヤート図である。第4図は、実施
例で用いたマイクロコンピユータを動作させるた
めのフローチヤート図である。 〔主要部分の符号の説明〕 計測手段……1,
2,3、計数手段……5、保持手段……6、デジ
タル計算手段……7、制御手段……9。
FIG. 1 is a block diagram showing an embodiment of the present invention, FIG. 1a is a diagram showing the output signal of the detection section 2 in FIG. 1 in principle, and FIG. 1b is a diagram showing the output signal of the detection section 2 in FIG. FIG. 3 is a diagram showing a signal obtained by waveform shaping an output signal. 2 is a circuit connection diagram of the main blocks in the block diagram shown in FIG. 1, and FIG. 3 is a timing chart showing signals of various parts in the circuit of FIG. 2. FIG. 4 is a flow chart for operating the microcomputer used in the example. [Explanation of symbols of main parts] Measurement means...1,
2, 3, Counting means...5, Holding means...6, Digital calculation means...7, Control means...9.

Claims (1)

【特許請求の範囲】 1 計測量に応じた数のパルスを出力する計測手
段と、最大計測量に応じたパルス数よりも小なる
数を最大計数値とし、前記計測手段からのパルス
数を計数する計数手段と前記計数手段の計数出力
信号を保持可能な保持手段と、前記計数手段によ
る計数値が最大計数値を越える前に開始信号を出
力し、該出力した後に前記保持手段にて保持され
た計数出力信号の累算を行なうデジタル計算手段
と、前記開始信号に基づいて、前記保持手段に前
記計数手段の計数出力信号を保持せしめると共
に、該保持後でかつ又前記パルス信号が出力され
る前に前記計数出力信号を初期化する如く前記計
数手段をリセツトする制御手段とを含むことを特
徴とする計数装置。 2 前記制御手段は、所定の位相差を有する第1
のクロツク信号と第2のクロツク信号を出力する
発振回路と、前記開始信号の入力後、前記第1の
クロツク信号と前記パルス信号に同期して、前記
パルス信号のパルスとパルスの間で、前記保持手
段を働かせる保持信号と、前記計数手段をリセツ
トするリセツト信号を出力する同期回路とを含む
ことを特徴とする特許請求の範囲第1項記載の装
置。 3 前記計測手段は、光電式のリニアエンコーダ
若しくは、ロータリーエンコーダを含み、該エン
コーダは、所定の位相差を有し、かつ移動量若し
くは回転量に応じたパルス数から成る2つの検出
信号を出力することを特徴とする特許請求の範囲
第2項記載の装置。 4 前記計測手段は、前記検出信号のパルス数に
比例し、かつ前記第2のクロツク信号と同期した
信号を前記パルス信号として発生すると共に、前
記2つの検出信号の位相差から前記エンコーダの
移動方向、若しくは回転方向を判別し、該判別に
従つて、前記パルス信号を択一的に2系列にふり
分けて出力する方向判別パルス回路を含むことを
特徴とする特許請求の範囲第3項記載の装置。 5 前記計数手段は、前記パルス信号のうち一方
の系列のパルス信号により前記計数出力信号を増
加し、前記パルス信号のうち他方の系列のパルス
信号により前記計数出力信号を減少するアツプダ
ウンカウンタであることを特徴とする特許請求の
範囲第4項記載の装置。 6 前記デジタル計算手段は、前記保持手段に保
持された、前記アツプダウンカウンタの計数出力
信号を入力するポート部、該入力ポート部のデジ
タルデータを累算する累算器を含む演算部、前記
開始信号を出力する出力ポート部を含み、前記ポ
ート部、演算部、出力ポート部の動作を、プログ
ラムによつて制御可能なマイクロコンピユータで
あることを特徴とする特許請求の範囲第5項記載
の装置。
[Scope of Claims] 1. A measuring means that outputs a number of pulses corresponding to a measured quantity, and a number smaller than the number of pulses corresponding to the maximum measured quantity as a maximum count value, and counting the number of pulses from the measuring means. a counting means capable of holding a count output signal of the counting means; a holding means capable of holding a count output signal of the counting means; outputting a start signal before a count value by the counting means exceeds a maximum count value; digital calculation means for accumulating the count output signal of the counting means; and based on the start signal, the holding means is made to hold the count output signal of the counting means, and after the holding, the pulse signal is also output. and control means for resetting the counting means so as to initialize the counting output signal beforehand. 2. The control means controls the first
an oscillation circuit that outputs a clock signal and a second clock signal; 2. The apparatus according to claim 1, further comprising a synchronization circuit for outputting a holding signal for activating the holding means and a reset signal for resetting the counting means. 3. The measuring means includes a photoelectric linear encoder or a rotary encoder, and the encoder outputs two detection signals having a predetermined phase difference and consisting of a number of pulses corresponding to the amount of movement or rotation. The device according to claim 2, characterized in that: 4. The measuring means generates a signal as the pulse signal that is proportional to the number of pulses of the detection signal and synchronized with the second clock signal, and determines the moving direction of the encoder from the phase difference between the two detection signals. , or a direction determining pulse circuit that determines the rotational direction and, according to the determination, selectively distributes and outputs the pulse signal into two series. Device. 5. The counting means is an up-down counter that increases the counting output signal by one series of pulse signals among the pulse signals and decreases the counting output signal by the pulse signal of the other series of the pulse signals. 5. The device according to claim 4, characterized in that: 6. The digital calculation means includes a port unit that inputs the count output signal of the up-down counter held in the holding unit, an arithmetic unit that includes an accumulator that accumulates digital data of the input port unit, and the start The device according to claim 5, characterized in that it is a microcomputer that includes an output port unit that outputs a signal, and that can control the operations of the port unit, arithmetic unit, and output port unit by a program. .
JP10369380A 1980-07-30 1980-07-30 Counting device Granted JPS5729911A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10369380A JPS5729911A (en) 1980-07-30 1980-07-30 Counting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10369380A JPS5729911A (en) 1980-07-30 1980-07-30 Counting device

Publications (2)

Publication Number Publication Date
JPS5729911A JPS5729911A (en) 1982-02-18
JPS636804B2 true JPS636804B2 (en) 1988-02-12

Family

ID=14360857

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10369380A Granted JPS5729911A (en) 1980-07-30 1980-07-30 Counting device

Country Status (1)

Country Link
JP (1) JPS5729911A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57169611A (en) * 1981-04-13 1982-10-19 Tokyo Optical Co Ltd Measuring device for angular displacement
US4558304A (en) * 1983-02-24 1985-12-10 Texas Instruments Incorporated Incremental encoder synchronous decode circuit

Also Published As

Publication number Publication date
JPS5729911A (en) 1982-02-18

Similar Documents

Publication Publication Date Title
JP2868266B2 (en) Signal phase difference detection circuit and signal phase difference detection method
CN108535507B (en) Computer storage medium for incremental encoder speed measurement
JPH0430215B2 (en)
JPH01320424A (en) Apparatus for detecting position of mobile machine element
JPS63190425A (en) Counter circuit
US4160154A (en) High speed multiple event timer
JPS636804B2 (en)
JP3173174B2 (en) Speed detector
US5198750A (en) Extremely wide range frequency measurement method
JPH061279B2 (en) Digital speed detector
JPS63253220A (en) Measuring instrument for angle of rotation
JPS61157282A (en) Motor controller
RU2742710C2 (en) Frequency measuring device
JP2719480B2 (en) Multi-rotation position detection device
JP2002311040A (en) Speed detector
JP3903607B2 (en) Pulse count method in pulse input circuit
JPH02298872A (en) Phase measuring circuit
JP2563366B2 (en) Signal cycle measuring device
Li et al. An improved M/T speed algorithm based on RISC-V DSP
JPH0630439B2 (en) Zero crossing point detector for sinusoidal signal
JP2791906B2 (en) Counter device
JP2827446B2 (en) Motor speed detection method
JPH01187462A (en) Detection of average number of revolution of motor
RU1829115C (en) Device for phase automatic frequency control
JPH0340847B2 (en)