JPH0423846B2 - - Google Patents

Info

Publication number
JPH0423846B2
JPH0423846B2 JP58192927A JP19292783A JPH0423846B2 JP H0423846 B2 JPH0423846 B2 JP H0423846B2 JP 58192927 A JP58192927 A JP 58192927A JP 19292783 A JP19292783 A JP 19292783A JP H0423846 B2 JPH0423846 B2 JP H0423846B2
Authority
JP
Japan
Prior art keywords
period
signal
time
measurement
output
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
JP58192927A
Other languages
Japanese (ja)
Other versions
JPS6084013A (en
Inventor
Hisatoshi Nodera
Hidehiro Fukumoto
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.)
Omron Corp
Original Assignee
Omron Tateisi Electronics Co
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 Omron Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP58192927A priority Critical patent/JPS6084013A/en
Publication of JPS6084013A publication Critical patent/JPS6084013A/en
Publication of JPH0423846B2 publication Critical patent/JPH0423846B2/ja
Granted legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/941Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated using an optical detector

Landscapes

  • Geophysics And Detection Of Objects (AREA)
  • Electronic Switches (AREA)

Description

【発明の詳細な説明】 発明の分野 本発明は送信部と受信部が分離され、その間の
物体の通過を検出する分離型の無接点スイツチに
関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a separate type non-contact switch in which a transmitter and a receiver are separated and detect passage of an object between them.

従来技術とその問題点 光や超音波を利用して物体を検出する無接点ス
イツチには、送信部と受信部が一体に形成された
反射型や溝型の無接点スイツチと、送信部及び受
信部が物体を検出する位置を介して対向して配置
される透過型等の分離型無接点スイツチがある。
送受信部が一体となつた無接点スイツチでは、通
常受信信号に重畳される雑音成分を除去するため
に送信部をパルス駆動し、受信部を送信部に同期
させてパルス波に対応して得られる受信信号成分
のみを取り出す同期方式が用いられている。とこ
ろが分離型の無接点スイツチでは、送信部と受信
部が分離して配置されるために同期方式にしよう
とすれば送受信部間に同期信号用ケーブルを配設
する必要があり、構造が複雑になるという問題点
がある。従つて多くの場合非同期式が採用されて
いるが非同期式では雑音の影響を受け易く、その
影響をできるだけ、除くために受信部の応答時間
を遅くするといつた対策が施されている。このよ
うな場合に一体型の無接点スイツチのように高速
応答ができず、物体の検出が遅れるという問題が
あつた。
Conventional technology and its problems Non-contact switches that detect objects using light or ultrasonic waves include reflection-type or groove-type non-contact switches in which a transmitting part and a receiving part are integrally formed, and contactless switches in which a transmitting part and a receiving part are integrally formed. There is a separation type non-contact switch, such as a transmission type, in which the parts are arranged opposite to each other across the object detection position.
In a non-contact switch with an integrated transmitting and receiving section, the transmitting section is driven in pulses to remove the noise components that are normally superimposed on the received signal, and the receiving section is synchronized with the transmitting section to obtain a signal corresponding to the pulse wave. A synchronization method is used that extracts only the received signal components. However, in a separate type non-contact switch, the transmitting section and the receiving section are placed separately, so if a synchronization method is used, it is necessary to install a synchronization signal cable between the transmitting and receiving sections, making the structure complicated. There is a problem with that. Therefore, in many cases, an asynchronous type is used, but the asynchronous type is easily affected by noise, and countermeasures such as slowing down the response time of the receiving section are taken to eliminate this effect as much as possible. In such cases, there was a problem that the switch could not respond as quickly as an integrated non-contact switch, resulting in a delay in object detection.

発明の目的 本発明はこのような分離型無接点スイツチの問
題点を解消するものであつて、同期信号用のケー
ブルを用いることなく受信部側で送信信号に基づ
いて同期信号を発生させ、同期式として動作させ
ることができる無接点スイツチを提供するもので
あり、特に電源投入時に誤りなく送信信号の周期
を測定するようにした無接点スイツチを提供する
ものである。
Purpose of the Invention The present invention solves the problems of such a separate type non-contact switch, and the purpose of the present invention is to generate a synchronization signal based on a transmitted signal on the receiver side without using a synchronization signal cable, and to perform synchronization. The object of the present invention is to provide a non-contact switch that can be operated as a conventional switch, and in particular, to provide a non-contact switch that can measure the period of a transmitted signal without error when the power is turned on.

発明の構成と効果 本発明は所定周期でパルス駆動される信号を受
信する受信素子と、電源投入して所定時間の経過
後受信素子から得られる受信信号の所定範囲内に
ある周期を測定すると共に、当該周期の信号と実
質的に同一周期の信号を引続き受信したときに開
始測定周期とする開始周期測定手段と、開始周期
測定手段による周期測定後、所定時間毎に受信素
子から得られる受信信号の周期を測定する断続周
期測定手段と、開始周期測定手段及び断続周期測
定手段により測定した最新の周期を有する同期信
号を発生させる同期信号発生手段と、同期信号発
生手段により発生する同期信号により受信素子の
受信出力を検知する出力手段と、を具備すること
を特徴とするものである。
Structure and Effects of the Invention The present invention includes a receiving element that receives a pulse-driven signal at a predetermined period, and a period within a predetermined range of the received signal obtained from the receiving element after a predetermined time has elapsed after turning on the power. , a start period measuring means that determines a start measurement period when a signal having substantially the same period as the signal of the period is successively received; and a reception signal obtained from the receiving element at predetermined time intervals after the period is measured by the start period measurement means. an intermittent period measuring means for measuring the period of the period, a synchronizing signal generating means for generating a synchronizing signal having the latest period measured by the starting period measuring means and the intermittent period measuring means, and a synchronizing signal generated by the synchronizing signal generating means. The device is characterized by comprising an output means for detecting the reception output of the element.

このような特徴を有する本発明によれば、送信
部から受信部に同期信号を伝送する必要がなくし
かも同期信号を伝送した場合と同様に雑音の影響
を受けにくく誤動作することがない無接点スイツ
チを得ることが可能である。又電源投入時にはあ
らかじめ記憶してある所定範囲内の周期を測定周
期とすると共に、引き続いて実質的に同一の周期
の受信信号を受信した時にのみ測定周期として、
以後それと同一の同期信号を発生させるようにし
ているので電源投入時にも周期を正確に測定する
ことが可能となる。又受信部側では受信信号に基
づいて同期信号を発生させているが、その同期信
号は所定時間毎に更新して前回測定した周期デー
タと入れ変えるようにしているので温度変化等に
よる送信パルスの周期の変動に追従することが可
能となり、安定した同期信号を得ることが可能と
なる。
According to the present invention having such characteristics, there is provided a non-contact switch that does not require transmitting a synchronization signal from the transmitter to the receiver, and is less susceptible to noise and does not malfunction in the same way as when transmitting a synchronization signal. It is possible to obtain Furthermore, when the power is turned on, a cycle within a predetermined range stored in advance is set as the measurement cycle, and only when a reception signal of substantially the same cycle is subsequently received, the measurement cycle is set as the measurement cycle.
Since the same synchronizing signal is generated thereafter, it is possible to accurately measure the period even when the power is turned on. In addition, the receiving section generates a synchronization signal based on the received signal, but the synchronization signal is updated at predetermined intervals and replaced with the previously measured periodic data, so the transmission pulse may be affected by changes in temperature, etc. It becomes possible to follow fluctuations in the period, and it becomes possible to obtain a stable synchronization signal.

実施例の説明 第1図は本発明による無接点スイツチの一実施
例を示すブロツク図である。本実施例を透過型の
光電スイツチとすると投光部には発光ダイオード
等の投光素子1とその投光素子1をパルス状に駆
動する投光回路2が設けられる。そしてこの投光
部と所定間隔を隔てて受光部が設けられる。受光
部の前面には投光素子の光を受光して電気信号に
変換するフオトトランジスタやフオトダイオード
等の受光素子3が設けられ、その出力は受光回路
4に与えられる。受光回路4は受光素子3に得ら
れた受光信号を増幅するものであつて、その出力
は直流分を遮断するカツプリングコンデンサ5を
介してコンパレータ6に与えられる。コンパレー
タ6は所定のスレツシユホールドレベルにより受
光信号を弁別して受光信号を整形し方形波信号と
するものであつて、その出力は本発明による同期
信号発生部7とゲート回路8に与えられる。同期
信号発生部7はマイクロプロセツシングユニツト
(以下MPUという)9とその演算処理手順及び一
時的なデータを保持するメモリ10を有してお
り、コンパレータ6の出力はI/Oポート11を
介してMPU9に与えられる。同期信号発生部7
は又MPU9を駆動するクロツク発生器13、及
びそのクロツクを計数し受光回路4より得られる
パルスの周期を測定するカウンタ14を有してい
る。同期信号発生部7は後述するように受光信号
に含まれているパルスの周期を設定することによ
つて疑似的な同期信号を発生するものであつて、
MPU9が発生する同期信号出力はI/Oポート
12を介してゲート回路8に与えられる。ゲート
回路8はその同期信号とコンパレータ6より与え
られる受光信号との論理積を出力回路15に与え
るものである。出力回路15はゲート回路8より
所定数の出力パルスが与えられた場合にのみ物体
検知信号を出力するものである。
DESCRIPTION OF EMBODIMENTS FIG. 1 is a block diagram showing an embodiment of a non-contact switch according to the present invention. If this embodiment is a transmission type photoelectric switch, the light projecting section is provided with a light projecting element 1 such as a light emitting diode and a light projecting circuit 2 that drives the light projecting element 1 in a pulsed manner. A light receiving section is provided at a predetermined distance from the light projecting section. A light-receiving element 3 such as a phototransistor or a photodiode is provided on the front surface of the light-receiving section and receives light from a light-emitting element and converts it into an electrical signal, and its output is given to a light-receiving circuit 4. The light-receiving circuit 4 amplifies the light-receiving signal obtained by the light-receiving element 3, and its output is given to a comparator 6 via a coupling capacitor 5 that blocks direct current. The comparator 6 discriminates the received light signal using a predetermined threshold level and shapes the received light signal into a square wave signal, and its output is given to the synchronization signal generator 7 and gate circuit 8 according to the present invention. The synchronization signal generation section 7 has a microprocessing unit (hereinafter referred to as MPU) 9 and a memory 10 for storing its arithmetic processing procedures and temporary data. and is given to MPU9. Synchronization signal generator 7
It also has a clock generator 13 for driving the MPU 9, and a counter 14 for counting the clock and measuring the cycle of pulses obtained from the light receiving circuit 4. The synchronization signal generator 7 generates a pseudo synchronization signal by setting the period of the pulse included in the received light signal, as will be described later.
A synchronization signal output generated by the MPU 9 is given to the gate circuit 8 via the I/O port 12. The gate circuit 8 provides the output circuit 15 with the AND of the synchronization signal and the light reception signal provided by the comparator 6. The output circuit 15 outputs an object detection signal only when a predetermined number of output pulses are given from the gate circuit 8.

第2図はメモリ10のメモリマツプを示す図で
ある。本図においてリードオンリメモリ等の固定
記憶領域にMPU9の演算処理手順を記憶するプ
ログラム領域を有し、更に投光部より与えられる
信号の周期は経年変化やその周囲の温度、電圧等
により異なるので、その最少値T01、最大値
T02、及び一旦測定した周期が温度変化等によつ
て徐々に微少時間だけ変動すると考えられるの
で、その変動時間に応じた偏差ΔTの記憶領域に
有している。更に書換え可能な記憶領域に同期信
号発生部7で発生する同期信号の信号幅の1/2の
時間をΔT′として記憶し、測定した周期Ti、周期
計測時に用いられ周期を計測する範囲を定める測
定開始時間Ts、測定終了時間Teを記憶する領域
と測定時の同期信号時間を定める測定時同期信号
時間TT領域及び同期信号計数カウンタNの領域
が設けられる。
FIG. 2 is a diagram showing a memory map of the memory 10. In this figure, a fixed storage area such as a read-only memory has a program area that stores the arithmetic processing procedures of the MPU 9, and the period of the signal given from the light emitter varies depending on changes over time, surrounding temperature, voltage, etc. , its minimum value T01, maximum value
Since T02 and the period once measured are thought to gradually fluctuate by a minute amount of time due to temperature changes, etc., it is stored in the storage area of the deviation ΔT corresponding to the fluctuation time. Further, in a rewritable storage area, the time of 1/2 of the signal width of the synchronizing signal generated by the synchronizing signal generating section 7 is stored as ΔT', and the measured period Ti and the range used for measuring the period are determined. An area for storing measurement start time Ts and measurement end time Te, a measurement synchronization signal time TT area for determining synchronization signal time during measurement, and a synchronization signal counter N area are provided.

次に本実施例の動作についてフローチヤート及
び波形図を参照しつつ説明する。フローチヤート
において引出し線を用いて示す番号はMPU9の
動作ステツプ又はサブルーチンを示すものであ
る。第3図は動作開始以後のMPU9の処理を示
すフローチヤートであり、第4図、第5図は電源
投入後の各部の波形を示す波形図である。これら
の図において動作を開始するとまずルーチン20
においてMPU9の初期処理、即ちI/Oポート
11,12の入出力の定義、MPU9内のプログ
ラムカウンタの設定、スタツクポインタの設定等
の処理を行い、そのためのリセツト時間が終了す
るとステツプ21に進んでコンパレータ6より
I/Oポート11を介して入力信号が得られるか
どうかをチエツクする。前述したように投光回路
2は投光素子1をパルス状に駆動しており、投光
素子1と受光素子3とが光軸を合わせて設置され
ている場合にはその間を遮る物体がなければ受光
素子3に受光信号が得られ、受光信号は第4図
b,cに示すように受光回路4によつて増幅され
コンパレータ6により方形波信号に変換されてい
る。従つて受光信号に基づいてMPU9に入力信
号が与えられる。第4図cに示すようにリセツト
時間の経過後、時刻t1に入力信号があればステツ
プ22に進んでカウンタ14によりクロツク発生器
13のクロツク信号の計数を開始する。そしてス
テツプ23においてカウンタ14により計数を開始
した後、メモリ10に記憶してある予期される周
期の最小値T01の時間の経過を待ち受け、その時
間T01が経過すれば更にコンパレータ6よりI/
Oポート11を介して入力が与えられるかどう
か、及びカウンタ14の計数値が予想される周期
の最大値T02に達したかどうかをチエツクする
(ステツプ24、25)。周期の最大値T02以上となつ
ても入力が得られない場合には投光素子1と受光
素子3間を物体が通過し光を遮断していると考え
られるのでステツプ21に戻つて同様の処理を繰り
返し、周期の最大値T02に達する以前の時刻t2に
コンパレータ6より入力が与えられればステツプ
24を介してステツプ26に進み、その時のカウンタ
14の計数値T11を測定した周期としてメモリ1
0の測定周期領域Tに書き込む。そしてステツプ
27において再びカウンタ14をリセツトして周期
の計数を開始すると共に、記憶したこの測定周期
T11から微少偏差ΔTを減算した値、及び偏差ΔT
を加算した値を夫々周期の測定開始時間Ts、及
び測定終了時間Teとして夫々メモリ10に記憶し
ておく(ステツプ28、29)。そしてステツプ30に
進みカウンタ14の計数値が測定開始時間Tsの
値に達したかどうかをチエツクする。測定開始時
間Tsに達した場合にはステツプ31、32に進んで
コンパレータ6より入力を待ち受け、再びコンパ
レータ6の出力によつて周期測定を行う。このよ
うに続けて周期測定を行うのは電源投入時に測定
した周期が誤つていれば、以後全ての動作におい
て誤つた、同期信号を出力することとなつて正常
な動作が期待できないので正確な周期を測定して
おく必要があるためである。そしてカウンタ14
の計数値が測定終了時間Teに達するまでの時間
t3にコンパレータ6より入力が与えられれば、ス
テツプ33に進んでその時のカウント値T12を電源
投入後に測定した周期として測定周期領域Tに書
き込む。そしてステツプ34において再びカウンタ
14をリセツトして計数を開始し、ステツプ35、
36において周期の測定開始時間Ts,測定終了時
間Teを同様に測定しておく。そしてステツプ37
に進み周期を測定するパルス間隔を定めるソフト
ウエアカウンタである同期信号計数カウンタNを
0とする。更にステツプ38にカウンタ14の計数
値がTi(最初のループではT12)となるかどうか
をチエツクし、Tiとなればカウンタ14をリセ
ツトすると共に再び計数を開始し(ステツプ39)、
同期パルスを出力する。出力回路15がコンパレ
ータ出力6の立ち下がりによつてトリガされるも
のとすると、同期パルスはその立ち下がり位置を
含む出力パルスを形成するようにし、そのパルス
をI/Oポート12を介してゲート回路8に与え
る。ステツプ40においてこの同期パルスを発生さ
せるとステツプ41と進んで同期信号計数カウンタ
Nをインクリメントし、ステツプ42に進んでその
同期信号計数カウンタNが所定値、例えば7とな
るかどうかをチエツクする。これが所定値でなけ
ればステツプ38に戻つて同様の処理を繰り返し、
同期信号発生部7より疑似的な同期信号を発生さ
せる。そして同期信号計数カウンタNが設定値、
例えば7となればルーチン43に進んで再び投光
回路2より得られる受光信号の周期を測定する。
Next, the operation of this embodiment will be explained with reference to a flowchart and waveform diagram. Numbers indicated using lead lines in the flowchart indicate operational steps or subroutines of the MPU 9. FIG. 3 is a flowchart showing the processing of the MPU 9 after the start of operation, and FIGS. 4 and 5 are waveform diagrams showing waveforms of various parts after power is turned on. In these figures, when the operation starts, the routine 20 is first executed.
In this step, the initial processing of the MPU 9, that is, the definition of input/output of the I/O ports 11 and 12, the setting of the program counter in the MPU 9, the setting of the stack pointer, etc., is performed, and when the reset time for this ends, the process proceeds to step 21. Then, it is checked whether an input signal can be obtained from the comparator 6 via the I/O port 11. As mentioned above, the light emitting circuit 2 drives the light emitting element 1 in a pulsed manner, and when the light emitting element 1 and the light receiving element 3 are installed with their optical axes aligned, there must be an object blocking the gap between them. For example, a light-receiving signal is obtained by the light-receiving element 3, and the light-receiving signal is amplified by the light-receiving circuit 4 and converted into a square wave signal by the comparator 6, as shown in FIGS. 4b and 4c. Therefore, an input signal is given to the MPU 9 based on the light reception signal. As shown in FIG. 4c, after the reset time has elapsed, if there is an input signal at time t1, the process proceeds to step 22 and the counter 14 starts counting the clock signal of the clock generator 13. After the counter 14 starts counting in step 23, it waits for the elapse of the minimum value T01 of the expected period stored in the memory 10, and when the time T01 has elapsed, the comparator 6 further detects the I/O
It is checked whether an input is given through the O port 11 and whether the count value of the counter 14 has reached the maximum value T02 of the expected period (steps 24, 25). If no input is obtained even when the period exceeds the maximum value T02, it is considered that an object has passed between the light emitter element 1 and the light receiver element 3 and is blocking the light, so return to step 21 and repeat the same process. is repeated, and if an input is given from comparator 6 at time t2 before reaching the maximum period value T02, step
24, the process advances to step 26, and the count value T11 of the counter 14 at that time is stored in the memory 1 as the measured period.
Write in measurement period area T of 0. and step
At 27, the counter 14 is reset again to start counting the period, and the memorized measurement period is
The value obtained by subtracting the minute deviation ΔT from T11, and the deviation ΔT
The added values are stored in the memory 10 as the measurement start time Ts and the measurement end time Te of each cycle (steps 28 and 29). Then, the process proceeds to step 30, and it is checked whether the count value of the counter 14 has reached the value of the measurement start time Ts. When the measurement start time Ts has been reached, the process advances to steps 31 and 32 to wait for an input from the comparator 6, and perform cycle measurement again based on the output of the comparator 6. The reason for continuously measuring the period in this way is that if the period measured when the power is turned on is incorrect, an incorrect synchronization signal will be output in all subsequent operations, and normal operation cannot be expected. This is because it is necessary to measure the period. and counter 14
The time it takes for the count value to reach the measurement end time Te
If an input is given to t3 from the comparator 6, the process proceeds to step 33, where the count value T12 at that time is written in the measurement period area T as the period measured after the power is turned on. Then, in step 34, the counter 14 is reset again to start counting, and in step 35,
36, measure the cycle measurement start time Ts and measurement end time Te in the same way. And step 37
The program proceeds to step 1, and sets the synchronizing signal counter N, which is a software counter that determines the pulse interval for measuring the period, to 0. Furthermore, in step 38, it is checked whether the counted value of the counter 14 becomes Ti (T12 in the first loop), and if it becomes Ti, the counter 14 is reset and counting starts again (step 39).
Outputs synchronization pulse. Assuming that the output circuit 15 is triggered by the falling edge of the comparator output 6, the synchronization pulse is made to form an output pulse that includes the falling position, and the pulse is sent to the gate circuit via the I/O port 12. Give to 8. When this synchronizing pulse is generated in step 40, the process proceeds to step 41, where the synchronous signal counting counter N is incremented, and the process proceeds to step 42, where it is checked whether the synchronous signal counting counter N reaches a predetermined value, for example, 7. If this is not the predetermined value, return to step 38 and repeat the same process.
A pseudo synchronization signal is generated from the synchronization signal generator 7. Then, the synchronization signal count counter N is the set value,
For example, if it is 7, the routine goes to routine 43 and the period of the light reception signal obtained from the light projection circuit 2 is measured again.

第5図はステツプ21〜36までの最初の周期を測
定する時間に受信信号にノイズが重畳された場合
の波形図である。本図cに示すように時刻t4にス
テツプ21において入力を検知した後、計数が開始
され最小値T01に時間の経過後ステツプ24,25に
おいて周期の終了を待ち受けている間の時刻t5に
受光回路4からの雑音によつてコンパレータ6が
出力を出した場合にその時のカウント値T13が測
定周期として測定周期領域Tに書き込まれる(ス
テツプ26)。そしてこの測定周期T13を基準とし
てステツプ28、29において周期の測定開始時間
Ts及び測定終了時間Teが演算され、測定開始時
間Tsが経過すればステツプ31、32に進んでコン
パレータより次の周期信号が与えられるかどうか
をチエツクする。しかしこの場合にはノイズによ
つて測定された誤つた周期T13によつて測定開始
時間Ts、測定終了時間Teが演算されているの
で、ステツプ31、32のループで周期の測定を検知
している時間帯にはコンパレータ6より入力が与
えられることはないと判断される。従つてこの場
合にはステツプ32を介してステツプ21に戻り再び
最初から周期測定が開始される。そして時刻t6に
入力があればその時点からカウンタ14は計数を
開始し(ステツプ22)、予想される周期の最小値
T01と最大値T02間で得られる周期T14を測定周
期領域Tに書き込む。そしてこの時刻t7に正しい
コンパレータからの出力によつて測定が開始され
たものとすると、その測定した周期に基づいてス
テツプ28、29により測定開始時間Ts、測定終了
時間Teが演算されるので、Ts、Teの時間内に物
体によつて光が遮られない限りコンパレータ6よ
り出力が与えられる。従つてその場合にはステツ
プ31を介してステツプ33に進んで、その時刻t8の
周期測定値T15を測定した周期として測定周期領
域Tに書き込む。そして同様にして時刻t8以後ス
テツプ37〜43のループにおいて疑似同期信号を発
生させる。
FIG. 5 is a waveform diagram when noise is superimposed on the received signal at the time of measuring the first period from steps 21 to 36. As shown in c in this figure, after the input is detected in step 21 at time t4, counting is started, and after a period of time has reached the minimum value T01, at time t5 while waiting for the end of the cycle in steps 24 and 25, the light receiving circuit When the comparator 6 outputs an output due to the noise from 4, the count value T13 at that time is written into the measurement period area T as the measurement period (step 26). Then, in steps 28 and 29, the period measurement start time is determined based on this measurement period T13.
Ts and the measurement end time Te are calculated, and when the measurement start time Ts has elapsed, the process proceeds to steps 31 and 32 to check whether the next periodic signal is given by the comparator. However, in this case, the measurement start time Ts and measurement end time Te are calculated based on the incorrect cycle T13 measured due to noise, so the cycle measurement is detected in the loop of steps 31 and 32. It is determined by the comparator 6 that no input is given during the time period. Therefore, in this case, the process returns to step 21 via step 32, and period measurement is restarted from the beginning. If there is an input at time t6, the counter 14 starts counting from that point (step 22), and calculates the minimum expected period.
The period T14 obtained between T01 and the maximum value T02 is written in the measurement period area T. Assuming that the measurement is started by the correct output from the comparator at time t7, the measurement start time Ts and measurement end time Te are calculated in steps 28 and 29 based on the measured period, so Ts , Te, unless the light is blocked by an object, an output is given from the comparator 6. Therefore, in that case, the process advances to step 33 via step 31, and the period measurement value T15 at the time t8 is written in the measurement period area T as the measured period. Similarly, after time t8, a pseudo synchronization signal is generated in the loop of steps 37-43.

ところでこうして電源投入時に測定した周期も
時間の経過と共に投光器の電圧変動や温度変化に
よつて僅かに変化することとなる。従つて所定時
間毎に周期を測定し直して正しい周期を持つた同
期信号を発生させるようにしている。
By the way, the period measured at power-on will also change slightly over time due to voltage fluctuations and temperature changes in the projector. Therefore, the cycle is remeasured at predetermined time intervals to generate a synchronization signal with the correct cycle.

第6図はこの周期測定ルーチン43を示すフロ
ーチヤートであり、第7図はその時の各部の波形
を示す波形図である。これらの図において時刻
t10よりこのルーチンが開始されるとまずステツ
プ50において偏差ΔTと通常の同期信号発生時の
同期信号幅の1/2の時間ΔT′との和を求めて測定
時同期信号時間TTとして記憶する。そしてステ
ツプ51においてカウンタ14の計数値が既にメモ
リ10にあらかじめ記憶してある周期の計測値T
(例えばこの値をToとする)であるかどうかをチ
エツクする。これが時刻t11においてToとなれば
ステツプ52に進んでカウンタ14をリセツトする
と共に再び計数を開始し、同時にステツプ53にお
いて同期信号出力を“H”レベルとする。そして
ステツプ54、55においてコンパレータ6の出力が
立ち下がるかどうか、及びカウンタ14の計数値
が測定時同期信号時間TTとなるかどうかをチエ
ツクする。先にコンパレータ6より出力が得られ
れば第7図b,cに示すようにその同期信号発生
時間中に投光部より光信号が与えられたこととな
るので、時刻t12においてカウンタ14の計数を
再開すると共に(ステツプ56)、ステツプ57にお
いて所定の微少時間T′の時間待ちを行つた後、
第7図cに示すようにステツプ58において同期出
力をLレベルとし、ステツプ59に進んでカウンタ
値が測定開始時間Tsとなつかどうかをチエツク
する。時刻t13においてこれが測定開始時間Tsと
なれば同期出力を“H”とする(ステツプ60)。
続いてステツプ61、62に進んでカウンタ14の計
数値が測定終了時間Teとなるまでにコンパレー
タ6より入力があるかどうかをチエツクする。第
7図bに示すようにコンパレータ6より入力があ
れば、その時刻t14のカウンタ14の計数値を周
期測定値T1としてメモリ10に記憶すると共に、
カウンタ14をリセツトして再び計数を開始する
(ステツプ63、64)。そしてステツプ65、66におい
て所定の待時間T′後に同期信号出力を“L”レ
ベルに下げ、新に測定開始時間Ts、測定終了時
間Teを求めて(ステツプ67、68)ステツプ69に
進んでカウンタ値がT−ΔT′となつたかどうかを
チエツクする。これは測定した周期の終了時刻
t14を基準にして次の期間の周期を測定するため
のタイミングを取るものである。そして時刻t15
においてこの時刻に達すればステツプ70に進んで
カウンタ14をリセツトすると共に再び計数を開
始し、第7図cに示すように同期パルスを出力し
てこのサブルーチンを終了する。そしてステツプ
37に戻つて同期信号計数カウンタNを0としステ
ツプ38に進む。そうして第7図aに示すようにカ
ウンタ値がルーチン43で測定した周期測定値
T1となればそのカウンタ14をリセツトして再
び計数を開始すると共にステツプ40において第7
図cに示すように同期信号パルスを発生し、周期
測定用カウンタNをインクリメントする。以後同
様にして周期測定用カウンタNが7に達するまで
ステツプ38〜42のループを繰り返して周期T1毎
に疑似同期信号を発生させ、第7図cに示す同期
信号とコンパレータ6の出力の論理積信号を出力
回路15に与える。そしてステツプ42においてN
が7となれば周期測定ルーチン43に進み、周期
測定ルーチンによつて第6図cに示すように次の
測定時刻における周期T2を測定して、以後その
周期T2によつて疑似同期信号を発生させる。
FIG. 6 is a flowchart showing this period measurement routine 43, and FIG. 7 is a waveform diagram showing waveforms of various parts at that time. In these figures the time
When this routine is started from t10, first in step 50, the sum of the deviation ΔT and the time ΔT' which is 1/2 of the synchronizing signal width when a normal synchronizing signal is generated is calculated and stored as the measuring synchronizing signal time TT. Then, in step 51, the count value of the counter 14 is the measured value T of the period already stored in the memory 10 in advance.
(for example, let this value be To). When this reaches To at time t11, the process proceeds to step 52, where the counter 14 is reset and counting starts again, and at the same time, at step 53, the synchronizing signal output is set to the "H" level. Then, in steps 54 and 55, it is checked whether the output of the comparator 6 falls and whether the count value of the counter 14 reaches the measurement synchronization signal time TT. If an output is obtained from the comparator 6 first, it means that an optical signal has been given from the light emitter during the synchronization signal generation time as shown in FIGS. 7b and 7c. Therefore, the count of the counter 14 at time t12 At the same time as restarting (step 56), after waiting for a predetermined minute time T' in step 57,
As shown in FIG. 7c, the synchronous output is set to L level in step 58, and the process proceeds to step 59, where it is checked whether the counter value is equal to the measurement start time Ts. When this reaches the measurement start time Ts at time t13, the synchronous output is set to "H" (step 60).
Next, the process proceeds to steps 61 and 62, and it is checked whether there is an input from the comparator 6 before the count value of the counter 14 reaches the measurement end time Te. As shown in FIG. 7b, if there is an input from the comparator 6, the count value of the counter 14 at time t14 is stored in the memory 10 as the period measurement value T1, and
The counter 14 is reset and counting starts again (steps 63 and 64). Then, in steps 65 and 66, after a predetermined waiting time T', the synchronization signal output is lowered to the "L" level, new measurement start time Ts and measurement end time Te are determined (steps 67 and 68), and the process proceeds to step 69 where the counter is started. Check whether the value becomes T-ΔT'. This is the end time of the measured period
This is to determine the timing for measuring the cycle of the next period based on t14. and time t15
When this time is reached, the process proceeds to step 70, where the counter 14 is reset and counting is started again, and a synchronizing pulse is output as shown in FIG. 7c, thereby terminating this subroutine. and step
Returning to step 37, the synchronizing signal counter N is set to 0, and the process advances to step 38. Then, as shown in FIG. 7a, the counter value is the period measurement value measured in routine 43.
When T1 is reached, the counter 14 is reset and counting starts again, and at step 40, the counter 14 is counted again.
As shown in Figure c, a synchronizing signal pulse is generated and a period measuring counter N is incremented. Thereafter, in the same manner, the loop of steps 38 to 42 is repeated until the period measurement counter N reaches 7 to generate a pseudo synchronization signal every period T1, and the AND of the synchronization signal shown in FIG. 7c and the output of the comparator 6 is performed. A signal is given to the output circuit 15. and in step 42
When becomes 7, the process proceeds to the period measurement routine 43, which measures the period T2 at the next measurement time as shown in FIG. 6c, and thereafter generates a pseudo synchronization signal using the period T2 let

第8図は投光素子1から与えられる光が物体に
よつて遮断され、受光素子3によつて受光されな
くなつた場合の動作を示す波形図である。測定時
刻t20において第6図に示す周期測定ルーチンに
入つたとするとカウンタ14の計数値がその前の
周期、例えばT1に達する時刻t21にカウンタ14
がリセツトされて再び計数が開始される(ステツ
プ52)。そしてステツプ53において同期信号を出
力した後ステツプ54、55のループにおいてコンパ
レータからの出力を待ち受けるが、投光信号が受
光されずコンパレータより出力を与えられないの
で、カウンタ14の計数値は測定時周期信号時間
TTに達しステツプ55を通つてステツプ72に進
む。ステツプ72では時刻t22に同期信号出力を
“L”レベルとし、又ステツプ73に進んで測定時
周期信号時間TTを偏差ΔTの倍の時間に設定し
直す。そうしてステツプ51に戻つて同様の処理を
繰り返す。そしてステツプ51においてカウンタ値
が前の周期T1に達すればステツプ52に進んで計
数を繰り返し同期信号を出力する。こうしてステ
ツプ51〜73のループを繰り返して既に測定してあ
る周期T1毎に第8図bに示すように同期信号を
出力しておくと共に、この間に測定開始のコンパ
レータ出力が確認されるのを待ち受ける。
FIG. 8 is a waveform diagram showing the operation when the light given from the light projecting element 1 is blocked by an object and is no longer received by the light receiving element 3. If the cycle measurement routine shown in FIG. 6 is entered at measurement time t20, then at time t21 when the count value of the counter 14 reaches the previous cycle, for example T1, the counter 14
is reset and counting starts again (step 52). After outputting the synchronization signal in step 53, the output from the comparator is awaited in the loop of steps 54 and 55, but since the light emitting signal is not received and no output is given from the comparator, the count value of the counter 14 is signal time
When TT is reached, the process passes through step 55 and proceeds to step 72. In step 72, the synchronizing signal output is set to the "L" level at time t22, and the process proceeds to step 73, where the measurement periodic signal time TT is reset to a time twice the deviation ΔT. Then, the process returns to step 51 and the same process is repeated. When the counter value reaches the previous cycle T1 in step 51, the process proceeds to step 52, where counting is repeated and a synchronizing signal is output. In this way, the loop of steps 51 to 73 is repeated, and a synchronization signal is output as shown in Figure 8b for each cycle T1 that has already been measured, and during this time, the comparator output to start measurement is confirmed. .

