JPS63179260A - Speed detecting method - Google Patents
Speed detecting methodInfo
- Publication number
- JPS63179260A JPS63179260A JP903687A JP903687A JPS63179260A JP S63179260 A JPS63179260 A JP S63179260A JP 903687 A JP903687 A JP 903687A JP 903687 A JP903687 A JP 903687A JP S63179260 A JPS63179260 A JP S63179260A
- Authority
- JP
- Japan
- Prior art keywords
- pulse
- pulses
- positive
- reverse
- incremental
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title description 5
- 238000001514 detection method Methods 0.000 claims description 11
- 238000012937 correction Methods 0.000 abstract description 5
- 230000003247 decreasing effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000007796 conventional method Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、モータと同軸的に配設されたロータリーエン
コーダの出力より回転体の速度を検出する方法に関する
。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method of detecting the speed of a rotating body from the output of a rotary encoder disposed coaxially with a motor.
(従来の技術)
第2図はこの種の速度検出方法により速度検出を行なう
装置のブロック図、第3図(a) 、 (b)はそれぞ
れ正転時と逆転時における第2図のタイムチャート、第
4図は速度検出方法を説明するためのタイムチャートで
ある。(Prior art) Figure 2 is a block diagram of a device that detects speed using this type of speed detection method, and Figures 3 (a) and (b) are time charts of Figure 2 during forward rotation and reverse rotation, respectively. , FIG. 4 is a time chart for explaining the speed detection method.
回転体11の回転により位相差を持つA相信号SAとB
相信号SRがロータリーエンコーダ12より出力される
。パルス発生回路13は、A相信号SA、B相信号SB
の位相関係により第3図(a)のように正転時はA相信
号SAの立上りで正パルスAPを出力し、逆転時には、
第3図(b)のようにA相信号SAの立下りで逆パルス
BPを出力する。この正パルスAPと逆パルスBPは次
段の正側カウンタ14と逆側カウンタ15でそれぞれア
ップカウントされる。同時に論理和回路17による正パ
ルスPAと逆パルスPBの論理和でTタイマ16はリセ
ットされる。Tタイマ16はリセットされることでカウ
ント値が0となり、リセット解除後に再び時間を計数し
、次のリセットまでアップカウント動作を行う。マイク
ロコンピュータ18は、予め定められた時間毎に正側カ
ウンタ14と逆側カウンタ15とTタイマの値を読込み
、速度f (Hz)を次式のように算出する。第4図中
の「Δ」は、マイクロコンピュータ18のカウンタ14
.15とTタイマ16の読込み時点である。A-phase signals SA and B that have a phase difference due to the rotation of the rotating body 11
A phase signal SR is output from the rotary encoder 12. The pulse generation circuit 13 generates an A-phase signal SA and a B-phase signal SB.
Due to the phase relationship, as shown in Figure 3 (a), during forward rotation, a positive pulse AP is output at the rising edge of the A-phase signal SA, and during reverse rotation,
As shown in FIG. 3(b), a reverse pulse BP is output at the falling edge of the A-phase signal SA. The positive pulse AP and reverse pulse BP are up-counted by a positive counter 14 and a reverse counter 15 at the next stage, respectively. At the same time, the T timer 16 is reset by the logical sum of the positive pulse PA and the reverse pulse PB by the logical sum circuit 17. When the T timer 16 is reset, the count value becomes 0, and after the reset is released, the T timer 16 counts the time again and performs an up-count operation until the next reset. The microcomputer 18 reads the values of the forward counter 14, reverse counter 15, and T timer at predetermined intervals, and calculates the speed f (Hz) as shown in the following equation. "Δ" in FIG. 4 is the counter 14 of the microcomputer 18.
.. 15 and T timer 16 are read.
f =((NP、。NP、。−1) (−NRnNR
n−+)) /(T+ T、−1−Tn) = ΔN
/T。f = ((NP, .NP, .-1) (-NRnNR
n-+)) / (T+ T, -1-Tn) = ΔN
/T.
ここで、f :速度(、z)
NF、n :今回の正側カウンタ14のカウント値N
P、。−1:前回の正側カウンタ14のカウント値NR
,n :今回の逆側カウンタ15のカウント値NR,
n−1:前回の逆側カウンタ15のカウント値To:パ
ルスの発生からマイクロコン
ピュータ18の読込時間(今回値)
Tn−1:同上(前回値)
ΔN =前回読込から今回読込までにカウントされた増
分パルス数(正パルスを
+とする。)
T、 : T、、時点に出力されたパルスAP。Here, f: Speed (,z) NF, n: Current count value N of the positive side counter 14
P. -1: Previous count value NR of positive side counter 14
, n: current count value NR of the opposite side counter 15,
n-1: Previous count value of the opposite side counter 15 To: Reading time of the microcomputer 18 from generation of pulse (current value) Tn-1: Same as above (previous value) ΔN = Counted from previous reading to current reading Incremental pulse number (positive pulse is +) T: Pulse AP output at time T.
からTn時点に出力されたパルス
APN、、までの時間
T 二マイクロコンピュータ18の前回のTタイマ1
6、カウンタ14.15の読込み点から今回のTタイマ
16、カウンタ
14.15の読込み点までの時間
〔発明が解決しようとする問題点〕
上述した従来の方法では、第5図のような場合を考える
と前回増分パルスΔNn −1が正で、今回増分パルス
数ΔNnが−1となるときはT、α0となるために、速
度1f+が現実の速度より非常に大きくなる。これは、
正パルスAP’ と逆パルスBP’ はパルスとしては
異った時間であられれるが、位置信号としては同じ位置
をあられすので、この両パルス間を通過する時間を用い
て速度検出はできないためである。The time T from the pulse APN outputted at time Tn, , to the previous T timer 1 of the second microcomputer 18
6. Time from the reading point of the counter 14.15 to the current reading point of the T timer 16 and the counter 14.15 [Problem to be solved by the invention] In the conventional method described above, the case shown in FIG. Considering that, when the previous incremental pulse ΔNn -1 is positive and the current incremental pulse number ΔNn is -1, T, α0, and therefore the speed 1f+ becomes much larger than the actual speed. this is,
This is because although the forward pulse AP' and the reverse pulse BP' occur at different times as pulses, they occur at the same position as position signals, so speed cannot be detected using the time passing between these two pulses. be.
以上のことは、前回増分パルス数ΔNn−1が負で今回
増分パルスΔN、、が+1でも起るのは言うまでもない
。Needless to say, the above occurs even if the previous incremental pulse number ΔNn-1 is negative and the current incremental pulse ΔN, . . . is +1.
従来の対策としては、増分パルスΔNの符号が変化した
ときは、速度fを強制的にOにしていた。しかしながら
、この方法では、第6図のような場合を考えると、増分
パルス数ΔNが正から負となっているので、速度fは正
しく計算されるにもかかわらず、0となってしまう。As a conventional measure, when the sign of the incremental pulse ΔN changes, the speed f is forcibly set to O. However, in this method, considering the case shown in FIG. 6, since the incremental pulse number ΔN changes from positive to negative, the speed f becomes 0 even though it is calculated correctly.
本発明の目的は、増分パルス数ΔNの符号が変化しても
正しく速度を検出する速度検出方法を提供することであ
る。An object of the present invention is to provide a speed detection method that correctly detects speed even if the sign of the incremental pulse number ΔN changes.
本発明の速度検出方法は、増分パルス数の符号が正から
負と変化したときは増分パルス数に1を加える補正を行
い、増分パルス数が負から正へと変化したときは、増分
パルス数から1を減算する補正を行うものである。In the speed detection method of the present invention, when the sign of the number of incremental pulses changes from positive to negative, the number of incremental pulses is corrected by adding 1, and when the number of incremental pulses changes from negative to positive, the number of incremental pulses is This is a correction that subtracts 1 from .
以上のような補正を行うと、例えば第5図のような場合
には、増分パルス数の符号が正から負と変化したので、
f−(−1+1)/T+−0となり、速度fが大きくな
ることはない。また、第6図のような場合にも、f−(
1−3+1)/Tl−17T+となり、正しい速度検出
が可能となる。なお、第5図において増分パルス数の符
号の変化が負から正の場合にはf−(1−1)/TI−
0となる。When the above correction is performed, for example in the case shown in Figure 5, the sign of the incremental pulse number changes from positive to negative.
f-(-1+1)/T+-0, and the speed f never increases. Also, in the case as shown in Fig. 6, f-(
1-3+1)/Tl-17T+, and accurate speed detection becomes possible. In addition, in FIG. 5, when the sign of the incremental pulse number changes from negative to positive, f-(1-1)/TI-
It becomes 0.
このように、増分パルス数の符号が変化したとき、増分
パルス数に符号の変化に応じて上述した補正を加えるこ
とで速度の検出を正しく行なうことができる。In this way, when the sign of the number of incremental pulses changes, the speed can be detected correctly by applying the above-described correction to the number of incremental pulses according to the change in sign.
(実施例)
次に、本発明の実施例について図面を参照して説明する
。(Example) Next, an example of the present invention will be described with reference to the drawings.
第1図は本発明の速度検出方法の一実施例を示すフロー
チャートである。なお、装置図として第2図を使用する
。FIG. 1 is a flowchart showing an embodiment of the speed detection method of the present invention. Note that FIG. 2 is used as a diagram of the apparatus.
本処理は、マイクロコンピュータ18を用いて予め定め
られた時間毎に、実行されるものとする。It is assumed that this process is executed using the microcomputer 18 at predetermined intervals.
まず、正側カウンタ14、逆側カウンタ15、Tタイマ
16の今回値N、、n、 NR9゜、Tnを読込む(ス
テップ1)。正側増分パルス数(NF、。−NP、。−
1)から逆側増分パルス数(NR,n−NR,n−1)
を減算し、これをΔNとする(ステップ2)。増分パル
ス数ΔN=Oかどうか判定しくステップ3)、ΔN二〇
ならば速度検出を行わず、処理を終える。First, the current values N, , n, NR9°, and Tn of the forward counter 14, reverse counter 15, and T timer 16 are read (step 1). Positive side incremental pulse number (NF, .-NP, .-
1) to the opposite side incremental pulse number (NR, n-NR, n-1)
is subtracted and set as ΔN (step 2). It is determined whether the number of incremental pulses ΔN=O or not (step 3). If ΔN is 20, no speed detection is performed and the process ends.
ΔN≠0ならばこのΔNを今回の増分パルス数ΔNnに
セットし、今回値NF、。、NR,nをそれぞれ前回値
NF、 n−1+ NR,n−1とする(ステップ4)
。次に、前回と今回の増分パルス数ΔNn、ΔNn−1
の符号の変化を判定しくステップ5)、符号の変化がな
ければ、増分パルス数ΔNr、をΔNn゛ とし、符号
の変化があれば、増分パルス数ΔNnの符号の判定(ス
テップ6)へ進み、ΔNn>0の場合には、ΔN、から
1だけ減算を行い、ΔNn° としくステップ8)、Δ
N、< 0の場合には、ΔN、、に1だけ加算を行い、
ΔNn′ とする(ステップ9)。そして、最後に速度
演算を行い、Fにセットし、増分パルス数ΔNn8時間
Tnを次回の計算のためにそれぞれΔNn−1+ Tn
−1にセーブする(ステップ10)。If ΔN≠0, this ΔN is set as the current incremental pulse number ΔNn, and the current value NF. , NR, and n are the previous values NF, n-1+ NR, n-1, respectively (Step 4)
. Next, the incremental number of pulses ΔNn, ΔNn−1 between the previous time and this time
If there is no change in sign, the number of incremental pulses ΔNr is set to ΔNn゛; if there is a change in sign, proceed to determination of the sign of the number of incremental pulses ΔNn (step 6); If ΔNn>0, subtract 1 from ΔN to obtain ΔNn°. Step 8), Δ
If N, < 0, add 1 to ΔN,
ΔNn' (step 9). Finally, calculate the speed, set it to F, and set the incremental pulse number ΔNn8 time Tn as ΔNn-1+Tn for the next calculation.
-1 (step 10).
(発明の効果)
以上説明したように本発明は、増分パルス数の符号が変
化したとき、増分パルス数に、符号の変化に応じて1ま
たは−1を加える補正を行なうことにより、増分パルス
数の符号が変化しても正しく速度を検出できる効果があ
る。(Effects of the Invention) As explained above, the present invention, when the sign of the number of incremental pulses changes, adds 1 or -1 to the number of incremental pulses according to the change in sign, thereby increasing the number of incremental pulses. This has the effect that the speed can be detected correctly even if the sign of changes.
第1図は本発明の速度検出方法の一実施例を示すフロー
チャート、第2図はロータリーエンコーダの出力から回
転体の速度を検出する装置のブロック図、第3図(a)
、 (b)はそれぞれ正転時と逆転時の第2図の装置
のタイムチャート、第4図は速度検出方法を説明するた
めのタイムチャート、第5図、第6図は従来の問題点を
説明するタイムチャートである。
1〜10 −・・ ステップ、 11 ・・・ 回転
体、12 ・・・ ロータリーエンコーダ、13
・・・ パルス発生回路、
14 ・・・ 正側カウンタ、
15 ・・・ 逆側カウンタ、 !6 ・−Tタイマ
、17・・・ 論理和回路、
18 ・・・ マイクロコンピュータ。FIG. 1 is a flowchart showing an embodiment of the speed detection method of the present invention, FIG. 2 is a block diagram of a device for detecting the speed of a rotating body from the output of a rotary encoder, and FIG. 3(a)
, (b) is a time chart of the device shown in Fig. 2 during forward rotation and reverse rotation, respectively, Fig. 4 is a time chart for explaining the speed detection method, and Figs. 5 and 6 show problems with the conventional system. This is a time chart for explanation. 1 to 10 - Step, 11 Rotating body, 12 Rotary encoder, 13
... Pulse generation circuit, 14 ... Positive side counter, 15 ... Reverse side counter, ! 6.-T timer, 17.. OR circuit, 18.. microcomputer.
Claims (1)
るロータリーエンコーダと、これら2相信号から回転体
の正転中には正パルスを、逆転中には逆パルスを発生す
るパルス発生回路と、正パルス、逆パルスをそれぞれカ
ウントする正側カウンタおよび逆側カウンタと、正パル
スと逆パルスの論理和でリセットされ、次にリセットさ
れるまでアップカウント動作を行なうタイマと、正側カ
ウンタと逆側カウンタとタイマの値を読込み、前回読込
から今回読込までの増分パルス数={(今回の正側カウ
ンタのカウント値−前回の正側カウンタのカウント値)
−(今回の逆側カウンタのカウント値−前回の逆側カウ
ンタのカウント値)}と、前回読込時の直前に出力され
た正パルスまたは逆パルスから今回読込時の直前に出力
された正パルスまたは逆パルスまでの時間を求めて回転
体の速度演算を行なう演算回路とを有する速度検出装置
において、 増分パルス数の符号が正から負へと転じた時は、増分パ
ルス数に1を加える補正を行ない、負から正へと転じた
時は、増分パルス数に−1を加える補正を行なう速度検
出方法。[Claims] A rotary encoder that outputs two-phase signals having a phase difference as the rotating body rotates, and a rotary encoder that outputs two-phase signals having a phase difference as the rotating body rotates, and from these two-phase signals, outputs a forward pulse when the rotating body is rotating in the forward direction and a reverse pulse when the rotating body is rotating in the reverse direction. A pulse generation circuit that generates , a forward counter and a reverse counter that count forward and reverse pulses, respectively, and a timer that is reset by the logical sum of the forward and reverse pulses and performs an up-count operation until the next reset. Then, read the values of the positive counter, reverse counter, and timer, and calculate the incremental number of pulses from the previous reading to this reading = {(current positive counter count value - previous positive counter count value)
- (count value of the current reverse side counter - count value of the previous reverse side counter)} and the positive pulse or reverse pulse output immediately before the current reading from the positive pulse or reverse pulse output immediately before the previous reading. In a speed detection device that has an arithmetic circuit that calculates the speed of the rotating body by determining the time until the reverse pulse, when the sign of the number of incremental pulses changes from positive to negative, the number of incremental pulses must be corrected by adding 1. A speed detection method that corrects the incremental pulse number by adding -1 when it changes from negative to positive.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP903687A JPH0726972B2 (en) | 1987-01-20 | 1987-01-20 | Speed detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP903687A JPH0726972B2 (en) | 1987-01-20 | 1987-01-20 | Speed detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS63179260A true JPS63179260A (en) | 1988-07-23 |
JPH0726972B2 JPH0726972B2 (en) | 1995-03-29 |
Family
ID=11709423
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP903687A Expired - Fee Related JPH0726972B2 (en) | 1987-01-20 | 1987-01-20 | Speed detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0726972B2 (en) |
-
1987
- 1987-01-20 JP JP903687A patent/JPH0726972B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH0726972B2 (en) | 1995-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPS6119937B2 (en) | ||
US4503374A (en) | Speed detection apparatus and method | |
JPS63179260A (en) | Speed detecting method | |
JPH0374325B2 (en) | ||
JP3596942B2 (en) | Speed detector | |
JPH0835857A (en) | Method for detecting angle of rotation | |
JP3250356B2 (en) | Rotational position detector | |
JP2006300699A (en) | Speed detector, and abnormal speed detecting method therefor | |
JP7468511B2 (en) | Motor control device | |
JPH0725698Y2 (en) | Rotating machine speed detector | |
JP4029449B2 (en) | Speed detection method | |
JPH11252966A (en) | Motor speed control device | |
JP2562436Y2 (en) | Detector | |
JP2002311040A (en) | Speed detector | |
JP2523207Y2 (en) | Speed detector | |
JP2546346B2 (en) | Position sensor compensation method | |
JPS62237316A (en) | Detection error correcting device for position detector | |
JPH05322909A (en) | Rotating-speed detecting apparatus | |
JPS59192916A (en) | Generating method of crank mark signal | |
JPH08201052A (en) | Method for detecting rotational angle | |
JP2891472B2 (en) | Speed signal detection circuit | |
JPS61210880A (en) | Motor control system | |
JPH01124769A (en) | Speed detecting device | |
JPH10260197A (en) | Detecting circuit for velocity pulse | |
JPH09236612A (en) | Rotating speed sensor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |