JP2751488B2 - Pulse input processing method - Google Patents

Pulse input processing method

Info

Publication number
JP2751488B2
JP2751488B2 JP30354189A JP30354189A JP2751488B2 JP 2751488 B2 JP2751488 B2 JP 2751488B2 JP 30354189 A JP30354189 A JP 30354189A JP 30354189 A JP30354189 A JP 30354189A JP 2751488 B2 JP2751488 B2 JP 2751488B2
Authority
JP
Japan
Prior art keywords
time
interrupt
chattering
time interval
pulse
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 - Lifetime
Application number
JP30354189A
Other languages
Japanese (ja)
Other versions
JPH03163363A (en
Inventor
真一 前田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP30354189A priority Critical patent/JP2751488B2/en
Publication of JPH03163363A publication Critical patent/JPH03163363A/en
Application granted granted Critical
Publication of JP2751488B2 publication Critical patent/JP2751488B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Transmission And Conversion Of Sensor Element Output (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は,車速,回転数などに関する繰り返し周波数
のパルス信号を処理するためのパルス入力処理方法に関
する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pulse input processing method for processing a pulse signal having a repetition frequency related to a vehicle speed, a rotation speed, and the like.

〔従来の技術〕[Conventional technology]

車速等を検出するためのパルス入力処理方法として
は,例えば特開昭49−27722号公報に示される内燃機関
の回転数検出装置,特公昭61−20274号公報に示される
エンジン回転数自動制御装置などがある。これらの方法
は,パルス間隔を一定のクロックパルスで計算し,入力
処理を行うものである。
As a pulse input processing method for detecting a vehicle speed or the like, for example, a rotational speed detecting device for an internal combustion engine disclosed in Japanese Patent Application Laid-Open No. 49-27722 and an automatic engine speed controlling device disclosed in Japanese Patent Publication No. 61-20274 are disclosed. and so on. In these methods, a pulse interval is calculated with a constant clock pulse, and input processing is performed.

ところで,車速センサ等においては,主にリードスイ
ッチが用いられているが,オン,オフの切替り時には,
不正信号(以降チャタリングという)が発生する。かか
るチャタリングはハード(電気回路)によっては十分取
り去ること(チャタリング取り)ができない。そのた
め,パルス信号の両エッジについてチャタリング信号が
発生し,該チャタリング信号がマイクロプロセッサのエ
ッジ入力ポートに入ったときには,誤作動を生ずる。
By the way, reed switches are mainly used in vehicle speed sensors and the like.
An illegal signal (hereinafter referred to as chattering) occurs. Such chattering cannot be sufficiently removed (chattering removal) depending on the hardware (electric circuit). Therefore, a chattering signal is generated for both edges of the pulse signal, and a malfunction occurs when the chattering signal enters the edge input port of the microprocessor.

即ち,車速センサは,第14図,第15図に示すごとく,
周方向にN,S極が着磁された磁石91を自動車の速度ケー
ブルにより車速に応じて回転させ,この磁石91に近接し
たリードスイッチ92のオン,オフ状態をパルス信号94と
して得るものである。そして,リードスイッチ92を用い
たセンサでは,磁石91の回転に伴うオン,オフ信号の切
り替わり時に,第15図のSPD信号で示すごときチャタリ
ング波形を発生する。
That is, as shown in FIG. 14 and FIG.
A magnet 91 whose N and S poles are magnetized in the circumferential direction is rotated by an automobile speed cable according to the vehicle speed, and the on / off state of a reed switch 92 close to the magnet 91 is obtained as a pulse signal 94. . Then, the sensor using the reed switch 92 generates a chattering waveform as shown by the SPD signal in FIG. 15 when the on / off signal is switched with the rotation of the magnet 91.

そこで,これを防止するため,第14図に示すチャタリ
ング取り回路を設ける。同回路によれば,抵抗R1,R2をR
1<<R2と設定し,トランジスタTrのスレッショルドレ
ベル電圧は「5V−約0.6V」と高い所にあることかから,
抵抗R2,コンデンサC1の時定数によりハード回路のチャ
タリング取りを行うことができる。
In order to prevent this, a chattering removing circuit shown in FIG. 14 is provided. According to the circuit, the resistors R1 and R2 are R
1 << R2 is set, and the threshold level voltage of the transistor Tr is "5V-about 0.6V".
Chattering of the hardware circuit can be removed by the time constant of the resistor R2 and the capacitor C1.

〔解決しようとする課題〕[Problem to be solved]

しかし,上記ハードによるチャタリング取りでは,チ
ャタリング時は全て“L"レベルと判定されてしまう(信
号93)。また,車速センサのオン,オフ時間比も考慮す
ると,高速において“H"レベルがなくなることも考えら
れる。それ故,ハードによるチャタリング取りは充分で
ない。
However, in the chattering removal by the above hardware, at the time of chattering, all are determined to be “L” level (signal 93). Also, considering the on / off time ratio of the vehicle speed sensor, the "H" level may disappear at high speed. Therefore, chattering by hardware is not enough.

そこで,従来特公平1−41944号公報には,上記チャ
タリングを除去するためのパルス入力処理方法が提案さ
れている。この方法は,割込み内でエッジ入力が対応す
る信号のレベルが一定時間以上同じである時,その入力
は正しいものとしてチャタリング除去処理をしている。
そのため,レベル変化を一定時間監視している間,他の
処理が行えないという欠点を有している。
In view of the above, Japanese Patent Publication No. 41944/1994 proposes a pulse input processing method for removing the chattering. In this method, when the level of a signal corresponding to an edge input within an interrupt is the same for a certain period of time or more, the input is regarded as correct and the chattering removal processing is performed.
Therefore, there is a disadvantage that other processing cannot be performed while monitoring the level change for a certain period of time.

一般的なパルス入力処理としては,センサのチャタリ
ングの発生しやすいエッジ方向に対し割込みを発生さ
せ,チャタリング除去を行う。第16図に示す処理を行っ
ている。この方法は,ステップ9−0においてSPD(車
速)パルス入力の立ち上りエッジ割込みを行い,9−1に
おいて立ち上り時間間隔演算を行い,9−2において1ms
以内の再割込みは無視するチャタリング取りを行う。そ
して,9−3において時間間隔によるSPD演算を行うと共
に,次回演算のための今回時刻の記憶を行う。
As a general pulse input process, an interrupt is generated in an edge direction where chattering of the sensor is likely to occur, and chattering is removed. The processing shown in FIG. 16 is performed. In this method, a rising edge interrupt of SPD (vehicle speed) pulse input is performed in step 9-0, a rising time interval is calculated in 9-1, and 1 ms is calculated in 9-2.
The re-interruption within is ignored for chattering. Then, in step 9-3, the SPD calculation is performed based on the time interval, and the current time is stored for the next calculation.

そして,この波形のタイムチャートについては,第17
図に示すごとく,まずSPD入力は立ち上りエッジ11,12,1
3,14があり,その間に立ち下りエッジ31,32,33がある。
そして,同図においては,立ち上りエッジ12と立ち下り
エッジ32の間に,立ち下りエッジと立ち上りエッジとの
チャタリングエッジ310,120が発生している。また,立
ち下りエッジ33と立ち上りエッジ14との間には立ち上り
エッジと立ち下りエッジとのチャタリング130,330が発
生している。
And for the time chart of this waveform,
As shown in the figure, first, the SPD input is rising edge 11, 12, 1
3, 14, between which there are falling edges 31, 32, 33.
In the same figure, between the rising edge 12 and the falling edge 32, chattering edges 310 and 120 between the falling edge and the rising edge occur. Further, between the falling edge 33 and the rising edge 14, chattering 130 and 330 between the rising edge and the falling edge occur.

そこで,上記のごとくチャタリング取り時間T1(1m
s)を設けると,立ち上り時間間隔は同図に示すごとく
なる。つまり,立ち上りエッジ12の後のT1内のチャタリ
ング310,120は割込み無視されるが,一方立ち下りエッ
ジ33後のチャタリング130,330については,立ち上りエ
ッジ130を基準とする時間間隔で演算される。そのた
め,前者の場合は正常であるが,後者の場合には高速で
あると誤判断されてしまう。
Therefore, as described above, the chattering time T1 (1m
When s) is provided, the rise time interval becomes as shown in FIG. That is, the chattering 310, 120 in T1 after the rising edge 12 is interrupted, whereas the chattering 130, 330 after the falling edge 33 is calculated at a time interval based on the rising edge 130. Therefore, the former case is normal, while the latter case is erroneously determined to be high speed.

即ち,上記方法では,立ち上がりエッジ11,12,13,14
側でのチャタリング入力は取去できるが,立ち下がりエ
ッジ31,32,33側でのチャタリング入力は取去できないた
め上記誤判断を生ずる。
That is, in the above method, the rising edges 11, 12, 13, 14
Although the chattering input on the side can be removed, the chattering input on the falling edges 31, 32, and 33 cannot be removed, resulting in the above erroneous determination.

そこで,上記問題に対処するため,第18図,第19図に
示すパルス入力処理方法が考えられる。
To cope with the above problem, a pulse input processing method shown in FIGS. 18 and 19 can be considered.

即ち,第18図において,前記のステップ9−0〜9−
2の後に9−7においてエッジが立ち上りか否かを判断
し,立ち上りであれば,9−8において前回割込み(立ち
下がり)9−10で記憶されたRAM内容(前回立ち上がり
エッジから立ち下がりエッジ時間)と,前回割込み時刻
(立ち下がりエッジ)と今回割込み時刻との差を加算し
た時間(前回立ち上がりから今回立ち上がり時間間隔)
からSPD演算を行う。9−9において時間演算のため今
回時刻記憶を行うと共に次回割込みエッジ切替を行う。
また,上記9−7において立ち上りエッジがないときに
は,9−10において前回割込み(立ち上がり)から今回割
込み(立ち下がり)の時間間隔の記憶を行い,9−9に進
む。
That is, in FIG. 18, the aforementioned steps 9-0 to 9-
In step 9-7 after step 2, it is determined whether or not the edge is a rising edge. If the edge is a rising edge, in step 9-8, the RAM contents stored in the previous interrupt (falling) 9-10 (time from the previous rising edge to the falling edge time) ) And the time obtained by adding the difference between the previous interrupt time (falling edge) and the current interrupt time (interval between the last rise and the current rise time)
Performs SPD operation from. In 9-9, the current time is stored for time calculation and the next interrupt edge switching is performed.
If there is no rising edge in 9-7, the time interval from the previous interrupt (rising) to the current interrupt (falling) is stored in 9-10, and the process proceeds to 9-9.

そして,上記方法においては,第19図に示すタイムチ
ャートが得られる。即ち,本方法では,立ち上りエッジ
11,12,13,14及び立ち下りエッジ31,32,33の両エッジに
ついて割込み発生チャタリング取りを行い,立ち上りか
ら立ち下りの時間20と立ち下りから立ち上りの時間25の
合計時間間隔からSPD演算がなされる。
Then, in the above method, the time chart shown in FIG. 19 is obtained. That is, in this method, the rising edge
Interrupt generation chattering is performed for both edges 11, 12, 13, 14 and the falling edges 31, 32, 33, and the SPD calculation is performed based on the total time interval of the rise-to-fall time 20 and the fall-to-rise time 25. Done.

しかし,この方法においても次の問題がある。即ち,S
PD信号のオン,オフデューティは50%ではなく,0.8≦ON
/OFF≦3.5の範囲にある。そのため,ハードディレーも
含め高速になると,オン時間又はオフ時間はチャタリン
グ取り時間(1ms)以下もありうる。
However, this method also has the following problem. That is, S
PD signal on / off duty is not 50%, 0.8 ≦ ON
/OFF≦3.5. Therefore, at high speeds including hard delay, the on-time or off-time may be shorter than the chattering elimination time (1 ms).

それゆえ,第20図に示すごとく,立ち上りエッジ11と
立ち下りエッジ31の間の“H"レベル(オン時間)20がチ
ャタリング取り時間T1よりも小さい時には,この時間T1
の間にチャタリングエッジ310,120が生じた場合,同図
のごとく低速と誤判断される。
Therefore, as shown in FIG. 20, when the "H" level (on time) 20 between the rising edge 11 and the falling edge 31 is shorter than the chattering elimination time T1, this time T1
If the chattering edges 310 and 120 occur during the period, it is erroneously determined that the speed is low as shown in FIG.

また,第21図に示すごとく,立ち下がりエッジ31と立
ち上がりエッジ12の間の“L"レベル(オフ時間)25が,
チャタリング取り時間T1よりも小さいときには,この時
間T1の間にチャタリングエッジ310,120が生じた場合,
低速と誤判断される。
As shown in FIG. 21, the “L” level (off time) 25 between the falling edge 31 and the rising edge 12 is
If the chattering edges 310 and 120 occur during the time T1 when the chattering time T1 is smaller than the chattering removal time T1,
It is erroneously determined to be low speed.

“L"又は“H"レベル時間がチャタリング取り時間以下
の時の誤判断は,従来技術として示す特公平1−41944
号公報についても言うことができる。
If the “L” or “H” level time is shorter than the chattering time, an erroneous judgment is made as described in the prior art.
Can also be said.

本発明はかかる従来の問題点に鑑み,チャタリング中
のパルス入力時間間隔を無視し,正確なパルス入力時間
間隔を得ることができ,車速等について正確な演算を行
うことができるパルス入力処理方法を提供しようとする
ものである。
SUMMARY OF THE INVENTION In view of the conventional problems, the present invention provides a pulse input processing method capable of ignoring a pulse input time interval during chattering, obtaining an accurate pulse input time interval, and performing an accurate calculation on vehicle speed and the like. It is something to offer.

〔課題の解決手段〕[Solutions to solve the problem]

本発明は,センサから送られる繰り返し周波数のパル
ス信号を処理するパルス入力処理方法において, パルス信号の立ち上りエッジで割込みがかかる第1割
込モードと,立ち下りエッジで割込みがかかる第2割込
モードとを有し, 第1割込モードでは,前回の第1割込みと今回の第1
割込みとの間である第1時間間隔を計算して入力パルス
周期とすると共に, 第2割込みより第2一定時間内における第1割込モー
ドにて計算した第1時間間隔は入力パルス周期とせず, 上記第1時間間隔に,上記第2一定時間後の第1割込
モードにて計算した第1時間間隔を加算して入力パルス
周期とすることを特徴とするパルス入力処理方法にあ
る。
The present invention relates to a pulse input processing method for processing a pulse signal of a repetition frequency sent from a sensor, wherein a first interrupt mode in which an interrupt is generated at a rising edge of the pulse signal and a second interrupt mode in which an interrupt is generated at a falling edge of the pulse signal In the first interrupt mode, the previous first interrupt and the current first interrupt
The first time interval between the interruption is calculated as the input pulse period, and the first time interval calculated in the first interrupt mode within the second fixed time from the second interruption is not set as the input pulse period. , A first time interval calculated in the first interrupt mode after the second fixed time is added to the first time interval to obtain an input pulse period.

本発明において最も注目すべきことは,立ち下がりエ
ッジについてチャタリング処理を行ってこのチャタリン
グ巾の入力時間間隔を考慮した正確な入力パルス周期の
演算を行えること,また立ち上がりエッジ(第1割込モ
ード)と立ち下がりエッジ(第2割込モード)との異な
る入力エッジタイミングとしたことで割込負荷を分散し
たことにある。
The most remarkable point in the present invention is that a chattering process is performed on the falling edge to accurately calculate the input pulse period in consideration of the input time interval of the chattering width. In addition, the rising edge (first interrupt mode) And the falling edge (second interrupt mode) has different input edge timing, thereby distributing the interrupt load.

また,本発明においては,第1割込モードから第1一
定時間内に発生する第1割込みは無視することもでき
る。
Further, in the present invention, the first interrupt generated within the first fixed time from the first interrupt mode can be ignored.

更に,上記入力パルス周期を用いた演算処理は,上記
第2割込モードにて行うこともできる。
Further, the arithmetic processing using the input pulse period can be performed in the second interrupt mode.

また,上記従来技術で示した特公平1−41944号公報
と本発明とを比較すると,前者は割込み内でそのエッジ
に対応するポートのレベルが正しいか否かを常時チェッ
クし,一定時間以上正しいときには正常な割込みと判断
し処理している。この場合は,チャタリング内では最後
の割込み時刻が演算時刻となる。
Also, comparing the present invention with Japanese Patent Publication No. 41944/1994, the former always checks whether or not the level of the port corresponding to the edge within the interrupt is correct, and corrects the level for more than a fixed time. Occasionally, a normal interrupt is determined and processed. In this case, the last interrupt time in the chattering is the calculation time.

これに対して,本発明は,今回の割込みに対して前回
の同一方向エッジ割込みが一定時間以上経過していると
きに正常割込みと判断する。つまり,チャタリング内で
は最初の割込み時刻が演算時刻となるのである。
On the other hand, according to the present invention, a normal interrupt is determined when a previous same-direction edge interrupt has passed a predetermined time or more with respect to the current interrupt. That is, the first interruption time in the chattering is the calculation time.

なお,上記の同一方向エッジ入力に対するチャタリン
グ取り時間は,パルス時間間隔を算出する第1割込モー
ド側ではパルス入力周波数範囲の最小時間間隔以下の時
間に近い値を採用する。一方,上記時間間隔に基づき演
算を行う第2割込モード側では使用するセンサから起こ
りうるチャタリング時間以上で,その時間に近い値を採
用する。両チャタリング時間は同じであっても,異なる
ものであっても良い。
As the chattering removal time for the same-direction edge input, a value close to a time equal to or less than the minimum time interval of the pulse input frequency range is adopted on the first interrupt mode side for calculating the pulse time interval. On the other hand, on the side of the second interrupt mode in which the calculation is performed based on the time interval, a value close to the chattering time that is longer than the chattering time that can occur from the sensor used is adopted. Both chattering times may be the same or different.

また,本発明において,上記各技術用語は,次のこと
を意味する。
In the present invention, the above technical terms mean the following.

第1割込み;立ち上がりエッジでかかる割込み。 First interrupt; interrupt at rising edge.

第2割込み;立ち下がりエッジでかかる割込み。 Second interrupt; interrupt that occurs at the falling edge.

第1割込モード;第1割込みで行われる処理状態,こ
こでは立ち上がりエッジ側で発生するチャタリング取り
と(チャタリングがある場合はこれを無視して)立ち上
がりエッジと立ち上がりエッジとの間の時間間隔の計算
と,計算した時間間隔を用いて行うパルス周期の計算と
を行う。
1st interrupt mode: the processing state performed by the 1st interrupt, here, the chattering occurring on the rising edge side and the time interval between the rising edges (ignoring chattering if present) The calculation and the calculation of the pulse period using the calculated time interval are performed.

また,パルス周期の演算は第2割込モードにてチャタ
リング取りが行われた場合,次回の第1割込モードにて
今回算出した時間間隔と次回算出する時間間隔とを加算
してパルス周期とする。
In the calculation of the pulse period, when chattering is performed in the second interrupt mode, the time interval calculated this time in the next first interrupt mode and the time interval calculated next time are added, and the pulse period is calculated. I do.

また,第2割込モードにてチャタリング取りが行われ
なかった場合には,次回の第1割込モードにて算出した
時間間隔をパルス周期とする。
When chattering is not performed in the second interrupt mode, the time interval calculated in the next first interrupt mode is set as the pulse cycle.

第2割込モード;第2割込みで行われる処理状態,こ
こでは立ち下がりエッジ側で発生するチャタリング取り
と,(チャタリング取りが行われなかった場合に)第1
割込モードにて算出したパルス周期を用いて車速等の演
算を行う。
The second interrupt mode; the processing state performed by the second interrupt, in this case, the chattering removal occurring on the falling edge side and the first state (when chattering removal is not performed)
The calculation of the vehicle speed or the like is performed using the pulse cycle calculated in the interrupt mode.

第1一定時間;T1(第2図参照)。 First fixed time; T1 (see FIG. 2).

第2一定時間;T2(第2図参照)。 Second fixed time; T2 (see FIG. 2).

〔作 用〕(Operation)

本発明においては,第3図のブロック図に示すごと
く,センサから送られるパルス信号は第1割込モードか
ら第1一定時間内に発生する第1割込みは無視する。ま
た第1割込モードにて,前回の第1割込みと今回の第1
割込みとの間である第1時間間隔を計算して入力パルス
周期とする。
In the present invention, as shown in the block diagram of FIG. 3, the pulse signal sent from the sensor ignores the first interrupt generated within the first fixed time from the first interrupt mode. In the first interrupt mode, the previous first interrupt and the current
A first time interval between the interruption and the interruption is calculated to be an input pulse period.

しかし,第2割込みより第2一定時間内にある第1割
込モードにて計算した第1時間間隔は入力パルス周期と
せず,この第1時間間隔に第2一定時間経過後発生した
第1割込モードにて計算した第1時間間隔を加算して入
力パルス周期とする。
However, the first time interval calculated in the first interrupt mode within the second fixed time from the second interrupt is not set as the input pulse period, and the first time interval generated after the second fixed time elapses in the first time interval. The first time interval calculated in the embedded mode is added to obtain an input pulse period.

また,請求項2の発明においては第1割込みモードか
ら第1一定時間内に発生する第1割込みは無視する。
According to the second aspect of the present invention, the first interrupt generated within the first fixed time from the first interrupt mode is ignored.

また,請求項3の発明においては入力パルス周期を用
いた演算処理は,第2割込モードにて行う。
According to the third aspect of the present invention, the arithmetic processing using the input pulse period is performed in the second interrupt mode.

〔実施例〕〔Example〕

第1実施例 本発明の実施例にかかるパルス入力処理方法につき,
第1図〜第6図を用いて説明する。
First Embodiment Regarding a pulse input processing method according to an embodiment of the present invention,
This will be described with reference to FIGS.

本例の方法は,第3図のブロック図に示すごとく,セ
ンサ40から発生するパルス信号は,第1割込モード41と
第2割込モード42において処理する。
In the method of this embodiment, as shown in the block diagram of FIG. 3, a pulse signal generated from the sensor 40 is processed in a first interrupt mode 41 and a second interrupt mode 42.

即ち,第1割込モード41においては,入力パルス信号
の立ち上りエッジ検出411を行い,次いで時間T1のチャ
タリング取り412を行い,時間間隔計算413を行う。一
方,第2割込モード42においては,入力パルス信号の立
ち下りエッジ検出421を行い,次いで時間T2のチャタリ
ング取り422を行い,前記第1割込モード41で計算され
た時間間隔を入力して車速等の演算423を行う。これら
の処理はマイクロコンピュータを用いて行う。
That is, in the first interrupt mode 41, the rising edge detection 411 of the input pulse signal is performed, then the chattering 412 of the time T1 is performed, and the time interval calculation 413 is performed. On the other hand, in the second interrupt mode 42, the falling edge detection 421 of the input pulse signal is performed, then the chattering 422 of the time T2 is performed, and the time interval calculated in the first interrupt mode 41 is input. The calculation 423 of the vehicle speed and the like is performed. These processes are performed using a microcomputer.

次に,上記処理のフローチャートを第1図により説明
する。割込み入力があると,ステップ1−1においては
そのエッジ入力が立ち上りか否かを判定し,立ち上りで
あれば1−2にてポートレベルが“H"(高いレベル,第
2図符号20)か否か判断する。“H"レベルであれば,1−
3にてTiN(今回割込み発生時刻)からZTiNH(立ち上が
り割込み時刻)を差し引いた値をD(立ち上がり割込み
時間間隔)とする。
Next, a flowchart of the above process will be described with reference to FIG. If there is an interrupt input, it is determined in step 1-1 whether or not the edge input is a rising edge. If the edge input is a rising edge, it is determined in 1-2 whether the port level is "H" (high level, reference numeral 20 in FIG. 2). Determine whether or not. If it is “H” level, 1−
In 3, the value obtained by subtracting ZTiNH (rising interrupt time) from TiN (current interrupt occurrence time) is set to D (rising interrupt time interval).

そして,1−4において,上記Dが第1割込みモードの
立ち上がりチャタリング取り時間T1より小さいか否か判
断し,D<T1の時には,チャタリングであるとして1−9
に進み,入力割込みエッジの切り替えをする。一方,1−
4においてD>T1のときには,1−5で上記TiNをZTiNHと
なし,1−6で演算フラグセットを確認して,NO即ち,前
回割込み(立ち下がりエッジ)で演算がなされなかった
時(立ち下がりチャタリング2回目以降の立ち上がりエ
ッジ割込み)であれば1−8にて立ち上りパルス時間間
隔T0(前回T0にDを加算)を計算し,前記1−9に進
む。また,1−6でフラグセットのときには,1−7にて前
記Dを上記時間間隔T0として,演算フラグをクリアして
上記1−9に進む。
Then, in 1-4, it is determined whether or not D is smaller than the rising chattering time T1 in the first interrupt mode. If D <T1, chattering is determined to be 1-9.
To switch the input interrupt edge. On the other hand,
When D> T1 in step 4, the TiN is set to ZTiNH in step 1-5, and the operation flag set is checked in step 1-6. If NO, that is, if the operation was not performed by the previous interrupt (falling edge) (standby) If it is the second or subsequent rising edge interrupt of falling chattering, the rising pulse time interval T 0 (addition of D to the previous time T 0 ) is calculated in 1-8, and the process proceeds to 1-9. Further, when the flag set at 1-6, the D as the time interval T 0 at 1-7, the process proceeds to the 1-9 clears the operation flag.

一方,上記1−1において,エッジが立ち上りでな
く,立ち下りエッジであると判断されたときには,1−10
において,ポートレベルが“L"(低レベル,第2図の符
号25)にあるか判断する。“L"であれば1−11において
TiNからZTiNL(立ち下がり割込み時刻)を差し引いた値
をDとなし,またTiNをZTiNLとする。
On the other hand, when it is determined in the above 1-1 that the edge is not a rising edge but a falling edge, 1-10
It is determined whether the port level is at "L" (low level, reference numeral 25 in FIG. 2). If “L”, at 1-11
D is the value obtained by subtracting ZTiNL (falling interrupt time) from TiN, and ZTiNL is TiN.

そして,1−12においてDが第2割込モードのチャタリ
ング取り時間T2よりも小さいか否か判断し,D<T2であれ
ば前記1−9に進む。一方,D<T2でないときには,1−13
において前記第1割込モードのステップ1−8又は1−
7で計算した時間間隔T0より,車速等の演算を行い,1−
14にて演算フラグセットを行い1−9へ進む。
Then, in 1-12, it is determined whether or not D is shorter than the chattering time T2 in the second interrupt mode. If D <T2, the process proceeds to 1-9. On the other hand, when D <T2, 1-13
In step 1-8 or 1- of the first interrupt mode,
Than the time interval T 0 calculated at 7 performs calculation of vehicle speed, 1-
At 14, the operation flag is set, and the routine proceeds to 1-9.

次に,第2図に上記フローチャートに基づいて得られ
るタイムチャートを示す。同図に示すごとく,立ち上り
及び立ち下りの各入力信号に対して,それぞれ時間T1,T
2のチャタリング取りがなされ,TiN−ZTiNHに基づく時間
間隔T0が算出され,演算が行われる。
Next, FIG. 2 shows a time chart obtained based on the above flowchart. As shown in the figure, for the rising and falling input signals, the time T1, T
The chattering of 2 is performed, and a time interval T 0 based on TiN−ZTiNH is calculated and the calculation is performed.

例えば,立ち上りエッジ12と立ち下りエッジ32との間
には,エッジ310,120のチャタリングが発生している。
しかし,立ち上りエッジ120の前記Dはチャタリング取
り時間T1よりも短い。そのため,この立ち上りエッジ12
0は無視して時間間隔が計算される。また,立ち下りエ
ッジ310に関しては,TiN−ZTiNL(立ち下り31)がT2より
大きいので,チャタリングとは関係なく演算が行われ
る。この時,演算される時間間隔は立ち上がりエッジ12
で得られた11から12までの時間間隔である。
For example, between the rising edge 12 and the falling edge 32, chattering of the edges 310 and 120 occurs.
However, the D at the rising edge 120 is shorter than the chattering time T1. Therefore, this rising edge 12
Time intervals are calculated ignoring 0. Regarding the falling edge 310, since TiN−ZTiNL (falling 31) is larger than T2, the calculation is performed irrespective of chattering. At this time, the calculated time interval is the rising edge 12
Is the time interval from 11 to 12 obtained in.

また,エッジ32と13との間には,立ち下りエッジ32の
後にエッジ121,320のチャタリングが発生している。こ
の場合,エッジ121では,12からのチャタリング取り時間
T1以降でかつ演算後で演算フラグはセットされている
為,T0は12から121までの時間がセットされる。エッジ32
0は32からのチャタリング取り時間T2以内であり無視さ
れる。次のエッジ13では,前回T0セット後演算はなされ
ていないため,演算フラグはクリア,ゆえにT0はT0(12
〜121の時間)に121から13の時間を加算された12から13
の時間間隔として次の立ち下がり330,33で演算されるの
である。
Further, between the edges 32 and 13, chattering of the edges 121 and 320 occurs after the falling edge 32. In this case, at edge 121, the chattering removal time from 12
Since the operation flag after a and calculating T1 or later is set, T 0 is set the time from 12 to 121. Edge 32
0 is within the chattering removal time T2 from 32 and is ignored. In the next edge 13, because after the last T 0 set operations has not been made, the operation flag is cleared, thus T 0 is T 0 (12
12 to 13 which is the time of 121 to 13)
Is calculated at the next fall 330, 33 as the time interval of.

次に,第4図〜第6図には,立ち上りエッジ11と立ち
下りエッジ31の間の“H"レベル20が,立ち下りエッジ31
と立ち上りエッジ12の間の“L"レベル25とほぼ同じ場合
(第4図),前者が後者よりも小さくかつ前者の時間が
チャタリング時間T1よりも小さい場合(第5図),前者
が後者よりも大きくかつ後者の時間がチャタリング時間
T2よりも小さい場合(第6図)を示している。
Next, FIG. 4 to FIG. 6 show that the “H” level 20 between the rising edge 11 and the falling edge 31
When the former is smaller than the latter and the time of the former is smaller than the chattering time T1 (FIG. 5), the former is smaller than the latter, as shown in FIG. Is larger and the latter time is chattering time
The case where it is smaller than T2 (FIG. 6) is shown.

そして,上記各図のタイムチャートより知られるごと
く,いずれの場合にもチャタリング発生とは関係なく,
正確なパルス入力時間間隔を確認後,該時間間隔による
演算を行うことができる。前記従来技術では,かかる処
理ができず誤判断を生じていた(第19図〜第21図参
照)。
And, as is known from the time charts in the above figures, in any case, regardless of the occurrence of chattering,
After confirming the correct pulse input time interval, the calculation based on the time interval can be performed. In the prior art, such processing cannot be performed, and an erroneous determination has occurred (see FIGS. 19 to 21).

第2実施例 次に,第7図〜第12図を用いて具体例を示す。Second Embodiment Next, a specific example will be described with reference to FIGS.

第7図,第8図は本発明の具体的実施例を示すフロー
チャートである。
7 and 8 are flowcharts showing a specific embodiment of the present invention.

第7図は,SPD(車速)割込み内の,第8図は4.096ms
毎に発生する定時割込みでのSPD処理である。SPD信号
は,例えば車速60km/hで,637rpm×4パルス発生し,割
込み発生時刻のLSBを4μS,SPD時間間隔を8ビット2バ
イトで演算したとすると,最大時間間隔幅は0.26214S
(4μS×216),またこの時の車速(最低検出速度)
は,約5.4km/h〔(1/0.2621)×(60×60/637×4)〕
である。
Fig. 7 shows SPD (vehicle speed) interrupt, Fig. 8 shows 4.096ms
This is SPD processing with a periodic interrupt that occurs every time. For example, if the SPD signal is generated at 637 rpm × 4 pulses at a vehicle speed of 60 km / h and the LSB of the interrupt occurrence time is calculated as 4 μS and the SPD time interval is calculated as 8 bits and 2 bytes, the maximum time interval width is 0.26214 S
(4 [mu] S × 2 16), also the vehicle speed at this time (minimum detection speed)
Is about 5.4km / h [(1 / 0.2621) x (60 x 60/637 x 4)]
It is.

CSPDi(4.096msカウンタ)1は,SPD信号が0.7S以上
(車速<2km/h)なかった時,車速=0km/hとするととも
に,前記割込みによる最低検出車速以下2km/hまで検出
できる様に,5−7,5−9の処理を行っている。また,前
回SPD演算時間々隔と今回SPD演算時間々隔を平均化す
る,なまし処理をステップ5−8,5−9,5−10,5−18,5−
19,5−20で行う様構成している。
The CSPDi (4.096 ms counter) 1 sets the vehicle speed to 0 km / h when the SPD signal is not 0.7 S or more (vehicle speed <2 km / h) and detects the vehicle speed up to 2 km / h below the minimum detected vehicle speed by the interrupt. , 5-7, 5-9. In addition, the smoothing process of averaging the previous SPD calculation time interval and the current SPD calculation time interval is performed in steps 5-8, 5-9, 5-10, 5-18, and 5-
It is configured to be performed in 19,5-20.

ステップ(以下省略)5−1は割込みエッジ判別,5−
3,5−14では次回割込みエッジの切り替え,5−4,5−15
は,同一方向割り込みエッジでのチャタリング取りを行
う。また,5−8,又は5−9と5−20で立ち上りエッジの
SPD演算時間間隔を算出し,立ち下りエッジのタイミン
グである5−21でSPDを演算している。
Step (hereinafter abbreviated) 5-1 is interrupt edge judgment, 5-
Switching of next interrupt edge in 3,5−14, 5−4, 5−15
Performs chattering at the same direction interrupt edge. In addition, the rising edge of 5-8, or 5-9 and 5-20
The SPD calculation time interval is calculated, and the SPD is calculated at 5-21 which is the timing of the falling edge.

次に,作動について説明する。 Next, the operation will be described.

第9図〜第12図は,種々のSPD信号に対する具体的実
施例第7図,第8図に対応する,タイムチャートであ
る。
9 to 12 are time charts corresponding to FIGS. 7 and 8 for specific embodiments for various SPD signals.

まず,SPD信号入力がない時4ms(4.096ms)の定時割込
み処理のうち,第8図の6−1でCSPDiは+1され,6−
2でCSPDi>172(SPDパルス間隔>0.7s,SPD<2km/h)と
判断され,6−3でSPD=0km/h,またSPD演算時間間隔TSPD
にCSPDi1で計測された時間がセットされる。
First, in the regular interrupt processing of 4 ms (4.096 ms) when there is no SPD signal input, CSPDi is incremented by 1 in 6-1 in FIG.
In 2, it is determined that CSPDi> 172 (SPD pulse interval> 0.7s, SPD <2km / h), SPD = 0km / h in 6-3, and SPD operation time interval TSPD
Is set to the time measured by CSPDi1.

ここで+1されるCSPDi1は,オーバーフローしない様
ガードがかけられているものとする。この時,SPD割込み
エッジは立ち上がりにセットしている。
Here, it is assumed that CSPDi1 incremented by 1 is guarded so as not to overflow. At this time, the SPD interrupt edge is set to rise.

次に,SPD信号が入ってきたとき,前記第7図の5−1
でエッジ判別され,5−2,5−13の割込みエッジに対応す
るレベル判別〔ポートレベルがH(高い側)か,L(低い
側)か〕後,5−3,5−14で,時間割込みエッジを切り替
えている。5−4,5−15はチャタリング取り処理で,時
間間隔計測側である立ち上り側(第9図の11,12,13,1
4)では,前回チャタリング取り後の最初の割込み時刻Z
SPDHから,次に発生した立ち上り割込み時刻TiNの差
が,立ち上りチャタリング取り時間T1より少ない時(第
9図の12〜120),その割込みはなかったものと無視す
る。
Next, when the SPD signal comes in, 5-1 in FIG.
After the level judgment [whether the port level is H (high side) or L (low side)] corresponding to the interrupt edge of 5-2 and 5-13, the time is judged at 5-3 and 5-14. Switching the interrupt edge. Reference numerals 5-4 and 5-15 denote chattering removal processing, which is the rising side which is the time interval measurement side (11, 12, 13, 1 in FIG. 9).
In 4), the first interrupt time Z after the previous chattering
From the SPDH, when the difference between the next rising interrupt time TiN and the rising chattering time T1 is shorter (12 to 120 in FIG. 9), it is ignored that there is no interrupt.

一方SPD演算側の立ち下り側(第9図の31,32,33,34)
では,割込み発生ごとの時刻ZSPDLから,今回立ち下り
割込み発生時刻TiNの差が立ち下りチャタリング取り時
間T2より少ない時(第9図の33〜330),その割込みは
無かったものと無視している。この理由については後で
述べる。
On the other hand, the falling side of the SPD calculation side (31, 32, 33, 34 in FIG. 9)
In this example, when the difference between the falling interrupt occurrence time TiN and the falling chattering time T2 is smaller than the falling chattering time T2 from the time ZSPDL for each interrupt occurrence (33 to 330 in FIG. 9), it is ignored that there is no interrupt. . The reason for this will be described later.

また,第7図の5−6車速<2km/h判定である。詳し
くは,定時割込みである4.096ms割込み処理の第8図中
の6−1で+1されSPD割込み第7図の立ち上りエッジ
でクリア(5−12)される,カウンタCSPDi1により判定
する。また,5−7でのSPD<5.7km/h判定についても,同
一カウンタで行いSPD演算時間間隔TSPDの処理(5−8,5
−9)を行う。
In addition, the vehicle speed is determined to be 5-6 <2 km / h in FIG. More specifically, it is determined by the counter CSPDi1 which is incremented by 1 at 6-1 in FIG. 8 of the 4.096 ms interrupt process, which is a regular interrupt, and is cleared (5-12) at the rising edge of the SPD interrupt in FIG. Also, the SPD <5.7km / h determination in 5-7 is performed using the same counter, and the SPD operation time interval TSPD processing (5-8,5
Perform -9).

TSPD処理5−8,5−9では,SPD演算時間TSPDに,今回
計測立ち上り時間間隔が,LSB(計測分解能)を合わせる
とともに次々と加算される。TSPD,LSB=32μS,TiN,ZSPD
H,LSB=4μS,CSPDi1,LSB=4.096μS,またここで使用し
ているZSPDHは,5−5でTiNデータをZSPDHとする前のZSP
DHデータである。また,加算後SPD演算時に,1/2とすべ
きなまし処理要求フラグをセットする。
In the TSPD processes 5-8 and 5-9, the rise time interval measured this time is added to the SPD operation time TSPD one after another while adjusting the LSB (measurement resolution). TSPD, LSB = 32μS, TiN, ZSPD
H, LSB = 4 μS, CSPDi1, LSB = 4.096 μS, and the ZSPDH used here is ZSP before TiN data is changed to ZSPDH in 5-5.
DH data. Also, at the time of the SPD calculation after the addition, a smoothing processing request flag that should be halved is set.

また,5−15により立ち下りでチャタリングが発生した
と判断した時,その中にあった立ち上り時間はTSPDに加
算されるが,チャタリング取り後,最初の立ち下りエッ
ジ割込み時以外は,SPDの演算は行わない。5−18では,5
−10でセットしたTSPDなまし要求フラグに応じ,TSPDを1
/2,又フラグをクリアの後,立ち上り時間間隔TSPDを基
にSPDを演算する。5−18で,なまし要求フラグがセッ
トされていない時,SPDの演算をせず次の処理としても良
い。
When it is determined that chattering occurs on the falling edge according to 5-15, the rise time included in the chattering is added to the TSPD, but after chattering is removed, the SPD operation is performed except at the first falling edge interrupt. Is not performed. In 5-18, 5
According to the TSPD smoothing request flag set in -10, TSPD is set to 1
/ 2, and after clearing the flag, calculate the SPD based on the rise time interval TSPD. In 5-18, when the smoothing request flag is not set, the next process may be performed without performing the SPD operation.

第9図〜第11図に,種々のSPD信号に対するタイムチ
ャートを示す。
9 to 11 show time charts for various SPD signals.

まず第9図について説明する。信号の立ち上り(11)
で,TSPDに新たな時間間隔が加算され,なまし要求フラ
グのセット時,信号の立ち下り(31)でTSPDを1/2とし
た後,SPDを演算している。
First, FIG. 9 will be described. Rising signal (11)
Then, a new time interval is added to the TSPD, and when the smoothing request flag is set, the SPD is calculated after halving the TSPD at the falling edge (31) of the signal.

立ち上りでチャタリング(320,120)が発生した時,TS
PDに今回立ち上り時間間隔を加算した後,立ち下り(32
0)でTSPDは1/2なましされ,SPDを演算する。その後のチ
ャタリング内での割込みは無視される。次の正規立ち下
り(32)信号では,なまし要求フラグはクリアされてい
る為,TSPDは1/2されない。
When chattering (320,120) occurs at the rise, TS
After adding the rise time interval to PD this time, fall (32
In 0), TSPD is halved and SPD is calculated. Subsequent interruptions in chattering are ignored. In the next normal falling (32) signal, the smoothing request flag is cleared, so that TSPD is not halved.

次に,立ち下り33でチャタリングが発生した場合は,
最初の立ち下り(33)で,すでに加算されたTSPDを1/2
なまし後,SPDの演算を行う。そして,立ち上り(130)
でTSPDに本来の立ち上り(13〜14)の時間々隔の約1/2
が加算され,その後のチャタリング内での割込みは無視
される。次の正規立ち上り(14)で本来の立ち上り時間
間隔となり,その次の立ち下り(34)で1/2なまし後,SP
Dが演算される。
Next, if chattering occurs at the fall 33,
At the first fall (33), the already added TSPD is halved.
After annealing, SPD calculation is performed. And rise (130)
Approximately 1/2 of the time interval of the original rise (13-14) in TSPD
Is added, and subsequent interrupts in chattering are ignored. At the next regular rise (14), the original rise time interval is reached.
D is calculated.

第10図は,SPD入力信号の“H"レベルがチャタリング取
り時間T1以下となった場合,第11図は“L"レベルがチャ
タリング取り時間T2以下となった場合の,タイムチャー
トを示す。
FIG. 10 is a time chart when the "H" level of the SPD input signal is less than the chattering removal time T1, and FIG. 11 is a time chart when the "L" level is less than the chattering removal time T2.

第11図で立ち下り(33)にチャタリングが発生した
時,立ち下りチャタリング内の最初の立ち上り信号(14
0)が立ち上り時間間隔として有効となり,他はチャタ
リングとして無視されることから,一時的に短い時間間
隔でSPDが演算される。
In FIG. 11, when chattering occurs at the falling edge (33), the first rising signal (14
Since 0) is valid as the rise time interval and the other is ignored as chattering, the SPD is calculated temporarily at short time intervals.

しかし,次の時間間隔は,その分長く測定されるとと
もに,“H"レベル時間>>“L"レベル時間を想定してお
り,なまし処理により問題はない。
However, the next time interval is measured to be longer by that amount, and "H" level time >>"L" level time is assumed, and there is no problem with the smoothing process.

また,SPD信号はもともと,クランク軸1回転で4パル
スであり,同一はリードスイッチ,同一のN又はS極磁
石は4つおきである。このことから,時間間隔はなまし
処理,又は4パルス時間間隔による演算が必要である。
In addition, the SPD signal originally has four pulses per rotation of the crankshaft, and the same is a reed switch, and the same N or S pole magnet is provided every fourth. For this reason, the time interval requires a smoothing process or a calculation based on a 4-pulse time interval.

さらには,前記第14図,第15図に示した様に,ハード
によるチャタリング取りは,チャタリング期間中を“L"
レベルとなる様構成すれば,第11図の様なSPD入力でな
く,“L"レベルの確保された信号とすることができる。
Further, as shown in FIGS. 14 and 15, the chattering removal by the hardware becomes “L” during the chattering period.
With such a configuration, it is possible to use a signal in which the "L" level is secured, instead of the SPD input as shown in FIG.

ここで,第12図により,前記立ち下りSPD演算時の,
チャタリング取り時刻ZSPDLを,立ち下り割込み発生(6
1,62,63,……)ごとに更新する点について説明する。
Here, according to FIG. 12, at the time of the falling SPD calculation,
Set the chattering removal time ZSPDL to fall interrupt (6
1, 62, 63,...) Will be described.

即ち,仮に,前記のごとく立ち上り(51,52……)と
同様に,最初の時刻を基準としてチャタリング取りを行
った場合,同図に示す様なSPD信号が発生した時,誤判
定を行うことがある。
That is, if chattering is performed based on the first time as in the case of rising (51, 52 ...) as described above, an erroneous determination is made when an SPD signal as shown in FIG. There is.

しかし,本発明では,前記第9図〜第11図に示したご
とく,チャタリング発生時のチャタリング取り時刻T1
は,必ず立ち上りを基準となし,立ち下りはそれよりも
後となる為,第12図に示すごとき誤判定はない。また,
前記ハード処理(第14図,第15図)による“L"レベル
が,立ち下りチャタリング取り時間T2以上を確保できる
のであれば,必らずしも,立ち下りチャタリング時刻を
割込み発生ごとに更新する必要はない。
However, in the present invention, as shown in FIGS. 9 to 11, the chattering removal time T1 when chattering occurs.
Is always based on the rise, and the fall is later than that, so there is no misjudgment as shown in FIG. Also,
If the "L" level by the hardware processing (FIGS. 14 and 15) can secure the falling chattering taking time T2 or more, the falling chattering time is necessarily updated every time an interrupt occurs. No need.

第3実施例 本例につき,第13図を用いて説明する。Third Embodiment This embodiment will be described with reference to FIG.

前記第2実施例では,前回SPD算出時間間隔に,今回
計測時間間隔を加算後,1/2するなまし処理を実施してい
る。
In the second embodiment, a smoothing process is performed in which the current measurement time interval is added to the previous SPD calculation time interval and halved.

しかし,第1図の1つ1つの時間々隔からSPDを演算
する方法において,その1−13における演算を,第13図
の様に置き替えることもできる。
However, in the method of calculating the SPD from each time interval in FIG. 1, the calculation in 1-13 can be replaced as shown in FIG.

即ち,11−1ないし11−5においてクランク軸1回転
4パルスにより,4パルスごとの時間間隔で演算したSPD
を,11−6〜11−9においてそれぞれSPD0〜3となし,11
−10でその平均値をSPDとしてなましても良い。
That is, SPD calculated at time intervals of every four pulses in 11-1 to 11-5 using four pulses of one rotation of the crankshaft.
And SPDs 0 to 3 at 11-6 to 11-9, respectively.
At -10, the average value may be used as SPD.

また,この場合,時間間隔をTSPD0〜3とし,その平
均時間間隔からSPDを演算しても良い。
In this case, the time interval may be set to TSPD0 to TSPD3, and the SPD may be calculated from the average time interval.

次に,上記実施例では,割込み処理内でSPDの演算を
行っているが,割込み処理時間を短くする為,割込み内
ではパルス時間間隔計測にとどめ,SPD演算要求フラグセ
ットにより,メインルーチンにて,時間間隔よりSPDを
演算しても良い。
Next, in the above embodiment, the SPD calculation is performed in the interrupt processing. However, in order to shorten the interrupt processing time, only the pulse time interval measurement is performed in the interrupt, and the SPD calculation request flag is set in the main routine. , SPD may be calculated from the time interval.

また,上記実施例では,主に車速センサについて説明
したが,本発明は,各種回転数測定など,同種のチャタ
リング信号を含むセンサ入力に対しても適用できる。
In the above embodiment, the vehicle speed sensor is mainly described. However, the present invention can be applied to a sensor input including the same type of chattering signal such as various kinds of rotation speed measurement.

さらには,センサ自体のチャタリングはなくても,ハ
ード回路にて電源の変動,スレッショルド付近における
ヒステリシス以上のノイズ等に起因する,正規信号レベ
ル変化後の,不正信号に対するパルス入力処理回路とし
ても使用できる。
Furthermore, even if there is no chattering of the sensor itself, it can also be used as a pulse input processing circuit for an illegal signal after a normal signal level change due to fluctuations in power supply, noise above hysteresis near the threshold, etc. .

【図面の簡単な説明】[Brief description of the drawings]

第1図〜第6図は第1実施例を示し,第1図はそのフロ
ーチャート,第2図はタイムテーブル,第3図はブロッ
ク図,第4図〜第6図はHレベルとLレベルの割合が異
なる場合のタイムテーブル,第7図〜第12図は第2実施
例を示し,第7図及び第8図はそのフローチャート,第
9図〜第11図は種々のタイムテーブル,第12図は比較説
明用のタイムテーブル,第13図は第3実施例のフローチ
ャート,第14図及第15図は従来のハードによるチャタリ
ング取りの回路図及びタイムテーブル,第16図及び第17
図は従来のソフトによるチャタリング取りのフローチャ
ート及びタイムテーブル,第18図〜第21図は他の従来の
ソフトによるチャタリング取りのフローチャート及びタ
イムテーブルである。
1 to 6 show a first embodiment, FIG. 1 is a flowchart thereof, FIG. 2 is a time table, FIG. 3 is a block diagram, and FIGS. 4 to 6 are diagrams of H level and L level. FIGS. 7 to 12 show the second embodiment, in which the ratio is different, FIGS. 7 and 8 are flowcharts thereof, FIGS. 9 to 11 are various time tables, and FIG. 13 is a timetable for comparative explanation, FIG. 13 is a flowchart of the third embodiment, FIGS. 14 and 15 are circuit diagrams and timetables for chattering removal by conventional hardware, and FIGS.
The drawings are a flowchart and a time table of chattering removal by conventional software, and FIGS. 18 to 21 are a flowchart and a time table of chattering removal by other conventional software.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】センサから送られる繰り返し周波数のパル
ス信号を処理するパルス入力処理方法において, パルス信号の立ち上りエッジで割込みがかかる第1割込
モードと,立ち下りエッジで割込みがかかる第2割込モ
ードとを有し, 第1割込モードでは,前回の第1割込みと今回の第1割
込みとの間である第1時間間隔を計算して入力パルス周
期とすると共に, 第2割込みより第2一定時間内における第1割込モード
にて計算した第1時間間隔は入力パルス周期とせず, 上記第1時間間隔に,上記第2一定時間後の第1割込モ
ードにて計算した第1時間間隔を加算して入力パルス周
期とすることを特徴とするパルス入力処理方法。
1. A pulse input processing method for processing a pulse signal of a repetition frequency sent from a sensor, comprising: a first interrupt mode in which an interrupt is generated at a rising edge of the pulse signal; and a second interrupt mode in which an interrupt is generated at a falling edge of the pulse signal. In the first interrupt mode, a first time interval between the previous first interrupt and the present first interrupt is calculated and used as an input pulse period. The first time interval calculated in the first interrupt mode within the fixed time is not set to the input pulse period, but the first time interval calculated in the first interrupt mode after the second fixed time in the first time interval. A pulse input processing method comprising adding an interval to an input pulse period.
【請求項2】請求項1において,第1割込モードから第
1一定時間内に発生する第1割込みは無視することを特
徴とするパルス入力処理方法。
2. The pulse input processing method according to claim 1, wherein a first interrupt generated within a first fixed time from the first interrupt mode is ignored.
【請求項3】請求項1又は2において,上記入力パルス
周期を用いた演算処理は,上記第2割込モードにて行う
ことを特徴とするパルス入力処理方法。
3. The pulse input processing method according to claim 1, wherein the arithmetic processing using the input pulse cycle is performed in the second interrupt mode.
JP30354189A 1989-11-22 1989-11-22 Pulse input processing method Expired - Lifetime JP2751488B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30354189A JP2751488B2 (en) 1989-11-22 1989-11-22 Pulse input processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30354189A JP2751488B2 (en) 1989-11-22 1989-11-22 Pulse input processing method

Publications (2)

Publication Number Publication Date
JPH03163363A JPH03163363A (en) 1991-07-15
JP2751488B2 true JP2751488B2 (en) 1998-05-18

Family

ID=17922240

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30354189A Expired - Lifetime JP2751488B2 (en) 1989-11-22 1989-11-22 Pulse input processing method

Country Status (1)

Country Link
JP (1) JP2751488B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4591580B2 (en) 2008-02-07 2010-12-01 株式会社デンソー Periodic signal processor
JP5580185B2 (en) * 2010-12-20 2014-08-27 スタンレー電気株式会社 Rotary encoder signal processing method
CN112815967A (en) * 2021-01-20 2021-05-18 苏州长风航空电子有限公司 Digital encoder interrupt filtering method based on linux platform

Also Published As

Publication number Publication date
JPH03163363A (en) 1991-07-15

Similar Documents

Publication Publication Date Title
JP2003250201A (en) Grounding detector for vehicle
JP2002232492A (en) Circuit arrangement for error detection on two-wire data bus
JP2751488B2 (en) Pulse input processing method
JPS5925117B2 (en) Ignition closure circuit for internal combustion engines
JP3506116B2 (en) Engine control device
JPH0461184B2 (en)
JP2757787B2 (en) Receiver
KR100304545B1 (en) Method and apparatus for detecting and acquiring vehicle fuel injector voltage signal pulse width
JP3350063B2 (en) Misfire detection device for internal combustion engine and control device for internal combustion engine using this misfire detection device
JP3054073B2 (en) Speed detector
JPH09100772A (en) Misfire detection device of internal combustion engine
JPH025608B2 (en)
JP3223884B2 (en) Duty ratio determination circuit and duty ratio determination method
KR100598799B1 (en) Misfire detection apparatus of ignition coil on vehicle
JPS62112070A (en) Detecting device for wire breaking of sensor
JPH11343917A (en) Crank angle position detecting device
JP2002202002A (en) Automobile control device
JPH0467216B2 (en)
JP3477811B2 (en) Ignition control device for internal combustion engine
JPH0429415Y2 (en)
JPH0524058Y2 (en)
JP3621171B2 (en) Crank angle detection device
JPH0230931Y2 (en)
JPH041448A (en) Knocking detecting method and device thereof
JPS6161058A (en) Discrimination device for engine rotating speed of internal-combustion engine

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100227

Year of fee payment: 12