JPH063385A - Detection of pulse frequency - Google Patents
Detection of pulse frequencyInfo
- Publication number
- JPH063385A JPH063385A JP18312192A JP18312192A JPH063385A JP H063385 A JPH063385 A JP H063385A JP 18312192 A JP18312192 A JP 18312192A JP 18312192 A JP18312192 A JP 18312192A JP H063385 A JPH063385 A JP H063385A
- Authority
- JP
- Japan
- Prior art keywords
- frequency
- pulse
- dividing circuit
- period
- circuit
- 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.)
- Pending
Links
Landscapes
- Measuring Frequencies, Analyzing Spectra (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は電動機の回転数を検出す
るパルスジェネレータなどの、広範囲にわたり変化する
パルスの周波数を検出する方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting the frequency of a pulse that varies over a wide range, such as a pulse generator for detecting the rotation speed of an electric motor.
【従来の技術】従来、パルスの周波数の検出方法には大
まかには、 1)一定期間の間に入力されるパルスの数を測定する方
法と、 2)パルスの周期を測定する方法とがある。 1)の方法では、周波数が高い領域では高い精度で周波
数を測定できるが、低い周波数に対しては精度が低下し
てしまう。低い周波数を精度よく測定するためには測定
期間を長くしなければならず、検出速度が遅くなる欠点
がある。2)の方法では、低い周波数については高い精
度で測定できるが、高い周波数については精度が下がる
欠点がある。このように、高い周波数から低い周波数ま
でのパルス周波数を精度よく測定することは、上記の何
れか一方の方法ではできないため、上記の二つの方法を
組み合わせる方法が一般に行われている。これらの方法
はマイクロコンピュータ(以下、CPUと記す)の利用
により比較的容易に行えるようになった。例えば、高い
周波数の時は一定期間中に入力されるパルスの数を測定
し、周波数が下がるとパルスの周期を測定するように方
法を切り換える手段がとられる。あるいは、常時、パル
スの入力される時刻とパルス数を測定しておき、パルス
の数と間隔の両方から周波数を求める方法もとられてい
る。2. Description of the Related Art Conventionally, there are roughly two methods for detecting the frequency of a pulse: 1) a method of measuring the number of pulses input during a fixed period, and 2) a method of measuring the pulse period. . According to the method 1), the frequency can be measured with high accuracy in the high frequency region, but the accuracy is deteriorated with respect to the low frequency. In order to accurately measure a low frequency, the measurement period must be lengthened, which has the drawback of slowing the detection speed. The method 2) can measure with high accuracy at low frequencies, but has the drawback of being less accurate at high frequencies. As described above, since it is not possible to accurately measure the pulse frequency from the high frequency to the low frequency by either one of the above methods, a method of combining the above two methods is generally performed. These methods can be relatively easily performed by using a microcomputer (hereinafter referred to as CPU). For example, there is a means for switching the method so that the number of pulses input during a certain period is measured when the frequency is high and the period of the pulse is measured when the frequency decreases. Alternatively, there is a method in which the time at which a pulse is input and the number of pulses are constantly measured and the frequency is obtained from both the number of pulses and the interval.
【0002】以上の方法は、切り換えにともなう問題が
生じたり、演算が複雑になったり、周波数が高くなると
CPUの責務が多くなるなどの欠点があった。従来の周
波数検出方法の一例を図3に示す。図3はそのブロック
図であり、1はパルス発生源、3はパルスカウンター、
4は時計部、5は周波数算出部を示し、パルスカウンタ
ー3、時計部4、周波数算出部5は、CPUがこれらの
機能を果たすことが多い。6はCPUを示す。パルス発
生源1からのパルスにより、パルスカウンター3はアッ
プ、またはダウンカウントする。また、時計部4は、最
新のパルスが入った時刻を出力している。図4は、図3
の周波数検出方法の原理を示す波形図であり、1)はパ
ルス発生源の波形である。この波形の立ち上がり(また
は 立ち下がり、あるいは その両方の)エッジをパル
スカウンタ3は計数する。同時に、時計部4はその時点
の時刻を出力する。図中、N、N+1,・・・はパルス
カウンタ3の出力値を示し、Tn,Tn+1、・・・は
時計部4の出力値を示す。2)は周波数算出部5が演算
動作を行う時点を示す。同図の、T0、T1の時点で演
算を行う場合について説明する。時刻T0にて、周波数
算出部5は その時点でのパルスカウンタ3の出力値N
と時計部4の出力値Tnとを読み込み、周波数算出演算
を行う。また、NとTnは次回の演算の為に記憶され
る。次の演算動作を行う時点T1になると、周波数算出
部5は 再び、その時点でのパルスカウンタ3の出力値
N+mと時計部4の出力値Tn+mとを読み込み、周波
数算出演算を行う。この時点では周波数算出部5は 前
回T0の時点のパルスカウンタ3及び時計部の出力値N
及びTnと今回T1での出力値 N+m、Tn+mを持
っており、次式により 1パルスの周期Tpを算出する
ことができる。 Tp=(Tn+m−Tn)/(N+m−N) 従って、周波数は周期の逆数として、1/Tpから求め
られる。The above methods have drawbacks such as problems associated with switching, complicated arithmetic operations, and increased responsibility of the CPU at higher frequencies. An example of a conventional frequency detection method is shown in FIG. FIG. 3 is a block diagram thereof, 1 is a pulse generator, 3 is a pulse counter,
Reference numeral 4 denotes a clock unit, 5 denotes a frequency calculation unit, and in the pulse counter 3, the clock unit 4, and the frequency calculation unit 5, the CPU often performs these functions. Reference numeral 6 represents a CPU. The pulse counter 3 counts up or down by the pulse from the pulse generation source 1. Further, the clock unit 4 outputs the time when the latest pulse is input. FIG. 4 shows FIG.
FIG. 3 is a waveform diagram showing the principle of the frequency detection method of 1), and 1) is the waveform of the pulse generation source. The pulse counter 3 counts the rising (or falling, or both) edges of this waveform. At the same time, the clock unit 4 outputs the time at that time. In the figure, N, N + 1, ... Show the output values of the pulse counter 3, and Tn, Tn + 1 ,. 2) indicates the time point when the frequency calculation unit 5 performs a calculation operation. A case where the calculation is performed at the time points T0 and T1 in the figure will be described. At time T0, the frequency calculator 5 outputs the output value N of the pulse counter 3 at that time.
And the output value Tn of the clock unit 4 are read, and frequency calculation calculation is performed. Also, N and Tn are stored for the next calculation. At time T1 when the next arithmetic operation is performed, the frequency calculation unit 5 again reads the output value N + m of the pulse counter 3 and the output value Tn + m of the clock unit 4 at that time and performs the frequency calculation operation. At this time, the frequency calculation unit 5 determines that the output value N of the pulse counter 3 and the clock unit at the previous time T0.
And Tn and the output values N + m and Tn + m at this time T1, and the period Tp of one pulse can be calculated by the following equation. Tp = (Tn + m-Tn) / (N + m-N) Therefore, the frequency is obtained from 1 / Tp as the reciprocal of the period.
【0003】[0003]
【発明が解決しようとする課題】しかしながら、従来の
方法には次のような欠点がある。周波数算出演算の為に
は、前回T0及び今回T1の時点の直前のパルスに対す
る時刻とカウンタの出力がわかっていればよいのである
が、予定の時点で速やかに演算を行うためには、時計部
によりT0とT1のあいだの期間に来るすべてのパルス
について一旦時刻を記憶しておく必要がある。 このこ
とは、パルスの周波数が高くなるにつれ、CPUが行わ
なければならない責務が増大することを意味する。従っ
て、測定できる周波数の上限が低くなる欠点がある。高
い周波数を測定するためには、パルス発生源1の出力側
に分周器を設ける方法があるが、その場合には、パルス
の周波数が低くなったときにカウンタ3及び時計部4に
入るパルスの周期が長くなるため低い周波数に対する検
出速度が遅くなってしまう。本発明は上述した点に鑑み
て創案されたもので、その目的とするところは、かよう
な欠点を解消したパルス周波数検出方法を提供すること
にある。However, the conventional method has the following drawbacks. For the frequency calculation calculation, it is sufficient to know the time and the output of the counter for the pulse immediately before the time T0 of this time and the time T1 this time, but in order to perform the calculation promptly at the scheduled time, the clock unit Therefore, it is necessary to store the time once for all the pulses that come in the period between T0 and T1. This means that as the frequency of the pulse increases, so does the CPU's duty to do. Therefore, there is a drawback that the upper limit of the measurable frequency becomes low. In order to measure a high frequency, there is a method of providing a frequency divider on the output side of the pulse generation source 1. In that case, when the frequency of the pulse becomes low, the pulse entering the counter 3 and the clock unit 4 Therefore, the detection speed for low frequencies becomes slow because the cycle becomes longer. The present invention was devised in view of the above-mentioned points, and an object of the present invention is to provide a pulse frequency detection method that eliminates such drawbacks.
【0004】[0004]
【課題が解決しようとする手段】つまり、その目的を達
成するための手段は、分周比をCPUにて自由に変える
ことができる分周回路を設け、該分周回路の出力パルス
の周期を測定する周期算出部と、前記分周回路の分周比
を自由に変えることができる分周比設定部と、周波数算
出部を有し、分周回路の出力パルスの周期がほぼ一定と
なるように分周回路の分周比を設定するようにし、周波
数算出部により、該分周比設定部により設定された分周
比と前記周期演算部の出力から周波数を算出する方法で
ある。That is, the means for achieving the object is to provide a frequency dividing circuit whose frequency dividing ratio can be freely changed by the CPU, and to set the cycle of the output pulse of the frequency dividing circuit. It has a period calculator for measurement, a divider ratio setting unit that can freely change the divider ratio of the divider circuit, and a frequency calculator so that the period of the output pulse of the divider circuit becomes almost constant. In this method, the frequency division ratio of the frequency division circuit is set, and the frequency calculation unit calculates the frequency from the frequency division ratio set by the frequency division ratio setting unit and the output of the period calculation unit.
【0005】[0005]
【作用】以上のように構成することにより、CPUへは
実際のパルス周波数の高低によらないほぼ一定間隔のパ
ルスが入力される為、CPUの責務はパルス周波数に因
らずにほぼ一定となる。しかも、パルス周波数が高い場
合にもCPUの責務が増えないばかりか、パルス周波数
が低い場合にもCPUにとっては同じ周波数のパルスが
入力されているのでパルス周波数の検出速度はパルス周
波数が高い場合と同じ速度である。さらに、高いパルス
周波数から低いパルス周波数まで、広い範囲について同
じ精度で周波数を求めることができる。以下、本発明の
一実施例を図面を参照して詳述する。With the above-described structure, the CPU is supplied with pulses at substantially constant intervals irrespective of the actual pulse frequency. Therefore, the CPU's duty becomes almost constant regardless of the pulse frequency. . Moreover, the duty of the CPU does not increase even when the pulse frequency is high, and the pulse of the same frequency is input to the CPU even when the pulse frequency is low. Same speed. Further, the frequency can be obtained with the same accuracy in a wide range from a high pulse frequency to a low pulse frequency. An embodiment of the present invention will be described below in detail with reference to the drawings.
【0006】[0006]
【実施例】図1は本発明の一実施例を示すブロック図、
図2はその波形図であり、図中、1は、パルス発生源、
2は分周回路、40は周期算出部、50は周波数算出
部、7は分周比設定部、60はCPUである。図1にお
いては、CPUが周期算出部40、周波数算出部50、
分周比設定部60の機能を果たす場合を示している。分
周回路2は、その分周比を自由に変えることができるも
のである。周期算出部40は、分周回路2が出力した最
新の2個のパルスの間隔を算出する。分周比設定部7
は、周期算出部40の出力から分周回路2の出力パルス
の間隔が予定値より大きい場合には分周回路2の分周比
を小さくなるように変更し、その間隔が予定値より小さ
い場合には分周回路2の分周比を大きくするように変更
する。図2中、1)はパルス発生源1の出力波形を示
す。また、波形の上に示した、0、1、2・・・は分周
回路2の計数値を示す。2)は、分周回路2の出力波形
を示し、3)は、周波数算出部50が演算を行う時点を
示す。図2により、本発明による周波数検出方法の動作
を説明する。なお、図2は、分周回路2の分周比を”
N”に設定している場合の動作を示している。時刻Tm
ー1にて、分周回路2はその計数値が分周比の値に達し
たため、該計数値がリセットされると共にパルス出力を
発生する。周期算出部40は、該パルス出力が発生する
と同時に、図示されていないそれ以前の最新のパルスと
の間隔Tpm−1を算出する。FIG. 1 is a block diagram showing an embodiment of the present invention,
FIG. 2 is a waveform diagram thereof, in which 1 is a pulse generation source,
Reference numeral 2 is a frequency dividing circuit, 40 is a period calculating unit, 50 is a frequency calculating unit, 7 is a frequency dividing ratio setting unit, and 60 is a CPU. In FIG. 1, the CPU includes a cycle calculation unit 40, a frequency calculation unit 50,
The case where the function of the division ratio setting unit 60 is fulfilled is shown. The frequency dividing circuit 2 can freely change the frequency dividing ratio. The cycle calculator 40 calculates the interval between the latest two pulses output from the frequency dividing circuit 2. Frequency division ratio setting section 7
Changes the frequency division ratio of the frequency dividing circuit 2 to be smaller when the interval of the output pulse of the frequency dividing circuit 2 from the output of the cycle calculating unit 40 is larger than the predetermined value. Is changed so that the frequency division ratio of the frequency dividing circuit 2 is increased. In FIG. 2, 1) shows the output waveform of the pulse generator 1. Further, 0, 1, 2, ... Shown on the waveform indicate the count value of the frequency dividing circuit 2. 2) shows an output waveform of the frequency dividing circuit 2, and 3) shows a time point when the frequency calculating section 50 performs a calculation. The operation of the frequency detection method according to the present invention will be described with reference to FIG. It should be noted that FIG. 2 shows the frequency division ratio of the frequency dividing circuit 2.
It shows the operation when it is set to N ″. Time Tm
In -1, the frequency divider circuit 2 resets the count value because the count value has reached the value of the frequency division ratio, and generates a pulse output. At the same time that the pulse output is generated, the period calculation unit 40 calculates the interval Tpm-1 from the latest pulse (not shown) before that.
【0007】周期算出部40は該パルス出力の発生時刻
Tmー1を記憶しており、同様に時刻Tmにて分周回路
2がパルスを発生すると (Tm ー Tm−1)によ
り最新のパルス間隔Tpmを算出する。 分周比設定部
7は、該パルス間隔Tpmが予定値より長い場合には分
周回路2の分周比を小さくするように変更する。また、
該パルス間隔Tpmが予定値より短い場合には分周回路
2の分周比を大きくように変更する。つまり、分周比設
定部40は分周回路2の出力がほぼ予定値となるように
分周回路2の分周比を設定する。時刻T1にて周波数算
出部が動作し、パルス発生源の出力パルスの周期は Tp=Tpm/N により求められ、さらに、周波数は 1 / Tp により求められる。 以上のような動作では、CPUは予め予定された周期で
発生するパルスの間隔を測定し、その結果に応じて分周
回路の分周比を設定する動作を行う。したがって、パル
ス発生源の周波数の高低に拘らず、ほぼ一定の責務を果
たせば良いことになる。しかも、この方法に因れば、周
波数の高低の影響はすべて分周回路が吸収するため、非
常に広い範囲のパルス周波数を同じ精度で測定すること
ができる。The period calculation unit 40 stores the time Tm-1 at which the pulse output is generated. Similarly, when the frequency dividing circuit 2 generates a pulse at time Tm, the latest pulse interval is obtained by (Tm-Tm-1). Calculate Tpm. The frequency division ratio setting unit 7 changes the frequency division ratio of the frequency dividing circuit 2 to be small when the pulse interval Tpm is longer than a predetermined value. Also,
When the pulse interval Tpm is shorter than the expected value, the frequency division ratio of the frequency dividing circuit 2 is changed to be large. In other words, the frequency division ratio setting unit 40 sets the frequency division ratio of the frequency division circuit 2 so that the output of the frequency division circuit 2 becomes approximately the planned value. At time T1, the frequency calculation unit operates, the cycle of the output pulse of the pulse generation source is calculated by Tp = Tpm / N, and the frequency is calculated by 1 / Tp. In the above-described operation, the CPU measures the pulse interval generated in a predetermined cycle, and sets the frequency division ratio of the frequency dividing circuit according to the result. Therefore, regardless of the frequency of the pulse generation source, it suffices to fulfill almost a fixed duty. Moreover, according to this method, the frequency dividing circuit absorbs all the influences of high and low frequencies, so that a very wide range of pulse frequencies can be measured with the same accuracy.
【0007】[0007]
【発明の効果】以上説明したように本発明によれば、C
PUの責務を軽く、しかもパルス周波数に拘らず一定に
できるため、CPUを有効に使用できると共に、広い範
囲のパルス周波数について測定精度が極めて一定した検
出を行うことができる。なお、本実施例では、分周回路
2をCPUの外部に設ける場合について説明したが、プ
リセット付きカウンタや、プリスケーラ付きのカウンタ
を有するCPUを使用する場合などには、分周回路2も
CPUの動作に組み込める。つまり、分周回路2、周期
算出部40、分周比設定部7と周波数算出部50の機能
が本発明の主旨であり、その形態を問うものではない。As described above, according to the present invention, C
Since the responsibility of the PU is light and can be kept constant regardless of the pulse frequency, the CPU can be effectively used and detection of a wide range of pulse frequencies with extremely constant measurement accuracy can be performed. In this embodiment, the case where the frequency dividing circuit 2 is provided outside the CPU has been described. However, when using a CPU having a counter with a preset or a counter with a prescaler, the frequency dividing circuit 2 is also included in the CPU. Can be incorporated into motion. That is, the functions of the frequency dividing circuit 2, the period calculating unit 40, the frequency dividing ratio setting unit 7, and the frequency calculating unit 50 are the gist of the present invention, and their forms are not important.
【0008】[0008]
【図1】図1は本発明の一実施例を示すブロック図であ
る。FIG. 1 is a block diagram showing an embodiment of the present invention.
【図2】図2はその波形図である。FIG. 2 is a waveform diagram thereof.
【図3】図3は従来の一例を示すブロック図である。FIG. 3 is a block diagram showing a conventional example.
【図4】図4はその波形図である。FIG. 4 is a waveform diagram thereof.
【0009】[0009]
1 パルス発生源 2 分周回路 7 分周比設定器 40 周期算出部 50 周波数算出部 60 CPU 1 pulse generation source 2 frequency divider circuit 7 frequency division ratio setter 40 cycle calculator 50 frequency calculator 60 CPU
Claims (1)
を任意に指定する分周回路と、該分周回路の出力パルス
の周期を測定する周期算出部と、前記分周回路の分周比
を自由に変える分周比設定部と、周波数算出部とを有
し、前記分周回路の出力パルスの周期がほぼ一定となる
ように分周回路の分周比を変化させるようにしたことを
特徴とするパルス周波数検出方法。1. In a pulse frequency detection circuit, a frequency dividing circuit for arbitrarily designating a frequency dividing ratio, a period calculating section for measuring a period of an output pulse of the frequency dividing circuit, and a frequency dividing ratio for the frequency dividing circuit are provided. A frequency division ratio setting unit that freely changes and a frequency calculation unit are provided, and the frequency division ratio of the frequency division circuit is changed so that the cycle of the output pulse of the frequency division circuit is substantially constant. And pulse frequency detection method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18312192A JPH063385A (en) | 1992-06-17 | 1992-06-17 | Detection of pulse frequency |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18312192A JPH063385A (en) | 1992-06-17 | 1992-06-17 | Detection of pulse frequency |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH063385A true JPH063385A (en) | 1994-01-11 |
Family
ID=16130162
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP18312192A Pending JPH063385A (en) | 1992-06-17 | 1992-06-17 | Detection of pulse frequency |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH063385A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007010593A (en) * | 2005-07-04 | 2007-01-18 | Yokogawa Electric Corp | Frequency measurement circuit and vibration sensor type differential pressure / pressure transmitter using the same |
| JP2017026603A (en) * | 2015-06-30 | 2017-02-02 | テクトロニクス・インコーポレイテッドTektronix,Inc. | Test measurement apparatus and prescale method |
| JP2023169786A (en) * | 2022-05-17 | 2023-11-30 | 横河電機株式会社 | Trigger generation circuit and waveform measurement device |
-
1992
- 1992-06-17 JP JP18312192A patent/JPH063385A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007010593A (en) * | 2005-07-04 | 2007-01-18 | Yokogawa Electric Corp | Frequency measurement circuit and vibration sensor type differential pressure / pressure transmitter using the same |
| JP2017026603A (en) * | 2015-06-30 | 2017-02-02 | テクトロニクス・インコーポレイテッドTektronix,Inc. | Test measurement apparatus and prescale method |
| JP2023169786A (en) * | 2022-05-17 | 2023-11-30 | 横河電機株式会社 | Trigger generation circuit and waveform measurement device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4503374A (en) | Speed detection apparatus and method | |
| US5233292A (en) | Speed detector device for elevator | |
| JPH063385A (en) | Detection of pulse frequency | |
| KR19980033797A (en) | Speed detection device using encoder in motor and its method | |
| JPH04233467A (en) | Method and apparatus for measuring speed of motor | |
| JPH01304360A (en) | Method for detecting speed of motor | |
| JPH0460468A (en) | Pulse position measuring type instrument drive circuit | |
| JPS61254863A (en) | Method for calculating velocity | |
| KR940004394B1 (en) | Motor speed measuring method and device | |
| JP3031970B2 (en) | Filter circuit | |
| JPH08140383A (en) | Controller for servo motor | |
| JPH0839298A (en) | Slide stop time measuring instrument of press machine | |
| JPH02110379A (en) | Motor-speed detecting apparatus | |
| JPS6319831B2 (en) | ||
| JPH0340847B2 (en) | ||
| JP2568121Y2 (en) | Average value period measurement device | |
| KR101806695B1 (en) | Method for improving position precision of motor | |
| SU1663424A1 (en) | Non-electric quantity measuring device | |
| JPH03113378A (en) | Driving method for indicating instrument | |
| JP2005009916A (en) | Frequency measuring device | |
| SU684447A1 (en) | Shaft rotational speed measuring device | |
| SU763797A1 (en) | Digital measuring instrument for determining relative velocity difference | |
| JPS6157581B2 (en) | ||
| JPH07154990A (en) | Motor speed controller | |
| SU1520589A1 (en) | Device for monitoring instability of rotary speed of magnetic disk of storage |