JP5152397B1 - PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR - Google Patents

PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR Download PDF

Info

Publication number
JP5152397B1
JP5152397B1 JP2011262536A JP2011262536A JP5152397B1 JP 5152397 B1 JP5152397 B1 JP 5152397B1 JP 2011262536 A JP2011262536 A JP 2011262536A JP 2011262536 A JP2011262536 A JP 2011262536A JP 5152397 B1 JP5152397 B1 JP 5152397B1
Authority
JP
Japan
Prior art keywords
light
received light
representative
amount
received
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.)
Active
Application number
JP2011262536A
Other languages
Japanese (ja)
Other versions
JP2013113795A (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 JP2011262536A priority Critical patent/JP5152397B1/en
Priority to PCT/JP2012/056105 priority patent/WO2013080577A1/en
Application granted granted Critical
Publication of JP5152397B1 publication Critical patent/JP5152397B1/en
Publication of JP2013113795A publication Critical patent/JP2013113795A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/941Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated using an optical detector
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K2217/00Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
    • H03K2217/94Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated
    • H03K2217/9401Calibration techniques
    • H03K2217/94021Calibration techniques with human activation, e.g. processes requiring or being triggered by human intervention, user-input of digital word or analog voltage
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K2217/00Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
    • H03K2217/94Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated
    • H03K2217/941Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated using an optical detector
    • H03K2217/94116Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated using an optical detector increasing reliability, fail-safe

Landscapes

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

Abstract

【課題】検出に適したしきい値を判別するのに適した情報を表示する。
【解決手段】投光部103および受光部104と、受光処理により得られた受光量をあらかじめ設定されたしきい値と比較することにより入光状態および非入光状態のいずれであるかを判別して、その判別結果を出力する検出部として機能する制御部105と、受光量を表示することが可能な表示部100とを具備する光電センサにおいて、現在設定されているしきい値により判別される複数の入光期間および複数の受光期間を対象に、各入光期間の中で受光量が相対的に最も低くなった期間における受光量と、各受光期間の中で受光量が相対的に最も高くなった期間における受光量とをそれぞれ特定し、特定された2つの代表受光量を、表示部100に表示する。
【選択図】図4
Information suitable for determining a threshold value suitable for detection is displayed.
The light projecting unit 103 and the light receiving unit 104 determine whether the light incident state or the non-light incident state by comparing the amount of received light obtained by the light receiving process with a preset threshold value. In the photoelectric sensor including the control unit 105 that functions as a detection unit that outputs the determination result and the display unit 100 that can display the received light amount, the photoelectric sensor is determined based on the currently set threshold value. For a plurality of light receiving periods and a plurality of light receiving periods, a light receiving amount in a period in which the light receiving amount is relatively lowest in each light receiving period and a light receiving amount in each light receiving period are relatively The received light amount in the highest period is specified, and the two specified representative received light amounts are displayed on the display unit 100.
[Selection] Figure 4

Description

本発明は、検出のための光を投光すると共に、その投光された光または投光された光に対する反射光を受光し、受光量を所定のしきい値と比較することにより物体を検出する光電センサに関する。   The present invention projects light for detection, receives the projected light or reflected light for the projected light, and detects an object by comparing the amount of received light with a predetermined threshold value. The present invention relates to a photoelectric sensor.

移動する物体を検出する光電センサの受光量には、設定されたしきい値を超えて山状に変化する部分と、しきい値より下がって谷状に変化する部分とが交互に生じる(以下、各変動部分を「山」「谷」という。)。透過型のセンサでは、山から谷への変化が生じたことをもって「物体あり」を示す検出信号を出力する。反対に反射型のセンサでは、谷から山への変化が生じたことをもって「物体あり」を示す検出信号を出力する。   In the amount of light received by the photoelectric sensor that detects a moving object, a portion that changes in a mountain shape exceeding a set threshold value and a portion that changes in a valley shape from below the threshold value are alternately generated (hereinafter referred to as the following). , Each fluctuation part is called "mountain" "valley"). The transmission type sensor outputs a detection signal indicating “object present” when a change from a mountain to a valley occurs. On the other hand, the reflection type sensor outputs a detection signal indicating “there is an object” when the change from the valley to the mountain occurs.

いずれの型のセンサでも、検出の精度を確保するには、山と谷との間に十分な差が生じるように感度を調整すると共に、山のピーク値と谷のボトム値との双方に対して余裕のある値をしきい値に設定する必要がある。また、ユーザが手操作でしきい値を設定する場合の参考にしたり、検出に適したしきい値が設定されているかどうかを確認するために、実際の受光状態を確認できるようにする必要がある。   Regardless of the type of sensor, to ensure the accuracy of detection, adjust the sensitivity so that there is a sufficient difference between the peaks and valleys, and adjust both the peak value of the peaks and the bottom value of the valleys. Therefore, it is necessary to set a threshold value with a margin. In addition, it is necessary to be able to confirm the actual light reception state to help the user manually set the threshold and to check whether the threshold suitable for detection is set. is there.

上記の必要性を鑑みて、一定長さの期間における受光量の最大値と最小値とを抽出し、抽出された各値を表示する機能を備えた光電センサがある(特許文献1を参照。)。   In view of the above necessity, there is a photoelectric sensor having a function of extracting the maximum value and the minimum value of the amount of received light in a period of a certain length and displaying each extracted value (see Patent Document 1). ).

特許第4023621号公報Japanese Patent No. 4023621

光電センサでは、微小な物体や高速で移動する物体を検出対象とすることが多く、また複数種の物体が検出対象となる場合もあるので、検出対象物によって反射状態(反射率、反射の方向など)が変動する可能性がある。この反射状態の変動が大きいと、受光量の山や谷のばらつきも大きくなる。   In a photoelectric sensor, a small object or an object that moves at high speed is often used as a detection target, and a plurality of types of objects may be the detection target, so the reflection state (reflectance, reflection direction) depends on the detection target object. Etc.) may fluctuate. If the fluctuation of the reflection state is large, the variation of the received light peaks and troughs also increases.

特許文献1に記載された発明によれば、一定長さの期間内に含まれる山の中で最も振幅が大きな山のピーク値と、同期間に含まれる谷の中で最も振幅が大きな谷のボトム値とが抽出されて表示されるので、これらに対して十分な余裕度を有する値がしきい値として設定される。このため、受光量の山や谷に大きなばらつきが生じていると、振幅が小さな山や谷では、しきい値に対する余裕度が小さくなり、検出動作が不安定になるおそれがある。   According to the invention described in Patent Document 1, the peak value of the peak having the largest amplitude among the peaks included in the period of a certain length and the peak value of the valley having the largest amplitude among the valleys included in the same period. Since the bottom value is extracted and displayed, a value having a sufficient margin for these values is set as the threshold value. For this reason, if there is a large variation in the peaks and valleys of the amount of received light, the margin with respect to the threshold is small in the peaks and valleys with small amplitudes, and the detection operation may become unstable.

本発明は上記の問題に着目してなされたもので、検出に適したしきい値を判別するのに適した情報が表示されるようにすることを、課題とする。   The present invention has been made paying attention to the above problem, and an object thereof is to display information suitable for determining a threshold suitable for detection.

本発明が適用される光電センサは、検出のための光を投光する投光部と、投光動作に応じて受光処理を行って受光量データを出力する受光部と、受光部からの受光量データを取得する処理と取得した受光量データが示す受光量をしきい値と比較することにより入光状態および非入光状態のいずれであるかを判別する処理とを繰り返すと共に、この判別の結果が切り替わったとき、切り替え後と同じ判別結果を得る受光量データをP回(P≧2)続けて取得したことを条件として、判別結果を示す出力を切り替える検出手段とを具備するもので、さらに、以下の第1および第2の代表受光量特定手段ならびに出力手段を具備する。 The photoelectric sensor to which the present invention is applied includes a light projecting unit that projects light for detection, a light receiving unit that performs light reception processing according to the light projecting operation and outputs received light amount data, and light reception from the light receiving unit. The process of acquiring the amount data and the process of determining whether the light incident state or the non-light incident state by comparing the received light amount indicated by the acquired received light amount data with a threshold value are repeated. A detection means for switching the output indicating the discrimination result on condition that the received light amount data for obtaining the same discrimination result as after switching is acquired P times (P ≧ 2) when the result is switched ; Furthermore, the following first and second representative received light amount specifying means and output means are provided.

第1の代表受光量特定手段は、現在設定されているしきい値により入光状態と判別される受光量を示す受光量データがP個以上得られる入光期間を複数対象として、対象の入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最小値を当該入光期間における代表受光量として特定し、現在設定されているしきい値により非入光状態と判別される受光量を示す受光量データがP個以上得られる非入光期間を複数対象として、対象の非入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最大値を当該非入光期間における代表受光量として特定する。
第2の代表受光量特定手段は、複数の入光期間のそれぞれにつき第1の代表受光量特定手段が特定した代表受光量の中の最小値を入光状態を表す代表受光量として特定し、複数の非入光期間のそれぞれにつき第1の代表受光量特定手段が特定した代表受光量の中の最大値を非入光状態を表す代表受光量として特定する。
出力手段は、第2の代表受光量特定手段により特定された2つの代表受光量を示す情報を、各代表受光量の表示のために出力する。この出力に伴い実施される表示処理では、たとえば、各代表受光量を並べて表示したり、両者を切り替え操作に応じて交互に表示することができる。
First representative light amount specifying means, the light incident period received light amount data indicating the amount of received light is judged that receiving light by the threshold that is currently set is obtained P or more as a plurality subject, the subject input For each light period, the minimum value among the light reception amounts indicated by the P light reception amount data acquired during that period is specified as the representative light reception amount in the light incident period, and no light is incident according to the currently set threshold value. For a plurality of non-light incident periods in which P or more received light quantity data indicating the amount of received light that is determined to be in a state are obtained , light reception indicated by P received light quantity data acquired during each target non-light incident period The maximum value among the amounts is specified as the representative received light amount in the non-light incident period.
The second representative received light amount specifying means specifies a minimum value among the representative received light amounts specified by the first representative received light amount specifying means for each of the plurality of light incident periods as a representative received light amount representing a light incident state, The maximum value among the representative received light amounts specified by the first representative received light amount specifying means for each of the plurality of non-incident periods is specified as the representative received light amount representing the non-incident state.
The output means outputs information indicating the two representative received light amounts specified by the second representative received light amount specifying means for displaying each representative received light amount. In the display process performed in accordance with this output, for example, the representative received light amounts can be displayed side by side, or both can be alternately displayed according to the switching operation.

上記において、入光期間は受光量の山が生じる期間に相当し、非入光期間は受光量の谷が生じる期間に相当する。入光状態と非入光状態とが切り替わっても、すぐには出力を切り替えずに、切り替わった後の状態がP回続いたことをもって出力を反転させるタイプのセンサでは、山、谷ともに、少なくともP個の受光量が確保できるようにしきい値が設定されていないと、誤検出が生じてしまう。またP個の受光量が得られる場合でも、それらの受光量のしきい値に対する余裕度が小さい場合には、受光量のばらつきに対して安定した検出を行うのが困難である。
本発明は上記の問題点を考慮して、受光量の山に関してはその山に含まれるP個の受光量の中の最小値を代表受光量として特定し、受光量の谷に関してはその谷に含まれるP個の受光量の中の最大値を代表受光量として特定し、複数の山の中最も値が低い代表受光量を入光状態を表す代表受光量として、複数の谷の中で最も値が高い代表受光量を非入光状態を表す代表受光量として、それぞれ表示する。山と谷とは、あくまでも現在設定されているしきい値に基づいて区別されるので、ユーザは、表示された2つの代表受光量の関係(各代表受光量の差の値など)に基づき、検出に適したしきい値の値を判断することができる。
In the above, the light incident period corresponds to a period in which a peak of received light amount occurs, and the non-light incident period corresponds to a period in which a valley of received light amount occurs. Even if the light incident state and the non-light incident state are switched, the output is not switched immediately, but the sensor that inverts the output after the state after the switching continues P times, If the threshold value is not set so that P received light amounts can be secured, erroneous detection occurs. Even when P received light amounts are obtained, it is difficult to perform stable detection with respect to variations in the received light amount if the margin of the received light amount with respect to the threshold is small.
In consideration of the above-described problems, the present invention specifies the minimum value among the P received light amounts included in the peak of the received light amount as the representative received light amount, and the valley of the received light amount in the valley. the maximum value of P number of light receiving quantity contained identified as the representative light receiving quantity, the least value is less representative light receiving quantity in the plurality of peaks as the representative light receiving quantity representing the light incident state, among the plurality of valleys The representative received light amount having the highest value is displayed as the representative received light amount indicating the non-light incident state. Since the peak and the valley are distinguished based on the currently set threshold value, the user is based on the relationship between the two representative received light amounts displayed (such as the difference between the representative received light amounts) A threshold value suitable for detection can be determined.

