JPS60194827A - Pulse counter - Google Patents

Pulse counter

Info

Publication number
JPS60194827A
JPS60194827A JP59051658A JP5165884A JPS60194827A JP S60194827 A JPS60194827 A JP S60194827A JP 59051658 A JP59051658 A JP 59051658A JP 5165884 A JP5165884 A JP 5165884A JP S60194827 A JPS60194827 A JP S60194827A
Authority
JP
Japan
Prior art keywords
data
value
count value
present
count
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
Application number
JP59051658A
Other languages
Japanese (ja)
Inventor
Masaki Murakami
村上 正喜
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.)
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
Original Assignee
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
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 Meidensha Corp, Meidensha Electric Manufacturing Co Ltd filed Critical Meidensha Corp
Priority to JP59051658A priority Critical patent/JPS60194827A/en
Publication of JPS60194827A publication Critical patent/JPS60194827A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K21/00Details of pulse counters or frequency dividers
    • H03K21/18Circuits for visual indication of the result
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K21/00Details of pulse counters or frequency dividers
    • H03K21/40Monitoring; Error detection; Preventing or correcting improper counter operation

Landscapes

  • Feedback Control In General (AREA)

Abstract

PURPOSE:To attain high-speed counting by adoting the design that a mean value between the present and preceding count values is adopted when the difference between the said mean value and the present count value is smaller than + or -1 and the present count value is adopted when the difference is larger to eliminate an error of + or -1 without increasing the resolution of a pulse transmitter. CONSTITUTION:An output pulse of a pulse oscillator 1 is counted by a prescribed sampling period by a counter 2, the count value is fetched to a controller main body 3 and fed to a control variable 4. In case of the sampling, a mean value is obtained at the 1st time while regarding the same value for the preceding time, and since the mean value is equal to the count value in this case, the value is adopted. A mean value N between the preceding count value N1 and the present count value N2 is obtained at the 2nd and succeeding operation and when the difference between the value N and the present value N2 is smaller than + or -1, the count value N is brought into count values N1, N2 after correction, and when the present mean value is larger, both the preceding and present count values are adopted. As a result, the error is halved, the instability of the control system is eliminated and the control with good response is attained.

Description

【発明の詳細な説明】 (技術分野) 本発明は、単位時間当シのパルスの個数を計数するパル
ス計数装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Technical Field) The present invention relates to a pulse counting device that counts the number of pulses per unit time.

(従来技術と問題点) パルス計数は、電動機のフィードバック速度制御ノタメ
のパルスピックアップによる速度検出や数値制御さらに
はアナログ信号をパルス数として積重する簡易アナログ
−ディジタル変換によるプロセス制御など多くの計測制
御に使用される。こ時間毎に計数し、この計数値をマイ
クロコンピュータなどの制御装置本体3にディジタル量
として取込む構成にされる。カウンタλの計数時間は本
体3側からサンプリング周期信号としてそのリセットで
設定され、リセット直前のカランタコの計数値がディジ
タル量として本体3に取込まれる。
(Prior art and problems) Pulse counting is used for many measurement controls such as speed detection and numerical control using pulse pickups for feedback speed control of electric motors, as well as process control using simple analog-to-digital conversion that accumulates analog signals as pulse numbers. used for. This count is counted every time, and the counted value is taken into the control device body 3, such as a microcomputer, as a digital quantity. The counting time of the counter λ is set as a sampling periodic signal from the main body 3 by its reset, and the counted value of the caran tacho immediately before the reset is taken into the main body 3 as a digital quantity.

本体3はパルス計数値等のデータに従って制御対2象弘
を制御し、制御対象lの制御量検出手段の1つとしてパ
ルス発信器/が設けられる。
The main body 3 controls the two control objects according to data such as pulse count values, and is provided with a pulse transmitter/as one of the control amount detection means for the control object l.

こうしたパルス計数装置は、カウンタ2のリセットにな
るサンプリング周期やサンプリングタイミングによって
カウンターの計数値に一1ハルスの誤差が発生する。例
えば、第2図に示すように、パルス発信器/の出力パル
スに対してサンプリング周期Tでサンプリングタイミン
グt。、tl 。
In such a pulse counting device, an error of 11 Hals occurs in the count value of the counter depending on the sampling period and sampling timing at which the counter 2 is reset. For example, as shown in FIG. 2, the sampling period T and the sampling timing t for the output pulse of the pulse generator/. ,tl.

t、による計数値は、パルスの立上参計数では期間t0
〜t□ 、t1〜t、共に同じ計数値12Nになるが、
パルスの立下逆計数では期間t。−七〇で計数値I21
 l/(対して期間t1〜t、で計数値1fi31にな
る。このような誤差にはサンプリングタイミング及びサ
ンプリング周期によって不規則に現われ、第1図のよう
な制御ループ内に微分成分が存在するときには制御系を
不安定にすることがあるし、オーブンルーズの制御系に
適用される場合にも誤差分として残る。
The count value due to t is the period t0 in pulse rising counting.
~t□ and t1~t both have the same count value 12N, but
The period t is used for counting the falling edge of the pulse. −70 and count value I21
l/(On the other hand, the count value becomes 1fi31 during the period t1 to t. Such errors appear irregularly depending on the sampling timing and sampling period, and when a differential component exists in the control loop as shown in Fig. 1, It may make the control system unstable, and it remains as an error even when applied to an oven-loose control system.

この誤差によ′る影響を少なくするためには、サンプル
データを数項の移動平均によシデータを平滑する移動平
均法又はパルス発信器/の分解能を高く(周波数を高く
)シて一1ハルスの誤差を相対的に小さくする方法が知
られている。、しかし、前者はデータ平滑のために検出
遅れ即ち制御系の制御遅れが発生し、高速制御には適用
できない。
In order to reduce the influence of this error, the sample data can be smoothed using a moving average of several terms, or the resolution of the pulse oscillator can be increased (higher frequency). There is a known method to relatively reduce the error. However, the former method causes a detection delay, that is, a control delay in the control system, due to data smoothing, and cannot be applied to high-speed control.

一方、後者は発信器/の機構からの制御(例えば回転体
のスリット数の制限)等によって分解能が制限される。
On the other hand, the resolution of the latter is limited by control from the transmitter/mechanism (for example, limiting the number of slits in the rotating body).

(発明の目的) 本発明の目的は、パルス発信器の分解能を土けることな
く±1の誤差を無くして高速計数できるパルス計数装置
全提供するにある。
(Object of the Invention) An object of the present invention is to provide a complete pulse counting device that can perform high-speed counting without reducing the resolution of the pulse oscillator and eliminating an error of ±1.

(発明の概要) 本発明は、1tサンプリング期前の計数値と現テンプリ
ング周期での計数値との平均値?求め、この平均値と現
サンプリング周期での計数値との差が±1より小さいと
きに平均値を現サンプリング周期及び前サンプリング周
期での計数値とし、+ 一1以上のときに現サンプリング周期での計数値をその
まま使いかつ次回のサンプリング時での前回のサンプリ
ング周期での計数値を前々回の計数値とすることで+:
1の計数誤差を修正することを特徴とする。
(Summary of the Invention) The present invention provides an average value of the count value before the 1t sampling period and the count value in the current Templing period. When the difference between this average value and the count value in the current sampling period is less than ±1, the average value is used as the count value in the current sampling period and the previous sampling period. By using the count value as it is and setting the count value in the previous sampling period at the next sampling time as the count value from the time before the previous one, +:
It is characterized by correcting a counting error of 1.

(実 施 例) 本発明の計数装置としては、第1図における制御装置本
体3がその中枢部としてマイクロコンピュータなどのデ
ィジタル処理手段を持つときには該手段を利用してカウ
ンタ2の計数値全入力データとして使用する前の修正処
理を行なわせる。また、制御装置本体3に修正処理余裕
がないときにはカウンタ2と本体Jの間に新たに修正処
理手段を設ける構成にされる。何れ の場合にも制御装置本体3において計数値データとして
使用する前処理(フロント処理)としてカランタコの計
数値を修正する。この修正処理の70−チャートは第8
図に示す。
(Embodiment) In the counting device of the present invention, when the control device main body 3 in FIG. Perform correction processing before using as a. Further, when the control device main body 3 does not have enough room for correction processing, a new correction processing means is provided between the counter 2 and the main body J. In either case, the count value of the caran taco is corrected as a preprocessing (front process) to be used as count value data in the control device main body 3. The 70-chart for this correction process is the 8th
As shown in the figure.

第3図において、第1回目のサンプリング周期での計数
値に対しては現サンプリング周期でのデータ(計数値)
Nta:取込み(ステップEll)、1サンプリング周
期前になる前回のサンプリング周期でのデータN1が存
在しないため現在データNi−−1”前回データN8と
する(ステップs2)。
In Figure 3, the data (count value) in the current sampling cycle is compared to the count value in the first sampling cycle.
Nta: Take in (step Ell), and since data N1 from the previous sampling period one sampling period ago does not exist, the current data Ni--1'' is set as the previous data N8 (step s2).

第2回目以降のサンプリング周期での計数値に対しては
現サンプリング周期でのデータN、を取込み、(ステッ
プS3)、前回のサンプリング周期でのデータN、が存
在するためステップS2の処理を省略する。こうしたデ
ータN*+Nlの取込み又は設定後、ます現在データN
、と前回データN。
For the count values in the second and subsequent sampling cycles, data N in the current sampling cycle is loaded (step S3), and the process in step S2 is omitted because data N in the previous sampling cycle exists. do. After importing or setting such data N*+Nl, the current data N
, and the previous data N.

とを使って前後移動平均データNをめる(ステップs4
)。
Calculate the forward and backward moving average data N using (step s4
).

N−−(N、 十N、) ・・・・・・・・・・・・(
1)この平均データNと現在データN、との間に11以
上の差があるか否か判定しくステップ85)、IN−N
、l(1・・・・・・・・・・・・(2)のとき、平均
データNを現在データN、の修正データ鳥としかつ前回
データN、のtデータ鳥′にもする(ステップ86)。
N--(N, 10N,) ・・・・・・・・・・・・(
1) To determine whether there is a difference of 11 or more between this average data N and the current data N (step 85), IN-N
, l (1...... (2), the average data N is set as the corrected data bird of the current data N, and is also made the t data bird' of the previous data N, (step 86).

+N−N、+≧1 ・・・・・・・・・・・・(3)の
とき、現在データN、をそのまま修正データ仝璽としか
つ前回データN、をそのま゛ま修正データへとする(ス
テップ87)。こうしたステップ86゜S7で得る修正
データNI+Niは制御装置本体3に使用するデータと
される。そして、現在データN、は前回データN1とし
ての移しをしくステップS8)、ステップS8に戻る繰
返し処理をする。
+N-N, +≧1 ・・・・・・・・・・・・When (3), the current data N is set as the corrected data, and the previous data N is set as the corrected data. (step 87). The modified data NI+Ni obtained in step 86°S7 is used as data for the control device main body 3. Then, the current data N is transferred as the previous data N1 (step S8), and the process is repeated to return to step S8.

こうした修正処理によシ、前回データN1と現在データ
N、に土1の差があるときにはその平均値Nを修正デー
タNl+N1としくステップ86人しかも現在データN
、全次回の処理では前回データN1として使う(ステッ
プSS)ことから、サンプリング周期やサンプリングタ
イミングの違いによる+:1の誤差発生は前回データと
現在データとの移動平均値Nに修正され、誤差分が半分
になる。そして、次回の平均値NはステップS8で前回
データN1がN、になっているため誤差分が零になシ、
制御装置本体3で使うデータ(修正データC)の変化は
+、lの変化にならず:!:0.5づつの変化になって
制御系の不安定な制御を無くすことになる。例えば前回
データN、が1551で現在データN、が15(3Nに
なると、その平均データNは155.51になル、次回
のサンプリングでは前回データN、が1561で現在デ
ータM、が15(31になっても使用データとしては1
5(3Nになる。このとき、本体3に使用されるデータ
は 現在データ 155#→#5551→15(3N前回デ
ータ 155#叫15邸l→15(3gのように変シ、
計数値に二1の誤差があっても155′から15f31
に大きく変化することがないし、前回データと現在デー
タが常に一致して両者を使った演算制御に二lの誤差分
が含まれることがない。
Through such correction processing, if there is a difference of 1 between the previous data N1 and the current data N, the average value N is set as the corrected data Nl + N1.
, Since the previous data N1 is used in all the next processing (step SS), an error of +:1 due to differences in sampling period or sampling timing is corrected to the moving average value N of the previous data and current data, and the error is is halved. Then, the next average value N is determined in step S8 because the previous data N1 is N, so the error is zero.
The change in the data used in the control device main body 3 (correction data C) does not result in a change of + or l:! : Changes in increments of 0.5 will eliminate unstable control of the control system. For example, if the previous data N is 1551 and the current data N is 15 (3N), the average data N is 155.51. In the next sampling, the previous data N is 1561 and the current data M is 15 (31). Even if the data used is 1
5 (becomes 3N. At this time, the data used for main body 3 is the current data 155# → #5551 → 15 (3N previous data 155# shout 15 residence l → 15 (changes like 3g, etc.)
Even if there is an error of 21 in the counted value, it is 155' to 15f31
The previous data and the current data always match, and the arithmetic control using them will not include an error of 2L.

また、修正処理には前回データN□と現在データN、と
金使った処理にな多、計数値検出の応答性としては1サ
ンプリング周期の遅れにな夛、従来の数項の移動平均に
較べて応答性が良くなる。
In addition, the correction process requires a lot of processing that uses the previous data N This improves responsiveness.

なお、前回データN□と現在データN、とに一2以上の
差があるときにはステップS7によって夫夫のデータN
1+Nlをそのまま使い、パルス発信器/自体の出力パ
ルス数の変化(検出値の変化)には応答性良く追従した
制御全可能にする。
Note that if there is a difference of 12 or more between the previous data N□ and the current data N, the husband's data N is changed in step S7.
By using 1+Nl as is, it is possible to perform control that follows changes in the number of output pulses (changes in detected values) of the pulse generator/itself with good responsiveness.

(発明の効果) 以上のとおシ、本発明によれば、サンプリング周期又は
タイミングによる+、1の計数誤差は除去され、しかも
応答性の良め計数値処理をすることができる効果が必る
(Effects of the Invention) As described above, according to the present invention, it is possible to eliminate counting errors of +1 due to the sampling period or timing, and to perform count value processing with improved responsiveness.

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

第1図はパルス計数装置の説明のための制御装置構成図
、第2図はパルス計数誤差を説明するためのタイムチャ
ート、第3図は本発明の一実施例を説明するためのフロ
ーチャートでおる。 /・・・パルス発信器、λ・・・カクンタ、3・・・制
御装置本体、弘・・・制御対象。
FIG. 1 is a configuration diagram of a control device for explaining a pulse counting device, FIG. 2 is a time chart for explaining pulse counting errors, and FIG. 3 is a flow chart for explaining an embodiment of the present invention. . /...Pulse transmitter, λ...Kakunta, 3...Control device main body, Hiro...Controlled object.

Claims (1)

【特許請求の範囲】[Claims] パルス発信器からの出力パルスを所定のサンプリング周
期で計数するカウンタの計数値として得るパルス計数装
置において、上記計数値として得る現サンプリング周期
でのデータN、と1サンプリング周期前の前回でのデー
タN1との平均値Nを演算する第1の処理手段と、上記
平均値Nと上記データN、との差が±lよシ小さいとき
に該平均値Nを現サンプリング周期での修正データ会及
び前回サンプリング周期での修正データ会とする第2の
処理手段と、現サンプリング周期でのデータN會全次回
のサンプリング周期でのデータに対する前回のサンプリ
ング周期でのデータとする第8の処理手段とを備えたこ
とt−特徴とするパルス計数装置。
In a pulse counting device that obtains output pulses from a pulse oscillator as a count value of a counter that counts at a predetermined sampling period, data N at the current sampling period obtained as the count value, and data N1 at the previous sampling period one sampling period ago. and a first processing means for calculating an average value N of the data N, and when the difference between the average value N and the data N is smaller than ±l, the average value N is calculated from the corrected data set in the current sampling period and the previous data set. a second processing means for converting the data in the current sampling cycle into a corrected data set; and an eighth processing unit for processing the data in the current sampling cycle as data in the previous sampling cycle with respect to the data in the next sampling cycle. - Characteristic pulse counting device.
JP59051658A 1984-03-16 1984-03-16 Pulse counter Pending JPS60194827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59051658A JPS60194827A (en) 1984-03-16 1984-03-16 Pulse counter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59051658A JPS60194827A (en) 1984-03-16 1984-03-16 Pulse counter

Publications (1)

Publication Number Publication Date
JPS60194827A true JPS60194827A (en) 1985-10-03

Family

ID=12892972

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59051658A Pending JPS60194827A (en) 1984-03-16 1984-03-16 Pulse counter

Country Status (1)

Country Link
JP (1) JPS60194827A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8436265B2 (en) 2007-03-30 2013-05-07 Fujitsu Component Limited Keyboard

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8436265B2 (en) 2007-03-30 2013-05-07 Fujitsu Component Limited Keyboard

Similar Documents

Publication Publication Date Title
JPS60131465A (en) Detector for rotating speed
KR920002760B1 (en) Speed controller
GB951735A (en) Self-adaptive control system
JPS60194827A (en) Pulse counter
JPH07229910A (en) Pulse counter circuit
JPH0340848B2 (en)
SU667957A1 (en) Device for regulating the ratio of flowrates
JPS6311662Y2 (en)
JP2827446B2 (en) Motor speed detection method
JPS5815159A (en) Digital speed detecting system
JPS60147653A (en) Speed detector
JP3243796B2 (en) Sampling synchronization circuit
JPS6319831B2 (en)
SU600727A1 (en) Signal frequency- to-digital code converter
SU879316A1 (en) Batch-type scale
SU922654A2 (en) Device for measuring non-stationary random train pulse average frequency
JPH0515184A (en) Speed detector
SU1645954A1 (en) Random process generator
SU798896A2 (en) Computing device for determining photographic system characteristics
JP2002136165A (en) Speed detecting method for motor controller
SU646348A2 (en) Azimuth pulse integrator
SU1760396A1 (en) Method of determination of load torque of d c electric drive
JPH02119592A (en) Motor speed controller
SU1084825A1 (en) Logarithmic analog-to digital converter
SU1027830A1 (en) Pulse repetition rate