JP3548881B2 - Detection apparatus and threshold setting method thereof - Google Patents

Detection apparatus and threshold setting method thereof Download PDF

Info

Publication number
JP3548881B2
JP3548881B2 JP26553197A JP26553197A JP3548881B2 JP 3548881 B2 JP3548881 B2 JP 3548881B2 JP 26553197 A JP26553197 A JP 26553197A JP 26553197 A JP26553197 A JP 26553197A JP 3548881 B2 JP3548881 B2 JP 3548881B2
Authority
JP
Japan
Prior art keywords
detection
detection signal
threshold
value
cycle
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
JP26553197A
Other languages
Japanese (ja)
Other versions
JPH11112319A (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 JP26553197A priority Critical patent/JP3548881B2/en
Publication of JPH11112319A publication Critical patent/JPH11112319A/en
Application granted granted Critical
Publication of JP3548881B2 publication Critical patent/JP3548881B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は光電センサや近接センサ等の閾値設定に特徴を有する検知装置及びその閾値設定方法に関するものである。
【0002】
【従来の技術】
従来、光電センサを用いて搬送ライン等を通過する被検出体(以下、ワークともいう)を検出する場合には、光電センサ等に閾値を設定しておく必要がある。閾値を設定する際には、ワークを所定位置に配置した状態で受光レベルをサンプリングし、又ワークを取り除いて背景状態で受光量をサンプリングし、夫々の受光量に基づいて閾値を設定する方法(2点ティーチング)がある。又ワークを所定位置に配置した状態のみで閾値を設定する方法(1点ティーチング)も用いられている。
【0003】
又このように人手を介することなくティーチングする方法として、オートティーチングが用いられている。これはワークが搬送ライン等で順次搬送される場合に、図18に示すように光電センサに一定時間ティーチング信号を入力する。ティーチング信号が入力されている間には光電センサは一定周期毎にサンプリングを行い、この間の受光量の最大値と最小値とによって閾値を設定する方法である。
【0004】
【発明が解決しようとする課題】
しかしながらこのような従来のティーチング方法によれば、1点ティーチングや2点ティーチングを行う際には使用者は受光量をサンプリングできるようにするために搬送ラインを停止して所定の位置にワークを配置し、又ワークを配置せずに背景状態としてティーチングをする必要がある。又オートティーチングの場合には搬送ラインを停止する必要はないが、使用者が最適なティーチング信号の入力時間やタイミングを認識し、ティーチング入力を制御しなければならない。サンプリング中は光電センサから出力が得られないため、この間のワークは無駄となる。又ティーチング入力が一定時間必要であり、搬送ラインが高速な場合には多くのワークが無駄になってしまうという欠点があった。
【0005】
本発明はこのような従来の問題点に着目してなされたものであって、搬送ラインを通過する被検出体の閾値を設定する際に、搬送ラインを停止することなくティーチング開始を入力するだけで、自動的に閾値を設定できるようにすることを目的とする。
【0006】
【課題を解決するための手段】
本願の請求項1の発明は、外部の物理状態に応じた検知信号を出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合、及び検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合のいずれか一方を検知対象の通過の1サイクルと判別するデータ比較部と、前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0007】
本願の請求項2の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合、及び検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合のいずれか一方を検知対象の通過の1サイクルと判別し、少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とするものである。
【0008】
本願の請求項3の発明は、外部の物理状態に応じた検知信号を出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合を検知対象の通過の1サイクルと判別するデータ比較部と、前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0009】
本願の請求項4の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合を検知対象の通過の1サイクルと判別し、少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とするものである。
【0010】
本願の請求項5の発明は、外部の物理状態に応じた検知信号を出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合を検知対象の通過の1サイクルと判別するデータ比較部と、前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0011】
本願の請求項6の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合を検知対象の通過の1サイクルと判別し、少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とするものである。
【0012】
本願の請求項7の発明は、外部の物理状態に応じた検知信号を所定間隔毎に出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号毎に検知信号間の差分値を演算する差分値算出部と、前記差分値算出部より得られる差分値の絶対値が所定範囲以内のときに前記検知信号を保持すると共に、前記差分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別するサイクル判別部と、前記サイクル判別部によって少なくとも1サイクルの検知対象の通過が判別される間に保持された検知信号に基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0013】
本願の請求項8の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたとき以降に所定期間毎にサンプリングを行い、前記サンプリング毎に得られる検知信号間の差分値を演算し、前記差分値の絶対値が所定範囲以内のときに前記検知信号のデータを保持し、前記差分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別し、少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定することを特徴とするものである。
【0014】
本願の請求項9の発明は、外部の物理状態に応じた検知信号を出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号毎に検知信号の微分値を演算する微分値算出部と、前記微分値のレベルの絶対値が所定範囲以内のときに前記検知信号のデータを保持すると共に、前記微分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別するサイクル判別部と、前記サイクル判別部によって少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0015】
本願の請求項10の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたときに断続的にサンプリングを行い、前記サンプリング毎に得られる検知信号毎にその微分値を算出し、前記微分値の絶対値が所定範囲内のときに前記検知信号のデータを保持し、前記微分値の絶対値の変化の状態によって検出対象通過の1サイクルを判別し、少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定することを特徴とするものである。
【0016】
本願の請求項11の発明は、外部の物理状態に応じた検知信号を所定間隔毎に出力する検知部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号の最大値を判別する最大値判別部と、ティーチング開始信号が入力されたときに前記検知部より得られる検知信号の最小値を判別する最小値判別部と、前記検知部より得られる検知信号が連続して最大値及び最小値を更新しないかどうかを判別し、所定回数連続して更新しない場合に検知対象通過の1サイクルを判別するサイクル判別部と、少なくとも1サイクルの検知対象の通過の間に得られる最大値と最小値とに基づいて閾値を設定する閾値設定処理部と、前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とするものである。
【0017】
本願の請求項12の発明は、外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、ティーチング開始信号が入力されたときに所定期間毎にサンプリングを行い、前記サンプリング毎に得られる検知信号の最大値を判別し、前記サンプリング毎に得られる検知信号の最小値を判別し、前記検知部より得られる検知信号が連続して最大値及び最小値を更新しないかどうかを判別し、所定回数連続して更新しない場合に検知対象通過の1サイクルを判別し、少なくとも1サイクルの通過の際に得られる最大値と最小値に基づいて閾値を設定することを特徴とするものである。
【0018】
【発明の実施の形態】
図1は本発明の第1の実施の形態による光電センサの構成を示すブロック図である。本実施の形態による光電センサ1Aにおいて、投光部2は一定の周期で単一もしくは複数波長で発光する投光素子を駆動するものであり、受光部3は物体検知領域から反射された光を受光して電気信号に変換し、コントロール部4Aに出力する。コントロール部4Aは例えばマイクロコンピュータにより構成されており、以下に示す機能を有するものである。コントロール部4A内の計測部5は一定周期毎に投光パルスを発生させて投光部2を駆動し、受光部3からの受光レベルを判別し物体検知信号を出力するものである。又コントロール部4Aには計測部5に加えて、ワークの通過サイクルを認識する際に必要となる初期受光量を取得する初期値取得部6、初期値の受光量と取得した受光量とを後述するように比較し、ワーク通過の1サイクルを検出するデータ比較部7、比較結果に基づいて保持された受光レベルの最大値,最小値から閾値を設定する閾値設定処理部8、受光量をサンプリングするため投受光を行うサンプリング処理部9と、受光量のデータを保持するためのメモリ部10を含んで構成される。又外部入力部11は後述するように他の機器又はユーザから直接入力されたティーチング入力をコントロール部4Aに出力するものであり、外部出力部12はティーチング終了時のアンサーバック信号や計測部5からの物体検知信号を外部に出力するものである。
【0019】
図2(a),(b)はこの光電センサに接続される外部機器の構成を示す図である。本図に示すように光電センサにはプログラマブルコントローラ20又は手入力スイッチ手段等が択一的に接続される。図2(a)に示すようにプログラマブルコントローラ20が接続される際には、プログラマブルコントローラ本体21は、出力部22を介して光電センサ側の外部入力部11にティーチング開始となるトリガ信号を入力する。光電センサ1が正常にティーチングを完了した場合には、外部出力部12よりアンサーバック信号が出力される。光電センサ1の外部出力部12にはプログラマブルコントローラ20の入力部23が接続されており、この信号を受けてプログラマブルコントローラ20側では閾値が更新されたものと判別できる。又その後送信される物体検知信号によって物体の有無をプログラマブルコントローラ側で識別できる。プログラマブルコントローラ側ではティーチング信号を出力した後、アンサーバック信号を検出するまで光電センサからの計測情報は無効となり、アンサーバック信号を出力した後の計測出力が有効と判断している。
【0020】
又光電センサ1Aには、図2(b)に示すように手入力スイッチ24を外部入力部11に接続し、外部出力部12には確認用の表示器25を接続してもよい。このように接続して手入力スイッチ24よりティーチング開始のトリガ信号を入力すると、ティーチング終了後のアンサーバック信号が確認用の表示器25に入力され、ティーチングの終了が確認できる。
【0021】
次に本発明の第1の実施の形態による閾値の設定処理についてフローチャート及びタイムチャートを参照しつつ説明する。この実施の形態による光電センサ1Aは図3(a)に示すように、コンベア等の搬送ライン上を順次ほぼ一定の間隔でワーク26が搬送され、このワーク26を検出する用途に用いられるものとする。このようなワークを検出する際に光電センサ1Aに閾値を設定する場合には、前述したようにプログラマブルコントローラ20又は手入力スイッチ24よりティーチング開始のトリガ信号を光電センサ1Aに入力する。
【0022】
図4はティーチング信号が入力された後のティーチング処理を示すフローチャートであり、ティーチングが開始されると、まずステップS1においてサンプリング処理を行い、ステップS2においてそのときの受光量に対して一定幅の範囲を上下に設定して初期範囲とする。例えば図5(a)に示すように背景状態の時刻tにティーチング入力が与えられたとき、図5(b)に示すように背景からワーク検知の中間状態の時刻tにティーチング入力が与えられたとき、及び図5(c)に示すようにワークの検出状態の時刻tにティーチング入力が与えられたときには、夫々図示のハッチングで示す領域を初期範囲とする。そしてステップS3,S4において初期範囲を外れるまでサンプリング処理を繰り返し、初期範囲を外れるとステップS5,S6に進んで再び初期範囲に復帰し、その後初期範囲から外れたかどうかを判別する。例えば図5(a)に示す状態では、ワーク検出状態となれば初期範囲を外れ、再び背景状態となる。そして時刻tに次のワークが近接して受光レベルが上昇すると、この初期範囲を外れるためステップS7に進む。又図5(b)に示すように背景とワークの中間の状態からティーチングが開始したときも、一旦ワークの検出状態に達した後、再び受光レベルが低下する。従って時刻tに初期範囲に戻り再び初期範囲から外れるため、ステップS7に進む。更にワーク検出状態でティーチングを開始したときには図5(c)に示すように一旦背景を検出する状態となった後、再び次のワークを検出する状態となるため、そのワークからの信号が低下する時刻tに初期範囲を外れ、ステップS7に進む。ステップS7では初期範囲を外れたときに、その初期範囲を横切って受光レベルが変化したかどうかを判別する。初期範囲を横切って変化しなければ、図5(a)又は(c)に示すようにワーク又は背景でティーチング入力があったものと判断して、これまでで1サイクルと認識する(ステップS8)。一方ステップS7において、初期範囲を横切って初期範囲を外れた場合(時刻t)には、図5(b)に示すように背景とワークとの中間の受光レベルでティーチング入力があったものと判断する(ステップS9)。この場合には再びステップS10,S11に進んで初期範囲に復帰した後、初期範囲を外れたかどうかを判別する。図5(b)の場合には時刻tで再び初期範囲に復帰した後、初期範囲を外れるため、このときに1サイクル期間が経過したと判別する。
【0023】
そして1サイクルと判断されると、ステップS8又はS10よりステップS12に進んで、あらかじめ定めた設定サイクル数に達したかどうかを判別し、設定サイクルに達していなければステップS5,S6のループに戻って同様の処理を繰り返す。尚ステップS4,S6及びS11のサンプリング処理中には、そのとき得られる受光レベルの最大値と最小値を更新して保持していくものとする。そしてステップS12において設定サイクル数に達すれば、ステップS13に進んで閾値設定処理部8による閾値設定処理を行う。閾値設定処理では、例えばサンプリング処理中の最大値と最小値の中央値を閾値とする。こうして閾値設定処理を終了した後、ステップS14に進んでこのとき外部出力部12よりティーチング処理完了のアンサーバック信号をプログラマブルコントローラ20等に出力する。こうすれば正常にティーチング処理が終了したことがプログラマブルコントローラ側で認識できる。そして閾値を設定した後、計測処理ルーチンに進む。
【0024】
図4に示すフローチャートにおいて、ステップS1,S4,S6及びS11はサンプリング処理部9の機能を達成しており、ステップS1,S2は初期値取得部6の機能を達成しており、又ステップS3〜S10は初期範囲からの変化状態に基づいて検知対象通過の1サイクルを判別するデータ比較部の機能を達成しており、ステップS12,S13は少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部8の機能を達成している。
【0025】
図6は計測処理を示すフローチャートであり、計測処理を開始するとまずステップS21において外部入力を監視し、ティーチング入力があるかどうかを判別する。ティーチング入力があればステップS22よりステップS1に進んで前述したティーチング処理を行う。ティーチング入力が検知されるとステップS23において投光部2より光を物体検知領域に投光し、受光部3からの受光レベルを検出する。そしてステップS25において受光レベルを越えているかどうかによってワークの有無を判別する。そしてステップS26に進んで判別結果を外部出力部12より外部に出力するものである。こうすればプログラマブルコントローラ20側では外部出力部12より出力される信号を物体検知信号と認識することができる。
【0026】
次に本発明の第2の実施の形態による光電センサについて説明する。図7は第2の実施の形態による光電センサのブロック図であり、前述した第1の実施の形態と同一部分は同一符号を付して詳細な説明を省略する。この実施の形態による光電センサ1Bはコントロール部4Bの一部の構成が異なっている。即ちコントロール部4Bは連続する2回のサンプリングによる受光レベルの差を算出する差分値算出部31、及びその差分値のレベルに基づいてワーク通過の1サイクルを判別する受光サイクル判別部32を有している。閾値設定処理部8は受光状態の少なくとも1サイクル判別の間に保持された受光レベルによって閾値を設定するものである。
【0027】
次に第2の実施の形態によるティーチング処理についてフローチャート及びタイムチャートを参照しつつ説明する。この実施の形態ではティーチング処理を開始するとまずステップS31においてサンプリング処理を行い、ステップS32において最初の受光量をメモリ部10の前回サンプリング値の領域に保持する。そしてステップS33,34に進んで一定周期のサンプリング処理を行い、サンプリング処理によって得られた次の受光量を今回サンプリング値領域に格納する。次いでステップS35において、前回及び今回のサンプリング値から差分値(=今回サンプリング値−前回サンプリング値)を演算する。そしてステップS36に進んで今回サンプリング値を前回サンプリング値の領域に移動する。次いでステップS37に進んで差分値が所定の範囲±α内かどうかを判別する。図9は受光レベルと差分値及び状態判別結果を示すタイムチャートである。±αの範囲内であれば閾値の変化が少ないため、ワークは状態1、即ち今回及び前回はいずれもワークを検出している状態又は背景状態での受光と判別できる。従ってその受光量は閾値設定用データとして保持する。そしてステップS37において差分値がこの範囲内になければ状態2、即ちワークと背景との間の変化状態と判断し、閾値設定用データとして格納しない(ステップS39)。そしてステップS40において状態1から状態2への移行回数が設定値に達したかどうかを判別し、この値に達していなければステップS33に戻って同様の処理を繰り返す。この設定回数は2以上とする必要がある。状態1から2への移行が設定回数に達すると、ステップS41に進んで閾値設定用データを用いて閾値を設定する。例えば閾値設定用データの最大値と最小値の中間値に閾値を設定する。そしてステップS42に進んでコントローラ20側にアンサーバック信号を出力して、図6の計測処理に移る。このようにすればティーチングを容易に行うことができ、又ワークの通過中にも閾値設定処理が行える。
【0028】
ここでコントロール部4BはステップS31,S33においてサンプリング処理部9の機能を達成しており、ステップS32,S34,S36において検知信号間の差分値を演算する差分値算出部31の機能を達成している。又ステップS37〜39において差分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別する受光サイクル判別部32の機能を達成しており、ステップS40,S41は少なくとも1サイクルの検知対象の通過が判別される間に得られる検知信号の最大値と最小値に基づいて閾値を設定する閾値設定処理部8の機能を達成している。
【0029】
次に本発明の第3の実施の形態について図10のブロック図を用いて説明する。本実施の形態は外乱光の対策として、又相互干渉を防止するためにサンプリング周期をランダムにする光電センサに第2の実施の形態を適用できるようにしたものである。この実施の形態は前述した第2の実施の形態において差分値算出部31に代えて微分値を算出する微分値算出部41を設けた点のみが異なっており、その他の点については第2の実施の形態と同様である。この実施の形態では図8に示すフローチャートのステップS35において、サンプリング間隔をTとすると、前回及び今回のサンプリングの差分値に代えて、微分値を次式で算出する。
微分値=|前回サンプリング値|−|今回サンプリング値|÷T
このように微分値を求め、ステップS37では微分値によって状態1,2を判別し、図8と同様に閾値を設定する。
【0030】
こうすればサンプリング間隔が一定でない光電センサについても、前述した第2の実施の形態による差分値に代えて微分値を用いることによって、第2の実施の形態と同様にティーチング入力をトリガとして自動的に閾値設定を行うことができる。
【0031】
次に本発明の第4の実施の形態について説明する。図11は第4の実施の形態による光電センサ1Dの構成を示すブロック図であり、前述した第1の実施の形態と同一部分は同一符号を付して詳細な説明を省略する。この実施の形態ではコントロール部4Dは最大値算出部51,最小値算出部52、及び所定サイクル数が終了したかどうかを判別するサイクル判別部53を有している。その他の構成については前述した実施の形態と同様である。
【0032】
次にこの実施の形態の動作について図12,図13のフローチャートを用いて説明する。この実施の形態ではティーチング処理を開始すると、まずステップS51においてサンプリング処理を行い、ステップS52においてメモリのMINバッファ,MAXバッファに初回受光量を格納する。次いでステップS53においてサンプリング処理を行い、得られた受光量がMAXバッファの値を越えているかどうか、及びMINバッファの値未満かどうかを判別する(ステップS54,55)。MAX値を越えている場合にはステップS56に進んでMAXバッファを更新し、MAXカウンタフラグ及びMAXカウンタをクリアする(ステップS57)。又MINバッファの値未満であればステップS58に進んでMINバッファを更新し、ステップS59に進んでMINフラグ及びMINカウンタをクリアする。そしてステップS53に戻ってサンプリング処理を行い、同様の処理を繰り返す。
【0033】
受光量がMAX,MINバッファの間の値であれば、ステップS54,55からステップS60に進んで前回MAXバッファの値が更新されたかどうかをチェックする。更新されていればステップS61に進んでMAXカウンタフラグをセットしてステップ53のループに戻る。又ステップS60において前回MAX値が更新されていなければ、ステップS62に進んで前回MINバッファの値が更新されたかどうかをチェックする。MINバッファが更新されていればステップS63に進んでMINカウンタフラグをセットし、ステップS53に戻る。ステップS60,S62においてMAXバッファ,MINバッファが更新されていなければ、図13のステップS64に進んでMAXカウンタフラグがセットされているかどうかをチェックする。このカウンタフラグがセットされている場合には、ステップS65に進んでMAXカウンタをインクリメントし、このフラグがセットされていなければ、ステップS65の処理を行うことなくステップS66に進んでMINカウンタフラグがセットされているかどうかを判別する。このフラグがセットされていればステップS67に進んでMINカウンタをインクリメントし、フラグがセットされていなければこの処理を行うことなくステップS68に進んでMAXカウンタ,MINカウンタ共所定値に達したかどうかをチェックする。この所定値はサンプリングのタイミングとワークの移動速度とから複数回連続してワーク検知前後で受光レベルが連続的に変化し、その後変化がなくなるため、変化のなくなることが検出できる適切な数値を設定しておくものとする。
【0034】
こうすれば双方のカウンタ値が規定値に達した場合には、最大値及び最小値は物体の有無の双方の受光レベルを含んでおり、1つのワークが通過(1サイクル)したことがわかる。従ってステップS69に進んで所定のサイクル数に達したかどうかを判別する。所定のサイクル数に達していなければステップS53に戻って同様の処理を繰り返し、そして所定サイクル数に達するとステップS70において閾値設定処理を行う。閾値設定処理は既に得られているMAXバッファ,MINバッファに保持されている最大値,最小値に基づいて設定するものとし、例えばその中間値に閾値を設定する。そしてステップS71に進んでコントローラ側にアンサーバック信号を出力して図6の計測処理に進む。このようにすればティーチング入力をトリガとして自動的に閾値を設定することができる。
【0035】
ここでコントロール部4DはステップS51,S53においてサンプリング処理部9の機能を達成しており、ステップS54,S56において最大値を算出する最大値算出部51、ステップS55,S58において最小値を算出する最小値算出部52の機能を達成している。又ステップS57,S59及びステップS60〜68において検知信号が連続して最大値及び最小値を更新しないかどうかを判別し、所定回数連続して更新しない場合に検知対象通過の1サイクルを判別するサイクル判別部53の機能を達成している。又ステップS69,S70において少なくとも1サイクルの間に得られた最大値及び最小値に基づいて閾値を設定する閾値設定処理部8の機能を達成している。
【0036】
次に本発明の第5の実施の形態について説明する。この実施の形態では第4の実施の形態のように最大値及び最小値を一旦算出した後、最大値及び最小値から所定の範囲をMAX範囲,MIN範囲とし、その滞在時間によって出力状態を規定できるようにしたものである。図14は第5の実施の形態による光電センサ1Eのコントロール部4Eの構成を示すブロック図であり、前述した第4の実施の形態と同一部分は同一符号を付して詳細な説明を省略する。この実施の形態ではコントロール部4Eは第4の実施の形態の最大値算出部51,最小値算出部52,サイクル判別部53に加えて、MAX範囲,MIN範囲の受光量データを計測する受光量データ計測部54、MAX範囲,MIN範囲に滞在する滞在時間データ計測部55及び出力設定部56を有している。受光量データ計測部54はMAX範囲及びMIN範囲での受光量のデータの平均値を計測するものであり、滞在時間データ計測部55はMAX範囲,MIN範囲の時間を計測するものであり、出力設定部56はこのデータに基づいて出力レベルのいずれのときにどの出力を出すかを識別して設定するものである。
【0037】
次にこの実施の形態の動作について図15のフローチャート及び図16のタイムチャートを用いて説明する。前述したティーチング処理によって閾値を設定した後、ステップS81においてMAXバッファに保持された最大値,MINバッファに保持された最小値よりMAX範囲,MIN範囲を求める。MAX範囲,MIN範囲は図16に示すように最大値及び最小値を含む所定範囲であって、相互に重ならないように設定するものである。そしてステップS82に進んでサンプリング処理を行い、受光量を得る。そしてステップS83において受光量がMAX範囲,MIN範囲内かを判別する。MAX範囲内であればステップS85,S86においてMAX範囲の受光量データ及び滞在時間データを蓄積する。同様に受光量がMIN範囲内であれば、ステップS87,88においてMIN範囲の受光量データ及び滞在時間データを蓄積する。このとき滞在時間データは積算した値を保持し、受光量データは夫々MAX範囲及びMIN範囲の滞在時間内での平均値を保持しておくものとする。MAX範囲,MIN範囲でなければこれらの処理を行うことなくステップS89に進んで、MAX範囲からMIN範囲への変化が設定回数を達したかどうかを判別する。設定回数に達していなければステップS82に戻って同様の処理を繰り返す。こうすれば図16に示すように受光レベルがMAX範囲,MIN範囲にあるときにのみ、その受光量の平均値と滞在時間とを計測でき、図17(a),(b)に示すようなデータが保持されることになる。そして例えば5回のMAX範囲,MIN範囲でのデータが得られたときにデータを集計し、図17(a)に示す最大値側では、VMAX の最小値とTMAX の最小値とを最終決定データとする。同様に図17(b)に示す最小値側でも、受光量のVMIN の最大値,滞在時間としてVMIN の最小値を最終決定データと定める。
【0038】
次いでTMAX 最小値とTMIN 最小値のいずれの時間が短いかを判別する。例えばTMAX の時間が小さければ、図16(a)に示すように受光レベルが高いMAX側がワークの検出状態であると判断でき、受光レベルの低いMIN側が背景と判断できる。従って受光レベルが閾値より高くなれば物体検知信号をオンとするような出力とする。又図16(b)に示すようにMAX値に入っている時間が長ければ、受光量レベルの低い時間帯をワークの検出状態となるように出力を設定する。
【0039】
こうすればユーザが改めてダークオン,ライトオンのいずれかを選択する必要がなく、使用者が望む物体検知信号を出力することができ、完全なオートティーチングが可能となる。このとき得られたVMAX の最小値,VMIN 最大値とに基づいて前述した閾値を修正するようにしてもよく、又受光量を蓄積せず、単に滞在時間のみを計測して出力を設定するようにしてもよい。又第5の実施の形態は第4の実施の形態の処理の後、出力を設定するため、MAX範囲,MIN範囲での滞在時間によって出力を設定するようにしているが、第1〜第3のいずれの実施の形態においても所定のサイクル数のワーク通過時に得られた最大値及び最小値を算出し、その後に第5の実施の形態のように滞在時間を蓄積して出力設定処理を行うことができる。
【0040】
尚この実施の形態では、通常の物体の有無を判別するようにした光電センサについて説明しているが、通常の物体検知用のセンサに限らず本発明は図3(b)に示すようにライン上の物体に付されたマーク27をワークとして検出するようにしたマークセンサについても適用することができることはいうまでもない。又前述した各実施の形態では光電センサについて説明しているが、本発明は光電センサに限らず近接センサ,圧力センサ,超音波センサ等他の種々の形態の検知器に適用することができる。光電センサの場合には受光信号を検知信号としているが、近接センサでは発振状態の変化を示す信号、例えば発振振幅信号が検知信号となる。又マークセンサではマークからの反射光の受光信号、圧力センサではセンサに導入された圧力信号、超音波センサでは超音波受信信号が検知信号となる。又各実施の形態で最大値及び最小値に基づいて閾値を設定しているが、厳密に最大値でなく最大値付近の代表値を用いてもよく、又最大値から余裕レベル分を差し引いた値、最大値に1よりやや小さい定数を乗じた値を用いて最大値としてもよい。同様にして最小値も最小値付近の代表値や最小値に余裕レベル分を加えた値、又は最小値に1よりやや大きい定数を乗じた値を用いてもよい。更に閾値の設定は前述した各実施の形態では、最大値及び最小値の中央値としているが、中央値に限らずその間の値を適宜設定することができる。
【0041】
又閾値設定の際に検知信号があらかじめ予想した変化を示さないとき、例えば第1の実施の形態では所定時間内に初期範囲から変化しなかった場合や所定時間内に初期範囲に戻らなかった場合等に閾値設定エラーを報知するようにしてもよい。第2の実施の形態では差分値、第3の実施の形態では微分値の値が適切でなかった場合等、状態判別が正確に行えない場合に、第4,第5の実施の形態でMAX範囲,MIN範囲が適切でなく、正常な動作が行えなかった場合等に閾値設定エラーとしてエラー処理を行うようにしてもよい。
【0042】
【発明の効果】
以上詳細に説明したように本願の請求項1〜12の発明によれば、検知対象の通過サイクルを検知装置が自動的に認識しサンプリングする時間を決定することができる。そして複数サイクルに基づいて閾値を設定することができるため、搬送ラインを停止することなくティーチング開始の入力を与えるだけで最適な時間のサンプリングを行い、閾値が設定できる。従って無駄なワークの発生を極力少なくすることができる。又搬送ラインを停止させる必要がなく、搬送ラインの搬送速度が一定でない場合でも外部よりティーチング入力を与えるだけでその搬送状態に応じたサンプリングによって検知サイクルを設定し閾値を設定することができるという効果が得られる。又請求項9及び10の発明によれば、相互干渉を防止するため、サンプリング周期をランダムとした検出器についても本発明を適用することができ、自動的に閾値設定を行うことができるという効果が得られる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態による光電センサの構成を示すブロック図である。
【図2】本発明の第1の実施の形態の光電センサとこれに接続されるコントローラの構成を示すブロック図である。
【図3】本発明の第1の実施の形態による光電センサの使用状態を示す概略図である。
【図4】本発明の第1の実施の形態による閾値設定方法を示すフローチャートである。
【図5】本発明の第1の実施の形態による閾値設定処理における受光レベルの変化を示すグラフである。
【図6】本発明の第1の実施の形態による光電センサの計測処理を示すフローチャートである。
【図7】本発明の第2の実施の形態による光電センサのブロック図である。
【図8】本発明の第2の実施の形態による閾値設定方法を示すフローチャートである。
【図9】本発明の第2の実施の形態による光電センサの閾値設定処理における受光レベルの変化を示すグラフである。
【図10】本発明の第3の実施の形態による光電センサの構成を示すブロック図である。
【図11】本発明の第4の実施の形態による光電センサの構成を示すブロック図である。
【図12】本発明の第4の実施の形態による光電センサの閾値設定処理を示すフローチャート(その1)である。
【図13】本発明の第4の実施の形態による光電センサの閾値設定処理を示すフローチャート(その2)である。
【図14】本発明の第5の実施の形態による光電センサの構成を示すブロック図である。
【図15】本発明の第5の実施の形態による光電センサの動作を示すフローチャートである。
【図16】本発明の第5の実施の形態による光電センサの受光レベルと滞在時間の変化を示すタイムチャートである。
【図17】本発明の第5の実施の形態による光電センサのMAX範囲,MIN範囲での平均受光量と滞在時間を示す図である。
【図18】従来の光電センサに得られる受光レベルとティーチング入力を示す図である。
【符号の説明】
1A,1B,1C,1D,1E 光電センサ
2 投光部
3 受光部
4A,4B,4C,4D,4E コントロール部
5 計測部
6 初期値取得部
7 データ比較部
8 閾値設定処理部
9 サンプリング処理部
10 メモリ部
11 外部入力部
12 外部出力部
20 プログラマブルコントローラ
21 プログラマブルコントローラ本体
22 入力部
23 出力部
24 手入力スイッチ
25 表示器
31 差分値算出部
32 受光サイクル判別部
41 微分値算出部
51 最大値算出部
51 最小値算出部
53 サイクル判別部
54 滞在時間データ計測部
55 受光量データ計測部
56 出力設定部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a detection device having a feature in threshold setting of a photoelectric sensor, a proximity sensor, and the like, and a threshold setting method thereof.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, when an object to be detected (hereinafter, also referred to as a work) passing through a transport line or the like is detected using a photoelectric sensor, a threshold value needs to be set in the photoelectric sensor or the like. When setting the threshold value, a method of sampling the light reception level in a state where the work is arranged at a predetermined position, sampling the light reception amount in a background state after removing the work, and setting the threshold value based on each light reception amount ( Two-point teaching). Further, a method of setting a threshold value only in a state where a work is arranged at a predetermined position (one-point teaching) is also used.
[0003]
Auto-teaching is used as a teaching method without manual intervention. When a work is sequentially conveyed on a conveyance line or the like, a teaching signal is input to the photoelectric sensor for a certain period of time as shown in FIG. In this method, while the teaching signal is being input, the photoelectric sensor performs sampling at regular intervals, and sets a threshold value based on the maximum and minimum values of the amount of received light during this period.
[0004]
[Problems to be solved by the invention]
However, according to such a conventional teaching method, when performing one-point teaching or two-point teaching, the user stops the transport line and places the work at a predetermined position so that the amount of received light can be sampled. In addition, it is necessary to perform teaching as a background state without arranging a work. In the case of auto-teaching, it is not necessary to stop the transport line, but the user must recognize the optimal input time and timing of the teaching signal and control the teaching input. Since no output is obtained from the photoelectric sensor during sampling, the work during this time is wasted. Further, there is a drawback that a teaching input is required for a certain period of time, and a lot of work is wasted when the conveying line is high speed.
[0005]
The present invention has been made in view of such conventional problems, and when setting a threshold value of an object to be detected passing through a transport line, simply inputting a teaching start without stopping the transport line. Therefore, an object of the present invention is to enable a threshold to be automatically set.
[0006]
[Means for Solving the Problems]
According to the first aspect of the present invention, a detection unit that outputs a detection signal according to an external physical state and a predetermined range including a level of the detection signal obtained from the detection unit when a teaching start signal is input are initialized. The initial value acquisition unit as a range, and after the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and when the detection signal changes without crossing the initial range, and the detection signal changes from the initial range. Thereafter, a detection signal within the initial range is obtained again, and after changing across the initial range, one of the cases where the detection signal within the initial range is obtained three times is determined as one cycle of passage of the detection target. A data comparison unit, a threshold setting processing unit that sets a threshold based on a maximum value and a minimum value obtained when the detection target of at least one cycle detected by the data comparison unit passes, and the threshold setting processing unit It is characterized in that it has a, a measuring unit for discriminating the output obtained from the detection unit based on the set threshold value I.
[0007]
The invention according to claim 2 of the present application is a threshold setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal, A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as the initial range. After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and the initial range is obtained. If the detection signal changes within the initial range, and after the detection signal changes from the initial range, a detection signal within the initial range is obtained again.After changing across the initial range, a detection signal within the initial range is obtained three times. Is determined as one cycle of the passage of the detection target, and a threshold is determined based on the maximum value and the minimum value of the detection signal obtained during at least one cycle of the passage of the detection target. It is characterized in that setting.
[0008]
According to the invention of claim 3 of the present application, a detection unit that outputs a detection signal according to an external physical state and a predetermined range including a level of the detection signal obtained from the detection unit when a teaching start signal is input are initialized. With the initial value acquisition unit as the range, the detection signal within the initial range is obtained again after the detection signal changes from the initial range, and after the detection signal changes across the initial range, the detection signal within the initial range is obtained three times. A data comparing unit that determines that the detection target is one cycle of passage of the detection target, and a threshold that sets a threshold based on a maximum value and a minimum value obtained when the detection target passes at least one cycle detected by the data comparison unit. It has a setting processing part and a measuring part which discriminates the output obtained from the detection part based on the threshold value set by the threshold value setting processing part.
[0009]
The invention according to claim 4 of the present application is a threshold value setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold value and outputs a detection result signal, A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as the initial range. After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and the initial range is obtained. When the detection signal within the initial range is obtained three times after changing across, it is determined as one cycle of the passage of the detection target, and the maximum value of the detection signal obtained during at least one cycle of the passage of the detection target And setting the threshold value based on the minimum value.
[0010]
According to a fifth aspect of the present invention, a detection unit that outputs a detection signal according to an external physical state and a predetermined range including a level of the detection signal obtained from the detection unit when a teaching start signal is input are initialized. An initial value acquisition unit that sets a range, a detection signal within the initial range is obtained again after the detection signal changes from the initial range, and a case where the detection signal changes without crossing the initial range is determined as one cycle of passage of the detection target. A threshold value setting unit configured to set a threshold based on a maximum value and a minimum value obtained when the detection target of at least one cycle detected by the data comparison unit passes. And a measuring unit that discriminates an output obtained from the detecting unit based on the threshold value obtained.
[0011]
The invention according to claim 6 of the present application is a threshold setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal, A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as the initial range. After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and the initial range is obtained. Is determined as one cycle of passage of the detection target, and a threshold is set based on the maximum value and the minimum value of the detection signal obtained during the passage of the detection target of at least one cycle. It is a feature.
[0012]
The invention according to claim 7 of the present application is directed to a detection unit that outputs a detection signal according to an external physical state at predetermined intervals, and a detection signal for each detection signal obtained from the detection unit when a teaching start signal is input. A difference value calculation unit that calculates a difference value between the difference value calculation unit and the detection signal, when the absolute value of the difference value obtained from the difference value calculation unit is within a predetermined range, and a change in the absolute value of the difference value. A cycle discriminator for discriminating one cycle of passage of the detection target according to the state, and a threshold setting process for setting a threshold based on a detection signal held while the cycle discrimination unit determines that at least one cycle of the detection target has passed. And a measurement unit that discriminates the output obtained from the detection unit based on the threshold value set by the threshold value setting processing unit.
[0013]
The invention according to claim 8 of the present application is a threshold setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal, Sampling is performed at predetermined intervals after the input of the teaching start signal, and a difference value between the detection signals obtained at each sampling is calculated. When the absolute value of the difference value is within a predetermined range, the detection signal is calculated. Is determined, and one cycle of detection object passage is determined based on the state of change in the absolute value of the difference value, and a threshold value is set based on the detection signal held during at least one cycle of the detection object passage. It is characterized by the following.
[0014]
According to a ninth aspect of the present invention, a detection unit that outputs a detection signal according to an external physical state, and a differential value of the detection signal for each detection signal obtained from the detection unit when a teaching start signal is input. A differential value calculating section for calculating, and when the absolute value of the level of the differential value is within a predetermined range, the data of the detection signal is held, and one cycle of passing through the detection target according to a change state of the absolute value of the differential value. A threshold setting processing unit that sets a threshold based on the detection signal held during the passage of the detection target in at least one cycle by the cycle determining unit; and a threshold setting processing unit that sets the threshold. And a measuring unit that discriminates the output obtained from the detecting unit based on the threshold value.
[0015]
The invention according to claim 10 of the present application is a threshold setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal, Sampling is performed intermittently when a teaching start signal is input, a differential value is calculated for each detection signal obtained at each sampling, and when the absolute value of the differential value is within a predetermined range, the detection signal is calculated. Holding data, determining one cycle of detection object passage based on a state of change in the absolute value of the differential value, and setting a threshold based on a detection signal held during at least one cycle of detection object passage. It is characterized by the following.
[0016]
The invention according to claim 11 of the present application is directed to a detection unit that outputs a detection signal corresponding to an external physical state at predetermined intervals, and a maximum value of the detection signal obtained from the detection unit when a teaching start signal is input. A maximum value discriminator for discriminating, a minimum value discriminator for discriminating a minimum value of a detection signal obtained from the detection unit when a teaching start signal is input, and a detection signal obtained from the detection unit continuously and maximally. A cycle determining unit that determines whether the value and the minimum value are not updated, and determines one cycle of passing the detection target if the updating is not performed a predetermined number of times continuously; and a maximum value obtained during at least one cycle of passing the detection target. A threshold setting processing unit that sets a threshold based on the value and the minimum value, and a measurement unit that discriminates an output obtained from the detection unit based on the threshold set by the threshold setting processing unit. It is characterized in that it has.
[0017]
The invention according to claim 12 of the present application is a threshold setting method in a detection device that detects a detection target sequentially passing by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal, When the teaching start signal is input, sampling is performed every predetermined period, the maximum value of the detection signal obtained at each sampling is determined, the minimum value of the detection signal obtained at each sampling is determined, It is determined whether or not the obtained detection signal continuously updates the maximum value and the minimum value. If the detection signal is not continuously updated a predetermined number of times, one cycle of the detection target passage is determined. The threshold value is set based on the obtained maximum value and minimum value.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 is a block diagram showing the configuration of the photoelectric sensor according to the first embodiment of the present invention. In the photoelectric sensor 1A according to the present embodiment, the light projecting unit 2 drives a light projecting element that emits light at a single cycle or a plurality of wavelengths at a fixed period, and the light receiving unit 3 emits light reflected from the object detection area. The light is received, converted into an electric signal, and output to the control unit 4A. The control unit 4A is constituted by, for example, a microcomputer and has the following functions. The measuring unit 5 in the control unit 4A generates a light emitting pulse at regular intervals, drives the light emitting unit 2, determines the light receiving level from the light receiving unit 3, and outputs an object detection signal. The control unit 4A includes, in addition to the measuring unit 5, an initial value acquiring unit 6 for acquiring an initial light receiving amount necessary for recognizing a work passage cycle. The initial value receiving amount and the acquired light receiving amount are described later. A data comparing section 7 for detecting one cycle of the workpiece passing, a threshold setting processing section 8 for setting a threshold from the maximum and minimum values of the received light level held based on the comparison result, and sampling the amount of received light. And a memory unit 10 for holding data of the amount of received light. The external input unit 11 outputs a teaching input directly input from another device or a user to the control unit 4A as described later, and the external output unit 12 outputs an answerback signal at the end of the teaching or a measurement unit 5 from the measuring unit 5. Is output to the outside.
[0019]
FIGS. 2A and 2B are diagrams showing a configuration of an external device connected to the photoelectric sensor. As shown in the figure, a programmable controller 20 or a manual input switch means or the like is alternatively connected to the photoelectric sensor. When the programmable controller 20 is connected as shown in FIG. 2A, the programmable controller main body 21 inputs a trigger signal for starting teaching to the external input unit 11 on the photoelectric sensor side via the output unit 22. . When the photoelectric sensor 1 has normally completed the teaching, the external output unit 12 outputs an answerback signal. The input unit 23 of the programmable controller 20 is connected to the external output unit 12 of the photoelectric sensor 1, and upon receiving this signal, the programmable controller 20 can determine that the threshold has been updated. Further, the presence or absence of an object can be identified on the programmable controller side by the object detection signal transmitted thereafter. After outputting the teaching signal, the programmable controller determines that the measurement information from the photoelectric sensor is invalid until the answer back signal is detected, and determines that the measurement output after outputting the answer back signal is valid.
[0020]
As shown in FIG. 2B, a manual input switch 24 may be connected to the external input unit 11 and a display 25 for confirmation may be connected to the external output unit 12 of the photoelectric sensor 1A. When a trigger signal for starting the teaching is input from the manual input switch 24 by connecting in this way, an answer back signal after the teaching is completed is input to the display 25 for confirmation, and the completion of the teaching can be confirmed.
[0021]
Next, a threshold value setting process according to the first embodiment of the present invention will be described with reference to flowcharts and time charts. As shown in FIG. 3A, the photoelectric sensor 1A according to the present embodiment is used for detecting the work 26 by transferring the work 26 at substantially constant intervals on a transfer line such as a conveyor. I do. When a threshold value is set for the photoelectric sensor 1A when such a workpiece is detected, a trigger signal for starting teaching is input to the photoelectric sensor 1A from the programmable controller 20 or the manual input switch 24 as described above.
[0022]
FIG. 4 is a flowchart showing the teaching process after the teaching signal is input. When the teaching is started, first, the sampling process is performed in step S1, and in step S2, a range of a predetermined width with respect to the received light amount at that time. Is set up and down to be the initial range. For example, as shown in FIG. 1 When a teaching input is given to the camera, a time t in the intermediate state of workpiece detection from the background as shown in FIG. 2 When a teaching input is given to the workpiece and the time t when the workpiece is detected as shown in FIG. 3 When a teaching input is given to the user, the regions indicated by hatching in the drawings are set as initial ranges. Then, in steps S3 and S4, the sampling process is repeated until the value falls outside the initial range. When the value falls outside the initial range, the process proceeds to steps S5 and S6 to return to the initial range again. For example, in the state shown in FIG. 5A, when the work detection state occurs, the initial range is deviated, and the state returns to the background state. And time t 5 When the next work comes close to and the light receiving level rises, the process goes out of the initial range and the process proceeds to step S7. Also, as shown in FIG. 5B, when teaching is started from a state intermediate between the background and the work, the light receiving level is reduced again once the work is detected. Therefore, time t 4 Then, the process returns to the initial range, and again goes out of the initial range. Further, when teaching is started in the work detection state, as shown in FIG. 5C, once the background is detected, and then the next work is detected again, so that the signal from the work decreases. Time t 7 , And goes to step S7. In step S7, it is determined whether or not the light receiving level has changed across the initial range when it has deviated from the initial range. If it does not change across the initial range, it is determined that the teaching input has been made on the work or the background as shown in FIG. 5A or 5C, and one cycle has been recognized so far (step S8). . On the other hand, if it is determined in step S7 that the current value crosses the initial range and falls outside the initial range (time 4 5), it is determined that a teaching input has been made at an intermediate light receiving level between the background and the work as shown in FIG. 5B (step S9). In this case, the process again proceeds to steps S10 and S11 to return to the initial range, and then it is determined whether or not the initial range has been exceeded. In the case of FIG. 6 After returning to the initial range again, it is determined that one cycle period has elapsed since the initial range is deviated.
[0023]
If it is determined that the cycle is one cycle, the process proceeds to step S12 from step S8 or S10, and it is determined whether or not a predetermined number of cycles has been reached. If the number of cycles has not been reached, the process returns to the loop of steps S5 and S6. And repeat the same processing. During the sampling processing in steps S4, S6 and S11, the maximum and minimum values of the light reception level obtained at that time are updated and held. When the number of cycles reaches the set number in step S12, the process proceeds to step S13, and the threshold value setting processing unit 8 performs threshold value setting processing. In the threshold setting process, for example, the median of the maximum value and the minimum value during the sampling process is set as the threshold. After ending the threshold setting process in this way, the process proceeds to step S14, at which time the answerback signal indicating the completion of the teaching process is output from the external output unit 12 to the programmable controller 20 or the like. This allows the programmable controller to recognize that the teaching process has been completed normally. After setting the threshold, the process proceeds to the measurement processing routine.
[0024]
In the flowchart shown in FIG. 4, steps S1, S4, S6 and S11 achieve the function of the sampling processing unit 9, steps S1 and S2 achieve the function of the initial value acquisition unit 6, and steps S3 to S3. S10 achieves the function of a data comparison unit that determines one cycle of passage of the detection target based on the change state from the initial range. Steps S12 and S13 determine the maximum value obtained when the detection target passes at least one cycle and The function of the threshold value setting processing unit 8 for setting the threshold value based on the minimum value is achieved.
[0025]
FIG. 6 is a flowchart showing the measurement process. When the measurement process is started, first, in step S21, an external input is monitored to determine whether there is a teaching input. If there is a teaching input, the process proceeds from step S22 to step S1 to perform the above-described teaching process. When the teaching input is detected, light is emitted from the light projecting unit 2 to the object detection area in step S23, and the light receiving level from the light receiving unit 3 is detected. Then, in step S25, the presence or absence of a work is determined based on whether or not the light receiving level is exceeded. Then, the process proceeds to step S26 to output the determination result to the outside from the external output unit 12. This allows the programmable controller 20 to recognize the signal output from the external output unit 12 as an object detection signal.
[0026]
Next, a photoelectric sensor according to a second embodiment of the present invention will be described. FIG. 7 is a block diagram of a photoelectric sensor according to the second embodiment. The same parts as those in the above-described first embodiment are denoted by the same reference numerals, and detailed description is omitted. The photoelectric sensor 1B according to the present embodiment is different from the photoelectric sensor 1B in part of the configuration of the control unit 4B. That is, the control section 4B has a difference value calculating section 31 for calculating a difference between light receiving levels by two consecutive samplings, and a light receiving cycle determining section 32 for determining one cycle of work passage based on the level of the difference value. ing. The threshold setting unit 8 sets a threshold based on the light receiving level held during at least one cycle of the light receiving state.
[0027]
Next, a teaching process according to the second embodiment will be described with reference to a flowchart and a time chart. In this embodiment, when the teaching process is started, a sampling process is first performed in step S31, and the first received light amount is held in the area of the previous sampling value in the memory unit 10 in step S32. Then, the process proceeds to steps S33 and S34 to perform sampling processing at a fixed period, and stores the next received light amount obtained by the sampling processing in the current sampling value area. Next, in step S35, a difference value (= current sampling value−previous sampling value) is calculated from the previous and current sampling values. Then, the process proceeds to step S36 to move the current sampling value to the area of the previous sampling value. Next, the routine proceeds to step S37, where it is determined whether the difference value is within a predetermined range ± α. FIG. 9 is a time chart showing the light receiving level, the difference value, and the state determination result. Since the change in the threshold value is small within the range of ± α, the work can be determined to be in the state 1, that is, the state where the work is detected in the current time and the state in which the work is detected last time or the light reception in the background state. Therefore, the received light amount is held as threshold setting data. If the difference value does not fall within this range in step S37, it is determined as state 2, that is, a change state between the work and the background, and is not stored as threshold setting data (step S39). Then, in step S40, it is determined whether the number of transitions from state 1 to state 2 has reached the set value, and if not, the process returns to step S33 and repeats the same processing. This set number must be two or more. When the transition from the state 1 to the state 2 has reached the set number of times, the process proceeds to step S41, and the threshold is set using the threshold setting data. For example, a threshold is set to an intermediate value between the maximum value and the minimum value of the threshold setting data. Then, the process proceeds to step S42 to output an answer back signal to the controller 20 side, and proceeds to the measurement processing in FIG. In this way, teaching can be easily performed, and the threshold setting process can be performed even while the workpiece is passing.
[0028]
Here, the control unit 4B achieves the function of the sampling processing unit 9 in steps S31 and S33, and achieves the function of the difference value calculation unit 31 that calculates the difference value between the detection signals in steps S32, S34, and S36. I have. In steps S37 to S39, the function of the light receiving cycle determining unit 32 for determining one cycle of passing the detection target according to the state of the change in the absolute value of the difference value is achieved. The function of the threshold value setting processing unit 8 that sets a threshold value based on the maximum value and the minimum value of the detection signal obtained while the passage is determined is achieved.
[0029]
Next, a third embodiment of the present invention will be described with reference to the block diagram of FIG. In this embodiment, the second embodiment can be applied to a photoelectric sensor in which a sampling period is randomized in order to prevent disturbance light and to prevent mutual interference. This embodiment is different from the above-described second embodiment only in that a differential value calculation unit 41 for calculating a differential value is provided in place of the difference value calculation unit 31, and the other points are the same as those in the second embodiment. This is the same as the embodiment. In this embodiment, in step S35 of the flowchart shown in FIG. 8, when the sampling interval is T, a differential value is calculated by the following equation instead of the difference value between the previous and current sampling.
Differential value = | previous sampling value |-| current sampling value | ÷ T
In this way, the differential value is obtained, and in step S37, states 1 and 2 are determined based on the differential value, and a threshold value is set as in FIG.
[0030]
In this way, even for a photoelectric sensor whose sampling interval is not constant, the differential value is used in place of the differential value according to the above-described second embodiment, so that the teaching input can be used as a trigger similarly to the second embodiment. Can be set for the threshold.
[0031]
Next, a fourth embodiment of the present invention will be described. FIG. 11 is a block diagram showing a configuration of a photoelectric sensor 1D according to the fourth embodiment. The same parts as those in the above-described first embodiment are denoted by the same reference numerals, and detailed description is omitted. In this embodiment, the control unit 4D has a maximum value calculation unit 51, a minimum value calculation unit 52, and a cycle determination unit 53 that determines whether a predetermined number of cycles has been completed. Other configurations are the same as those of the above-described embodiment.
[0032]
Next, the operation of this embodiment will be described with reference to the flowcharts of FIGS. In this embodiment, when the teaching process is started, the sampling process is first performed in step S51, and the first received light amount is stored in the MIN buffer and the MAX buffer of the memory in step S52. Next, in step S53, a sampling process is performed, and it is determined whether the obtained amount of received light exceeds the value of the MAX buffer and whether it is less than the value of the MIN buffer (steps S54 and S55). If it exceeds the MAX value, the process proceeds to step S56 to update the MAX buffer and clear the MAX counter flag and the MAX counter (step S57). If the value is less than the value of the MIN buffer, the flow advances to step S58 to update the MIN buffer, and the flow advances to step S59 to clear the MIN flag and the MIN counter. Then, the process returns to step S53, performs the sampling process, and repeats the same process.
[0033]
If the amount of received light is a value between the MAX and MIN buffers, the process proceeds from steps S54 and S55 to step S60 to check whether the value of the MAX buffer was updated last time. If it has been updated, the flow advances to step S61 to set the MAX counter flag, and returns to the loop of step 53. If it is determined in step S60 that the MAX value has not been updated last time, the process proceeds to step S62 to check whether the value of the MIN buffer has been updated last time. If the MIN buffer has been updated, the flow advances to step S63 to set a MIN counter flag, and the flow returns to step S53. If the MAX buffer and the MIN buffer have not been updated in steps S60 and S62, the process proceeds to step S64 in FIG. 13 to check whether the MAX counter flag is set. If the counter flag is set, the process proceeds to step S65 to increment the MAX counter. If the flag is not set, the process proceeds to step S66 without performing the process of step S65 and the MIN counter flag is set. To determine if it has been done. If the flag has been set, the process proceeds to step S67 to increment the MIN counter. If the flag has not been set, the process proceeds to step S68 without performing this process, and whether the MAX counter and the MIN counter have reached the predetermined values. Check This predetermined value is set to an appropriate value that can detect that there is no change because the light receiving level continuously changes before and after the work detection and continuously stops after the work is detected multiple times based on the sampling timing and the moving speed of the work. Shall be kept.
[0034]
In this way, when both counter values reach the specified values, the maximum value and the minimum value include both the light receiving levels of the presence or absence of the object, and it can be seen that one work has passed (one cycle). Therefore, the process proceeds to step S69 to determine whether or not a predetermined number of cycles has been reached. If the predetermined number of cycles has not been reached, the process returns to step S53 to repeat the same processing. If the predetermined number of cycles has been reached, a threshold setting process is performed in step S70. The threshold value setting process is set based on the maximum value and the minimum value held in the MAX buffer and the MIN buffer that have already been obtained. For example, the threshold value is set to an intermediate value. Then, the process proceeds to step S71 to output an answer back signal to the controller side, and then proceeds to the measurement process of FIG. In this way, the threshold can be automatically set using the teaching input as a trigger.
[0035]
Here, the control unit 4D has achieved the function of the sampling processing unit 9 in steps S51 and S53, the maximum value calculation unit 51 calculating the maximum value in steps S54 and S56, and the minimum value calculating the minimum value in steps S55 and S58. The function of the value calculation unit 52 is achieved. In steps S57 and S59 and steps S60 to S68, it is determined whether or not the detection signal continuously updates the maximum value and the minimum value. If the detection signal is not continuously updated a predetermined number of times, one cycle of passing the detection target is determined. The function of the determination unit 53 is achieved. Further, the function of the threshold value setting processing unit 8 for setting a threshold value based on the maximum value and the minimum value obtained during at least one cycle in steps S69 and S70 is achieved.
[0036]
Next, a fifth embodiment of the present invention will be described. In this embodiment, as in the fourth embodiment, after the maximum value and the minimum value are once calculated, a predetermined range from the maximum value and the minimum value is defined as a MAX range and a MIN range, and the output state is defined by the stay time. It was made possible. FIG. 14 is a block diagram showing a configuration of a control unit 4E of a photoelectric sensor 1E according to the fifth embodiment. The same parts as those in the above-described fourth embodiment are denoted by the same reference numerals, and detailed description is omitted. . In this embodiment, the control unit 4E includes a maximum value calculation unit 51, a minimum value calculation unit 52, and a cycle determination unit 53 of the fourth embodiment, and a light reception amount for measuring light reception amount data in a MAX range and a MIN range. A data measurement unit 54, a stay time data measurement unit 55 staying in the MAX range and the MIN range, and an output setting unit 56 are provided. The received light amount data measuring unit 54 measures the average value of the received light amount data in the MAX range and the MIN range. The stay time data measuring unit 55 measures the time in the MAX range and the MIN range. The setting unit 56 identifies and sets which output is to be output at which output level based on the data.
[0037]
Next, the operation of this embodiment will be described with reference to the flowchart of FIG. 15 and the time chart of FIG. After setting the threshold value by the above-described teaching process, in step S81, the MAX range and the MIN range are obtained from the maximum value stored in the MAX buffer and the minimum value stored in the MIN buffer. The MAX range and the MIN range are predetermined ranges including the maximum value and the minimum value as shown in FIG. 16, and are set so as not to overlap each other. Then, the process proceeds to step S82 to perform a sampling process to obtain the amount of received light. Then, in a step S83, it is determined whether or not the light receiving amount is within the MAX range and the MIN range. If it is within the MAX range, the received light amount data and stay time data of the MAX range are accumulated in steps S85 and S86. Similarly, if the received light amount is within the MIN range, the received light amount data and stay time data of the MIN range are accumulated in steps S87 and S88. At this time, the stay time data holds an integrated value, and the received light amount data holds an average value within the stay time in the MAX range and the MIN range, respectively. If it is not the MAX range or the MIN range, the process proceeds to step S89 without performing these processes, and it is determined whether the change from the MAX range to the MIN range has reached the set number of times. If the set number has not been reached, the process returns to step S82 to repeat the same processing. In this way, only when the light receiving level is in the MAX range and the MIN range as shown in FIG. 16, the average value of the received light amount and the stay time can be measured, as shown in FIGS. 17 (a) and (b). The data will be retained. For example, when data in the MAX range and the MIN range is obtained five times, the data is totaled. On the maximum value side shown in FIG. MAX And T MAX And the minimum value of are used as final decision data. Similarly, on the minimum value side shown in FIG. MIN Maximum value of stay, V as stay time MIN Is defined as the final decision data.
[0038]
Then T MAX Minimum and T MIN It is determined which of the minimum values is shorter. For example, T MAX If the time is small, it can be determined that the MAX side with the higher light receiving level is in the work detection state, and the MIN side with the lower light receiving level is the background, as shown in FIG. Therefore, the output is such that the object detection signal is turned on when the light receiving level becomes higher than the threshold value. If the time during which the value is within the MAX value is long as shown in FIG. 16B, the output is set so that the workpiece is detected in the time zone where the light reception level is low.
[0039]
This eliminates the need for the user to select either dark-on or light-on again, can output an object detection signal desired by the user, and enables complete auto-teaching. V obtained at this time MAX , V MIN The above-described threshold value may be corrected based on the maximum value, or the output may be set by merely measuring the stay time without accumulating the received light amount. In the fifth embodiment, the output is set based on the stay time in the MAX range and the MIN range in order to set the output after the processing of the fourth embodiment. In any of the embodiments, the maximum value and the minimum value obtained when a predetermined number of cycles of workpieces are passed are calculated, and thereafter, the stay time is accumulated and the output setting process is performed as in the fifth embodiment. be able to.
[0040]
In this embodiment, a photoelectric sensor for determining the presence or absence of a normal object is described. However, the present invention is not limited to a sensor for detecting a normal object, and the present invention is not limited to a line sensor as shown in FIG. It goes without saying that the present invention can be applied to a mark sensor that detects the mark 27 attached to the upper object as a workpiece. In each of the embodiments described above, the photoelectric sensor is described. However, the present invention is not limited to the photoelectric sensor, and can be applied to various other types of detectors such as a proximity sensor, a pressure sensor, and an ultrasonic sensor. In the case of a photoelectric sensor, a light receiving signal is used as a detection signal. However, in a proximity sensor, a signal indicating a change in an oscillation state, for example, an oscillation amplitude signal is used as a detection signal. In the mark sensor, the detection signal is a light reception signal of reflected light from the mark, in the pressure sensor, a pressure signal introduced into the sensor, and in the ultrasonic sensor, an ultrasonic reception signal is a detection signal. In each embodiment, the threshold value is set based on the maximum value and the minimum value. However, a representative value near the maximum value may be used instead of the strict maximum value, or a margin level is subtracted from the maximum value. The maximum value may be determined using a value obtained by multiplying the maximum value by a constant slightly smaller than 1. Similarly, the minimum value may be a representative value near the minimum value, a value obtained by adding a margin level to the minimum value, or a value obtained by multiplying the minimum value by a constant slightly larger than 1. Further, in each of the above-described embodiments, the threshold value is set to the median of the maximum value and the minimum value. However, the threshold value is not limited to the median value, and a value between them can be set as appropriate.
[0041]
In addition, when the detection signal does not show a change expected in advance when setting the threshold value, for example, in the first embodiment, when there is no change from the initial range within a predetermined time, or when it does not return to the initial range within a predetermined time. For example, a threshold setting error may be notified. If the state determination cannot be performed accurately, such as when the difference value is not appropriate in the second embodiment and the differential value is not appropriate in the third embodiment, MAX is used in the fourth and fifth embodiments. If the range and the MIN range are not appropriate and a normal operation cannot be performed, an error process may be performed as a threshold setting error.
[0042]
【The invention's effect】
As described above in detail, according to the first to twelfth aspects of the present invention, it is possible for the detecting device to automatically recognize the passage cycle of the detection target and determine the sampling time. Since the threshold can be set based on a plurality of cycles, sampling can be performed for an optimal time by simply inputting the teaching start without stopping the transport line, and the threshold can be set. Therefore, generation of useless work can be reduced as much as possible. Also, there is no need to stop the transport line, and even when the transport speed of the transport line is not constant, it is possible to set a detection cycle and set a threshold value by sampling according to the transport state only by giving a teaching input from the outside. Is obtained. According to the ninth and tenth aspects of the present invention, in order to prevent mutual interference, the present invention can be applied to a detector having a random sampling period, and the threshold value can be automatically set. Is obtained.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a photoelectric sensor according to a first embodiment of the present invention.
FIG. 2 is a block diagram illustrating a configuration of a photoelectric sensor according to the first embodiment of the present invention and a controller connected to the photoelectric sensor.
FIG. 3 is a schematic diagram showing a use state of the photoelectric sensor according to the first embodiment of the present invention.
FIG. 4 is a flowchart illustrating a threshold setting method according to the first embodiment of the present invention.
FIG. 5 is a graph showing a change in a light receiving level in a threshold setting process according to the first embodiment of the present invention.
FIG. 6 is a flowchart illustrating a measurement process of the photoelectric sensor according to the first embodiment of the present invention.
FIG. 7 is a block diagram of a photoelectric sensor according to a second embodiment of the present invention.
FIG. 8 is a flowchart illustrating a threshold setting method according to a second embodiment of the present invention.
FIG. 9 is a graph showing a change in light receiving level in a threshold value setting process of the photoelectric sensor according to the second embodiment of the present invention.
FIG. 10 is a block diagram illustrating a configuration of a photoelectric sensor according to a third embodiment of the present invention.
FIG. 11 is a block diagram showing a configuration of a photoelectric sensor according to a fourth embodiment of the present invention.
FIG. 12 is a flowchart (part 1) illustrating a threshold setting process of the photoelectric sensor according to the fourth embodiment of the present invention.
FIG. 13 is a flowchart (part 2) illustrating a threshold setting process of the photoelectric sensor according to the fourth embodiment of the present invention.
FIG. 14 is a block diagram showing a configuration of a photoelectric sensor according to a fifth embodiment of the present invention.
FIG. 15 is a flowchart showing an operation of the photoelectric sensor according to the fifth embodiment of the present invention.
FIG. 16 is a time chart showing changes in a light receiving level and a stay time of a photoelectric sensor according to a fifth embodiment of the present invention.
FIG. 17 is a diagram illustrating an average light reception amount and a stay time in a MAX range and a MIN range of the photoelectric sensor according to the fifth embodiment of the present invention.
FIG. 18 is a diagram showing a light receiving level and teaching input obtained by a conventional photoelectric sensor.
[Explanation of symbols]
1A, 1B, 1C, 1D, 1E photoelectric sensor
2 Floodlight
3 Receiver
4A, 4B, 4C, 4D, 4E control unit
5 Measurement section
6 Initial value acquisition section
7 Data comparison section
8 Threshold setting processing section
9 Sampling processing unit
10 Memory section
11 External input section
12 External output section
20 Programmable Controller
21 Programmable controller body
22 Input section
23 Output section
24 Manual input switch
25 Display
31 Difference value calculation unit
32 Light receiving cycle discriminator
41 Differential value calculator
51 Maximum value calculation unit
51 Minimum value calculation unit
53 Cycle discriminator
54 Stay time data measurement unit
55 Received light data measurement unit
56 Output setting section

Claims (12)

外部の物理状態に応じた検知信号を出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、
検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合、及び検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合のいずれか一方を検知対象の通過の1サイクルと判別するデータ比較部と、
前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state,
An initial value acquisition unit that sets a predetermined range including a level of the detection signal obtained from the detection unit when the teaching start signal is input as an initial range,
After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and when the detection signal changes without crossing the initial range, and after the detection signal changes from the initial range, the detection signal again within the initial range. Is obtained, and after changing across the initial range, a data comparing unit that determines one of the cases where a detection signal within the initial range is obtained three times as one cycle of passage of the detection target,
A threshold setting processing unit that sets a threshold based on a maximum value and a minimum value obtained when the detection target of at least one cycle detected by the data comparison unit passes,
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、
検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合、及び検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合のいずれか一方を検知対象の通過の1サイクルと判別し、
少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as an initial range,
After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and when the detection signal changes without crossing the initial range, and after the detection signal changes from the initial range, the detection signal again within the initial range. Is obtained, and after changing across the initial range, one of the cases where a detection signal within the initial range is obtained three times is determined as one cycle of passage of the detection target,
A threshold setting method, comprising: setting a threshold based on a maximum value and a minimum value of the detection signal obtained during at least one cycle of passing the detection target.
外部の物理状態に応じた検知信号を出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、
検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合を検知対象の通過の1サイクルと判別するデータ比較部と、
前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state,
An initial value acquisition unit that sets a predetermined range including a level of the detection signal obtained from the detection unit when the teaching start signal is input as an initial range,
After the detection signal changes from the initial range, a detection signal within the initial range is obtained again. After the detection signal changes across the initial range, the detection signal within the initial range is obtained three times. A data comparison unit for determining a cycle,
A threshold setting processing unit that sets a threshold based on a maximum value and a minimum value obtained when the detection target of at least one cycle detected by the data comparison unit passes,
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、
検知信号が初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切って変化した後、三たび初期範囲内の検知信号が得られた場合を検知対象の通過の1サイクルと判別し、
少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as an initial range,
After the detection signal changes from the initial range, a detection signal within the initial range is obtained again. After the detection signal changes across the initial range, the detection signal within the initial range is obtained three times. Judge as a cycle,
A threshold setting method, comprising: setting a threshold based on a maximum value and a minimum value of the detection signal obtained during at least one cycle of passing the detection target.
外部の物理状態に応じた検知信号を出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号のレベルを含む所定範囲を初期範囲とする初期値取得部と、
検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合を検知対象の通過の1サイクルと判別するデータ比較部と、
前記データ比較部で検出された少なくとも1サイクルの検知対象の通過時に得られる最大値及び最小値に基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state,
An initial value acquisition unit that sets a predetermined range including a level of the detection signal obtained from the detection unit when the teaching start signal is input as an initial range,
After the detection signal has changed from the initial range, a detection signal within the initial range is obtained again, and a data comparing unit that determines that a change without crossing the initial range is one cycle of passage of the detection target,
A threshold setting processing unit that sets a threshold based on a maximum value and a minimum value obtained when the detection target of at least one cycle detected by the data comparison unit passes,
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたときに得られる検知信号のレベルを含む所定範囲を初期範囲として設定し、
検知信号が前記初期範囲から変化した後、再び初期範囲内の検知信号が得られ、初期範囲を横切らずに変化した場合を検知対象の通過の1サイクルと判別し、少なくとも1サイクルの検知対象の通過の間に得られる前記検知信号の最大値及び最小値に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
A predetermined range including the level of the detection signal obtained when the teaching start signal is input is set as an initial range,
After the detection signal changes from the initial range, a detection signal within the initial range is obtained again, and a case where the detection signal changes without crossing the initial range is determined as one cycle of passage of the detection target, and at least one cycle of the detection target is detected. A threshold setting method, wherein a threshold is set based on a maximum value and a minimum value of the detection signal obtained during the passage.
外部の物理状態に応じた検知信号を所定間隔毎に出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号毎に検知信号間の差分値を演算する差分値算出部と、
前記差分値算出部より得られる差分値の絶対値が所定範囲以内のときに前記検知信号を保持すると共に、前記差分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別するサイクル判別部と、
前記サイクル判別部によって少なくとも1サイクルの検知対象の通過が判別される間に保持された検知信号に基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state at predetermined intervals,
A difference value calculation unit that calculates a difference value between detection signals for each detection signal obtained from the detection unit when a teaching start signal is input,
Cycle discrimination for holding the detection signal when the absolute value of the difference value obtained from the difference value calculation unit is within a predetermined range, and for discriminating one cycle of passing the detection target based on a change state of the absolute value of the difference value. Department and
A threshold setting processing unit that sets a threshold based on the detection signal held while the passage of the detection target in at least one cycle is determined by the cycle determination unit;
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたとき以降に所定期間毎にサンプリングを行い、
前記サンプリング毎に得られる検知信号間の差分値を演算し、
前記差分値の絶対値が所定範囲以内のときに前記検知信号のデータを保持し、前記差分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別し、
少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
Sampling is performed every predetermined period after the teaching start signal is input, and
Calculate the difference value between the detection signals obtained for each sampling,
Holding the data of the detection signal when the absolute value of the difference value is within a predetermined range, determining one cycle of passing the detection target by the state of change of the absolute value of the difference value,
A threshold setting method, wherein the threshold is set based on a detection signal held during at least one cycle of passage of a detection target.
外部の物理状態に応じた検知信号を出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号毎に検知信号の微分値を演算する微分値算出部と、
前記微分値のレベルの絶対値が所定範囲以内のときに前記検知信号のデータを保持すると共に、前記微分値の絶対値の変化の状態によって検知対象通過の1サイクルを判別するサイクル判別部と、
前記サイクル判別部によって少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state,
A differential value calculation unit that calculates a differential value of a detection signal for each detection signal obtained from the detection unit when a teaching start signal is input,
A cycle determination unit that holds the data of the detection signal when the absolute value of the level of the differential value is within a predetermined range, and determines one cycle of passage of the detection target based on a state of a change in the absolute value of the differential value;
A threshold setting processing unit that sets a threshold based on the detection signal held during the passage of the detection target in at least one cycle by the cycle determination unit;
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたときに断続的にサンプリングを行い、
前記サンプリング毎に得られる検知信号毎にその微分値を算出し、
前記微分値の絶対値が所定範囲内のときに前記検知信号のデータを保持し、
前記微分値の絶対値の変化の状態によって検出対象通過の1サイクルを判別し、
少なくとも1サイクルの検知対象の通過の間に保持された検知信号に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
When the teaching start signal is input, sampling is performed intermittently.
Calculate the differential value of each detection signal obtained for each sampling,
Holding the data of the detection signal when the absolute value of the differential value is within a predetermined range,
One cycle of the detection object passage is determined based on the state of the change in the absolute value of the differential value,
A threshold setting method, wherein the threshold is set based on a detection signal held during at least one cycle of passage of a detection target.
外部の物理状態に応じた検知信号を所定間隔毎に出力する検知部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号の最大値を判別する最大値判別部と、
ティーチング開始信号が入力されたときに前記検知部より得られる検知信号の最小値を判別する最小値判別部と、
前記検知部より得られる検知信号が連続して最大値及び最小値を更新しないかどうかを判別し、所定回数連続して更新しない場合に検知対象通過の1サイクルを判別するサイクル判別部と、
少なくとも1サイクルの検知対象の通過の間に得られる最大値と最小値とに基づいて閾値を設定する閾値設定処理部と、
前記閾値設定処理部によって設定された閾値に基づいて前記検知部より得られる出力を弁別する計測部と、を有することを特徴とする検知装置。
A detection unit that outputs a detection signal according to an external physical state at predetermined intervals,
A maximum value determination unit that determines a maximum value of a detection signal obtained from the detection unit when a teaching start signal is input;
A minimum value determination unit that determines a minimum value of a detection signal obtained from the detection unit when a teaching start signal is input;
A cycle determination unit that determines whether the detection signal obtained from the detection unit continuously updates the maximum value and the minimum value, and determines one cycle of the detection target passage when the update is not continuously performed a predetermined number of times;
A threshold setting processing unit that sets a threshold based on a maximum value and a minimum value obtained during the passage of the detection target in at least one cycle;
A detector configured to distinguish an output obtained from the detector based on a threshold set by the threshold setting processor.
外部の物理状態に応じた検知信号を閾値と比較することによって順次通過する検知対象を検出し、検知結果信号を出力する検知装置における閾値設定方法であって、
ティーチング開始信号が入力されたときに所定期間毎にサンプリングを行い、
前記サンプリング毎に得られる検知信号の最大値を判別し、
前記サンプリング毎に得られる検知信号の最小値を判別し、
前記検知部より得られる検知信号が連続して最大値及び最小値を更新しないかどうかを判別し、
所定回数連続して更新しない場合に検知対象通過の1サイクルを判別し、
少なくとも1サイクルの通過の際に得られる最大値と最小値に基づいて閾値を設定することを特徴とする閾値設定方法。
A threshold setting method in a detection device that sequentially detects a detection target that sequentially passes by comparing a detection signal according to an external physical state with a threshold, and outputs a detection result signal,
When the teaching start signal is input, sampling is performed every predetermined period,
Determine the maximum value of the detection signal obtained for each sampling,
Determine the minimum value of the detection signal obtained for each sampling,
Determine whether the detection signal obtained from the detection unit does not continuously update the maximum value and the minimum value,
When the update is not performed continuously for a predetermined number of times, one cycle of the detection target passage is determined,
A threshold setting method characterized in that a threshold is set based on a maximum value and a minimum value obtained during at least one cycle of passage.
JP26553197A 1997-09-30 1997-09-30 Detection apparatus and threshold setting method thereof Expired - Fee Related JP3548881B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26553197A JP3548881B2 (en) 1997-09-30 1997-09-30 Detection apparatus and threshold setting method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26553197A JP3548881B2 (en) 1997-09-30 1997-09-30 Detection apparatus and threshold setting method thereof

Publications (2)

Publication Number Publication Date
JPH11112319A JPH11112319A (en) 1999-04-23
JP3548881B2 true JP3548881B2 (en) 2004-07-28

Family

ID=17418431

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26553197A Expired - Fee Related JP3548881B2 (en) 1997-09-30 1997-09-30 Detection apparatus and threshold setting method thereof

Country Status (1)

Country Link
JP (1) JP3548881B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002357669A (en) * 2001-05-31 2002-12-13 Sunx Ltd Photoelectric sensor
JP5046266B2 (en) * 2006-05-31 2012-10-10 パナソニック デバイスSunx株式会社 Detection device
JP5104150B2 (en) * 2007-09-14 2012-12-19 オムロン株式会社 Detection apparatus and method, and program
JP6316233B2 (en) * 2015-03-26 2018-04-25 アズビル株式会社 Switching method of adjustment mode in photoelectric sensor
CN114803391B (en) * 2022-05-12 2023-11-03 北京华能新锐控制技术有限公司 Unmanned automatic material taking method for bucket wheel machine of intelligent fuel system

Also Published As

Publication number Publication date
JPH11112319A (en) 1999-04-23

Similar Documents

Publication Publication Date Title
EP2363736B1 (en) Photoelectric sensor and method for aiding checking of threshold
JP3548763B2 (en) Detecting device and its output setting method
SE9502172D0 (en) Method and apparatus for belt conveyor load tracking
US20110215221A1 (en) Photoelectric sensor and method for aiding operational checking of photoelectric sensor
US6832989B2 (en) Infrared clinical thermometer
JP3548881B2 (en) Detection apparatus and threshold setting method thereof
US6057769A (en) Intelligent alarm system with snow sensor
JP4541553B2 (en) Method and apparatus for processing a received signal carrying encoded data
JP3684573B2 (en) Photoelectric sensor
JP4175240B2 (en) Detection device
JPH09284117A (en) Detection switch
JP6990356B2 (en) Sensor device and detection method
JP7100826B2 (en) Detection device
JPH10153656A (en) Compound human body detection device
JP2516092Y2 (en) Photoelectric switch
KR20200068820A (en) People counter for improving accuracy
JPH10282245A (en) Mobile body detecting system using ultrasonic wave and device therefor
JPH0729076A (en) Human body detector
JP3944020B2 (en) Photoelectric sensor
JPS62276694A (en) Fire alarm
JPH09284116A (en) Detection switch
JPH08292260A (en) Photoelectric sensor having self-diagnostic function
JPH10154449A (en) Photoelectric sensor
JP3142731B2 (en) Distance measuring device
JPH08339746A (en) Photoelectric sensor

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040323

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040405

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090430

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100430

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110430

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130430

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130430

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140430

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees