[go: up one dir, main page]

JP2012127865A - Optical displacement sensor and method for detecting step therein - Google Patents

Optical displacement sensor and method for detecting step therein Download PDF

Info

Publication number
JP2012127865A
JP2012127865A JP2010280898A JP2010280898A JP2012127865A JP 2012127865 A JP2012127865 A JP 2012127865A JP 2010280898 A JP2010280898 A JP 2010280898A JP 2010280898 A JP2010280898 A JP 2010280898A JP 2012127865 A JP2012127865 A JP 2012127865A
Authority
JP
Japan
Prior art keywords
period
value
displacement
displacement amount
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010280898A
Other languages
Japanese (ja)
Other versions
JP5679427B2 (en
Inventor
Noriyuki Kurihara
宣之 栗原
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 JP2010280898A priority Critical patent/JP5679427B2/en
Publication of JP2012127865A publication Critical patent/JP2012127865A/en
Application granted granted Critical
Publication of JP5679427B2 publication Critical patent/JP5679427B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an optical displacement sensor which detects a period to be a step candidate and reduces an influence of a variation in a displacement amount due to vibration of a conveying device such as a belt conveyor and a variation in a displacement amount in the time direction, thereby further accurately detecting a step, and to provide a method for detecting the step in the optical displacement sensor.SOLUTION: An optical displacement sensor calculates the displacement amount of a detecting object based on an output of a receiver, and performs a sampling at a prescribed timing. The optical displacement sensor calculates a difference value between the displacement amount sampled previously and the displacement amount sampled this time and determines a step period and a non-step period based on the calculated difference value. Then, the optical displacement sensor calculates an integrated value of the difference value in a period determined to be the step period, and compares a maximum value of the integrated value calculated for every period determined to be the step period with a first threshold to determine whether it is the step or not.

Description

本発明は、光学式変位センサ及び該光学式変位センサにおける段差検出方法に関する。特に、検出対象物に照射した投射光の、検出対象物表面で反射した反射光を受光する受光器の出力に基づいて検出対象物表面の段差を検出する光学式変位センサ及び該光学式変位センサにおける段差検出方法に関する。   The present invention relates to an optical displacement sensor and a step detection method in the optical displacement sensor. In particular, an optical displacement sensor that detects a step on the surface of the detection object based on the output of a light receiver that receives the reflected light reflected on the surface of the detection object, and the optical displacement sensor. The present invention relates to a step detection method.

検出対象物に光を照射して検出対象物の有無、検出対象物の所望の形状等を検出するセンサとして、光電センサの他に光学式変位センサが良く用いられている。光学式変位センサは、検出対象物に照射した投射光の、検出対象物表面で反射した反射光に基づいて検出対象物の変位量を算出し、算出した変位量が予め定められた閾値以上、又は予め定められた上限閾値と下限閾値との間であるか等を判定し、判定結果に基づいて検出対象物の有無、検出対象物の所望の形状等を検出する。   An optical displacement sensor is often used in addition to a photoelectric sensor as a sensor that irradiates a detection target with light to detect the presence / absence of the detection target, a desired shape of the detection target, and the like. The optical displacement sensor calculates the displacement amount of the detection object based on the reflected light reflected from the detection object surface of the projection light irradiated to the detection object, and the calculated displacement amount is equal to or greater than a predetermined threshold value. Alternatively, it is determined whether it is between a predetermined upper limit threshold and a lower limit threshold, and the presence / absence of the detection target, a desired shape of the detection target, and the like are detected based on the determination result.

一般に、センサを用いた検出対象物の検出は、センサ及び検出対象物の少なくともいずれか一方を相対的に移動させることにより行われ、例えばセンサを装置乃至設備に固定し、検出対象物をベルトコンベア等の搬送装置で移動させることにより行われる。変位センサは、変位センサと検出対象物との相対的な変位量を検出する。例えば、紙葉類の段差、金属板の段差等の検出対象物による変位量を基準とした場合のベルトコンベア等の搬送装置の振動等による変動量が比較的大きいとき等は、紙葉類の段差、金属板の段差等による変動であるのか、ベルトコンベア等の搬送装置の振動等による変動であるのか、変位センサにより区別することが困難である。   In general, detection of a detection target using a sensor is performed by relatively moving at least one of the sensor and the detection target. For example, the sensor is fixed to an apparatus or equipment, and the detection target is transferred to a belt conveyor. It is performed by moving it with a transfer device such as. The displacement sensor detects a relative displacement amount between the displacement sensor and the detection object. For example, when the amount of fluctuation due to vibration of a conveyor such as a belt conveyor is relatively large when the amount of displacement due to an object to be detected, such as a step of a paper sheet or a step of a metal plate, is used as a reference, It is difficult to distinguish by a displacement sensor whether it is a variation due to a step, a step of a metal plate, or a variation due to a vibration of a transport device such as a belt conveyor.

そこで、特許文献1では、変位センサの検出信号を微分処理することで、段差の存在による急峻な変位量の変動と振動による比較的緩やかな変位量の変動とを区別するようにして段差を検出している。また、特許文献2では、段差において、上段と下段とで受光波形の特徴が一気に遷移することを利用して段差を検出している。さらに、特許文献3では、変位センサの検出信号の波形の山と谷とを判別し、検出対象物の個数をカウントしている。   Therefore, in Patent Document 1, the detection signal of the displacement sensor is differentiated to detect a step so as to distinguish between a steep displacement variation due to the presence of a step and a relatively moderate displacement variation due to vibration. is doing. Further, in Patent Document 2, the step is detected by utilizing the fact that the characteristics of the received light waveform transition at a stretch between the upper step and the lower step. Furthermore, in patent document 3, the peak and trough of the waveform of the detection signal of a displacement sensor are discriminate | determined, and the number of detection objects is counted.

特開平07−271945号公報Japanese Patent Application Laid-Open No. 07-271945 特開2008−145159号公報JP 2008-145159 A 特開2005−108052号公報JP 2005-108052 A

しかし、変位の微分値は、検出対象物の搬送速度に大きく依存している。例えば1mmの段差を検出したい場合、変位の微分値の単位は「mm/秒」又は「mm/サンプリング」等となる。したがって、特許文献1では、段差判別のための閾値に時間、速度等の単位が含まれるため、閾値の設定は設定者にとって直感的なものではなく、設定することが困難であるという問題があった。また、搬送速度が変化した場合には同じ検出対象物であったとしても微分値が変化し、適切な閾値を設定することが困難であった。特に、検出動作にデジタル処理が含まれる場合、サンプリングのタイミングによっては、微分値が半分になるおそれもあり、安定して検出することが困難であった。さらに、変位の微分値を算出するためには変動の緩急の基準となるパラメータとしてカットオフ周波数、サンプリング周波数等を閾値とは別に設定する必要があり、斯かる周波数の設定も設定者にとって直感的なものではなく容易ではない。   However, the differential value of the displacement greatly depends on the conveyance speed of the detection object. For example, when it is desired to detect a step of 1 mm, the unit of the differential value of displacement is “mm / second” or “mm / sampling”. Therefore, in Patent Document 1, the threshold value for determining the level difference includes units such as time and speed. Therefore, the setting of the threshold value is not intuitive for the setter and is difficult to set. It was. Further, when the conveyance speed is changed, the differential value is changed even if the object is the same detection target, and it is difficult to set an appropriate threshold value. In particular, when the detection operation includes digital processing, the differential value may be halved depending on the sampling timing, making it difficult to detect stably. Furthermore, in order to calculate the differential value of the displacement, it is necessary to set a cutoff frequency, a sampling frequency, etc. separately from the threshold as parameters that serve as a reference for fluctuations, and setting such frequencies is also intuitive for the setter. It is not easy and not easy.

特許文献2では、段差の上段と下段との受光波形が一気に遷移することを利用して段差を検出しているが、段差が微小である場合、段差の上段と下段との受光波形の分離が困難であるおそれがある。また、段差の垂直側面がやや上向きに傾いている場合等は変位量が徐々に増加するため、受光波形が一気に遷移せず段差を検出することが困難であった。   In Patent Document 2, the step is detected by utilizing the fact that the received light waveforms at the upper and lower steps of the step transition at a stroke. However, when the step is very small, the received light waveform at the upper and lower steps is separated. May be difficult. In addition, when the vertical side surface of the step is inclined slightly upward, the amount of displacement gradually increases, so that the received light waveform does not transition all at once, making it difficult to detect the step.

さらに、特許文献3では、変位量を示す波形の山と谷とがはっきりしている場合でなければ段差を検出することが困難であり、そもそも微分の特長部分も欠落してしまい、従来の微分機能を用いない変位センサと同様に、例えば紙葉類の段差、金属板の段差等の検出対象物による変位量を基準とした場合のベルトコンベア等の搬送装置の振動等による変動量が比較的大きいとき等は、紙葉類の段差、金属板の段差等による変動であるのか、ベルトコンベア等の搬送装置の振動等による変動であるのか、変位センサにより区別することが困難であった。   Furthermore, in Patent Document 3, it is difficult to detect a step unless the peaks and valleys of the waveform indicating the displacement are clear, and the characteristic features of the differentiation are lost in the first place. As with displacement sensors that do not use the function, for example, the amount of fluctuation due to vibration of a conveyor device such as a belt conveyor when the amount of displacement due to a detection object such as a paper sheet level difference or a metal plate level difference is a reference. When it is large, it is difficult to distinguish by a displacement sensor whether it is a variation due to a step of a paper sheet, a step of a metal plate, or a variation due to vibration of a conveying device such as a belt conveyor.

本発明は上記事情に鑑みてなされたものであり、ベルトコンベア等の搬送装置の振動等による変位量の変動、時間方向の変位量の変動の影響を低減し、より確実に段差を検出することができる光学式変位センサ及び該光学式変位センサにおける段差検出方法を提供することを目的とする。   The present invention has been made in view of the above circumstances, and can detect a step more reliably by reducing the influence of fluctuations in displacement due to vibrations of a conveying device such as a belt conveyor and fluctuations in displacement in the time direction. It is an object of the present invention to provide an optical displacement sensor and a step detection method in the optical displacement sensor.

上記目的を達成するために第1発明に係る光学式変位センサは、検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する差分値算出手段と、算出した差分値に基づいて段差期間と非段差期間とを判別する判別手段と、前記段差期間と判別された期間における差分値の積算値を算出する差分積算手段と、前記段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別する段差判別手段と、段差であるか否かに関する判別信号を出力する出力手段とを備えることを特徴とする。   In order to achieve the above object, an optical displacement sensor according to a first aspect of the present invention irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver. In the optical displacement sensor for acquiring the displacement amount of the sensor, a displacement amount calculating means for calculating the displacement amount of the detection object based on the received light signal of the light receiver sampled and acquired at a predetermined timing, and the displacement sampled last time A difference value calculating means for calculating a difference value between the amount and the displacement amount sampled this time, a determining means for determining a step period and a non-step period based on the calculated difference value, and a period determined as the step period A difference integrating means for calculating an integrated value of difference values, and a step for determining whether or not the difference is a step by comparing the maximum value of the integrated value calculated for each period determined as the step period and a first threshold value. Discrimination Characterized in that it comprises a stage, and an output means for outputting a determination signal regarding whether a level difference.

また、第2発明に係る光学式変位センサは、第1発明において、前記段差期間と判別された期間において算出した差分値の積算値を表示する表示手段を備えることを特徴とする。   The optical displacement sensor according to a second aspect of the invention is characterized in that, in the first aspect of the invention, the optical displacement sensor further comprises display means for displaying an integrated value of the difference values calculated in the period determined as the step period.

また、第3発明に係る光学式変位センサは、第1又は第2発明において、前記段差期間と判別された期間において算出した差分値の積算値をゼロにリセットするリセット手段を備えることを特徴とする。   The optical displacement sensor according to a third aspect of the invention is characterized in that, in the first or second aspect of the invention, the optical displacement sensor further comprises reset means for resetting an integrated value of difference values calculated in the period determined as the step period to zero. To do.

次に、上記目的を達成するために第4発明に係る光学式変位センサは、検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する差分値算出手段と、算出した差分値に基づいて段差期間と非段差期間とを判別する判別手段と、前記段差期間と判別された期間における基準変位を特定する基準変位特定手段と、現在の変位と前記基準変位との差分値を第一の閾値と比較して段差であるか否かを判別する段差判別手段と、段差であるか否かに関する判別信号を出力する出力手段とを備えることを特徴とする。   Next, in order to achieve the above object, an optical displacement sensor according to a fourth aspect of the present invention irradiates a detection target with projection light and receives reflected light reflected by the detection target using a light receiver. In an optical displacement sensor for acquiring a displacement amount of a detection object, a displacement amount calculating means for calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing, and a previous time A difference value calculating means for calculating a difference value between the sampled displacement amount and the currently sampled displacement amount; a determining means for determining a step period and a non-step period based on the calculated difference value; and the step period. A reference displacement specifying means for specifying a reference displacement in a given period, a step determining means for comparing the difference value between the current displacement and the reference displacement with a first threshold to determine whether or not it is a step, and a step Is there And an outputting means for outputting a determination signal regarding.

また、第5発明に係る光学式変位センサは、第4発明において、前記段差期間と判別された期間において前記基準変位を現在の変位にリセットするリセット手段を備えることを特徴とする。   An optical displacement sensor according to a fifth aspect of the invention is characterized in that, in the fourth aspect of the invention, the optical displacement sensor further comprises reset means for resetting the reference displacement to the current displacement in a period determined as the step period.

また、第6発明に係る光学式変位センサは、第1乃至第5発明のいずれか1つにおいて、前記判別手段は、前記タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値以上であると判断された期間を段差期間であると判別するようにしてあることを特徴とする。   The optical displacement sensor according to a sixth aspect of the present invention is the optical displacement sensor according to any one of the first to fifth aspects, wherein the determination unit determines whether or not the difference value is equal to or greater than a second threshold value at each timing. The period determined to be equal to or greater than the second threshold is determined to be a step period.

また、第7発明に係る光学式変位センサは、第1乃至第5発明のいずれか1つにおいて、前記判別手段は、前記タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値より小さいと判断された期間であっても、直前の所定期間内でいずれかの差分値が第二の閾値以上であると判断した場合には、段差期間であると判別するようにしてあることを特徴とする。   An optical displacement sensor according to a seventh aspect of the present invention is the optical displacement sensor according to any one of the first to fifth aspects, wherein the determination unit determines whether or not the difference value is equal to or greater than a second threshold value at each timing. Even if it is a period determined to be smaller than the second threshold, if any difference value is determined to be equal to or greater than the second threshold within the immediately preceding predetermined period, it is determined that it is a step period. It is made to do so.

また、第8発明に係る光学式変位センサは、第1乃至第7発明のいずれか1つにおいて、前記変位量を出力することを停止する停止指示を受け付ける停止指示受付手段を備えることを特徴とする。   An optical displacement sensor according to an eighth aspect of the present invention is the optical displacement sensor according to any one of the first to seventh aspects, further comprising stop instruction receiving means for receiving a stop instruction for stopping outputting the displacement amount. To do.

また、第9発明に係る光学式変位センサは、第1乃至第8発明のいずれか1つにおいて、前記出力手段は、前記判別信号を、一定の時間幅を有するワンショットパルス信号として出力するようにしてあることを特徴とする。   An optical displacement sensor according to a ninth aspect of the invention is the optical displacement sensor according to any one of the first to eighth aspects, wherein the output means outputs the determination signal as a one-shot pulse signal having a certain time width. It is characterized by that.

次に、上記目的を達成するために第10発明に係る光学式変位センサは、検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、前記変位量の変動に基づいて段差期間と非段差期間とを判別する判別手段と、段差期間に取得した変位量に基づく段差の上段又は下段の一方を表す第1代表値と、該段差期間の直前の非段差期間に取得した変位量に基づく段差の上段又は下段の他方を表す第2代表値とに基づいて段差代表値を算出する段差算出手段と、前記段差期間と判別された期間ごとに算出した段差代表値と第一の閾値とを比較して段差であるか否かを判別する段差判別手段と、段差であるか否かに関する判別信号を出力する出力手段とを備えることを特徴とする。   Next, in order to achieve the above object, an optical displacement sensor according to a tenth aspect of the invention irradiates a detection target with projection light and receives reflected light reflected by the detection target using a light receiver. In an optical displacement sensor that acquires a displacement amount of a detection object, a displacement amount calculation unit that calculates a displacement amount of the detection object based on a light reception signal of the light receiver that is sampled and acquired at a predetermined timing; and Discriminating means for discriminating a step period and a non-step period based on a variation in displacement amount, a first representative value representing one of an upper stage or a lower stage of a step based on a displacement amount acquired during the step period, and immediately before the step period Step calculating means for calculating a step representative value based on the second representative value representing the other of the upper step or the lower step of the step based on the displacement obtained during the non-step period, and calculating for each period determined as the step period Step difference value and number And the step determination means for comparing the threshold value to determine whether the difference in level, and an outputting means for outputting a determination signal regarding whether a level difference.

次に、上記目的を達成するために第11発明に係る段差検出方法は、検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおける段差検出方法において、所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する工程と、算出した変位量の差分値に基づいて段差期間と非段差期間とを判別する工程と、前記段差期間と判別された期間における差分値の積算値を算出する工程と、前記段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別する工程と、段差であるか否かに関する判別信号を出力する工程とを含むことを特徴とする。   Next, in order to achieve the above object, the step detection method according to the eleventh aspect of the present invention is to detect a detection object by irradiating the detection object with projection light and receiving the reflected light reflected by the detection object using a light receiver. In a step detection method in an optical displacement sensor for acquiring a displacement amount of an object, a step of calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing, and calculation Determining the step period and the non-step period based on the difference value of the displacement amount, calculating the integrated value of the difference values in the period determined as the step period, and the period determined as the step period A step of comparing the maximum value of the integrated value calculated for each and a first threshold value to determine whether or not a step is present, and a step of outputting a determination signal regarding whether or not it is a step. And

次に、上記目的を達成するために第12発明に係る段差検出方法は、検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおける段差検出方法において、所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する工程と、算出した変位量の差分値に基づいて段差期間と非段差期間とを判別する工程と、前記段差期間と判別された期間における基準変位を特定する工程と、現在の変位と前記基準変位との差分値を第一の閾値と比較して段差であるか否かを判別する工程と、段差であるか否かに関する判別信号を出力する工程とを含むことを特徴とする。   Next, in order to achieve the above object, the step detection method according to the twelfth aspect of the invention irradiates a detection target with projection light, and receives and detects the reflected light reflected by the detection target using a light receiver. In a step detection method in an optical displacement sensor for acquiring a displacement amount of an object, a step of calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing, and calculation A step of determining a step period and a non-step period based on a difference value of the displacement amount, a step of identifying a reference displacement in the period determined to be the step period, and a difference value between the current displacement and the reference displacement And a first threshold value to determine whether or not it is a step, and a step of outputting a determination signal regarding whether or not it is a step.

第1発明及び第11発明では、所定のタイミングでサンプリングして取得する受光器の受光信号に基づいて検出対象物の変位量を算出し、算出した変位量の差分値に基づいて段差候補となる段差期間と段差期間とならない非段差期間とを判別する。段差期間と判別された期間における差分値の積算値を算出し、段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別し、段差であるか否かに関する判別信号を出力する。変位量が比較的大きく変動した時点から段差期間であると判別し、段差期間における変位量が第一の閾値以上である場合に段差であると判別することにより、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても、一旦段差候補であるか否かを判別することで段差を確実に検出することができるとともに、段差判別閾値(第一の閾値)によってさらに判別することにより、段差以外による変動を排除することができる。したがって、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても、確実に段差を検出することが可能となる。   In the first invention and the eleventh invention, the displacement amount of the detection target is calculated based on the received light signal of the light receiver sampled and acquired at a predetermined timing, and becomes a step candidate based on the difference value of the calculated displacement amount. A step period and a non-step period that does not become a step period are discriminated. The integrated value of the difference value in the period determined as the step period is calculated, and the maximum value calculated for each period determined as the step period is compared with the first threshold value to determine whether or not it is a step. Discriminate and output a discrimination signal regarding whether or not it is a step. By determining that the displacement period is a step period from the time when the displacement amount fluctuates relatively large, and determining that the displacement amount during the step period is equal to or greater than the first threshold, Even if the fluctuation per sampling is relatively gradual, it is possible to reliably detect the step by once determining whether or not it is a step candidate, and further using the step determination threshold (first threshold). By discriminating, it is possible to eliminate fluctuations other than steps. Therefore, even when the amount of displacement due to the level difference is relatively slow per time or per sampling, the level difference can be reliably detected.

第2発明では、段差期間と判別された期間において算出した差分値の積算値を表示することにより、従来は読み取ることが困難であった段差の大きさを視認することが容易となる。   In the second invention, by displaying the integrated value of the difference values calculated in the period determined as the step period, it becomes easy to visually recognize the size of the step that has been difficult to read in the past.

第3発明では、段差期間と判別された期間において算出した差分値の積算値をゼロにリセットすることにより、所望の位置における段差の高さを確実に検出することが可能となる。   In the third aspect of the invention, it is possible to reliably detect the height of the step at a desired position by resetting the integrated value of the difference values calculated during the period determined as the step period to zero.

第4発明及び第12発明では、所定のタイミングでサンプリングして取得する受光器の受光信号に基づいて検出対象物の変位量を算出し、算出した変位量の差分値に基づいて段差候補となる段差期間と段差期間とならない非段差期間とを判別する。段差期間と判別された期間における基準変位を特定し、現在の変位と基準変位との差分値を第一の閾値と比較して段差であるか否かを判別し、段差であるか否かに関する判別信号を出力する。変位量が比較的大きく変動した時点から段差期間であると判別し、段差期間における変位量が第一の閾値以上である場合に段差であると判別することにより、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても、一旦段差候補であるか否かを判別することで段差を確実に検出することができるとともに、現在の変位と基準変位との差分値を段差判別閾値(第一の閾値)と比較して段差を判別することにより、段差以外による変動を排除することができる。したがって、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても確実に段差を検出することが可能となる。   In the fourth invention and the twelfth invention, the displacement amount of the detection target is calculated based on the light reception signal of the light receiver sampled and acquired at a predetermined timing, and becomes a step candidate based on the difference value of the calculated displacement amount. A step period and a non-step period that does not become a step period are discriminated. The reference displacement in the period determined as the step period is specified, and the difference value between the current displacement and the reference displacement is compared with the first threshold value to determine whether it is a step or not. A discrimination signal is output. By determining that the displacement period is a step period from the time when the displacement amount fluctuates relatively large, and determining that the displacement amount during the step period is equal to or greater than the first threshold, Even if the fluctuation per sampling is relatively gradual, it is possible to reliably detect the step by once determining whether or not it is a step candidate, and to calculate the difference value between the current displacement and the reference displacement. By determining the step compared with the step determination threshold (first threshold), it is possible to eliminate fluctuations due to other than the step. Therefore, it is possible to reliably detect the step even when the displacement per hour or the fluctuation per sampling due to the step is relatively gradual.

第5発明では、段差期間と判別された期間において基準変位を現在の変位にリセットすることにより、所望の位置における段差の高さを確実に検出することが可能となる。   In the fifth aspect, the height of the step at a desired position can be reliably detected by resetting the reference displacement to the current displacement in the period determined as the step period.

第6発明では、タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値以上であると判断された期間を段差期間であると判別することにより、変位量の変動が搬送装置の振動によるものであるか段差によるものであるかを判断する閾値を適切に設定することにより、段差が微小であっても確実に検出することが可能となる。   In the sixth aspect of the invention, it is determined whether or not the difference value is greater than or equal to the second threshold value for each timing, and the period determined to be greater than or equal to the second threshold value is determined as the step period, whereby the amount of displacement By appropriately setting a threshold value for determining whether the fluctuation is due to the vibration of the transport device or the step, it is possible to reliably detect even a small step.

第7発明では、タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値より小さいと判断された期間であっても、直前の所定期間内でいずれかの差分値が第二の閾値以上であると判断した場合には、段差期間であると判別する。これにより、途中でノイズが入った場合等であっても、段差ではないと誤って判別することを回避することが可能となる。   In the seventh invention, it is determined whether the difference value is greater than or equal to the second threshold value at each timing, and even if the difference value is less than the second threshold value, If it is determined that the difference value is greater than or equal to the second threshold, it is determined that the difference is in the step period. As a result, it is possible to avoid erroneously determining that the level difference is not a step even when noise occurs in the middle.

第8発明では、変位量を出力することを停止する停止指示を受け付けることにより、明らかに出力することが不要となる期間を任意に設定することが可能となる。   In the eighth invention, by receiving a stop instruction to stop outputting the displacement amount, it becomes possible to arbitrarily set a period during which it is not necessary to output clearly.

第9発明では、判別信号を、一定の時間幅を有するワンショットパルス信号として出力することにより、一定の時間、判別結果を表示することができ、測定値を視認しやすくすることができる。   In the ninth aspect, by outputting the discrimination signal as a one-shot pulse signal having a constant time width, the discrimination result can be displayed for a fixed time, and the measured value can be easily viewed.

第10発明では、所定のタイミングでサンプリングして取得する受光器の受光信号に基づいて検出対象物の変位量を算出し、変位量の変動に基づいて段差候補となる段差期間と段差期間とならない非段差期間とを判別する。段差期間に取得した変位量に基づく段差の上段又は下段の一方を表す第1代表値と、段差期間の直前の非段差期間に取得した変位量に基づく段差の上段又は下段の他方を表す第2代表値とに基づいて段差代表値を算出する。段差期間と判別された期間ごとに算出した段差代表値と第一の閾値とを比較して段差であるか否かを判別することにより、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても、一旦段差候補であるか否かを判別することで段差を確実に検出することができるとともに、段差候補期間内の各サンプリング値の代表値と段差判別閾値(第一の閾値)とを比較して段差をさらに判別することにより、段差以外による変動を排除することができる。したがって、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても確実に段差を検出することが可能となる。   In the tenth aspect of the invention, the displacement amount of the detection target is calculated based on the light reception signal of the light receiver sampled and acquired at a predetermined timing, and the step period and the step period that are step candidates are not formed based on the variation of the displacement amount. A non-step period is discriminated. A first representative value that represents one of the upper or lower steps of the step based on the displacement amount acquired during the step period, and a second that represents the other of the upper or lower steps based on the displacement amount acquired during the non-step period immediately before the step period. A step representative value is calculated based on the representative value. By comparing the step representative value calculated for each period determined as a step period with the first threshold to determine whether or not it is a step, the displacement per hour or sampling variation due to the step is compared. Even if it is moderate, it is possible to reliably detect the step by determining whether or not it is a step candidate, and to represent the representative value of each sampling value within the step candidate period and the step determination threshold (first step). (1 threshold value) and further discriminating the step, it is possible to eliminate variations due to other than the step. Therefore, it is possible to reliably detect the step even when the displacement per hour or the fluctuation per sampling due to the step is relatively gradual.

本発明によれば、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても、一旦段差候補であるか否かを判別することで段差を確実に検出することができるとともに、段差候補期間内の各サンプリング値の代表値と段差判別閾値(第一の閾値)とを比較して段差をさらに判別することにより、段差以外による変動を排除することができる。したがって、段差による変位量の時間当たり又はサンプリング当たりの変動が比較的緩やかな場合であっても確実に段差を検出することが可能となる。   According to the present invention, it is possible to detect a step with certainty by once determining whether or not it is a step candidate even when the amount of displacement due to the step is relatively gradual per sampling or sampling. In addition, by comparing the representative value of each sampling value within the step candidate period with the step determination threshold (first threshold) to further determine the step, it is possible to eliminate variations due to other than the step. Therefore, it is possible to reliably detect the step even when the displacement per hour or the fluctuation per sampling due to the step is relatively gradual.

本発明の実施の形態1に係る光学式変位センサの構成を示す模式図である。It is a schematic diagram which shows the structure of the optical displacement sensor which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係る三角測距方式の光学式変位センサの測定ヘッド部の構成例を示す三面図である。FIG. 3 is a three-view diagram illustrating a configuration example of a measurement head unit of the optical distance sensor of the triangulation system according to the first embodiment of the present invention. 本発明の実施の形態1に係る光学式変位センサのコントローラ部の構成を示す平面図である。It is a top view which shows the structure of the controller part of the optical displacement sensor which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係る光学式変位センサの構成を示すブロック図である。It is a block diagram which shows the structure of the optical displacement sensor which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係る光学式変位センサの演算部の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the calculating part of the optical displacement sensor which concerns on Embodiment 1 of this invention. 時系列のサンプリング値の変動とその他の値の関係を示す図である。It is a figure which shows the relationship between the fluctuation | variation of the sampling value of a time series, and another value. 途中でノイズが入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。It is a figure which shows the relationship between the fluctuation | variation of a time series sampling value, and other values when noise enters in the middle. 紙葉類を重ねて搬送する場合の変位量の変動を示す図である。It is a figure which shows the fluctuation | variation of the displacement amount in the case of conveying paper sheets in piles. 途中で測定レンジを外れた場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。It is a figure which shows the relationship between the fluctuation | variation of the sampling value of a time series, and another value when it remove | deviates from the measurement range in the middle. リセット入力が入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。It is a figure which shows the relationship between the fluctuation | variation of a time-sequential sampling value, and another value when reset input is input. タイミング入力が入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。It is a figure which shows the relationship between the fluctuation | variation of a time-sequential sampling value, and another value when a timing input is input. 第一の閾値の自動設定方法を説明するための模式図である。It is a schematic diagram for demonstrating the automatic setting method of a 1st threshold value. 本発明の実施の形態2に係る光学式変位センサの構成を示すブロック図である。It is a block diagram which shows the structure of the optical displacement sensor which concerns on Embodiment 2 of this invention. 本発明の実施の形態2に係る光学式変位センサの演算部の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the calculating part of the optical displacement sensor which concerns on Embodiment 2 of this invention.

以下、本発明の実施の形態に係る光学式変位センサについて、図面を参照しながら説明する。なお、参照する図面を通じて、同一又は同様の構成又は機能を有する要素については、同一又は同様の符号を付して、詳細な説明を省略する。   Hereinafter, an optical displacement sensor according to an embodiment of the present invention will be described with reference to the drawings. Throughout the drawings to be referred, elements having the same or similar configuration or function are denoted by the same or similar reference numerals, and detailed description thereof is omitted.

(実施の形態1)
図1は、本発明の実施の形態1に係る光学式変位センサの構成を示す模式図である。図1に示すように本実施の形態1に係る光学式変位センサ1は、照射した投射光L1がワーク(検出対象物)A1の表面で反射した反射光L2に基づいて、ワークA1の有無、ワークA1の所望の形状等を検出する変位センサである。光学式変位センサ1は、測定ヘッド部2、伝送ケーブル3及びコントローラ部4からなる変位検出装置であり、作業台A2上に載置されたワークA1の有無、ワークA1の所望の形状等を検出する。
(Embodiment 1)
FIG. 1 is a schematic diagram showing a configuration of an optical displacement sensor according to Embodiment 1 of the present invention. As shown in FIG. 1, the optical displacement sensor 1 according to the first embodiment includes the presence or absence of the workpiece A1 based on the reflected light L2 reflected by the irradiated projection light L1 on the surface of the workpiece (detection target) A1. It is a displacement sensor that detects a desired shape or the like of the workpiece A1. The optical displacement sensor 1 is a displacement detection device including a measurement head unit 2, a transmission cable 3, and a controller unit 4. The optical displacement sensor 1 detects the presence / absence of the workpiece A1 placed on the work table A2, the desired shape of the workpiece A1, and the like. To do.

測定ヘッド部2は、ワークA1に投射光L1を照射する投光器11と、投射光L1がワークA1の表面で反射した反射光L2を受光する受光器14とで、後述する測定部23を構成しており、受光器14の出力に基づいて投光器11の出力調整を行う。測定ヘッド部2は、例えば、ワークA1の製造ライン上に配置され、直下方向に投射光L1を照射する。   The measurement head unit 2 includes a projector 11 that irradiates the workpiece A1 with the projection light L1 and a light receiver 14 that receives the reflected light L2 that is reflected from the surface of the workpiece A1. The output of the projector 11 is adjusted based on the output of the light receiver 14. For example, the measurement head unit 2 is arranged on the production line of the workpiece A1, and irradiates the projection light L1 in the direction directly below.

伝送ケーブル3は、電力供給線として測定ヘッド部2に電力を供給するとともに、受光器14の出力をコントローラ部4へ伝送し、制御信号をコントローラ部4から測定ヘッド部2へ伝送する通信線として機能する。通信方式としては、RS485通信の他、RS422通信、RS232通信、LVDS、Ethernet(登録商標)等、データ通信することが可能な方式であればなんでも良い。また、伝送ケーブル3を用いて通信する代わりに無線で通信しても良い。   The transmission cable 3 serves as a communication line for supplying power to the measurement head unit 2 as a power supply line, transmitting the output of the light receiver 14 to the controller unit 4, and transmitting a control signal from the controller unit 4 to the measurement head unit 2. Function. As a communication method, any method can be used as long as data communication is possible, such as RS422 communication, RS232 communication, LVDS, Ethernet (registered trademark), in addition to RS485 communication. In addition, communication may be performed wirelessly instead of using the transmission cable 3.

コントローラ部4は、受光器14で受光した反射光L2の受光スポットの位置を検出し、検出した結果に基づいてワークA1の有無の判別、変位量の算出等を行う。コントローラ部4の筐体における一面には、各種操作キー、ワークA1の有無、結果等を表示するための表示部等が配置されている。   The controller unit 4 detects the position of the light receiving spot of the reflected light L2 received by the light receiver 14, and determines the presence / absence of the workpiece A1 and calculates the displacement amount based on the detected result. On one surface of the casing of the controller unit 4, various operation keys, the presence / absence of the workpiece A1, the display unit for displaying the result, and the like are arranged.

なお、受光器14の出力に基づく受光スポットの位置の検出は、図示しないPLC(Programmable Logic Controller:プラグラマブルロジックコントローラ)などの外部機器から入力されるタイミング信号をトリガとして行われるように構成しても良い。   The position of the light receiving spot based on the output of the light receiver 14 is configured to be triggered by a timing signal input from an external device such as a PLC (Programmable Logic Controller) (not shown). Also good.

図2は、本発明の実施の形態1に係る三角測距方式の光学式変位センサ1の測定ヘッド部2の構成例を示す三面図である。測定ヘッド部2は、投光器11、投光レンズ12、受光レンズ13及び受光器14を備え、筐体の側面にLED表示灯15a〜15cからなるヘッドインジケータ15が配置されている。   FIG. 2 is a three-view diagram illustrating a configuration example of the measurement head unit 2 of the triangular distance measuring optical displacement sensor 1 according to the first embodiment of the present invention. The measurement head unit 2 includes a light projector 11, a light projection lens 12, a light receiving lens 13, and a light receiver 14, and a head indicator 15 including LED indicator lights 15a to 15c is disposed on a side surface of the housing.

投光器11は、投射光L1を生成する光源装置であり、LD(レーザーダイオード)、LED等の発光素子で構成されている。投光レンズ12は、投光器11から照射された投射光L1を集光するための集光レンズであり、投光器11よりもワークA1側に配置されている。投光レンズ12を透過した投射光L1は、筐体前面に設けられた矩形状の投光窓2aを介してワークA1に照射される。   The projector 11 is a light source device that generates the projection light L1, and includes a light emitting element such as an LD (laser diode) or an LED. The light projecting lens 12 is a condensing lens for condensing the projection light L <b> 1 irradiated from the light projector 11, and is disposed closer to the work A <b> 1 than the light projector 11. The projection light L1 that has passed through the light projection lens 12 is irradiated onto the workpiece A1 through a rectangular light projection window 2a provided on the front surface of the housing.

受光レンズ13は、ワークA1に照射された投射光L1がワークA1の表面で反射した反射光L2を受光器14上に集光するための集光レンズであり、反射光L2は、筐体前面に設けられた受光窓2bを介して入射される。受光器14は、ワークA1からの反射光L2を受光する複数の受光素子が線状に配置され、各受光素子から受光量に応じた信号が出力される。具体的には、複数の受光要素が直線上に配置されたラインCCD(Charge Coupled Device:電荷結合素子)が受光器14として用いられている。もちろん、ラインCCDに限定されるものではなく、CMOS等の他の撮像素子やPSDを用いても良い。   The light receiving lens 13 is a condensing lens for condensing the reflected light L2 reflected on the surface of the work A1 by the projection light L1 applied to the work A1, and the reflected light L2 The light enters through the light receiving window 2b provided in the. In the light receiver 14, a plurality of light receiving elements that receive the reflected light L <b> 2 from the workpiece A <b> 1 are linearly arranged, and a signal corresponding to the amount of light received is output from each light receiving element. Specifically, a line CCD (Charge Coupled Device) in which a plurality of light receiving elements are arranged on a straight line is used as the light receiver 14. Of course, the imaging device is not limited to the line CCD, and other imaging devices such as CMOS or PSD may be used.

投光器11からワークA1に照射された光は、ワークA1の表面で反射され、ワークA1上における照射点の高さ、すなわち作業台A2からの距離に応じて受光器14上の異なる位置に集光する。なお、照射点の高さの変化による受光器14上における受光スポットの位置の変化が判別可能であれば、複数の受光素子が面状に配置された撮像素子を受光器14として用いても良い。   The light emitted from the projector 11 to the work A1 is reflected by the surface of the work A1, and is condensed at different positions on the light receiver 14 according to the height of the irradiation point on the work A1, that is, the distance from the work table A2. To do. Note that an imaging element in which a plurality of light receiving elements are arranged in a planar shape may be used as the light receiver 14 as long as the change in the position of the light receiving spot on the light receiver 14 due to the change in the height of the irradiation point can be determined. .

LED表示灯15aは、投射光L1の出力状態を示す表示灯であり、LED(Light Emitting Diode:発光ダイオード)で構成されている。LED表示灯15aは、例えば投射光L1が照射中である場合に緑色に点灯し、照射中でない場合に消灯する。LED表示灯15bは、コントローラ部4のセンサ出力状態を示す表示灯であり、例えばセンサ出力がオン状態である場合に消灯し、オフ状態である場合に赤色に点灯する。   The LED indicator lamp 15a is an indicator lamp that indicates the output state of the projection light L1, and is configured by an LED (Light Emitting Diode). For example, the LED indicator lamp 15a is lit in green when the projection light L1 is being irradiated, and is turned off when the projection light L1 is not being irradiated. The LED indicator lamp 15b is an indicator lamp that indicates the sensor output state of the controller unit 4. For example, the LED indicator lamp 15b is turned off when the sensor output is in the on state, and is lit red when the sensor output is in the off state.

LED表示灯15cは、ワークA1上における多重反射の有無を示す表示灯であり、例えばワークA1の表面で反射した反射光L2に多重反射によるものを含む場合に緑色に点灯し、多重反射によるものを含まない場合に消灯する。   The LED indicator lamp 15c is an indicator lamp that indicates the presence or absence of multiple reflection on the workpiece A1. For example, when the reflected light L2 reflected from the surface of the workpiece A1 includes multiple reflections, it lights in green and is due to multiple reflections. Turns off when does not contain.

図3は、本発明の実施の形態1に係る光学式変位センサ1のコントローラ部4の構成を示す平面図である。コントローラ部4は、匡体の一面に各種のLED表示灯24、25、27、28と、7セグメントLED表示部26とで構成された表示部21を備えている。LED表示灯24は、投射光L1の照射状態を示す表示灯であり、LEDで構成されている。LED表示灯24は、例えば投射光L1が照射中である場合に緑色に点灯し、照射中でない場合に消灯する。   FIG. 3 is a plan view showing the configuration of the controller unit 4 of the optical displacement sensor 1 according to Embodiment 1 of the present invention. The controller unit 4 includes a display unit 21 including various LED indicator lamps 24, 25, 27, and 28 and a 7-segment LED display unit 26 on one surface of the housing. The LED indicator lamp 24 is an indicator lamp that indicates the irradiation state of the projection light L1, and is composed of LEDs. For example, the LED indicator lamp 24 lights in green when the projection light L1 is being irradiated, and turns off when the projection light L1 is not being irradiated.

LED表示灯25は、コントローラ部4のセンサ出力状態を示す表示灯であり、例えばセンサ出力がオン状態である場合に消灯し、オフ状態である場合に赤色に点灯する。LED表示灯27は、動作モードを示す表示灯である。   The LED indicator lamp 25 is an indicator lamp that indicates the sensor output state of the controller unit 4. For example, the LED indicator lamp 25 is turned off when the sensor output is in the on state, and is lit red when the sensor output is in the off state. The LED indicator lamp 27 is an indicator lamp showing an operation mode.

LED表示灯28は、ワークA1上における多重反射の有無を示す表示灯であり、例えばワークA1の表面で反射した反射光L2に多重反射によるものを含む場合に緑色に点灯し、多重反射によるものを含まない場合に消灯する。   The LED indicator lamp 28 is an indicator lamp that indicates the presence or absence of multiple reflection on the workpiece A1, for example, when the reflected light L2 reflected by the surface of the workpiece A1 includes multiple reflection, it lights in green and is due to multiple reflection. Turns off when does not contain.

7セグメントLED表示部26は、変位量等を文字で表示する表示装置であり、表示部21内の中央に配置された6つの7セグメントLEDで構成されている。各7セグメントLEDは、筐体の一面で長手方向に配列されている。   The 7-segment LED display unit 26 is a display device that displays a displacement amount or the like in characters, and is configured by six 7-segment LEDs arranged at the center in the display unit 21. Each 7-segment LED is arranged in the longitudinal direction on one surface of the housing.

図4は、本発明の実施の形態1に係る光学式変位センサ1の構成を示すブロック図であり、コントローラ部4内の機能ブロックの一例も示されている。測定ヘッド部2は、測定部23、及びコントローラ部4とデータ通信する通信部22で構成されている。コントローラ部4は、各種の演算処理を実行する演算部41、必要な情報を記憶する記憶部42、測定ヘッド部2とデータ通信する通信部43、表示部21、及びコントローラ間通信部46により構成されている。   FIG. 4 is a block diagram showing a configuration of the optical displacement sensor 1 according to Embodiment 1 of the present invention, and an example of functional blocks in the controller unit 4 is also shown. The measurement head unit 2 includes a measurement unit 23 and a communication unit 22 that performs data communication with the controller unit 4. The controller unit 4 includes an arithmetic unit 41 that executes various arithmetic processes, a storage unit 42 that stores necessary information, a communication unit 43 that performs data communication with the measurement head unit 2, a display unit 21, and an inter-controller communication unit 46. Has been.

演算部41は、マイコン、CPU等で構成される。記憶部42は、EEPROM、フラッシュメモリ等で構成され、段差候補となる期間、すなわち段差期間であるか否かを判別する段差期間閾値(第二の閾値)421、段差であるか否かを判別する段差判別閾値(第一の閾値)422、段差期間内での変位量の最大値を示すピークホールド値423、基準変位424を、それぞれ記憶する。   The calculation unit 41 is configured by a microcomputer, a CPU, and the like. The storage unit 42 is composed of an EEPROM, a flash memory, etc., and determines whether or not it is a step period threshold (second threshold) 421 that determines whether or not it is a step candidate period, that is, a step period. The step determination threshold (first threshold) 422, the peak hold value 423 indicating the maximum displacement amount within the step period, and the reference displacement 424 are stored.

また、コントローラ間通信部46は、光学式変位センサ1を2台以上用いる場合に、コントローラ部4同士で情報を交換する。コントローラ間の通信にCAN通信、光通信等を用いるが、特にこれに限定されるものではなく、互いにデータ通信することができれば、特に限定されるものではない。   Further, the inter-controller communication unit 46 exchanges information between the controller units 4 when two or more optical displacement sensors 1 are used. CAN communication, optical communication, or the like is used for communication between controllers, but is not particularly limited thereto, and is not particularly limited as long as data communication can be performed with each other.

演算部41の変位量算出部411は、図1に示す受光器14の各受光素子の受光量に基づいて受光器14上における受光スポットの位置、例えば1次元位置を検出し、検出した結果に基づいてワークA1の変位量を算出する。具体的には、受光素子が検出した受光量が受光素子ごとに判別され、各受光素子の配列方向に関する受光量の1次元位置の分布から受光スポットが抽出される。抽出された受光スポットのピーク位置又は重心位置に基づいて変位量が算出される。変位量として、ワークA1上における照射点の、投射光L1の光軸方向における位置が算出される。   The displacement amount calculation unit 411 of the calculation unit 41 detects the position of the light receiving spot on the light receiver 14 based on the amount of light received by each light receiving element of the light receiver 14 shown in FIG. Based on this, the displacement amount of the workpiece A1 is calculated. Specifically, the amount of received light detected by the light receiving element is determined for each light receiving element, and a light receiving spot is extracted from the distribution of the one-dimensional position of the received light quantity in the arrangement direction of each light receiving element. A displacement amount is calculated based on the peak position or the gravity center position of the extracted light receiving spot. As the amount of displacement, the position of the irradiation point on the workpiece A1 in the optical axis direction of the projection light L1 is calculated.

サンプリング部412は、変位量算出部411により算出された変位量を所定のタイミングでサンプリングし、差分値算出部413は、前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する。ここで、「前回サンプリングした変位量」とは、直前のタイミングでサンプリングした変位量だけでなく、所定回前にサンプリングした変位量であっても良い。また、複数のタイミングでサンプリングした変位量から算出した、複数の変位量を代表する代表変位量も本発明における「前回サンプリングした変位量」に含まれる。また、差分値は、前回サンプリングした変位量と今回サンプリングした変位量との単純な差としても良いし、前回サンプリングした時刻と今回サンプリングした時刻との時間差を考慮した値としても良い。   The sampling unit 412 samples the displacement amount calculated by the displacement amount calculation unit 411 at a predetermined timing, and the difference value calculation unit 413 calculates a difference value between the displacement amount sampled last time and the displacement amount sampled this time. Here, the “displacement amount sampled last time” may be not only the displacement amount sampled at the immediately preceding timing but also the displacement amount sampled a predetermined number of times before. Further, representative displacement amounts representing a plurality of displacement amounts calculated from displacement amounts sampled at a plurality of timings are also included in the “previously sampled displacement amount” in the present invention. The difference value may be a simple difference between the displacement amount sampled last time and the displacement amount sampled this time, or may be a value that takes into account the time difference between the time sampled last time and the time sampled this time.

段差期間判別部(判別手段)414は、算出した差分値に基づいて段差期間と非段差期間とを判別する。より具体的には、変位量の変動を捕捉し、変動する期間を段差とて認識する方法であるが、ノイズ等の段差以外による変動と段差による変動とを区別して、段差を認識する必要がある。しかし、正確に段差を判別するための適切な閾値を設定することが困難であるため、段差期間判別部414は、ノイズ等の段差以外による変動も含め、差分値が第二の閾値よりも大きい期間を段差期間と判別する。また、段差期間を安定して判別できるように変位量の変動があったタイミングを段差期間の開始タイミング(段差期間開始時点)と判別し、変位量の変動が落ち着いたとみなすことができるタイミングを段差期間の終了タイミングと判別するようにしている。ここで、「変位量の変動が落ち着いたとみなすことができる」とは、例えば差分値が第二の閾値を超えない期間が所定時間又は所定サンプリング回数連続することを意味する。なお、変位量の変動には、正方向と負方向との2方向があるが、段差とみなす変動の方向はユーザによる設定等により正方向又は負方向が予め定められており、変位量の変動の絶対値が大きくても段差とみなす変動の方向と逆方向の場合には、段差であると判別するべき変位量の変動はないとみなしている。   The step period determination unit (determination unit) 414 determines a step period and a non-step period based on the calculated difference value. More specifically, it is a method that captures fluctuations in the amount of displacement and recognizes the fluctuation period as a level difference. However, it is necessary to recognize the level difference by distinguishing fluctuations other than the level difference such as noise from fluctuations due to the level difference. is there. However, since it is difficult to set an appropriate threshold value for accurately determining the step, the step period determination unit 414 has a difference value larger than the second threshold value, including fluctuations due to other than the step such as noise. The period is determined as a step period. In addition, the timing at which the change in the amount of displacement has been determined as the start timing of the step period (at the start of the step period) so that the step period can be determined stably, and the timing at which the change in the amount of displacement can be considered to have settled It is discriminated from the end timing of the period. Here, “can be considered that the variation of the displacement amount has settled” means that, for example, a period in which the difference value does not exceed the second threshold continues for a predetermined time or a predetermined number of sampling times. There are two variations of displacement amount, positive direction and negative direction, but the direction of variation regarded as a step is determined in advance by the user's setting etc. Even if the absolute value of is large, it is considered that there is no change in the amount of displacement that should be determined to be a step if the direction of change is considered to be a step in the opposite direction.

基準変位特定部415は、段差期間と判別された期間における基準変位を特定し、段差判別部416は、現在の変位と基準変位との差分値を第一の閾値と比較して段差であるか否かを判別する。具体的には、段差期間開始時点の現在の変位を基準変位として特定する。出力部417は、段差であるか否かに関するON状態/OFF状態の判別信号を出力し、表示部21に表示する。すなわち、段差の変位量を、測定値として7セグメントLED表示部26で構成された表示部21に表示させる。出力部417は、段差であるか否かに関する判別信号に加え、表示部21に表示される段差の変位量を示すアナログ信号を出力するようにしても良い。   The reference displacement specifying unit 415 specifies the reference displacement in the period determined as the step period, and the step determining unit 416 compares the difference value between the current displacement and the reference displacement with the first threshold value to determine whether the step is a step. Determine whether or not. Specifically, the current displacement at the start of the step period is specified as the reference displacement. The output unit 417 outputs an ON / OFF state determination signal regarding whether or not it is a step, and displays it on the display unit 21. That is, the amount of displacement of the step is displayed on the display unit 21 configured with the 7-segment LED display unit 26 as a measured value. The output unit 417 may output an analog signal indicating the amount of displacement of the step displayed on the display unit 21 in addition to the determination signal regarding whether or not it is a step.

以下、上述した構成の光学式変位センサ1の動作について説明する。図5は、本発明の実施の形態1に係る光学式変位センサ1の演算部41の処理手順を示すフローチャートである。   Hereinafter, the operation of the optical displacement sensor 1 having the above-described configuration will be described. FIG. 5 is a flowchart showing a processing procedure of the calculation unit 41 of the optical displacement sensor 1 according to Embodiment 1 of the present invention.

図5において、光学式変位センサ1の演算部41は、所定のタイミングで変位量をサンプリングし(ステップS501)、現在の変位を基準変位に設定する(ステップS502)。その後、演算部41は、次の所定のタイミングで変位量をサンプリングし(ステップS503)、前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する(ステップS504)。   In FIG. 5, the calculation unit 41 of the optical displacement sensor 1 samples the displacement amount at a predetermined timing (step S501), and sets the current displacement as a reference displacement (step S502). Thereafter, the computing unit 41 samples the displacement amount at the next predetermined timing (step S503), and calculates a difference value between the displacement amount sampled last time and the displacement amount sampled this time (step S504).

演算部41は、算出した差分値が、第二の閾値以上であるか否かを判断する(ステップS505)。演算部41が、差分値が第二の閾値より小さいと判断した場合(ステップS505:NO)、演算部41は、現在の変位を新たな基準変位に設定し(ステップS506)、処理をステップS503へ戻して上述した処理を繰り返す。   The calculating unit 41 determines whether or not the calculated difference value is equal to or greater than a second threshold (step S505). When the calculation unit 41 determines that the difference value is smaller than the second threshold (step S505: NO), the calculation unit 41 sets the current displacement as a new reference displacement (step S506), and the process is performed in step S503. The process described above is repeated.

図6は、時系列のサンプリング値(各タイミングでサンプリングされた変位量)の変動とその他の値の関係を示す図である。上段のグラフは、サンプリング値の遷移を示すグラフであり、その直下の数値は各タイミングにおけるサンプリング値を示すものである。図6では、10、15、10、25、40、55、70・・・の順でサンプリング値が遷移している様子が示されている。前回サンプリングした変位量と今回サンプリングした変位量との差分値はこれに対応して、不定、5、−5、15、15、15、15・・・となる(図示せず)。図6では、段差であるか否かを判別する段差判別閾値(第一の閾値)を‘50’、段差期間であるか否かを判別する段差期間閾値(第二の閾値)を‘9’としている。また、ワンショット出力時の時間61を8msとしている。   FIG. 6 is a diagram illustrating a relationship between a variation in time-series sampling values (amount of displacement sampled at each timing) and other values. The upper graph is a graph showing the transition of the sampling value, and the numerical value immediately below it indicates the sampling value at each timing. FIG. 6 shows a state in which sampling values transition in the order of 10, 15, 10, 25, 40, 55, 70. Correspondingly, the difference value between the displacement amount sampled last time and the displacement amount sampled this time becomes indefinite 5, 5, -5, 15, 15, 15, 15... (Not shown). In FIG. 6, the step determination threshold (first threshold) for determining whether or not the step is “50”, and the step period threshold (second threshold) for determining whether or not the step is “9”. It is said. Further, the time 61 at the time of one-shot output is 8 ms.

図6に示すように、サンプリングを開始して最初の3回は、直前のサンプリング値(前回のサンプリング値)との差分値が第二の閾値‘9’より小さい‘5’、‘−5’又は不定であることから、ステップS505により、非段差期間又は不定であると判別される。なお、図6に示すとおり「段差期間フラグ」は、‘1’が段差期間中を、‘0’が非段差期間中を、‘−’が不定であることを、それぞれ示す。「基準変位」は、非段差期間中はそれぞれの時点での変位、すなわちサンプリングされた値が変更される都度更新される。これにより、緩やかな変動に対して基準変位を追従させることができ、段差以外による変位量の変動の影響を低減することができる。   As shown in FIG. 6, “5” and “−5”, which are smaller than the second threshold value “9”, are the difference values from the previous sampling value (previous sampling value) in the first three times after starting sampling. Alternatively, since it is indefinite, it is determined in step S505 that it is a non-step period or indefinite. As shown in FIG. 6, the “step period flag” indicates that “1” is during the step period, “0” is during the non-step period, and “−” is undefined. The “reference displacement” is updated each time the displacement at each time point, that is, the sampled value is changed during the non-step period. Thereby, the reference displacement can be made to follow a gradual change, and the influence of the change in the displacement amount due to other than the step can be reduced.

4回目におけるサンプリング値の差分値(前回サンプリングした変位量と今回サンプリングした変位量との差分値)は‘15’であり、第二の閾値‘9’以上であるので、3回目以降の期間が段差期間であると判別され、段差期間である旨を示すフラグを立てる(「段差期間フラグ」を‘0’から‘1’に変更する)とともに、「基準変位」の追従を中断する、つまり「基準変位」は、直前である3回目のサンプリング値‘10’に維持される。換言すると、「基準変位」は、段差期間中、該段差期間の直前の非段差期間における各サンプリング値を代表する値、この例では非段差期間の最後のサンプリング値‘10’に維持されることになる。図6に示される「差分値」は、サンプリング値から基準変位を減じた値であり、「基準変位」が、不定、10、15、10、10、10、10・・・と遷移しているため、「差分値」は、不定、不定、−5、15、30、45、60・・・と遷移している。   The difference value of the sampling value in the fourth time (the difference value between the displacement amount sampled last time and the displacement amount sampled this time) is “15”, which is equal to or greater than the second threshold value “9”. It is determined that it is a step period, and a flag indicating that it is a step period is set (the “step period flag” is changed from “0” to “1”), and the tracking of the “reference displacement” is interrupted, that is, “ The “reference displacement” is maintained at the sampling value “10” of the third time immediately before. In other words, the “reference displacement” is maintained at a value representative of each sampling value in the non-step period immediately before the step period, in this example, the last sampling value “10” in the non-step period during the step period. become. The “difference value” shown in FIG. 6 is a value obtained by subtracting the reference displacement from the sampling value, and the “reference displacement” transitions to indefinite, 10, 15, 10, 10, 10, 10,. Therefore, the “difference value” transitions to indefinite, indefinite, −5, 15, 30, 45, 60.

図5に戻って、光学式変位センサ1の演算部41が、差分値が第二の閾値以上であると判断した場合(ステップS505:YES)、その後、演算部41は、所定のタイミングで変位量をサンプリングし(ステップS507)、直前の所定回数内、例えば5回以内にサンプリングした変位量との差分値のいずれかが第二の閾値以上であるか否かを判断する、つまりステップS505における直近5回の判断のうち1回でもYESと判断したか否かにより変位量の変動が落ち着いたとみなすことができるか否かを判断する(ステップS508)。演算部41が、直前の所定サンプリング回数内のいずれかの差分値が第二の閾値以上であると判断した場合、つまり変位量の変動がまだ落ち着いていないと判断した場合(ステップS508:YES)、演算部41は、サンプリングした変位量と基準変位との差分値を算出し、差分値が既にピークホールド値として記憶部42に記憶されている値を超えている場合には、算出した差分値をピークホールド値として記憶部42に記憶し、差分値が既にピークホールド値として記憶部42に記憶されている値を超えていない場合には、記憶部42に記憶されているピークホールド値を更新せず(ステップS509)、処理をステップS507へ戻して上述した処理を繰り返す。   Returning to FIG. 5, when the calculation unit 41 of the optical displacement sensor 1 determines that the difference value is greater than or equal to the second threshold (step S505: YES), the calculation unit 41 then displaces at a predetermined timing. The amount is sampled (step S507), and it is determined whether any of the difference values from the displacement amount sampled within the predetermined number of times immediately before, for example, within 5 times is equal to or greater than the second threshold, that is, in step S505. It is determined whether or not it can be considered that the variation of the displacement amount has settled depending on whether or not it is determined to be YES at least once among the latest five determinations (step S508). When the calculation unit 41 determines that any difference value within the immediately preceding predetermined number of samplings is equal to or greater than the second threshold value, that is, when it is determined that the variation of the displacement amount has not yet settled (step S508: YES). The calculation unit 41 calculates a difference value between the sampled displacement amount and the reference displacement, and when the difference value exceeds the value stored in the storage unit 42 as the peak hold value, the calculated difference value is calculated. Is stored in the storage unit 42 as the peak hold value, and the peak hold value stored in the storage unit 42 is updated when the difference value does not exceed the value stored in the storage unit 42 as the peak hold value. Without (step S509), the process returns to step S507 and the above-described process is repeated.

演算部41が、直前の所定サンプリング回数内の各差分値がすべて第二の閾値より小さいと判断した場合、つまり変位量の変動が落ち着いたと判断した場合(ステップS508:NO)、記憶してあるピークホールド値が基準変位からの最大変動量に相当するため、段差による変動であるか否かを判別するために、演算部41は、記憶してあるピークホールド値が第一の閾値以上であるか否かを判断する(ステップS510)。演算部41が、記憶してあるピークホールド値が第一の閾値以上であると判断した場合(ステップS510:YES)、演算部41は、段差である旨を示す判別信号をワンショット出力する(ステップS511)。演算部41が、記憶してあるピークホールド値が第一の閾値より小さいと判断した場合(ステップS510:NO)、演算部41は、記憶してあるピークホールド値を0(ゼロ)にリセットし(ステップS512)、処理をステップS503へ戻して上述した処理を繰り返す。 When the calculation unit 41 determines that all the difference values within the immediately preceding predetermined number of samplings are all smaller than the second threshold value, that is, when it is determined that the variation of the displacement amount has settled (step S508: NO), it is stored. Since the peak hold value corresponds to the maximum fluctuation amount from the reference displacement, in order to determine whether or not the fluctuation is caused by a step, the calculation unit 41 has the stored peak hold value equal to or greater than the first threshold value. Is determined (step S510). When the calculation unit 41 determines that the stored peak hold value is greater than or equal to the first threshold value (step S510: YES), the calculation unit 41 outputs a determination signal indicating that it is a step (one shot) ( Step S511). When the calculation unit 41 determines that the stored peak hold value is smaller than the first threshold (step S510: NO), the calculation unit 41 resets the stored peak hold value to 0 (zero). (Step S512), the process is returned to step S503, and the above-described process is repeated.

図6に示すピークホールド値は、非段差期間においては0(ゼロ)であり、段差期間においては、サンプリング値又は差分値(サンプリング値から基準変位を減じた値)が増加するに従い15、30、45、60、75、90と増加していき、その後、サンプリング値又は差分値(サンプリング値から基準変位を減じた値)が減少した場合であっても、該段差期間における最大値である‘90’が維持される。換言すれば、段差期間における各サンプリング値の中から該段差期間を代表するサンプリング値を求めるものであり、この例では段差期間の最大サンプリング値‘100’が該段差期間の各サンプリング値を代表するサンプリング値に相当する。そして、段差期間を代表するサンプリング値と該段差期間の直前の非段差期間を代表するサンプリング値に基づいて該段差期間における段差を示す段差代表値を求めるものであり、この例では、段差期間の最大サンプリング値‘100’と該段差期間の直前の非段差期間における各サンプリング値を代表する値である基準変位‘10’との差分‘90’が該段差期間の段差代表値に相当する。   The peak hold value shown in FIG. 6 is 0 (zero) in the non-step period, and in the step period, 15, 30, as the sampling value or the difference value (a value obtained by subtracting the reference displacement from the sampling value) increases. Even when the sampling value or the difference value (the value obtained by subtracting the reference displacement from the sampling value) is decreased, it is the maximum value in the step period '90. 'Is maintained. In other words, the sampling value representative of the step period is obtained from the sampling values in the step period. In this example, the maximum sampling value '100' of the step period represents each sampling value of the step period. Corresponds to the sampling value. Then, based on the sampling value representative of the step period and the sampling value representative of the non-step period immediately before the step period, a step representative value indicating the step in the step period is obtained. A difference “90” between the maximum sampling value “100” and the reference displacement “10” that represents each sampling value in the non-step period immediately before the step period corresponds to the step representative value of the step period.

図6に示す「カウント数」は、段差期間中に前回サンプリングした変位量と今回サンプリングした変位量との差分値が第二の閾値‘9’より小さい場合にカウントアップされ、該差分値が第二の閾値‘9’以上であると0(ゼロ)にリセットされる。すなわち、該差分値が連続して第二の閾値‘9’より小さいか否かを判定している。図6の例では、サンプリング値(サンプリングした変位量)が・・・85、100、100、60、0、0、0、0、0、0、15・・・と遷移しているため、前回サンプリングした変位量と今回サンプリングした変位量との差分値(図示しない)は・・・15、15、0、−40、−60、0、0、0、0、0、15・・・と遷移しており、カウント数は、・・・0、0、1、2、3、4、0、0、0、0、0・・・と遷移する。なお、この例では、段差期間が終了したと判断するための連続回数を4回とした例であり、カウント数が‘4’となったタイミングを段差期間が終了したタイミングと判断している。なお、この例では、非段差期間におけるカウント数を0(ゼロ)としている。 The “count number” shown in FIG. 6 is counted up when the difference value between the displacement amount sampled last time during the step period and the displacement amount sampled this time is smaller than the second threshold value “9”. If it is greater than or equal to the second threshold value '9', it is reset to 0 (zero). That is, it is determined whether or not the difference value is continuously smaller than the second threshold value “9”. In the example of FIG. 6, the sampling value (sampled displacement amount) transitions to 85, 100, 100, 60, 0, 0, 0, 0, 0, 0, 15. The difference value (not shown) between the sampled displacement amount and the currently sampled displacement amount is changed to 15, 15, 0, −40, −60, 0, 0, 0, 0, 0, 15. The count number changes as follows: 0, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0. In this example, the number of consecutive times for determining that the step period has ended is four, and the timing at which the count number becomes “4” is determined as the timing at which the step period ends. In this example, the count number in the non-step period is set to 0 (zero).

段差期間の開始から終了までのタイミングが確定することにより、段差期間における各サンプリング値を代表する値、該段差期間における段差を代表する段差代表値が確定する。ピークホールド値(段差期間における段差を代表する段差代表値)と段差であるか否かを判別する段差判別閾値(第一の閾値)とを比較し、図6の例では、ピークホールド値(段差期間における段差を代表する段差代表値)‘90’が段差判別閾値(第一の閾値)‘50’以上であるので、該段差期間における変位量の変動は段差によるものであると判断する。この場合、ピークホールド値(段差期間における段差を代表する段差代表値)‘90’を測定値として定め、定められた測定値は次の段差期間の確定により測定値が定められるまで値が保持される。また、図6の例では、段差期間が確定した場合であっても、ピークホールド値(段差期間における段差を代表する段差代表値)が段差判別閾値(第一の閾値)よりも小さい場合、測定値は更新されていないが、更新されるように構成しても良いことは言うまでもない。 By determining the timing from the start to the end of the step period, a value representative of each sampling value in the step period and a step representative value representative of the step in the step period are determined. The peak hold value (step representative value representative of the step in the step period) is compared with a step determination threshold (first threshold) for determining whether or not it is a step. In the example of FIG. Since the step representative value (“90” representing the step in the period) is greater than or equal to the step determination threshold (first threshold) “50”, it is determined that the change in the displacement amount during the step is due to the step. In this case, the peak hold value (step representative value representing the step in the step period) '90' is determined as the measurement value, and the determined measurement value is held until the measurement value is determined by determining the next step period. The In the example of FIG. 6, even when the step period is fixed, the measurement is performed when the peak hold value (step representative value representing the step in the step period) is smaller than the step determination threshold (first threshold). It goes without saying that the values are not updated, but may be configured to be updated.

測定値は表示部21に表示させるとともに、ピークホールド値(段差期間における段差を代表する段差代表値)と段差判別閾値(第一の閾値)とを比較し、段差期間における変位量の変動は段差によるものであると判断した場合、ワンショット出力時の時間である8msの間、段差である旨を示す判別信号を出力する(ON状態)。判別信号の出力時間(ON状態の時間)が8msを超えた場合、判別信号は自動的にOFF状態となる。 The measured value is displayed on the display unit 21 and the peak hold value (step representative value representing the step in the step period) is compared with the step determination threshold (first threshold). If it is determined that the difference is due to the above, a determination signal indicating that the level difference is present is output for 8 ms, which is the time for one-shot output (ON state). When the output time of the discrimination signal (ON state time) exceeds 8 ms, the discrimination signal is automatically turned off.

図7は、途中でノイズが入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。図7でも図6と同様、段差であるか否かを判別する段差判別閾値(第一の閾値)を‘50’、段差期間であるか否かを判別する段差期間閾値(第二の閾値)を‘9’としている。また、ワンショット出力時の時間を8msとしている。なお、図7における「サンプリング値」等の用語の定義は、特に再定義しない限り図6における用語の定義と同一である。   FIG. 7 is a diagram illustrating a relationship between time-series fluctuations in sampling values and other values when noise enters midway. In FIG. 7, as in FIG. 6, the step determination threshold (first threshold) for determining whether or not the step is “50”, and the step period threshold (second threshold) for determining whether or not the step is a step. Is set to '9'. The time for one-shot output is 8 ms. Note that definitions of terms such as “sampling value” in FIG. 7 are the same as those in FIG. 6 unless redefined.

図7の2つ目の山に示すように、サンプリングの途中でノイズが入ることにより、差分値が段差判別閾値‘50’を挟んで大きく上下動している。従来は、変位量の変動がノイズによる変動であるのか段差による変動であるのかを区別するための閾値を適切に設定することが困難であり、例えば閾値の設定が不適切である場合、ピークホールド値‘70’の状態では段差による変動であると判断してしまうおそれがあった。それに対して、本実施の形態1では、直近所定回の差分値に基づいて、サンプリング値の差分値が安定するまで段差期間であると判別することがない。つまり、第二の閾値は段差らしきものが存在する段差期間とそれ以外の期間である非段差期間とを判別するだけであるので、ノイズにより変位量が変動する期間も含めて段差期間としても良く、閾値として精緻な値の設定は要求されない。そして、基準変位からの各段差期間における最大変動量であるピークホールド値により最終的に各段差期間の変動が段差によるものであったか否かを判断することで、段差を正確に判別することができる。また、サンプリング値の差分値が安定した以後のピークホールド値‘105’を出力として表示する。   As shown in the second peak of FIG. 7, the noise value is moved up and down greatly with the step discrimination threshold value '50' sandwiched by the noise during sampling. Conventionally, it has been difficult to appropriately set a threshold value for distinguishing whether a variation in displacement is a variation due to noise or a variation due to a level difference. For example, when the threshold setting is inappropriate, peak hold In the state of the value “70”, there is a possibility that it is determined that the fluctuation is caused by a step. On the other hand, in the first embodiment, it is not determined that it is the step period until the difference value of the sampling value is stabilized based on the most recent predetermined difference value. In other words, since the second threshold value only determines a step period in which there appears to be a step and a non-step period that is other than that, it may be a step period including a period in which the displacement varies due to noise. A precise value is not required as the threshold value. Then, it is possible to accurately determine the step by determining whether or not the change in each step period is due to the step, based on the peak hold value that is the maximum amount of change in each step period from the reference displacement. . Further, the peak hold value '105' after the difference between the sampling values is stabilized is displayed as an output.

図6及び図7において、段差期間の終了は、直前のサンプリング値との各差分値が段差期間閾値より小さい値が所定回数連続するか否かで判断している。したがって、カウント数が‘4’になった時点でカウント数をリセットし、段差期間である旨を示すフラグを0(ゼロ)にする。そして、記憶してあるピークホールド値を測定値として表示部21に表示させる。また、ワンショット出力時の時間である8msの間、段差である旨を示す判別信号を出力する(ON状態)。8msを超えた場合、判別信号は自動的にOFF状態となる。さらに、判別信号を出力する出力線に加え、表示部21に表示される段差の変位量を示すアナログ信号を出力する出力線を設けてもよい。   6 and 7, the end of the step period is determined by whether or not each difference value from the immediately preceding sampling value is smaller than the step period threshold by a predetermined number of times. Therefore, the count number is reset when the count number reaches ‘4’, and the flag indicating the step period is set to 0 (zero). Then, the stored peak hold value is displayed on the display unit 21 as a measured value. In addition, a discrimination signal indicating that the level difference is present is output for 8 ms, which is the time for one-shot output (ON state). When 8 ms is exceeded, the determination signal is automatically turned off. Furthermore, in addition to the output line that outputs the discrimination signal, an output line that outputs an analog signal indicating the amount of displacement of the step displayed on the display unit 21 may be provided.

なお、表示部21に表示される段差の変位量は、次に段差が検出されるまで更新されることなく維持されるので、微分値、変位量等の表示値が瞬時に更新されることがなく、測定値を確実に表示することができる。したがって、従来は読み取ることが困難であった段差の大きさを視認することが容易となる。   In addition, since the displacement amount of the step displayed on the display unit 21 is maintained without being updated until the next step is detected, the display values such as the differential value and the displacement amount may be instantaneously updated. The measured value can be displayed reliably. Therefore, it becomes easy to visually recognize the size of the step that has been difficult to read in the past.

図8は、紙葉類を重ねて搬送する場合の変位量の変動を示す図である。図8(a)に示すように、紙葉類83がベルトコンベア82により重なって搬送される場合であっても、判別信号をワンショット出力とすることで、例えば図8(b)に示すように、段差による変位量81の立ち上がり変動が比較的急峻で、立ち下り変動が比較的緩やかな場合であっても、確実に各段差を検出することができる。   FIG. 8 is a diagram illustrating a change in the amount of displacement when paper sheets are stacked and conveyed. As shown in FIG. 8A, even when the paper sheet 83 is conveyed by being overlapped by the belt conveyor 82, the discrimination signal is set as a one-shot output, for example, as shown in FIG. In addition, even when the rising fluctuation of the displacement amount 81 due to the step is relatively steep and the falling fluctuation is relatively gentle, each step can be detected reliably.

途中で測定レンジを外れた場合、サンプリング値を取得することはできない。この場合、測定レンジに戻ってきた時点で基準変位を設定し直す必要が生じる。図9は、途中で測定レンジを外れた場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。図9でも、段差であるか否かを判別する段差判別閾値(第一の閾値)を‘50’、段差期間であるか否かを判別する段差期間閾値(第二の閾値)を‘9’としている。また、ワンショット出力時の時間を8msとしている。なお、図9における「サンプリング値」等の用語の定義は、特に再定義しない限り図6における用語の定義と同一である。   If the measurement range is out of the way, the sampling value cannot be acquired. In this case, it is necessary to reset the reference displacement when returning to the measurement range. FIG. 9 is a diagram showing the relationship between the variation of the time-series sampling value and other values when the measurement range is out of the way. Also in FIG. 9, the step determination threshold (first threshold) for determining whether or not the step is “50”, and the step period threshold (second threshold) for determining whether or not the step is “9”. It is said. The time for one-shot output is 8 ms. Note that definitions of terms such as “sampling value” in FIG. 9 are the same as those in FIG. 6 unless redefined.

図9の2つ目の山に示すように、サンプリング途中91でサンプリング値が測定レンジから外れたために、サンプリング値が取得できていない。この場合、サンプリング値の取得が再開された時点から、再度基準変位を設定し直すことで対応するので、サンプリング値の取得を再開してしばらくは差分値を取得することができない。したがって、測定値を出力しないので異常値を出力することがない。   As shown in the second peak of FIG. 9, the sampling value cannot be acquired because the sampling value deviates from the measurement range during sampling 91. In this case, since it corresponds by resetting the reference displacement again from the time when the acquisition of the sampling value is resumed, it is impossible to acquire the difference value for a while after the acquisition of the sampling value is resumed. Therefore, since no measurement value is output, no abnormal value is output.

また、基準変位を現在の変位に設定し直すのに、リセット入力を用いても良い(リセット手段)。この場合、リセット入力が入った時点における変位を基準変位として設定する。図10は、リセット入力が入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。図10でも、段差であるか否かを判別する段差判別閾値(第一の閾値)を‘50’、段差期間であるか否かを判別する段差期間閾値(第二の閾値)を‘9’としている。また、ワンショット出力時の時間を8msとしている。なお、図10における「サンプリング値」等の用語の定義は、特に再定義しない限り図6における用語の定義と同一である。   Further, a reset input may be used to reset the reference displacement to the current displacement (reset means). In this case, the displacement when the reset input is input is set as the reference displacement. FIG. 10 is a diagram illustrating the relationship between time-series sampling value fluctuations and other values when a reset input is input. Also in FIG. 10, the step determination threshold (first threshold) for determining whether or not the step is “50”, and the step period threshold (second threshold) for determining whether or not the step is “9”. It is said. The time for one-shot output is 8 ms. Note that definitions of terms such as “sampling value” in FIG. 10 are the same as those in FIG. 6 unless redefined.

図10のリセット入力のパルス波形に示すように2つ目の山で順次サンプリング値を取得し、差分値を算出している途中でリセット入力が入った場合、リセット入力が入った時点の現在の変位‘45’を基準変位に設定する。この場合、記憶されるピークホールド値が小さくなるので、出力される値も小さくなる。   As shown in the pulse waveform of the reset input in FIG. 10, when the sampling value is sequentially acquired at the second peak and the reset input is input while the difference value is being calculated, the current value at the time when the reset input is input Displacement '45' is set as a reference displacement. In this case, since the stored peak hold value is small, the output value is also small.

さらに、タイミング入力を受け付けることにより、所望のタイミングで取得したサンプリング値を無視し、出力を停止することもできる(停止指示受付手段)。図11は、タイミング入力が入った場合の、時系列のサンプリング値の変動とその他の値の関係を示す図である。図11でも、段差であるか否かを判別する段差判別閾値(第一の閾値)を‘50’、段差期間であるか否かを判別する段差期間閾値(第二の閾値)を‘9’としている。また、ワンショット出力時の時間を8msとしている。なお、図11における「サンプリング値」等の用語の定義は、特に再定義しない限り図6における用語の定義と同一である。   Furthermore, by accepting the timing input, the sampling value acquired at the desired timing can be ignored and the output can be stopped (stop instruction accepting means). FIG. 11 is a diagram illustrating the relationship between time-series fluctuations in sampling values and other values when a timing input is input. Also in FIG. 11, the step determination threshold (first threshold) for determining whether or not the step is “50”, and the step period threshold (second threshold) for determining whether or not the step is “9”. It is said. The time for one-shot output is 8 ms. Note that definitions of terms such as “sampling value” in FIG. 11 are the same as those in FIG. 6 unless redefined.

図11のタイミング入力のパルス波形に示すように、オン状態である期間111の段差に基づいて取得したサンプリング値を無視し、オフ状態になった時点で、その時点のサンプリング値を基準変位‘100’として設定している。これにより、測定値を出力する必要がない部分については、タイミング入力を入れることで測定値が出力されないようにすることができる。   As shown in the pulse waveform of the timing input in FIG. 11, the sampling value acquired based on the step of the period 111 in the on state is ignored, and when the off state is entered, the sampling value at that point is used as the reference displacement '100. Set as'. Thereby, about the part which does not need to output a measured value, it can prevent that a measured value is output by inputting a timing input.

なお、光学式変位センサ1は、ユーザの指示に応じて測定した変位量に基づく第一の閾値を設定できるように構成しても良い。より具体的には、光学式変位センサ1は、段差の下段に対応する変位量をユーザの指示に応じて測定し、次に段差の上段に対応する変位量をユーザの指示に応じて測定することで、段差の上段に対応する変位量と段差の下段に対応する変位量との中間の値を第一の閾値として自動的に設定することができる。   Note that the optical displacement sensor 1 may be configured to set a first threshold value based on a displacement amount measured according to a user instruction. More specifically, the optical displacement sensor 1 measures the amount of displacement corresponding to the lower stage of the step according to the user's instruction, and then measures the amount of displacement corresponding to the upper stage of the step according to the user's instruction. Thus, an intermediate value between the amount of displacement corresponding to the upper stage of the step and the amount of displacement corresponding to the lower stage of the step can be automatically set as the first threshold value.

図12は、第一の閾値の自動設定方法を説明するための模式図である。図12(a)に示すように、まずワークA1の段差の下段に対応する変位量122を取得し、ユーザがSETボタン等を操作することにより記憶される。次に図12(b)に示すように、ワークA1の段差の上段に対応する変位量123を取得し、ユーザがSETボタン等を操作することにより記憶される。そして、図12(c)に示すように、ワークA1の段差の上段に対応する変位量123と段差の下段に対応する変位量122との中間の値を第一の閾値121として設定する。なお、自動的に設定した後、ユーザにより第一の閾値を任意の値に調整することが可能に構成しても良いことは言うまでもない。   FIG. 12 is a schematic diagram for explaining the first threshold automatic setting method. As shown in FIG. 12A, first, a displacement 122 corresponding to the lower level of the step of the workpiece A1 is acquired and stored by the user operating the SET button or the like. Next, as shown in FIG. 12B, the displacement 123 corresponding to the upper level of the step of the work A1 is acquired and stored by the user operating the SET button or the like. Then, as shown in FIG. 12C, an intermediate value between the displacement amount 123 corresponding to the upper step of the workpiece A1 and the displacement amount 122 corresponding to the lower step of the step is set as the first threshold value 121. Needless to say, the first threshold value may be adjusted to an arbitrary value by the user after the automatic setting.

また、第二の閾値を、第一の閾値と一定の関係を持たせることで、第一の閾値を設定した場合に自動的に第二の閾値が決定するように構成しても良い。例えば、第一の閾値の10分の1の値を第二の閾値として設定する。   Further, the second threshold value may have a fixed relationship with the first threshold value so that the second threshold value is automatically determined when the first threshold value is set. For example, a value that is 1/10 of the first threshold is set as the second threshold.

第二の閾値は、段差期間の継続時間、サンプリング回数等に応じて調整することができるようにしても良いし、サンプリング周期の設定に連動して調整することができるように構成しても良い。例えば、サンプリング周期が短い場合には第一の閾値の10分の1の値を、サンプリング周期が長い場合には第一の閾値の3分の1の値を、それぞれ第二の閾値として設定する。   The second threshold value may be adjusted according to the duration of the step period, the number of samplings, or the like, or may be configured to be adjusted in conjunction with the setting of the sampling period. . For example, when the sampling period is short, the value of 1/10 of the first threshold is set as the second threshold, and when the sampling period is long, the value of 1/3 of the first threshold is set as the second threshold. .

なお、第二の閾値をユーザが設定することが可能に構成されている場合、表示部21に各段差期間の継続時間、サンプリング回数、あるいは各段差期間における前回サンプリングした変位量と今回サンプリングした変位量との差分値の最大値と最小値とを表示できるように構成し、ユーザに対して第二の閾値の設定に役立つ情報を表示させても良い。 When the second threshold is configured to be set by the user, the display unit 21 displays the duration of each step period, the number of times of sampling, or the displacement amount sampled last time and the displacement sampled this time in each step step period. The maximum value and the minimum value of the difference value with respect to the amount may be displayed, and information useful for setting the second threshold value may be displayed to the user.

また、判別した段差の数をカウントする段差カウント機能を備えても良い。 In addition, a step counting function for counting the number of steps determined may be provided.

なお、測定ヘッド部2とコントローラ部4とが分離した分離型の光学式変位センサについて説明したが、本発明は測定ヘッド部2とコントローラ部4とが一体となった一体型の光学式変位センサへも適用することが可能である。   Although the separation type optical displacement sensor in which the measurement head unit 2 and the controller unit 4 are separated has been described, the present invention is an integrated optical displacement sensor in which the measurement head unit 2 and the controller unit 4 are integrated. It is also possible to apply to.

以上のように本実施の形態1によれば、変位量が第二の閾値以上であると判断した時点から段差期間であると判別し、段差期間における変位量が第一の閾値以上である場合に段差であると判別することにより、ベルトコンベア等の搬送装置の振動等による変位量の変動、時間方向の変位量の変動等の影響を低減し、より確実に段差を検出することが可能となる。   As described above, according to the first embodiment, when the displacement amount is determined to be equal to or greater than the second threshold value, it is determined that the displacement period is the step period, and the displacement amount during the step period is equal to or greater than the first threshold value. It is possible to detect the step more reliably by reducing the influence of fluctuations in the displacement due to vibrations of the conveying device such as a belt conveyor, fluctuations in the displacement in the time direction, etc. Become.

(実施の形態2)
本発明の実施の形態2に係る光学式変位センサ1の構成は実施の形態1と同様であることから、同一の符号を付することにより、詳細な説明は省略する、本実施の形態2は、段差であるか否かを判別するのに、基準変位とサンプリング値との差分値を用いるのではなく、今回のサンプリング値と直前のサンプリング値との差分値を積算して用いる点で実施の形態1とは相違する。
(Embodiment 2)
Since the configuration of the optical displacement sensor 1 according to the second embodiment of the present invention is the same as that of the first embodiment, the same reference numerals are given to omit detailed description. In order to determine whether or not it is a step, the difference value between the reference displacement and the sampling value is not used, but the difference value between the current sampling value and the immediately preceding sampling value is integrated and used. This is different from Form 1.

図13は、本発明の実施の形態2に係る光学式変位センサ1の構成を示すブロック図であり、コントローラ部4内の機能ブロックの一例も示されている。測定ヘッド部2は、測定部23、及びコントローラ部4とデータ通信する通信部22で構成されている。コントローラ部4は、各種の演算処理を実行する演算部41、必要な情報を記憶する記憶部42、測定ヘッド部2とデータ通信する通信部43、表示部21、及びコントローラ間通信部46により構成されている。   FIG. 13 is a block diagram showing a configuration of the optical displacement sensor 1 according to Embodiment 2 of the present invention, and an example of functional blocks in the controller unit 4 is also shown. The measurement head unit 2 includes a measurement unit 23 and a communication unit 22 that performs data communication with the controller unit 4. The controller unit 4 includes an arithmetic unit 41 that executes various arithmetic processes, a storage unit 42 that stores necessary information, a communication unit 43 that performs data communication with the measurement head unit 2, a display unit 21, and an inter-controller communication unit 46. Has been.

演算部41は、マイコン、CPU等で構成される。記憶部42は、EEPROM、フラッシュメモリ等で構成され、段差期間であるか否かを判別する段差期間閾値(第二の閾値)421、段差であるか否かを判別する段差判別閾値(第一の閾値)422、段差期間内における変位量の最大値を示すピークホールド値423を、それぞれ記憶する。   The calculation unit 41 is configured by a microcomputer, a CPU, and the like. The storage unit 42 is configured by an EEPROM, a flash memory, or the like, and has a step period threshold (second threshold) 421 for determining whether or not it is a step period, and a step determination threshold (first threshold) for determining whether or not it is a step. , And a peak hold value 423 indicating the maximum value of the displacement amount within the step period.

また、コントローラ間通信部46は、光学式変位センサ1を2台以上用いる場合に、コントローラ部4同士で情報を交換する。コントローラ間の通信にCAN通信、光通信等を用いるが、特にこれに限定されるものではなく、互いにデータ通信することができれば、特に限定されるものではない。   Further, the inter-controller communication unit 46 exchanges information between the controller units 4 when two or more optical displacement sensors 1 are used. CAN communication, optical communication, or the like is used for communication between controllers, but is not particularly limited thereto, and is not particularly limited as long as data communication can be performed with each other.

演算部41の変位量算出部411は、図1に示す受光器14の各受光素子の受光量に基づいて受光器14上における受光スポットの位置、例えば1次元位置を検出し、検出した結果に基づいてワークA1の変位量を算出する。具体的には、受光素子が検出した受光量が受光素子ごとに判別され、各受光素子の配列方向に関する受光量の1次元位置の分布から受光スポットが抽出される。抽出された受光スポットのピーク位置又は重心位置に基づいて変位量が算出される。変位量として、ワークA1上における照射点の、投射光L1の光軸方向における位置が算出される。   The displacement amount calculation unit 411 of the calculation unit 41 detects the position of the light receiving spot on the light receiver 14 based on the amount of light received by each light receiving element of the light receiver 14 shown in FIG. Based on this, the displacement amount of the workpiece A1 is calculated. Specifically, the amount of received light detected by the light receiving element is determined for each light receiving element, and a light receiving spot is extracted from the distribution of the one-dimensional position of the amount of received light with respect to the arrangement direction of each light receiving element. A displacement amount is calculated based on the peak position or the gravity center position of the extracted light receiving spot. As the amount of displacement, the position of the irradiation point on the workpiece A1 in the optical axis direction of the projection light L1 is calculated.

サンプリング部412は、変位量算出部411により算出された変位量を所定のタイミングでサンプリングし、差分値算出部413は、前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する。段差期間判別部(判別手段)414は、算出した差分値に基づいて段差期間と非段差期間とを判別する。   The sampling unit 412 samples the displacement amount calculated by the displacement amount calculation unit 411 at a predetermined timing, and the difference value calculation unit 413 calculates a difference value between the displacement amount sampled last time and the displacement amount sampled this time. The step period determination unit (determination unit) 414 determines a step period and a non-step period based on the calculated difference value.

より具体的には、変位量の変動を捕捉し、変動する期間を段差とて認識する方法であるが、ノイズ等の段差以外による変動と段差による変動とを区別して、段差を認識する必要がある。しかし、正確に段差を判別するためには判別するための適切な閾値を設定することが困難であるため、段差期間判別部414は、ノイズ等の段差以外による変動も含め、差分値が第二の閾値よりも大きい期間を段差期間と判別する。また、段差期間を安定して判別できるように変位量の変動があったタイミングを段差期間の開始タイミング(段差期間開始時点)と判別し、変位量の変動が落ち着いたとみなすことができるタイミングを段差期間の終了タイミングと判別するようにしている。ここで、「変位量の変動が落ち着いたとみなすことができる」とは、例えば差分値が第二の閾値を超えない期間が所定時間又は所定サンプリング回数連続することを意味する。なお、変位量の変動には、正方向と負方向との2方向があるが、段差とみなす変動の方向はユーザによる設定等により正方向又は負方向が予め定められており、変位量の変動の絶対値が大きくても段差とみなす変動の方向と逆方向の場合には、検出すべき段差による変位量の変動はないとみなしている。   More specifically, it is a method that captures fluctuations in the amount of displacement and recognizes the fluctuation period as a level difference. However, it is necessary to recognize the level difference by distinguishing fluctuations other than the level difference such as noise from fluctuations due to the level difference. is there. However, since it is difficult to set an appropriate threshold value for accurate determination of a step, the step period determination unit 414 has a second difference value including a variation due to other than a step such as noise. A period larger than the threshold value is determined as a step period. In addition, the timing at which the change in the amount of displacement has been determined as the start timing of the step period (at the start of the step period) so that the step period can be determined stably, and the timing at which the change in the amount of displacement can be considered to have settled It is discriminated from the end timing of the period. Here, “can be considered that the variation of the displacement amount has settled” means that, for example, a period in which the difference value does not exceed the second threshold continues for a predetermined time or a predetermined number of sampling times. There are two variations of displacement amount, positive direction and negative direction, but the direction of variation regarded as a step is determined in advance by the user's setting etc. Even if the absolute value of is large, it is considered that there is no change in the displacement amount due to the step to be detected when the direction of the change is regarded as a step in the opposite direction.

差分積算部418は、段差期間と判別された期間における差分値の積算値を算出し、段差判別部416は、段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別する。出力部417は、段差であるか否かに関するON/OFFの判別信号を出力し、表示部21に表示する。すなわち、段差の変位量を、測定値として7セグメントLED表示部26で構成された表示部21に表示させる。   The difference integrating unit 418 calculates an integrated value of the difference values in the period determined as the step period, and the step determining unit 416 calculates the maximum integrated value calculated for each period determined as the step period and the first threshold value. To determine whether or not it is a step. The output unit 417 outputs an ON / OFF determination signal related to whether or not it is a step and displays it on the display unit 21. That is, the amount of displacement of the step is displayed on the display unit 21 configured with the 7-segment LED display unit 26 as a measured value.

以下、上述した構成の光学式変位センサ1の動作について説明する。図14は、本発明の実施の形態2に係る光学式変位センサ1の演算部41の処理手順を示すフローチャートである。   Hereinafter, the operation of the optical displacement sensor 1 having the above-described configuration will be described. FIG. 14 is a flowchart showing a processing procedure of the calculation unit 41 of the optical displacement sensor 1 according to Embodiment 2 of the present invention.

図14において、光学式変位センサ1の演算部41は、所定のタイミングで変位量をサンプリングし(ステップS1401)、次の所定のタイミングで変位量をサンプリングし(ステップS1402)、直前にサンプリングした変位量(前回サンプリングした変位量)と今回サンプリングした変位量との差分値を算出する(ステップS1403)。   In FIG. 14, the calculation unit 41 of the optical displacement sensor 1 samples the displacement amount at a predetermined timing (step S1401), samples the displacement amount at the next predetermined timing (step S1402), and the displacement sampled immediately before. A difference value between the amount (displacement amount sampled last time) and the displacement amount sampled this time is calculated (step S1403).

演算部41は、算出した差分値が、第二の閾値以上であるか否かを判断する(ステップS1404)。演算部41が、差分値が第二の閾値より小さいと判断した場合(ステップS1404:NO)、演算部41は、処理をステップS1402へ戻して上述した処理を繰り返す。   The calculating unit 41 determines whether or not the calculated difference value is equal to or greater than a second threshold (step S1404). When the calculation unit 41 determines that the difference value is smaller than the second threshold (step S1404: NO), the calculation unit 41 returns the process to step S1402 and repeats the above-described process.

演算部41が、差分値が第二の閾値以上であると判断した場合(ステップS1404:YES)、演算部41は、算出した差分値を積算する(ステップS1405)。ここで、変位量の変動があったタイミングを段差期間の開始タイミング(段差期間開始時点)と判別し、差分値は直前にサンプリングした変位量(前回サンプリングした変位量)に基づいて算出されるので、該段差期間の直前の非段差期間における最後のサンプリング値が該段差期間の直前の非段差期間における各サンプリング値を代表する値に相当する。   When the calculation unit 41 determines that the difference value is greater than or equal to the second threshold (step S1404: YES), the calculation unit 41 integrates the calculated difference value (step S1405). Here, the timing at which the displacement amount fluctuates is determined as the start timing of the step period (step point start time), and the difference value is calculated based on the displacement amount sampled immediately before (displacement amount sampled last time). The last sampling value in the non-step period immediately before the step period corresponds to a value representing each sampling value in the non-step period immediately before the step period.

演算部41は、次の所定のタイミングで変位量をサンプリングし(ステップS1406)、直前の所定回数内、例えば5回以内にサンプリングした変位量との差分値のいずれかが第二の閾値以上であるか否かを判断する(ステップS1407)。演算部41が、直前の所定回数内にサンプリングした変位量に基づくいずれかの差分値が第二の閾値以上であると判断した場合(ステップS1407:YES)、演算部41は、算出した差分値をさらに積算し(ステップS1408)、積算した積算値をピークホールド値として記憶部42に記憶し(ステップS1409)、処理をステップS1406へ戻して上述した処理を繰り返す。なお、算出した差分値を積算した積算値は、中間で取得したサンプリング値が順次相殺され、最初と最後に取得したサンプリング値に相当するが、最初のサンプリング値は該段差期間の直前の非段差期間における最後のサンプリング値であり、最後のサンプリング値は該段差期間における最大のサンプリング値に相当するものであるから、算出した差分値を積算した積算値のピークホールド値は、段差代表値に相当する。   The computing unit 41 samples the displacement amount at the next predetermined timing (step S1406), and any of the difference values from the displacement amount sampled within the previous predetermined number of times, for example, within 5 times, is greater than or equal to the second threshold value. It is determined whether or not there is (step S1407). When the calculation unit 41 determines that any difference value based on the amount of displacement sampled within the immediately preceding predetermined number of times is greater than or equal to the second threshold (step S1407: YES), the calculation unit 41 calculates the calculated difference value. (Step S1408), the integrated integrated value is stored in the storage unit 42 as a peak hold value (step S1409), the process returns to step S1406, and the above-described process is repeated. Note that the integrated value obtained by integrating the calculated difference values corresponds to the first and last acquired sampling values that are sequentially offset in the middle, and the first sampling value is the non-step difference immediately before the step period. This is the last sampling value in the period, and the last sampling value corresponds to the maximum sampling value in the step period. Therefore, the peak hold value of the integrated value obtained by integrating the calculated difference values corresponds to the step representative value. To do.

演算部41が、直前の所定回数内にサンプリングした変位量に基づく差分値がすべて第二の閾値より小さいと判断した場合(ステップS1407:NO)、演算部41は、記憶してあるピークホールド値が第一の閾値以上であるか否かを判断する(ステップS1410)。演算部41が、記憶してあるピークホールド値が第一の閾値以上であると判断した場合(ステップS1410:YES)、演算部41は、段差である旨を示す判別信号をワンショット出力する(ステップS1411)。演算部41が、記憶してあるピークホールド値(段差代表値)が第一の閾値より小さいと判断した場合(ステップS1410:NO)、演算部41は、記憶してある積算値及びピークホールド値を0(ゼロ)にリセットし(ステップS1412)、処理をステップS1402へ戻して上述した処理を繰り返す。   When the calculation unit 41 determines that all the difference values based on the displacement amount sampled within the predetermined number of times immediately before are smaller than the second threshold value (step S1407: NO), the calculation unit 41 stores the peak hold value stored. Is greater than or equal to the first threshold (step S1410). When the calculation unit 41 determines that the stored peak hold value is greater than or equal to the first threshold value (step S1410: YES), the calculation unit 41 outputs a determination signal indicating that it is a step (one shot) ( Step S1411). When the calculation unit 41 determines that the stored peak hold value (step difference representative value) is smaller than the first threshold (step S1410: NO), the calculation unit 41 stores the accumulated value and peak hold value. Is reset to 0 (step S1412), the process returns to step S1402, and the above-described process is repeated.

実施の形態2においても、図9乃至図11と同様に、測定レンジを外れた場合であっても測定を継続することができ、リセット入力、タイミング入力を活用することができる。   In the second embodiment as well, as in FIGS. 9 to 11, measurement can be continued even when the measurement range is out of range, and reset input and timing input can be utilized.

以上のように本実施の形態2によれば、変位量を差分値の積算値として求めることができ、求めた変位量が第二の閾値以上であると判断した時点から段差期間であると判別し、段差期間における変位量が第一の閾値以上である場合に段差であると判別することにより、変位量の変動が搬送装置の振動によるものであるか段差によるものであるかを判断する閾値を比較的容易に設定することができ、段差が微小であっても確実に検出することが可能となる。また、測定値を確実に表示することができるので、従来は読み取ることが困難であった段差の大きさを視認することが容易となる。   As described above, according to the second embodiment, the displacement amount can be obtained as an integrated value of the difference values, and it is determined that the step period is from the time point when the obtained displacement amount is determined to be equal to or greater than the second threshold value. The threshold value for determining whether the change in the displacement amount is due to the vibration of the transport device or the step difference by determining that the displacement amount is a step when the displacement amount in the step period is equal to or greater than the first threshold value. Can be set relatively easily, and even if the step is very small, it can be reliably detected. In addition, since the measured value can be displayed reliably, it becomes easy to visually recognize the size of the step that has been difficult to read in the past.

なお、本発明は上記実施例に限定されるものではなく、本発明の趣旨の範囲内であれば多種の変更、改良等が可能である。   The present invention is not limited to the above-described embodiments, and various changes and improvements can be made within the scope of the present invention.

1 光学式変位センサ
2 測定ヘッド部
4 コントローラ部
11 投光器
14 受光器
21 表示部
41 演算部
42 記憶部
1 Optical displacement sensor 2 Measuring head
4 Controller unit 11 Projector 14 Receiver 21 Display unit 41 Calculation unit 42 Storage unit

Claims (12)

検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、
所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、
前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する差分値算出手段と、
算出した差分値に基づいて段差期間と非段差期間とを判別する判別手段と、
前記段差期間と判別された期間における差分値の積算値を算出する差分積算手段と、
前記段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別する段差判別手段と、
段差であるか否かに関する判別信号を出力する出力手段と
を備えることを特徴とする光学式変位センサ。
In an optical displacement sensor that irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver to obtain a displacement amount of the detection object.
Displacement amount calculating means for calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing; and
Difference value calculating means for calculating a difference value between the displacement amount sampled last time and the displacement amount sampled this time;
A discriminating means for discriminating a step period and a non-step period based on the calculated difference value;
A difference integration means for calculating an integrated value of the difference values in the period determined as the step period;
A step determining means for comparing the maximum value of the integrated value calculated for each period determined as the step period and a first threshold to determine whether or not the step is a step;
An optical displacement sensor comprising: output means for outputting a determination signal regarding whether or not a step.
前記段差期間と判別された期間において算出した差分値の積算値を表示する表示手段を備えることを特徴とする請求項1記載の光学式変位センサ。   2. The optical displacement sensor according to claim 1, further comprising display means for displaying an integrated value of the difference values calculated in the period determined as the step period. 前記段差期間と判別された期間において算出した差分値の積算値をゼロにリセットするリセット手段を備えることを特徴とする請求項1又は2記載の光学式変位センサ。   3. The optical displacement sensor according to claim 1, further comprising a reset unit that resets an integrated value of the difference values calculated in the period determined as the step period to zero. 検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、
所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、
前回サンプリングした変位量と今回サンプリングした変位量との差分値を算出する差分値算出手段と、
算出した差分値に基づいて段差期間と非段差期間とを判別する判別手段と、
前記段差期間と判別された期間における基準変位を特定する基準変位特定手段と、
現在の変位と前記基準変位との差分値を第一の閾値と比較して段差であるか否かを判別する段差判別手段と、
段差であるか否かに関する判別信号を出力する出力手段と
を備えることを特徴とする光学式変位センサ。
In an optical displacement sensor that irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver to obtain a displacement amount of the detection object.
Displacement amount calculating means for calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing; and
Difference value calculating means for calculating a difference value between the displacement amount sampled last time and the displacement amount sampled this time;
A discriminating means for discriminating a step period and a non-step period based on the calculated difference value;
Reference displacement specifying means for specifying a reference displacement in a period determined as the step period;
A step determining means for comparing the difference value between the current displacement and the reference displacement with a first threshold to determine whether or not it is a step;
An optical displacement sensor comprising: output means for outputting a determination signal regarding whether or not a step.
前記段差期間と判別された期間において前記基準変位を現在の変位にリセットするリセット手段を備えることを特徴とする請求項4記載の光学式変位センサ。   5. The optical displacement sensor according to claim 4, further comprising reset means for resetting the reference displacement to a current displacement in a period determined as the step period. 前記判別手段は、前記タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値以上であると判断された期間を段差期間であると判別するようにしてあることを特徴とする請求項1乃至5のいずれか一項に記載の光学式変位センサ。   The determination means determines whether or not the difference value is greater than or equal to a second threshold at each timing, and determines that a period determined to be greater than or equal to the second threshold is a step period. The optical displacement sensor according to any one of claims 1 to 5, wherein: 前記判別手段は、前記タイミングごとに差分値が第二の閾値以上であるか否かを判断し、第二の閾値より小さいと判断された期間であっても、直前の所定期間内でいずれかの差分値が第二の閾値以上であると判断した場合には、段差期間であると判別するようにしてあることを特徴とする請求項1乃至5のいずれか一項に記載の光学式変位センサ。   The determination means determines whether or not the difference value is equal to or greater than a second threshold value at each timing, and even if it is determined that the difference value is less than the second threshold value, 6. The optical displacement according to claim 1, wherein when it is determined that the difference value is equal to or greater than the second threshold value, it is determined that the difference period is a step period. 6. Sensor. 前記変位量を出力することを停止する停止指示を受け付ける停止指示受付手段を備えることを特徴とする請求項1乃至7のいずれか一項に記載の光学式変位センサ。   The optical displacement sensor according to any one of claims 1 to 7, further comprising stop instruction receiving means for receiving a stop instruction for stopping outputting the displacement amount. 前記出力手段は、前記判別信号を、一定の時間幅を有するワンショットパルス信号として出力するようにしてあることを特徴とする請求項1乃至8のいずれか一項に記載の光学式変位センサ。   9. The optical displacement sensor according to claim 1, wherein the output unit outputs the determination signal as a one-shot pulse signal having a certain time width. 検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおいて、
所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する変位量算出手段と、
前記変位量の変動に基づいて段差期間と非段差期間とを判別する判別手段と、
段差期間に取得した変位量に基づく段差の上段又は下段の一方を表す第1代表値と、該段差期間の直前の非段差期間に取得した変位量に基づく段差の上段又は下段の他方を表す第2代表値とに基づいて段差代表値を算出する段差算出手段と、
前記段差期間と判別された期間ごとに算出した段差代表値と第一の閾値とを比較して段差であるか否かを判別する段差判別手段と、
段差であるか否かに関する判別信号を出力する出力手段と
を備えることを特徴とする光学式変位センサ。
In an optical displacement sensor that irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver to obtain a displacement amount of the detection object.
Displacement amount calculating means for calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing; and
A discriminating means for discriminating a step period and a non-step period based on a change in the displacement amount;
A first representative value representing one of the upper or lower steps of the step based on the displacement amount acquired during the step period, and a first representative value representing the other of the upper or lower steps based on the displacement amount acquired during the non-step period immediately before the step period. Step calculating means for calculating a step representative value based on the two representative values;
A step determining means for comparing the step representative value calculated for each period determined as the step period and a first threshold to determine whether or not it is a step;
An optical displacement sensor comprising: output means for outputting a determination signal regarding whether or not a step.
検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおける段差検出方法において、
所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する工程と、
算出した変位量の差分値に基づいて段差期間と非段差期間とを判別する工程と、
前記段差期間と判別された期間における差分値の積算値を算出する工程と、
前記段差期間と判別された期間ごとに算出した積算値の最大値と第一の閾値とを比較して段差であるか否かを判別する工程と、
段差であるか否かに関する判別信号を出力する工程と
を含むことを特徴とする段差検出方法。
In a step detection method in an optical displacement sensor that irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver to obtain a displacement amount of the detection object.
Calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing;
Determining a step period and a non-step period based on a difference value of the calculated displacement amount;
Calculating an integrated value of difference values in the period determined as the step period;
Comparing the maximum value of the integrated value calculated for each period determined as the step period and a first threshold value to determine whether or not it is a step;
And a step of outputting a determination signal regarding whether or not it is a step.
検出対象物に投射光を照射し、該検出対象物で反射した反射光を、受光器を用いて受光して検出対象物の変位量を取得する光学式変位センサにおける段差検出方法において、
所定のタイミングでサンプリングして取得する前記受光器の受光信号に基づいて前記検出対象物の変位量を算出する工程と、
算出した変位量の差分値に基づいて段差期間と非段差期間とを判別する工程と、
前記段差期間と判別された期間における基準変位を特定する工程と、
現在の変位と前記基準変位との差分値を第一の閾値と比較して段差であるか否かを判別する工程と、
段差であるか否かに関する判別信号を出力する工程と
を含むことを特徴とする段差検出方法。
In a step detection method in an optical displacement sensor that irradiates a detection object with projection light and receives reflected light reflected by the detection object using a light receiver to obtain a displacement amount of the detection object.
Calculating a displacement amount of the detection object based on a light reception signal of the light receiver obtained by sampling at a predetermined timing;
Determining a step period and a non-step period based on a difference value of the calculated displacement amount;
Identifying a reference displacement in a period determined as the step period;
Comparing the difference value between the current displacement and the reference displacement with a first threshold value to determine whether or not it is a step;
And a step of outputting a determination signal regarding whether or not it is a step.
JP2010280898A 2010-12-16 2010-12-16 Optical displacement sensor and step detection method in the optical displacement sensor Expired - Fee Related JP5679427B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010280898A JP5679427B2 (en) 2010-12-16 2010-12-16 Optical displacement sensor and step detection method in the optical displacement sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010280898A JP5679427B2 (en) 2010-12-16 2010-12-16 Optical displacement sensor and step detection method in the optical displacement sensor

Publications (2)

Publication Number Publication Date
JP2012127865A true JP2012127865A (en) 2012-07-05
JP5679427B2 JP5679427B2 (en) 2015-03-04

Family

ID=46645061

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010280898A Expired - Fee Related JP5679427B2 (en) 2010-12-16 2010-12-16 Optical displacement sensor and step detection method in the optical displacement sensor

Country Status (1)

Country Link
JP (1) JP5679427B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107677220A (en) * 2017-10-19 2018-02-09 江苏杰士德精密工业有限公司 Mobile phone display screen support offset detection device
JP2018136260A (en) * 2017-02-23 2018-08-30 オムロン株式会社 Optical measuring device
JP2019060699A (en) * 2017-09-26 2019-04-18 オムロン株式会社 Displacement measuring device, system, and displacement measuring method
JP2021117131A (en) * 2020-01-28 2021-08-10 キヤノン株式会社 Displacement meter and article manufacturing method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0476409A (en) * 1990-07-18 1992-03-11 Toyota Motor Corp Level-difference detection
JPH07270187A (en) * 1994-03-31 1995-10-20 Keyence Corp Method and apparatus for optically measuring displacement amount
JPH10305379A (en) * 1997-05-12 1998-11-17 Nippon Steel Corp Butt position detector
JP2000241561A (en) * 1999-02-17 2000-09-08 Matsushita Electric Ind Co Ltd Bed state detection device and method
JP2002022419A (en) * 2000-07-10 2002-01-23 Sankyo Eng Kk Crack width measuring device
JP2005326387A (en) * 2003-09-19 2005-11-24 Omron Corp Continuous sensor system
JP2008020316A (en) * 2006-07-12 2008-01-31 Omron Corp Displacement sensor

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0476409A (en) * 1990-07-18 1992-03-11 Toyota Motor Corp Level-difference detection
JPH07270187A (en) * 1994-03-31 1995-10-20 Keyence Corp Method and apparatus for optically measuring displacement amount
JPH10305379A (en) * 1997-05-12 1998-11-17 Nippon Steel Corp Butt position detector
JP2000241561A (en) * 1999-02-17 2000-09-08 Matsushita Electric Ind Co Ltd Bed state detection device and method
JP2002022419A (en) * 2000-07-10 2002-01-23 Sankyo Eng Kk Crack width measuring device
JP2005326387A (en) * 2003-09-19 2005-11-24 Omron Corp Continuous sensor system
JP2008020316A (en) * 2006-07-12 2008-01-31 Omron Corp Displacement sensor

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018136260A (en) * 2017-02-23 2018-08-30 オムロン株式会社 Optical measuring device
JP2019060699A (en) * 2017-09-26 2019-04-18 オムロン株式会社 Displacement measuring device, system, and displacement measuring method
JP7024285B2 (en) 2017-09-26 2022-02-24 オムロン株式会社 Displacement measuring device, system, and displacement measuring method
CN107677220A (en) * 2017-10-19 2018-02-09 江苏杰士德精密工业有限公司 Mobile phone display screen support offset detection device
CN107677220B (en) * 2017-10-19 2024-04-05 江苏杰士德精密工业有限公司 Mobile phone display screen support break-make detection equipment
JP2021117131A (en) * 2020-01-28 2021-08-10 キヤノン株式会社 Displacement meter and article manufacturing method
JP7408416B2 (en) 2020-01-28 2024-01-05 キヤノン株式会社 Displacement meter and article manufacturing method

Also Published As

Publication number Publication date
JP5679427B2 (en) 2015-03-04

Similar Documents

Publication Publication Date Title
US7639374B2 (en) Optical displacement sensor
US6567159B1 (en) System for recognizing a gaming chip and method of use
CN101196570B (en) Optical displacement sensor and optical displacement measurement device
EP2363736B1 (en) Photoelectric sensor and method for aiding checking of threshold
JP5679427B2 (en) Optical displacement sensor and step detection method in the optical displacement sensor
US9097814B2 (en) Photoelectric sensor and method for aiding operational checking of photoelectric sensor
ITMO20110031A1 (en) METHOD OF ACQUISITION OF IMAGES
EP2230537A3 (en) Photoelectric sensor for sensing a target
JP5974561B2 (en) Optical sensor and setting method for sensitivity adjustment control
EP3104193A1 (en) Distance measurement apparatus
JP4887057B2 (en) Photoelectric sensor
US7305321B2 (en) Multiple sensor system
JP2014202614A (en) Infrared detector and detection method of detection object
EP1262800A3 (en) Optoelectronic sensor
KR100728482B1 (en) Displacement sensor with automatic setting means of measuring area
US20130242089A1 (en) Apparatus for measuring distance and method thereof
CN114234957A (en) A Node Recognition Method Based on Magnetic Stripe Navigation Data Code
EP1469297A3 (en) Methods and devices for measuring fundamental data of lenses
MX2021002723A (en) System and method for measurement selection and probe guiding in a gingivitis detector.
JP2020036227A (en) Imaging timing control device, imaging system, and imaging method
KR101750617B1 (en) Visible light motion sensing device
US20240071173A1 (en) Casino token counting systems, devices, and methods
JP7513948B2 (en) Photoelectric Sensor
JP7483205B2 (en) Photoelectric Sensor
JP7053070B1 (en) Dimension measurement device, dimensional measurement method and dimensional measurement program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130917

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140326

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140507

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140702

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: 20141224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141226

R150 Certificate of patent or registration of utility model

Ref document number: 5679427

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees