JP2017072522A - Photoelectric switch - Google Patents

Photoelectric switch Download PDF

Info

Publication number
JP2017072522A
JP2017072522A JP2015200555A JP2015200555A JP2017072522A JP 2017072522 A JP2017072522 A JP 2017072522A JP 2015200555 A JP2015200555 A JP 2015200555A JP 2015200555 A JP2015200555 A JP 2015200555A JP 2017072522 A JP2017072522 A JP 2017072522A
Authority
JP
Japan
Prior art keywords
color
reference color
degree
interpolation
color information
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.)
Granted
Application number
JP2015200555A
Other languages
Japanese (ja)
Other versions
JP6650239B2 (en
Inventor
伸一 槻木
Shinichi Tsukiki
伸一 槻木
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2015200555A priority Critical patent/JP6650239B2/en
Priority to US15/257,938 priority patent/US9958329B2/en
Priority to DE102016219513.1A priority patent/DE102016219513A1/en
Priority to CN201610877974.7A priority patent/CN106568510B/en
Publication of JP2017072522A publication Critical patent/JP2017072522A/en
Application granted granted Critical
Publication of JP6650239B2 publication Critical patent/JP6650239B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Spectrometry And Color Measurement (AREA)
  • Switches Operated By Changes In Physical Conditions (AREA)
  • Electronic Switches (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a photoelectric switch that can correctly detect even such a workpiece that changes color among manufacturing lots while suppressing wrong detection.SOLUTION: A photoelectric switch comprises: matching degree calculation means that compares acquired color information with color information on a reference color to calculate a matching degree; detection signal generation means that compares the calculated matching degree with a predetermined detection determination threshold to conduct a workpiece determination; and reference color specification means that specifies a start reference color, additional reference color and interpolation reference color on the basis of a take-in instruction. The reference color specification means is configured to: specify color information acquired on the basis of a first take-in instruction as color information on the start reference color; specify color information acquired on the basis of a second take-in instruction as color information on the additional color reference color; and specify the interpolation reference color based on the start reference color and additional reference color. The detection signal generation means compares the highest matching degree out of a matching degree relative to the start reference color, a matching degree relative to the interpolation reference color, and a matching degree relative to the additional reference color with the detection determination threshold to conduct a workpiece determination.SELECTED DRAWING: Figure 4

Description

本発明は、光電スイッチに係り、さらに詳しくは、検出領域からの反射光を受光して色情報を取得し、ワーク判定を行う光電スイッチの改良に関する。   The present invention relates to a photoelectric switch, and more particularly, to an improvement in a photoelectric switch that receives reflected light from a detection region, acquires color information, and performs work determination.

光電スイッチは、光を用いてワークを検出する検出装置であり、検出光を投光し、ワークによる反射光や透過光等を受光してワーク判定を行い、ワーク判定の結果に基づいて検出信号を生成する。光電スイッチには、ワークを含む検出領域からの反射光又は透過光の受光量によりワーク判定を行う受光量方式の光電スイッチと、ワークまでの距離を計測してワーク判定を行う距離計測方式の光電スイッチと、ワーク表面の色を判別してワーク判定を行う色判別方式の光電スイッチとがある。   A photoelectric switch is a detection device that detects light using light, projects detection light, receives reflected light or transmitted light from the work, etc., makes a work determination, and detects a signal based on the result of the work determination. Is generated. The photoelectric switch includes a received light amount type photoelectric switch that performs workpiece determination based on the amount of reflected or transmitted light received from a detection area including the workpiece, and a distance measurement type photoelectric switch that measures the distance to the workpiece and performs workpiece determination. There are a switch and a color discrimination type photoelectric switch that discriminates the color of the workpiece surface and discriminates the workpiece.

受光量方式の光電スイッチは、ワーク表面の反射率又は色の違い、ワークまでの距離の違い、ワーク表面の傾き(チルト角)の違い等により受光量が変動することを利用してワーク判別を行うものであり、多くの用途に適用することができる汎用的な光電スイッチである。一方、距離計測方式の光電スイッチは、ワークの形状による特徴をワークまでの距離として計測してワーク判定を行うものであり、ワーク表面の反射率及び色の変動、ワーク表面の傾き(チルト角)の変動の影響を受け難い。また、色判別方式の光電スイッチは、ワーク表面の色によりワーク判定を行うものであり、ワーク表面の反射率の変動、ワークまでの距離の変動、ワーク表面の傾き(チルト角)の変動の影響を受け難い。   Light-receiving-type photoelectric switches use the fact that the amount of received light varies due to differences in the reflectance or color of the workpiece surface, differences in the distance to the workpiece, differences in the tilt (tilt angle) of the workpiece surface, etc. This is a general-purpose photoelectric switch that can be applied to many purposes. On the other hand, the distance measurement type photoelectric switch measures a feature by measuring the feature depending on the shape of the workpiece as the distance to the workpiece, and changes the reflectance and color of the workpiece surface, and the tilt (tilt angle) of the workpiece surface. It is hard to be affected by fluctuations. In addition, the color discrimination type photoelectric switch determines the workpiece based on the color of the workpiece surface, and is affected by variations in the reflectance of the workpiece surface, variations in the distance to the workpiece, and variations in the workpiece surface tilt (tilt angle). It is difficult to receive.

色判別方式の従来の光電スイッチは、赤色、緑色及び青色の検出光をそれぞれ生成する3つの発光素子と、反射光を受光して受光信号を生成する1つの受光素子とを備える(例えば、特許文献1〜4)。この種の光電スイッチでは、各発光素子を時分割で順に点灯させて得られる3色の受光量レベルR,G,Bに基づいて、例えば、3色の受光量レベルの比率r=R/M,g=G/M,bk=B/M(受光量の和M=R+G+B)により色を表し、ワークの色に対応する受光量レベルの比率r,g,bが、予め登録された基準色に対応する受光量レベルの比率r,g,bと一致するか否かが判別される。具体的には、各色の受光量レベルの比率を基準色の受光量レベルの比率と比較して両色情報の一致度を求め、この一致度を判定用閾値と比較することにより、ワーク判定が行われる。 A conventional photoelectric switch of a color discrimination system includes three light emitting elements that respectively generate red, green, and blue detection lights, and one light receiving element that receives reflected light and generates a light reception signal (for example, a patent). Literatures 1-4). In this type of photoelectric switch, for example, the ratio r k of the light reception amount levels of the three colors based on the light reception amount levels R k , G k , and B k of the three colors obtained by sequentially lighting the light emitting elements in time division. = R k / M k, g k = G k / M k, represents a color by bk = B k / M k (OR M k = R k + G k + B k of the light-receiving amount), corresponding to the work color light It is determined whether or not the quantity level ratios r 1 , g 1 , b 1 match the received light quantity level ratios r 0 , g 0 , b 0 corresponding to the reference color registered in advance. Specifically, by comparing the ratio of the received light amount level of each color with the ratio of the received light amount level of the reference color, the degree of coincidence of the two color information is obtained, and by comparing this degree of coincidence with the determination threshold value, the work determination is performed. Done.

基準色の受光量レベルは、ユーザが指示したタイミングで取得された各色の受光量レベルに基づいて定められる。例えば、所定期間内に取得される複数の受光量レベル又は受光量レベルの比率に基づいて、色成分ごとに最大値及び最小値を求め、最大値と最小値との中間値が基準色の受光量レベル又は受光量レベルの比率に指定される。   The received light level of the reference color is determined based on the received light level of each color acquired at the timing designated by the user. For example, a maximum value and a minimum value are obtained for each color component based on a plurality of received light amount levels or a ratio of received light amount levels acquired within a predetermined period, and an intermediate value between the maximum value and the minimum value is the received light of the reference color It is specified as the ratio of the light level or the light receiving level.

特開2000−121440号公報JP 2000-112440 A 特開2000−121441号公報Japanese Patent Laid-Open No. 2000-121441 特開2005−127869号公報JP 2005-127869 A 特開2005−291748号公報JP 2005-291748 A

上述した従来の光電スイッチは、色の判別に一致度を用いることにより、通常3つのパラメータにより表現される色情報を、一致度という1つのパラメータで表現するため、受光量と閾値とで判別する受光量方式の光電スイッチと同様な取り扱いができ、設定が簡便なものとなっている。一方、従来の光電スイッチにおいて同一ワーク内で色目が変化するようなワークを正しく検出するには、たとえ色成分ごとに求めた最大値及び最小値から定めた基準色を用いたとしても、色目の変化量に応じて従来の光電スイッチの判定用閾値を十分に低く設定しなければならない。つまり、従来の光電スイッチでは、最適な基準色を求めたとしても、色目の変化量によっては、ワークの色が基準色に対して一致度の低いワークであってもワークとして判別されることになり、検出精度が低下してしまうという問題があった。例えば、製造ロット間におけるワークの色目のバラツキ、ワーク表面の汚れ、印字マークのかすれ、色劣化の影響により、所望のワークを正しく検出することができないという問題があった。   The conventional photoelectric switch described above uses color matching to determine color information, which is usually represented by three parameters, using a single parameter called matching, and therefore discriminates based on the amount of received light and a threshold value. It can be handled in the same way as a light receiving type photoelectric switch, and is easy to set. On the other hand, in order to correctly detect a work whose color changes within the same work in the conventional photoelectric switch, even if the reference color determined from the maximum value and the minimum value obtained for each color component is used, The judgment threshold value of the conventional photoelectric switch must be set sufficiently low according to the amount of change. That is, in the conventional photoelectric switch, even if the optimum reference color is obtained, depending on the amount of change in the color, even if the work color is a work having a low degree of coincidence with the reference color, it is determined as a work. Thus, there is a problem that the detection accuracy is lowered. For example, there has been a problem that a desired workpiece cannot be detected correctly due to the influence of the color of the workpiece between manufacturing lots, the contamination of the workpiece surface, the blur of the print mark, and the color deterioration.

本発明は、上記事情に鑑みてなされたものであり、誤検出を抑制しつつ、製造ロット間で色目が変化する様なワークであっても正しく検出することができる光電スイッチを提供することを目的とする。   The present invention has been made in view of the above circumstances, and provides a photoelectric switch that can correctly detect even a workpiece whose color changes between manufacturing lots while suppressing erroneous detection. Objective.

本発明の第1の態様による光電スイッチは、検出光を検出領域に向けて投光する投光手段と、上記検出領域からの反射光を受光し、受光信号を生成する受光手段と、2以上の特定波長にそれぞれ対応する2以上の上記受光信号に基づいて、色情報を取得する色情報取得手段と、取得された上記色情報を基準色の色情報と比較して両色情報の一致度を算出する一致度算出手段と、算出された上記一致度を予め定められた検出判定閾値と比較してワーク判定を行い、上記ワーク判定の結果に基づいて、検出信号を生成する検出信号生成手段と、上記基準色の取込指示を受け付ける取込指示受付手段と、上記取込指示に基づいて、開始基準色、追加基準色及び補間基準色を指定する基準色指定手段とを備える。上記基準色指定手段は、第1の上記取込指示に基づいて取得された上記色情報を開始基準色の色情報に指定するとともに、第1の取込指示後の第2の上記取込指示に基づいて取得された上記色情報を追加基準色の色情報に指定し、上記開始基準色の色情報及び上記追加基準色の色情報に基づいて、開始基準色及び追加基準色間の色情報を補間する1又は2以上の補間基準色の指定を行う。上記一致度算出手段は、上記色情報が新たに取得された場合に、当該色情報を上記開始基準色の色情報、上記補間基準色の色情報及び上記追加基準色の色情報と比較して一致度をそれぞれ算出する。上記検出信号生成手段は、上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を上記検出判定閾値と比較してワーク判定を行う。   The photoelectric switch according to the first aspect of the present invention includes: a light projecting unit that projects detection light toward a detection region; a light receiving unit that receives reflected light from the detection region and generates a light reception signal; Color information acquisition means for acquiring color information based on two or more of the received light signals respectively corresponding to the specific wavelengths of the color, and the degree of coincidence between the two color information by comparing the acquired color information with the color information of the reference color A degree-of-matching calculating means for calculating a workpiece, comparing the calculated degree of matching with a predetermined detection determination threshold value to determine a workpiece, and generating a detection signal based on the result of the workpiece determination And a reference instruction specifying means for specifying a start reference color, an additional reference color, and an interpolation reference color based on the input instruction. The reference color designation means designates the color information acquired based on the first take-in instruction as color information of a start reference color, and the second take-in instruction after the first take-in instruction The color information acquired based on the reference color is designated as color information of the additional reference color, and color information between the start reference color and the additional reference color based on the color information of the start reference color and the color information of the additional reference color Designation of one or more interpolation reference colors for interpolation is performed. The degree-of-match calculation means compares the color information with the color information of the start reference color, the color information of the interpolation reference color, and the color information of the additional reference color when the color information is newly acquired. The degree of coincidence is calculated. The detection signal generation means performs work determination by comparing the degree of coincidence with the start reference color, the degree of coincidence with the interpolation reference color, and the degree of coincidence with the additional reference color with the detection determination threshold. .

この光電スイッチは、色判別方式の光電スイッチであり、2以上の基準色を用いてワーク判定が行われる。このため、1つの基準色を用いてワーク判定を行う場合に比べ、検出判定閾値を高く設定することができることから、誤検出を抑制しつつ、製造ロット間で色目が変化する様なワークであっても正しく検出することができる。   This photoelectric switch is a color discrimination type photoelectric switch, and workpiece determination is performed using two or more reference colors. For this reason, since the detection determination threshold can be set higher than in the case where workpiece determination is performed using one reference color, the workpiece has a color change between production lots while suppressing erroneous detection. Can be detected correctly.

また、開始基準色及び追加基準色間に色情報を補間する1又は2以上の補間基準色が自動的に指定されるため、補間基準色の取込を指示する手間を省くことができる。特に、開始基準色と追加基準色との2点を指定するだけで、その間の色目を補間基準色として追加することができる。これによって、個体間で色目がバラつく時(ロット間のバラツキなど)に、全ての色目バラツキワークを用意して基準色を設定しなくても、色目バラツキの両端を用意するだけで、その間の色目も検出することが出来るように設定することができる。   In addition, since one or more interpolation reference colors for interpolating color information between the start reference color and the additional reference color are automatically specified, it is possible to save the trouble of instructing the capture of the interpolation reference color. In particular, only by designating two points of the start reference color and the additional reference color, the color between them can be added as the interpolation reference color. As a result, when colors vary between individuals (such as lot-to-lot variations), it is only necessary to prepare both ends of the color variation without preparing all color variation work and setting a reference color. It can be set so that color eyes can also be detected.

さらに、開始基準色の色情報及び追加基準色の色情報に基づいて補間基準色の指定が行われる。このため、開始基準色及び追加基準色間の一致度に関わらず補間基準色を設定する場合に比べ、補間基準色の数が抑制されることから、実際の運転時におけるワーク判定の処理負荷を低減させることができる。   Furthermore, the interpolation reference color is designated based on the color information of the start reference color and the color information of the additional reference color. For this reason, the number of interpolation reference colors is suppressed compared to the case where the interpolation reference colors are set regardless of the degree of coincidence between the start reference color and the additional reference color, so that the work determination processing load during actual operation is reduced. Can be reduced.

本発明の第2の態様による光電スイッチは、上記構成に加え、上記基準色指定手段が、上記追加基準色の色情報を上記開始基準色の色情報と比較して算出される一致度が予め定められた補間判定閾値以下である場合に、補間基準色の指定を行う一方、一致度が上記補間判定閾値を上回っている場合に、補間基準色の指定を行わないように構成される。   In the photoelectric switch according to the second aspect of the present invention, in addition to the above configuration, the reference color designating unit has a degree of coincidence calculated in advance by comparing the color information of the additional reference color with the color information of the start reference color. While the interpolation reference color is designated when it is equal to or less than the predetermined interpolation judgment threshold, the interpolation reference color is not designated when the degree of coincidence exceeds the interpolation judgment threshold.

この様な構成によれば、開始基準色及び追加基準色間の一致度に応じて補間基準色の指定が行われるため、開始基準色及び追加基準色間の一致度に関わらず補間基準色を設定する場合に比べ、実際の運転時におけるワーク判定の処理負荷を低減させることができる。   According to such a configuration, since the interpolation reference color is designated according to the degree of coincidence between the start reference color and the additional reference color, the interpolation reference color is determined regardless of the degree of coincidence between the start reference color and the additional reference color. Compared with the case of setting, the processing load for workpiece determination during actual operation can be reduced.

本発明の第3の態様による光電スイッチは、上記構成に加え、上記一致度算出手段が、上記追加基準色が新たに指定された場合に、当該追加基準色の色情報を上記開始基準色の色情報と比較して一致度を算出するとともに、当該追加基準色よりも前に指定された全ての上記追加基準色の色情報及び上記補間基準色の色情報と比較して一致度を算出し、上記基準色指定手段が、上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を上記補間判定閾値と比較して補間基準色の指定を行うように構成される。   In the photoelectric switch according to the third aspect of the present invention, in addition to the above configuration, when the coincidence calculation unit newly designates the additional reference color, the color information of the additional reference color is stored in the start reference color. The degree of coincidence is calculated by comparing with the color information, and the degree of coincidence is calculated by comparing with the color information of all the additional reference colors specified before the additional reference color and the color information of the interpolation reference color. The reference color designating means compares the degree of coincidence with the start reference color, the degree of coincidence with the interpolation reference color and the degree of coincidence with the additional reference color with the interpolation determination threshold value to compare the interpolation reference color Is configured to specify.

この様な構成によれば、一致度が最も高い基準色に絞り込んで補間基準色の指定が行われる。このため、全ての基準色について一致度を補間判定閾値と比較する場合に比べ、基準色を補間するか否かの補間判定の処理負荷を低減させることができる。   According to such a configuration, the interpolation reference color is designated by narrowing down to the reference color having the highest degree of coincidence. Therefore, it is possible to reduce the processing load of the interpolation determination as to whether or not to interpolate the reference color, as compared with the case where the degree of coincidence is compared with the interpolation determination threshold for all the reference colors.

本発明の第4の態様による光電スイッチは、上記構成に加え、上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を表示する表示手段を備えて構成される。この様な構成によれば、基準色を補間するか否かの補間判定に用いられる一致度を確認しながらワークを移動させ、或いは、ワークの姿勢を変化させることができる。このため、基準色設定時の作業性を向上させることができる。   In addition to the above configuration, the photoelectric switch according to the fourth aspect of the present invention displays the highest degree of coincidence among the degree of coincidence with the start reference color, the degree of coincidence with the interpolation reference color, and the degree of coincidence with the additional reference color. It comprises a display means. According to such a configuration, the workpiece can be moved or the posture of the workpiece can be changed while checking the degree of coincidence used for the interpolation determination as to whether or not to interpolate the reference color. For this reason, the workability at the time of setting the reference color can be improved.

本発明の第5の態様による光電スイッチは、上記構成に加え、操作キーに対する押下操作に基づいて、上記検出判定閾値及び上記補間判定閾値を指定する判定閾値指定手段を備え、上記表示手段が、上記検出判定閾値及び上記補間判定閾値を表示するように構成される。この様な構成によれば、操作キーを操作することによって検出判定閾値及び補間判定閾値を任意に指定することができる。   A photoelectric switch according to a fifth aspect of the present invention includes a determination threshold value specifying unit that specifies the detection determination threshold value and the interpolation determination threshold value based on a pressing operation on an operation key in addition to the above configuration, and the display unit includes: The detection determination threshold value and the interpolation determination threshold value are configured to be displayed. According to such a configuration, the detection determination threshold value and the interpolation determination threshold value can be arbitrarily designated by operating the operation keys.

本発明による光電スイッチでは、2以上の基準色を用いてワーク判定を行うため、誤検出を抑制しつつ、製造ロット間で色目が変化する様なワークであっても正しく検出することができる。   In the photoelectric switch according to the present invention, since workpiece determination is performed using two or more reference colors, it is possible to correctly detect even a workpiece whose color changes between manufacturing lots while suppressing erroneous detection.

本発明の実施の形態による光電スイッチ1の一構成例を示した平面図である。It is the top view which showed one structural example of the photoelectric switch 1 by embodiment of this invention. 筐体10の上面及び背面を示した平面図である。FIG. 2 is a plan view showing an upper surface and a rear surface of the housing 10. 図1の光電スイッチ1内の機能構成の一例を示したブロック図である。FIG. 2 is a block diagram illustrating an example of a functional configuration in the photoelectric switch 1 of FIG. 1. 図3の主制御部100の構成例を示したブロック図である。FIG. 4 is a block diagram illustrating a configuration example of a main control unit 100 in FIG. 3. 図3の光電スイッチ1の動作を比較例と比較して示した説明図である。It is explanatory drawing which showed operation | movement of the photoelectric switch 1 of FIG. 3 compared with the comparative example. 図3の光電スイッチ1における補間基準色の設定時の動作の一例を模式的に示した説明図である。It is explanatory drawing which showed typically an example of the operation | movement at the time of the setting of the interpolation reference color in the photoelectric switch 1 of FIG. 図3の光電スイッチ1における基準色設定時の動作の一例を示したフローチャートである。4 is a flowchart illustrating an example of an operation when setting a reference color in the photoelectric switch 1 of FIG. 3. 図3の光電スイッチ1における補間基準色設定時の動作の一例を示したフローチャートである。4 is a flowchart showing an example of an operation when setting an interpolation reference color in the photoelectric switch 1 of FIG. 3. 図3の光電スイッチ1における運転モード時の動作の一例を示したフローチャートである。It is the flowchart which showed an example of the operation | movement at the time of the operation mode in the photoelectric switch 1 of FIG.

以下、本発明の実施の形態について、図面を参照して説明する。本明細書では、便宜上、投光レンズの光軸(主軸)の方向を前後方向として説明するが、本発明による光電スイッチの使用時における姿勢を限定するものではない。   Embodiments of the present invention will be described below with reference to the drawings. In this specification, for the sake of convenience, the direction of the optical axis (principal axis) of the light projecting lens is described as the front-rear direction. However, the posture of the photoelectric switch according to the present invention is not limited.

<光電スイッチ1>
図1は、本発明の実施の形態による光電スイッチ1の一構成例を示した平面図であり、色判別方式の光電スイッチ1が示されている。図中の(a)には、筐体10の前面が示され、(b)には、筐体10の右側面が示されている。図2は、筐体10の上面及び背面を示した平面図であり、図中の(a)には、上面に設けられた表示灯3、操作キー6及び調整ねじ7が示され、(b)には、背面に設けられた操作キー5及び表示パネル8が示されている。
<Photoelectric switch 1>
FIG. 1 is a plan view showing a configuration example of a photoelectric switch 1 according to an embodiment of the present invention, in which a color discrimination type photoelectric switch 1 is shown. (A) in the drawing shows the front surface of the housing 10 and (b) shows the right side surface of the housing 10. FIG. 2 is a plan view showing the upper surface and the rear surface of the housing 10, and (a) in the drawing shows the indicator lamp 3, the operation key 6 and the adjustment screw 7 provided on the upper surface. ) Shows the operation keys 5 and the display panel 8 provided on the back surface.

光電スイッチ1は、検出光を投光し、検出領域からの反射光を受光してワーク判定を行い、ワーク判定の結果に基づいて検出信号を出力する検出装置である。ワーク判定は、ワーク表面の色を判別して行われ、ワークの良否又はワークの有無を示す検出信号が出力される。   The photoelectric switch 1 is a detection device that projects detection light, receives reflected light from a detection region, performs workpiece determination, and outputs a detection signal based on the result of workpiece determination. The workpiece determination is performed by determining the color of the workpiece surface, and a detection signal indicating whether the workpiece is acceptable or not is output.

光電スイッチ1の筐体10は、回路素子及び光学部品を収容するためのケーシングである。この筐体10には、投受光窓カバー2、表示灯3、配線ケーブル4、操作キー5,6、調整ねじ7及び表示パネル8が設けられている。検出光は、筐体10の前面から出射し、検出領域からの反射光が当該前面に入射する。投受光窓カバー2は、筐体10の前面に形成された投受光用の開口を塞ぐ保護用の透明板であり、筐体10に取り付けられている。   The housing 10 of the photoelectric switch 1 is a casing for housing circuit elements and optical components. The housing 10 is provided with a light projecting / receiving window cover 2, an indicator lamp 3, a wiring cable 4, operation keys 5 and 6, an adjusting screw 7 and a display panel 8. The detection light is emitted from the front surface of the housing 10 and the reflected light from the detection region is incident on the front surface. The light projecting / receiving window cover 2 is a protective transparent plate that closes the light projecting / receiving opening formed on the front surface of the housing 10, and is attached to the housing 10.

表示灯3は、ワーク判定の結果に応じて点灯するLED(発光ダイオード)インジケータであり、筐体上面の前端に配設されている。操作キー6は、ワーク判定用の基準色を指定する際に使用される押下式のセットキーであり、筐体10の上面に配設されている。調整ねじ7は、検出領域までの距離を変化させ、投光スポットのサイズを調整するための操作子であり、筐体10の上面に配設されている。   The indicator lamp 3 is an LED (light emitting diode) indicator that is turned on according to the result of the workpiece determination, and is disposed at the front end of the upper surface of the housing. The operation key 6 is a push-type set key used when specifying a reference color for workpiece determination, and is disposed on the upper surface of the housing 10. The adjustment screw 7 is an operator for changing the distance to the detection region and adjusting the size of the projection spot, and is arranged on the upper surface of the housing 10.

操作キー5は、ワーク判定用の閾値を指定する際に使用される押下式の方向キーであり、アップキー5a及びダウンキー5bにより構成される。アップキー5aを操作することにより、数値をインクリメントすることができ、ダウンキー5bを操作することにより、数値をデクリメントすることができる。操作キー5a及び5bは、筐体10の背面に配設されている。   The operation key 5 is a push-down direction key used when a threshold value for workpiece determination is designated, and includes an up key 5a and a down key 5b. The numerical value can be incremented by operating the up key 5a, and the numerical value can be decremented by operating the down key 5b. The operation keys 5 a and 5 b are disposed on the back surface of the housing 10.

配線ケーブル4は、筐体10内の回路素子に電力を供給するための電源ケーブルと、制御用信号や検出信号を伝送するための信号ケーブルとにより構成される。配線ケーブル4の引出部は、筐体背面の下端に配置されている。   The wiring cable 4 includes a power cable for supplying power to the circuit elements in the housing 10 and a signal cable for transmitting a control signal and a detection signal. The lead-out portion of the wiring cable 4 is disposed at the lower end on the rear surface of the housing.

表示パネル8は、ワーク判定用の閾値や一致度を表示する表示装置であり、筐体10の背面に配設されている。例えば、表示パネル8は、7セグメント表示器である。なお、表示パネル8には、LCD(Liquid Crystal Display:液晶ディスプレイ)などのアクティブマトリクス駆動方式の表示装置を用いても良い。   The display panel 8 is a display device that displays a threshold value and a degree of coincidence for workpiece determination, and is disposed on the back surface of the housing 10. For example, the display panel 8 is a 7 segment display. The display panel 8 may be an active matrix driving display device such as an LCD (Liquid Crystal Display).

図3は、図1の光電スイッチ1内の機能構成の一例を示したブロック図である。この光電スイッチ1は、主制御部100、投光駆動部101、カラーフィルタ102、受光素子ユニット103、アンプ部104、メモリ105、電源部106、入出力部107、表示部108及び操作部109により構成される。   FIG. 3 is a block diagram showing an example of a functional configuration in the photoelectric switch 1 of FIG. The photoelectric switch 1 includes a main control unit 100, a light projecting drive unit 101, a color filter 102, a light receiving element unit 103, an amplifier unit 104, a memory 105, a power supply unit 106, an input / output unit 107, a display unit 108, and an operation unit 109. Composed.

主制御部100は、投受光を制御し、受光信号に基づいてワーク判定を行う。投光駆動部101は、主制御部100の指示に基づいて、発光ダイオード21を駆動する。例えば、投光駆動部101は、平均電流が一定になるように調整された高周波パルスによって駆動する。   The main control unit 100 controls light projection and reception, and performs workpiece determination based on the light reception signal. The light projecting drive unit 101 drives the light emitting diode 21 based on an instruction from the main control unit 100. For example, the light projecting drive unit 101 is driven by a high-frequency pulse adjusted so that the average current is constant.

発光ダイオード21は、色相が異なる2以上の色成分を含む検出光を生成する発光素子である。この発光ダイオード21は、白色光を検出光として生成する半導体チップからなり、回路基板に面実装される。例えば、発光ダイオード21は、補色の関係にある2つの色の光を混ぜることによって白色光を生成する白色LED(Light Emitting Diode)である。   The light emitting diode 21 is a light emitting element that generates detection light including two or more color components having different hues. The light emitting diode 21 is formed of a semiconductor chip that generates white light as detection light, and is surface-mounted on a circuit board. For example, the light emitting diode 21 is a white LED (Light Emitting Diode) that generates white light by mixing light of two colors having complementary colors.

検出光は、図示しない投光レンズを介して出射される。投光レンズは、検出光を検出領域に結像させる。投光レンズには、色収差を抑える色収差補正レンズ、例えば、分散率が互いに異なる2以上の光学レンズにより構成されるアクロマートレンズが用いられる。一方、検出領域からの反射光は、図示しない受光レンズを介して入射される。受光レンズは、反射光を受光素子ユニット103の受光面に結像させる。   The detection light is emitted through a projection lens (not shown). The light projection lens forms an image of the detection light on the detection area. As the projection lens, a chromatic aberration correction lens that suppresses chromatic aberration, for example, an achromatic lens composed of two or more optical lenses having different dispersion rates is used. On the other hand, the reflected light from the detection region is incident through a light receiving lens (not shown). The light receiving lens forms an image of the reflected light on the light receiving surface of the light receiving element unit 103.

受光素子ユニット103は、検出領域からの反射光を2以上の特定波長に対応して選択的に受光し、特定波長ごとの受光量にそれぞれ対応する2以上の受光信号を生成する。この受光素子ユニット103は、2以上のPD(Photo Diode:フォトダイオード)22が回路基板上に2次元的に配列された多分割PDユニットである。例えば、PD22は、12×24のマトリクス状に配列される。   The light receiving element unit 103 selectively receives reflected light from the detection region corresponding to two or more specific wavelengths, and generates two or more received light signals respectively corresponding to the received light amounts for the specific wavelengths. The light receiving element unit 103 is a multi-division PD unit in which two or more PDs (Photo Diodes) 22 are two-dimensionally arranged on a circuit board. For example, the PDs 22 are arranged in a 12 × 24 matrix.

カラーフィルタ102は、2次元位置に応じて特定波長の色成分の光を選択的に透過させる光学素子であり、受光素子ユニット103の受光面上に配置される。このカラーフィルタ102では、赤色光、緑色光又は青色光のいずれかをそれぞれ選択的に透過させるRフィルタ領域、Gフィルタ領域及びBフィルタ領域がマトリクス状に配置される。Rフィルタ領域、Gフィルタ領域及びBフィルタ領域は、いずれも微小な矩形領域からなり、PD22に対応づけて形成される。   The color filter 102 is an optical element that selectively transmits light of a color component having a specific wavelength according to a two-dimensional position, and is disposed on the light receiving surface of the light receiving element unit 103. In the color filter 102, an R filter region, a G filter region, and a B filter region that selectively transmit any of red light, green light, and blue light are arranged in a matrix. Each of the R filter region, the G filter region, and the B filter region is formed of a minute rectangular region, and is formed in association with the PD 22.

アンプ部104は、各PD22から入力される受光信号を増幅して主制御部100へ出力する増幅器ユニットである。このアンプ部104は、ゲインを切り替えることができる。受光信号は、特定波長の色成分ごとに増幅して主制御部100へ出力される。   The amplifier unit 104 is an amplifier unit that amplifies the light reception signal input from each PD 22 and outputs the amplified signal to the main control unit 100. The amplifier unit 104 can switch the gain. The light reception signal is amplified for each color component of a specific wavelength and output to the main control unit 100.

メモリ105には、ワーク判定用の閾値、基準色の色情報などが保持される。電源部106は、配線ケーブル4を介してコントローラなどの外部機器に接続され、主制御部100の制御に基づいて、主制御部100や投光駆動部101に直流電源を供給する。入出力部107は、配線ケーブル4を介してコントローラなどの外部機器に接続され、制御用信号を受信して主制御部100へ出力し、主制御部100から入力された検出信号を外部機器へ送信する。   The memory 105 holds a workpiece determination threshold value, reference color information, and the like. The power supply unit 106 is connected to an external device such as a controller via the wiring cable 4 and supplies DC power to the main control unit 100 and the light projecting drive unit 101 based on the control of the main control unit 100. The input / output unit 107 is connected to an external device such as a controller via the wiring cable 4, receives a control signal, outputs the control signal to the main control unit 100, and outputs the detection signal input from the main control unit 100 to the external device. Send.

表示部108は、主制御部100の制御に基づいて、ワーク判定用の閾値や一致度を表示パネル8に表示する。操作部109は、操作キー5a,5b及び6の押下操作に基づいて、操作信号を生成し、主制御部100へ出力する。この操作部109は、基準色の色情報を取り込むための取込指示を受け付ける取込指示受付手段であり、操作キー6に対する押下操作に基づいて、取込指示を主制御部100へ入力する。   The display unit 108 displays the workpiece determination threshold and the degree of coincidence on the display panel 8 based on the control of the main control unit 100. The operation unit 109 generates an operation signal based on the pressing operation of the operation keys 5 a, 5 b, and 6 and outputs the operation signal to the main control unit 100. The operation unit 109 is a take-in instruction receiving unit that receives a take-in instruction for taking in the color information of the reference color, and inputs a take-in instruction to the main control unit 100 based on a pressing operation on the operation key 6.

主制御部100は、操作キー6に対する長押し操作及び短押し操作を識別し、基準色の指定方法を選択する。長押し操作は、操作が一定の時間長以上継続する押下操作であり、操作開始及び操作終了が検知される。短押し操作は、継続時間が上記時間長未満の押下操作である。   The main control unit 100 identifies a long press operation and a short press operation on the operation key 6 and selects a reference color designation method. The long press operation is a press operation in which the operation continues for a certain length of time, and the operation start and operation end are detected. The short press operation is a press operation whose duration is less than the above time length.

例えば、1点チューニング、色ムラチューニング又は補間チューニングのいずれかが基準色の指定方法として選択される。1点チューニングは、1つの色情報のみを基準色の色情報に指定する方法であり、操作キー6の長押し操作を検知して色情報が取り込まれ、基準色に指定される。   For example, one point tuning, color unevenness tuning or interpolation tuning is selected as the reference color designation method. One-point tuning is a method in which only one color information is designated as the color information of the reference color, and color information is taken in by detecting a long press operation of the operation key 6 and designated as the reference color.

色ムラチューニングは、2以上の基準色を順次に指定する方法であり、操作キー6の短押し操作とその後の長押し操作とが検知される。色ムラチューニングでは、操作キー6の短押し操作に基づいて取り込んだ色情報が開始基準色の色情報に指定され、短押し操作後の長押し操作に基づいて取り込んだ色情報の中から、1又は2以上の追加基準色の色情報が指定される。   Color unevenness tuning is a method of sequentially specifying two or more reference colors, and a short press operation of the operation key 6 and a subsequent long press operation are detected. In color unevenness tuning, the color information captured based on the short press operation of the operation key 6 is designated as the color information of the start reference color, and 1 color is selected from the color information captured based on the long press operation after the short press operation. Alternatively, color information of two or more additional reference colors is specified.

補間チューニングは、2つの基準色の間に色情報を補間する補間基準色を指定する方法であり、操作キー6及び操作キー5aの同時長押し操作を検知して色情報が取り込まれる。補間チューニングでは、操作キー6の最初の短押し操作に基づいて取り込んだ色情報が開始基準色の色情報に指定され、その後の短押し操作に基づいて取り込んだ色情報が追加基準色の色情報に指定される。追加基準色が新たに指定されれば、当該追加基準色と当該追加基準色よりも前に指定された基準色との間に、色情報を補間する1又は2以上の補間基準色が自動的に指定される。   Interpolation tuning is a method of designating an interpolation reference color for interpolating color information between two reference colors. Color information is taken in by detecting a simultaneous long press operation of the operation key 6 and the operation key 5a. In the interpolation tuning, the color information acquired based on the first short press operation of the operation key 6 is designated as the color information of the start reference color, and the color information acquired based on the subsequent short press operation is the color information of the additional reference color. Specified. When an additional reference color is newly specified, one or more interpolation reference colors for interpolating color information are automatically inserted between the additional reference color and the reference color specified before the additional reference color. Specified.

例えば、補間チューニングは、1点チューニング、色ムラチューニングにより基準色を設定した後に、さらに基準色を追加する場合に実施されるチューニングであっても良い。1点チューニングにより基準色を設定した後、つまり検出したいワークに対し操作キー6を長押しして基準色を設定した後に補間チューニングされる場合は、1点チューニングの基準色が開始基準色となり、補間チューニングにより追加基準色が指定されるとともに、開始基準色と追加基準色との間の色が途切れなく検出できるように必要に応じて1もしくは2以上の補間基準色が自動的に指定される。   For example, the interpolation tuning may be tuning performed when a reference color is added after setting a reference color by one-point tuning or color unevenness tuning. When the reference color is set by one-point tuning, that is, when interpolation tuning is performed after long-pressing the operation key 6 for the workpiece to be detected and setting the reference color, the reference color for the one-point tuning becomes the start reference color, An additional reference color is specified by interpolation tuning, and one or more interpolation reference colors are automatically specified as necessary so that the color between the start reference color and the additional reference color can be detected without interruption. .

また、色ムラチューニングにより基準色を設定した後に補間チューニングされる場合は、色ムラチューニングで設定された複数の基準色に対して、補間チューニングにより追加基準色が指定されるとともに、指定された追加基準色と複数の基準色とで一致度を求め、その中で最も大きい一致度となる基準色と追加基準色との間の色が途切れなく検出できるように必要に応じて1もしくは2以上の補間基準色が自動的に指定される。   In addition, when interpolation tuning is performed after setting a reference color by color unevenness tuning, an additional reference color is specified by interpolation tuning for multiple reference colors set by color unevenness tuning, and the specified additional The degree of coincidence is obtained between the reference color and a plurality of reference colors, and one or more as necessary, so that the color between the reference color having the largest degree of coincidence and the additional reference color can be detected without interruption. An interpolation reference color is automatically specified.

<主制御部100>
図4は、図3の主制御部100の構成例を示したブロック図である。この主制御部100は、投光量制御部110、色情報取得部111、基準色指定部112、基準色記憶部113、一致度算出部114、検出信号生成部115、取込期間指定部116、判定閾値指定部117、判定閾値記憶部118及び報知部119により構成される。
<Main control unit 100>
FIG. 4 is a block diagram showing a configuration example of the main control unit 100 of FIG. The main control unit 100 includes a light projection amount control unit 110, a color information acquisition unit 111, a reference color designation unit 112, a reference color storage unit 113, a coincidence degree calculation unit 114, a detection signal generation unit 115, a capture period designation unit 116, The determination threshold value specifying unit 117, the determination threshold value storage unit 118, and the notification unit 119 are configured.

投光量制御部110は、アンプ部104から入力される受光信号に基づいて、投光駆動部101を制御し、発光ダイオード21による投光量を調整する。例えば、反射光の受光量が一定レベルを上回った場合に、投光量を下げる一方、受光量が当該一定レベルを下回った場合に、投光量を上げて元の状態に戻す制御が行われる。   The light projection amount control unit 110 controls the light projection drive unit 101 based on the light reception signal input from the amplifier unit 104 and adjusts the light projection amount by the light emitting diode 21. For example, when the amount of reflected light received exceeds a certain level, the amount of emitted light is reduced. On the other hand, when the amount of received light falls below the certain level, control is performed to increase the amount of emitted light and return to the original state.

この投光量制御部110では、アンプ部104から入力される受光信号に基づいて、アンプ部104を制御し、ゲインが切り替えられる。例えば、反射光の受光量が一定レベルを上回った場合に、アンプ部104のゲインを下げる一方、反射光の受光量が当該一定レベルを下回った場合に、アンプ部104のゲインを上げて元の状態に戻す制御が行われる。これらの投光量制御は、RGBのいずれかの受光量に基づいて行われる。或いは、RGBの各受光量を組み合わせて得られるパラメータに基づいて行われる。   In the light emission amount control unit 110, the amplifier unit 104 is controlled based on the light reception signal input from the amplifier unit 104, and the gain is switched. For example, when the amount of reflected light received exceeds a certain level, the gain of the amplifier unit 104 is reduced. On the other hand, when the amount of received reflected light falls below the certain level, the gain of the amplifier unit 104 is increased to increase the original gain. Control to return to the state is performed. These light emission control is performed based on the received light amount of RGB. Alternatively, it is performed based on parameters obtained by combining the received light amounts of RGB.

色情報取得部111は、2以上の特定波長にそれぞれ対応する2以上の受光信号に基づいて、色情報を取得し、一致度算出部114及び基準色指定部112へ出力する。取得される色情報は、3色の受光量レベルに基づいて定められる。例えば、赤色光の受光量レベルをR、緑色光の受光量レベルをG、青色光の受光量レベルをBとし、受光量の和をM=R+G+Bとすれば、3色の受光量レベルの比率r=R/M,g=G/M,b=B/Mを用いた組(r,g,b)により色が表される。色情報(r,g,b)は、周期的に繰り返し取得される。 The color information acquisition unit 111 acquires color information based on two or more received light signals respectively corresponding to two or more specific wavelengths and outputs the color information to the coincidence calculation unit 114 and the reference color designation unit 112. The acquired color information is determined based on the received light amount levels of the three colors. For example, if the received light amount level of red light is R 1 , the received light amount level of green light is G 1 , the received light amount level of blue light is B 1, and the sum of received light amounts is M k = R k + G k + B k. According to the set (r 1 , g 1 , b 1 ) using the ratios r k = R k / M k , g k = G k / M k , and b k = B k / M k of the three light reception levels. Color is expressed. The color information (r 1 , g 1 , b 1 ) is periodically and repeatedly acquired.

基準色指定部112は、操作部109からの取込指示に基づいて、色情報取得部111により取得された色情報(r,g,b)を基準色の色情報に指定する。基準色記憶部113には、基準色指定部112によって登録された基準色の色情報(r,g,b)が保持される。 The reference color designating unit 112 designates the color information (r 0 , g 0 , b 0 ) acquired by the color information acquiring unit 111 as the color information of the reference color based on the capture instruction from the operation unit 109. The reference color storage unit 113 holds the color information (r 0 , g 0 , b 0 ) of the reference color registered by the reference color specifying unit 112.

一致度算出部114は、色情報取得部111により取得された色情報(r,g,b)を基準色記憶部113に登録された基準色の色情報(r,g,b)と比較し、両色情報の一致度Cを算出し、検出信号生成部115へ出力する。一致度Cは、色の一致の度合いを示すパラメータであり、比較対象の色がワーク判定の基準として登録された色にどれだけ類似しているのかが定量的に評価される。 The coincidence calculation unit 114 uses the color information (r 1 , g 1 , b 1 ) acquired by the color information acquisition unit 111 as the reference color information (r 0 , g 0 , b 0 ), the degree of coincidence C between the two color information is calculated and output to the detection signal generation unit 115. The degree of coincidence C is a parameter indicating the degree of color coincidence, and it is quantitatively evaluated how much the color to be compared is similar to the color registered as a reference for work determination.

例えば、一致度Cは、0以上999以下の範囲の整数を用いて表される。比較対象の色が基準色と完全に一致していれば、一致度Cは999である。表示部108は、一致度算出部114により算出された一致度Cを表示パネル8に表示する。なお、色情報として、各色の受光量レベルの比率であるr,g,bの組(r,g,b)を例示したが、本発明では、色情報の構成をこれに限らない。例えば、赤色光の受光量レベル、緑色光の受光量レベル、青色光の受光量レベルの組(R,G,B)を色情報としても良い。また、RGB表色系に限られず、Lab等の表色系に基づく各色成分の値からなる組を色情報としても良い。 For example, the degree of coincidence C is expressed using an integer in the range of 0 to 999. If the color to be compared completely matches the reference color, the matching degree C is 999. The display unit 108 displays the matching degree C calculated by the matching degree calculation unit 114 on the display panel 8. In addition, as the color information, a set of r k , g k , and b k (r k , g k , b k ), which is the ratio of the received light amount level of each color, has been illustrated. Not limited to. For example, a combination (R k , G k , B k ) of a received light level of red light, a received light level of green light, and a received light level of blue light may be used as color information. Further, the color information is not limited to the RGB color system, and a set of color component values based on the color system such as Lab may be used as the color information.

検出信号生成部115は、一致度算出部114により算出された一致度Cを予め定められた検出判定閾値Cdと比較してワーク判定を行い、検出信号を生成して入出力部107へ出力する。検出信号は、ワーク判定の結果に基づいて生成される。運転モードでは、色情報が新たに取得されるごとに、一致度Cが算出され、ワーク判定が行われる。   The detection signal generation unit 115 compares the degree of coincidence C calculated by the degree of coincidence calculation unit 114 with a predetermined detection determination threshold Cd, performs work determination, generates a detection signal, and outputs the detection signal to the input / output unit 107. . The detection signal is generated based on the result of the work determination. In the operation mode, every time color information is newly acquired, the degree of coincidence C is calculated, and the work determination is performed.

取込期間指定部116は、操作部109からの取込指示に基づいて、基準色取込期間を指定する。基準色取込期間は、色ムラチューニングにおけるパラメータ調整期間であり、操作キー6に対する短押し操作及び長押し操作を識別して指定される。例えば、操作キー6の短押し操作時と、当該短押し操作後の長押し操作の操作開始から操作終了までの期間とが基準色取込期間である。   The capture period designation unit 116 designates a reference color capture period based on a capture instruction from the operation unit 109. The reference color capture period is a parameter adjustment period in color unevenness tuning, and is specified by identifying a short press operation and a long press operation on the operation key 6. For example, the reference color capture period is a time from the start of operation of the long press operation after the short press operation to the end of the operation after the short press operation of the operation key 6.

基準色指定部112は、操作部109からの取込指示に基づいて、2以上の基準色を指定する。すなわち、基準色指定部112は、基準色取込期間内に取得される色情報を候補色の色情報として、候補色間の一致度Cを予め定められた追加判定閾値Ctと比較することにより、基準色の指定を行う。   The reference color designating unit 112 designates two or more reference colors based on the capture instruction from the operation unit 109. That is, the reference color designating unit 112 uses the color information acquired within the reference color capture period as the color information of the candidate color, and compares the matching degree C between the candidate colors with a predetermined additional determination threshold value Ct. Specify the reference color.

色ムラチューニングにおける基準色の指定方法について具体的に説明すれば、基準色指定部112は、基準色取込期間の最初に取得された候補色を開始基準色に指定し、開始基準色の色情報を基準色記憶部113内に格納する。開始基準色の色情報は、操作キー6の短押し操作に基づいて取得される。   Specifically, the reference color designation method in the color unevenness tuning will be described. The reference color designation unit 112 designates the candidate color acquired at the beginning of the reference color capture period as the start reference color, and the color of the start reference color. Information is stored in the reference color storage unit 113. The color information of the start reference color is acquired based on a short press operation of the operation key 6.

次に、基準色指定部112は、候補色が新たに取得された場合に、当該候補色の開始基準色に対する一致度Cが追加判定閾値Ct未満であれば追加基準色に指定し、追加基準色の色情報を基準色記憶部113内に格納する。一方、基準色指定部112は、一致度Cが追加判定閾値Ct以上であれば追加基準色に指定しない。基準色記憶部113には、開始基準色の色情報と追加基準色の色情報とが保持される。   Next, when a candidate color is newly acquired, the reference color designating unit 112 designates the candidate color as an additional reference color if the degree of matching C of the candidate color with the start reference color is less than the additional determination threshold value Ct. The color information of the color is stored in the reference color storage unit 113. On the other hand, the reference color specifying unit 112 does not specify an additional reference color if the degree of matching C is equal to or greater than the additional determination threshold Ct. The reference color storage unit 113 holds color information of the start reference color and color information of the additional reference color.

一致度算出部114は、候補色が新たに取得された場合に、当該候補色の色情報を開始基準色の色情報と比較して一致度Cを算出するとともに、当該候補色が取得されるよりも前に指定された全ての追加基準色の色情報と比較して一致度Cを算出する。基準色指定部112は、開始基準色に対する一致度Cと追加基準色に対する一致度Cとの中で最も高い一致度Cを追加判定閾値Ctと比較して追加基準色の指定を行う。   When a candidate color is newly acquired, the matching degree calculation unit 114 compares the color information of the candidate color with the color information of the start reference color to calculate the matching degree C, and the candidate color is acquired. The degree of coincidence C is calculated by comparing with the color information of all the additional reference colors specified before. The reference color specifying unit 112 specifies the additional reference color by comparing the highest match C between the match C for the start reference color and the match C for the additional reference color with the additional determination threshold Ct.

報知部119は、基準色指定部112により追加基準色が新たに指定されれば、基準色が追加されたことをユーザに報知する。具体的には、表示灯3を点灯させることにより、基準色の追加がユーザ報知される。例えば、基準色が追加された際に、ワーク判定時とは異なる表示色で表示灯3が点灯する。また、表示灯3の点灯は、基準色が新たに指定されるごとに、一定時間だけ行われる。   When the reference color specifying unit 112 newly designates the additional reference color, the notification unit 119 notifies the user that the reference color has been added. Specifically, the user is notified of the addition of the reference color by turning on the indicator lamp 3. For example, when the reference color is added, the indicator lamp 3 is turned on with a display color different from that used when the workpiece is determined. The indicator lamp 3 is turned on for a certain period of time each time a new reference color is designated.

表示部108は、開始基準色に対する一致度Cと追加基準色に対する一致度Cとの中で最も高い一致度Cを表示パネル8に表示する。この様な構成により、候補色を基準色に追加するか否かの追加判定に用いられる一致度Cを確認しながらワークを移動させ、或いは、ワークの姿勢を変化させることができる。   The display unit 108 displays on the display panel 8 the highest degree of coincidence C between the degree of coincidence C for the start reference color and the degree of coincidence C for the additional reference color. With such a configuration, the workpiece can be moved or the posture of the workpiece can be changed while confirming the degree of coincidence C used for addition determination as to whether or not to add the candidate color to the reference color.

判定閾値指定部117は、操作部109からの操作信号に基づいて、検出判定閾値Cd及び追加判定閾値Ctを指定し、判定閾値記憶部118内に格納する。判定閾値記憶部118には、判定閾値指定部117によって登録された検出判定閾値Cd及び追加判定閾値Ctが保持される。検出判定閾値Cd及び追加判定閾値Ctは、操作キー5a又は5bを操作することにより、任意に指定し、或いは、変更することができる。検出判定閾値Cd及び追加判定閾値Ctは、同じ値であっても良い。   The determination threshold value specification unit 117 specifies the detection determination threshold value Cd and the additional determination threshold value Ct based on the operation signal from the operation unit 109 and stores them in the determination threshold value storage unit 118. The determination threshold storage unit 118 holds the detection determination threshold Cd and the additional determination threshold Ct registered by the determination threshold specifying unit 117. The detection determination threshold value Cd and the additional determination threshold value Ct can be arbitrarily designated or changed by operating the operation keys 5a or 5b. The detection determination threshold Cd and the additional determination threshold Ct may be the same value.

表示部108は、判定閾値指定部117により指定された検出判定閾値Cd又は追加判定閾値Ctのいずれかを動作状況に応じて表示パネル8に表示する。すなわち、運転モードでは、検出判定閾値Cdが表示される。一方、色ムラチューニング時には、追加判定閾値Ctが表示される。   The display unit 108 displays either the detection determination threshold value Cd or the additional determination threshold value Ct specified by the determination threshold value specification unit 117 on the display panel 8 according to the operation state. That is, in the operation mode, the detection determination threshold value Cd is displayed. On the other hand, during color unevenness tuning, an additional determination threshold value Ct is displayed.

一致度算出部114は、運転モードにおいて色情報が新たに取得された場合に、当該色情報を開始基準色の色情報と比較して一致度Cを算出するとともに、追加基準色の色情報と比較して一致度Cを算出する。検出信号生成部115は、色情報が新たに取得された場合に、当該色情報を2以上の基準色の色情報とそれぞれ比較して算出される一致度Cの中で最も高い一致度Cを検出判定閾値Cdと比較してワーク判定を行う。   When the color information is newly acquired in the operation mode, the coincidence calculation unit 114 compares the color information with the color information of the start reference color to calculate the coincidence C, and the color information of the additional reference color The degree of coincidence C is calculated by comparison. When the color information is newly acquired, the detection signal generation unit 115 obtains the highest matching degree C among the matching degrees C calculated by comparing the color information with the color information of two or more reference colors. Work determination is performed in comparison with the detection determination threshold Cd.

次に、補間チューニングにおける基準色の指定方法について説明する。基準色指定部112は、1点チューニング又は色ムラチューニングにより基準色を設定した後、操作キー6及び操作キー5aの同時長押し操作に基づいて、追加基準色及び補間基準色を指定し、基準色記憶部113内に格納する。すなわち、基準色指定部112は、1点チューニングにより基準色を設定した後に、操作キー6及び操作キー5aに対する同時長押し操作が検知された場合に、1点チューニングの基準色を開始基準色とし、新たに取得された色情報を追加基準色の色情報に指定するとともに、開始基準色と追加基準色との間の色が途切れなく検出できるように必要に応じて1又は2以上の補間基準色を指定する。   Next, a reference color designation method in interpolation tuning will be described. The reference color designating unit 112 designates an additional reference color and an interpolation reference color based on the simultaneous long pressing operation of the operation key 6 and the operation key 5a after setting the reference color by one-point tuning or color unevenness tuning. Stored in the color storage unit 113. In other words, the reference color specifying unit 112 sets the reference color by one-point tuning, and when a simultaneous long press operation on the operation key 6 and the operation key 5a is detected, the reference color for one-point tuning is set as the start reference color. In addition to designating the newly acquired color information as the color information of the additional reference color, one or more interpolation standards are necessary so that the color between the start reference color and the additional reference color can be detected without interruption. Specify the color.

また、基準色指定部112は、色ムラチューニングにより基準色を設定した後に、操作キー6及び操作キー5aに対する同時長押し操作が検知された場合に、色ムラチューニングで設定された複数の基準色に対して、新たに取得された色情報を追加基準色の色情報に指定するとともに、指定された追加基準色と複数の基準色とで一致度Cを求め、その中で最も大きい一致度Cとなる基準色と追加基準色との間の色が途切れなく検出できるように必要に応じて1又は2以上の補間基準色を指定する。   The reference color designating unit 112 sets a plurality of reference colors set in the color unevenness tuning when a simultaneous long press operation on the operation key 6 and the operation key 5a is detected after setting the reference color by color unevenness tuning. On the other hand, the newly acquired color information is designated as the color information of the additional reference color, and the degree of coincidence C is obtained between the designated additional reference color and the plurality of reference colors, and the largest degree of coincidence C among them is obtained. One or more interpolation reference colors are designated as necessary so that the color between the reference color and the additional reference color can be detected without interruption.

具体的には、追加基準色の色情報を開始基準色の色情報と比較して算出される一致度Cが予め定められた補間判定閾値Ch以下である場合に、補間基準色の指定が行われる。一方、一致度Cが補間判定閾値Chを上回っている場合には、補間基準色の指定が行われない。   Specifically, the interpolation reference color is designated when the degree of coincidence C calculated by comparing the color information of the additional reference color with the color information of the start reference color is equal to or less than a predetermined interpolation determination threshold Ch. Is called. On the other hand, when the degree of coincidence C exceeds the interpolation determination threshold Ch, the interpolation reference color is not designated.

一致度算出部114は、追加基準色が新たに指定された場合に、当該追加基準色の色情報を開始基準色の色情報と比較して一致度Cを算出するとともに、当該追加基準色よりも前に指定された全ての追加基準色の色情報及び補間基準色の色情報と比較して一致度Cを算出する。   When the additional reference color is newly designated, the coincidence calculation unit 114 compares the color information of the additional reference color with the color information of the start reference color to calculate the coincidence C, and from the additional reference color Also, the degree of coincidence C is calculated by comparing with the color information of all the additional reference colors specified previously and the color information of the interpolation reference colors.

基準色指定部112は、開始基準色に対する一致度C、補間基準色に対する一致度C及び追加基準色に対する一致度Cの中で最も高い一致度Cを補間判定閾値Chと比較して補間基準色の指定を行う。補間基準色を指定する場合、新たに指定された追加基準色と一致度Cが最も高い基準色との間に1又は2以上の補間基準色が自動的に設定される。例えば、補間基準色の色情報は、線形補間により算出される。   The reference color designating unit 112 compares the matching degree C with respect to the start reference color, the matching degree C with respect to the interpolation reference color, and the matching degree C with respect to the additional reference color with the interpolation determination threshold value Ch to compare the interpolation reference color. Specify. When an interpolation reference color is designated, one or more interpolation reference colors are automatically set between the newly designated additional reference color and the reference color having the highest matching degree C. For example, the color information of the interpolation reference color is calculated by linear interpolation.

一致度算出部114は、運転モードにおいて色情報が新たに取得された場合に、当該色情報を開始基準色の色情報、補間基準色の色情報及び追加基準色の色情報と比較して一致度Cをそれぞれ算出する。検出信号生成部115は、開始基準色に対する一致度C、補間基準色に対する一致度C及び追加基準色に対する一致度Cの中で最も高い一致度Cを検出判定閾値Cdと比較してワーク判定を行う。   When the color information is newly acquired in the operation mode, the degree of coincidence calculation unit 114 compares the color information with the color information of the start reference color, the color information of the interpolation reference color, and the color information of the additional reference color to make a match Each degree C is calculated. The detection signal generation unit 115 compares the degree of coincidence C with respect to the start reference color, the degree of coincidence C with respect to the interpolation reference color, and the degree of coincidence C with respect to the additional reference color with the detection determination threshold Cd to perform work determination. Do.

表示部108は、開始基準色に対する一致度C、補間基準色に対する一致度C及び追加基準色に対する一致度Cの中で最も高い一致度Cを表示パネル8に表示する。この様な構成により、基準色を補間するか否かの補間判定に用いられる一致度Cを確認しながらワークを移動させ、或いは、ワークの姿勢を変化させることができる。   The display unit 108 displays on the display panel 8 the highest match C among the match C for the start reference color, the match C for the interpolation reference color, and the match C for the additional reference color. With such a configuration, the workpiece can be moved or the posture of the workpiece can be changed while confirming the degree of coincidence C used for interpolation determination as to whether or not to interpolate the reference color.

判定閾値指定部117は、操作部109からの操作信号に基づいて、補間判定閾値Chを指定し、判定閾値記憶部118内に格納する。補間判定閾値Chは、操作キー5a又は5bを操作することにより、任意に指定し、或いは、変更することができる。検出判定閾値Cd及び補間判定閾値Chは、同じ値であっても良い。表示部108は、判定閾値指定部117により指定された補間判定閾値Chを表示パネル8に表示する。   The determination threshold value specifying unit 117 specifies the interpolation determination threshold value Ch based on the operation signal from the operation unit 109 and stores it in the determination threshold value storage unit 118. The interpolation determination threshold Ch can be arbitrarily designated or changed by operating the operation keys 5a or 5b. The detection determination threshold value Cd and the interpolation determination threshold value Ch may be the same value. The display unit 108 displays the interpolation determination threshold value Ch specified by the determination threshold value specification unit 117 on the display panel 8.

図5は、図3の光電スイッチ1の動作を比較例と比較して示した説明図であり、ワーク判定用の基準色を設定する際の動作が模式的に示されている。図中の(a)には、本発明による光電スイッチ1の場合が示され、(b)には、比較例が示されている。この図では、候補色の測定点を色空間内の2次元平面上にプロットした場合が、横軸を色成分aとし、縦軸を色成分bとして示されている。   FIG. 5 is an explanatory diagram showing the operation of the photoelectric switch 1 of FIG. 3 in comparison with a comparative example, and schematically shows the operation when setting a reference color for work determination. (A) in the figure shows the case of the photoelectric switch 1 according to the present invention, and (b) shows a comparative example. In this figure, when the candidate color measurement points are plotted on a two-dimensional plane in the color space, the horizontal axis represents the color component a and the vertical axis represents the color component b.

本発明による光電スイッチ1では、基準色取込期間内に取得される色情報を候補色の色情報とし、候補色間の一致度Cを追加判定閾値Ctと比較して追加基準色32が指定される。領域31は、対象ワークの色分布範囲である。色ムラが大きければ、この領域31が広くなる。   In the photoelectric switch 1 according to the present invention, the color information acquired within the reference color capture period is used as the color information of the candidate color, and the degree of coincidence C between candidate colors is compared with the additional determination threshold value Ct to designate the additional reference color 32. Is done. A region 31 is a color distribution range of the target work. If the color unevenness is large, the region 31 is widened.

開始基準色30は、基準色取込期間の最初に取得された候補色である。また、追加基準色は、開始基準色30に対する一致度Cが追加判定閾値Ct未満の候補色である。開始基準色30及び追加基準色32の測定点は、領域31内にある。開始基準色30及び追加基準色32の測定点に付加された円33の半径は、追加判定閾値Ctに対応する。追加判定閾値Ctが高いほど、円33の半径は小さくなる。   The start reference color 30 is a candidate color acquired at the beginning of the reference color capture period. The additional reference color is a candidate color having a matching degree C with the start reference color 30 that is less than the additional determination threshold Ct. The measurement points of the start reference color 30 and the additional reference color 32 are in the region 31. The radius of the circle 33 added to the measurement point of the start reference color 30 and the additional reference color 32 corresponds to the addition determination threshold value Ct. As the additional determination threshold Ct is higher, the radius of the circle 33 is smaller.

ワーク表面に汚れやグラデーションがあれば、色相が同じであっても彩度や明度が大きく変化する。この様なワークの場合、同一のワーク内における色目の変化は、細長い領域31として表されることになる。領域31を円33で埋め尽くすことにより、色目の変化するワークを正しく検出することができる。   If there is dirt or gradation on the work surface, the saturation and brightness will change greatly even if the hue is the same. In the case of such a workpiece, the change in color within the same workpiece is represented as an elongated region 31. By filling the region 31 with a circle 33, it is possible to correctly detect a workpiece whose color changes.

本発明によれば、2以上の基準色の中から一致度Cが最も高い基準色を用いてワーク判定を行うため、検出判定閾値Cdを高く設定しても、同一のワーク内で色目が変化する上述した様なワークを正しく検出することができる。   According to the present invention, since the work determination is performed using the reference color having the highest degree of coincidence C among the two or more reference colors, even if the detection determination threshold Cd is set high, the color changes within the same work. It is possible to correctly detect the workpiece as described above.

これに対し、比較例では、ユーザによって色情報の取込が指示された2つの測定点41及び42に基づいて、1つの基準色43が指定される。基準色43の測定点は、2つの測定点41及び42の中点であり、基準色43の各色成分は、測定点41及び42の色成分の平均値からなる。基準色43の測定点に付加された円44の半径は、判定用閾値に対応する。色目が測定点41又は42に対応するワークを正しく検出するには、判定用閾値を十分に低く設定しなければならない。すなわち、同一のワーク内で色目が変化する様なワークを正しく検出するには、円44の半径を十分に大きくしなければならない。このため、色目の全く異なるNGワークが誤検出されてしまうという問題があった。   On the other hand, in the comparative example, one reference color 43 is designated based on the two measurement points 41 and 42 instructed to take in color information by the user. The measurement point of the reference color 43 is a midpoint between the two measurement points 41 and 42, and each color component of the reference color 43 is an average value of the color components of the measurement points 41 and 42. The radius of the circle 44 added to the measurement point of the reference color 43 corresponds to the determination threshold value. In order to correctly detect a workpiece whose color corresponds to the measurement point 41 or 42, the determination threshold must be set sufficiently low. That is, in order to correctly detect a workpiece whose color changes within the same workpiece, the radius of the circle 44 must be sufficiently large. For this reason, there is a problem that NG workpieces having completely different colors are erroneously detected.

図6は、図3の光電スイッチ1における補間基準色の設定時の動作の一例を模式的に示した説明図である。図中の(a)には、開始基準色30と追加基準色32との間に4つの補間基準色35が指定される場合が示されている。開始基準色30及び追加基準色32の一致度Cが補間判定閾値Ch以下である場合に、補間基準色35が指定される。   FIG. 6 is an explanatory diagram schematically showing an example of the operation when setting the interpolation reference color in the photoelectric switch 1 of FIG. (A) in the drawing shows a case where four interpolation reference colors 35 are designated between the start reference color 30 and the additional reference color 32. When the matching degree C between the start reference color 30 and the additional reference color 32 is equal to or less than the interpolation determination threshold Ch, the interpolation reference color 35 is designated.

また、補間基準色35を指定する場合の分割数nは、開始基準色30及び追加基準色32間の一致度と補間判定閾値Chとに基づいて指定される。2つの基準色を結ぶ線分上に、(n−1)個の補間基準色35が均等に配置される。開始基準色30の測定点に付加された円34の半径は、補間判定閾値Chに対応する。補間判定閾値Chが高いほど、円34の半径は小さくなる。   Further, the division number n when designating the interpolation reference color 35 is designated based on the degree of coincidence between the start reference color 30 and the additional reference color 32 and the interpolation determination threshold Ch. (N-1) interpolation reference colors 35 are equally arranged on a line segment connecting two reference colors. The radius of the circle 34 added to the measurement point of the start reference color 30 corresponds to the interpolation determination threshold value Ch. The higher the interpolation determination threshold Ch is, the smaller the radius of the circle 34 is.

図中の(b)には、2つの追加基準色32の間に2つの補間基準色35が指定される場合が示されている。追加基準色32と新たに指定された追加基準色32との一致度Cが補間判定閾値Ch以下である場合に、補間基準色35が指定される。   (B) in the drawing shows a case where two interpolation reference colors 35 are designated between two additional reference colors 32. When the degree of coincidence C between the additional reference color 32 and the newly specified additional reference color 32 is equal to or less than the interpolation determination threshold Ch, the interpolation reference color 35 is specified.

図中の(c)には、補間基準色35と追加基準色32との間に2つの補間基準色35が指定される場合が示されている。新たに追加基準色32が指定された場合、当該追加基準色32の色情報を開始基準色30の色情報と比較して一致度Cが算出されるとともに、当該追加基準色32よりも前に指定された全ての追加基準色32の色情報及び補間基準色35の色情報と比較して一致度Cが算出される。そして、開始基準色30に対する一致度C、補間基準色35に対する一致度C及び追加基準色32に対する一致度Cの中で最も高い一致度Cが補間判定閾値Ch以下であれば、補間基準色35が指定される。   (C) in the figure shows a case where two interpolation reference colors 35 are designated between the interpolation reference color 35 and the additional reference color 32. When the additional reference color 32 is newly designated, the color information of the additional reference color 32 is compared with the color information of the start reference color 30, and the degree of coincidence C is calculated. The degree of coincidence C is calculated by comparing the color information of all the specified additional reference colors 32 and the color information of the interpolation reference color 35. If the highest matching degree C among the matching degree C with respect to the start reference color 30, the matching degree C with respect to the interpolation reference color 35, and the matching degree C with respect to the additional reference color 32 is equal to or less than the interpolation determination threshold Ch, the interpolation reference color 35 is obtained. Is specified.

図7のステップS101〜S109は、図3の光電スイッチ1における基準色設定時の動作の一例を示したフローチャートである。図中には、操作キー6に対する短押し操作を検知した後の処理手順が示されている。まず、主制御部100は、現在の受光量を読み込み、色成分ごとの受光量の比率r,g,bからなる色情報を算出し、開始基準色として登録する(ステップS101〜S103)。 Steps S101 to S109 in FIG. 7 are flowcharts showing an example of the operation when setting the reference color in the photoelectric switch 1 in FIG. In the figure, a processing procedure after detecting a short press operation on the operation key 6 is shown. First, the main control unit 100 reads the current amount of received light, calculates color information including the ratios r k , g k , and b k of the amount of received light for each color component, and registers them as start reference colors (steps S101 to S103). ).

次に、主制御部100は、操作キー6に対する長押し操作を検知すれば(ステップS104)、色情報を取得して一致度Cを算出する。すなわち、主制御部100は、現在の受光量を読み込んで色成分ごとの受光量の比率r,g,bからなる色情報を算出し、候補色とする(ステップS105)。そして、主制御部100は、候補色の色情報を開始基準色の色情報と比較して一致度Cを求める(ステップS106)。 Next, if the main control unit 100 detects a long press operation on the operation key 6 (step S104), the main control unit 100 acquires color information and calculates a matching degree C. That is, the main control unit 100 reads the current received light amount, calculates the color information composed of the received light amount ratios r k , g k , and b k for each color component, and sets it as a candidate color (step S105). Then, the main control unit 100 compares the color information of the candidate color with the color information of the start reference color and obtains a matching degree C (Step S106).

主制御部100は、算出した一致度Cを追加判定閾値Ctと比較し、一致度Cが追加判定閾値Ct未満であれば、候補色を追加基準色に指定し、次の処理手順へ移行する(ステップS107,S108)。主制御部100は、一致度Cが追加判定閾値Ct以上であれば、候補色を追加基準色に指定せず、次の処理手順へ移行する。   The main control unit 100 compares the calculated degree of coincidence C with the additional determination threshold Ct. If the degree of coincidence C is less than the additional determination threshold Ct, the main control unit 100 designates the candidate color as an additional reference color and proceeds to the next processing procedure. (Steps S107 and S108). If the degree of coincidence C is equal to or greater than the additional determination threshold Ct, the main control unit 100 does not designate a candidate color as an additional reference color and proceeds to the next processing procedure.

ステップS105以降の処理手順は、操作キー6がリリースされるまで繰り返され、長押し操作の操作終了が検知されれば、この処理は終了する(ステップS109)。また、ステップS106では、候補色の色情報を開始基準色の色情報と、当該候補色よりも前に指定された追加基準色の色情報とにそれぞれ比較して一致度Cが算出される。そして、ステップS107では、開始基準色に対する一致度Cと追加基準色に対する一致度Cとの中で最も高い一致度Cを追加判定閾値Ctと比較して追加基準色の指定が行われる。   The processing procedure after step S105 is repeated until the operation key 6 is released, and if the end of the long press operation is detected, this processing ends (step S109). Further, in step S106, the degree of coincidence C is calculated by comparing the color information of the candidate color with the color information of the start reference color and the color information of the additional reference color specified before the candidate color. In step S107, the highest matching degree C between the matching degree C with respect to the start reference color and the matching degree C with respect to the additional reference color is compared with the additional determination threshold value Ct to designate the additional reference color.

図8のステップS201〜S208は、図3の光電スイッチ1における補間基準色設定時の動作の一例を示したフローチャートである。図中には、操作キー6及び操作キー5aに対する同時長押し操作を検知した後の処理手順が示されている。まず、主制御部100は、現在の受光量を読み込み、色成分ごとの受光量の比率r,g,bからなる色情報を算出し、追加基準色として登録する(ステップS201〜S203)。 Steps S201 to S208 in FIG. 8 are flowcharts showing an example of the operation when setting the interpolation reference color in the photoelectric switch 1 in FIG. In the figure, a processing procedure after detecting a simultaneous long press operation on the operation key 6 and the operation key 5a is shown. First, the main control unit 100 reads the current received light amount, calculates color information including the received light amount ratios r k , g k , and b k for each color component, and registers them as additional reference colors (steps S201 to S203). ).

次に、主制御部100は、これまでに登録された基準色と比較して一致度Cを算出し、補間判定閾値Chと比較する(ステップS204,S205)。このとき、主制御部100は、最も高い一致度Cが補間判定閾値Ch以下であれば、一致度Cが最も高い基準色及び追加基準色間の一致度と補間判定閾値Chとから分割数nを決定する(ステップS206)。そして、主制御部100は、一致度Cが最も高い基準色及び追加基準色の色情報と分割数nとから補間色情報を算出し、補間基準色として登録する(ステップS207,SS208)。一方、主制御部100は、最も高い一致度Cが補間判定閾値Chを上回っていれば、補間基準色の指定を行わず、この処理を終了する。   Next, the main control unit 100 calculates the degree of coincidence C by comparing with the reference colors registered so far, and compares it with the interpolation determination threshold Ch (steps S204 and S205). At this time, if the highest matching degree C is equal to or less than the interpolation determination threshold Ch, the main control unit 100 determines the division number n from the matching degree between the reference color and the additional reference color having the highest matching degree C and the interpolation determination threshold Ch. Is determined (step S206). Then, the main control unit 100 calculates the interpolation color information from the color information of the reference color and the additional reference color having the highest degree of matching C and the division number n, and registers it as the interpolation reference color (steps S207 and SS208). On the other hand, if the highest matching degree C exceeds the interpolation determination threshold Ch, the main control unit 100 ends this process without specifying the interpolation reference color.

図9のステップS301〜S307は、図3の光電スイッチ1における運転モード時の動作の一例を示したフローチャートである。まず、主制御部100は、現在の受光量を読み込み、色成分ごとの受光量の比率r,g,bからなる色情報を算出する(ステップS301,S302)。次に、主制御部100は、取得した色情報を基準色の色情報と比較して一致度Cを算出する(ステップS303)。主制御部100は、他に基準色が登録されていれば、ステップS303の処理手順を繰り返し、全ての基準色について一致度Cが算出されれば、次の処理手順へ移行する(ステップS304)。すなわち、一致度Cは、開始基準色及び追加基準色として登録された全ての基準色について算出される。 Steps S301 to S307 in FIG. 9 are flowcharts showing an example of the operation in the operation mode in the photoelectric switch 1 in FIG. First, the main control unit 100 reads the current received light amount and calculates color information including the ratios r k , g k , and b k of the received light amount for each color component (steps S301 and S302). Next, the main control unit 100 compares the acquired color information with the color information of the reference color and calculates the degree of coincidence C (step S303). The main control unit 100 repeats the processing procedure of step S303 if other reference colors are registered, and proceeds to the next processing procedure if the degree of coincidence C is calculated for all reference colors (step S304). . That is, the degree of coincidence C is calculated for all reference colors registered as the start reference color and the additional reference color.

次に、主制御部100は、各基準色に対する一致度Cの中で最も高い一致度Cmaxを選出し(ステップS305)、検出判定閾値Cdと比較してワーク判定を行う(ステップS306,S307)。すなわち、一致度Cmaxが検出判定閾値Cd以上であれば、所望のワークであると判断され、一致度Cmaxが検出判定閾値Cd未満であれば、不良ワークであると判断される。   Next, the main control unit 100 selects the highest matching degree Cmax among the matching degrees C for each reference color (step S305), and performs work determination by comparing with the detection determination threshold Cd (steps S306 and S307). . That is, if the matching degree Cmax is equal to or greater than the detection determination threshold Cd, it is determined that the workpiece is a desired workpiece, and if the matching degree Cmax is less than the detection determination threshold Cd, it is determined that the workpiece is a defective workpiece.

本実施の形態によれば、2以上の基準色を用いてワーク判定が行われるため、1つの基準色を用いてワーク判定を行う場合に比べ、検出判定閾値Cdを高く設定することができることから、誤検出を抑制しつつ、製造ロット間で色目が変化する様なワークであっても正しく検出することができる。   According to the present embodiment, since workpiece determination is performed using two or more reference colors, the detection determination threshold Cd can be set higher than in the case where workpiece determination is performed using one reference color. Thus, it is possible to correctly detect even a workpiece whose color changes between production lots while suppressing erroneous detection.

また、開始基準色及び追加基準色間に色情報を補間する1又は2以上の補間基準色が自動的に指定されるため、補間基準色の取込を指示する手間を省くことができる。さらに、開始基準色の色情報及び追加基準色の色情報に基づいて補間基準色の指定が行われる。このため、開始基準色及び追加基準色間の一致度に関わらず補間基準色を設定する場合に比べ、補間基準色の数が抑制されることから、実際の運転時におけるワーク判定の処理負荷を低減させることができる。   In addition, since one or more interpolation reference colors for interpolating color information between the start reference color and the additional reference color are automatically specified, it is possible to save the trouble of instructing the capture of the interpolation reference color. Furthermore, the interpolation reference color is designated based on the color information of the start reference color and the color information of the additional reference color. For this reason, the number of interpolation reference colors is suppressed compared to the case where the interpolation reference colors are set regardless of the degree of coincidence between the start reference color and the additional reference color, so that the work determination processing load during actual operation is reduced. Can be reduced.

また、開始基準色及び追加基準色間の一致度Cに応じて補間基準色の指定が行われるため、開始基準色及び追加基準色間の一致度Cに関わらず補間基準色を設定する場合に比べ、実際の運転時におけるワーク判定の処理負荷を低減させることができる。   In addition, since the interpolation reference color is designated according to the matching degree C between the start reference color and the additional reference color, the interpolation reference color is set regardless of the matching degree C between the start reference color and the additional reference color. In comparison, it is possible to reduce the processing load for workpiece determination during actual operation.

また、一致度Cが最も高い基準色に絞り込んで補間基準色の指定が行われる。このため、全ての基準色について一致度Cを補間判定閾値Chと比較する場合に比べ、基準色を補間するか否かの補間判定の処理負荷を低減させることができる。   Further, the interpolation reference color is designated by narrowing down to the reference color having the highest matching degree C. Therefore, it is possible to reduce the processing load for the interpolation determination as to whether or not to interpolate the reference color, as compared with the case where the degree of coincidence C is compared with the interpolation determination threshold Ch for all the reference colors.

なお、本実施の形態では、一致度Cが3色の受光量レベルの比率r,g,bに基づいて算出される場合の例について説明したが、本発明は、一致度Cの算出方法をこれに限定するものではない。3色の受光量レベルの比率r,g,bと受光量の和Mとに基づいて一致度Cを求めるような構成であっても良い。この様な一致度Cを用いることにより、有彩色のワークだけでなく、色相や彩度が同程度であって明度だけが大きく変化する様なワーク、特に、白黒の濃淡を有する様な無彩色のワークを正しく検出することができる。 In the present embodiment, an example has been described in which the degree of coincidence C is calculated based on the ratios r k , g k , and b k of the light reception amount levels of the three colors. The calculation method is not limited to this. The configuration may be such that the degree of coincidence C is obtained based on the ratios r k , g k , b k of the received light amount levels of the three colors and the sum M k of the received light amounts. By using such a degree of coincidence C, not only chromatic work, but also work in which the hue and saturation are similar and only lightness changes greatly, especially achromatic colors having black and white shades. Can be detected correctly.

また、本実施の形態では、基準色が追加された際に表示灯3を点灯させて報知する場合の例について説明したが、本発明は、基準色追加時の報知方法をこれに限定するものではない。例えば、音声出力により基準色の追加をユーザに報知するような構成であっても良い。   Further, in the present embodiment, an example has been described in which notification is performed by turning on the indicator lamp 3 when a reference color is added, but the present invention limits the notification method when a reference color is added. is not. For example, the configuration may be such that the user is notified of the addition of the reference color by audio output.

また、本実施の形態では、操作キー6の押下操作に基づいて、基準色の取込指示が入力される場合の例について説明したが、本発明は、基準色の取込を指示する方法をこれに限定するものではない。例えば、コントローラなどの外部機器から入力されるトリガ信号に基づいて、色情報を取り込んで基準色の色情報に指定するような構成であっても良い。   In this embodiment, an example in which a reference color capture instruction is input based on a pressing operation of the operation key 6 has been described. However, the present invention provides a method for instructing capture of a reference color. However, the present invention is not limited to this. For example, based on a trigger signal input from an external device such as a controller, the configuration may be such that color information is captured and specified as color information for a reference color.

また、本実施の形態では、基準色取込期間が操作キー6の短押し操作とその後の長押し操作とにより規定される場合に例について説明したが、本発明は、基準色取込期間の指定方法をこれに限定するものではない。例えば、操作キー6に対する1回目の短押し操作から2回目の短押し操作までの間を基準色取込期間としても良い。或いは、操作キー6に対する1回目の短押し操作から、一定時間が経過するまでの間を基準色取込期間としても良い。或いは、操作キー6に対する1回目の短押し操作から、色情報の取得数が一定数を超えるまでの間を基準色取込期間としても良い。   In the present embodiment, an example has been described in which the reference color capture period is defined by a short press operation of the operation key 6 and a subsequent long press operation. However, the present invention is not limited to the reference color capture period. The specification method is not limited to this. For example, the period from the first short press operation to the operation key 6 to the second short press operation may be used as the reference color capture period. Alternatively, the period from the first short pressing operation on the operation key 6 until a predetermined time elapses may be set as the reference color capturing period. Alternatively, the period from the first short pressing operation on the operation key 6 until the number of color information acquisitions exceeds a certain number may be used as the reference color capturing period.

また、本実施の形態では、色相が異なる2以上の色成分を含む白色光を検出光として用いる場合の例について説明したが、本発明は、投光用光源をこれに限定するものではない。例えば、赤色、緑色及び青色の検出光をそれぞれ生成する3つの発光素子を投光用光源として備え、各発光素子を時分割で順に点灯させるような構成であっても良い。   In this embodiment, an example in which white light including two or more color components having different hues is used as detection light has been described. However, the present invention is not limited to this. For example, a configuration in which three light emitting elements that respectively generate red, green, and blue detection lights are provided as light sources for light projection, and the respective light emitting elements are sequentially turned on in a time-sharing manner.

また、本実施の形態では、多分割PDユニットからなる受光素子ユニット103を用いて反射光を受光する場合の例について説明したが、本発明は、受光素子ユニット103の構成をこれに限定するものではない。例えば、反射光を3つの色成分に分光する分光器と、各色成分を受光する3つの受光素子とを受光素子ユニット103として備えるような構成であっても良い。或いは、赤色、緑色及び青色の検出光を時分割で順に投光する場合には、1つの受光素子を受光素子ユニット103として備えるような構成であっても良い。   In the present embodiment, an example in which reflected light is received using the light receiving element unit 103 formed of a multi-division PD unit has been described. However, the present invention limits the configuration of the light receiving element unit 103 to this. is not. For example, the light receiving element unit 103 may include a spectroscope that splits reflected light into three color components and three light receiving elements that receive each color component. Alternatively, when red, green, and blue detection lights are sequentially projected in a time division manner, a configuration in which one light receiving element is provided as the light receiving element unit 103 may be used.

1 光電スイッチ
2 投受光窓カバー
3 表示灯
4 配線ケーブル
5,6 操作キー
7 調整ねじ
8 表示パネル
10 筐体
21 発光ダイオード
22 PD(フォトダイオード)
30 開始基準色
31 色分布範囲を示す領域
32 追加基準色
33,34 許容色差を示す円
35 補間基準色
100 主制御部
101 投光駆動部
102 カラーフィルタ
103 受光素子ユニット
104 アンプ部
105 メモリ
106 電源部
107 入出力部
108 表示部
109 操作部
110 投光量制御部
111 色情報取得部
112 基準色指定部
113 基準色記憶部
114 一致度算出部
115 検出信号生成部
116 取込期間指定部
117 判定閾値指定部
118 判定閾値記憶部
119 報知部
DESCRIPTION OF SYMBOLS 1 Photoelectric switch 2 Light emitting / receiving window cover 3 Indicator lamp 4 Wiring cables 5, 6 Operation key 7 Adjustment screw 8 Display panel 10 Case 21 Light emitting diode 22 PD (photodiode)
30 Start reference color 31 Region 32 indicating color distribution range Additional reference colors 33 and 34 Circle 35 indicating allowable color difference Interpolation reference color 100 Main control unit 101 Light projecting drive unit 102 Color filter 103 Light receiving element unit 104 Amplifier unit 105 Memory 106 Power supply Unit 107 input / output unit 108 display unit 109 operation unit 110 light intensity control unit 111 color information acquisition unit 112 reference color designation unit 113 reference color storage unit 114 coincidence calculation unit 115 detection signal generation unit 116 capture period designation unit 117 determination threshold Specification unit 118 Determination threshold value storage unit 119 Notification unit

Claims (5)

検出光を検出領域に向けて投光する投光手段と、
上記検出領域からの反射光を受光し、受光信号を生成する受光手段と、
2以上の特定波長にそれぞれ対応する2以上の上記受光信号に基づいて、色情報を取得する色情報取得手段と、
取得された上記色情報を基準色の色情報と比較して両色情報の一致度を算出する一致度算出手段と、
算出された上記一致度を予め定められた検出判定閾値と比較してワーク判定を行い、上記ワーク判定の結果に基づいて、検出信号を生成する検出信号生成手段と、
上記基準色の取込指示を受け付ける取込指示受付手段と、
上記取込指示に基づいて、開始基準色、追加基準色及び補間基準色を指定する基準色指定手段とを備え、
上記基準色指定手段は、第1の上記取込指示に基づいて取得された上記色情報を開始基準色の色情報に指定するとともに、第1の取込指示後の第2の上記取込指示に基づいて取得された上記色情報を追加基準色の色情報に指定し、上記開始基準色の色情報及び上記追加基準色の色情報に基づいて、開始基準色及び追加基準色間の色情報を補間する1又は2以上の補間基準色の指定を行い、
上記一致度算出手段は、上記色情報が新たに取得された場合に、当該色情報を上記開始基準色の色情報、上記補間基準色の色情報及び上記追加基準色の色情報と比較して一致度をそれぞれ算出し、
上記検出信号生成手段は、上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を上記検出判定閾値と比較してワーク判定を行うことを特徴とする光電スイッチ。
Light projecting means for projecting detection light toward the detection area;
A light receiving means for receiving reflected light from the detection region and generating a light reception signal;
Color information acquisition means for acquiring color information based on two or more received light signals respectively corresponding to two or more specific wavelengths;
A degree of coincidence calculation means for comparing the acquired color information with the color information of the reference color and calculating the degree of coincidence of both color information;
Detection signal generation means for comparing the calculated degree of coincidence with a predetermined detection determination threshold value to perform work determination, and generating a detection signal based on the result of the work determination;
An import instruction accepting means for accepting an instruction for taking in the reference color;
A reference color specifying means for specifying a start reference color, an additional reference color, and an interpolation reference color based on the capture instruction;
The reference color designation means designates the color information acquired based on the first take-in instruction as color information of a start reference color, and the second take-in instruction after the first take-in instruction The color information acquired based on the reference color is designated as color information of the additional reference color, and color information between the start reference color and the additional reference color based on the color information of the start reference color and the color information of the additional reference color Specify one or more interpolation reference colors to interpolate
The degree-of-match calculation means compares the color information with the color information of the start reference color, the color information of the interpolation reference color, and the color information of the additional reference color when the color information is newly acquired. Calculate the degree of match,
The detection signal generation means performs work determination by comparing the degree of coincidence with the start reference color, the degree of coincidence with the interpolation reference color, and the degree of coincidence with the additional reference color with the detection determination threshold. A photoelectric switch characterized by that.
上記基準色指定手段は、上記追加基準色の色情報を上記開始基準色の色情報と比較して算出される一致度が予め定められた補間判定閾値以下である場合に、補間基準色の指定を行う一方、一致度が上記補間判定閾値を上回っている場合に、補間基準色の指定を行わないことを特徴とする請求項1に記載の光電スイッチ。   The reference color specifying means specifies the interpolation reference color when the degree of coincidence calculated by comparing the color information of the additional reference color with the color information of the start reference color is equal to or less than a predetermined interpolation determination threshold value. On the other hand, if the degree of coincidence exceeds the interpolation determination threshold value, the interpolation reference color is not designated. 上記一致度算出手段は、上記追加基準色が新たに指定された場合に、当該追加基準色の色情報を上記開始基準色の色情報と比較して一致度を算出するとともに、当該追加基準色よりも前に指定された全ての上記追加基準色の色情報及び上記補間基準色の色情報と比較して一致度を算出し、
上記基準色指定手段は、上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を上記補間判定閾値と比較して補間基準色の指定を行うことを特徴とする請求項2に記載の光電スイッチ。
When the additional reference color is newly specified, the coincidence degree calculation means calculates the degree of coincidence by comparing the color information of the additional reference color with the color information of the start reference color, and the additional reference color The degree of coincidence is calculated by comparing the color information of all the additional reference colors specified before and the color information of the interpolation reference colors,
The reference color designating means compares the degree of coincidence with the start reference color, the degree of coincidence with the interpolation reference color, and the degree of coincidence with the additional reference color with the interpolation determination threshold value to determine the interpolation reference color. 3. The photoelectric switch according to claim 2, wherein designation is performed.
上記開始基準色に対する一致度、上記補間基準色に対する一致度及び上記追加基準色に対する一致度の中で最も高い一致度を表示する表示手段を備えたことを特徴とする請求項3に記載の光電スイッチ。   4. The photoelectric device according to claim 3, further comprising display means for displaying a matching degree with respect to the start reference color, a matching degree with respect to the interpolation reference color, and a matching degree with respect to the additional reference color. switch. 操作キーに対する押下操作に基づいて、上記検出判定閾値及び上記補間判定閾値を指定する判定閾値指定手段を備え、
上記表示手段は、上記検出判定閾値及び上記補間判定閾値を表示することを特徴とする請求項4に記載の光電スイッチ。
A determination threshold value specifying means for specifying the detection determination threshold value and the interpolation determination threshold value based on a pressing operation on the operation key;
The photoelectric switch according to claim 4, wherein the display unit displays the detection determination threshold value and the interpolation determination threshold value.
JP2015200555A 2015-10-08 2015-10-08 Photoelectric switch Active JP6650239B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2015200555A JP6650239B2 (en) 2015-10-08 2015-10-08 Photoelectric switch
US15/257,938 US9958329B2 (en) 2015-10-08 2016-09-07 Photoelectric switch
DE102016219513.1A DE102016219513A1 (en) 2015-10-08 2016-10-07 Photoelectric switch
CN201610877974.7A CN106568510B (en) 2015-10-08 2016-10-08 Photoelectric switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015200555A JP6650239B2 (en) 2015-10-08 2015-10-08 Photoelectric switch

Publications (2)

Publication Number Publication Date
JP2017072522A true JP2017072522A (en) 2017-04-13
JP6650239B2 JP6650239B2 (en) 2020-02-19

Family

ID=58537238

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015200555A Active JP6650239B2 (en) 2015-10-08 2015-10-08 Photoelectric switch

Country Status (1)

Country Link
JP (1) JP6650239B2 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5021645A (en) * 1989-07-11 1991-06-04 Eaton Corporation Photoelectric color sensor for article sorting
JPH04301530A (en) * 1991-03-29 1992-10-26 Minolta Camera Co Ltd Dental color meter
JPH11326055A (en) * 1998-05-08 1999-11-26 Toyota Motor Corp Color inspecting method and coating defect inspecting method
JP2001333290A (en) * 2000-03-31 2001-11-30 Canon Inc Processing method, medium and memory
JP2005127869A (en) * 2003-10-24 2005-05-19 Keyence Corp Color-discrimination device
US6901163B1 (en) * 1998-05-19 2005-05-31 Active Silicon Limited Method of detecting objects
JP2012020130A (en) * 2010-07-13 2012-02-02 Carestream Health Inc Dental tone mapping
WO2013002349A1 (en) * 2011-06-29 2013-01-03 富士通株式会社 Plant species identification device, method, and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5021645A (en) * 1989-07-11 1991-06-04 Eaton Corporation Photoelectric color sensor for article sorting
JPH04301530A (en) * 1991-03-29 1992-10-26 Minolta Camera Co Ltd Dental color meter
JPH11326055A (en) * 1998-05-08 1999-11-26 Toyota Motor Corp Color inspecting method and coating defect inspecting method
US6901163B1 (en) * 1998-05-19 2005-05-31 Active Silicon Limited Method of detecting objects
JP2001333290A (en) * 2000-03-31 2001-11-30 Canon Inc Processing method, medium and memory
JP2005127869A (en) * 2003-10-24 2005-05-19 Keyence Corp Color-discrimination device
JP2012020130A (en) * 2010-07-13 2012-02-02 Carestream Health Inc Dental tone mapping
WO2013002349A1 (en) * 2011-06-29 2013-01-03 富士通株式会社 Plant species identification device, method, and program

Also Published As

Publication number Publication date
JP6650239B2 (en) 2020-02-19

Similar Documents

Publication Publication Date Title
RU2434368C2 (en) System and method of controlling led lamp
WO2016056459A1 (en) Light source device and method for controlling light source device
JP6047968B2 (en) Projector and light emission control method in projector
US9693415B1 (en) Photoelectric switch
US20140293432A1 (en) Projector, head-up display device, and control method of projector
US9462653B2 (en) Illumination system
CN110597001A (en) Automatic control method and system for white balance of RGB laser projector
CN111988594B (en) Image processing apparatus, image pickup apparatus, monitoring system, and medium
CN106568510B (en) Photoelectric switch
JP2017073723A (en) Photoelectric switch
KR101680446B1 (en) Creation device for color table, correction and control device for camera image and method thereof
JP6712132B2 (en) Photoelectric switch
JP2017073322A (en) Photoelectric switch
US10096128B2 (en) Change degree deriving device, change degree deriving system, and non-transitory computer readable medium
JP6650239B2 (en) Photoelectric switch
US10652508B2 (en) Projector and method for projecting an image pixel by pixel
JP6748414B2 (en) Photoelectric switch
EP2570850A2 (en) Laser projector with virtual touch screen function
JP6637282B2 (en) Photoelectric switch
JP4266182B2 (en) Photoelectric switch
JP6729578B2 (en) Optical characteristic measuring device and method for setting optical characteristic measuring device
JP2005127869A (en) Color-discrimination device
JP2007334191A (en) Projection apparatus, range finding processing method, and program
JP2005291748A (en) Color identification apparatus
JP2019204017A (en) Color correction method of image projection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180831

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190619

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190626

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190820

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200120

R150 Certificate of patent or registration of utility model

Ref document number: 6650239

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250