JP2973218B2 - Compensation method for change in received light amount of photoelectric sensor - Google Patents

Compensation method for change in received light amount of photoelectric sensor

Info

Publication number
JP2973218B2
JP2973218B2 JP2142573A JP14257390A JP2973218B2 JP 2973218 B2 JP2973218 B2 JP 2973218B2 JP 2142573 A JP2142573 A JP 2142573A JP 14257390 A JP14257390 A JP 14257390A JP 2973218 B2 JP2973218 B2 JP 2973218B2
Authority
JP
Japan
Prior art keywords
value
amount
change
light
average value
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 - Fee Related
Application number
JP2142573A
Other languages
Japanese (ja)
Other versions
JPH0434386A (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.)
Omron Corp
Original Assignee
Omron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Corp filed Critical Omron Corp
Priority to JP2142573A priority Critical patent/JP2973218B2/en
Publication of JPH0434386A publication Critical patent/JPH0434386A/en
Application granted granted Critical
Publication of JP2973218B2 publication Critical patent/JP2973218B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Electronic Switches (AREA)
  • Optical Radar Systems And Details Thereof (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

《産業上の利用分野》 本発明は、フォトカプラの如き光電センサの受光量変
化補正方法に関し、特に投光素子の発光効率の変化、レ
ンズ面の曇り、汚れ等に起因する受光量変化を補正し、
誤動作を防止する受光量変化補正方法に関するものであ
る。 《従来の技術》 発光ダイオード(LED)等による投光素子とフォトダ
イオード(PD)等による受光素子とを用い、投光素子よ
りの光を受光素子が感知することにより無接触式に物品
等の移動、有無を検出するよう構成された光電センサは
よく知られており、これは各種の広い分野にて用いられ
ている。 光電センサの問題点として、温度変化により投光素子
の発光効率が変化することにより、或いは投光素子及び
受光素子のレンズ面に曇りが生じたり、ごみが付着する
ことにより、更には振動等によって投光素子と受光素子
との光軸にずれが生じる等により、受光素子が感知する
光量、即ち受光量が変化し、これによって受光回路に入
力される受光信号の大きさが変化することがあり、これ
は誤作動を生じる原因になる。 上述の如き問題点に鑑みて、受光素子とは別に、モニ
タフォトダイオードを用いたAPC回路を組込み、これに
よって温度変化等による投光素子の発光効率の変化を補
償することが既に提案されており、また受光素子による
受光量を任意の回数に亘って計測してそれの平均値を求
め、これと前回又は初期データとの比較により受光量補
正値を見出し、これによって投光量もしくは受光側ゲイ
ンをフィードバック補償することが提案されている。 《発明が解決しようとする課題》 モニタフォトダイオードを用いたAPC回路によるもの
は、投光素子の温度補償には有効であるが、しかしレン
ズ面の曇り、汚れ等に起因する受光量変化には対応でき
ず、これについては全く補償できない。 受光量の平均値をもとにフィードバック制御するもの
に於ては、投光素子の温度補償に加えてレンズ面の曇
り、汚れ等による受光量変化が補償されるようになる
が、しかしただ単に平均値の比較だけで受光量変化補正
制御が行われると、受光量計測値のばらつきや急激な単
発的な変化に充分に対応できず、必ずしも適切な受光量
変化補正が行われない。 また、平均値を求める計測回数の如何によっては計測
値のばらつきにより制御系が発振する虞れがあり、安定
した補正を行うことが困難である場合がある。 本発明は、従来の受光量変化補正に於ける上述の如き
問題点に着目してなされたものであり、投光素子の温度
特性やレンズ面の汚れ等による受光量変化を総括した上
で、受光量変化を信頼性高く適確に補償でき、しかも計
測値のばらつきにより制御系が発振することがなく安定
した補正が行われ、更には急激な単発的変化があって
も、それの頻度に応じて本来の変化に対する補正への支
障を極力小さくした上で信頼性の高い受光量変化補正を
行う受光量変化補正方法を提供することを目的としてい
る。 《課題を解決するための手段》 上述の如き目的は、本発明に於ては、光電センサの受
光素子の受光量を計測し、これの所定測定回数による平
均値と分布とを所定測定回数毎に検出し、今回の計測値
の平均値と前回の計測値の平均値とを比較すると共に今
回の計測値の分布と前回の計測値の分布とを比較し、こ
の両比較により受光量変化を補償すべく受光量補正値を
決定することを特徴とする光電センサの受光量変化補正
方法によって達成される。 また本発明による受光量変化補正方法に於ては、前記
受光素子の受光量の計測値が以前の計測値に比して大き
く異なる時には該計測値を前記平均値の算出及び分布に
参加させないか或いは該計測値が前記平均値の算出及び
分布度数に与える重みを小さくし、以前の計測値に比し
て大きく異なる計測値が計測される回数の増大に伴い該
計測値が前記平均値の算出及び分布度数に与える重みを
増大するようになっていてもよい。 また本発明による光電センサの受光量変化補正方法に
於ては、前記計測値の分布レンジが以前に比して拡大し
た時には前記平均値及び分布を検出する計測回数を増大
し、前記分布レンジが以前に比して縮小された時には前
記平均値及び分布を検出する測定回数を減少するように
なっていてよい。 《作用》 本発明による光電センサの受光量変化補正方法によれ
ば、受光量の計測値の平均値の変化に加えて計測値の分
布の変化を考慮して受光量補正値が決定されるから、投
光素子の温度特性やレンズ面の汚れ等に起因する受光量
変化が適切に補償され得るようになる。 また、受光量の計測値が以前の計測値に比して大きく
異なる時には、即ち急激な単発的変化が生じた場合に
は、これの頻度に応じて前記平均値及び計測値の分布度
数が更新され、急激な単発的変化が生じても本来の変化
に対する補正への支障を極力小さくした上で、このこと
に対しても信頼性の高い受光量補正が行われるようにな
る。 また計測値の分布レンジの変化に応じて平均値を算出
する計測回数が定められ、これにより計測値のばらつき
に起因して制御系が発振することが回避され、安定した
補正が行われるようになる。 《実施例》 以下に添付の図を参照して本発明を実施例について詳
細に説明する。 第1図は本発明による光電センサの光電量変化補正方
法の実施に用いられる光電センサ及び受光量変化制御装
置の回路ブロック図である。 第1図に於て、符号1は光電センサを示しており、光
電センサ1は投光素子3と受光素子5とにより構成され
ている。投光素子3はパルス変調方式のLED等により構
成され、投光用回路7により駆動されて発光するように
なっている。受光素子5は、フォトダイオード等により
構成され、投光素子3よりの光を受けて光を電流に変換
し、電流信号を出力するようになっている。 受光素子5よりの電流信号はI/D変換器9に与えられ
て電圧値に変換される。この電圧信号は、一般に微弱で
あるため、増幅器11により増幅される。増幅器11は受光
量変化補正のためのゲイン調整のためにゲインを可変設
定できる可変ゲイン増幅器として構成されている。 受光素子5が感応する光は投光素子3よりのパルス変
調波であるために、可変ゲイン設定器11よりの電圧信号
は、ピークホールドのサンプルホールド回路13に与えら
れてこれにて直流成分に変換され、この後にA/D変換器1
5によってディジタル信号化されてCPU17に入力される。 また可変ゲイン増幅器11が出力する電圧信号は信号処
理回路19に与えられる。信号処理回路19は一般的な光電
センサに於ける信号処理回路と同様のものであってよ
く、比較器による入光か非入光かの判別、ノイズフィル
タによるノイズ成分の除去等を行い、動作信号を出力す
るものである。この動作信号19はCPU17にも入力され
る。 CPU17は、一般的構造のものであってよく、EEPROM21
に格納されるオペレーションシステム、プログラムに従
って光電センサ1の受光量変化補正を行うようになって
いる。尚、CPU17はA/D変換器15とEEPROM21とを内蔵した
型式のものであってもよい。 CPU17は、光電センサ1の受光量変化補正のために可
変ゲイン設定器11にゲイン設定信号を出力し、またアラ
ーム信号を出力すると共にトリガ信号を入力するように
なっている。 受光素子5の受光量の変化を補正するためには、受光
量の計測値を逐次取込む必要があり、また受光量補正
用、換言すれば感度補正用の初期データとなる受光量の
測定値として、基準となり得る状態に於ける受光量の測
定値が必要である。基準となり得る状態は、光電センサ
が反射光検出式のものと透過光検出式のもの等の違いに
よって、第2図に示されている如く入光時の受光量が安
定するライトオンのものと、第3図に示されている如
く、遮光時の受光量が安定するダークオンとの二通りが
あるから、安定して入光する状態をオン状態としてこの
オン状態時の受光量を計測するようにする。より厳密に
言うならば、例えばライトオンの場合にはオン時の最大
受光量を、ダークオンのものに於てはオフ時の最小受光
量を取込むようにハードウェア構成或いはソフトウェア
にて処理されれば、オフからオン、或いはオンからオフ
へ移行する変化途中の光量変化が誤って感度補正用のデ
ータとして取入れられることがなくなる。またこの受光
量測定値の取込みタイミングが外部よりのゲートが掛け
られなければ、難しい場合は、CPU17にトリガ信号を入
れ、これによってゲートを掛けるようにすればよい。 光電センサ1の受光素子5に於ける受光量の経時的変
化を見るためには、所定回数の計測値の平均値の変化に
加えて計測値のばらつきによる変化の違いを見極めるこ
とが行われる。このために必要なデータの処理の一例を
次に説明する。 先ず、比較基準となるための初期データを取入れる必
要があるので、例えば光電センサ1のセッティング直
後、又は何等かのトリガ入力後に、所定回数n回の受光
量測定値を取込む。つまり例えば、光電センサ1がn回
に亘ってオンするまで搬送ラインに物品を流すなどした
受光量計測値を取込む。 そしてこのn回による受光量計測値の平均値とばらつ
き幅、即ち分布レンジをCPU17にて算出し、これを初期
データとしてCPU17の内部メモリに格納しておく。 次に実際の運転に移り、同じく受光量計測値をn回に
亘って逐次取入れ、受光量計測値をn回取終えた時点に
て上述の初期データと同様に、このn回の受光量計測値
より、これの平均値と分布レンジとを算出し、これと初
期データとを比較し、後述する要領にて受光量補正値を
決定し、これに基づいて可変ゲイン増幅器11へゲイン設
定信号を出力する。そして引続き次のn回に亘って受光
量計測値を順次取込んで、これの平均値と分布レンジと
を算出し、これと一回前に算出された平均値及び分布レ
ンジとを比較して受光量補正値を算出することを繰返
す。 次に、光電センサの受光量変化を補正するための本発
明による受光量変化補正方法の処理アルゴリズムを第一
の実施例について説明する。 受光素子5の受光量の変化を補正するために投光素子
3、受光素子5のレンズ面の汚れにより受光量が低下す
ると、第1図に於ける可変ゲイン増幅器3のゲインを大
きくすることが行われる。つまり、受光量の計測値の平
均値及び分布レンジが入力であり、データ処理後の出力
の一つは信号増幅のためのゲインとなる。 また計測値の分布レンジが初期データ或いは以前のも
のより大きくなった場合、データとしての信頼度を上
げ、発振現象の発生を防止するために、平均値及び分布
レンジ算出の計測回数を増やすことが好ましい状況が現
われる。逆に、計測値の分布レンジが以前より小さくな
った場合には、平均値及び分布レンジ算出の計測回数を
減らして受光量補正が行われる応答速度を速くし、効率
を上げた方がよい場合もある。このような場合のデータ
処理後の出力は平均値及び分布レンジ算出のための計測
回数ということになる。 ここで、入力データとしては、受光量計測値の平均値
とばらつき等を述べたが、ここのデータの中には、例え
ばセンサの検出光軸上に、誤って異物が一瞬だけ通過し
て光軸が遮られた時の如く、本来、平均値算出等のデー
タとしては除くべきものが混入している場合がある。但
しこれらのデータも、発生回数(出現回数)が増大して
くると、処理データとしての信頼度を上げるために、そ
れらに関する処理アルゴリズムも別途用意する必要が生
じる。以降この処理を例外処理と呼ぶ。 従って受光量変化を補正するための処理アルゴリズム
としては、感度補正に関するものと、平均値及び分布レ
ンジの算出のための計測回数の調整に関するものと、例
外処理に関するものの三つがある。以下にこの各処理ア
ルゴリズムについて説明する。 ◎感度補正に関する処理 第4図に示されている如く、n回に亘る受光量計測値
のばらつきが正規分布であったとすると、今回の計測値
のデータと前回の計測値のデータとの関係は、第5図に
示されている如く、今回の計測値の分布レンジが前回の
計測値の分布レンジ内に納まらない場合と、第6図に示
されている如くそれが納まる場合とがある。 第5図に示されている如く今回の計測値の分布レンジ
が前回のそれに完全には属していない場合は、今回の計
測値の平均値が前回の計測値の平均値のレベルにまで戻
るように、ゲイン調整が行われればよく、この時の計算
式は、現在のゲインをGn-1、補正後のゲインをGn、前回
の計測値の平均値をAn-1、今回の計測値の平均値をAn
すれば、下式により示される。 Gn=(An-1/An)Gn-1 …(1) 第6図に示されている如く、今回の計測値の分布レン
ジが前回の計測値の分布レンジに完全に属している場合
には、計測値の平均値自体が変化していても、それは単
に許容ばらつき内での変動ということが考えられるの
で、受光量補正値、即ちゲイン補正量を第5図に示され
ている如き場合に比して小さくすることが行われる。例
えば、第5図に示されている如き場合に比してそのゲイ
ン調整量をほぼ半分に設定する場合には、ゲイン算出用
の計算式は下式により示される。 Gn=0.5(An-1/An)Gn-1 …(2) 従って、所定回数に於ける受光量計測値の分布レンジ
の変化が、第5図に示されている如きパターンか、或い
は第6図に示されている如きパターンかを判別してゲイ
ン補正量が設定され、これによってフィードバック式に
受光量補正が行われる。更に、可変ゲイン設定器11の可
変ゲイン設定幅等の限界から、これ以上の補正が不可能
である場合には、CPU17はアラーム信号を出力するよう
になっていればよく、これにより診断機能を持たせるこ
とが可能になる。 ◎平均値算出及び分布レンジ算出のための計測回数の調
整に関する処理アルゴリズム 例えば、この計測回数が最小20回から最大50回まで可
変設定できるものとし、初期データ取込み時には、これ
は35回に設定されているものとする。 今回の計測値の分布レンジが前回のものと同一である
ならば、計測回数の35回は変更せず、分布レンジが零に
近付く程、計測回数が最低の20回に近付くように処理を
行う。逆に分布レンジが大きくなる場合は、例えば計測
値の分布レンジが前回のものの三倍になったとすると、
計測回数が最大の50回になるように設定しておき、この
分布レンジが大きくなるほど計測回数が増大するように
処理を行う。この計測回数の決定のための計算式は、前
回の計測値の分布レンジをRn-1、今回の計測値の分布レ
ンジをRn、調整後の計測回数をnとすれば下式により示
される。 Rn<Rn-1の場合 n=(Rn/Rn-1)15+20 …(3) Rn≧Rn-1の場合 n=(Rn/Rn-1)7.5+27.5. …(4) 但し、計測回数nは正の整数だけであるから、上述の
計算式に於て、nが有理数である場合には、少数点以下
が四捨五入されればよい。 また、受光量計測値の分布ばらつきが所定値を超えて
増大した場合にはアラーム出力が行われてよく、これに
よって使用者に光電センサ1の受光量の大きい変動等を
知らせることができるようになる。 ◎例外処理アルゴリズム ここでは例外処理の一例として、今回の計測値の分布
レンジRnが前回の分布レンジRn-1の三倍を超える計測値
を例外処理の対象とする。この例外処理は上述の如き例
外処理の対象となる計測値が出現する回数が少ない程無
視し、これが多くなる程補正用データとしての重み付け
を大きくする。 この場合、詳細には、前記受光素子5の受光量の計測
値が以前の計測値に比して大きく異なる時には該計測値
を前記平均値の算出及び分布に参加させないか、或いは
該計測値が前記平均値の算出及び分布度数に与える重み
を小さくし、以前の計測値に比して大きく異なる計測値
が計測される回数の増大に伴い該計測値が前記平均値の
算出及び分布度数に与える重みを増大する。 次に例外処理の対象となる計測値の出現回数が多くな
る程、そのものの値で計算し、回数が少ない程、小さく
加工して処理し、また例外対象の計測値の出現回数の度
合により、例外対象の計測値の平均値を後に全体の計測
データに加える時の重み付けを変える方法の計算例を以
下に示す。尚、この計算例に於ては、n回の計測中にk
個の例外対象の計測値Eがあったとする。
<< Industrial application field >> The present invention relates to a method for correcting a change in the amount of received light of a photoelectric sensor such as a photocoupler, and in particular, correcting a change in the amount of received light due to a change in luminous efficiency of a light emitting element, fogging of a lens surface, and contamination. And
The present invention relates to a method for correcting a change in the amount of received light for preventing a malfunction. << Conventional Technology >> A light-emitting device such as a light emitting diode (LED) and a light-receiving device such as a photodiode (PD) are used. Photoelectric sensors configured to detect movement and presence are well known and are used in a wide variety of fields. As a problem of the photoelectric sensor, the luminous efficiency of the light emitting element changes due to a temperature change, or the lens surfaces of the light emitting element and the light receiving element become fogged or dust adheres, and furthermore, due to vibration or the like. The amount of light sensed by the light receiving element, that is, the amount of received light may change due to a shift in the optical axis between the light emitting element and the light receiving element, which may change the magnitude of the light receiving signal input to the light receiving circuit. , Which can cause malfunctions. In view of the above problems, it has already been proposed to incorporate an APC circuit using a monitor photodiode separately from the light receiving element, thereby compensating for a change in the light emitting efficiency of the light emitting element due to a temperature change or the like. In addition, the amount of light received by the light receiving element is measured an arbitrary number of times, and the average value is obtained, and a correction value of the received light amount is found by comparing the average value with the previous or initial data. Feedback compensation has been proposed. 《Problems to be solved by the invention》 An APC circuit using a monitor photodiode is effective for temperature compensation of a light emitting element, but is not effective for changes in the amount of received light due to fogging and dirt on a lens surface. No response, no compensation for this. In the feedback control based on the average value of the received light amount, in addition to the temperature compensation of the light emitting element, a change in the received light amount due to fogging and dirt on the lens surface is compensated. If the received light amount change correction control is performed only by comparing the average value, it is not possible to sufficiently cope with a variation in the received light amount measurement value or a sudden one-off change, and thus an appropriate received light amount change correction is not necessarily performed. In addition, depending on the number of times of measurement for obtaining the average value, there is a possibility that the control system may oscillate due to variation in the measured value, and it may be difficult to perform stable correction. The present invention has been made by focusing on the above-described problems in the conventional light reception amount change correction, and comprehensively describes the change in the light reception amount due to the temperature characteristics of the light emitting element, dirt on the lens surface, and the like. The change in received light amount can be compensated accurately and reliably, and the control system does not oscillate due to the dispersion of the measured values.Stable correction is performed. Accordingly, it is an object of the present invention to provide a light-receiving-amount change correction method for performing a highly reliable light-receiving-amount change correction while minimizing an obstacle to correction for an original change. << Means for Solving the Problems >> In the present invention, the object as described above is to measure the amount of light received by a light receiving element of a photoelectric sensor, and to calculate an average value and a distribution of the measured amounts by a predetermined number of times for each predetermined number of times. The average value of the current measurement value is compared with the average value of the previous measurement value, and the distribution of the current measurement value is compared with the distribution of the previous measurement value. This is achieved by a method for correcting a change in the amount of received light of a photoelectric sensor, wherein a correction value of the amount of received light is determined to compensate. Further, in the received light amount change correction method according to the present invention, when the measured value of the received light amount of the light receiving element is significantly different from the previous measured value, the measured value is not allowed to participate in the calculation and distribution of the average value. Alternatively, the weight given to the calculation of the average value and the distribution frequency by the measurement value is reduced, and the measurement value is calculated with the increase in the number of times the measurement value that is significantly different from the previous measurement value is measured. And the weight given to the distribution frequency may be increased. Further, in the method for correcting a change in the amount of received light of the photoelectric sensor according to the present invention, when the distribution range of the measured values is expanded as compared with the previous case, the number of measurements for detecting the average value and the distribution is increased, and the distribution range is increased. The number of measurements for detecting the average value and the distribution may be reduced when the size is reduced as compared with the previous case. << Operation >> According to the method for correcting a change in the amount of received light of the photoelectric sensor according to the present invention, the corrected amount of received light is determined in consideration of the change in the distribution of the measured values in addition to the change in the average of the measured values of the received light. In addition, a change in the amount of received light due to the temperature characteristics of the light emitting element, contamination of the lens surface, and the like can be appropriately compensated. When the measured value of the received light amount is significantly different from the previous measured value, that is, when a sudden spontaneous change occurs, the average value and the distribution frequency of the measured value are updated according to the frequency of the change. Therefore, even if a sudden single change occurs, it is possible to minimize the obstacle to the correction for the original change, and to perform the highly reliable received light amount correction for this as well. Also, the number of measurements for calculating the average value is determined in accordance with the change in the distribution range of the measured values, so that the control system is prevented from oscillating due to the dispersion of the measured values, and stable correction is performed. Become. << Example >> Hereinafter, the present invention will be described in detail with reference to the accompanying drawings with reference to examples. FIG. 1 is a circuit block diagram of a photoelectric sensor and a light-receiving amount change control device used for implementing a method for correcting a change in photoelectric amount of a photoelectric sensor according to the present invention. In FIG. 1, reference numeral 1 denotes a photoelectric sensor, and the photoelectric sensor 1 includes a light projecting element 3 and a light receiving element 5. The light projecting element 3 is composed of a pulse modulation type LED or the like, and is driven by the light projecting circuit 7 to emit light. The light receiving element 5 is configured by a photodiode or the like, receives light from the light projecting element 3, converts the light into a current, and outputs a current signal. The current signal from the light receiving element 5 is given to the I / D converter 9 and is converted into a voltage value. Since this voltage signal is generally weak, it is amplified by the amplifier 11. The amplifier 11 is configured as a variable gain amplifier that can variably set a gain for gain adjustment for light amount variation correction. Since the light to which the light receiving element 5 responds is a pulse modulated wave from the light projecting element 3, the voltage signal from the variable gain setting unit 11 is supplied to the peak hold sample and hold circuit 13 and converted into a DC component. A / D converter 1
The signal is converted into a digital signal by 5 and input to the CPU 17. The voltage signal output from the variable gain amplifier 11 is provided to the signal processing circuit 19. The signal processing circuit 19 may be the same as a signal processing circuit in a general photoelectric sensor, and performs operation such as discriminating light incident or non-light incident by a comparator, removal of a noise component by a noise filter, and the like. It outputs a signal. This operation signal 19 is also input to the CPU 17. The CPU 17 may be of a general structure,
The correction of the change in the amount of received light of the photoelectric sensor 1 is performed according to an operation system and a program stored in the storage device. Note that the CPU 17 may be of a type incorporating the A / D converter 15 and the EEPROM 21. The CPU 17 outputs a gain setting signal to the variable gain setting device 11 for correcting a change in the amount of light received by the photoelectric sensor 1, outputs an alarm signal, and inputs a trigger signal. In order to correct the change in the amount of light received by the light receiving element 5, it is necessary to sequentially acquire the measured value of the amount of received light, and the measured value of the amount of received light serving as initial data for correcting the amount of received light, in other words, sensitivity correction. Therefore, a measured value of the amount of received light in a state that can serve as a reference is required. The reference state may be a light-on type in which the amount of light received is stable as shown in FIG. 2 due to the difference between the photoelectric sensor of the reflected light detection type and the transmitted light detection type, as shown in FIG. As shown in FIG. 3, there are two types, dark on, in which the amount of received light during light shielding is stable. Therefore, the state in which light enters stably is set to the on state, and the amount of received light in this on state is measured. To Strictly speaking, for example, the hardware configuration or software is used to capture the maximum amount of light received when the light is on and the minimum amount of light received when the dark is on. For example, a change in the amount of light during the transition from off to on or from on to off is not erroneously taken in as sensitivity correction data. If it is difficult to take in the timing of taking in the measured value of the received light amount unless an external gate is applied, a trigger signal may be input to the CPU 17 to apply the gate. In order to observe the change over time in the amount of light received by the light receiving element 5 of the photoelectric sensor 1, it is necessary to determine the difference in the change due to the variation in the measured values in addition to the change in the average value of the measured values for a predetermined number of times. An example of data processing required for this will be described below. First, since it is necessary to take in initial data to be used as a comparison reference, for example, immediately after setting of the photoelectric sensor 1 or after inputting any trigger, a received light amount measurement value is taken n times a predetermined number of times. That is, for example, a measured value of the amount of received light, such as flowing an article through the transport line until the photoelectric sensor 1 is turned on n times, is acquired. Then, the CPU 17 calculates the average value and the variation width of the measured values of the amount of received light by the n times, that is, the distribution range, and stores them in the internal memory of the CPU 17 as initial data. Next, the actual operation is started, and the received light amount measurement values are sequentially taken in n times in the same manner. From the values, the average value and the distribution range are calculated, and this is compared with the initial data, the received light amount correction value is determined in a manner described later, and the gain setting signal is sent to the variable gain amplifier 11 based on this. Output. Subsequently, the received light amount measurement values are successively taken over the next n times, the average value and the distribution range are calculated, and this is compared with the average value and the distribution range calculated one time ago. The calculation of the received light amount correction value is repeated. Next, a description will be given of a processing algorithm of a method for correcting a change in the amount of received light according to the present invention for correcting a change in the amount of received light of the photoelectric sensor in the first embodiment. If the amount of light received decreases due to contamination of the lens surfaces of the light projecting element 3 and the light receiving element 5 in order to correct the change in the amount of light received by the light receiving element 5, the gain of the variable gain amplifier 3 in FIG. Done. That is, the average value and the distribution range of the measured values of the amount of received light are input, and one of the outputs after data processing is a gain for signal amplification. In addition, when the distribution range of the measured value is larger than the initial data or the previous one, it is necessary to increase the number of measurements of the average value and the distribution range calculation in order to increase the reliability as data and prevent occurrence of oscillation phenomenon. A favorable situation appears. Conversely, if the distribution range of the measured values is smaller than before, it is better to increase the response speed at which the received light amount correction is performed by reducing the number of measurements for calculating the average value and the distribution range, and to increase the efficiency. There is also. The output after data processing in such a case is the number of measurements for calculating the average value and the distribution range. Here, as the input data, the average value and the variation of the measured amount of received light are described. However, in this data, for example, a foreign substance accidentally passes through the detection optical axis of the sensor for a moment and is illuminated. As in the case where the axis is blocked, there is a case where data to be originally excluded as data for calculating the average value is mixed. However, when the number of occurrences (the number of appearances) of these data also increases, it is necessary to separately prepare a processing algorithm for them in order to increase the reliability as the processing data. Hereinafter, this processing is referred to as exception processing. Therefore, there are three processing algorithms for correcting a change in the amount of received light, those relating to sensitivity correction, those relating to adjustment of the number of measurements for calculating an average value and a distribution range, and those relating to exception processing. The respective processing algorithms will be described below. ◎ Processing for Sensitivity Correction As shown in FIG. 4, if the variation of the received light amount measurement value over n times is a normal distribution, the relationship between the data of the current measurement value and the data of the previous measurement value is As shown in FIG. 5, there are a case where the distribution range of the current measurement value does not fall within the distribution range of the previous measurement value, and a case where it falls as shown in FIG. As shown in FIG. 5, when the distribution range of the current measurement value does not completely belong to that of the previous measurement, the average value of the current measurement value returns to the level of the average value of the previous measurement value. a, it is sufficient performed gain adjustment, equation at this time, G n-1 the current gain, the gain of the corrected G n, a n-1 the average value of the previous measurement value, the current measurement Assuming that the average value of the values is An , it is represented by the following equation. G n = (A n-1 / A n ) G n-1 (1) As shown in FIG. 6, the distribution range of the current measurement value completely belongs to the distribution range of the previous measurement value. In this case, even if the average value itself of the measured values changes, it is considered that the change is merely a variation within the allowable variation. Therefore, the received light amount correction value, that is, the gain correction amount is shown in FIG. It is made smaller than in such cases. For example, when the gain adjustment amount is set to approximately half that in the case as shown in FIG. 5, the calculation formula for calculating the gain is represented by the following expression. G n = 0.5 (A n-1 / A n ) G n-1 (2) Accordingly, the change in the distribution range of the measured amount of received light at the predetermined number of times is determined by the pattern shown in FIG. Alternatively, it is determined whether the pattern is as shown in FIG. 6, and the gain correction amount is set, whereby the light receiving amount correction is performed in a feedback manner. Further, if further correction is not possible due to the limit of the variable gain setting width of the variable gain setting device 11, the CPU 17 only needs to output an alarm signal. It becomes possible to have. ◎ Processing algorithm related to adjustment of the number of measurements for calculating the average value and distribution range For example, assume that the number of measurements can be variably set from a minimum of 20 to a maximum of 50, and this is set to 35 at the time of initial data capture It is assumed that If the distribution range of the current measurement value is the same as the previous one, do not change the measurement count of 35, and process so that the distribution count approaches the minimum of 20 as the distribution range approaches zero . Conversely, if the distribution range is large, for example, if the distribution range of the measured value is three times the previous one,
The number of measurements is set to be the maximum of 50 times, and the processing is performed so that the number of measurements increases as the distribution range increases. Equation for determination of the measurement number, R n-1 the distribution range of the previous measurement value, indicated the distribution range of the current measurement value R n, the number of measurements adjusted by n Tosureba following formula It is. If R n <R n-1 n = (R n / R n-1 ) 15 + 20 ... (3) If R n ≧ R n-1 n = (R n / R n-1 ) 7.5 + 27.5. (4) However, since the number of measurements n is only a positive integer, in the above formula, if n is a rational number, it is only necessary to round off the decimal point. In addition, when the variation in the distribution of the measured amount of received light exceeds a predetermined value, an alarm may be output, so that the user can be notified of a large change in the amount of received light of the photoelectric sensor 1 or the like. Become. ◎ An example of exception handling exception processing algorithm, where the measured value distribution range R n of the current measured value exceeds three times the distribution range R n-1 of the previous target of exception processing. This exception processing is ignored as the number of occurrences of the measurement value to be subjected to the exception processing as described above decreases, and as the number increases, the weight as correction data is increased. In this case, in detail, when the measured value of the amount of light received by the light receiving element 5 is significantly different from the previous measured value, the measured value is not allowed to participate in the calculation and distribution of the average value, or the measured value is The weight given to the calculation of the average value and the distribution frequency is reduced, and the measurement value is given to the calculation of the average value and the distribution frequency with an increase in the number of times that the measurement value greatly different from the previous measurement value is measured. Increase weight. Next, as the number of occurrences of the measurement value subject to exception processing increases, it is calculated with the value itself, and as the number of times decreases, it is processed smaller and processed. A calculation example of a method of changing the weight when the average value of the measurement values of the exception target is later added to the entire measurement data is described below. Note that, in this calculation example, during n measurements, k
It is assumed that there are three exceptional measurement values E.

【E>An−1+3Rn−1の場合】 Ae=[{E1+E2+…Ek)/k −(An-1+3Rn-1)}(k/n)} +(An-1+3Rn-1) …(5) ΣE=Ae・k・(k/n) …(6) ∴An=(ΣE+ΣM)/{k(k/n)+(n−k)} …(7) 但し、ΣE:例外対象以外の計測値の和 この時、+R=Ae −R=3Rn-1内の計測値の最小値 [E> A n-1 + 3R For n-1] Ae = [{E 1 + E 2 + ... E k) / k - (A n-1 + 3R n-1)} (k / n)} + (A n-1 + 3Rn -1 ) (5) {E = Ae · k · (k / n) (6) {A n = (ΣE + ΔM) / {k (k / n) + (nk)} (7) where ΔE is the sum of the measured values other than the exception target. At this time, the minimum value of the measured values within + R = Ae−R = 3R n-1

【E<An−1−3Rn−1の場合】 Ae=(An-1−3Rn-1)−[{(An-1 −3Rn-1)−(E1+E2+…Ek) /k}(k/n)] …(8) ΣE=Ae・k・(k/n) …(9) ∴An=(ΣE+ΣM)/{k(k/n)+(n−k)} …(10) この時、+R=3Rn-1内の計測値の最大値 −R=Ae (5)及び(8)式は、例外対象の計測値Eの前回の
計測値分布レンジからの偏差の平均値に(k/a)を掛け
ることにより、例外対象の計測値の出現回数kが多くな
る程、そのものの値に近付くように計算を行っている。
尚、例外対象の計測値Eの出現回数kに対する重み付け
の度合を変えたい場合には、(k/n)をべき乗する等の
処理が行われればよい。 (6)式及び(9)式は、例外対象の計測値Eの全体
の和を求めたものであるが、これの個数kに(k/n)を
掛けることにより、例外対象の計測値Eのデータの個数
kが多くなる程、実測値に近付き、これが少ない程無視
(軽視)される確率が高まるようにしている。 (7)式及び(10)式は、以上の処理に於て、例外対
象の計測値Eを処理した後の計測値全体の重み付けの平
均値を表わしている。 尚、例外対象の計測値が所定値を超えて多く出現する
場合には、アラーム出力が行われればよく、これにより
外的環境の変化を使用者に知らせることができるように
なる。 次に上述の如き受光量変化補正の処理をファジィ推論
を用いて行う場合について説明する。 ファジィ推論が用いられることにより、処理アルゴリ
ズム体系が、簡易で、理解され易くなり、また状況に適
合した処理を汎用的に組込むことが可能になり、且つ応
答性を向上させることができる。 ファジィ推論を用いた受光量変化補正のための処理ア
ルゴリズムについても、上述の実施例と同様に、感度補
正と計測回数調整と例外処分に分けて説明する。 ◎感度補正に関するファジィ推論アルゴリズム 感度補正に関するファジィ推論ルールの一例を(10)
〜(15)式に示す。 このファジィ推論に於ける入力要件は、受光量の計測
値の平均値Anと今回の受光量の計測値の全てが前回の計
測値のばらつき集合(分布レンジ)内に全て含まれるか
否かの判断データであり、出力はゲイン変化率ΔGであ
る。 (11)式と(15)式に示されたファジィ推論ルールに
於ては、今回の受光量の計測値が前回の受光量計測値の
ばらつき範囲を超えているので、そのまま平均値が前回
の値に戻るようにゲイン調整によるフィードバック制御
を行い、(12)式と(14)式にて示されたファジィ推論
ルールに於ては、今回の受光量の計測値が前回の受光量
の計測値のばらつき範囲内に全てあるのでゲイン変化率
を小さくし、少めにフィードバック制御を行う。 尚、例えば、(11)式のファジィ推論ルールの場合、
「平均値がかなり大きく低下し、しかも今回の計測デー
タが前回の計測データのばらつきの範囲を超していれ
ば、ゲインをかなり大きくせよ」という命令を意味して
いる。 第7図は受光量計測値の平均値Anの入力メンバーシッ
プ関数を、第8図はゲイン変化率ΔGの出力メンバーシ
ップ関数を示している。例えば、8ビットCPUにて処理
を行う場合、受光量計測値の平均値Anの最小値(NL)は
1で、最大値(PL)は256となり、また平均値の変化が
殆ど無い場合(ZR)の値は前回の平均値An-1となる。 ゲイン変化率ΔGのメンバーシップ関数は、計測値の
平均値が変化しても、補正値、確実に前回の計測値の平
均値に戻るように現在のゲインに対する変化率の値とし
て、NL、ZR、PLの値を設定する。 ◎計測回数の調整に関するファジィ推論アルゴリズム 計測値の平均値及び分布レンジを算出する計測回数の
調整に関するファジィ推論ルールの一例を(16)〜(1
8)式に示している。 If Rn/Rn-1=NL then Δn=NL …(16) If Rn/Rn-1=ZR then Δn=ZR …(17) If Rn/Rn-1=PL then Δn=PL …(18) このファジィ推論ルールに於ける入力要件は前回の計
測値の分布レンジRn-1に対する今回の計測値の分布レン
ジRnの比(Rn/Rn-1)であり、出力は計測回数の調整度
数としての変化量Δnである。これは現在の計測回数か
ら、計測回数を何回増やすか、或いは何回減らすかを表
わす。 尚、例えば、(16)式に示されたファジィ推論ルール
の場合、「今回の計測データの分布レンジが前回のそれ
より、かなり小さければ、計測回数をかなり少なくせ
よ」という命令であり、(17)式は、分布レンジの変化
が殆ど無いので、計測回数は変化させず、(18)式は、
分布レンジの変化がかなり大きいので計測回数をかなり
増やせということを意味する。つまり、分布レンジが大
きくなる程に計測回数を増やすようにファジィ推論ルー
ルが設定されている。 第9図は分布レンジ比Rn/Rn-1の入力メンバーシップ
関数を示している。分布レンジ比の最小値(NL)はRn
0より0になり、殆ど変化しない場合(ZR)は1にな
る。また最大値(PL)については、例えば前回の分布レ
ンジRn-1の三倍位に設定する。尚、この最大値について
は、アプリケーションに応じて最適値が設定されればよ
い。第10図は計測回数の調整度合Δnを示す出力メンバ
ーシップ関数を示している。調整度合Δnに関しては、
この場合、NL=−15、ZR=0、PL=15に設定している。 ◎例外処理に関するファジィ推論アルゴリズム 例外処理に於ける感度補正のファジィ推論ルールの一
例を(19)〜(23)式に示している。 このファジィ推論に於ける入力要件は、例外と見做さ
れる計測値、例えば前回の計測値の分布レンジの範囲の
三倍を超える計測値の平均値Aeと、その例外対象の計測
値の出現回数kであり、出力はゲイン変化率ΔG2であ
る。ゲイン変化率ΔG2は、上述の感度補正によるゲイン
調整後に行われるものである。従って、この場合、上述
の感度補正のゲイン変化率ΔGはこの例外対象の計測値
による補正成分を含んでいないものとする。 If Ae=PL and k=PL then ΔG2=NL …(19) If Ae=PL and k=NL then ΔG2=ZR …(20) If Ae=ZR then ΔG2=ZR …(21) If Ae=NL and k=NL then ΔG2=ZR …(22) If Ae=NL and k=PL then ΔG2=PL …(23) このファジィ推論ルールに於ては、例外対象の計測値
の平均値Aeが大きい程、ゲインを小さくするように補正
するが、その時に、この例外対象の計測値の出現回数k
が小さい程、その補正の大きさを小さくしている。つま
り、例外対象の計測値の出現回数kが小さい程、例外対
象の計測値による影響を小さくするようにしている。
尚、例えば、(19)式に示されたファジィ推論ルールの
場合、「例外対象の計測値の平均値がかなり大きく、そ
の出現回数もかなり大きいようであるならば、かなり大
きくゲインを下げよ」という命令となる。 このファジィ推論により、たとえ突発的な異常な計測
値があったとしても確実な光量補正が可能になる。 第11図は例外対象の計測値の平均値Aeの入力メンバー
シップ関数を、第12図は例外対象の計測値の出現回数k
の入力メンバーシップ関数を、第13図はゲイン補正率Δ
G2の出力メンバーシップ関数を各々示している。尚、第
11図に示された入力メンバーシップ関数と第14図に示さ
れた出力メンバーシップ関数に関しては、前述の感度補
正に関するファジィ推論のアルゴリズム時に於ける入力
メンバーシップ関数と出力メンバーシップ関数と同じで
ある。例外対象の計測値の出現回数kに於て、最小値
(NL)は全く出現しなかった場合であり、これは零であ
る。最大値(PL)は、その時の最大計測回数になり、そ
の中間値位をZRとする。この回数に関する重み付けを変
えたい時はZRの値が操作されればよい。 尚、この例外処理に関するファジィ推論アルゴリズム
と感度補正に関するファジィ推論アルゴリズムとを組合
せ、ファジィ推論が、例えば「光量変化がかなりある
が、例外対象の計測値の可能性も若干含んでいるので、
少し大きく感度を変化させろ」という如きファジィ推論
に従って行われるようにしてもよい。 上述の如く、ファジィ推論ルール及びメンバーシップ
関数が設定されることにより、簡単なアルゴリズムで、
確実に安定した光量変化の補正が行われるようになる。 《発明の効果》 以上の説明から理解される如く、本発明による光電セ
ンサの受光量変化補正方法によれば、受光量の計測値の
平均値の変化に加えて計測値の分布の変化を考慮して受
光量補正値が決定されるから、投光素子の温度特性やレ
ンズ面の汚れ等に起因する受光量変化が適切に補償され
得るようになる。また、受光量の計測値が以前の計測値
に比して大きく異なる時には、即ち急激な単発的変化が
生じた場合にはこれの頻度に応じて前記平均値及び計測
値の分布度数が更新され、急激な単発的変化が生じても
本来の変化に対する補正への支障を極力小さくした上
で、このことに対しても信頼性の高い受光量補正が行わ
れるようになる。また計測値の分布レンジの変化に応じ
て平均値を算出する計測回数が定められ、これにより計
測値のばらつきに起因して制御系が発振することが回避
され、安定した補正が行われるようになる。
[E <A n-1 -3R n-1 ] Ae = (A n-1 -3R n-1 )-[{(A n-1 -3R n-1 )-(E 1 + E 2 + ... (E k ) / k} (k / n)] (8) ΣE = Ae · k · (k / n) (9) ∴A n = (ΣE + ΣM) / {k (k / n) + (n− k)} (10) At this time, the maximum value of the measured value within + R = 3R n-1 −R = Ae (5) and (8) are the previous measured value distribution ranges of the measured value E of the exception target. By multiplying the average value of the deviation from by (k / a), the calculation is performed so as to approach the value as the number of appearances k of the measurement value of the exception target increases.
If it is desired to change the degree of weighting with respect to the number of appearances k of the measurement value E of the exception target, processing such as raising (k / n) to the power may be performed. Equations (6) and (9) are obtained by calculating the total sum of the measurement values E of the exception target, and by multiplying the number k of these values by (k / n), the measurement value E of the exception target is obtained. As the number k of data increases, the measured value approaches the actual measured value, and as the number k decreases, the probability of being ignored (disregarded) increases. Equations (7) and (10) represent the average of the weights of the entire measured value after processing the exceptional measured value E in the above processing. When a large number of exceptional measured values exceed a predetermined value, an alarm may be output, and this allows the user to be notified of changes in the external environment. Next, a case will be described in which the above-described process of correcting the change in the amount of received light is performed using fuzzy inference. By using the fuzzy inference, the processing algorithm system is simple and easy to understand, and it is possible to incorporate a process suitable for the situation in a general-purpose manner and to improve the responsiveness. A processing algorithm for light amount variation correction using fuzzy inference will be described separately for sensitivity correction, measurement frequency adjustment, and exceptional disposal, as in the above-described embodiment. ◎ Fuzzy inference algorithm for sensitivity correction An example of fuzzy inference rules for sensitivity correction (10)
To (15). At input requirements for this fuzzy inference, whether all of the measurement values of the average value A n and the current light reception amount of the measured value of the light receiving amount is included all the variations set of previous measurement value (distribution range) The output is the gain change rate ΔG. In the fuzzy inference rules shown in Equations (11) and (15), the measured value of the received light amount this time exceeds the variation range of the measured value of the previous received light amount. The feedback control by gain adjustment is performed so that the value returns to the value. In the fuzzy inference rules shown in the equations (12) and (14), the measured value of the received light amount is the measured value of the previous received light amount. Therefore, the gain change rate is reduced and the feedback control is performed slightly. For example, in the case of the fuzzy inference rule of Expression (11),
This means that if the average value is considerably reduced and the current measurement data exceeds the range of the variation of the previous measurement data, the gain should be considerably increased. Figure 7 is an input membership function of the mean value A n of received light amount measurement value, Figure 8 shows the output membership function of the gain change rate .DELTA.G. For example, 8 if at bit CPU performs processing, minimum value of the average value A n of received light amount measurement value (NL) is 1 and the maximum value (PL) 256, and the hand when the change of the average value is almost no ( ZR) is the previous average value An-1 . The membership function of the gain change rate ΔG is calculated as NL, ZR as the correction value and the change rate value for the current gain so as to surely return to the average value of the previous measurement value even if the average value of the measurement values changes. , PL value. ◎ A fuzzy inference algorithm for adjusting the number of measurements The example of the fuzzy inference rules for adjusting the number of measurements for calculating the average value and the distribution range of the measured values is shown in (16) to (1).
8) shown in equation. If R n / R n-1 = NL then Δn = NL ... (16) If R n / R n-1 = ZR then Δn = ZR ... (17) If R n / R n-1 = PL then Δn = PL ... (18) at the input requirements to the fuzzy inference rule is the ratio of the distribution range R n of current measurement values on the distribution range R n-1 of the previous measurement value (R n / R n-1), an output Is a variation Δn as an adjustment frequency of the number of times of measurement. This indicates how many times the number of measurements is increased or decreased from the current number of measurements. For example, in the case of the fuzzy inference rule shown in the expression (16), the instruction is “if the distribution range of the current measurement data is considerably smaller than that of the previous measurement, reduce the number of measurements considerably”. Equation (18) does not change the number of measurements because there is almost no change in the distribution range.
Since the change in the distribution range is quite large, it means that the number of measurements can be significantly increased. That is, the fuzzy inference rule is set so that the number of measurements is increased as the distribution range is increased. Figure 9 shows the input membership functions of the distribution range ratio R n / R n-1. The minimum value (NL) of the distribution range ratio is R n =
It becomes 0 from 0, and becomes 1 when it hardly changes (ZR). The maximum value (PL) is set to, for example, a triple of the previous distribution range Rn -1 . The maximum value may be set to an optimal value according to the application. FIG. 10 shows an output membership function indicating the degree of adjustment Δn of the number of measurements. Regarding the adjustment degree Δn,
In this case, NL = −15, ZR = 0, and PL = 15. ◎ Fuzzy inference algorithm for exception processing An example of a fuzzy inference rule for sensitivity correction in exception processing is shown in equations (19) to (23). The input requirement in this fuzzy inference is that the measured values considered as exceptions, for example, the average value Ae of the measured values exceeding three times the range of the distribution range of the previous measured value, and the appearance of the measured value of the exception target The number of times is k, and the output is the gain change rate ΔG 2 . The gain change rate ΔG 2 is obtained after the gain adjustment by the above-described sensitivity correction. Therefore, in this case, it is assumed that the gain change rate ΔG of the above-described sensitivity correction does not include the correction component based on the measurement value of the exception target. If Ae = PL and k = PL then ΔG 2 = NL ... (19) If Ae = PL and k = NL then ΔG 2 = ZR ... (20) If Ae = ZR then ΔG 2 = ZR ... (21) If Ae = NL and k = NL then ΔG 2 = ZR ... (22) If Ae = NL and k = PL then ΔG 2 = PL ... (23) In this fuzzy inference rule, the average value Ae of the measured values of the exception target is The gain is corrected so as to be smaller as the value is larger.
Is smaller, the magnitude of the correction is smaller. That is, as the number of appearances k of the measurement value of the exception target is smaller, the influence of the measurement value of the exception target is reduced.
For example, in the case of the fuzzy inference rule shown in Expression (19), "if the average value of the measured values of the exceptional targets is quite large and the number of appearances thereof is also quite large, lower the gain considerably." Command. This fuzzy inference enables reliable light quantity correction even if there is a sudden abnormal measurement value. FIG. 11 shows the input membership function of the average value Ae of the measurement values of the exception target, and FIG. 12 shows the number of appearances k of the measurement values of the exception target.
FIG. 13 shows the gain correction rate Δ
Shows each output membership function of G 2. In addition,
The input membership function shown in FIG. 11 and the output membership function shown in FIG. 14 are the same as the input membership function and the output membership function in the fuzzy inference algorithm regarding the sensitivity correction described above. . This is a case where the minimum value (NL) does not appear at all in the number of appearances k of the measurement value of the exception target, which is zero. The maximum value (PL) is the maximum number of measurements at that time, and the intermediate value is ZR. To change the weight for the number of times, the value of ZR may be manipulated. It should be noted that the fuzzy inference algorithm relating to the exception processing and the fuzzy inference algorithm relating to the sensitivity correction are combined, and the fuzzy inference includes, for example, `` There is a considerable change in the light amount, but the measurement value of the exception target includes a little,
Change the sensitivity slightly larger ". As described above, by setting the fuzzy inference rules and membership functions, a simple algorithm can be used.
As a result, a stable correction of a change in the amount of light is performed. << Effects of the Invention >> As understood from the above description, according to the method for correcting a change in the amount of received light of the photoelectric sensor according to the present invention, a change in the distribution of the measured values is considered in addition to the change in the average of the measured values of the received light. As a result, the received light amount correction value is determined, so that a change in the received light amount due to the temperature characteristics of the light emitting element, contamination of the lens surface, and the like can be appropriately compensated. Further, when the measured value of the received light amount is significantly different from the previous measured value, that is, when a sudden spontaneous change occurs, the average value and the distribution frequency of the measured value are updated according to the frequency of the sudden change. Even if a sudden one-off change occurs, the obstacle to the correction for the original change is reduced as much as possible, and the light amount correction with high reliability is performed for this as well. Also, the number of measurements for calculating the average value is determined in accordance with the change in the distribution range of the measured values, so that the control system is prevented from oscillating due to the dispersion of the measured values, and stable correction is performed. Become.

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

第1図は本発明による光電センサの受光量変化補正方法
の実施に用いられる光電センサ及び受光量変化補正制御
装置の一実施例を示すブロック線図、第2図はライトオ
ン型の光電センサの受光量の変化を示すグラフ、第3図
はダークオン型の光電センサの受光量変化を示すグラ
フ、第4図は所定回数の受光量の計測値の平均値及びそ
れの分布レンジを示すグラフ、第5図及び第6図は各々
今回の計測値の分布レンジと前回の計測値の分布レンジ
との相違を示すグラフ、第7図は感度補正に関するファ
ジィ推論に於ける入力要件である計測値の平均値の入力
メンバーシップ関数を示すグラフ、第8図はそれの出力
であるゲイン変化率の出力メンバーシップ関数を示すグ
ラフ、第9図は計測回数の調整に関するファジィ推論に
於ける入力要件である計測値の分布レンジの入力メンバ
ーシップ関数を示すグラフ、第10図はそれの出力である
測定回数調整度合の出力メンバーシップ関数を示すグラ
フ、第11図は例外処理に関するファジィ推論に於ける入
力要件である例外対象の計測値の平均値の入力メンバー
シップ関数を示すグラフ、第12図はそれの例外計測値の
出現回数の入力メンバーシップ関数を示すグラフ、第13
図はそれの出力であるゲイン変化率の出力メンバーシッ
プ関数を示すグラフである。 1……光電センサ 3……投光素子 5……受光素子 11……可変ゲイン増幅器 17……CPU 19……信号処理回路
FIG. 1 is a block diagram showing an embodiment of a photoelectric sensor and a received light amount change correction control device used for implementing a method of correcting a received light amount change of a photoelectric sensor according to the present invention, and FIG. 2 is a block diagram of a light-on type photoelectric sensor. FIG. 3 is a graph showing a change in the amount of received light of a dark-on type photoelectric sensor, FIG. 4 is a graph showing an average value of measured values of the amount of received light a predetermined number of times, and a distribution range thereof. 5 and 6 are graphs respectively showing the difference between the distribution range of the present measurement value and the distribution range of the previous measurement value, and FIG. 7 is the average of the measurement values which is an input requirement in fuzzy inference regarding sensitivity correction. 8 is a graph showing an output membership function of a gain change rate as an output thereof, and FIG. 9 is an input requirement in fuzzy inference regarding adjustment of the number of measurements. Graph showing the input membership function of the distribution range of measured values, Fig. 10 is a graph showing the output membership function of the degree of adjustment of the number of measurements that is the output, and Fig. 11 is the input requirement in fuzzy inference regarding exception handling Is a graph showing the input membership function of the average value of the measured values of the exception target, and FIG. 12 is a graph showing the input membership function of the number of occurrences of the exceptional measured value, and FIG.
The figure is a graph showing the output membership function of the gain change rate which is the output. 1 ... photoelectric sensor 3 ... light emitting element 5 ... light receiving element 11 ... variable gain amplifier 17 ... CPU 19 ... signal processing circuit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 堤 康弘 京都府京都市右京区花園土堂町10番地 オムロン株式会社内 (56)参考文献 特開 平1−94283(JP,A) 特開 平1−286655(JP,A) 実開 昭60−113573(JP,U) 特公 昭62−47262(JP,B2) (58)調査した分野(Int.Cl.6,DB名) G01S 7/48 - 7/51 G01S 17/00 - 17/95 H03K 17/78 G01V 8/10 ────────────────────────────────────────────────── ─── Continued on the front page (72) Inventor Yasuhiro Tsutsumi Omron Co., Ltd. (10) Hanazono Dodocho, Ukyo-ku, Kyoto-shi, Kyoto (56) References JP-A-1-94283 (JP, A) JP-A-1- 286655 (JP, A) Japanese Utility Model 60-113573 (JP, U) JP-B 62-47262 (JP, B2) (58) Fields investigated (Int. Cl. 6 , DB name) G01S 7/48-7 / 51 G01S 17/00-17/95 H03K 17/78 G01V 8/10

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】光電センサの受光素子の受光量を計測し、
これの所定測定回数による平均値と分布とを所定測定回
数毎に検出し、今回の計測値の平均値と前回の計測値の
平均値とを比較すると共に今回の計測値の分布と前回の
計測値の分布とを比較し、この両比較により受光量変化
を補償すべく受光量補正値を決定することを特徴とする
光電センサの受光量変化補正方法。
1. A method for measuring the amount of light received by a light receiving element of a photoelectric sensor,
The average value and distribution based on the predetermined number of measurements are detected for each predetermined number of measurements, and the average value of the current measurement value and the average value of the previous measurement value are compared, and the distribution of the current measurement value and the previous measurement are compared. A method for correcting a change in the amount of received light of a photoelectric sensor, comprising comparing a distribution of values and a light-receiving amount correction value for compensating for a change in the amount of received light.
【請求項2】前記受光素子の受光量の計測値が以前の計
測値に比して大きく異なる時には該計測値を前記平均値
の算出及び分布に参加させないか或いは該計測値が前記
平均値の算出及び分布度数に与える重みを小さくし、以
前の計測値に比して大きく異なる計測値が計測される回
数の増大に伴い該計測値が前記平均値の算出及び分布度
数に与える重みを増大することを特徴とする請求項1記
載の光電センサの受光量変化補正方法。
2. When the measured value of the amount of light received by the light receiving element is significantly different from the previous measured value, the measured value is not allowed to participate in the calculation and distribution of the average value, or the measured value is calculated based on the average value. The weight given to the calculation and the distribution frequency is reduced, and the weight given to the calculation of the average value and the distribution frequency by the measurement value is increased with the increase in the number of times that the measurement value greatly different from the previous measurement value is measured. 2. The method according to claim 1, wherein the received light amount change of the photoelectric sensor is corrected.
【請求項3】前記計測値の分布レンジが以前に比して拡
大した時には前記平均値及び分布を検出する計測回数を
増大し、前記分布レンジが以前に比して縮小された時に
は前記平均値及び分布を検出する測定回数を減少するこ
とを特徴とする請求項1或いは請求項2に記載の光電セ
ンサの受光量変化補正方法。
3. When the distribution range of the measurement value is expanded as compared with the previous time, the average value and the number of measurements for detecting the distribution are increased, and when the distribution range is reduced as compared with the previous time, the average value is reduced. 3. The method according to claim 1, wherein the number of measurements for detecting the distribution is reduced.
JP2142573A 1990-05-31 1990-05-31 Compensation method for change in received light amount of photoelectric sensor Expired - Fee Related JP2973218B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2142573A JP2973218B2 (en) 1990-05-31 1990-05-31 Compensation method for change in received light amount of photoelectric sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2142573A JP2973218B2 (en) 1990-05-31 1990-05-31 Compensation method for change in received light amount of photoelectric sensor

Publications (2)

Publication Number Publication Date
JPH0434386A JPH0434386A (en) 1992-02-05
JP2973218B2 true JP2973218B2 (en) 1999-11-08

Family

ID=15318468

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2142573A Expired - Fee Related JP2973218B2 (en) 1990-05-31 1990-05-31 Compensation method for change in received light amount of photoelectric sensor

Country Status (1)

Country Link
JP (1) JP2973218B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002100975A (en) * 2000-09-22 2002-04-05 Mitsubishi Electric Corp Closing safety device for elevator door
JP4636899B2 (en) * 2005-02-25 2011-02-23 株式会社キーエンス Photoelectric switch and photoelectric switch setting method
JP4756614B2 (en) * 2007-09-05 2011-08-24 株式会社山武 Signal detection device
JP5360153B2 (en) * 2011-07-29 2013-12-04 富士通セミコンダクター株式会社 Surge detection circuit for sensors

Also Published As

Publication number Publication date
JPH0434386A (en) 1992-02-05

Similar Documents

Publication Publication Date Title
US7049575B2 (en) System for sensing ambient light having ambient stability probability
US7777634B2 (en) Scattered light smoke detector
KR910004925B1 (en) Method and device detecting error in control system
US5691808A (en) Laser range finder receiver
KR100225369B1 (en) Apparatus and method for laser range of low cost
US5751209A (en) System for the early detection of fires
US6054927A (en) Apparatus and method for sensing an object within a monitored zone
TW201616152A (en) Open loop correction for optical proximity detectors
JP2973218B2 (en) Compensation method for change in received light amount of photoelectric sensor
US5179580A (en) X-ray analyzer with self-correcting feature
JP2625471B2 (en) Fire alarm device with dirt correction function
US20220299362A1 (en) Reducing dark current in an optical device
JP3135750B2 (en) Loom weft detection device
JPH0480566B2 (en)
JP3401800B2 (en) Photoelectric switch
US20240201345A1 (en) Proximity detection with auto calibration
JPH06194160A (en) Processing method and device for laser range finding sensor
JP3351901B2 (en) Photoelectric sensor
JP2814389B2 (en) Distance measuring device
JPH09178511A (en) Method, apparatus and system for adjusting sensitivity and physical quantity detection system
JP3187621B2 (en) Active triangulation
JPH06249959A (en) Distance measuring equipment
JP3248285B2 (en) Photoelectric switch
JPH0227215A (en) Photoelectric switch
JP2932863B2 (en) Output level setting circuit

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080903

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees