Photoelectric Sensor and Threshold Correction Method
By setting threshold values based on light conditions during object presence and absence, the sensor addresses fluctuating light issues, enhancing detection accuracy and reliability.
Patent Information
- Application Number
- JP2020042577
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-12
- Publication Date
- 2025-07-03
- Estimated Expiration
- 2040-03-12
AI Technical Summary
Conventional photoelectric sensors face issues in setting appropriate threshold values when the received light amount fluctuates greatly, especially when the background light is small, leading to inaccurate object detection.
The photoelectric sensor sets threshold values based on the received light amount during periods when an object is present and absent, using methods such as calculating correction values from maximum and minimum light amounts, averages, and variances to account for changes in light conditions.
This approach allows for more accurate threshold setting, reducing the influence of sudden light changes and improving object detection reliability over time.
Smart Images

Figure 0007702073000001 
Figure 0007702073000002 
Figure 0007702073000003
Abstract
Description
Technical Field
[0001] The present invention relates to a photoelectric sensor and a threshold setting method.
Background Art
[0002] Conventionally, threshold correction means calculates a ratio of a moving average of a received light amount at the time of OFF of a set threshold value with respect to an ON or OFF state immediately after optical axis adjustment between a light projecting unit and a light receiving unit as a reference state, and stores this ratio. A photoelectric sensor is known that includes means for generating an average value of the received light amount at the time of OFF, and correcting the threshold value by multiplying the average value of the received light amount at the time of OFF by the above ratio (see Patent Document 1). This photoelectric sensor is configured to maintain a stable detection state even when there is a change in the received light amount over time.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] In the photoelectric sensor described in Cited Document 1, for example, when the received light amount of the background is small and fluctuates greatly at the time of OFF, the set threshold value may become large, and there is a possibility that the threshold value cannot be set appropriately.
[0005] However, in the photoelectric sensor described in Cited Document 1, for example, when the received light amount of the background is small and fluctuates greatly at the time of OFF, the set threshold value may become large, and there is a possibility that the threshold value cannot be set appropriately.
[0006] Therefore, one of the objectives of the present invention is to provide a photosensor and a threshold setting method that can set a more appropriate threshold value for the change in the received light amount over time.
Means for Solving the Problems
[0007] A photosensor according to an aspect of the present invention is a photosensor for detecting an object, including a light receiving unit that receives light to obtain a received light amount, an object determination unit that determines the presence or absence of an object based on the received light amount and a threshold value, and a setting unit that sets a threshold value based on the received light amount during a period in which an object has been determined to be present and the received light amount during a period in which an object has been determined to be absent.
[0008] According to this aspect, the threshold value is set based on the received light amount during a period in which an object has been determined to be present and the received light amount during a period in which an object has been determined to be absent. As a result, it becomes possible to reflect both the change in the received light amount when an object is present and the change in the received light amount when an object is absent in the setting of the threshold value. Therefore, for example, compared with a conventional photosensor that is strongly affected by the change in the received light amount when an object is absent, the threshold value can be set more appropriately for the change in the received light amount over time.
[0009] In the above-described aspect, the setting unit may calculate a correction value based on one of the maximum and minimum received light amounts during a period in which an object has been determined to be present and the other of the maximum and minimum received light amounts during a period in which an object has been determined to be absent, and set the correction value as the threshold value.
[0010] According to this aspect, the correction value is calculated based on one of the maximum and minimum received light amounts during a period in which an object has been determined to be present and the other of the maximum and minimum received light amounts during a period in which an object has been determined to be absent. As a result, for example, it becomes possible to reflect both the maximum received light amount when an object is present and the minimum received light amount when an object is absent in the threshold value. Therefore, it is possible to set a threshold value in which the influence of a sudden change in the received light amount is suppressed.
[0011] In the above-described aspect, the setting unit may calculate a correction value based on the average of the received light amounts during the period when the object was determined to be present and the average of the received light amounts during the period when the object was determined not to be present, and set the correction value as the threshold value.
[0012] According to this aspect, a correction value is calculated based on the average of the received light amounts during the period when the object was determined to be present and the average of the received light amounts during the period when the object was determined not to be present. As a result, it becomes possible to reflect both the average of the received light amounts when the object is present and the average of the received light amounts when the object is not present in the threshold value. Therefore, it is possible to set a threshold value in which the influence of a sudden change in the received light amount is further suppressed.
[0013] In the above-described aspect, the setting unit may calculate a correction value based on a value based on the average and variance in the distribution of the received light amounts during the period when the object was determined to be present and a value based on the average and variance in the distribution of the received light amounts during the period when the object was determined not to be present, and set the correction value as the threshold value.
[0014] According to this aspect, a correction value is calculated based on a value based on the average and variance in the distribution of the received light amounts during the period when the object was determined to be present and a value based on the average and variance in the distribution of the received light amounts during the period when the object was determined not to be present. As a result, it becomes possible to reflect both the value based on the average and variance in the distribution of the received light amounts when the object is present and the value based on the average and variance in the distribution of the received light amounts when the object is not present in the threshold value. Therefore, it is possible to set a threshold value in which the influence of a sudden change in the received light amount is further suppressed.
[0015] In the above-described aspect, a setting determination unit is further provided that determines whether it is possible to set a threshold value based on the received light amount during the period when the object was determined to be present and the received light amount during the period when the object was determined not to be present, and the setting unit may set the threshold value when it is determined that it is possible to set the threshold value.
[0016] According to this aspect, it is determined whether it is possible to set a threshold value based on the amount of received light during the period when an object is determined to be present and the amount of received light during the period when no object is determined to be present. Thereby, for example, it becomes possible to monitor the difference between the amount of received light when an object is present and the amount of received light when no object is present, that is, the margin in setting the threshold value. Therefore, it is possible to appropriately determine whether it is possible to set the threshold value.
[0017] In the above-described aspect, the setting determination unit may determine whether it is possible to set a threshold value based on the difference between one of the maximum and minimum values of the amount of received light during the period when an object is determined to be present and the other of the maximum and minimum values of the amount of received light during the period when no object is determined to be present.
[0018] According to this aspect, it is determined whether it is possible to set a threshold value based on the difference between one of the maximum and minimum values of the amount of received light during the period when an object is determined to be present and the other of the maximum and minimum values of the amount of received light during the period when no object is determined to be present. Thereby, for example, it becomes possible to monitor the margin in setting the threshold value according to the difference between the maximum amount of received light when an object is present and the minimum amount of received light when no object is present. Therefore, it is possible to more appropriately determine whether it is possible to set the threshold value.
[0019] In the above-described aspect, the setting determination unit may determine whether it is possible to set a threshold value based on the difference between a value based on the mean and variance in the distribution of the amount of received light during the period when an object is determined to be present and a value based on the mean and variance in the distribution of the amount of received light during the period when no object is determined to be present.
[0020] According to this aspect, based on the difference between the value based on the mean and variance in the light reception amount distribution during the period when an object was determined to be present and the value based on the mean and variance in the light reception amount distribution during the period when no object was determined to be present, it is determined whether the threshold can be corrected. Thereby, according to the difference between the value based on the mean and variance in the light reception amount distribution when an object is present and the value based on the mean and variance in the light reception amount distribution when no object is present, it becomes possible to monitor the margin in setting the threshold. Therefore, it is possible to more appropriately determine whether the threshold can be set.
[0021] In the above-described aspect, when it is determined that the threshold cannot be set, an output unit that outputs that the threshold cannot be set may be further provided.
[0022] According to this aspect, when it is determined that the threshold cannot be set, it is output that the threshold cannot be set. Thereby, it is possible to notify that the change in the light reception amount over time has reached a level where the presence or absence of an object cannot be determined.
[0023] A threshold setting method according to another aspect of the present invention is a threshold setting method for a photoelectric sensor that detects an object, including a light reception step of receiving light to obtain a light reception amount, an object determination step of determining the presence or absence of an object based on the light reception amount and the threshold, and a setting step of setting the threshold based on the light reception amount during the period when an object was determined to be present and the light reception amount during the period when no object was determined to be present.
[0024] According to this aspect, the threshold is set based on the light reception amount during the period when an object was determined to be present and the light reception amount during the period when no object was determined to be present. Thereby, it becomes possible to reflect both the light reception amount changes when an object is present and when no object is present in the setting of the threshold. Therefore, for example, compared with the conventional threshold setting method that is strongly affected by the change in the light reception amount when no object is present, the threshold can be set more appropriately with respect to the change in the light reception amount over time.
Advantages of the Invention
[0025] According to the present invention, a more appropriate threshold value can be set for the change in the amount of received light over time.
Brief Description of the Drawings
[0026]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Embodiments for Carrying Out the Invention
[0027] Embodiments of the present invention will be described below. In the following description of the drawings, the same or similar parts are denoted by the same or similar reference numerals. However, the drawings are schematic. Therefore, specific dimensions and the like should be determined in light of the following description. Of course, there are also parts where the dimensional relationships and ratios are different between the drawings. Furthermore, the technical scope of the present invention should not be construed as being limited to the embodiments.
[0028] First, while referring to FIG. 1, the configuration of a photoelectric sensor according to an embodiment will be described. FIG. 1 is a block diagram illustrating a schematic configuration of a photoelectric sensor 100 in an embodiment.
[0029] As shown in FIG. 1, the photoelectric sensor 100 includes a light projecting unit 20, a light receiving unit 30, a display unit 40, an operation unit 45, a control unit 50, an external device I / F (interface) 60, a storage unit 70, an output unit 80, and a power supply unit 90. The light projecting unit 20, the light receiving unit 30, the display unit 40, the operation unit 45, the control unit 50, the I / F 60 for input / output to external devices, the storage unit 70, the output unit 80, and the power supply unit 90 are housed in a main body unit 10 described later.
[0030] However, the respective parts of the photoelectric sensor 100 are not limited to being housed in a single housing 30 main body unit 90. For example, the respective parts of the photoelectric sensor 100 may be housed separately into two or more parts.
[0031] The photoelectric sensor 100 of the present embodiment is a photoelectric sensor (also referred to as a photoelectric switch) that detects the presence or absence of an object TA by utilizing various properties of light. Photoelectric sensors are roughly classified into a reflection type that detects an object based on the amount of light received that is reflected by the object, and a transmission type that detects an object based on the light being blocked by the object. In the following description, unless otherwise specified, the reflection type photoelectric sensor will be described.
[0032] The light projecting unit 20 is for projecting light onto the object TA. The light projecting unit 20 includes, for example, an LED (Light Emitting Diode) 21 and an LED driving circuit 22.
[0033] The light receiving unit 30 is configured to receive light and obtain a light reception amount. The light receiving unit 30 includes, for example, a PD (photodiode) 31, an amplification circuit 32, and an A / D conversion circuit 33.
[0034] Here, while referring to FIG. 2, the principle by which a photoelectric sensor according to an embodiment detects an object will be described. FIG. 2 is a schematic diagram illustrating the detection principle of the photoelectric sensor 100 in an embodiment.
[0035] As shown in FIG. 2, the photoelectric sensor 100 includes a main body portion 10 and optical fibers 11 and 12 attached to the front surface of the main body portion 10. The optical fiber 11 is for light projection, and the other optical fiber 12 is for light reception. A head portion 13 including a lens or the like is attached to the tip of each of the optical fibers 11 and 12.
[0036] The optical fibers 11 and 12 are respectively inserted into insertion openings (not shown) on the front surface of the main body portion 10. The LED 21 of the light projecting unit 20 is disposed near the insertion opening of the light projection optical fiber 11, and the PD 31 of the light receiving unit 30 is disposed near the insertion opening of the light reception optical fiber 12.
[0037] When in use, the photoelectric sensor 100 is disposed with the head portion 13 at a predetermined distance from the object TA. The light emitted from the LED 21 of the light projecting unit 20 is emitted from the head portion 13 via the optical fiber 11. The light reflected by the object TA and incident on the head portion 13 reaches the PD 31 of the light receiving unit 30 via the optical fiber 12.
[0038] The light reception amount data generated by the light receiving unit 30 is input to the control unit 50, compared with a previously registered threshold value, it is determined whether light is reflected by the object TA, and the determination result is output.
[0039] In the example shown in FIG. 2, the photoelectric sensor 100 receives the light projected from the light projecting unit and reflected by the object TA by the light receiving unit, and determines that the state in which this reflected light is received is "object present".
[0040] Returning to the description of FIG. 1, the control unit 50 is configured to control the operations of each part of the photoelectric sensor 100. The control unit 50 includes, for example, a processor such as a CPU (Central Processing Unit). The control unit 50 controls the operations of the light projecting unit 20 and the light receiving unit 30 according to a program stored in the storage unit 70 including a memory, and executes a detection process based on the received light amount data input from the light receiving unit 30. The detection result is output via the output unit 80 or the external device I / F 60. Details of the control unit 50 will be described later.
[0041] The operation unit 45 is for inputting information to the photoelectric sensor 100. The operation unit 45 includes, for example, buttons, switches, touch panels, keyboards, and the like.
[0042] The display unit 40 is for displaying information. The display unit 80 includes, for example, an indicator light and a display.
[0043] The control unit 50 includes, as functional blocks, an object determination unit 51, a setting unit 52, and a setting determination unit 53.
[0044] The object determination unit 51 is configured to determine the presence or absence of the object TA based on the received light amount obtained by the light receiving unit 30 and a threshold value. The object determination unit 51 outputs a detection signal as a determination result. The detection signal has, for example, a high signal level when the object TA is present (hereinafter, the detection signal is also referred to as "ON"), and a low signal level when the object TA is absent (hereinafter, the detection signal is also referred to as "OFF").
[0045] Generally, the amount of received light obtained by the photoelectric sensor 100 tends to decrease over time due to changes in the surrounding environment or changes in the state of the photoelectric sensor 100 itself. Factors causing the decrease in the amount of received light include, for example, dirt due to adhesion to the light transmitting / receiving surface or the detection surface such as dust, oil, and welding spatter, changes in the mounting state due to vibration or contact, dirt on the object, variations due to the lot of the object TA, deterioration of components, movement of equipment, changes in ambient temperature, ambient light, magnetic field, etc. due to seasonal changes, etc. Therefore, the photoelectric sensor 100 sets the above-described threshold value according to such a change in the amount of received light over time.
[0046] The setting unit 52 is configured to set a threshold value based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined to be absent. The period when the object TA is determined to be present is the period during which the object TA is determined to be present by the object determination unit 41 and the detection signal is "ON" (hereinafter also referred to as the "ON period"). On the other hand, the period when the object TA is determined to be absent is the period during which the object TA is determined to be absent by the object determination unit 41 and the detection signal is "OFF" (hereinafter also referred to as the "OFF period").
[0047] More specifically, the setting unit 52 is configured to calculate a correction value based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined to be absent, and set the calculated correction value as the threshold value. Various modes can be adopted for the method of calculating the correction value. Specific examples of the calculation of the correction value will be described later.
[0048] The setting determination unit 53 is configured to determine whether it is possible to set a threshold value based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined to be absent. The setting unit 52 sets the threshold value when it is determined that the setting of the threshold value is possible.
[0049] In this way, by determining whether it is possible to set a threshold value based on the amount of received light during the period when the object TA is determined to exist and the amount of received light during the period when the object TA is determined not to exist, for example, it becomes possible to monitor the difference between the amount of received light when the object TA exists and the amount of received light when the object TA does not exist, that is, the margin in setting the threshold value. Therefore, it is possible to appropriately determine whether the threshold value can be set.
[0050] On the other hand, when it is determined that the threshold value cannot be set, the output unit 80 is configured to output that the threshold value cannot be set based on a control signal from the control unit 50.
[0051] In this way, when it is determined that the threshold value cannot be set, by outputting that the threshold value cannot be set, it is possible to notify that the change over time of the amount of received light has reached a level where the presence or absence of the object TA cannot be determined.
[0052] Next, with reference to FIG. 3, an application example of a photoelectric sensor according to an embodiment will be described. FIG. 3 is a configuration diagram illustrating a schematic configuration of a belt conveyor BC in which a photoelectric sensor 100 according to an embodiment is installed.
[0053] As shown in FIG. 3, the belt conveyor BC is configured to convey an object TA placed on a belt BL in the direction of the arrow shown in FIG. 3 by rotating an annular belt BL.
[0054] The head portion 13 of the photoelectric sensor 100 is disposed above the belt conveyor BC and is installed to irradiate light on the moving object TA and receive the reflected light.
[0055] A plurality of metal partitions MD are provided on the belt BL. The object TA is placed between two metal partitions MD and is being conveyed. The belt BL is usually composed of a material mainly made of black rubber and has a relatively low reflectivity. On the other hand, the metal partition MD is made of metal with a relatively high reflectivity. The belt BL and the metal partition MD of the belt conveyor BC correspond to an example of the background BG in the example shown in FIG. 2.
[0056] Here, with reference to FIG. 4, the setting of the threshold value in the conventional photoelectric sensor will be described. FIG. 4 is a graph illustrating the time change of the light reception amount of the photoelectric sensor in the conventional example. In FIG. 4, the horizontal axis represents time and the vertical axis represents the light reception amount. Also, the "ON" or "OFF" of the detection signal corresponding to the time change of the light reception amount is shown below the graph. Note that since the configuration of the photoelectric sensor in the conventional example is similar to the configuration of the photoelectric sensor 100 shown in FIG. 1, the illustration and its description are omitted.
[0057] As shown in FIG. 4, the conventional photoelectric sensor determines the presence or absence of an object based on the light reception amount and the initial threshold value TH until time t10, and outputs the "ON" or "OFF" of the detection signal.
[0058] The conventional photoelectric sensor corrects the initial threshold value TH at time t10, for example, and sets a new threshold value RTH'.
[0059] When setting the new threshold value RTH', the conventional photoelectric sensor first sets the average value of the light reception amount in the initial OFF period as the reference value RV, and calculates the ratio of the threshold value to this reference value RV. The conventional photoelectric sensor then multiplies this ratio by the average value of the light reception amount in the OFF period to calculate a new threshold value RTH'.
[0060] However, in the conventional photoelectric sensor, in the OFF period, when the light reception amount of the background is small and varies greatly, there is a possibility that the threshold value cannot be set appropriately.
[0061] Specifically, in the OFF period when there is no object, the amount of received light is small due to the low reflectivity of the belt BL shown in FIG. 3. When the amount of received light suddenly increases due to the presence of the metal partition MD with high reflectivity on the belt BL, the amount of received light fluctuates greatly. In such a case, since the conventional photoelectric sensor calculates the threshold value RTH' set using the amount of received light in the OFF period, it is greatly affected by the fluctuation of the amount of received light in the OFF period. Therefore, for example, if the amount of received light fluctuates greatly during the period between time t11 and time t12, the new threshold value RTH' will become a large value. As a result, even if the amount of received light changes due to the presence of an object during the period between time t13 and time t14 and the period between time t15 and time t16, the conventional photoelectric sensor cannot detect the object and cannot output the detection signal "ON". Thus, the threshold value RTH' of the conventional photoelectric sensor may not be appropriate.
[0062] Next, with reference to FIG. 5, the setting of the threshold value in the photoelectric sensor according to an embodiment will be described. FIG. 5 is a graph illustrating the temporal change in the amount of received light of the photoelectric sensor in an embodiment. In FIG. 5, the horizontal axis represents time, and the vertical axis represents the amount of received light. Also, the detection signal of "ON" or "OFF" corresponding to the temporal change in the amount of received light is shown below the graph.
[0063] As shown in FIG. 5, similar to the conventional photoelectric sensor, the photoelectric sensor 100 determines the presence or absence of an object based on the amount of received light and the initial threshold value TH until time t20, and outputs the detection signal "ON" or "OFF".
[0064] The photoelectric sensor 100 corrects the initial threshold value TH at time t20, for example, to set a new threshold value RTH.
[0065] As described above, a correction value is calculated based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined to be absent, and the correction value is set as the new threshold value RTH. Specifically, the correction value calculation unit 52 calculates a correction value based on the amount of received light in the OFF period immediately before time t20 (white circle shown in FIG. 5) and the amount of received light in the ON period immediately before time t20 (black circle shown in FIG. 5), and the setting unit 52 sets the correction value as the new threshold value RTH.
[0066] Therefore, for example, when the amount of received light varies greatly during the period between time t21 and time t22, the setting unit 52 further corrects the corrected threshold value RTH based not only on the amount of received light in the OFF period but also on the amount of received light in the ON period, so that the corrected threshold value RTH can be set to an appropriate value. As a result, also in the periods between time t23 and time t24 and between time t25 and time t26, the photoelectric sensor 100 can detect the object TA and output a detection signal of "ON".
[0067] In this way, by setting the threshold value based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined to be absent, it becomes possible to reflect both the changes in the amount of received light when the object TA is present and when the object TA is absent in the setting of the threshold value. Therefore, for example, compared with a conventional photoelectric sensor that is strongly affected by changes in the amount of received light when the object is absent, the threshold value can be set more appropriately with respect to the change in the amount of received light over time.
[0068] Next, a method for calculating a correction value in a photoelectric sensor according to an embodiment will be described with reference to FIGS. 6 and 7. FIG. 6 is a graph illustrating the time change of the amount of received light of the photoelectric sensor 100 in an embodiment. FIG. 7 is a graph illustrating the frequency distribution of the amount of received light of the photoelectric sensor 100 in an embodiment. In FIG. 6, the horizontal axis represents time and the vertical axis represents the amount of received light. In FIG. 7, the horizontal axis represents the amount of received light and the vertical axis represents the frequency (number of times or frequency).
[0069] For example, as shown in FIG. 6, the setting unit 52 is configured to calculate a correction value based on the minimum received light amount (white circle shown in FIG. 6) during the OFF period and the maximum received light amount (black circle shown in FIG. 6) during the ON period. Specifically, the setting unit 52 calculates the average ((btm + peak) / 2) of the minimum received light amount (btm) during the OFF period and the maximum received light amount (peak) during the ON period as the correction value. In the example shown in FIG. 6, the OFF period and the ON period together form one cycle, and the setting unit 52 sets the calculated correction value as a new threshold value for each cycle.
[0070] When the photosensor 100 is a transmissive photosensor, contrary to the reflective photosensor, the received light amount during the OFF period is relatively large and the received light amount during the ON period is relatively small. In this case, the setting unit 52 is configured to calculate a correction value based on the maximum received light amount during the OFF period and the minimum received light amount during the ON period.
[0071] In this way, by calculating the correction value based on one of the maximum and minimum received light amounts during the period when the object TA is determined to be present and the other of the maximum and minimum received light amounts during the period when the object TA is determined to be absent, for example, both the maximum received light amount when the object TA is present and the minimum received light amount when the object is absent can be reflected in the threshold value. Therefore, it is possible to set a threshold value that is suppressed from being affected by a sudden change in the received light amount.
[0072] Further, the setting unit 52 may use the average of the received light amounts instead of the maximum and minimum received light amounts. For example, the correction value calculation unit 52 may be configured to calculate a correction value based on the average of the received light amounts during the OFF period and the average of the received light amounts during the ON period. In this case, the setting unit 52 obtains the average (off_ave) of the received light amounts during the OFF period and the average (on_ave) of the received light amounts during the ON period, and then calculates the average ((off_ave + on_ave) / 2) of these as the correction value. Then, the setting unit 52 sets the calculated correction value as the threshold value for each cycle.
[0073] In this way, by calculating a correction value based on the average amount of received light during the period when the object TA is determined to exist and the average amount of received light during the period when the object TA is determined not to exist, it becomes possible to reflect both the average amount of received light when the object TA exists and the average amount of received light when the object TA does not exist in the threshold value. Therefore, it is possible to set a threshold value with further suppression of the influence of a rapid change in the amount of received light.
[0074] Alternatively, the setting unit 52 may calculate a correction value using the distribution of the amount of received light over a plurality of cycles. For example, when the distribution of the frequency of the amount of received light in the OFF period and the ON period in a plurality of past cycles is as shown in FIG. 7, the setting unit 52 first calculates, for the distribution of the relatively small amount of received light corresponding to the OFF period, a value based on the average (btm_ave) and the variance (σ 1 / 2 ). For example, the setting unit 52 calculates a value (btm_ave + 3σ) obtained by adding three times the standard deviation (σ) to the average. Similarly, the setting unit 52 calculates, for the distribution of the relatively large amount of received light corresponding to the ON period, a value based on the average (peak_ave) and the variance (σ 1 / 2 ). For example, the setting unit 52 calculates a value (peak_ave - 3σ) obtained by subtracting three times the standard deviation (σ) from the average. Next, the setting unit 52 calculates the average of these values ({(btm_ave + 3σ)+(peak_ave - 3σ)} / 2) as the correction value. Then, the setting unit 52 sets the calculated correction value as the threshold value for each of the plurality of cycles.
[0075] When the photoelectric sensor 100 is a transmissive photoelectric sensor, the setting unit 52 first calculates, for the distribution of the relatively large amount of received light corresponding to the OFF period, a value based on the average (peak_ave) and the variance (σ 1 / 2 ), for example, a value (peak_ave - 3σ) obtained by subtracting three times the standard deviation (σ) from the average. Similarly, the setting unit 52 calculates, for the distribution of the relatively small amount of received light corresponding to the ON period, the average (btm_ave) and the variance (σ 1 / 2)-based value, for example, a value obtained by adding three times the standard deviation (σ) to the average (btm_ave + 3σ), is calculated. Next, the setting unit 52 calculates the average of these values ({(btm_ave + 3σ)+(peak_ave - 3σ)} / 2) as a correction value.
[0076] Thus, based on the values based on the average and variance in the light reception amount distribution during the period when the object TA was determined to be present, and the values based on the average and variance in the light reception amount distribution during the period when the object TA was determined not to be present, by calculating a correction value, for example, both the value based on the average and variance in the light reception amount distribution when the object TA is present and the value based on the average and variance in the light reception amount distribution when the object TA is not present can be reflected in the threshold value. Therefore, a new threshold value with further suppressed influence of sudden changes in the light reception amount can be set.
[0077] Next, while referring to FIGS. 8 and 9, a method for determining whether a threshold value can be set in a photoelectric sensor according to an embodiment will be described. FIG. 8 is a graph illustrating the temporal change in the light reception amount of the photoelectric sensor 100 in an embodiment. FIG. 9 is a graph illustrating the frequency distribution of the light reception amount of the photoelectric sensor 100 in an embodiment. In FIG. 8, the horizontal axis represents time, and the vertical axis represents the light reception amount. In FIG. 9, the horizontal axis represents the light reception amount, and the vertical axis represents the frequency (number of times or frequency).
[0078] For example, as shown in FIG. 8, the setting determination unit 53 is configured to determine whether it is possible to set a threshold value based on the difference between the minimum light reception amount (white circle shown in FIG. 8) during the OFF period and the maximum light reception amount (black circle shown in FIG. 8) during the ON period. Specifically, the setting determination unit 53 calculates the difference (peak - btm) between the maximum (peak) of the light reception amount during the ON period and the minimum (btm) of the light reception amount during the OFF period, and compares the calculated difference with a predetermined value, for example, the hysteresis width HYS_W set for the threshold value. As a result of the comparison, if the calculated difference is greater than or equal to the hysteresis width HYS_W (peak - btm ≧ HYS_W), the setting determination unit 53 determines that it is possible to set the threshold value. On the other hand, as a result of the comparison, if the calculated difference is less than the hysteresis width HYS_W (peak - btm < HYS_W), the setting determination unit 53 determines that it is not possible to set the threshold value.
[0079] In addition, when the photosensor 100 is a transmissive photosensor, the setting determination unit 53 is configured to determine whether it is possible to set a threshold value based on the difference between the maximum light reception amount during the OFF period and the minimum light reception amount during the ON period.
[0080] In this way, by determining whether it is possible to set a threshold value based on the difference between one of the maximum and minimum light reception amounts during the period when the object TA is determined to be present and the other of the maximum and minimum light reception amounts during the period when the object TA is determined not to be present, for example, it becomes possible to monitor the margin in setting the threshold value according to the difference between the maximum light reception amount when the object TA is present and the minimum light reception amount when the object TA is not present. Therefore, it is possible to more appropriately determine whether it is possible to set the threshold value.
[0081] Further, the setting determination unit 53 may determine whether it is possible to set a threshold value using the distribution of the light reception amount over a plurality of cycles. For example, when the frequency distributions of the light reception amounts during the OFF period and the ON period in a plurality of past cycles are as shown in FIG. 9, the setting determination unit 53 first calculates the average (btm_ave) and variance (σ 1 / 2) values based on, for example, the value obtained by adding three times the standard deviation (σ) to the average (btm_ave + 3σ). Similarly, the setting determination unit 53 calculates, for the distribution of relatively large received light amounts corresponding to the ON period, the average (peak_ave) and the variance (σ 1 / 2 ) values based on, for example, the value obtained by subtracting three times the standard deviation (σ) from the average (peak_ave - 3σ). Next, the setting determination unit 53 calculates the difference between these values ((peak_ave - 3σ) - (btm_ave + 3σ)) and compares the difference with a predetermined value, for example, zero. As a result of the comparison, if the calculated difference is zero or more ((peak_ave - 3σ) - (btm_ave + 3σ) ≧ 0), the setting determination unit 53 determines that the threshold can be set. On the other hand, as a result of the comparison, if the calculated difference is less than zero ((peak_ave - 3σ) - (btm_ave + 3σ) < 0), the setting determination unit 53 determines that the threshold cannot be set.
[0082] Note that when the photoelectric sensor 100 is a transmissive photoelectric sensor, the setting determination unit 53 first calculates, for the distribution of relatively large received light amounts corresponding to the OFF period, the average (peak_ave) and the variance (σ 1 / 2 ) values based on, for example, the value obtained by subtracting three times the standard deviation (σ) from the average (peak_ave - 3σ). Similarly, the setting determination unit 53 calculates, for the distribution of relatively small received light amounts corresponding to the ON period, the average (btm_ave) and the variance (σ 1 / 2 ) values based on, for example, the value obtained by adding three times the standard deviation (σ) to the average (btm_ave + 3σ). Next, the setting determination unit 53 calculates the difference between these values ((peak_ave - 3σ) - (btm_ave + 3σ)) and compares the difference with a predetermined value, for example, zero.
[0083] Based on the difference between the value based on the mean and variance in the light reception amount distribution during the period when the object TA was determined to be present and the value based on the mean in the light reception amount distribution during the period when the object TA was determined not to be present, by determining whether a threshold value can be set, according to the difference between the value based on the mean and variance in the light reception amount distribution when the object TA is present and the value based on the mean and variance in the light reception amount distribution when the object TA is not present, it becomes possible to monitor the margin in setting the threshold value. Therefore, it is possible to more appropriately determine whether the threshold value can be set.
[0084] Next, with reference to FIG. 10, an example of a threshold value setting method for the photoelectric sensor 100 according to an embodiment will be described. FIG. 10 is a flowchart illustrating the schematic operation of the threshold value setting process S200 of the photoelectric sensor 100 in an embodiment.
[0085] In the following description, for the sake of simplicity of explanation, unless otherwise specified, the correction value is calculated based on either the maximum or minimum of the light reception amount during the period when the object TA was determined to be present and the other of the maximum and minimum of the light reception amount during the period when the object TA was determined not to be present. Also, whether the threshold value can be set is determined based on the difference between either the maximum or minimum of the light reception amount during the period when the object TA was determined to be present and the other of the maximum and minimum of the light reception amount during the period when the object TA was determined not to be present. Further, it is assumed that an initial value has been set for the threshold value.
[0086] As shown in FIG. 10, first, the control unit 50 acquires the light reception amount during the period when the object TA was determined not to be present, that is, the OFF period (S201).
[0087] Next, the control unit 50 acquires the light reception amount during the period when the object TA was determined to be present, that is, the ON period (S202).
[0088] Next, the setting determination unit 53 determines whether it is possible to set a threshold value based on the received light amount during the OFF period and the received light amount during the ON period (S203). Specifically, the setting determination unit 53 makes a determination based on the difference between the minimum of the received light amount during the OFF period and the maximum of the received light amount during the ON period.
[0089] Note that in step S203, the setting determination unit 53 may make a determination based on the difference between a value based on the average and variance in the distribution of the received light amount during the period when the object TA was determined to be present and a value based on the distribution and variance of the received light amount during the period when the object TA was determined not to be present.
[0090] As a result of the determination in step S203, if it is possible to set a threshold value, the setting unit 52 calculates a correction value based on the minimum of the received light amount during the OFF period and the maximum of the received light amount during the ON period (S204).
[0091] Note that in step S204, the setting unit 52 may calculate a correction value based on the average of the received light amount during the period when the object TA was determined to be present and the average of the received light amount during the period when the object TA was determined not to be present. Further, the setting unit 52 may calculate a correction value based on a value based on the average and variance in the distribution of the received light amount during the period when the object TA was determined to be present and a value based on the average and variance in the distribution of the received light amount during the period when the object TA was determined not to be present.
[0092] Next, the setting unit 52 sets the correction value calculated in step S204 as a new threshold value (S205). If an initial value has not been set for the threshold value, the setting unit 52 sets the correction value calculated in step S204 as the initial value of the threshold value. After step S205, the control unit 50 performs steps S201 to S205 again.
[0093] On the other hand, as a result of the determination in step S203, if it is not possible to set a threshold value, the output unit 80 outputs that the threshold value cannot be set (S206). Then, after step S206, the control unit 50 ends the threshold value setting process S200.
[0094] Note that the sequences and flowcharts described in this embodiment may be rearranged as long as there is no contradiction in the processing.
[0095] As described above, exemplary embodiments of the present invention have been described. According to the photoelectric sensor 100 and the threshold setting method according to an embodiment of the present invention, a threshold is set based on the amount of received light during the period when the object TA is determined to be present and the amount of received light during the period when the object TA is determined not to be present. Thereby, it becomes possible to reflect both the changes in the amount of received light when the object TA is present and when the object TA is not present in the setting of the threshold. Therefore, for example, compared with a conventional photoelectric sensor that is strongly affected by changes in the amount of received light when there is no object, the threshold can be set more appropriately with respect to the change in the amount of received light over time.
[0096] Note that the embodiments described above are for facilitating the understanding of the present invention and are not for limiting the interpretation of the present invention. The present invention can be changed / improved without departing from its gist, and equivalents thereof are also included in the present invention. That is, what those skilled in the art appropriately modify in design in the embodiments is also included in the scope of the present invention as long as it has the features of the present invention. For example, each element included in the embodiment and its arrangement, material, conditions, shape, size, etc. are not limited to those illustrated and can be appropriately changed. Also, the embodiments are examples, and it goes without saying that partial substitution or combination of the configurations shown in different embodiments is possible, and these are also included in the scope of the present invention as long as they include the features of the present invention.
[0097] (Supplementary Note) 1. A photoelectric sensor (100) for detecting an object (TA), a light receiving unit (20) that receives light and obtains an amount of received light; an object determination unit (51) that determines the presence or absence of the object (TA) based on the amount of received light and a threshold; A setting unit (52) that sets the threshold value based on the amount of received light during the period when the object (TA) is determined to be present and the amount of received light during the period when the object (TA) is determined not to be present. Photoelectric sensor (100). 9. A method for setting a threshold value of a photoelectric sensor for detecting an object (TA), comprising: A light receiving step of receiving light to obtain an amount of received light; An object determination step of determining the presence or absence of the object (TA) based on the amount of received light and the threshold value; A setting step of setting the threshold value based on the amount of received light during the period when the object (TA) is determined to be present and the amount of received light during the period when the object (TA) is determined not to be present. Threshold value setting method.
Explanation of symbols
[0098] 10... Main body part, 11, 12... Optical fibers, 13... Head part, 20... Light projecting part, 21... LED, 22... LED drive circuit, 30... Light receiving part, 31... PD, 32... Amplification circuit, 33... A / D conversion circuit, 40... Display part, 45... Operation part, 50... Control part, 51... Object determination part, 52... Setting part, 53... Setting determination part, 60... I / F for external device, 70... Storage part, 80... Output part, 90... Power supply part, 100... Photoelectric sensor, BC... Belt conveyor, BG... Background, BL... Belt, S200... Threshold value setting process, TA... Object.
Claims
1. A photoelectric sensor for detecting an object, comprising: a light receiving unit that receives light and obtains a light reception amount; an object determination unit that determines the presence or absence of the object based on the light reception amount and a threshold value; a setting unit that sets the threshold value based on the light reception amount during a period in which the object is determined to be present and the light reception amount during a period in which the object is determined to be absent; a setting determination unit that determines whether the threshold value can be set based on the light reception amount during a period in which the object is determined to be present and the light reception amount during a period in which the object is determined to be absent; when a difference between one of a maximum and a minimum of the light reception amount during a period in which the object is determined to be present and the other of a maximum and a minimum of the light reception amount during a period in which the object is determined to be absent is equal to or greater than a predetermined value, the setting determination unit determines that the threshold value can be set; when it is determined that the threshold value can be set, the setting unit sets the threshold value; a photoelectric sensor.
2. The setting unit calculates a correction value based on one of a maximum and a minimum of the light reception amount during a period in which the object is determined to be present and the other of a maximum and a minimum of the light reception amount during a period in which the object is determined to be absent, and sets the correction value as the threshold value. The photoelectric sensor according to claim 1.
3. The setting unit calculates a correction value based on an average of the light reception amount during a period in which the object is determined to be present and an average of the light reception amount during a period in which the object is determined to be absent, and sets the correction value as the threshold value. The photoelectric sensor according to claim 1.
4. The setting unit calculates a correction value based on a value based on an average and a variance in a distribution of the light reception amount during a period in which the object is determined to be present and a value based on an average and a variance in a distribution of the light reception amount during a period in which the object is determined to be absent, and sets the correction value as the threshold value. The photoelectric sensor according to claim 1.
5. The setting determination unit determines whether the threshold value can be set based on a difference between a value based on an average and a variance in a distribution of the light reception amount during a period in which the object is determined to be present and a value based on an average and a variance in a distribution of the light reception amount during a period in which the object is determined to be absent. The photoelectric sensor according to any one of claims 1 to 4.
6. further comprising an output unit that outputs inability to set the threshold value when it is determined that the threshold value cannot be set. The photoelectric sensor according to any one of claims 1 to 5.
7. A method for setting a threshold value of a photoelectric sensor for detecting an object, comprising: a light receiving step of receiving light to obtain a light reception amount; an object determination step of determining the presence or absence of the object based on the light reception amount and the threshold value; a setting step of setting the threshold value based on the light reception amount during the period in which the object is determined to be present and the light reception amount during the period in which the object is determined to be absent; a setting determination step of determining whether or not the threshold value can be set based on the light reception amount during the period in which the object is determined to be present and the light reception amount during the period in which the object is determined to be absent; the setting determination step includes determining that the threshold value can be set when a difference between one of a maximum and a minimum of the light reception amount during the period in which the object is determined to be present and the other of a maximum and a minimum of the light reception amount during the period in which the object is determined to be absent is equal to or greater than a predetermined value; the setting step includes setting the threshold value when it is determined that the threshold value can be set; Threshold value setting method.
Citation Information
Patent Citations
Detection sensor and threshold value setting method therefor
JP1995221623A
Detection switch
JP1997238064A
Detection switch
JP1997284116A
Detection device and its threshold setting method
JP1999112319A
Photoelectric sensor device
JP2004320372A
Cited By
Photoelectric sensor and threshold correction method
JP2025123458A