JPH0618024B2 - Contact encoder encoder reading method - Google Patents

Contact encoder encoder reading method

Info

Publication number
JPH0618024B2
JPH0618024B2 JP58017621A JP1762183A JPH0618024B2 JP H0618024 B2 JPH0618024 B2 JP H0618024B2 JP 58017621 A JP58017621 A JP 58017621A JP 1762183 A JP1762183 A JP 1762183A JP H0618024 B2 JPH0618024 B2 JP H0618024B2
Authority
JP
Japan
Prior art keywords
contact
switch
input
state
encoder
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
JP58017621A
Other languages
Japanese (ja)
Other versions
JPS59144938A (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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP58017621A priority Critical patent/JPH0618024B2/en
Publication of JPS59144938A publication Critical patent/JPS59144938A/en
Publication of JPH0618024B2 publication Critical patent/JPH0618024B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K5/00Manipulating of pulses not covered by one of the other main groups of this subclass
    • H03K5/125Discriminating pulses
    • H03K5/1252Suppression or limitation of noise or interference
    • H03K5/1254Suppression or limitation of noise or interference specially adapted for pulses generated by closure of switches, i.e. anti-bouncing devices

Landscapes

  • Physics & Mathematics (AREA)
  • Nonlinear Science (AREA)
  • Input From Keyboards Or The Like (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、マイクロコンピュータを用いてスイッチの状
態変化を検出するような場合に用いられる接点式エンコ
ーダスイッチ読取装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a contact type encoder switch reader used when detecting a change in the state of a switch using a microcomputer.

従来例の構成とその問題点 第1図にエンコーダスイッチの等価回路を示す。共通端
子COMと端子Aは抵抗1と接点Sと抵抗2で接続さ
れ、共通端子COMと端子Bは抵抗1と接点Sと抵抗
3で接続される。この接点S,Sが機械的に断続さ
れると、端子COMと端子A・B間の断続波形は、第2
図に示すようにチャタリングCを含む波形となる。
Configuration of Conventional Example and Problems Thereof FIG. 1 shows an equivalent circuit of an encoder switch. The common terminal COM and the terminal A are connected by a resistor 1 and a contact point S 1 and a resistor 2, and the common terminal COM and the terminal B are connected by a resistor 1 and a contact point S 2 and a resistor 3. When the contacts S 1 and S 2 are mechanically interrupted, the intermittent waveform between the terminal COM and the terminals A and B becomes the second
As shown in the figure, the waveform includes chattering C.

第2図で、右回しの場合は、まず接点Sが接触し、続
いて両接点S,Sが接触し、次に接点Sだけが接
触し、最後に両接点S,S共に離れる。左回しの場
合は、まず、S接点が接触し、続いて両接点S,S
が接触し、次に接点Sだけが接触し、最後に両接点
,S共に離れる。
In FIG. 2, in the case of clockwise rotation, the contact point S 1 is first contacted, then both contact points S 1 and S 2 are contacted, then only the contact point S 2 is contacted, and finally both contact points S 1 and S 2. Two separate together. In the case of turning counterclockwise, first the S 2 contacts come into contact, then both contacts S 1 , S
2 make contact, then only contact S 1 makes contact, and finally both contacts S 1 , S 2 separate.

この接点が断続する時にチャタリングCを生じるが、こ
のチャタリング時間は、スイッチの回転速度が速くなる
と短くなり、回転速度が遅くなると長くなるという比例
関係があり一定ではない。しかしながら、このチャタリ
ングCは2つの接点の位相がずれているため、第2図の
のように、片方の信号が安定し、もう一方の信号が
変化するまでには時間間隔があり、これは必ず時間的に
0より大きいという特性がある。
Chattering C occurs when this contact is intermittent, but this chattering time is not constant because there is a proportional relationship that it becomes shorter when the rotation speed of the switch becomes faster and becomes longer when the rotation speed becomes slow. However, in this chattering C, the two contacts are out of phase with each other, so that there is a time interval until one signal becomes stable and the other signal changes, as at t C in FIG. Always has a characteristic that it is larger than 0 in terms of time.

従来には、このようなチャタリングを含む信号を、第3
図のように、スイッチ4からチャタリング除去回路5
(抵抗とコンデンサによる積分回路)で処理を行なって
からパルス判別回路6で積分後の波形を検出し、位相検
出回路7で回転方向の判別を行なうようにしていた。
Conventionally, a signal containing such chattering is
As shown, the switch 4 to the chattering removal circuit 5
The pulse discriminating circuit 6 detects the waveform after integration after the processing by the (integrating circuit using resistors and capacitors), and the phase detecting circuit 7 discriminates the rotation direction.

しかし、このような方法では、チャタリング時間が一定
でないため、低速回転時と高速回転時で正常な動作を保
障することが困難であるという欠点があった。
However, such a method has a drawback that it is difficult to guarantee a normal operation at low speed rotation and high speed rotation because the chattering time is not constant.

発明の目的 本発明は、このような欠点を除去するものであり、さら
に、ソフトウェアで処理を行うようにすることにより、
ハードウェアの簡素化がはかれ、また簡単な変更で応用
範囲も広い接点式エンコーダスイッチで読取装置を提供
することを目的とする。
OBJECT OF THE INVENTION The present invention eliminates such drawbacks, and further, by performing processing by software,
It is an object of the present invention to provide a reading device with a contact-type encoder switch that has a wide range of applications with simple modification of hardware.

発明の構成 本発明においては、ソフトウェアでスイッチの現在の状
態を読み取り直前の状態と比較検出することにより順次
供給される第1と第2の接点の開閉状態の4通りの組合
せ判別データを所望の順序数に対応した状態信号に変換
処理し、順序数の最後の数に対応する判別データによつ
て右回りか左回りかを判定し、チャタリング或いはスイ
ッチの途中反転等により不所望の入力があった場合に
は、右回りとも左回りとも判定しないように構成したも
のである。
Configuration of the Invention In the present invention, four kinds of combination discrimination data of the open / closed states of the first and second contacts, which are sequentially supplied by comparing and detecting the current state of the switch with the state immediately before being read by software, are desired. It is converted to a status signal corresponding to the ordinal number, and it is determined whether it is clockwise or counterclockwise according to the discrimination data corresponding to the last number of the ordinal number, and there is an undesired input due to chattering or inversion of the switch. In the case of a right turn, it is configured such that neither right turn nor left turn is determined.

実施例の説明 第4図に本発明を等価的にハードウェアで構成した場合
の一実施例のブロック図を示す。第1図に示す構成のス
イッチ8より入力読取回路9へ入力された信号により、
入力読取手段(回路)9は入力情報を状態判別手段(回
路)10へ送る。この状態判別手段(回路)10は各時
点において4つの状態を判別し、それぞれの状態の処理
手段(回路)11〜14へ情報を渡す。そして、これら
の処理手段(回路)11〜14の結果を、判別結果出力
手段(回路)15へ渡し、右回り・左回りの判別結果を
出力する。
Description of Embodiments FIG. 4 shows a block diagram of an embodiment in which the present invention is equivalently configured by hardware. By the signal input to the input reading circuit 9 from the switch 8 having the configuration shown in FIG.
The input reading means (circuit) 9 sends the input information to the state determination means (circuit) 10. This state determination means (circuit) 10 determines four states at each time point and passes information to the processing means (circuits) 11 to 14 of each state. Then, the results of these processing means (circuits) 11 to 14 are passed to the discrimination result output means (circuit) 15 to output the clockwise / counterclockwise discrimination results.

ここで、4つの状態とは、第5図において、両接点
,Sが共に離れている状態(以下、状態をTと略
す)をT=0とし、次にどちらかの接点S,Sが接
続された時をT=1とし、次に両接点S,S共に接
続された時をT=2とし、さらにその後、初めに接続さ
れた接点S,Sと反対の接点S,Sが離れた時
をT=3とし、再び両接点S,Sが離れると元のT
=0とする。
Here, the four states are T = 0 when both contacts S 1 and S 2 are separated from each other in FIG. 5 (hereinafter, the state is abbreviated as T), and then either contact S 1 , S 2 are connected, T = 1, then both contacts S 1 , S 2 are connected, T = 2, and then the first connected contacts S 1 , S 2 are opposite. When the contact points S 2 and S 1 of the two are separated, T = 3, and when the contact points S 1 and S 2 are separated again, the original T
= 0.

ここで、チヤタリングCを生じている期間Tは、直前
がT=0で直後がT=1のときはT=0か1で、直前
がT=1で直後がT=2のときはT=1か2で、直前
がT=2で直後がT=3のときはチャタリング期間もT
=3で、直前がT=3で直後がT=0のときはT
0か1である。
Here, the period T X in which the chattering C is occurring is T X = 0 or 1 when T = 0 immediately before and T = 1 immediately after, and when T = 1 immediately before and T = 2 immediately after. If T X = 1 or 2, T = 2 immediately before and T = 3 immediately after, the chattering period is also T.
When X = 3, T = 3 immediately before, and T = 0 immediately after, T X =
It is 0 or 1.

次に、本動作をマイクロコンピュータを用いて実施する
ときのフローチャートを第6図に示す。第6図で入力=
(0,0)は両接点S,S共に離れていることを示
し、入力=(1.0)は接点Sが接続されていて、接
点Sは離れていることを示し、入力=(0,1)は接
点Sが接続されていて、接点Sが離れていることを
示し、入力=(1,1)は両接点S,S共に接続さ
れていることを示す。
Next, FIG. 6 shows a flowchart when this operation is carried out using a microcomputer. Input in Figure 6 =
(0,0) indicates that both contacts S 1 and S 2 are separated, and input = (1.0) indicates that contact S 1 is connected and contact S 2 is separated. = (0,1) indicates that the contact S 2 is connected and the contact S 1 is separated, and input = (1,1) indicates that both contacts S 1 and S 2 are connected. .

第6図で、まず入力=(0,0)の場合をT=0とす
る。次に、入力=(0,1)又は入力=(1,0)で直
前のTがT=0の場合にT=1とし、その時の入力を保
存しておく。次に入力=(1,1)の時にはT=2に変
更する。さらに入力=(1,0)又は入力=(0,1)
の時でかつ直前のTがT=2の場合には、保存していた
入力データと今の入力が同一か否かを比較し、同じ場合
には、T=2の状態からスイッチの回転方向を換えたも
のと判断し、そのまま戻り、保存データと今のデータが
異なる時にはT=3にし、今の入力=(0,1)ならば
右回りと判断し、今の入力=(1,0)ならば左回りと
判断する。
In FIG. 6, it is assumed that T = 0 when input = (0,0). Next, when input = (0,1) or input = (1,0) and the immediately preceding T is T = 0, T = 1 is set, and the input at that time is saved. Next, when input = (1,1), change to T = 2. Further input = (1,0) or input = (0,1)
When the previous T is T = 2, the stored input data and the current input are compared to see if they are the same. If they are the same, the switch rotation direction is changed from the state of T = 2. If the current data is different from the saved data, T = 3 is set. If the current input = (0,1), it is determined to be clockwise, and the current input = (1,0 If it is), it is judged to be counterclockwise.

かくして、各状態を判別し、その直前の状態と比較する
ことによって右回りと左回りとを判断するので、接点S
,Sにチャタリング等があった場合は、判別データ
に対応する状態信号が不所望の入力となり、検出信号が
出力されず、チャタリングがあっても右回りとも左回り
とも判定しない。そのため、チャタリング等に影響され
ず正確な判別ができる。
Thus, since each state is discriminated and it is determined whether the state is clockwise or counterclockwise by comparing with the state immediately before that, the contact S
If there is chattering or the like in 1 and S 2 , the state signal corresponding to the determination data becomes an undesired input, the detection signal is not output, and neither chattering nor clockwise rotation is determined. Therefore, accurate determination can be performed without being affected by chattering or the like.

発明の効果 以上のように、本発明はスイッチの現在の状態を読み取
り、直前の状態と比較検出することにより、状態判別手
段の判別データの変化に対応して状態処理手段が状態信
号を順次発生し状態信号の最終値に対応する判別データ
に基づいて右回りか左回りかを判定するようにしたの
で、スイッチの回し方によって時間が一定しないチャタ
リング或いはスイッチの途中反転等により不所望の順序
で入力された信号に対しても、誤動作をしない安定した
スイッチの読み取り装置を構成することが可能である。
As described above, according to the present invention, the current state of the switch is read, and the current state of the switch is compared and detected with the state immediately before, so that the state processing means sequentially generates the state signals in response to changes in the discrimination data of the state discrimination means. Since it is decided whether to turn clockwise or counterclockwise based on the discrimination data corresponding to the final value of the state signal, the time is not constant depending on the way the switch is turned, or in an undesired order due to chattering or inversion of the switch midway. It is possible to configure a stable switch reader that does not malfunction even with respect to an input signal.

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

第1図は接点式エンコーダスイッチの等価回路図、第2
図は第1図のスイッチの断続タイミング図、第3図は従
来例の接点式エンコーダスイッチ読取回路のブロック
図、第4図は本発明の一実施例における接点式エンコー
ダスイッチ読取装置を等価的にハードウェアで示したブ
ロック図、第5図はそのスイッチの状態を示すタイミン
グ図、第6図は同装置の動作を説明するためのフローチ
ャートである。 S,S……接点、9……入力読み取り回路、10…
…状態判別回路、11,12,13,14……処理回
路、15……判別結果出力回路。
FIG. 1 is an equivalent circuit diagram of a contact encoder switch, and FIG.
1 is a block diagram of a switch of FIG. 1, FIG. 3 is a block diagram of a conventional contact type encoder switch reading circuit, and FIG. 4 is an equivalent view of a contact type encoder switch reading device according to an embodiment of the present invention. FIG. 5 is a block diagram shown in hardware, FIG. 5 is a timing diagram showing the state of the switch, and FIG. 6 is a flow chart for explaining the operation of the device. S 1, S 2 ...... contact, 9 ...... input reading circuit, 10 ...
... State discrimination circuit, 11, 12, 13, 14 ... Processing circuit, 15 ... Discrimination result output circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】第1と第2の接点からなる接点式エンコー
ダスイッチの開閉状態(ON,OFF)を前記第1と第2の接点
(S1,S2)の開閉状態の4通りの組合せデータ{(0,0),
(0,1),(1,1),(1,0)}として判別し、 前記判別データを、前記第1と第2のスイッチが共に開
状態の時を基数(0)として、判別データ又は前に設定さ
れた状態信号の順序数に基づいて所望の順序数{T(S1,
S2)=i(i=0,1,2,3)}に変換処理し、 前記状態信号{T(S1,S2)=i}が順序数の最後の数(i=
3)に該当する場合に、該最後の順序数(i=3)に対応する
判別データ(S1,S2)によってスイッチの右回りか、左回
りかを判定し、その結果に基づいて右回りフラッグ或い
は左回りフラッグを発生するようにしたことを特徴とす
る接点式エンコーダスイッチの読み取り方法。
1. An open / closed state (ON, OFF) of a contact-type encoder switch including first and second contacts is defined as the first and second contacts.
Four combinations of open / closed states of (S1, S2) {(0,0),
(0,1), (1,1), (1,0)}, and the discrimination data is the discrimination data with the radix (0) when both the first and second switches are open. Or a desired ordinal number {T (S1,
S2) = i (i = 0,1,2,3)}, and the state signal {T (S1, S2) = i} is the last number (i =
In the case of 3), it is determined whether the switch is clockwise or counterclockwise by the discrimination data (S1, S2) corresponding to the last ordinal number (i = 3), and the clockwise flag is determined based on the result. Alternatively, a contact-type encoder switch reading method is characterized in that a counterclockwise flag is generated.
JP58017621A 1983-02-04 1983-02-04 Contact encoder encoder reading method Expired - Lifetime JPH0618024B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58017621A JPH0618024B2 (en) 1983-02-04 1983-02-04 Contact encoder encoder reading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58017621A JPH0618024B2 (en) 1983-02-04 1983-02-04 Contact encoder encoder reading method

Publications (2)

Publication Number Publication Date
JPS59144938A JPS59144938A (en) 1984-08-20
JPH0618024B2 true JPH0618024B2 (en) 1994-03-09

Family

ID=11948937

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58017621A Expired - Lifetime JPH0618024B2 (en) 1983-02-04 1983-02-04 Contact encoder encoder reading method

Country Status (1)

Country Link
JP (1) JPH0618024B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0325520A (en) * 1989-06-23 1991-02-04 Yagi Antenna Co Ltd Data input system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5391629A (en) * 1977-01-24 1978-08-11 Casio Comput Co Ltd Switching unit

Also Published As

Publication number Publication date
JPS59144938A (en) 1984-08-20

Similar Documents

Publication Publication Date Title
JPS6150329B2 (en)
US5278462A (en) Threshold crossover detector with improved digital noise rejection
JPH0618024B2 (en) Contact encoder encoder reading method
JP3207392B2 (en) Data storage control circuit
JPH038126B2 (en)
JP3475589B2 (en) Signal reading device
JP2583446B2 (en) Clock signal stop detection circuit
KR940002718Y1 (en) Pulse width detecting circuit
JPH0138996Y2 (en)
JP2906850B2 (en) Time-division switch monitoring circuit
SU1675874A1 (en) Data input device
JPH05223594A (en) Transfer information detector using encoder
SU1501064A1 (en) Device for monitoring pulse sequences
JPH0327425A (en) Input discrimination system by micro computer
JP3491372B2 (en) Failure detection method of input capture circuit
JPH0731630Y2 (en) External event count circuit
JPS63145599A (en) Alarm detection circuit
JPH03252526A (en) Sensor output circuit
RU1805470C (en) Output unit of tester for digital units
JPH0629801A (en) Chatting prevention circuit
JPS6335465Y2 (en)
JPH0323846B2 (en)
SU1285578A2 (en) Clock synchronizing device
SU1458984A1 (en) Apparatus for automatic monitoring of orientation of microcircuits
JPH0333612A (en) Detecting method of rotating direction of rotary input means