JPH09284117A - Detection switch - Google Patents

Detection switch

Info

Publication number
JPH09284117A
JPH09284117A JP8121095A JP12109596A JPH09284117A JP H09284117 A JPH09284117 A JP H09284117A JP 8121095 A JP8121095 A JP 8121095A JP 12109596 A JP12109596 A JP 12109596A JP H09284117 A JPH09284117 A JP H09284117A
Authority
JP
Japan
Prior art keywords
threshold value
light
detection
level
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP8121095A
Other languages
Japanese (ja)
Inventor
Takashi Kamei
隆 亀井
Takayoshi Horii
孝佳 堀井
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 Corp
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 Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP8121095A priority Critical patent/JPH09284117A/en
Publication of JPH09284117A publication Critical patent/JPH09284117A/en
Pending legal-status Critical Current

Links

Landscapes

  • Photometry And Measurement Of Optical Pulse Characteristics (AREA)
  • Geophysics And Detection Of Objects (AREA)
  • Switches Operated By Changes In Physical Conditions (AREA)
  • Manipulation Of Pulses (AREA)
  • Electronic Switches (AREA)

Abstract

PROBLEM TO BE SOLVED: To set a threshold level in following to a level even when the input level is fluctuated due to an environmental change or the like in the case of discriminating the input level. SOLUTION: A light is emitted from a light projection section 2 for each prescribed period and its reflected light is received by a light receiving section 3. The light receiving signal is A/D converted and discriminated by a discrimination means 13. In this case, the discrimination result and input level are stored in a data storage means 14. When a prescribed number of data is stored, a threshold level calculation means 15 discriminates each distribution of the discrimination result and calculates the threshold level to be an intermediate distribution level. Thus, the calculation processing of the threshold level is conducted stepwise so as to continue the light projection and discrimination for a prescribed period.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は光電スイッチや近接
スイッチ等の検出スイッチにおいて、環境変化に対応し
た閾値を設定する方式に特徴を有する検出スイッチに関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a detection switch, such as a photoelectric switch or a proximity switch, which is characterized by a method of setting a threshold value corresponding to environmental changes.

【0002】[0002]

【従来の技術】従来例えば光電スイッチは投光部より光
を物体検知領域に照射し、その透過光又は反射光を受光
する。そして受光レベルが閾値を越えているかどうかで
物体検知領域の物体の有無を判別するようにしている。
このような従来の光電スイッチでは、閾値設定モードで
所定の方式で閾値を設定すると、それ以降は設定された
閾値に基づいて物体の有無を判別している。この閾値設
定方法には、物体がない背景での受光レベルと、物体を
検出位置に配置した状態での受光レベルとを検出し、そ
の中間のレベルに閾値を設定する等の、種々の手法が従
来より提案され用いられている。図9(a)は反射型光
電スイッチにおいて、閾値Th1を設定した時点での受
光レベルの分布を示すグラフであり、光電スイッチが背
景と判断したときと物体を検出したときの受光感度毎の
分布状況を示している。このように分布している場合に
は、双方の分布の中間の受光レベルに閾値Th1を設定
することができれば、誤動作なく物体が検出できること
となる。
2. Description of the Related Art Conventionally, for example, a photoelectric switch irradiates an object detection area with light from a light projecting portion and receives transmitted light or reflected light. Then, the presence / absence of an object in the object detection area is determined based on whether or not the light receiving level exceeds a threshold value.
In such a conventional photoelectric switch, when the threshold value is set in the threshold value setting mode by a predetermined method, the presence or absence of an object is determined based on the set threshold value thereafter. This threshold setting method includes various methods such as detecting the light receiving level in the background where there is no object and the light receiving level when the object is placed at the detection position, and setting the threshold value at an intermediate level. It has been proposed and used conventionally. FIG. 9A is a graph showing the distribution of the received light level at the time when the threshold Th1 is set in the reflective photoelectric switch, and the distribution for each received light sensitivity when the photoelectric switch determines that it is the background and when it detects an object. It shows the situation. In the case of such distribution, if the threshold value Th1 can be set to the light receiving level intermediate between both distributions, the object can be detected without malfunction.

【0003】[0003]

【発明が解決しようとする課題】しかしながらこのよう
な従来の検出スイッチによれば、一旦設定された閾値は
変化させることがないため、使用中に使用環境の変化や
投光レベル,受光感度の変動等によって検出状態が変わ
った場合には、安定した検出を行うことができなくな
る。例えば環境変化や光量変動によって図9(b)に示
すように全体の受光レベルが低下したものとすると、物
体検知時に物体が検知領域に位置しているにもかかわら
ず、受光レベルが低い場合には閾値Th1が固定されて
いるため、誤判定を生じることがある。図9(b)に示
すハッチングはこの誤判定を生じる領域を示している。
このような誤動作を避けるためには、閾値自体を図9
(b)のTh2のように変化させる必要がある。又閾値
の設定の際、何らかの異常により物体検出時の受光レベ
ルや背景の受光レベルが正常な値とは大きく異なった値
が得られ、これをその受光レベルとして検出した場合に
は、設定される閾値が図9(a)に示すものとならず、
正確な閾値の設定が難しくなるという欠点があった。
However, according to such a conventional detection switch, since the threshold value once set does not change, the use environment changes and the light projection level and the light receiving sensitivity change during use. When the detection state changes due to factors such as the above, stable detection cannot be performed. For example, assuming that the overall light receiving level is lowered as shown in FIG. 9B due to a change in environment or a change in light amount, when the light receiving level is low even though the object is located in the detection area at the time of object detection, Since the threshold value Th1 is fixed, there is a case where an erroneous determination occurs. The hatching shown in FIG. 9B indicates the region where this erroneous determination occurs.
In order to avoid such a malfunction, the threshold value itself should be set as shown in FIG.
It must be changed like Th2 in (b). Also, when setting the threshold, a light receiving level at the time of object detection or a light receiving level of the background that is largely different from the normal value is obtained due to some abnormality, and it is set when this light receiving level is detected. The threshold does not become as shown in FIG.
There is a drawback that it becomes difficult to set an accurate threshold value.

【0004】本発明はこのような従来の問題点に着目し
てなされたものであって、環境の変化があっても通常の
検出動作中に閾値を環境変化に追従させて自動的に最適
な閾値を設定できるようにすることを技術的課題とす
る。
The present invention has been made by paying attention to such a conventional problem, and even if there is a change in the environment, the threshold value is made to follow the change in the environment during the normal detection operation and the optimum value is automatically obtained. A technical issue is to be able to set a threshold value.

【0005】[0005]

【課題を解決するための手段】本願の請求項1の発明
は、一定の周期で物理状態に応じた入力レベルを検出す
る検出手段と、前記検出手段の出力を閾値によって弁別
して検知信号を出力する判別手段と、前記判別手段によ
り検知信号を出力したときの入力レベル及び判別結果を
蓄積するデータ蓄積手段と、前記データ蓄積手段に蓄積
された夫々の検出結果毎に入力レベルの分布を検出し、
各分布の間に閾値を算出し、これに基づく閾値を前記判
別手段に設定する閾値算出手段と、具備し、前記閾値算
出手段は前記検出手段及び判別手段による夫々の処理の
間に段階的に閾値算出処理を行うことにより、前記閾値
算出手段による閾値算出中も一定周期の検出及び判別を
行うようにしたことを特徴とするものである。
According to a first aspect of the present invention, a detecting means for detecting an input level according to a physical state at a constant cycle and an output of the detecting means are discriminated by a threshold value to output a detection signal. Discriminating means, a data accumulating means for accumulating the input level and the discrimination result when the detection signal is output by the discriminating means, and detecting the distribution of the input level for each detection result accumulated in the data accumulating means. ,
A threshold value calculating means for calculating a threshold value between the respective distributions and setting a threshold value based on the threshold value in the judging means, wherein the threshold value calculating means is stepwise during each processing by the detecting means and the judging means. By performing the threshold value calculation process, detection and determination of a constant period are performed even during the threshold value calculation by the threshold value calculation means.

【0006】本願の請求項2の発明では、前記検出手段
は、一定の周期で投光パルスを出力する投光処理手段
と、前記投光処理手段の投光パルスに応じて光を物体検
知領域に出射する投光部と、物体検知領域を介して前記
投光部からの光を受光し、該一定周期毎に受光レベルを
出力する受光部と、を有することを特徴とするものであ
る。
In the invention of claim 2 of the present application, the detection means outputs light projection pulses at a constant cycle, and light projection processing means for outputting light according to the light projection pulses of the light projection processing means. And a light-receiving unit that receives light from the light-projecting unit via the object detection area and outputs a light-reception level at each fixed cycle.

【0007】このような特徴を有する本願の請求項1の
発明によれば、検出手段により入力された入力レベルを
判別手段によって判別する。そしてその判別結果と入力
レベルとをデータ蓄積手段によって蓄積する。そして所
定数を越えるデータが蓄積されたときには、そのデータ
に基づいて新たな閾値を算出する。閾値の算出は夫々の
検出結果毎に入力レベルの分布を検出し、この分布の間
に新たな閾値を算出する。こうして算出された閾値はそ
のまま、又はこれにあらかじめ入力されているオフセッ
ト分を付加して新たな閾値として判別手段に設定するよ
うにしている。そして閾値算出・設定の処理を行う間も
一定周期で検出手段及び判別手段を動作させるようにす
るために、閾値の演算処理を段階的に行うようにしてい
る。
According to the invention of claim 1 of the present application having such a feature, the input level input by the detection means is determined by the determination means. Then, the discrimination result and the input level are accumulated by the data accumulating means. Then, when data exceeding a predetermined number is accumulated, a new threshold value is calculated based on the data. The threshold value is calculated by detecting the distribution of the input level for each detection result and calculating a new threshold value during this distribution. The threshold value calculated in this way is set as it is, or an offset amount that has been input in advance is added to the threshold value and set as a new threshold value in the determination means. Then, in order to operate the detection means and the determination means at a constant cycle even while the threshold calculation / setting processing is performed, the threshold calculation processing is performed stepwise.

【0008】[0008]

【発明の実施の形態】図1は本発明の一実施形態による
反射型光電スイッチの全体構成を示すブロック図であ
る。本図においてマイクロコンピュータ1には投光部2
が接続される。マイクロコンピュータ1は投光処理手段
11により一定周期毎に投光パルスを投光部2に与え
る。投光部2は投光パルスに応じてLED等の発光素子
を駆動して光を物体検知領域に照射するものであり、そ
の反射光が受光部3により受光される。受光部3の出力
は受光信号を増幅するアンプ部4を介してマイクロコン
ピュータ1に入力される。マイクロコンピュータ1には
投光処理手段11に加えて、アンプ部4から入力された
受光レベルの信号をA/D変換するA/D変換部12、
A/D変換部12により変換された受光レベルを閾値に
よって弁別し、物体の検知又は非検知を判別する判別手
段13を有している。更に本発明ではA/D変換部12
の受光レベルを判別結果毎に蓄積するデータ蓄積手段1
4、及び蓄積されたデータに基づいて閾値を算出する閾
値算出手段15を有している。マイクロコンピュータ1
により判別された判別結果は出力部5により外部に物体
検知又は非検知の信号として出力される。表示部6は後
述するように受光レベルや閾値及びオンオフ出力が表示
される。又計測モードと閾値設定モードとを切換えると
共に、閾値のオフセットUoff の上昇,下降を入力する
入力部7が設けられている。
1 is a block diagram showing the overall structure of a reflective photoelectric switch according to an embodiment of the present invention. In the figure, the microcomputer 1 is provided with a light projecting section 2
Is connected. The microcomputer 1 causes the light projecting processing means 11 to apply a light projecting pulse to the light projecting unit 2 at regular intervals. The light projecting unit 2 drives a light emitting element such as an LED in accordance with a light projecting pulse to irradiate the object detection region with light, and the reflected light is received by the light receiving unit 3. The output of the light receiving unit 3 is input to the microcomputer 1 via the amplifier unit 4 that amplifies the light receiving signal. In addition to the light emission processing means 11, the microcomputer 1 includes an A / D converter 12 for A / D converting a light reception level signal input from the amplifier 4.
The light-receiving level converted by the A / D conversion unit 12 is discriminated by a threshold value, and a discrimination unit 13 for discriminating detection or non-detection of an object is provided. Further, in the present invention, the A / D conversion unit 12
Data storage means 1 for accumulating the received light level of each of the discrimination results
4 and a threshold value calculation means 15 for calculating a threshold value based on the accumulated data. Microcomputer 1
The determination result determined by is output to the outside by the output unit 5 as an object detection or non-detection signal. The display unit 6 displays the light receiving level, the threshold value, and the on / off output, as described later. Further, an input section 7 is provided for switching between the measurement mode and the threshold value setting mode and for inputting an increase and a decrease of the threshold value offset Uoff.

【0009】データ蓄積手段14は、判別手段13で判
別された判別結果とそのとき入力されたオンレベルとオ
フレベル、例えば物体が存在するときの受光レベルと背
景と判断されたときの受光レベルのデータを判別結果と
共に蓄積するものである。閾値算出手段15はこのデー
タに基づいて統計処理によって閾値を算出して設定する
ものである。
The data accumulating means 14 indicates the discrimination result discriminated by the discriminating means 13 and the ON level and OFF level inputted at that time, for example, the light receiving level when an object exists and the light receiving level when it is judged to be the background. The data is stored together with the determination result. The threshold calculation means 15 calculates and sets a threshold by statistical processing based on this data.

【0010】次に本実施形態の閾値設定処理について詳
細に説明する。図2は本実施形態の動作時のタイムチャ
ートであり、図3はその動作を示すフローチャートであ
る。まず最初の閾値の設定では従来から用いられている
何らかの方法によってティーチングを行い、最初の閾値
を設定しておくものとして計測処理モードに切換える。
計測処理モードではまず図3に示すルーチン21におい
て投光処理手段11により一定周期毎に投光パルスを発
生し、投光処理を行う。図2(a)はこの投光パルスを
示している。投光パルスの出力毎に投光部2の発光素子
が駆動され、投光パルスに対応して受光部3より得られ
る受光信号をアンプ部4によって増幅する。そして増幅
出力はマイクロコンピュータ1のA/D変換部12に入
力される。ルーチン22ではA/D変換部12によるA
/D変換処理を行い、ルーチン23に進んでそのとき設
定されている閾値によって物体の有無を判別する。オン
オフ判定処理ルーチン23は判別手段13の機能を実現
するルーチンであり、判別結果は出力部5,表示部6に
出力される。そしてステップ24に進んでデータ蓄積期
間かどうかをチェックする。本実施形態では投光パルス
の出力毎にそれに対応する受光レベルと物体の判別信号
のデータをマイクロコンピュータ1内のデータ蓄積手段
14に蓄積している。データは物体の検出時と物体がな
く背景のみの場合のいずれかである。従ってベルトコン
ベア上を同一種類の物品が搬送される場合のように、同
じ状態で物品検知に用いられる場合には、所定数データ
が蓄積されれば、その分布は例えば図4に示すように、
正規分布又はこれに近い分布が得られる。
Next, the threshold setting process of this embodiment will be described in detail. FIG. 2 is a time chart during the operation of this embodiment, and FIG. 3 is a flowchart showing the operation. First, in setting the first threshold value, teaching is performed by some method conventionally used, and the mode is switched to the measurement processing mode as the first threshold value is set.
In the measurement processing mode, first, in the routine 21 shown in FIG. 3, the light projecting processing means 11 generates a light projecting pulse at regular intervals to perform the light projecting processing. FIG. 2A shows this light projection pulse. The light emitting element of the light projecting unit 2 is driven each time the light projecting pulse is output, and the light receiving signal obtained from the light receiving unit 3 corresponding to the light projecting pulse is amplified by the amplifier unit 4. Then, the amplified output is input to the A / D conversion unit 12 of the microcomputer 1. In the routine 22, A by the A / D converter 12
The / D conversion process is performed, and the routine proceeds to routine 23, where the presence or absence of an object is determined by the threshold value set at that time. The on / off determination processing routine 23 is a routine that realizes the function of the determination means 13, and the determination result is output to the output unit 5 and the display unit 6. Then, the process proceeds to step 24, and it is checked whether it is the data accumulation period. In the present embodiment, the light receiving level and the data of the object discrimination signal corresponding to each output of the light emitting pulse are stored in the data storing means 14 in the microcomputer 1. The data is either when an object is detected or when there is no object and only the background is present. Therefore, when the same type of articles are conveyed on the belt conveyor and used for article detection in the same state, if a predetermined number of data are accumulated, the distribution thereof is, for example, as shown in FIG.
A normal distribution or a distribution close to this can be obtained.

【0011】こうして所定数の受光データが蓄積される
と、閾値の算出演算処理を行う。算出演算処理は図3に
示す本実施形態では複数の段階に分けて行っており、ま
ずルーチン26で演算段階の選択を行う。そして演算段
階に応じてルーチン27〜29の閾値算出演算1〜Nの
いずれかの処理を行う。そして閾値の演算処理が終われ
ば閾値の更新処理を行って投光処理ルーチン21に戻
る。こうして新しい閾値を設定すると、その閾値に応じ
た判別処理が以後のルーチン23によって行われる。こ
のように閾値の算出演算処理を複数の段階に分けておけ
ば、夫々の段階での演算処理時間を十分短くすることが
でき、図2(a),(c)に示すように閾値演算処理中
も一定周期毎に投光パルスを出力し、物体の判別処理を
そのまま継続することができる。このため演算処理の段
階数は一定周期での投光、判別が維持できるものとす
る。こうすれば使用者は閾値算出処理中かデータ蓄積中
かを意識することなく、一定周期の投光パルス毎に判別
結果が得られる。
When a predetermined number of received light data are accumulated in this way, a threshold calculation operation is performed. In the present embodiment shown in FIG. 3, the calculation calculation process is divided into a plurality of stages, and the routine 26 first selects the calculation stage. Then, any one of the threshold value calculation operations 1 to N of the routines 27 to 29 is performed according to the operation stage. When the threshold value calculation process is completed, the threshold value update process is performed and the process returns to the light projecting process routine 21. When the new threshold value is set in this way, the determination processing according to the threshold value is performed by the subsequent routine 23. By dividing the threshold calculation processing into a plurality of stages in this way, the calculation processing time in each stage can be shortened sufficiently, and as shown in FIGS. 2A and 2C, the threshold calculation processing is performed. Even during this period, a light projection pulse is output at regular intervals, and the object discrimination processing can be continued as it is. Therefore, it is assumed that the number of stages of the arithmetic processing can maintain the light projection and the discrimination in a constant cycle. In this way, the user can obtain the determination result for each light projection pulse of a constant cycle without being aware of whether the threshold value calculation processing or the data accumulation is being performed.

【0012】又ルーチン29の最後の閾値算出演算処理
の際に自動追従モードかどうかを判別し、自動追従モー
ドであれば閾値を更新し、自動追従モードでなければ閾
値の算出に留めて閾値の更新処理を行わないようにして
もよい。こうすれば使用者が必要なときにのみ閾値の自
動追従が可能となる。又ルーチン23による判定処理の
後でトリガ入力がある場合にのみデータの蓄積を行い、
トリガ入力がなければデータの蓄積を行わないようにし
てもよい。これは例えば光電スイッチの通常の使用位置
にない場合や背景に通常とは異なった物体を配置した場
合等に、誤ったデータを取り込まないようにするためで
あり、外部から例えばプログラマブルコントローラを通
じてトリガ信号を入力したときにのみデータを蓄積する
ことが考えられる。
In the final threshold value calculation operation of the routine 29, it is determined whether or not the automatic follow-up mode is set. If the automatic follow-up mode is set, the threshold value is updated. The update process may not be performed. In this way, the threshold can be automatically tracked only when the user needs it. Data is accumulated only when there is a trigger input after the determination processing by the routine 23.
If there is no trigger input, data may not be stored. This is to prevent incorrect data from being taken in, for example, when the photoelectric switch is not in the normal use position or when an object different from the normal one is placed in the background. It is conceivable that data will be accumulated only when is input.

【0013】次に閾値演算処理の詳細について説明す
る。図5は閾値演算処理を分割せずにまとめて示したフ
ローチャートであり、実際には図3のように動作時間に
応じて分割して行われる。さて閾値算出処理は図5に示
すようにまずステップ31において閾値の算出条件を満
たし、算出が可能かどうかを判別する。ここで図4に示
す背景を検出したデータ数と物体を検出したデータ数の
双方について閾値を算出できるに十分なデータ数かどう
かを判別する。これ以下であれば閾値算出処理は行わ
ず、受光データ蓄積処理を続ける。又いずれか一方のデ
ータが多い場合も正確な閾値を算出できないので、デー
タ数の比が所定数以上のときは閾値を算出しない。双方
のデータが所定数を越え、その比が所定値以下であれば
算出条件を満たすので、ステップ32に進んでまず物体
の検出出力が得られた場合の物体検出受光レベルの平均
値AV1を算出する。次いでステップ33に進んで物体
検出の受光レベルの標準偏差σ1を算出する。次いでス
テップ34において第1の基準値L1を算出する。第1
の基準値L1は反射型光電センサでは図4に示すように
閾値より物体検出時の受光レベルの方が高いので、閾値
は物体受光レベルの平均値AV1以下に設定されること
となり、第1の基準値もこれに近づくように決める。即
ちこの場合はAV1−kσ1を第1の基準値L1とす
る。係数kは例えば2又は3の値を用いるものとする
が、整数である必要はない。図4ではkを2とした場合
の基準値L1を示している。
Next, details of the threshold value calculation processing will be described. FIG. 5 is a flowchart collectively showing the threshold value calculation process without dividing it, and in practice, it is divided according to the operation time as shown in FIG. In the threshold value calculation process, as shown in FIG. 5, first, in step 31, the threshold value calculation condition is satisfied, and it is determined whether the calculation is possible. Here, it is determined whether or not the number of pieces of data for detecting the background and the number of pieces of data for detecting the object shown in FIG. 4 are both sufficient. If it is less than this, the threshold calculation process is not performed, and the received light data accumulation process is continued. Further, since the accurate threshold value cannot be calculated even when there is a large amount of either one of the data, the threshold value is not calculated when the ratio of the number of data is a predetermined number or more. If both data exceeds a predetermined number and the ratio is less than or equal to a predetermined value, the calculation condition is satisfied. Therefore, the process proceeds to step 32, and the average value AV1 of the object detection light receiving level when the detection output of the object is first obtained is calculated. To do. Next, in step 33, the standard deviation σ1 of the light receiving level for object detection is calculated. Next, at step 34, the first reference value L1 is calculated. First
In the reflective photoelectric sensor, the reference value L1 is higher than the threshold in the light receiving level at the time of object detection, so that the threshold is set to the average value AV1 of the object light receiving level or less. The standard value should also be decided so as to approach this. That is, in this case, AV1-kσ1 is set as the first reference value L1. The coefficient k uses a value of 2 or 3, for example, but it does not have to be an integer. FIG. 4 shows the reference value L1 when k is 2.

【0014】次いでステップ35に進んで背景と判断さ
れた場合の受光レベルの平均値AV2を算出する。そし
てステップ36において背景受光レベルの標準偏差σ2
を算出する。更にステップ37において背景受光レベル
の第2の基準値L2を算出する。この場合も図示のよう
に背景の平均受光レベルAV2より高いレベルに閾値が
設定されるので、AV2+kσ2を第2の基準値L2と
する。そしてステップ38に進んでこれらの2つの基準
値L1,L2を用いてこれらの間に新しい閾値Thnを
算出する。この新閾値Thnは例えば基準値L1,L2
の相加平均値を用いるものとする。次いでステップ39
に進んで現在設定されている閾値Thと新たな閾値Th
nとの差が所定値εを越えているかどうかを判別する。
新閾値Thnが現在の閾値Thより大幅に変化した場合
には何らかの異常、例えばセンサの破損や装置の異常に
よる影響が考えられる。従って閾値の変更処理を行わ
ず、外部に追従限界出力を出し、エラー表示を行う(ス
テップ40)。閾値の変化がそれほど大きいものでなけ
れば、こうして算出された新しい閾値Thnをこの光電
スイッチの推奨閾値Thnとする。次にステップ41に
進んでこの推奨閾値に後述するユーザオフセットUoff
を加えて新たな閾値Thuとする。次いでステップ42
に進んで新たな閾値Thuを閾値Thに置き換える更新
処理を行い、更新した閾値やユーザオフセット値を表示
して処理を終える(ステップ43)。こうすれば閾値が
大幅に変化しなければ、受光レベルの変動に応じて最適
の閾値が設定されることとなる。
Next, the routine proceeds to step 35, where the average value AV2 of the light receiving level when it is judged to be the background is calculated. Then, in step 36, the standard deviation σ2 of the background light receiving level
Is calculated. Further, in step 37, the second reference value L2 of the background light receiving level is calculated. Also in this case, the threshold value is set to a level higher than the average light receiving level AV2 of the background as shown in the figure, so that AV2 + kσ2 is set to the second reference value L2. Then, the routine proceeds to step 38, where a new threshold value Thn is calculated between these two reference values L1 and L2. This new threshold value Thn is, for example, reference values L1 and L2.
The arithmetic mean value of is used. Then step 39
And the new threshold Th currently set.
It is determined whether or not the difference from n exceeds a predetermined value ε.
When the new threshold value Thn is significantly changed from the current threshold value Th, some kind of abnormality, for example, damage of the sensor or abnormality of the device is considered. Therefore, the threshold value changing process is not performed, the tracking limit output is output to the outside, and the error is displayed (step 40). If the change in the threshold value is not so large, the new threshold value Thn thus calculated is set as the recommended threshold value Thn of this photoelectric switch. Next, the procedure proceeds to step 41, where a user offset Uoff to be described later is set to this recommended threshold value.
Is added to obtain a new threshold Thu. Then step 42
Then, the updating process for replacing the new threshold value Thu with the threshold value Th is performed, the updated threshold value and the user offset value are displayed, and the process ends (step 43). In this way, if the threshold value does not change significantly, the optimum threshold value is set according to the fluctuation of the received light level.

【0015】そして閾値の算出設定処理を終えると、図
2に示すように再び受光データの蓄積処理を行い、一定
時間蓄積を終えると更に新たな閾値を算出し設定する。
このようにデータの蓄積とそのデータに基づいた閾値の
算出,設定を繰り返すことにより、環境の変化や受光
量,投光レベルの低下等の変動があってもその変化を含
んだ最適の閾値が自動的に設定されることになる。又入
力部7からトリガ信号を入力するとデータ蓄積を行い、
データ蓄積後に閾値を算出し設定する処理を行うように
してもよい。この場合には使用者が環境変化等があった
ときに手動で閾値更新のタイミングを入力することがで
きる。
When the threshold value calculation / setting process is completed, the received light data is again accumulated as shown in FIG. 2, and a new threshold value is calculated and set after the accumulation for a certain period of time.
By repeating the accumulation of data and the calculation and setting of the threshold value based on the data in this way, the optimum threshold value including the change even if there is a change in the environment, the amount of received light, the drop of the light projection level, etc. It will be set automatically. When a trigger signal is input from the input unit 7, data is stored,
A process of calculating and setting the threshold may be performed after the data is accumulated. In this case, the user can manually input the threshold update timing when the environment changes.

【0016】図6は動作時における表示部6のパネル面
を示す図、図7はその表示範囲を示す概念図である。本
実施形態による表示部は左右に2本のバーグラフ表示器
が設けられる。左側のバーグラフ表示器は受光量表示部
51である。そして左側の受光量表示部51の中央の位
置を閾値レベルとしている。中央の閾値Thは光電スイ
ッチのパネル面に固定的に描かれている。受光量表示部
51では閾値の上下に夫々5つの表示素子が配列され、
受光レベルを表示する。この表示例では図7に示すよう
に受光部3のダイナミックレンジの全範囲をそのまま受
光量表示部51の受光量として表示する。そして受光レ
ベル表示部51は受光量の受光範囲全体を閾値レベルで
上下に2分し、これを各1/5に等分して夫々の表示素
子に対応させる。この場合には閾値を中心とした上下で
1表示素子分の受光量が異なることとなる。又右側のバ
ーグラフ表示器は閾値付近の1表示素子分の受光レベル
を拡大した拡大表示部52である。この場合には閾値を
中心としてその閾値の1素子分を拡大表示部52で拡大
しているため、光電スイッチが算出した新たな閾値が推
奨閾値Thnとして表示される。又この拡大表示部52
にはユーザが設定するオフセット値Uoff が推奨閾値T
hnとの差として表示される。推奨閾値Thnは常に拡
大表示部52の中央にあり、それに対するユーザオフセ
ットを加えた値が閾値Thuとなる。このユーザオフセ
ットは押ボタンスイッチ54a,54bで上下に変更す
ることができる。図6(a)は受光レベルが設定された
閾値Thuを越えているので、物体検知信号を外部に出
力しており、動作表示灯53が点灯している。又図6
(b)は受光レベルが閾値Thu以下であるため、物体
検知信号が出力されず動作表示灯53が消灯している状
態を示している。こうすれば常に閾値が中央に表示され
るため、受光レベルの余裕度が認識し易くなる。尚ここ
では表示素子数は上下夫々5素子としたが、これに限ら
ず任意の数でよい。又閾値を中心として受光レベルを2
分割し、夫々を5等分としたが、必ずしも等分に分割す
る必要はない。
FIG. 6 is a diagram showing the panel surface of the display unit 6 during operation, and FIG. 7 is a conceptual diagram showing its display range. The display unit according to the present embodiment is provided with two bar graph indicators on the left and right. The bar graph display on the left side is the received light amount display section 51. Then, the central position of the received light amount display section 51 on the left side is set as the threshold level. The central threshold Th is fixedly drawn on the panel surface of the photoelectric switch. In the received light amount display section 51, five display elements are arranged above and below the threshold value,
Displays the received light level. In this display example, as shown in FIG. 7, the entire dynamic range of the light receiving unit 3 is displayed as it is as the light receiving amount of the light receiving amount display unit 51. Then, the light-reception level display section 51 divides the entire light-reception range of the light-reception amount into upper and lower halves at a threshold level, and divides this equally into ⅕ to correspond to the respective display elements. In this case, the amount of light received for one display element differs above and below the threshold value. The bar graph display on the right side is an enlarged display section 52 in which the light receiving level for one display element near the threshold is enlarged. In this case, since one element of the threshold value is enlarged by the enlargement display unit 52 around the threshold value, the new threshold value calculated by the photoelectric switch is displayed as the recommended threshold value Thn. Also, this enlarged display section 52
Offset value Uoff set by the user is the recommended threshold value T
It is displayed as the difference from hn. The recommended threshold Thn is always in the center of the enlarged display section 52, and the value obtained by adding the user offset to the recommended threshold Thn is the threshold Thu. This user offset can be changed up and down with the push button switches 54a and 54b. In FIG. 6A, since the light receiving level exceeds the set threshold value Thu, the object detection signal is output to the outside and the operation indicator lamp 53 is lit. FIG. 6
(B) shows a state in which the object detection signal is not output and the operation indicator lamp 53 is off because the light reception level is equal to or lower than the threshold Thu. In this way, the threshold value is always displayed in the center, so that the margin of the light receiving level can be easily recognized. Although the number of display elements is 5 in each of the upper and lower sides here, it is not limited to this and may be any number. In addition, the light receiving level around the threshold is 2
Although it is divided into five equal parts, it is not always necessary to divide the parts into five equal parts.

【0017】又表示部6のうちの受光量表示部51は受
光レベルの受光範囲全体でなく、図8に示すように閾値
を中心とした上下の一定範囲を受光量表示部51に表示
することも考えられる。この場合には閾値の上下の一定
範囲を等間隔、この場合は5つに分割し、夫々を各表示
素子に対応させてバーグラフ表示を行う。受光量表示部
51ではこのレベルに受光量が達した時に光量表示をバ
ーグラフ表示するものであり、拡大表示部52は閾値レ
ベル近傍の1表示素子分を拡大して推奨閾値Thnと使
用者が設定したユーザオフセットUoff を加えた閾値T
huとを同様に表示する。この場合には常に閾値が受光
量表示部51の中央となるため、閾値付近の受光レベル
を詳細に認識することができる。又使用時の余裕度もよ
り正確に認識することができる。
Further, the received light amount display unit 51 of the display unit 6 does not display the entire received light range of the received light level but the upper and lower fixed ranges around the threshold as shown in FIG. 8 on the received light amount display unit 51. Can also be considered. In this case, a certain range above and below the threshold value is divided into equal intervals, in this case, five, and a bar graph is displayed by making each correspond to each display element. The received light amount display unit 51 displays the amount of received light in a bar graph when the received light amount reaches this level, and the enlarged display unit 52 enlarges one display element near the threshold level and recommends the threshold value Thn and the user. Threshold value T including the set user offset Uoff
Similarly, hu is displayed. In this case, since the threshold value is always located at the center of the received light amount display section 51, the light reception level near the threshold value can be recognized in detail. Also, the margin during use can be recognized more accurately.

【0018】尚前述した実施形態では反射型光電スイッ
チについて説明しているが、透過型光電スイッチに適用
することも可能である。この場合には物体が検知された
ときにはその入力レベルが低下し、通常の物体のない状
態では高いレベルの受光信号が得られているため、図4
に示す分布状態は逆転している。この場合にも夫々の平
均値をその中間の閾値側に近づくように標準偏差の係数
倍を加算又は減算して第1,第2の基準値とする。又本
実施形態は光電スイッチについて説明しているが、本発
明は光電スイッチだけでなく高周波発振型の近接スイッ
チや超音波スイッチ等、外部の物理状態を検出し、これ
を閾値で弁別して出力を出す種々の形態の検出スイッチ
に適用することができる。
Although the reflective photoelectric switch has been described in the above-mentioned embodiment, it may be applied to a transmissive photoelectric switch. In this case, when an object is detected, the input level of the object is lowered, and in a normal state without an object, a high level light reception signal is obtained.
The distribution state shown in is reversed. In this case as well, the average value of each is added or subtracted by a coefficient multiple of the standard deviation so as to approach the intermediate threshold value side, and the first and second reference values are obtained. Although the present embodiment describes the photoelectric switch, the present invention detects not only the photoelectric switch but also an external physical state such as a high-frequency oscillation type proximity switch or an ultrasonic switch, and discriminates this with a threshold value to output. It can be applied to various types of detection switches.

【0019】[0019]

【発明の効果】以上詳細に説明したように本願の請求項
1,2の発明によれば、判別結果の分布状態によって最
適な閾値を算出することができる。そして周囲環境の変
化によって入力レベル等が変化した場合にも、これに追
従して最適な閾値を常に設定することができるという優
れた効果が得られる。又閾値演算処理を段階的に行うよ
うにしているため、一定周期での検出手段及びそれに対
応した判別手段の動作の周期を変更することなく閾値の
演算が行える。このため使用者はデータの蓄積中か閾値
算出処理中かを意識することなく、そのまま使用を継続
することができるという効果が得られる。
As described in detail above, according to the first and second aspects of the present invention, the optimum threshold value can be calculated according to the distribution state of the discrimination result. Even when the input level or the like changes due to the change of the surrounding environment, the excellent effect that the optimum threshold value can be always set following the change is obtained. Further, since the threshold value calculation process is performed stepwise, the threshold value calculation can be performed without changing the operation cycle of the detection means and the determination means corresponding thereto in a constant cycle. Therefore, there is an effect that the user can continue to use the data without being aware of whether the data is being accumulated or the threshold value is being calculated.

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

【図1】本発明の一実施形態による光電スイッチの構成
を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a photoelectric switch according to an embodiment of the present invention.

【図2】本実施形態の動作を示すタイムチャートであ
る。
FIG. 2 is a time chart showing the operation of the present embodiment.

【図3】本実施形態の動作を示すフローチャートであ
る。
FIG. 3 is a flowchart showing an operation of this embodiment.

【図4】閾値設定時の受光レベルとその頻度を示す分布
図である。
FIG. 4 is a distribution chart showing a light receiving level and its frequency when a threshold value is set.

【図5】本実施形態の閾値算出処理を示すフローチャー
トである。
FIG. 5 is a flowchart showing a threshold value calculation process of this embodiment.

【図6】本実施形態の表示部の状態を示す表示例であ
る。
FIG. 6 is a display example showing a state of a display unit of the present embodiment.

【図7】受光レベルと表示部の関係を示す図である。FIG. 7 is a diagram showing a relationship between a light receiving level and a display unit.

【図8】他の実施形態による表示器の表示例と受光レベ
ルとの関係を示す図である。
FIG. 8 is a diagram showing a relationship between a display example of a display according to another embodiment and a light receiving level.

【図9】従来の光電スイッチの受光レベルと閾値を示す
図である。
FIG. 9 is a diagram showing a light reception level and a threshold value of a conventional photoelectric switch.

【符号の説明】[Explanation of symbols]

1 マイクロコンピュータ 2 投光部 3 受光部 4 アンプ部 5 出力部 6 表示部 7 入力部 11 投光処理手段 12 A/D変換部 13 判別手段 14 データ蓄積手段 15 閾値算出手段 DESCRIPTION OF SYMBOLS 1 Microcomputer 2 Light emitting part 3 Light receiving part 4 Amplifier part 5 Output part 6 Display part 7 Input part 11 Projection processing means 12 A / D conversion part 13 Discrimination means 14 Data storage means 15 Threshold value calculation means

フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G01V 8/12 H01H 35/00 A H01H 35/00 H03K 5/08 R H03K 5/08 G01V 3/08 E // G01V 3/08 9/04 K Continuation of the front page (51) Int.Cl. 6 Identification code Reference number within the agency FI Technical display location G01V 8/12 H01H 35/00 A H01H 35/00 H03K 5/08 R H03K 5/08 G01V 3/08 E / / G01V 3/08 9/04 K

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 一定の周期で物理状態に応じた入力レベ
ルを検出する検出手段と、 前記検出手段の出力を閾値によって弁別して検知信号を
出力する判別手段と、 前記判別手段により検知信号を出力したときの入力レベ
ル及び判別結果を蓄積するデータ蓄積手段と、 前記データ蓄積手段に蓄積された夫々の検出結果毎に入
力レベルの分布を検出し、各分布の間に閾値を算出し、
これに基づく閾値を前記判別手段に設定する閾値算出手
段と、具備し、 前記閾値算出手段は前記検出手段及び判別手段による夫
々の処理の間に段階的に閾値算出処理を行うことによ
り、前記閾値算出手段による閾値算出中も一定周期の検
出及び判別を行うようにしたことを特徴とする検出スイ
ッチ。
1. A detection means for detecting an input level according to a physical state in a constant cycle, a discrimination means for discriminating an output of the detection means by a threshold value and outputting a detection signal, and a detection signal output by the discrimination means. Data storage means for accumulating the input level and the discrimination result at the time, the distribution of the input level is detected for each of the detection results stored in the data storage means, and the threshold value is calculated between the distributions.
A threshold value calculation means for setting a threshold value based on this in the determination means, and the threshold value calculation means performs the threshold value calculation processing stepwise during the respective processing by the detection means and the determination means, A detection switch characterized in that detection and determination are performed in a constant cycle even while the threshold value is being calculated by the calculation means.
【請求項2】 前記検出手段は、一定の周期で投光パル
スを出力する投光処理手段と、 前記投光処理手段の投光パルスに応じて光を物体検知領
域に出射する投光部と、 物体検知領域を介して前記投光部からの光を受光し、該
一定周期毎に受光レベルを出力する受光部と、を有する
ものであることを特徴とする請求項1記載の検出スイッ
チ。
2. The light emitting processing means for outputting light emitting pulses at a constant cycle, and the light emitting portion for emitting light to an object detection area according to the light emitting pulses of the light emitting processing means. 2. The detection switch according to claim 1, further comprising: a light-receiving unit that receives light from the light-projecting unit via an object detection region and outputs a light-reception level at each constant cycle.
JP8121095A 1996-04-17 1996-04-17 Detection switch Pending JPH09284117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8121095A JPH09284117A (en) 1996-04-17 1996-04-17 Detection switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8121095A JPH09284117A (en) 1996-04-17 1996-04-17 Detection switch

Publications (1)

Publication Number Publication Date
JPH09284117A true JPH09284117A (en) 1997-10-31

Family

ID=14802761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8121095A Pending JPH09284117A (en) 1996-04-17 1996-04-17 Detection switch

Country Status (1)

Country Link
JP (1) JPH09284117A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810112B1 (en) 1999-10-06 2004-10-26 Fujitsu Limited Method and apparatus for testing an information notification service
JP2007013372A (en) * 2005-06-29 2007-01-18 Matsushita Electric Ind Co Ltd Touch key and household electric apparatus using the same
JP2007166184A (en) * 2005-12-13 2007-06-28 Sharp Corp Decoder, reproducing apparatus, decoding method, decoding program, and recording medium therefor
JP2009168492A (en) * 2008-01-11 2009-07-30 Anywire:Kk Photoelectric sensor system
JP2012503402A (en) * 2008-09-19 2012-02-02 エーティーラブ・インコーポレーテッド SENSOR, SENSOR SENSING METHOD, AND SENSOR FILTER
JP2012021822A (en) * 2010-07-12 2012-02-02 Takenaka Electronic Industrial Co Ltd Optical phase difference detecting type object detecting sensor
JP2019184437A (en) * 2018-04-11 2019-10-24 コーデンシ株式会社 Optical sensor and counter
WO2021181959A1 (en) * 2020-03-12 2021-09-16 オムロン株式会社 Photoelectric sensor and threshold correction method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6810112B1 (en) 1999-10-06 2004-10-26 Fujitsu Limited Method and apparatus for testing an information notification service
JP2007013372A (en) * 2005-06-29 2007-01-18 Matsushita Electric Ind Co Ltd Touch key and household electric apparatus using the same
JP2007166184A (en) * 2005-12-13 2007-06-28 Sharp Corp Decoder, reproducing apparatus, decoding method, decoding program, and recording medium therefor
JP2009168492A (en) * 2008-01-11 2009-07-30 Anywire:Kk Photoelectric sensor system
JP2012503402A (en) * 2008-09-19 2012-02-02 エーティーラブ・インコーポレーテッド SENSOR, SENSOR SENSING METHOD, AND SENSOR FILTER
JP2012021822A (en) * 2010-07-12 2012-02-02 Takenaka Electronic Industrial Co Ltd Optical phase difference detecting type object detecting sensor
JP2019184437A (en) * 2018-04-11 2019-10-24 コーデンシ株式会社 Optical sensor and counter
WO2021181959A1 (en) * 2020-03-12 2021-09-16 オムロン株式会社 Photoelectric sensor and threshold correction method

Similar Documents

Publication Publication Date Title
US8510068B2 (en) Photoelectric smoke sensor
US6720545B2 (en) Photoelectric sensor, control method therefor and semiconductor integrated circuit therefor
JPS62215848A (en) Sensing apparatus
CN109725323B (en) Displacement sensor
JPH09284117A (en) Detection switch
US8410445B2 (en) Human body sensing apparatus with improved accuracy
JPH09284115A (en) Sensor switch
JPH09284116A (en) Detection switch
JPH11112318A (en) Detection device and its output setting method
US20220179079A1 (en) Time-of-flight ranging device and time-of-flight ranging method
JP3291581B2 (en) Oxygen saturation measurement device and signal processing method
JP5416391B2 (en) smoke detector
JP3076616B2 (en) Photoelectric switch and control method thereof
JP3443920B2 (en) Detection sensor and threshold setting method thereof
JPH11112319A (en) Detection device and its threshold setting method
US8063790B2 (en) System and method for detecting the presence of an object
JP3230209B2 (en) Grain sizing rate judgment device
KR20200068820A (en) People counter for improving accuracy
JPH08340242A (en) Detector switch
JP3401816B2 (en) Photoelectric switch
US20230314609A1 (en) Proximity sensing
JP3076617B2 (en) Method and apparatus for adjusting sensitivity of photoelectric switch
JPH07294643A (en) Seated state detector
JPH08184672A (en) Distance measuring apparatus
JP2000111315A (en) Photoelectric sensor and its production method

Legal Events

Date Code Title Description
A02 Decision of refusal

Effective date: 20040309

Free format text: JAPANESE INTERMEDIATE CODE: A02