第9図は測定開始時にのみコンパレータ出力が
与えられた場合のコンパレータ6の出力と同期信
号の波形を示す図である。本図において測定時刻
t30に第4図の周期測定ルーチンに入つたものと
すると、ステツプ50を介してステツプ51において
その時の既に測定してある周期T4に達したかど
うかをチエツクし、更にステツプ54、55において
その同期信号時間内にコンパレータ6より出力が
与えられるかどうかをチエツクする。コンパレー
タ出力があれば、第7図において説明した周期測
定の開始処理と同様にしてステツプ56から60にお
いて時刻t31に測定開始時点の同期信号を終了さ
せると共に、測定開始時間Tsによつて時刻t33に
次の同期信号を発生させる。そしてステツプ61、
62において周期測定終了時点のコンパレータ出力
が得られるかどうかをチエツクする。このときカ
ウント値が測定終了時間Teに達しても出力が得
られない場合には時刻t34にステツプ62に介して
ステツプ74に進み、カウンタ14の計数を開始す
る。そしてステツプ75において同期信号出力をL
レベルに下げ、ステツプ76に進んで測定時周期信
号時間TTを偏差ΔTの倍の時間に設定し、ステ
ツプ77においてカウンタ14の計数値がT−
2ΔTとなるまで待ち受ける。この場合には時刻
t33からt34の間にコンパレータ6より出力が与え
られなかつたの測定をし直す必要がある。従つて
ステツプ77においてカウンタ14の値が所定値に
達した場合にはステツプ52に戻つて測定開始の時
点から処理を再開する。このように測定開始及び
測定終了の同期信号出力時間中にコンパレータ出
力が得られる場合には正しい測定周期として周期
を計測し、それ以外の場合にはこれらが確認され
るまで同様の処理を繰り返す。そして周期が測定
されればこの周期測定ルーチン43を終了して第
5図の主ルーチンに戻る。
FIG. 9 is a diagram showing the output of the comparator 6 and the waveforms of the synchronization signal when the comparator output is applied only at the start of measurement. In this figure, the measurement time
Assuming that the period measurement routine shown in FIG. 4 is entered at t30, it is checked in step 51 via step 50 whether the period T4 which has already been measured at that time has been reached, and further the synchronization is performed in steps 54 and 55. It is checked whether an output is given from the comparator 6 within the signal time. If there is a comparator output, the synchronization signal at the measurement start point is terminated at time t31 in steps 56 to 60 in the same way as the period measurement start process explained in FIG. Generates the next synchronization signal. And step 61,
At step 62, it is checked whether the comparator output at the end of the cycle measurement is obtained. At this time, if no output is obtained even when the count value reaches the measurement end time Te, the process proceeds to step 74 via step 62 at time t34, and the counter 14 starts counting. Then, in step 75, the synchronization signal output is set to L.
level, the process proceeds to step 76, where the measurement periodic signal time TT is set to twice the deviation ΔT, and in step 77, the count value of the counter 14 is T-
Wait until it reaches 2ΔT. In this case the time
It is necessary to perform the measurement again since no output was given from the comparator 6 between t33 and t34. Therefore, when the value of the counter 14 reaches the predetermined value in step 77, the process returns to step 52 and the process is restarted from the point of time when the measurement was started. In this way, if the comparator output is obtained during the synchronization signal output time of the measurement start and measurement end, the period is measured as a correct measurement period, and in other cases, the same process is repeated until these are confirmed. Once the period has been measured, the period measurement routine 43 is terminated and the process returns to the main routine shown in FIG.

次に第10図は受光素子3に迷光が重畳され、
受光回路4はそのノイズを含んだ受光信号を出力
した場合の動作を示す波形図である。第10図a
に示すように時刻t71とt81間に雑音が重畳された
場合にはコンパレータ6も同様にして雑音を含ん
だ成形信号を出力する。しかし同期信号発生部7
は受光信号が与えられるべき時間幅2ΔT′だけの
パルスを同期信号として発生しているので、この
時間帯を除く時間に雑音が与えられてもゲート回
路8には論理積信号が得られず、出力回路15に
出力が伝わることはない。尚同期信号の出力パル
スの間に雑音が加わつた場合には雑音を本来の信
号と見なして周期の測定が行われるで、周期測定
がずれることとなる。しかしながらこのずれはあ
らかじめ定められている偏差ΔTの範囲内にある
ため、誤つて測定した周期に基づいて同期信号を
発生させてもそのまま正しい同期信号として処理
を行うことが可能となる。
Next, in FIG. 10, stray light is superimposed on the light receiving element 3,
The light receiving circuit 4 is a waveform diagram showing the operation when outputting a light receiving signal containing noise. Figure 10a
If noise is superimposed between times t71 and t81 as shown in FIG. 2, the comparator 6 similarly outputs a shaped signal containing noise. However, the synchronization signal generator 7
Since the synchronizing signal generates a pulse with a time width of 2ΔT' in which the light reception signal should be applied, even if noise is applied at a time other than this time period, the gate circuit 8 will not obtain an AND signal. No output is transmitted to the output circuit 15. Note that if noise is added between the output pulses of the synchronization signal, the period is measured by regarding the noise as the original signal, resulting in a deviation in the period measurement. However, since this deviation is within the range of the predetermined deviation ΔT, even if a synchronization signal is generated based on an incorrectly measured period, it can be processed as a correct synchronization signal.

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

第1図は本発明による無接点スイツチの構成を
示すブロツク図、第2図はメモリ10のメモリマ
ツプ、第3図は本発明による無接点スイツチの同
期信号発生処理を示すフローチヤート、第4図、
第5図は電源投入時の周期を測定する場合におけ
る各部の波形を示す波形図、第6図は周期測定ル
ーチンを示すフローチヤート、第7図、第8図及
び第9図は周期を測定する場合における各部の波
形を示す波形図、第10図は受光信号に雑音が重
畳された場合の各部の波形を示す波形図である。 1……投光素子、2……投光回路、3……受光
素子、4……受光回路、6……コンパレータ、7
……同期信号発生部、8……ゲート回路、9……
MPU、10……メモリ、14……カウンタ、1
5……出力回路。
FIG. 1 is a block diagram showing the configuration of a non-contact switch according to the present invention, FIG. 2 is a memory map of the memory 10, FIG. 3 is a flowchart showing synchronization signal generation processing of the non-contact switch according to the present invention, and FIG.
Figure 5 is a waveform diagram showing the waveforms of each part when measuring the cycle at power-on, Figure 6 is a flowchart showing the cycle measurement routine, and Figures 7, 8, and 9 are for measuring the cycle. FIG. 10 is a waveform diagram showing the waveforms of each part when noise is superimposed on the received light signal. 1... Light emitting element, 2... Light emitting circuit, 3... Light receiving element, 4... Light receiving circuit, 6... Comparator, 7
...Synchronization signal generation section, 8...Gate circuit, 9...
MPU, 10...Memory, 14...Counter, 1
5...Output circuit.

Claims (1)

【特許請求の範囲】 1 所定周期でパルス駆動される信号を受信する
受信素子と、 電源投入して所定時間の経過後前記受信素子か
ら得られる受信信号の所定範囲内にある周期を測
定すると共に、当該周期の信号と実質的に同一周
期の信号を引続き受信したときに開始測定周期と
する開始周期測定手段と、 前記開始周期測定手段による周期測定後、所定
時間毎に前記受信素子から得られる受信信号の周
期を測定する断続周期測定手段と、 前記開始周期測定手段及び断続周期測定手段に
より測定した最新の周期を有する同期信号を発生
させる同期信号発生手段と、 前記同期信号発生手段により発生する同期信号
により前記受信素子の受信出力を検知する出力手
段と、を具備することを特徴とする無接点スイツ
チ。 2 前記受信素子は受光素子であることを特徴と
する特許請求の範囲第1項記載の無接点スイツ
チ。 3 前記受信素子は超音波受信素子であることを
特徴とする特許請求の範囲第1項記載の無接点ス
イツチ。
[Claims] 1. A receiving element that receives a pulse-driven signal at a predetermined period; and after a predetermined time elapses after power is turned on, a period within a predetermined range of the received signal obtained from the receiving element is measured; , a start period measuring means that determines a start measurement period when a signal having substantially the same period as the signal of the period is successively received; and after the period is measured by the start period measuring means, the period is obtained from the receiving element at predetermined intervals. intermittent period measuring means for measuring the period of the received signal; synchronizing signal generating means for generating a synchronizing signal having the latest period measured by the starting period measuring means and the intermittent period measuring means; and synchronizing signal generating means generated by the synchronizing signal generating means. A non-contact switch comprising: output means for detecting the reception output of the reception element using a synchronization signal. 2. The non-contact switch according to claim 1, wherein the receiving element is a light receiving element. 3. The non-contact switch according to claim 1, wherein the receiving element is an ultrasonic receiving element.
JP58192927A 1983-10-14 1983-10-14 Contactless switch Granted JPS6084013A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58192927A JPS6084013A (en) 1983-10-14 1983-10-14 Contactless switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58192927A JPS6084013A (en) 1983-10-14 1983-10-14 Contactless switch

Publications (2)

Publication Number Publication Date
JPS6084013A JPS6084013A (en) 1985-05-13
JPH0423846B2 true JPH0423846B2 (en) 1992-04-23

Family

ID=16299298

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58192927A Granted JPS6084013A (en) 1983-10-14 1983-10-14 Contactless switch

Country Status (1)

Country Link
JP (1) JPS6084013A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2558645Y2 (en) * 1991-09-13 1997-12-24 サンクス 株式会社 Photoelectric switch
DE19519659C1 (en) * 1995-05-30 1996-03-07 Leuze Electronic Gmbh & Co Noise signal from optical barrier elimination method for

Also Published As

Publication number Publication date
JPS6084013A (en) 1985-05-13

Similar Documents

Publication Publication Date Title
CN111381487B (en) Multi-sensor synchronous time service system, method and device and electronic equipment
JPS6233637B2 (en)
EP0981201B1 (en) Zero crossing detector and method of determining a zero crossing point
JP2002181934A (en) Apparatus and method for clocking as well as distance measuring apparatus
JPH0423846B2 (en)
JPH0423847B2 (en)
JP3478646B2 (en) Photoelectric switch and photoelectric switch system
JP2007198911A (en) Distance measuring instrument
JP6383237B2 (en) User detection method, user detection apparatus, and image forming apparatus
JPH03119308A (en) Write position controller for laser printer
CA3162936A1 (en) Device and method for generating test data for testing a distance determination in an optical time-of-flight measurement
JPS5997069A (en) Ultrasonic car height measuring apparatus
JPS6044624B2 (en) Ultrasonic measuring device
US4467362A (en) Apparatus and method for transmitting ultrasonic wave
JP3062265B2 (en) Photoelectric switch
JPH063514Y2 (en) Fire alarm
JP2001282458A (en) Optical scanning touch panel
SU1540801A1 (en) Device for registering lower jaw movements
JPH0727104B2 (en) Camera with automatic focus adjustment function
JPH0373880A (en) Laser range findier
JP2762305B2 (en) Dim smoke detector
JPH0571912B2 (en)
CN115201830A (en) Target object detection method and device and intelligent door lock
JPS5852519Y2 (en) photoelectric smoke detector
JPH0239267Y2 (en)