なお、代表受光量特定手段が処理対象とする入光期間と非入光期間とを分けるしきい値は、検出手段の判別処理のために設定されているしきい値に限らず、当該判別処理のためのしきい値を変更する候補の値として仮に設定されたしきい値であってもよい。
上記の光電センサの第1の実施形態による第1の代表受光量特定手段は、複数の入光期間毎に、その入光期間内に取得した受光量データが示す受光量を大きさの降順に並べた場合にP番目に位置する受光量を当該入光期間における代表受光量として特定し、複数の非入光期間毎に、その非入光期間内に取得した受光量データが示す受光量を大きさの昇順に並べた場合にP番目に位置する受光量を当該非入光期間における代表受光量として特定する。この実施形態によれば、各山のP番目に高い受光量の中の最小値と、各谷のP番目に低い受光量の中の最大値とが表示されるので、ユーザは、両者の値の関係から、検出処理に適したしきい値を容易に判別することが可能になる。
Note that the threshold value for dividing the light incident period and the non-light incident period to be processed by the representative received light amount specifying unit is not limited to the threshold value set for the determination process of the detection unit, but the determination process. It may be a threshold value temporarily set as a candidate value for changing the threshold value for.
The first representative received light amount specifying means according to the first embodiment of the photoelectric sensor described above receives, for each of a plurality of light incident periods, the light received quantities indicated by the received light quantity data acquired in the light incident periods in descending order of size. When arranged, the Pth received light amount is specified as the representative received light amount in the light incident period, and the received light amount indicated by the received light amount data acquired in the non-light incident period is determined for each of the plurality of light incident periods. The P-th received light amount when arranged in ascending order of size is specified as the representative received light amount in the non-light incident period. According to this embodiment, since the minimum value in the P-th highest received light amount of each peak and the maximum value in the P-th lowest received light amount of each valley are displayed, the user can set both values. Therefore, it is possible to easily determine a threshold value suitable for detection processing.

上記の光電センサの第2の実施形態では、第2の代表受光量特定手段は、あらかじめ定めた一定時間内に生じた複数の入光期間のそれぞれに対して第1の代表受光量特定手段が特定した代表受光量の中の最小値を入光状態を表す代表受光量として特定する。また一定時間内に生じた複数の非入光期間のそれぞれに対して第1の代表受光量特定手段が特定した代表受光量の中の最大値を非入光状態を表す代表受光量として特定する。
この実施形態によれば、たとえば検出対象物の移動速度に基づき、十分な数の対象物が通過するのに要する時間を求めて、この時間を代表受光量特定手段による処理時間として設定することにより、様々な値にばらつく受光量の山や谷を得て、それらの中で山と谷とを分けたしきい値に対する余裕度が最も小さい山および谷の代表受光量を表示することができる。
In the second embodiment of the photoelectric sensor described above, the second representative received light amount specifying means includes the first representative received light amount specifying means for each of a plurality of light incident periods occurring within a predetermined time. The minimum value among the identified representative received light amounts is specified as the representative received light amount representing the incident light state. Also identified as the representative light receiving quantity representing the non-light incidence state the maximum value among the representative light receiving quantity is first representative light receiving quantity specifying means specified for each of a plurality of non-light incident period occurring within a predetermined time .
According to this embodiment, for example, the time required for a sufficient number of objects to pass through is determined based on the moving speed of the detection object, and this time is set as the processing time by the representative received light amount specifying means. It is possible to obtain peaks and valleys of received light amounts that vary in various values, and to display the representative received light amounts of peaks and valleys having the smallest margin with respect to the threshold value obtained by dividing the peaks and valleys.

第3の実施形態による光電センサでは、第1の代表受光量特定手段は、受光部からの受光量データが示す受光量をしきい値と比較して入光期間と非入光期間との切り替わりを判別しつつ、各期間における代表受光量を特定する。第2の代表受光量特定手段は、入光期間から非入光期間への切り替わりが生じる都度、その直前の入光期間から遡る過去の複数の入光期間に対して第1の代表受光量特定手段が特定した代表受光量の中の最小値を入光状態を表す代表受光量として特定し、非入光期間から入光期間への切り替わりが生じる都度、その直前の非入光期間から遡る過去の複数の非入光期間に対して第1の代表受光量特定手段が特定した代表受光量の中の最大値を非入光状態を表す代表受光量として特定する。この実施形態によれば、たとえば、複数の対象物が移動している間の受光量を取得して処理を行うことにより、最終的に、各対象物に対応する山や谷の中からしきい値に対する余裕度が最も小さい山および谷の代表受光量を表示することができる。 In the photoelectric sensor according to the third embodiment, the first representative light reception amount specifying means switches the light reception period and the non-light reception period by comparing the light reception amount indicated by the light reception amount data from the light receiving unit with a threshold value. And determining the representative amount of received light in each period. Second representative light amount specifying means, each time the switch from the light incident period to the non-light incident period occurs, first representative light receiving quantity specified for a plurality of past light incident period dating back from the light incident period immediately before The minimum value of the representative received light quantity specified by the means is specified as the representative received light quantity that represents the incident light state, and every time a transition from the non-light incident period to the light incident period occurs , the past goes back from the previous non-light incident period. The maximum value among the representative received light amounts specified by the first representative received light amount specifying means for the plurality of non-incidence periods is specified as the representative received light amount representing the non-incident state . According to this embodiment, for example, by acquiring the amount of light received while a plurality of objects are moving and performing processing, the threshold is finally determined from the mountains and valleys corresponding to each object. can margin against the value to display the representative light receiving quantity of the smallest peaks and valleys.

第4の実施形態による光電センサは、さらに、前記Pの値が異なる複数の検出モードのうちの1つを選択する操作を受け付けて、選択された検出モードによるPの値を検出手段に設定する設定手段を具備する。 The photoelectric sensor according to the fourth embodiment further accepts an operation of selecting one of a plurality of detection modes having different values of P, and sets the value of P according to the selected detection mode in the detection means. Setting means is provided.

第5の実施形態による光電センサでは、出力手段に、第2の代表受光量特定手段により特定された2つの代表受光量を表示するための表示部が含まれる。すなわち、検出を行うセンサ自体が2種類の代表受光量を表示する機能を備えることになる。
出力手段に表示部が含まれない場合でも、各代表受光量を示す情報を外部の表示装置に与えて表示することができる。
In the photoelectric sensor according to the fifth embodiment, the output unit includes a display unit for displaying the two representative received light amounts specified by the second representative received light amount specifying unit. That is, the detection sensor itself has a function of displaying two types of representative received light amounts.
Even when the output means does not include a display unit, information indicating each representative received light amount can be given to an external display device for display.

第6の実施形態による光電センサは、しきい値を変更する操作を行うための操作部と、第2の代表受光量特定手段により特定された2つの代表受光量の表示に連動させて検出手段の判別処理のために設定されているしきい値が表示されるように当該しきい値を出力し、この出力による表示が行われている状態下で操作部による操作に応じてしきい値を変更するしきい値変更手段とを、さらに具備する。この構成によれば、たとえば、各代表受光量の表示に対してしきい値を呼び出す操作が行われたことに応じて、現在のしきい値を表示し、ユーザがしきい値と代表受光量との関係が適切でないと判断した場合に、操作によりしきい値を変更することができる。 The photoelectric sensor according to the sixth embodiment includes an operation unit for performing an operation of changing a threshold value, and detection means in conjunction with display of two representative received light amounts specified by the second representative received light amount specifying means. The threshold value is output so that the threshold value set for the discrimination process is displayed, and the threshold value is set according to the operation by the operation unit under the display state by this output. And a threshold value changing means for changing. According to this configuration, for example, the current threshold value is displayed in response to an operation for calling the threshold value for each representative received light amount display, and the user can display the threshold value and the representative received light amount. When it is determined that the relationship with is not appropriate, the threshold value can be changed by an operation.

上記のしきい値の表示は、代表受光量の表示と切り替えて行っても良いし、代表受光量の表示にしきい値の表示を加える方法をとってもよい。また、ユーザによるしきい値の呼び出し操作を行うことなく、最初から、各代表受光量およびしきい値を、三者の比較が可能な態様により表示してもよい。   The display of the threshold value may be switched to the display of the representative received light amount, or a method of adding the threshold value display to the display of the representative received light amount may be used. In addition, each representative light reception amount and threshold value may be displayed from the beginning in a manner that allows comparison between the three without performing a threshold value calling operation by the user.

本発明は、光電センサの受光状態を確認する作業を支援する方法に適用することができる。この方法では、光電センサに現在設定されているしきい値より入光状態と判別される受光量を示す受光量データがP個以上得られる入光期間を複数対象として、対象の入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最小値を当該入光期間における代表受光量として特定し、現在設定されているしきい値により非入光状態と判別される受光量を示す受光量データがP個以上得られる非入光期間を複数対象として、対象の非入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最大値を当該非入光期間における代表受光量として特定する。さらに、複数の入光期間のそれぞれにおける代表受光量の中の最小値を入光状態を表す代表受光量として特定して表示し、複数の非入光期間のそれぞれにおける代表受光量の中の最大値を非入光状態を表す代表受光量として特定して表示するThe present invention can be applied to a method for supporting the work of confirming the light receiving state of a photoelectric sensor. In this way, the light incident period received light amount data indicating the amount of received light is determined from the threshold to the photoelectric sensor is currently set to light incident state is obtained P or more as a plurality interest, each light incident period of interest The minimum value of the received light amount indicated by the P received light amount data acquired during that period is specified as the representative received light amount in the light incident period, and is determined as a non-light incident state based on the currently set threshold value. the non light incident period received light amount data are obtained P or more indicating the received light amount of a plurality of objects, in the obtained P number of received light amount data indicating received light amount during that period for each non-light incident period of interest Is specified as the representative received light amount in the non-light-incidence period. Further, the minimum value of the representative received light amounts in each of the plurality of light incident periods is specified and displayed as the representative received light amount representing the light incident state, and the maximum of the representative received light amounts in each of the plurality of non-light incident periods is displayed. The value is specified and displayed as a representative received light amount representing a non-light incident state .

上記の方法は、光電センサの制御部により実施することができるが、これに限らず、光電センサの受光部から取得した受光量を外部機器に伝送し、外部機器で代表受光量の特定や表示を行ってもよい。または、代表受光量を特定する処理は光電センサで行い、特定された代表受光量を外部機器に送信して、センサの外部で代表受光量の表示を行うようにしてもよい。   The above method can be implemented by the control unit of the photoelectric sensor, but is not limited to this. The amount of received light acquired from the light receiving unit of the photoelectric sensor is transmitted to an external device, and the representative amount of received light is specified or displayed by the external device. May be performed. Alternatively, the process of specifying the representative received light amount may be performed by a photoelectric sensor, and the specified representative received light amount may be transmitted to an external device to display the representative received light amount outside the sensor.

本発明によれば、検出対象物によって受光量の変化の状態にばらつきが生じる場合でも、入光期間および非入光期間につき、それぞれしきい値に対する余裕度が最も小さな期間における代表受光量が表示されるので、ユーザは、双方の代表受光量に対して十分な余裕度が得られる受光量がしきい値の適正値であると判断することができる。よって、現在のしきい値がこの適正値から離れている場合には、しきい値を変更することにより、安定した検出処理を実施することができる。   According to the present invention, even when the variation in the amount of received light varies depending on the object to be detected, the representative amount of received light in the period with the smallest margin with respect to the threshold value is displayed for each of the light incident period and the non-light incident period. Therefore, the user can determine that the received light amount that provides a sufficient margin for both representative received light amounts is an appropriate value of the threshold value. Therefore, when the current threshold value is far from the appropriate value, stable detection processing can be performed by changing the threshold value.

光ファイバ式の光電センサの外観を示す斜視図である。It is a perspective view which shows the external appearance of an optical fiber type photoelectric sensor. 図1の光電センサの上面カバーを開けた状態を示す斜視図である。It is a perspective view which shows the state which opened the upper surface cover of the photoelectric sensor of FIG. 上記光電センサの操作部および表示部を含む上面を正面視した図である。It is the figure which looked at the upper surface containing the operation part and display part of the said photoelectric sensor from the front. 上記光電センサの電気構成を示すブロック図である。It is a block diagram which shows the electric constitution of the said photoelectric sensor. 受光量のピーク値およびボトム値を参照してしきい値を変更する処理を行う場合に表示部に展開される表示の例を示す図である。It is a figure which shows the example of the display expand | deployed on a display part, when performing the process which changes a threshold value with reference to the peak value and bottom value of light reception amount. 検出処理に用いられるパルスカウント数をモード別に示すテーブルである。It is a table which shows the pulse count number used for a detection process according to mode. パルスカウント方式の検出処理の具体例をその問題点と共に示す図である。It is a figure which shows the specific example of the detection process of a pulse count system with the problem. 受光量のピーク値およびボトム値を表示する処理に関する手順を示すフローチャートである。It is a flowchart which shows the procedure regarding the process which displays the peak value and bottom value of received light quantity. 入光時処理および非入光時処理の詳細な手順を示すフローチャートである。It is a flowchart which shows the detailed procedure of the process at the time of incident light, and the process at the time of non-incident light. 入光期間中の受光量を格納するバッファの値の変化の例を示すテーブルである。It is a table which shows the example of the change of the value of the buffer which stores the light reception amount in a light-incidence period. 受光量のピーク値およびボトム値を表示する処理に関する手順の第2の例を示すフローチャートである。It is a flowchart which shows the 2nd example of the procedure regarding the process which displays the peak value and bottom value of light reception amount. 受光量のピーク値およびボトム値を表示する処理に関する手順の第3の例を示すフローチャートである。It is a flowchart which shows the 3rd example of the procedure regarding the process which displays the peak value and bottom value of light reception amount.

図1および図2は、本発明が適用される光ファイバ式の光電センサの外観を示す。
この光電センサ1は、本体部10と本体部10の前面に取り付けられる一対の光ファイバ11,12とを具備する。光ファイバ11は投光用で、他方の光ファイバ12は受光用である。各光ファイバ11,12の先端部には、それぞれレンズなどを含むヘッド部11A,12Aが取り付けられている。なお、実際の光ファイバ11,12は、図示の状態より長くすることができる。
1 and 2 show the appearance of an optical fiber photoelectric sensor to which the present invention is applied.
The photoelectric sensor 1 includes a main body 10 and a pair of optical fibers 11 and 12 attached to the front surface of the main body 10. The optical fiber 11 is for light projection, and the other optical fiber 12 is for light reception. Head portions 11A and 12A each including a lens or the like are attached to the tip portions of the optical fibers 11 and 12, respectively. The actual optical fibers 11 and 12 can be longer than the illustrated state.

各光ファイバ11,12は、それぞれ本体部10の前面の挿入口11B,12Bに挿入される。投光用の光ファイバ11の挿入口11Bの近傍には投光部が設けられ、受光用の光ファイバ12の挿入口12Bの近傍には受光部が設けられる。また本体部10の背面からは、接続用のケーブル14が引き出されている。   The optical fibers 11 and 12 are inserted into the insertion ports 11B and 12B on the front surface of the main body 10, respectively. A light projecting portion is provided in the vicinity of the insertion port 11B of the light projecting optical fiber 11, and a light receiving unit is provided in the vicinity of the insertion port 12B of the light receiving optical fiber 12. A connection cable 14 is drawn from the back surface of the main body 10.

上記の光電センサ1は、投光部から投光された光を受光部により受光し、この光路が遮光された状態を「物体あり」と判別する透過型のセンサとして機能するが、物体からの反射光を受光して「物体あり」と判別する反射型の光電センサとして機能させることもできる。反射型の光電センサとして使用する場合には、各光ファイバ11,12の先端に共通のヘッド部が装着され、このヘッド部が検出エリアに向けて配備される。   The photoelectric sensor 1 functions as a transmissive sensor that receives light projected from the light projecting unit by the light receiving unit and discriminates that the optical path is shielded from being “object present”. It can also function as a reflective photoelectric sensor that receives reflected light and discriminates that there is an object. When used as a reflective photoelectric sensor, a common head portion is attached to the tip of each of the optical fibers 11 and 12, and this head portion is arranged toward the detection area.

受光部により生成された受光量データは、制御部(CPU)に入力され、あらかじめ登録されたしきい値との比較により入光状態であるか否かが判定されて、その判定結果が出力される。   The received light amount data generated by the light receiving unit is input to the control unit (CPU), and it is determined whether it is in the light incident state by comparison with a threshold value registered in advance, and the determination result is output. The

本体部10の上面には、表示部100や複数の押ボタンスイッチSW1〜SW5が設けられる。使用時の上面にはカバー13が被せられるが、設定の際などには、カバー13が開放されて各押ボタンスイッチSW1〜SW5の操作が可能になる。図2は、カバー13が開放された状態の本体部10の斜視図であり、図3は上面を正面視した図である。なお、カバー13は透明であるので、カバー13が装着されている場合でも、カバー13を介して表示部100の表示を確認することができる。   A display unit 100 and a plurality of push button switches SW <b> 1 to SW <b> 5 are provided on the upper surface of the main body unit 10. The cover 13 is put on the upper surface when in use, but the cover 13 is opened at the time of setting or the like, and the operation of the pushbutton switches SW1 to SW5 becomes possible. FIG. 2 is a perspective view of the main body 10 with the cover 13 opened, and FIG. 3 is a front view of the upper surface. Since the cover 13 is transparent, the display on the display unit 100 can be confirmed via the cover 13 even when the cover 13 is attached.

図2,3を参照して上面の構成を説明する。
この実施例では、本体部の前面寄りの位置に、押ボタンスイッチSW1が配備され、その後方に表示部100が設けられ、さらに表示部100の後方に4個の押ボタンスイッチSW2,SW3,SW4,SW5が配備されている。なお、押ボタンスイッチSW2,SW3のボタン部は一体になっているが、筐体10内のスイッチ本体(図示せず。)はそれぞれ独立している。
The configuration of the upper surface will be described with reference to FIGS.
In this embodiment, a push button switch SW1 is provided at a position closer to the front surface of the main body, a display unit 100 is provided behind the push button switch SW1, and four push button switches SW2, SW3, SW4 are provided behind the display unit 100. , SW5 is deployed. In addition, although the button part of pushbutton switch SW2, SW3 is united, the switch main body (not shown) in the housing | casing 10 is each independent.

表示部100には、一対の表示器101,102や5個の表示灯111〜115が設けられる。表示器101,102は、4個の7セグLEDが組み合わせられたもので、それぞれ4桁以内の数字やアルファベット文字列を表示する。   The display unit 100 is provided with a pair of indicators 101 and 102 and five indicator lights 111 to 115. The display devices 101 and 102 are a combination of four 7-segment LEDs, and display numbers and alphabetic character strings of up to 4 digits, respectively.

前方の押ボタンスイッチSW1は、後記するチューニング処理に使用されるので、以下、このスイッチSW1を「チューニングスイッチSW1」という。
表示部100の後方の一対の押ボタンスイッチSW2,SW3は、表示器101,102に表示される数値やサブメニューを変更するために用いられる。以下、ボタン部に+印が付いたスイッチSW2を「アップスイッチSW2」と呼び、ボタン部に−印が付いたスイッチSW3を「ダウンスイッチSW3」と呼ぶ。
Since the front pushbutton switch SW1 is used for a tuning process to be described later, the switch SW1 is hereinafter referred to as “tuning switch SW1”.
A pair of push button switches SW2 and SW3 on the rear side of the display unit 100 are used to change numerical values and submenus displayed on the display devices 101 and 102. Hereinafter, the switch SW2 with the + mark on the button portion is referred to as “up switch SW2”, and the switch SW3 with the − mark on the button portion is referred to as “down switch SW3”.

押ボタンスイッチSW4は、計測モードと設定モードとを切り替えたり、設定モードのメインメニューの選択や決定に用いられる。以下では、このスイッチSW4を「モードスイッチSW4」と呼ぶ。
設定モードにおいて何らかの設定が行われると、設定された内容が確定する。モードスイッチSW4により計測モードに切り替えられると、設定された内容にて計測が開始される。
The push button switch SW4 is used for switching between the measurement mode and the setting mode, and for selecting and determining the main menu of the setting mode. Hereinafter, this switch SW4 is referred to as “mode switch SW4”.
When any setting is made in the setting mode, the set content is confirmed. When the mode is switched to the measurement mode by the mode switch SW4, the measurement is started with the set contents.

押ボタンスイッチSW5は、センサ1の出力形式を切り替えるためのものである。具体的には、受光量がしきい値以上となったときに出力をオン状態にする「ライトオンモード」か、受光量がしきい値以下となったときに出力をオン状態とする「ダークオンモード」が選択される。   The push button switch SW5 is for switching the output format of the sensor 1. Specifically, the “light on mode” that turns the output on when the amount of received light exceeds a threshold value or the “dark on” state that turns the output on when the amount of received light falls below the threshold value. Mode "is selected.

表示灯111は、検出処理において、センサ1からの検出信号がオン状態になったときに点灯する。表示灯112はライトオンモードが選択されているときに点灯し、表示灯113はダークオンモードが選択されているときに点灯する。
表示灯114は、表示上の受光量を自動的に調整する処理が有効に設定されている場合に点灯する。表示灯115は、チューニング処理が行われている間とチューニング終了後とに点灯する。
The indicator lamp 111 is lit when the detection signal from the sensor 1 is turned on in the detection process. The indicator lamp 112 is lit when the light-on mode is selected, and the indicator lamp 113 is lit when the dark-on mode is selected.
The indicator lamp 114 is lit when the process for automatically adjusting the amount of received light on the display is set to be effective. The indicator lamp 115 is lit while the tuning process is being performed and after the end of tuning.

図4は、上記光電センサ1の電気的構成を示す。
このセンサ1では、制御部となるCPU105に、投光部103や受光部104のほか、プログラムが格納されたメモリ106、表示部100、操作部110、外部機器用インタフェース107、出力部108、電源部109などが接続される。
FIG. 4 shows the electrical configuration of the photoelectric sensor 1.
In this sensor 1, in addition to the light projecting unit 103 and the light receiving unit 104, a memory 106 storing a program, a display unit 100, an operation unit 110, an external device interface 107, an output unit 108, a power source, in addition to the light projecting unit 103 and the light receiving unit 104 The unit 109 and the like are connected.

表示部100には、前述した表示器101,102や表示灯111〜115が含まれ、操作部110には、各押ボタンスイッチSW1〜SW5が含まれる。投光部103には、LED131とLED駆動回路132とが含まれ、受光部104には、フォトダイオード(PD)141のほか、増幅回路142やA/D変換回路143が含まれる。投光部103では、LED駆動回路132からLED131に駆動用の電流が流れて、投光処理が行われる。受光部104では、フォトダイオード141からの出力が増幅回路142およびA/D変換回路143により処理されることにより、受光量を表すディジタルデータ(以下、「受光量データ」という。)が生成される。   The display unit 100 includes the above-described indicators 101 and 102 and indicator lamps 111 to 115, and the operation unit 110 includes push button switches SW1 to SW5. The light projecting unit 103 includes an LED 131 and an LED drive circuit 132, and the light receiving unit 104 includes an amplifying circuit 142 and an A / D conversion circuit 143 in addition to a photodiode (PD) 141. In the light projecting unit 103, a driving current flows from the LED drive circuit 132 to the LED 131, and a light projecting process is performed. In the light receiving unit 104, the output from the photodiode 141 is processed by the amplification circuit 142 and the A / D conversion circuit 143, thereby generating digital data representing the amount of received light (hereinafter referred to as “light reception amount data”). .

CPU105は、メモリ106に格納されたプログラムに従って、投光部103および受光部104の動作を制御しながら、受光部104から受光量データを入力して検出処理を実行する。検出結果は、出力部108や外部機器用インタフェース107を介して出力される。   The CPU 105 inputs the received light amount data from the light receiving unit 104 and executes detection processing while controlling the operations of the light projecting unit 103 and the light receiving unit 104 according to the program stored in the memory 106. The detection result is output via the output unit 108 and the external device interface 107.

計測モードにおいてチューニングスイッチSW1が操作されると、「チューニング」と呼ばれる設定処理が実施される。チューニングは、検出処理に不可欠な設定であるしきい値の設定処理と感度調整処理とを一括で行うものである。簡単に説明すると、移動するワークを検出対象とする場合には、検出時と同じ条件でワークを移動させながらチューニングスイッチSW1を所定時間以上押し続け、その間に得られる受光量の中の最大値と最小値とを特定する。そして、最大値があらかじめ定めた目標値になるように感度を調整すると共に、この調整に合わせて最小値を補正し、最大値と最小値との間の中間値をしきい値に設定する。なお、感度の調整は、投光部103に流す駆動電流や受光部104の増幅回路142の倍率の調整により行われる。   When the tuning switch SW1 is operated in the measurement mode, a setting process called “tuning” is performed. In the tuning, threshold setting processing and sensitivity adjustment processing, which are indispensable settings for detection processing, are performed collectively. Briefly, when a moving workpiece is to be detected, the tuning switch SW1 is continuously pressed for a predetermined time or more while moving the workpiece under the same conditions as at the time of detection. Specify the minimum value. Then, the sensitivity is adjusted so that the maximum value becomes a predetermined target value, the minimum value is corrected in accordance with this adjustment, and an intermediate value between the maximum value and the minimum value is set as a threshold value. The sensitivity is adjusted by adjusting the drive current flowing through the light projecting unit 103 and the magnification of the amplifier circuit 142 of the light receiving unit 104.

また、比較的短い間隔をおいてチューニングスイッチSW1を2回押下する操作に伴ってチューニング処理が行われる場合もある。この場合には、一方の操作は、ワークが検出エリアに置かれた状態で実施され、他方の操作はワークが検出エリアにない状態下で行われる。そして、各操作に応じて取り込まれた受光量のうちの高い方の値が目標値になるように感度を調整し、この調整に合わせて他方の受光量を補正し、各受光量の間の中間値をしきい値に設定する。   In addition, the tuning process may be performed in accordance with an operation of pressing the tuning switch SW1 twice at a relatively short interval. In this case, one operation is performed in a state where the work is placed in the detection area, and the other operation is performed in a state where the work is not in the detection area. Then, the sensitivity is adjusted so that the higher value of the received light amount captured in accordance with each operation becomes the target value, and the other received light amount is corrected in accordance with this adjustment. Set the intermediate value to the threshold value.

モードスイッチSW4により設定モードが選択されると、表示部100の各表示器101,102に、設定用のメニューが表示される。ユーザは、アップスイッチSW2やダウンスイッチSW3によってメニュー表示を切り替えながら、所望の設定を実行する。   When the setting mode is selected by the mode switch SW4, a setting menu is displayed on each of the displays 101 and 102 of the display unit 100. The user performs a desired setting while switching the menu display using the up switch SW2 or the down switch SW3.

上記の設定モードには、センサの受光状態を確認し、チューニング処理により設定されたしきい値を必要に応じて手操作で変更する処理が含まれている。図5は、この受光量の確認作業およびしきい値の変更作業のために表示部100に展開される表示例を示す。   The setting mode includes a process of checking the light receiving state of the sensor and manually changing the threshold set by the tuning process as necessary. FIG. 5 shows a display example developed on the display unit 100 for the work of confirming the amount of received light and the work of changing the threshold value.

まず、ユーザは、メインメニューやサブメニューの選択により、図5の(a)に示すように、表示器101に「disp」という文字列(「display」の略である。)が表示され、表示器102に「P−b」という文字列が表示された状態にする。この表示状態下でユーザがモードスイッチSW4を操作すると、図5(b)に示すように、表示器101は「PEAK」という文字列を表示する状態になり、表示器102は「botn(nはバー付)」という文字列(「BOTTOM」を意味する。)を表示する状態になる。   First, as shown in FIG. 5A, the user selects and displays a character string “disp” (abbreviation of “display”) as shown in FIG. The character string “Pb” is displayed on the device 102. When the user operates the mode switch SW4 in this display state, as shown in FIG. 5B, the display device 101 enters a state of displaying the character string “PEAK”, and the display device 102 displays “botn (n is A character string “with bar” (which means “BOTTOM”) is displayed.

さらに所定時間が経過すると、表示器101,102には、図5(c)に示すような数値が表示される。この実施例では、しきい値以上の受光量を得た状態を入光状態とし、しきい値より小さい受光量を得た状態を非入光状態としており、表示器101に表示される数値(3185)は、入光状態が続く期間(入光期間)における代表受光量であり、表示部102に表示される数値(1467)は、非入光状態が続く期間(非入光期間)における代表受光量である。   Further, when a predetermined time elapses, numerical values as shown in FIG. In this embodiment, a state where a received light amount equal to or greater than the threshold value is set as a light incident state, and a state where a received light amount smaller than the threshold value is set as a non-light incident state, a numerical value displayed on the display 101 ( 3185) is a representative received light amount in a period (light incident period) in which the light incident state continues, and a numerical value (1467) displayed on the display unit 102 is a representative in a period (non light incident period) in which the non-light incident state continues. This is the amount of light received.

図5(c)の表示と図5(b)の表示とは、所定の時間をおいて交互に切り替えられる。これにより、表示器101に表示される代表受光量は受光量のピーク値として、表示器102に表示される代表受光量は受光量のボトム値として、それぞれユーザに提示される。   The display in FIG. 5C and the display in FIG. 5B are alternately switched after a predetermined time. Thereby, the representative received light amount displayed on the display device 101 is presented to the user as the peak value of the received light amount, and the representative received light amount displayed on the display device 102 is presented to the user as the bottom value of the received light amount.

この実情に合わせて、以下の説明でも、表示器101に表示される代表受光量をピーク値と呼び、表示器102に表示される代表受光量をボトム値と呼ぶ。ただし、以下に詳細に述べるように、各代表受光量は、受光量の最大値や最小値ではない。   In accordance with this situation, in the following description, the representative received light amount displayed on the display unit 101 is referred to as a peak value, and the representative received light amount displayed on the display unit 102 is referred to as a bottom value. However, as described in detail below, each representative received light amount is not the maximum value or the minimum value of the received light amount.

ピーク値およびボトム値の表示に対し、所定の時点でユーザがアップスイッチSW2またはダウンスイッチSW3を操作すると、当該表示が終了し、図5(d)に示すように、表示器102に「th」という文字列(threshold(しきい値)の略。)が表示され、表示器101に、現在のしきい値を示す数値が表示される。   When the user operates the up switch SW2 or the down switch SW3 at a predetermined time with respect to the display of the peak value and the bottom value, the display ends, and “th” is displayed on the display 102 as shown in FIG. And a numerical value indicating the current threshold value is displayed on the display unit 101.

上記の表示状態において、ユーザは、アップスイッチSW2やダウンスイッチSW3を操作することにより、図5(e)に示すように、表示器101の数値を自由に変更することができる。この変更後にモードスイッチSW4が操作されると、計測モードに戻り、変更された数値をしきい値とした検出処理が開始される。   In the above display state, the user can freely change the numerical value of the display 101 as shown in FIG. 5E by operating the up switch SW2 and the down switch SW3. When the mode switch SW4 is operated after this change, the measurement mode is returned to and detection processing using the changed numerical value as a threshold value is started.

なお、ピーク値およびボトム値の表示やしきい値の表示の形態は、図5の例に限らず、たとえば、3種類の値を、それぞれの値の意味を示す文字列と共に、1つずつ切り替えて表示してもよい。または、表示部100を液晶パネルなどにより構成して、3種類の値を並列表示してもよい。この場合には、各数値を、バーグラフなどの視覚的に大きさを表現する形態にして表示してもよい。   In addition, the display form of the peak value and the bottom value and the display of the threshold value are not limited to the example of FIG. 5, but, for example, three kinds of values are switched one by one together with a character string indicating the meaning of each value. May be displayed. Alternatively, the display unit 100 may be configured by a liquid crystal panel or the like to display three types of values in parallel. In this case, each numerical value may be displayed in a form that visually represents the size, such as a bar graph.

つぎに、この実施例の検出処理では、制御用のクロックパルスに従って受光量をサンプリングし、サンプリングした受光量をしきい値と比較することにより入光状態および非入光状態のいずれであるかを判別しながら、出力を制御する。ただし、判別の結果が切り替わっても、出力を直ちに切り替えるのではなく、切り替え後と同じ結果を一定数P回続けて得たことを確認してから、出力を切り替える。   Next, in the detection process of this embodiment, the amount of received light is sampled according to the clock pulse for control, and the sampled received light amount is compared with a threshold value to determine whether the light incident state or the non-light incident state. The output is controlled while discriminating. However, even if the determination result is switched, the output is not switched immediately, but the output is switched after confirming that the same result as that after the switching is obtained a certain number P times continuously.

具体的には、非入光を示す受光量(しきい値より小)を得ている状態から入光を示す受光量(しきい値以上)を得ている状態に変わると、CPU105は、その受光を1回目として、入光がP回続くことを確認してから、非入光を示す出力から入光を示す出力に切り替える。入光を示す受光量を得ている状態から非入光を示す受光量を得ている状態に変わった場合も同様に、その受光を1回目として、非入光がP回続くことを確認してから、入光を示す出力から非入光を示す出力に切り替える。したがって、受光状態が変化した時点を1回目とすると、P+1回目の受光のタイミングに合わせて、出力が切り替えられることになる。   Specifically, when changing from a state where the amount of received light indicating non-incident light (smaller than the threshold) is obtained to a state where the amount of received light indicating incident light (greater than or equal to the threshold) is obtained, the CPU 105 After confirming that the incident light P continues for the first time, the light output is switched from an output indicating non-incident light to an output indicating light incident. Similarly, when changing from a state where the amount of received light indicating the incident light is obtained to a state where the amount of received light indicating the non-incident light is obtained, confirm that the non-incident light continues P times for the first time. Then, the output indicating incident light is switched to the output indicating non-incident light. Therefore, when the time when the light receiving state changes is the first time, the output is switched in accordance with the timing of the P + 1th light receiving.

上記の方法による検出処理を、以下、「パルスカウント方式の検出処理」という。
パルスカウント方式の検出処理では、Pの値を変更することにより、検出の精度や速度を変更することができる。この実施例では、図6に示すような4種類の検出モードを用意して、これらの中のいずれか1つを設定モードにおいて選択できるようにしている。
The detection process by the above method is hereinafter referred to as “pulse count type detection process”.
In the detection process of the pulse count method, the accuracy and speed of detection can be changed by changing the value of P. In this embodiment, four types of detection modes as shown in FIG. 6 are prepared, and any one of them can be selected in the setting mode.

図7は、パルスカウント方式の検出処理の具体例を、その問題点と共に示す。
この例では、出力形式がライトオンモードに設定され、検出モードとして最速モード(P=2)が選択されているものとする。また、図7では、受光量の変化曲線を示すと共に。この曲線上にCPU105によるサンプリング点をドットにより示し、さらに各サンプリング点とセンサからの出力の変化とを対応づけて示す。
FIG. 7 shows a specific example of the detection process of the pulse count method together with the problem.
In this example, it is assumed that the output format is set to the light-on mode and the fastest mode (P = 2) is selected as the detection mode. FIG. 7 shows a change curve of the amount of received light. On this curve, the sampling points by the CPU 105 are indicated by dots, and each sampling point and a change in output from the sensor are shown in correspondence with each other.

入光期間中の受光量曲線は受光量の山に相当し、非入光期間中の受光量曲線は受光量の谷に相当すると考えると、P=2としてパルスカウント方式の検出処理を誤りなく行うには、全ての山および全ての谷に、それぞれ2点以上のサンプリング点が含まれる必要がある。   Assuming that the received light amount curve during the light incident period corresponds to the peak of the received light amount, and the received light amount curve during the non-light incident period corresponds to the trough of the received light amount, the detection processing of the pulse count method without error is set to P = 2 To do so, every mountain and every valley needs to contain two or more sampling points each.

図7の例の受光量の変化曲線は、2つのワークが検出エリアを通過する間に生じたもので、ワーク毎に山および谷が1つずつ生じているが、ワーク間での反射状態の違いが大きいために、山や谷の振幅にかなり大きなばらつきが生じている。また、設定されるしきい値によっても、山や谷の振幅や幅が変動する。
このように受光量のばらつきが大きい場合でも、図7(1)に示すように、各山および各谷にそれぞれ2点以上のサンプリング点が含まれる状態でしきい値が設定されると、ワーク毎に出力のオン/オフを切り替えることができる。一方、図7(2)の例のように、しきい値が図7(1)より低い値に設定され、谷となる箇所に対するサンプリング点が1点のみとなると、この谷に対して出力を切り替えることができなくなる。この結果、図7(2)の例では、2つのワークが1つのワークとして誤検出されている。
The change curve of the amount of received light in the example of FIG. 7 is generated while two workpieces pass through the detection area, and one peak and valley are generated for each workpiece. Due to the large difference, the amplitudes of the peaks and valleys vary considerably. Also, the amplitude and width of the peaks and valleys vary depending on the set threshold value.
Even when the variation in the amount of received light is large, as shown in FIG. 7A, if the threshold is set in a state where each peak and each valley include two or more sampling points, the workpiece The output can be switched on / off each time. On the other hand, when the threshold value is set to a value lower than that in FIG. 7 (1) as in the example of FIG. 7 (2), and there is only one sampling point for a valley, an output is output to this valley. It becomes impossible to switch. As a result, in the example of FIG. 7B, two workpieces are erroneously detected as one workpiece.

しきい値が高すぎて、山となる箇所で2点以上のサンプリング点を確保できなくなった場合も、同様に、ワーク毎に出力を切り替えることができなくなって、誤検出が生じる。   Similarly, when the threshold value is too high and two or more sampling points cannot be secured at a peak, it becomes impossible to switch the output for each workpiece, and erroneous detection occurs.

前述したチューニング処理では、ワークが検出エリアにある状態での受光量とワークが検出エリアにない状態での受光量とを取得して、各受光量に基づきしきい値を自動設定するが、受光量のばらつきが大きく、振幅が大きな山や谷の受光量に基づいてしきい値が設定されると、振幅が小さな山や谷に対しては、いずれか一方にしきい値が偏った状態になる。この結果、図7(2)に示すような誤検出が生じるおそれがある。   In the tuning process described above, the received light amount when the workpiece is in the detection area and the received light amount when the workpiece is not in the detection area are acquired, and the threshold value is automatically set based on each received light amount. When threshold values are set based on the amount of light received from peaks and valleys with large variations in amplitude and large amplitudes, the threshold values are biased to either one of peaks or valleys with small amplitudes. . As a result, there is a possibility that erroneous detection as shown in FIG.

上記の問題点に着目して、この実施例では、入光期間および非入光期間からそれぞれ代表受光量を1つ抽出し、各入光期間の代表受光量の中の最小値(以下、MTminとする。)をピーク値とし、非入光期間の代表受光量の中の最大値(以下、VYmaxとする。)をボトム値とする。図5(c)に示した表示例は、この方法により特定されたMTminとVYmaxとを表示したものである。 Focusing on the above problems, in this embodiment, one representative received light amount is extracted from each of the light incident period and the non-light incident period, and the minimum value (hereinafter referred to as MT) of the representative light received amount in each light incident period is extracted. (Min .) is a peak value, and the maximum value (hereinafter referred to as VY max ) of the representative received light amount in the non-light-incidence period is a bottom value. The display example shown in FIG. 5C displays MT min and VY max specified by this method.

代表受光量は、検出処理に設定されているパルスカウント数Pに基づいて抽出される。具体的には、入光期間については、期間中の受光量を最大値から降順に並べた場合にP番目に位置する受光量が、代表受光量として抽出され、非入光期間については、期間中の受光量を最小値から昇順に並べた場合にP番目に位置する受光量が、代表受光量として抽出される。   The representative received light amount is extracted based on the pulse count number P set in the detection process. Specifically, for the light incident period, when the light reception amounts during the period are arranged in descending order from the maximum value, the Pth received light amount is extracted as the representative light reception amount. When the received light amounts are arranged in ascending order from the minimum value, the received light amount located at the Pth is extracted as the representative received light amount.

図8は、表示器101,102により図5(c)に示した表示を行うための処理の手順を示す。また、図9(A)は図8中の入光時処理(ステップS111)の詳細な手順を示し、図9(B)は図8中の非入光時処理(ステップS121)の詳細な手順を示す。また、図10は、入光期間中の代表受光量の特定に関わる受光量を格納するバッファの値が変化する例を示す。   FIG. 8 shows a processing procedure for performing the display shown in FIG. 9A shows the detailed procedure of the light incident process (step S111) in FIG. 8, and FIG. 9B shows the detailed procedure of the non-light incident process (step S121) in FIG. Indicates. FIG. 10 shows an example in which the value of the buffer that stores the received light amount related to the specification of the representative received light amount during the light incident period changes.

以下、これらの図を参照して、各代表受光量の表示処理について詳細に説明する。なお、この実施例では、あらかじめ定められた処理時間をT秒とし、制御部105内のタイマにより時間の経過をチェックする。   Hereinafter, the display processing of each representative received light amount will be described in detail with reference to these drawings. In this embodiment, a predetermined processing time is set to T seconds, and the passage of time is checked by a timer in the control unit 105.

図8において、最初のステップS101では、初期化処理を実施する。この初期化処理には、表示器101に表示されるピーク値MTmin、表示器102に表示されるボトム値VYmax、および2種類のバッファmt(i),vy(j)に初期値を設定する処理が含まれる。 In FIG. 8, in the first step S101, initialization processing is performed. In this initialization process, initial values are set for the peak value MT min displayed on the display device 101, the bottom value VY max displayed on the display device 102, and the two types of buffers mt (i) and vy (j). Processing is included.

MTminには、表示器101に表示可能な最大の値9999が初期値として格納され、VYmaxには表示器102に表示される最小の値0が初期値として格納される。
バッファmt(i)(i=1〜P)は、入光期間中の受光量を、最大値から降順にP番目まで格納するためのもので、初期値として0が格納される。vy(j)(j=1〜P)は、非入光期間中の受光量を、最小値から昇順にP番目まで格納するためのもので、初期値として9999が格納される。
In MT min , the maximum value 9999 that can be displayed on the display unit 101 is stored as an initial value, and in VY max , the minimum value 0 displayed on the display unit 102 is stored as an initial value.
The buffer mt (i) (i = 1 to P) stores the received light amount during the light incident period from the maximum value to the Pth in descending order, and 0 is stored as an initial value. vy (j) (j = 1 to P) is for storing the received light amount during the non-incident period from the minimum value to the Pth in ascending order, and 9999 is stored as an initial value.

初期化処理の後はタイマをリセットする(ステップS102)。その後は、クロックパルスに応じたタイミングで受光量Dを取得し(ステップS103)、取得した受光量Dをしきい値と比較して、入光か非入光かを判定する(ステップS104)。
図8では詳細を省略しているが、ステップS104では、検出処理時と同様のパルスカウント方式に従って、入光、非入光の切り替えを判別する。すなわち、ステップS103で取得した受光量Dがしきい値以上であれば、さらにしきい値以上となる受光量をP−1回続けて受光したことを確認して入光状態であると判定する。ステップS103で取得した受光量Dがしきい値より小さい場合も同様に、しきい値より小さい受光量をP−1回続けて受光したことを確認して非入光状態であると判定する。
After the initialization process, the timer is reset (step S102). Thereafter, the received light amount D is acquired at a timing according to the clock pulse (step S103), and the acquired received light amount D is compared with a threshold value to determine whether the light is incident or not (step S104).
Although details are omitted in FIG. 8, in step S <b> 104, switching between incident light and non-incident light is determined according to the same pulse count method as in the detection process. That is, if the received light amount D acquired in step S103 is equal to or greater than the threshold value, it is further determined that the received light amount that is equal to or greater than the threshold value is received P-1 times in succession and is in the incident light state. . Similarly, when the received light amount D acquired in step S103 is smaller than the threshold value, it is determined that the received light amount is smaller than the threshold value P-1 times continuously, and it is determined that the light is not incident.

なお、入光、非入光ともに、同じ状態がP回続くことなく別の状態に変動した場合(受光量Dがしきい値以上となる入光状態からしきい値より小さい非入光状態への変動、または非入光状態から入光状態への変動をいう。)には、さらに変動後の状態がP回続くか否かによって判定を行う。また、判定に用いられたP個の受光量は、作業用のバッファに一時保存される。   In the case where both the incident light and the non-incident light are changed to another state without continuing the same state P times (from the incident state where the received light amount D is equal to or greater than the threshold value to the non-incident state smaller than the threshold value). Or a change from a non-light incident state to a light incident state) is further determined by whether or not the state after the variation continues P times. The P received light amounts used for the determination are temporarily stored in the work buffer.

ステップS104において入光状態であると判定された場合には、ステップS111の入光時処理に移行し、非入光状態であると判定された場合には、ステップS121の非入光時処理に移行する。   If it is determined in step S104 that the light is incident, the process proceeds to the light incident process in step S111. If it is determined that the light is not incident, the process proceeds to the non-light incident process in step S121. Transition.

ここで、処理開始後の最初のステップS104で入光状態と判定されたものと仮定して、図9(A)および図10を参照して、入光時処理の詳細を説明する。
この処理は、直前に取得した受光量Dを、バッファmt(i)に格納されている値と比較し、バッファmt(i)よりDの方が大きい場合に、バッファmt(i)の書き換えを行うものである。
Here, assuming that the light incident state is determined in the first step S104 after the start of the process, details of the light incident process will be described with reference to FIG. 9A and FIG.
This process compares the received light amount D acquired immediately before with the value stored in the buffer mt (i), and when D is larger than the buffer mt (i), the buffer mt (i) is rewritten. Is what you do.

まず、ステップS11でi=Pとし、ステップS12で、直前の取得受光量Dをmt(i)と比較する。
i=PのときにD>mt(i)となると、ステップS12が「YES」、ステップS13が「NO」となり、ステップS15に進む。ステップS15では、mt(i)の現在値を破棄して、受光量Dをmt(i)に格納する。
First, i = P is set in step S11, and the immediately preceding acquired received light amount D is compared with mt (i) in step S12.
If D> mt (i) when i = P, step S12 becomes “YES”, step S13 becomes “NO”, and the process proceeds to step S15. In step S15, the current value of mt (i) is discarded and the received light amount D is stored in mt (i).

この後は、ステップS16からステップS17に進んで、iをディクリメントし(i=P−1)、ステップS12で、更新後のiにより特定されるバッファmt(i)に格納されている値と取得受光量Dとを比較する。この段階でもD>mt(i)となると、ステップS12およびこれに続くステップS13が共に「YES」となり、ステップS14に進む。   Thereafter, the process proceeds from step S16 to step S17, i is decremented (i = P-1), and in step S12, the value stored in the buffer mt (i) specified by the updated i is The acquired received light amount D is compared. At this stage, if D> mt (i), both step S12 and subsequent step S13 are “YES”, and the process proceeds to step S14.

ステップS14では、バッファmt(i+1)の現在値を破棄して、このバッファmt(i+1)にmt(i)の値を格納する。さらにステップS15に進み、受光量Dをmt(i)に格納する。   In step S14, the current value of the buffer mt (i + 1) is discarded, and the value of mt (i) is stored in this buffer mt (i + 1). In step S15, the received light amount D is stored in mt (i).

以下、iが1になるまで(ステップS16が「YES」)、上記と同様の処理を繰り返し実行するが、途中で受光量Dがmt(i)以下になった場合(ステップS12が「NO」)には、処理を終了する。   Thereafter, until i becomes 1 (“YES” in step S16), the same processing as described above is repeatedly executed. However, when the received light amount D becomes mt (i) or less in the middle (step S12 is “NO”). ) Terminates the process.

図10は、P=3として、3回の受光に対してそれぞれ入光時処理が行われた場合のバッファmt(1),mt(2),mt(3)に生じる値の変化を示す。
バッファmt(1),mt(2),mt(3)には、それぞれ初期値として0がセットされている。初期化後の最初の受光量Dが100であるとすると、mt(1),mt(2),mt(3)はいずれもDより小さくなるので、ステップS12〜S17のループが3回繰り返される。
FIG. 10 shows changes in values generated in the buffers mt (1), mt (2), and mt (3) when P = 3 and the light reception process is performed for three times of light reception.
In the buffers mt (1), mt (2), and mt (3), 0 is set as an initial value. Assuming that the initial received light amount D after initialization is 100, mt (1), mt (2), and mt (3) are all smaller than D, so the loop of steps S12 to S17 is repeated three times. .

最初のループでは、ステップS15によってmt(3)に100が格納される。2回目のループでは、ステップS14によってmt(2)の0がmt(3)に移動し、ステップS15によって、mt(2)に100が格納される。さらに、3回目のループでは、ステップS14によってmt(1)の0がmt(2)に移動し、ステップS15によってmt(1)に100が格納される。   In the first loop, 100 is stored in mt (3) in step S15. In the second loop, 0 of mt (2) is moved to mt (3) by step S14, and 100 is stored in mt (2) by step S15. Further, in the third loop, 0 in mt (1) is moved to mt (2) in step S14, and 100 is stored in mt (1) in step S15.

2回目の受光量Dが150であるとすると、上記と同様に、ステップS12〜S17のループが3回繰り返され、最初のループで、mt(3)に150が格納される。2回目のループでは、mt(2)の0がmt(3)に移動して、mt(2)に150が格納される。さらに3回目のループで、mt(1)の100がmt(2)に移動し、mt(1)に150が格納される。   Assuming that the second received light amount D is 150, similarly to the above, the loop of steps S12 to S17 is repeated three times, and 150 is stored in mt (3) in the first loop. In the second loop, 0 of mt (2) moves to mt (3), and 150 is stored in mt (2). Further, in the third loop, 100 of mt (1) moves to mt (2), and 150 is stored in mt (1).

3回目の受光量Dが80であるとすると、1回目のループで着目されるmt(3)にはDより小さい値0が格納されているので、ステップS15によりmt(3)に80が格納される。しかし、2回目のループでは、着目されるmt(2)にDより大きい値(100)が格納されているので、ステップS12の判定が「NO」となって処理が終了する。これにより、mt(2)やmt(1)の値は維持される。   If the amount of received light D for the third time is 80, a value 0 smaller than D is stored in mt (3) focused on in the first loop, so 80 is stored in mt (3) in step S15. Is done. However, in the second loop, since a value (100) greater than D is stored in mt (2) of interest, the determination in step S12 is “NO”, and the process ends. Thereby, the values of mt (2) and mt (1) are maintained.

上記のとおり、入光期間中の各受光量に対して入光時処理を行うことにより、受光量の中の最大値がバッファmt(1)に格納され、以下、2番目に高い受光量からP番目に高い受光量までの各受光量が、mt(2)・・・mt(P)に順に格納される。   As described above, by performing the light reception process for each light reception amount during the light reception period, the maximum value of the light reception amount is stored in the buffer mt (1), and from the second highest light reception amount below. The received light amounts up to the P-th highest received light amount are sequentially stored in mt (2)... Mt (P).

図9(B)に示す非入光時処理も、図9(A)の入光時処理と同様の流れで進行する。
簡単に説明すると、j=Pとして処理を開始し(ステップS21)、バッファvy(j)の値を取得受光量Dと比較して(ステップS22)、バッファvy(j)が取得受光量より小さい場合(ステップS22が「YES」)にはバッファvy(j)を取得受光量Dに書き換える(ステップS25)。またjがPより小さい場合には、ステップS25を実行する前にバッファvy(j)の値をvy(j+1)に移動させる(ステップS23,24)。
上記の処理を、jの値をディクリメントして続け(ステップS27)、jが1となった場合(ステップS26が「YES」)か、vy(j)が取得受光量D以下となった場合(ステップS22が「NO」)に、処理を終了する。
The non-light incident process shown in FIG. 9B also proceeds in the same flow as the light incident process of FIG. 9A.
Briefly, processing is started with j = P (step S21), the value of the buffer vy (j) is compared with the acquired received light amount D (step S22), and the buffer vy (j) is smaller than the acquired received light amount. In the case (“YES” in step S22), the buffer vy (j) is rewritten to the acquired received light amount D (step S25). If j is smaller than P, the value of the buffer vy (j) is moved to vy (j + 1) before executing step S25 (steps S23 and S24).
The above process is continued by decrementing the value of j (step S27), when j becomes 1 (“YES” at step S26), or when vy (j) becomes less than or equal to the acquired received light amount D (Step S22 is “NO”), the process is terminated.

上記のとおり、非入光期間中の各受光量に対して非入光時処理を行うことにより、受光量の中の最小値がバッファvy(1)に格納され、以下、2番目に低い受光量からP番目に低い受光量までの各受光量が、バッファvy(2)・・・vy(P)に順に格納される。   As described above, by performing the non-incidence process for each received light amount during the non-incident period, the minimum value of the received light amount is stored in the buffer vy (1). Each received light amount from the amount to the Pth lowest received light amount is sequentially stored in the buffers vy (2)... Vy (P).

図8に参照を戻す。
ステップS104での入光判定に応じた入光時処理(ステップS111)では、上記の判定に使用されたP個の受光量を順にDにセットして、図9(A)の処理を実行する。その後は、T秒が経過していないことを条件に(ステップS112が「NO」)、再び受光量を取得し(ステップS113)、その受光量Dにより非入光状態に切り替わったか否かを判定する。
Returning to FIG.
In the light incident process according to the light incident determination in step S104 (step S111), the P received light amounts used for the above determination are sequentially set to D, and the process of FIG. 9A is executed. . Thereafter, on the condition that T seconds have not elapsed ("NO" in step S112), the amount of received light is acquired again (step S113), and it is determined whether or not the light reception amount D has switched to the non-incident state. To do.

この判定でも、しきい値より小さい受光量がP回得られたことをもって、非入光状態に変化したと判定し、非入光状態になったと判定されるまではステップS111〜S114のループを繰り返す。これにより、入光期間中の各受光量に対して図9(A)に示した処理が実行され、受光量の山の頂点の受光量(最大受光量)から降順に数えてP番目に相当する受光量がバッファmt(P)に格納される。   Even in this determination, it is determined that the light receiving amount smaller than the threshold value is obtained P times, and it is determined that the light receiving state is changed, and the loop of steps S111 to S114 is performed until it is determined that the light receiving state is not reached. repeat. As a result, the processing shown in FIG. 9A is executed for each light reception amount during the light incident period, and corresponds to the Pth counting from the light reception amount (maximum light reception amount) at the peak of the light reception amount in descending order. The received light amount is stored in the buffer mt (P).

入光状態から非入光状態に切り替わると、ステップS111〜S114のループを終了してステップS115に進み、バッファmt(P)の値をMTminと比較する。ここでmt(P)<MTminであれば(ステップS115が「YES」)、mt(P)をMTminとする(ステップS116)。mt(P)がMTmin以上になる場合(ステップS115が「NO」)には、ステップS116はスキップされ、MTminの現在値が維持される。
この後は、バッファmt(i)(i=1〜P)を初期値の0に戻し(ステップS117)、ステップS121の非入光時処理に移行する。
When the light incident state is switched to the non-light incident state, the loop of steps S111 to S114 is terminated and the process proceeds to step S115, where the value of the buffer mt (P) is compared with MT min . If mt (P) <MT min (step S115 is “YES”), mt (P) is set to MT min (step S116). If mt (P) is equal to or greater than MT min (step S115 is “NO”), step S116 is skipped and the current value of MT min is maintained.
Thereafter, the buffer mt (i) (i = 1 to P) is returned to the initial value 0 (step S117), and the process proceeds to the non-light incident process of step S121.

ステップS121の非入光時処理でも、ステップS104またはステップS114の判定に用いられたP個の受光量を順にDにセットして、図9(B)の処理を実行する。その後は、T秒が経過しないことを条件に(ステップS122が「NO」)、再び受光量を取得し(ステップS123)、取得した受光量Dにより入光状態に切り替わったか否かを判定する(ステップS124)。   Even in the non-light incident process of step S121, the P received light amounts used in the determination of step S104 or step S114 are sequentially set to D, and the process of FIG. 9B is executed. Thereafter, on condition that T seconds have not elapsed ("NO" in step S122), the amount of received light is acquired again (step S123), and it is determined whether or not the light reception state is switched by the acquired amount of received light D (step S123). Step S124).

このステップS124でも、しきい値D以上の受光量をP回連続して受光するまでは、判定は「NO」となる。入光状態になったと判定されるまでステップS121〜S124のループを繰り返すことにより、非入光期間中の各受光量に対して図9(B)に示した処理が実行される。これにより、受光量の谷底(最小受光量)から昇順に数えてP番目に相当する受光量がバッファvy(P)に格納される。   Even in this step S124, the determination is “NO” until the amount of received light equal to or greater than the threshold value D is received P times consecutively. By repeating the loop of steps S121 to S124 until it is determined that the light enters, the processing shown in FIG. 9B is executed for each received light amount during the non-light incident period. Thus, the Pth received light amount counted in ascending order from the bottom of the received light amount (minimum received light amount) is stored in the buffer vy (P).

非入光状態から入光状態に切り替わると(ステップS124が「YES」)、ステップS125において、vy(P)をVYmaxと比較する。ここでvy(P)>VYmaxであれば(ステップS125が「YES」)、vy(P)をVYmaxとする(ステップS126)。一方、vy(P)がVYmax以下の場合(ステップS125が「NO」)には、ステップS126はスキップされる。
この後はバッファvy(j)(j=1〜P)を初期値の9999に戻し、ステップS111の入光時処理に移行する。なお、ステップS111でも、その移行のための判定に用いられたP個の受光量を順に対象として、図9(A)に示した処理を実行する。
When the non-light incident state is switched to the light incident state (“YES” in step S124), vy (P) is compared with VY max in step S125. If vy (P)> VY max (step S125 is “YES”), vy (P) is set to VY max (step S126). On the other hand, when vy (P) is equal to or less than VY max (step S125 is “NO”), step S126 is skipped.
Thereafter, the buffer vy (j) (j = 1 to P) is returned to the initial value of 9999, and the process proceeds to the light incident process in step S111. In step S111 as well, the process shown in FIG. 9A is executed for the P received light amounts used for the determination for the transition in order.

このように、毎回の受光量により入光状態と非入光状態との切り替わり時期を判別しながら、入光時処理を含むループ(S101〜104)と非入光時処理を含むループ(S111〜114)とを繰り返し実行する。これにより入光期間中の受光量群(受光量の山)毎に最大値から数えてP番目に高い受光量が代表受光量として抽出され、それらの代表受光量の中の最小値がMTminに格納される。また非入光期間中の受光量群(受光量の谷)毎に最小値から数えてP番目に低い受光量が代表受光量として抽出され、それらの代表受光量の中の最大値がVYmaxに格納される。 As described above, while determining the switching timing between the light incident state and the non-light incident state based on the amount of light received each time, the loop including the light incident time process (S101 to 104) and the loop including the non light incident time process (S111 to S111). 114). As a result, the P-th highest received light amount from the maximum value is extracted as the representative received light amount for each received light amount group (crest of received light amount) during the light incident period, and the minimum value among these representative received light amounts is MT min. Stored in In addition, the P-th lowest received light amount counted from the minimum value is extracted as the representative received light amount for each received light amount group (received light valley) during the non-incident period, and the maximum value among the representative received light amounts is VY max. Stored in

最終的に、タイマの計時時刻がT秒に達すると、ステップS112またはステップS122が「YES」となってステップS105に進み、その時点でのMTminをピーク値として表示器101に表示し、VYmaxをボトム値として表示器102に表示する。 Finally, when the time measured by the timer reaches T seconds, step S112 or step S122 becomes “YES” and the process proceeds to step S105, where MT min at that time is displayed as a peak value on the display 101, and VY Max is displayed on the display 102 as a bottom value.

図8では、上記の表示をもって処理終了となるが、以後は、適宜、MTmin,VYmaxを表示する状態と図5(b)に示した表示とを切り換えながら、ユーザの操作に待機する。ユーザにより、アップスイッチSW2またはダウンスイッチSW3が操作されると、処理を終了し、しきい値を表示する状態(図5の(d))に移行する。 In FIG. 8, the process ends with the above display. Thereafter, the process waits for a user operation while appropriately switching between the state of displaying MT min and VY max and the display shown in FIG. When the user operates the up switch SW2 or the down switch SW3, the process ends, and the state shifts to a state in which a threshold value is displayed ((d) in FIG. 5).

なお、上記の処理では、ピーク値MTminやボトム値VYmaxの表示に合わせて、これらの値を外部機器に出力することもできる。またセンサの本体部に表示部がない場合でも、特定されたMTmin,VYmaxを外部機器に出力し、外部のモニタで各値を表示することが可能である。 In the above processing, these values can be output to an external device in accordance with the display of the peak value MT min and the bottom value VY max . Even when the sensor main body does not have a display unit, it is possible to output the specified MT min and VY max to an external device and display each value on an external monitor.

図8の例では、ピーク値MTminおよびボトム値VYmaxを特定する処理を1回としたが、これに限らず、しきい値を設定するための操作が行われるまで図8に示した処理を繰り返すことにより、ピーク値およびボトム値の値の表示が周期的に更新されるようにしてもよい。また、この処理の周期の長さ(T秒間のT)を、ユーザの設定操作に応じて変更できるようにしてもよい。さらに、表示の更新に合わせて、各値を外部に出力したり、メモリ106に保存してもよい。
このようにすれば、ワークが高速で移動するためにその移動に伴う受光量の変化を直接認識するのが困難な場合でも、表示されるピーク値およびボトム値のばらつきの度合いに基づき、ワークの移動に伴い生じる受光量のおよその変化を知ることができる。
In the example of FIG. 8, the processing for specifying the peak value MT min and the bottom value VY max is performed once. However, the processing is not limited to this, and the processing illustrated in FIG. 8 is performed until an operation for setting a threshold value is performed. By repeating the above, the display of the peak value and the bottom value may be periodically updated. Further, the length of the processing cycle (T for T seconds) may be changed according to the user's setting operation. Furthermore, each value may be output to the outside or stored in the memory 106 in accordance with the display update.
In this way, even if it is difficult to directly recognize the change in the amount of received light due to the movement of the workpiece at a high speed, the workpiece can be detected based on the degree of variation in the displayed peak and bottom values. It is possible to know an approximate change in the amount of received light that accompanies the movement.

上記図8および図9に示した処理によれば、T秒間に生じた受光量の山や谷の中で、現在のしきい値に対する余裕度が最も小さい山および谷から抽出された代表受光量が、ピーク値およびボトム値として表示される。また、サンプリングされた各受光量により実際に検出を行うとした場合に、入光状態と非入光状態との切り替わりの判定に必要となる受光量データの中で最もしきい値に近い値が、ピーク値およびボトム値として特定される。   According to the processing shown in FIGS. 8 and 9, the representative received light amount extracted from the peaks and valleys having the smallest margin with respect to the current threshold value among the peaks and valleys of the received light amount generated during T seconds. Are displayed as a peak value and a bottom value. In addition, when detection is actually performed based on each sampled received light amount, the value closest to the threshold value among the received light amount data necessary for determining the switching between the light incident state and the non-light incident state is , Specified as a peak value and a bottom value.

よって、ユーザは、表示されたピーク値およびボトム値の双方に対して余裕度のある値(たとえばピーク値とボトム値との中間値)を、しきい値の適正値であると判定し、切替操作に応じて表示されたしきい値(図5(d)参照)が適正値に近い値であれば、検出処理を安定して実行することが可能であると解釈する。一方、しきい値の適正値と表示されたしきい値との間に大きな差がある場合には、しきい値が偏った設定になっており、しきい値を変更する必要があることがわかる。   Therefore, the user determines that a value having a margin with respect to both the displayed peak value and bottom value (for example, an intermediate value between the peak value and the bottom value) is an appropriate value of the threshold value, and switches the value. If the threshold value displayed according to the operation (see FIG. 5D) is a value close to the appropriate value, it is interpreted that the detection process can be stably executed. On the other hand, if there is a large difference between the appropriate threshold value and the displayed threshold value, the threshold value is biased and it may be necessary to change the threshold value. Recognize.

なお、図8および図9に示した処理によれば、しきい値が高すぎたために、しきい値以上の受光量をP回続けて受光することができなかった場合には、入光時処理が一度も行われず、その結果、MTminが0となる。また、しきい値が低すぎて、しきい値より小さい受光量をP回続けて受光することができなかった場合には、非入光時処理が一度も行われず、その結果、VYmaxが9999となる。このような結果になった場合のステップS105では、MTmin,VYmaxの表示後、またはこの表示と交互に、エラー表示を行って、しきい値の変更を促すのが望ましい。 According to the processing shown in FIG. 8 and FIG. 9, when the threshold value is too high and the amount of received light exceeding the threshold value cannot be continuously received P times, The process is never performed, and as a result, MT min becomes zero. Further, when the threshold value is too low and the received light amount smaller than the threshold value cannot be continuously received P times, the non-light incident process is not performed at all, and as a result, VY max is 9999. In step S 105 when such a result is obtained, it is desirable to prompt an error display by displaying an error after displaying MT min and VY max or alternately with this display.

一方で、パルスカウント数Pの値が比較的小さい(たとえば、図6の最速モードの場合のP=2)場合や、パルスカウント方式の検出処理を実施しない場合には、各入光期間の最大受光量の中の最も小さい値をピーク値とし、各非入光期間の最小受光量の中の最も大きい値をボトム値として、それぞれ表示してもよい。   On the other hand, when the value of the pulse count number P is relatively small (for example, P = 2 in the case of the fastest mode in FIG. 6) or when the detection process of the pulse count method is not performed, the maximum of each light incident period The smallest value in the amount of received light may be displayed as the peak value, and the largest value in the minimum amount of received light in each non-light incident period may be displayed as the bottom value.

また、上記実施例では、各入光期間および各非入光期間の代表受光量を期間の種類毎に比較し、入光期間の代表受光量の中の最小値をピークとし、非入光期間の代表受光量の中の最大値とボトム値としたが、ピーク値およびボトム値を特定するための方法は、これに限定されるものではない。たとえば、入光期間について、最大受光量からP番目に高い受光量までの各受光量の平均値を算出し、この平均値が最小となる入光期間の代表受光量をピーク値として特定してもよい。非入光期間についても、最小受光量からP番目に低い受光量までの各受光量の平均値を算出し、この平均値が最大となる非入光期間の代表受光量をボトム値として特定してもよい。   Further, in the above embodiment, the representative received light amount in each light incident period and each non-light incident period is compared for each type of period, the minimum value in the representative light received amount in the light incident period is a peak, and the non-light incident period Although the maximum value and the bottom value in the representative received light amount are set, the method for specifying the peak value and the bottom value is not limited to this. For example, for the light incident period, the average value of each received light amount from the maximum received light amount to the Pth highest received light amount is calculated, and the representative received light amount of the light incident period in which this average value is minimum is specified as the peak value. Also good. For the non-light-incident period, the average value of each received light quantity from the minimum received light quantity to the Pth lowest received light quantity is calculated, and the representative received light quantity of the non-light-incident period in which this average value is maximum is specified as the bottom value. May be.

また、上記の実施例では、あらかじめ定めたT秒間の受光量の中から、表示対象のピーク値およびボトム値を特定したが、処理の期間を定めることなく、処理開始後にMTminおよびVYmaxの値が初めて特定されたことに応じてこれらを表示し、以後、MTminまたはVYmaxの値が更新される都度、それに応じて表示を更新してもよい。
この場合には、ユーザは、ピーク値およびボトム値の表示が安定したことをもって、それらに基づき、しきい値の適正値を判別することができる。
Further, in the above embodiment, the peak value and the bottom value of the display target are specified from the predetermined amount of light received for T seconds. However, without specifying the processing period, MT min and VY max are set after the processing is started. These may be displayed in response to the first specification of values, and thereafter the display may be updated accordingly whenever the value of MT min or VY max is updated.
In this case, the user can determine the appropriate threshold value based on the stable display of the peak value and the bottom value.

またパルスカウント方式の検出処理の精度を重視するために、受光量のばらつきを把握したい場合には、図11に示すような処理により、入光期間と非入光期間とが切り替わる都度、その切り替えの直前の期間の代表受光量により表示を更新してもよい。   Further, in order to emphasize the accuracy of the detection processing of the pulse count method, when it is desired to grasp the variation in the amount of received light, the switching is performed every time the light incident period and the non-light incident period are switched by the process shown in FIG. The display may be updated with the representative light reception amount in the period immediately before.

図11の処理について説明する。なお、この実施例では、ピーク値をMT、ボトム値をVYとする。
最初のステップS201の初期化処理では、入光期間中の受光量を格納するためのバッファmt(i)(i=1〜P)に0を格納し、非入光期間中の受光量を格納するためのバッファvy(j)(j=1〜P)に9999を格納する。
The process of FIG. 11 will be described. In this embodiment, the peak value is MT and the bottom value is VY.
In the initialization process of the first step S201, 0 is stored in the buffer mt (i) (i = 1 to P) for storing the received light amount during the light incident period, and the received light amount during the non-light incident period is stored. 9999 is stored in the buffer vy (j) (j = 1 to P).

つぎに受光量Dを取得し(ステップS202)、入光、非入光のいずれになるかを判定する。この実施例でも、同じ受光状態がP回続いたことをもって、判定を確定するようにしており、入光と判定された場合には、その判定に用いられたP個の受光量を順に対象にして、ステップS211の入光時処理を実行する。非入光と判定された場合にも同様に、その判定に用いられたP個の受光量を順に対象にして、ステップS221の非入光時処理を実行する。なお、ステップS211の具体的手順は図9(A)に示したものと同様であり、ステップS221の具体的手順は図9(B)に示したものと同様である。   Next, the received light amount D is acquired (step S202), and it is determined whether the light is incident or not. Also in this embodiment, the determination is confirmed when the same light receiving state continues P times, and when it is determined that the light is incident, the P received light amounts used for the determination are sequentially targeted. In step S211, the incident light process is executed. Similarly, when it is determined that the light is not incident, the P light reception amount used in the determination is sequentially processed, and the non-light incident process in step S221 is executed. The specific procedure of step S211 is the same as that shown in FIG. 9A, and the specific procedure of step S221 is the same as that shown in FIG. 9B.

入光時処理(ステップS211)の後は、再び受光量Dを取得し(ステップS212)、その受光量Dにより入光状態が続いていると判定した場合(ステップS213が「NO」)には、新たに取得した受光量Dを対象として、再び入光時処理(ステップS211)を実行する。以下、同様に、非入光状態に切り替わったと判定されるまで(ステップS213が「YES」)、受光量Dの取得と入光時処理とが繰り返される。   After the light incident process (step S211), the received light amount D is acquired again (step S212), and when it is determined that the light incident state continues with the received light amount D (step S213 is “NO”). Then, the light reception process (step S211) is executed again for the newly received light reception amount D as a target. Hereinafter, similarly, the acquisition of the received light amount D and the process during incident light are repeated until it is determined that the light incident state has been switched (“YES” in step S213).

上記一連の処理により、入光状態から非入光状態に切り替わったとき(ステップS213が「YES」)のバッファmt(P)には、入光期間中で最大受光量から数えてP番目に高い受光量が格納される。ステップS214では、このmt(P)の値をMTとし、ステップS215ではバッファmt(i)を初期値のゼロに戻す。さらにステップS216では、MTをピーク値として表示器101に表示する。   The buffer mt (P) when switched from the light incident state to the non-light incident state by the above-described series of processing (step S213: “YES”) is Pth higher than the maximum received light amount during the light incident period. The amount of received light is stored. In step S214, the value of mt (P) is set to MT, and in step S215, the buffer mt (i) is returned to the initial value of zero. Further, in step S216, MT is displayed on the display unit 101 as a peak value.

ステップS203で非入光と判定されて非入光時処理(ステップS221)が行われた場合も、同様に、入光状態に切り替わったと判定されるまで、受光量Dを取得する処理(ステップS222)と非入光時処理(ステップS221)とを繰り返す。この一連の処理により、非入光状態から入光状態に切り替わったと判定されたとき(ステップS223が「YES」)に、非入光期間の受光量の中で最大値から数えてP番目に低い受光量がバッファvy(P)に格納される。ステップS224では、このvy(P)の値をVYとし、ステップS225では、バッファvy(j)を初期値の9999に戻す。さらにステップS226では、VYをボトム値として表示器102に表示する。 Even in the case where it is determined that light is not incident in step S203 and the non-light incident process (step S221) is performed, similarly, the process of acquiring the received light amount D until it is determined that the light incident state is switched (step S222). ) And non-light incident processing (step S221) are repeated. By this series of processing, when it is determined that the light incident state is switched to the light incident state (step S223 is “YES”), the light reception amount in the non-light incident period is Pth lower than the maximum value. The amount of received light is stored in the buffer vy (P). In step S224, the value of vy (P) is set to VY, and in step S225, the buffer vy (j) is returned to the initial value 9999. In step S226, VY is displayed on the display unit 102 as a bottom value.

以下、同様に、表示部100の表示を切り替える操作が行われるまで(ステップS217が「YES」)、入光と非入光との切り替わりを判別しながら、ステップS211〜216またはステップS221〜S226を実行する。所定のタイミングでユーザによる切り替え操作が行われると、ステップS217が「YES」となり、処理を終了する。
なお、ステップS211,S223でも、それぞれ非入光状態、入光状態がP回続いたことをもって、「YES」判定となり、それぞれの判定を受けたステップS211,S221では、判定に用いられたP個の受光量を順に処理対象とする。
Hereinafter, similarly, until an operation for switching the display of the display unit 100 is performed (“YES” in step S217), steps S211 to 216 or steps S221 to S226 are performed while discriminating switching between incident light and non-incident light. Run. If a switching operation is performed by the user at a predetermined timing, step S217 is “YES”, and the process is terminated.
In steps S211, S223, the determination of “YES” is made when the non-light incident state and the light incident state have continued P times. In steps S211 and S221 that have received the respective determinations, the P number used for the determination is determined. Are sequentially processed.

図11に示した処理によれば、受光量の山毎に、その山を検出するために最低限確保すべき受光量の中で現在のしきい値に最も近い値(P番目に高い受光量)が抽出され、ピーク値として表示される。また、受光量の谷毎に、その谷を検出するために最低限確保すべき受光量の中で現在のしきい値に最も近い値(P番目に低い受光量)が抽出され、ボトム値として表示される。したがって、ユーザは、毎回の表示により受光量の山と谷とのばらつきを把握すると共に、各値のしきい値に対する余裕度に基づき、現在のしきい値の適否を判別することができる。   According to the processing shown in FIG. 11, for each peak of received light amount, a value (P-th highest received light amount) closest to the current threshold value among the minimum received light amount for detecting the peak. ) Are extracted and displayed as peak values. In addition, for each valley of the amount of received light, a value closest to the current threshold value (Pth lowest received amount) is extracted from the minimum amount of received light that should be secured in order to detect the valley, and is used as the bottom value. Is displayed. Therefore, the user can grasp the variation between the peaks and valleys of the received light amount by displaying each time, and can determine whether the current threshold value is appropriate based on the margin of each value with respect to the threshold value.

なお、図11に示した方法でピーク値MTおよびボトム値VYを特定する場合には、これらを表示する処理に代えて、または表示と共に、毎回のMT,VYの値をメモリ106に蓄積し、蓄積された各値を所定のタイミングで外部機器に出力してもよい。または、新たなピーク値MTや新たなボトム値VYを得る都度、その値を直ちに外部機器に出力してもよい。このようにすれば、毎回のピーク値MTやボトム値VYを時系列に並べて表示するなど、各値のばらつき度合いやしきい値との関係の詳細な分析に適した処理を行うことが可能になる。   When the peak value MT and the bottom value VY are specified by the method shown in FIG. 11, the values of MT and VY for each time are stored in the memory 106 instead of or together with the process of displaying them. Each accumulated value may be output to an external device at a predetermined timing. Alternatively, every time a new peak value MT or a new bottom value VY is obtained, the value may be immediately output to an external device. In this way, it is possible to perform processing suitable for detailed analysis of the degree of variation of each value and the relationship with the threshold, such as displaying the peak value MT and the bottom value VY in each time series. Become.

また、図8や図11の処理に先立ち設定されるしきい値は、チューニング処理により設定されるものに限らず、メモリ106にデフォルトで登録されているしきい値を用いてもよい。   Further, the threshold value set prior to the processing of FIGS. 8 and 11 is not limited to that set by the tuning process, and a threshold value registered in the memory 106 by default may be used.

つぎに、これまでに示した実施例では、あらかじめしきい値が設定されていることを前提にして、そのしきい値に基づき入光期間と非入光期間との切り替わりを判別しながら、ピーク値およびボトム値を特定したが、事前にしきい値を設定することなく、一定の時間内に得られた受光量の中から、ピーク値およびボトム値となる代表受光量を抽出することも可能である。その場合の処理を、図12を参照して説明する。   Next, in the embodiments shown so far, on the assumption that a threshold value has been set in advance, the peak value is determined while determining the switching between the light incident period and the non-light incident period based on the threshold value. Although the threshold value and bottom value are specified, it is possible to extract the representative received light amount that will be the peak value and bottom value from the received light amount obtained within a certain time without setting the threshold value in advance. is there. Processing in that case will be described with reference to FIG.

この処理でも、2種類のバッファmt(i),vy(j)によりそれぞれP個の受光量を保存するようにしている。ステップS301の初期化処理では、先の各例と同様に、バッファmt(i)に0を格納し、バッファvy(j)に9999を格納する。   Also in this processing, P received light amounts are stored by two types of buffers mt (i) and vy (j), respectively. In the initialization process in step S301, 0 is stored in the buffer mt (i) and 9999 is stored in the buffer vy (j), as in the previous examples.

つぎに、内部のタイマをリセットし(ステップS302)、クロックパルスに応じて受光量を取得し(ステップS303)、この受光量に対し、入光時処理(ステップS304)と非入光時処理(ステップS305)とを順に実行する。各処理の詳細手順は、それぞれ図9(A),図9(B)に示したものと同様である。   Next, the internal timer is reset (step S302), the amount of received light is acquired in accordance with the clock pulse (step S303), and light incident processing (step S304) and non-light incident processing (step S304). Step S305) is executed in order. Detailed procedures of each process are the same as those shown in FIGS. 9A and 9B, respectively.

この後も、あらかじめ定めたT1秒が経過していないことを条件に(ステップS306が「NO」)、新たな受光量を取得し(ステップS303)、この受光量を対象にして、入光時処理(ステップS304)と非入光時処理(ステップS305)とを実行する。これにより、バッファmt(i)においては、P個の受光量が最大値を先頭に降順に整列し、バッファmt(j)においては、P個の受光量が最小値を先頭に昇順に整列する。   Thereafter, on the condition that the predetermined T1 seconds have not elapsed (“NO” in step S306), a new received light amount is acquired (step S303), and the received light amount is set as the target at the time of light incident. Processing (step S304) and non-light incident processing (step S305) are executed. Thereby, in the buffer mt (i), the P received light amounts are arranged in descending order with the maximum value at the top, and in the buffer mt (j), the P received light amounts are arranged in ascending order with the minimum value at the top. .

T1秒が経過すると(ステップS306が「YES」)、ステップS307に進み、バッファmt(P)の値をピーク値として表示器101に表示し、バッファvy(P)の値をボトム値として表示器102に表示する。   When T1 seconds have elapsed ("YES" in step S306), the process proceeds to step S307, where the value of the buffer mt (P) is displayed on the display unit 101 as a peak value, and the value of the buffer vy (P) is displayed as a bottom value. 102.

図8の実施例によれば、1つのワークの通過にかかる時間に応じてT1の値を決めることにより、受光量の山と谷とを1つずつ発生させて、山の中で最大値から数えてP番目に高い受光量をピーク値とし、谷の中で最小値から数えてP番目に低い受光量をボトム値として、それぞれ表示することができる。よって、これらの値の関係に基づき、しきい値として適切な値を設定することができる。   According to the embodiment of FIG. 8, by determining the value of T1 according to the time taken to pass one workpiece, one peak and one valley of the received light amount are generated, and the maximum value in the peak is obtained. The Pth highest received light amount can be displayed as a peak value, and the Pth lowest received light amount counted from the minimum value in the valley can be displayed as a bottom value. Therefore, an appropriate value can be set as the threshold based on the relationship between these values.

図8の実施例でも、ピーク値およびボトム値の表示を1回にとどめずに、ワークの通過に応じてステップS301〜S307の手順を繰り返すようにすれば、図7の例と同様に、ワーク毎のピーク値とボトム値とのばらつきを確認することができる。また、この実施例でも、毎回のピーク値およびボトム値をメモリ106に蓄積したり、外部機器に出力することが可能である。また、検出処理のために設定されているしきい値を変更することを検討する場合にも、変更後の値として仮設定されたしきい値により入光状態と非入光状態との切り替わりを判別しながら、ピーク値およびボトム値を求め、表示や出力を行うことができる。   In the embodiment of FIG. 8 as well, if the procedure of steps S301 to S307 is repeated according to the passage of the workpiece without displaying the peak value and the bottom value only once, the workpiece is similar to the example of FIG. The variation between the peak value and the bottom value can be confirmed. Also in this embodiment, it is possible to accumulate the peak value and the bottom value every time in the memory 106 or output them to an external device. In addition, when considering changing the threshold value set for detection processing, switching between the light incident state and the non-light incident state is performed depending on the threshold value temporarily set as the changed value. While determining, the peak value and the bottom value can be obtained and displayed or output.

1 光電センサ
100 表示部
101,102 表示器
110 操作部
103 投光部
104 受光部
105 制御部(CPU)
106 メモリ
DESCRIPTION OF SYMBOLS 1 Photoelectric sensor 100 Display part 101,102 Display device 110 Operation part 103 Light projection part 104 Light reception part 105 Control part (CPU)
106 memory

Claims (8)

検出のための光を投光する投光部と、
投光動作に応じて受光処理を行って受光量データを出力する受光部と、
受光部からの受光量データを取得する処理と取得した受光量データが示す受光量をしきい値と比較することにより入光状態および非入光状態のいずれであるかを判別する処理とを繰り返すと共に、この判別の結果が切り替わったとき、切り替え後と同じ判別結果を得る受光量データをP回(P≧2)続けて取得したことを条件として、判別結果を示す出力を切り替える検出手段と、
現在設定されているしきい値により入光状態と判別される受光量を示す受光量データがP個以上得られる入光期間を複数対象として、対象の入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最小値を当該入光期間における代表受光量として特定し、前記現在設定されているしきい値により非入光状態と判別される受光量を示す受光量データがP個以上得られる非入光期間を複数対象として、対象の非入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最大値を当該非入光期間における代表受光量として特定する第1の代表受光量特定手段と、
前記複数の入光期間のそれぞれにつき第1の代表受光量特定手段が特定した代表受光量の中の最小値を入光状態を表す代表受光量として特定し、前記複数の非入光期間のそれぞれにつき第1の代表受光量特定手段が特定した代表受光量の中の最大値を非入光状態を表す代表受光量として特定する第2の代表受光量特定手段と、
前記第2の代表受光量特定手段により特定された2つの代表受光量を示す情報を、各代表受光量の表示のために出力する出力手段とを、
具備する光電センサ。
A light projecting unit that projects light for detection;
A light receiving unit that performs light reception processing according to the light projecting operation and outputs received light amount data ;
The process of acquiring the received light amount data from the light receiving unit and the process of determining whether the light incident state or the non-light incident state by comparing the received light amount indicated by the acquired received light amount data with a threshold value are repeated. In addition, when the result of this determination is switched, detection means for switching the output indicating the determination result on condition that the received light amount data for obtaining the same determination result as after the switching is acquired P times (P ≧ 2),
A plurality of incident periods in which P or more received light amount data indicating the amount of received light that is determined to be the incident light state by the currently set threshold value are obtained are obtained during each incident period of the object. The minimum value among the received light amounts indicated by the P received light amount data is specified as the representative received light amount in the light incident period, and indicates the received light amount that is determined as the non-light incident state by the currently set threshold value. For a plurality of non-light incident periods in which P or more received light quantity data are obtained , the maximum value among the received light quantities indicated by the P received light quantity data acquired during each target non-light incident period First representative received light amount specifying means for specifying the representative received light amount in the light incident period;
For each of the plurality of light incident periods, a minimum value among the representative light reception amounts specified by the first representative light reception amount specifying means is specified as a representative light reception amount representing a light incident state, and each of the plurality of non-light incident periods is specified. Second representative received light amount specifying means for specifying a maximum value among the representative received light amounts specified by the first representative received light amount specifying means as a representative received light amount representing a non-light incident state;
Output means for outputting information indicating the two representative received light amounts specified by the second representative received light amount specifying means for displaying each representative received light amount;
Photoelectric sensor provided .
前記第1の代表受光量特定手段は、前記複数の入光期間毎に、その入光期間内に取得した受光量データが示す受光量を大きさの降順に並べた場合にP番目に位置する受光量を当該入光期間における代表受光量として特定し、前記複数の非入光期間毎に、その非入光期間内に取得した受光量データが示す受光量を大きさの昇順に並べた場合にP番目に位置する受光量を当該非入光期間における代表受光量として特定する、請求項1に記載された光電センサ。 The first representative received light amount specifying means is positioned at the Pth when the received light amounts indicated by the received light amount data acquired during the light incident period are arranged in descending order of the size for each of the plurality of light incident periods. When the received light amount is specified as the representative received light amount in the light incident period, and the received light amount indicated by the received light amount data acquired in the non-light incident period is arranged in ascending order of size for each of the plurality of light incident periods The photoelectric sensor according to claim 1, wherein the Pth received light amount is specified as a representative received light amount in the non-light incident period . 前記第2の代表受光量特定手段は、あらかじめ定めた一定時間内に生じた複数の入光期間のそれぞれに対して第1の代表受光量特定手段が特定した代表受光量の中の最小値を前記入光状態を表す代表受光量として特定し、前記一定時間内に生じた複数の非入光期間のそれぞれに対して第1の代表受光量特定手段が特定した代表受光量の中の最大値を前記非入光状態を表す代表受光量として特定する、請求項1または2に記載された光電センサ。 The second representative received light amount specifying means calculates a minimum value among the representative received light amounts specified by the first representative received light amount specifying means for each of a plurality of light incident periods that occur within a predetermined time period. The maximum value among the representative received light amounts specified by the first representative received light amount specifying means for each of a plurality of non-incident periods that occur within the predetermined time, specified as the representative received light amount representing the light incident state The photoelectric sensor according to claim 1 , wherein the light receiving amount is specified as a representative light receiving amount representing the non-light incident state. 前記第1の代表受光量特定手段は、前記受光部からの受光量データが示す受光量を前記しきい値と比較して入光期間と非入光期間との切り替わりを判別しつつ、各期間における代表受光量を特定し、
前記第2の代表受光量特定手段は、入光期間から非入光期間への切り替わりが生じる都度、その直前の入光期間から遡る過去の複数の入光期間に対して第1の代表受光量特定手段が特定した代表受光量の中の最小値を前記入光状態を表す代表受光量として特定し、前記非入光期間から入光期間への切り替わりが生じる都度、その直前の非入光期間から遡る過去の複数の非入光期間に対して第1の代表受光量特定手段が特定した代表受光量の中の最大値を前記非入光状態を表す代表受光量として特定する、請求項1または2に記載された光電センサ。
The first representative received light amount specifying means compares the received light amount indicated by the received light amount data from the light receiving unit with the threshold value, and determines the switching between the light incident period and the non-light incident period. Identify the amount of representative light received at
The second representative light amount specifying means, input each time the light period to the non-light incident period switching occurs, the first representative light receiving quantity with respect to a plurality of past light incident period dating back from the light incident period immediately before identify minimum value of the representative light receiving quantity that certain means identified as the representative light receiving quantity representing the entering-light state, the each time switched from the non-light incident period to the light entry period occurs, the non-light incident period immediately before identifying a maximum value in the first representative light receiving quantity specifying means has specified the representative light receiving quantity with respect to a plurality of non-light incident period in the past as the representative light receiving quantity representing the non-light incidence state dating back from claim 1 Or the photoelectric sensor described in 2 .
請求項1に記載された光電センサにおいて、
前記Pの値が異なる複数の検出モードのうちの1つを選択する操作を受け付けて、選択された検出モードによるPの値を前記検出手段に設定する設定手段を、さらに具備する光電センサ。
The photoelectric sensor according to claim 1,
A photoelectric sensor further comprising setting means for accepting an operation of selecting one of a plurality of detection modes having different values of P and setting the value of P according to the selected detection mode in the detection means .
前記出力手段は、前記第2の代表受光量特定手段により特定された2つの代表受光量を表示するための表示部を含む、請求項1に記載された光電センサ。 2. The photoelectric sensor according to claim 1, wherein the output unit includes a display unit for displaying two representative received light amounts specified by the second representative received light amount specifying unit. 請求項1に記載された光電センサにおいて、
しきい値を変更する操作を行うための操作部と、
前記第2の代表受光量特定手段により特定された2つの代表受光量の表示に連動させて前記検出手段の判別処理のために設定されているしきい値が表示されるように当該しきい値を出力し、この出力による表示が行われている状態下で操作部による操作に応じてしきい値を変更するしきい値変更手段とを、さらに具備する光電センサ。
The photoelectric sensor according to claim 1,
An operation unit for performing an operation of changing the threshold;
The threshold value is set so that the threshold value set for the discrimination process of the detection means is displayed in conjunction with the display of the two representative light reception quantities specified by the second representative received light quantity specifying means. And a threshold value changing means for changing the threshold value according to an operation by the operation unit in a state where display is performed by this output.
検出のための光を投光する投光部と、投光動作に応じて受光処理を行って受光量データを出力する受光部と、受光部からの受光量データを取得する処理と取得した受光量データが示す受光量をしきい値と比較することにより入光状態および非入光状態のいずれであるかを判別する処理とを繰り返すと共に、この判別の結果が切り替わったとき、切り替え後と同じ判別結果を得る受光量データをP回(P≧2)続けて取得したことを条件として、判別結果を示す出力を切り替える検出手段とを具備する光電センサを対象に、当該センサの受光状態を確認する作業を支援するための方法であって、
前記光電センサに現在設定されているしきい値により入光状態と判別される受光量を示す受光量データがP個以上得られる入光期間を複数対象として、対象の入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最小値を当該入光期間における代表受光量として特定し、前記現在設定されているしきい値により非入光状態と判別される受光量を示す受光量データがP個以上得られる非入光期間を複数対象として、対象の非入光期間毎にその期間中に取得したP個の受光量データが示す受光量の中の最大値を当該非入光期間における代表受光量として特定し、
前記複数の入光期間のそれぞれにおける代表受光量の中の最小値を入光状態を表す代表受光量として特定して表示し、前記複数の非入光期間のそれぞれにおける代表受光量の中の最大値を非入光状態を表す代表受光量として特定して表示することを特徴とする、光電センサの受光状態を確認する作業の支援方法。
A light projecting unit that emits light for detection, a light receiving unit that performs light reception processing according to the light projecting operation and outputs light reception amount data, a process for obtaining light reception amount data from the light receiving unit, and the received light reception When the result of this determination is switched, the process is the same as after switching, while repeating the process of determining whether the light incident state or non-light incident state by comparing the amount of light received indicated by the amount data with a threshold value. Confirming the light reception state of the sensor for a photoelectric sensor having detection means for switching the output indicating the discrimination result on condition that the received light amount data for obtaining the discrimination result is acquired P times (P ≧ 2) continuously. A method for supporting the work to be performed,
A plurality of incident periods in which P or more received light amount data indicating the amount of received light that is determined to be an incident state based on a threshold value currently set in the photoelectric sensor are obtained , and the period for each incident period of light. The minimum value among the received light amounts indicated by the P received light amount data acquired therein is specified as the representative received light amount in the light incident period, and is determined as a non-light incident state based on the currently set threshold value. For a plurality of non-light incident periods in which P or more received light quantity data indicating the received light quantity are obtained, the maximum of the received light quantities indicated by the P received light quantity data acquired during each target non-light incident period Specify the value as the representative received light amount in the non-light-incidence period,
The minimum value among the representative received light amounts in each of the plurality of light incident periods is specified and displayed as the representative received light amount representing the light incident state, and the maximum of the representative received light amounts in each of the plurality of non-light incident periods is displayed. A method for supporting a work for confirming a light receiving state of a photoelectric sensor, characterized in that a value is specified and displayed as a representative light receiving amount representing a non-light incident state.
JP2011262536A 2011-11-30 2011-11-30 PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR Active JP5152397B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2011262536A JP5152397B1 (en) 2011-11-30 2011-11-30 PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR
PCT/JP2012/056105 WO2013080577A1 (en) 2011-11-30 2012-03-09 Photoelectric sensor and method for assisting task of checking state of light reception by photoelectric sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011262536A JP5152397B1 (en) 2011-11-30 2011-11-30 PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR

Publications (2)

Publication Number Publication Date
JP5152397B1 true JP5152397B1 (en) 2013-02-27
JP2013113795A JP2013113795A (en) 2013-06-10

Family

ID=47890604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011262536A Active JP5152397B1 (en) 2011-11-30 2011-11-30 PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR

Country Status (2)

Country Link
JP (1) JP5152397B1 (en)
WO (1) WO2013080577A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111479100A (en) * 2020-04-02 2020-07-31 深圳臻像科技有限公司 Calibration method of three-dimensional display system projector

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4009838B2 (en) * 2002-09-11 2007-11-21 オムロン株式会社 Photoelectric sensor
JP4129768B2 (en) * 2003-10-02 2008-08-06 株式会社山武 Detection device
JP4175240B2 (en) * 2003-11-05 2008-11-05 株式会社山武 Detection device
JP2006080896A (en) * 2004-09-09 2006-03-23 Keyence Corp Detection switch, photoelectronic switch and detecting method
JP4023621B2 (en) * 2005-01-18 2007-12-19 株式会社キーエンス Photoelectric switch

Also Published As

Publication number Publication date
JP2013113795A (en) 2013-06-10
WO2013080577A1 (en) 2013-06-06

Similar Documents

Publication Publication Date Title
JP3669352B2 (en) Photoelectric sensor
KR101291834B1 (en) Photoelectric sensor and method of support for action confirmation working of photoelectric sensor
JP6135090B2 (en) Photoelectric sensor
JP5067436B2 (en) Photoelectric sensor and threshold value checking method
JP6007717B2 (en) Photoelectric sensor
US8786436B2 (en) Multiple optical axis photoelectric sensor
JP6264934B2 (en) Photoelectric sensor
JP4983407B2 (en) Photoelectric sensor
JP4009838B2 (en) Photoelectric sensor
JP5152397B1 (en) PHOTOELECTRIC SENSOR AND METHOD FOR SUPPORTING WORK CHECKING LIGHT EMITTING STATUS OF PHOTOELECTRIC SENSOR
JP4428416B2 (en) Photoelectric sensor
JP2003169780A (en) Photoelectric pulse wave type pulse measuring instrument
JP6020033B2 (en) Photoelectric sensor
JP5507895B2 (en) Transmission type measuring device
US10429510B2 (en) Sensor and method for setting threshold of sensor
JPH06160971A (en) Switching mechanism
JP2014096715A (en) Photoelectric sensor
JP3981820B2 (en) Sensor
JP2007139495A (en) Photoelectric sensor
JP3149798U (en) Shredder chip detection device
JP4616036B2 (en) Detection sensor threshold setting method and detection sensor
JP2015078947A (en) Photoelectronic sensor

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121119

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

Free format text: PAYMENT UNTIL: 20151214

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5152397

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150