Photoelectric sensor and threshold correction method
By setting threshold values based on light levels during object presence and absence, the photoelectric sensor addresses fluctuation issues, ensuring accurate and stable object detection despite varying light conditions.
Patent Information
- Application Number
- JP2025103673
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Conventional photoelectric sensors struggle to set appropriate threshold values when the amount of received light fluctuates significantly, especially when the background light is small and varies greatly, leading to inaccurate object detection.
The photoelectric sensor sets threshold values based on the amount of received light during periods when an object is present and when it is not present, using various calculation methods such as maximum, minimum, average, and variance of light levels to adjust the threshold value, and includes a determination mechanism to ensure the threshold can be appropriately set.
This approach allows for more accurate and stable threshold setting, reducing the influence of sudden changes in light levels and improving the sensor's ability to detect objects reliably over time.
Smart Images

Figure 2025123458000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a photoelectric sensor and a threshold setting method. [Background technology]
[0002] Conventionally, there is known a photoelectric sensor in which threshold correction means calculates the ratio of the set threshold to the moving average of the amount of light received when the light is off, using the ON or OFF state immediately after adjusting the optical axes of the light-emitting unit and the light-receiving unit as a reference state, includes means for storing this ratio, generates an average value of the amount of light received when the light is off, and corrects the threshold by multiplying this average value of the amount of light received when the light is off by the ratio (see Patent Document 1). This photoelectric sensor is designed to maintain a stable detection state even if the amount of light received changes over time. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2007-139494 Summary of the Invention [Problem to be solved by the invention]
[0004] The photoelectric sensor described in Cited Document 1 sets the threshold value by setting the average amount of light received when the sensor is OFF as a reference for the change in the amount of light received over time, calculating the ratio of the threshold value to the set reference, and multiplying the calculated ratio by the average amount of light received when the sensor is OFF.
[0005] However, in the photoelectric sensor described in Cited Document 1, for example, when the amount of received light in the background is small and fluctuates greatly when the sensor is OFF, the set threshold value may become too large, and there is a possibility that the threshold value cannot be set appropriately.
[0006] Therefore, an object of the present invention is to provide a photoelectric sensor and a threshold value setting method that can set a more appropriate threshold value in response to changes over time in the amount of received light. [Means for solving the problem]
[0007] A photoelectric sensor according to one aspect of the present invention is a photoelectric sensor for detecting an object, and includes a light receiving unit that receives light and obtains an amount of received light, an object determination unit that determines whether or not an object is present based on the amount of received light and a threshold value, and a setting unit that sets the threshold value based on the amount of received light during a period when it was determined that an object was present and the amount of received light during a period when it was determined that an object was not present.
[0008] According to this aspect, the threshold value is set based on the amount of received light during the period when it was determined that an object was present and the amount of received light during the period when it was determined that an object was not present. This makes it possible to reflect changes in the amount of received light both when an object is present and when it is not present in the threshold value setting. Therefore, compared to conventional photoelectric sensors that are strongly affected by changes in the amount of received light when an object is not present, the threshold value can be set more appropriately in response to changes in the amount of received light over time.
[0009] In the above-described aspect, the setting unit may calculate a correction value based on one of the maximum and minimum amounts of light received during the period in which it was determined that an object was present and the other of the maximum and minimum amounts of light received during the period in which it was determined that an object was not present, 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 amounts of received light during the period when it was determined that an object was present and the other of the maximum and minimum amounts of received light during the period when it was determined that an object was not present. This makes it possible to reflect, for example, both the maximum amount of received light when an object was present and the minimum amount of received light when an object was not present in the threshold value. Therefore, it is possible to set a threshold value that is less affected by sudden changes in the amount of received light.
[0011] In the above-described aspect, the setting unit may calculate a correction value based on the average amount of light received during the period in which it was determined that an object was present and the average amount of light received during the period in which it was determined that an object was not present, and set the correction value as the threshold value.
[0012] According to this aspect, the correction value is calculated based on the average amount of received light during the period when it was determined that an object was present and the average amount of received light during the period when it was determined that an object was not present. This makes it possible to reflect both the average amount of received light when an object was present and the average amount of received light when an object was not present in the threshold value. Therefore, it is possible to set a threshold value that is further less affected by sudden changes in the amount of received light.
[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 amount of received light during a period in which it was determined that an object was present and a value based on the average and variance in the distribution of the amount of received light during a period in which it was determined that an object was not present, and set the correction value as the threshold value.
[0014] According to this aspect, the correction value is calculated based on a value based on the average and variance of the distribution of the amount of received light during the period when it was determined that an object was present and a value based on the average and variance of the distribution of the amount of received light during the period when it was determined that an object was not present. This makes it possible to reflect, in the threshold value, both a value based on the average and variance of the distribution of the amount of received light when an object was present and a value based on the average and variance of the distribution of the amount of received light when an object was not present. Therefore, it is possible to set a threshold value that is further suppressed in the influence of sudden changes in the amount of received light.
[0015] In the above-mentioned aspect, the device may further include a setting determination unit that determines whether or not a threshold value can be set based on the amount of light received during the period when it was determined that an object was present and the amount of light received during the period when it was determined that an object was not present, and the setting unit may set the threshold value when it is determined that the threshold value can be set.
[0016] According to this aspect, whether or not the threshold value can be set is determined based on the amount of received light during the period when it was determined that an object was present and the amount of received light during the period when it was determined that an object was not present. This makes it possible to monitor, for example, the difference between the amount of received light when an object was present and the amount of received light when an object was not present, i.e., the margin for error in setting the threshold value. Therefore, it is possible to appropriately determine whether or not the threshold value can be set.
[0017] In the above-mentioned aspect, the setting determination unit may determine whether or not a threshold value can be set based on the difference between one of the maximum and minimum amounts of light received during a period in which it was determined that an object was present and the other of the maximum and minimum amounts of light received during a period in which it was determined that an object was not present.
[0018] According to this aspect, whether or not the threshold value can be set is determined based on the difference between the maximum or minimum amount of received light during the period when it was determined that an object was present and the other of the maximum or minimum amount of received light during the period when it was determined that an object was not present. This makes it possible to monitor the margin for setting the threshold value, for example, according to the difference between the maximum amount of received light when an object was present and the minimum amount of received light when an object was not present. Therefore, it is possible to more appropriately determine whether or not the threshold value can be set.
[0019] In the above-described aspect, the setting determination unit may determine whether or not a threshold value can be set based on the difference between a value based on the average and variance in the distribution of the amount of received light during a period in which it was determined that an object was present and a value based on the average and variance in the distribution of the amount of received light during a period in which it was determined that an object was not present.
[0020] According to this aspect, whether or not the threshold value can be corrected is determined based on the difference between the value based on the mean and variance of the distribution of the amount of received light during the period when it was determined that an object was present and the value based on the mean and variance of the distribution of the amount of received light during the period when it was determined that an object was not present. This makes it possible to monitor the margin for setting the threshold value based on the difference between the value based on the mean and variance of the distribution of the amount of received light when an object was present and the value based on the mean and variance of the distribution of the amount of received light when an object was not present. Therefore, it is possible to more appropriately determine whether or not the threshold value can be set.
[0021] In the above-described aspect, an output unit may be further provided that outputs a message indicating that the threshold value cannot be set when it is determined that the threshold value cannot be set.
[0022] According to this aspect, when it is determined that the threshold value cannot be set, a message indicating that the threshold value cannot be set is output, thereby notifying the user that the change in the amount of received light over time has reached a level where it is no longer possible to determine the presence or absence of an object.
[0023] Another aspect of the present invention is a threshold setting method for a photoelectric sensor that detects an object, and includes a light receiving step of receiving light to obtain an amount of received light, an object determination step of determining whether or not an object exists based on the amount of received light and a threshold, and a setting step of setting a threshold based on the amount of received light during a period when it was determined that an object existed and the amount of received light during a period when it was determined that an object did not exist.
[0024] According to this aspect, the threshold value is set based on the amount of received light during the period when it was determined that an object was present and the amount of received light during the period when it was determined that an object was not present. This makes it possible to reflect changes in the amount of received light both when an object is present and when it is not present in the threshold value setting. Therefore, compared to conventional threshold value setting methods that are strongly affected by changes in the amount of received light when an object is not present, it is possible to set the threshold value more appropriately in response to changes in the amount of received light over time. [Effects of the Invention]
[0025] According to the present invention, it is possible to set a threshold value that is more appropriate for changes in the amount of received light over time. [Brief explanation of the drawings]
[0026] [Figure 1] FIG. 1 is a block diagram illustrating a schematic configuration of a photoelectric sensor according to an embodiment. [Figure 2] FIG. 2 is a schematic diagram illustrating the detection principle of the photoelectric sensor shown in FIG. [Figure 3] FIG. 3 is a diagram illustrating a schematic configuration of a belt conveyor on which a photoelectric sensor according to an embodiment is installed. [Figure 4] FIG. 4 is a graph illustrating the change over time in the amount of light received by a conventional photoelectric sensor. [Figure 5] FIG. 5 is a graph illustrating the change over time in the amount of light received by the photoelectric sensor in one embodiment. [Figure 6] FIG. 6 is a graph illustrating the change over time in the amount of light received by the photoelectric sensor in one embodiment. [Figure 7] FIG. 7 is a graph illustrating the frequency distribution of the amount of light received by the photoelectric sensor in one embodiment. [Figure 8] FIG. 8 is a graph illustrating the change over time in the amount of light received by the photoelectric sensor in one embodiment. [Figure 9] FIG. 9 is a graph illustrating the frequency distribution of the amount of light received by the photoelectric sensor in one embodiment. [Figure 10] FIG. 10 is a flowchart illustrating the outline of the operation of the threshold correction process S200 of the photoelectric sensor in one embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0027] An embodiment of the present invention will be described below. In the following description of the drawings, identical or similar parts are denoted by identical or similar reference numerals. However, the drawings are schematic. Therefore, specific dimensions and the like should be determined in light of the following description. Furthermore, it goes without saying that the dimensional relationships and ratios of parts included in the drawings differ from one another. Furthermore, the technical scope of the present invention should not be interpreted as being limited to the embodiment.
[0028] First, the configuration of a photoelectric sensor according to an embodiment will be described with reference to Fig. 1. Fig. 1 is a block diagram illustrating the schematic configuration of a photoelectric sensor 100 according to an embodiment.
[0029] 1, the photoelectric sensor 100 includes a light-emitting 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-emitting unit 20, the light-receiving unit 30, the display unit 40, the operation unit 45, the control unit 50, the input / output external device I / F 60, the storage unit 70, the output unit 80, and the power supply unit 90 are housed in a main body 10, which will be described later.
[0030] However, the configuration is not limited to the configuration in which each part of the photoelectric sensor 100 is housed in one main body 90 of the housing 30. For example, each part of the photoelectric sensor 100 may be housed in two or more separate parts.
[0031] The photoelectric sensor 100 of this embodiment is a photoelectric sensor (also called 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 reflective types that detect an object based on the amount of light reflected by the object and transmissive types that detect an object based on light being blocked by the object. In the following explanation, a reflective type photoelectric sensor will be described unless otherwise specified.
[0032] The light projecting unit 20 projects light onto the target object TA. The light projecting unit 20 includes, for example, an LED (Light Emitting Diode) 21 and an LED drive circuit 22.
[0033] The light receiving unit 30 is configured to receive light and obtain the amount of received light. The light receiving unit 30 includes, for example, a photodiode (PD) 31, an amplifier circuit 32, and an A / D conversion circuit 33.
[0034] The principle of detecting an object by a photoelectric sensor according to an embodiment will now be described with reference to Fig. 2. Fig. 2 is a schematic diagram illustrating the detection principle of a photoelectric sensor 100 according to an embodiment.
[0035] 2, the photoelectric sensor 100 includes a main body 10 and optical fibers 11 and 12 attached to the front surface of the main body 10. The optical fiber 11 is for emitting light, and the other optical fiber 12 is for receiving light. A head 13 including a lens and the like is attached to the tip of each of the optical fibers 11 and 12.
[0036] The optical fibers 11 and 12 are each inserted into an insertion port (not shown) on the front surface of the main body 10. An LED 21 of the light-projecting unit 20 is disposed near the insertion port of the optical fiber 11 for projecting light, and a PD 31 of the light-receiving unit 30 is disposed near the insertion port of the optical fiber 12 for receiving light.
[0037] When using the photoelectric sensor 100, the head unit 13 is placed at a predetermined distance from the object TA. Light emitted from the LED 21 of the light-projecting unit 20 is emitted from the head unit 13 via the optical fiber 11. The light reflected by the object TA and incident on the head unit 13 reaches the PD 31 of the light-receiving unit 30 via the optical fiber 12.
[0038] The received light amount data generated by the light receiving unit 30 is input to the control unit 50, where it is compared with a pre-registered threshold value to determine whether or not light has been reflected by the object TA, and the determination result is output.
[0039] In the example shown in FIG. 2, the photoelectric sensor 100 receives light projected from the light projecting unit and reflected by the object TA with the light receiving unit, and determines that the state in which this reflected light is received is "the presence of an object."
[0040] Returning to the explanation of FIG. 1 , the control unit 50 is configured to control the operation of each unit of the photoelectric sensor 100. The control unit 50 includes a processor such as a CPU (Central Processing Unit). The control unit 50 executes detection processing based on received light amount data input from the light receiving unit 30 while controlling the operation of the light projecting unit 20 and the light receiving unit 30 in accordance with a program stored in a storage unit 70 including a memory. 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 used to input information to the photoelectric sensor 100. The operation unit 45 includes, for example, buttons, switches, a touch panel, a keyboard, and the like.
[0042] The display unit 40 is for displaying information. The display unit 40 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 an object TA based on the amount of light received by the light receiving unit 30 and a threshold value. The object determination unit 51 outputs a detection signal as a determination result. For example, the detection signal has a high signal level (hereinafter, the detection signal may be referred to as "ON") when the object TA is present, and a low signal level (hereinafter, the detection signal may be referred to as "OFF") when the object TA is not present.
[0045] Generally, the amount of light received by the photoelectric sensor 100 tends to decrease over time due to changes in the surrounding environment or the condition of the photoelectric sensor 100 itself. Factors that cause a decrease in the amount of light received include, for example, dirt due to adhesion of dust, oil, welding spatter, etc. to the light-emitting / receiving surface or the detection surface, changes in the mounting condition due to vibration or contact, dirt on the target object, variations in the target object TA due to lot size, deterioration of parts, relocation of equipment, changes in ambient temperature, ambient light, magnetic field, etc. due to seasonal changes, etc. Therefore, the photoelectric sensor 100 sets the above-mentioned threshold value in accordance with such changes in the amount of light received over time.
[0046] The setting unit 52 is configured to set a threshold value based on the amount of received light during a period in which it was determined that the object TA was present and the amount of received light during a period in which it was determined that the object TA was not present. The period in which it was determined that the object TA was present is a period in which the object determination unit 41 determined that the object TA was present and the detection signal was "ON" (hereinafter also referred to as an "ON period"). On the other hand, the period in which it was determined that the object TA was not present is a period in which the object determination unit 41 determined that the object TA was not present and the detection signal was "OFF" (hereinafter also referred to as an "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 it was determined that the object TA was present and the amount of received light during the period when it was determined that the object TA was not present, and set the calculated correction value as the threshold value. A variety of methods can be used to calculate the correction value. Specific examples of calculation of the correction value will be described later.
[0048] The setting determination unit 53 is configured to determine whether or not it is possible to set a threshold value based on the amount of light received during the period when it was determined that the object TA was present and the amount of light received during the period when it was determined that the object TA was not present. The setting unit 52 sets the threshold value when it is determined that it is possible to set the threshold value.
[0049] In this way, by determining whether or not it is possible to set a threshold value based on the amount of received light during the period when it was determined that the object TA was present and the amount of received light during the period when it was determined that the object TA was not present, it becomes possible to monitor, for example, the difference between the amount of received light when the object TA was present and the amount of received light when the object TA was not present, i.e., the margin for error in setting the threshold value. Therefore, it is possible to appropriately determine whether or not it is possible to set a threshold value.
[0050] On the other hand, when it is determined that the threshold value cannot be set, the output section 80 is configured to output a message indicating that the threshold value cannot be set based on a control signal from the control section 50.
[0051] In this way, when it is determined that it is not possible to set a threshold value, a message indicating that it is not possible to set a threshold value is output, thereby notifying the user that the change in the amount of received light over time has reached a level where it is no longer possible to determine whether or not the object TA is present.
[0052] Next, an application example of a photoelectric sensor according to an embodiment will be described with reference to Fig. 3. Fig. 3 is a configuration diagram illustrating a schematic configuration of a belt conveyor BC on 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 the circular belt BL.
[0054] The head portion 13 of the photoelectric sensor 100 is disposed above the belt conveyor BC and is installed so as to irradiate light onto the moving object TA and receive the reflected light.
[0055] A plurality of metal partitions MD are provided on the belt BL. An object TA is placed between two of the metal partitions MD and is transported. The belt BL is typically made of a material whose main component is black rubber, giving it a relatively low reflectivity. On the other hand, the metal partitions MD are made of metal, which has a relatively high reflectivity. The belt BL and metal partitions MD of the belt conveyor BC correspond to an example of the background BG in the example shown in Figure 2.
[0056] Here, the setting of the threshold value in a conventional photoelectric sensor will be described with reference to FIG. 4. FIG. 4 is a graph illustrating the change over time in the amount of light received by a conventional photoelectric sensor. In FIG. 4, the horizontal axis represents time, and the vertical axis represents the amount of light received. Also, the "ON" or "OFF" state of the detection signal corresponding to the change over time in the amount of light received is shown below the graph. Note that the configuration of the conventional photoelectric sensor is similar to the configuration of photoelectric sensor 100 shown in FIG. 1, so illustration and description thereof will be omitted.
[0057] As shown in FIG. 4, the conventional photoelectric sensor determines the presence or absence of an object based on the amount of received light and the initial threshold value TH until time t10, and outputs a detection signal of "ON" or "OFF."
[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 a new threshold value RTH', the conventional photoelectric sensor first sets the average amount of light received during the initial OFF period as a reference value RV, and then calculates the ratio of the threshold value to this reference value RV. The conventional photoelectric sensor then multiplies this ratio by the average amount of light received during the OFF period to calculate the new threshold value RTH'.
[0060] However, in the conventional photoelectric sensor, if the amount of received background light is small and fluctuates greatly during the OFF period, it may not be possible to set the threshold value appropriately.
[0061] Specifically, during the OFF period when no object is present, the amount of received light may be small due to the low reflectivity of the belt BL (see FIG. 3). However, the presence of a highly reflective metal partition MD on the belt BL may suddenly increase the amount of received light, causing a large fluctuation in the amount of received light. In such cases, the conventional photoelectric sensor calculates the threshold value RTH' using the amount of received light during the OFF period, and is therefore significantly affected by fluctuations in the amount of received light during the OFF period. Therefore, for example, if the amount of received light fluctuates significantly between times t11 and t12, the new threshold value RTH' will be large. As a result, even if the amount of received light changes due to the presence of an object between times t13 and t14 and between times t15 and t16, the conventional photoelectric sensor will not be able to detect the object and will not be able to output the "ON" detection signal. Thus, the conventional photoelectric sensor may calculate an inappropriate new threshold value RTH'.
[0062] Next, setting of a threshold value in a photoelectric sensor according to one embodiment will be described with reference to Fig. 5. Fig. 5 is a graph illustrating an example of temporal changes in the amount of light received by a photoelectric sensor in one embodiment. In Fig. 5, the horizontal axis represents time and the vertical axis represents the amount of light received. Also, an "ON" or "OFF" detection signal corresponding to the temporal change in the amount of light received is shown below the graph.
[0063] As shown in FIG. 5, the photoelectric sensor 100, like the conventional photoelectric sensor, 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 a detection signal of “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 it was determined that the object TA was present and the amount of received light during the period when it was determined that the object TA was not present, 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 during the OFF period immediately before time t20 (white circles in FIG. 5) and the amount of received light during the ON period immediately before time t20 (black circles in FIG. 5), and the setting unit 52 sets the correction value as the new threshold value RTH.
[0066] Therefore, for example, if the amount of received light fluctuates significantly during the period between time t21 and time t22, the setting unit 52 further corrects the corrected threshold value RTH based on not only the amount of received light during the OFF period but also the amount of received light during the ON period, making it possible to set the corrected threshold value RTH to an appropriate value. As a result, the photoelectric sensor 100 can detect the object TA even during the period between time t23 and time t24 and the period between time t25 and time t26, and can output an "ON" detection signal.
[0067] In this way, by setting the threshold value based on the amount of received light during the period when it was determined that the object TA was present and the amount of received light during the period when it was determined that the object TA was not present, it is possible to reflect changes in the amount of received light both when the object TA is present and when the object TA is not present in the threshold value setting. Therefore, compared to conventional photoelectric sensors that are strongly affected by changes in the amount of received light when there is no object, for example, it is possible to set the threshold value more appropriately in response to changes 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 Figures 6 and 7. Figure 6 is a graph illustrating an example of the change over time in the amount of light received by photoelectric sensor 100 in an embodiment. Figure 7 is a graph illustrating an example of the frequency distribution of the amount of light received by photoelectric sensor 100 in an embodiment. In Figure 6, the horizontal axis represents time, and the vertical axis represents the amount of light received. In Figure 7, the horizontal axis represents the amount of light received, 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 the correction value based on the minimum amount of light received during the OFF period (white circle in Fig. 6) and the maximum amount of light received during the ON period (black circle in Fig. 6). Specifically, the setting unit 52 calculates the average ((btm+peak) / 2) of the minimum amount of light received during the OFF period (btm) and the maximum amount of light received during the ON period (peak) as the correction value. In the example shown in Fig. 6, the OFF period and the ON period together constitute one cycle, and the setting unit 52 sets the calculated correction value as a new threshold value for each cycle.
[0070] Note that, when the photoelectric sensor 100 is a transmission type photoelectric sensor, the amount of light received during the OFF period is relatively large and the amount of light received during the ON period is relatively small, unlike a reflective type photoelectric sensor. In this case, the setting unit 52 is configured to calculate the correction value based on the maximum amount of light received during the OFF period and the minimum amount of light received during the ON period.
[0071] In this way, by calculating a correction value based on one of the maximum and minimum amounts of received light during the period when it was determined that the object TA was present and the other of the maximum and minimum amounts of received light during the period when it was determined that the object TA was not present, it becomes possible to reflect, for example, both the maximum amount of received light when the object TA was present and the minimum amount of received light when the object was not present in the threshold value, thereby making it possible to set a threshold value that is less affected by sudden changes in the amount of received light.
[0072] Furthermore, the setting unit 52 may use the average amount of received light instead of the maximum and minimum amount of received light. For example, the correction value calculation unit 52 may be configured to calculate the correction value based on the average amount of received light during the OFF period and the average amount of received light during the ON period. In this case, the setting unit 52 obtains the average amount of received light during the OFF period (off_ave) and the average amount of received light during the ON period (on_ave), and then calculates the average of these ((off_ave+on_ave) / 2) 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 the correction value based on the average amount of received light during the period when it was determined that the object TA was present and the average amount of received light during the period when it was determined that the object TA was not present, it is possible to reflect both the average amount of received light when the object TA was present and the average amount of received light when the object TA was not present in the threshold value, thereby making it possible to set a threshold value that is further less affected by sudden changes in the amount of received light.
[0074] Alternatively, the setting unit 52 may calculate the correction value using the distribution of the amount of received light over multiple cycles. For example, if the distribution of the frequency of the amount of received light during the OFF period and the ON period over multiple past cycles is the example shown in FIG. 7, the setting unit 52 first calculates the average (btm_ave) and variance (σ 1 / 2 ) is calculated. For example, the setting unit 52 calculates a value (btm_ave+3σ) by adding three times the standard deviation (σ) to the average. Similarly, the setting unit 52 calculates a value based on the average (peak_ave) and variance (σ) for the distribution of the relatively large amount of received light corresponding to the ON period. 1 / 2 ) is calculated. For example, the setting unit 52 calculates a value (peak_ave-3σ) 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 multiple periods.
[0075] If the photoelectric sensor 100 is a transmission type photoelectric sensor, the setting unit 52 first calculates the average (peak_ave) and 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 the average (btm_ave) and variance (σ 1 / 2), for example, a value (btm_ave+3σ) obtained by adding three times the standard deviation (σ) to the average. Next, the setting unit 52 calculates the average of these values ({(btm_ave+3σ)+(peak_ave-3σ)} / 2) as a correction value.
[0076] In this way, by calculating a correction value based on a value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was present and a value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was not present, it becomes possible to reflect, for example, both a value based on the average and variance in the distribution of the amount of received light when the object TA was present and a value based on the average and variance in the distribution of the amount of received light when the object TA was not present in the threshold value. Therefore, it is possible to set a new threshold value that is further suppressed in the influence of sudden changes in the amount of received light.
[0077] Next, a method for determining whether or not to set a threshold value in a photoelectric sensor according to an embodiment will be described with reference to Figures 8 and 9. Figure 8 is a graph illustrating an example of a change over time in the amount of light received by photoelectric sensor 100 in an embodiment. Figure 9 is a graph illustrating an example of a frequency distribution of the amount of light received by photoelectric sensor 100 in an embodiment. In Figure 8, the horizontal axis represents time, and the vertical axis represents the amount of light received. In Figure 9, the horizontal axis represents the amount of light received, 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, when 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, when 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 of the light reception amount during the OFF period and the minimum of the 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 of the light reception amount during the period when the object TA is determined to be present and the other of the maximum and minimum of the light reception amount during the period when the object TA is determined to be absent, for example, it becomes possible to monitor the margin in setting the threshold value according to the difference between the maximum of the light reception amount when the object TA is present and the minimum of the light reception amount when the object TA is absent. Therefore, it is possible to more appropriately determine whether the threshold value can be set.
[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 distribution of the frequency of the light reception amount during the OFF period and the ON period in a plurality of past cycles is as shown in FIG. 9, the setting determination unit 53 first calculates the average (btm_ave) and variance (σ 1 / 2), for example, a value (btm_ave+3σ) obtained by adding three times the standard deviation (σ) to the average. Similarly, the setting determination unit 53 calculates the average (peak_ave) and variance (σ 1 / 2 ), for example, a value (peak_ave-3σ) obtained by subtracting three times the standard deviation (σ) from the average. Next, the setting determination unit 53 calculates the difference between these values ((peak_ave-3σ)-(btm_ave+3σ)) and compares this difference with a predetermined value, for example, zero. If the result of the comparison shows that the calculated difference is equal to or greater than zero ((peak_ave-3σ)-(btm_ave+3σ)≧0), the setting determination unit 53 determines that it is possible to set the threshold. On the other hand, if the result of the comparison shows that the calculated difference is less than zero ((peak_ave-3σ)-(btm_ave+3σ)<0), the setting determination unit 53 determines that it is not possible to set the threshold.
[0082] If the photoelectric sensor 100 is a transmission type photoelectric sensor, the setting determination unit 53 first calculates the average (peak_ave) and variance (σ 1 / 2 ), for example, a value (peak_ave-3σ) obtained by subtracting three times the standard deviation (σ) from the average. Similarly, the setting determination unit 53 calculates the average (btm_ave) and variance (σ 1 / 2 ), for example, the value (btm_ave+3σ) obtained by adding three times the standard deviation (σ) to the average. Next, the setting determination unit 53 calculates the difference between these values ((peak_ave-3σ)-(btm_ave+3σ)) and compares this difference with a predetermined value, for example, zero.
[0083] In this way, by determining whether or not it is possible to set a threshold value based on the difference between the value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was present and the value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was not present, it becomes possible to monitor the margin for setting a threshold value according to the difference between the value based on the average and variance in the distribution of the amount of received light when the object TA was present and the value based on the average and variance in the distribution of the amount of received light when the object TA was not present. Therefore, it is possible to more appropriately determine whether or not it is possible to set a threshold value.
[0084] Next, an example of a threshold setting method for the photoelectric sensor 100 according to an embodiment will be described with reference to Fig. 10. Fig. 10 is a flowchart illustrating an outline of the operation of the threshold setting process S200 for the photoelectric sensor 100 according to an embodiment.
[0085] In the following description, for simplicity's sake, unless otherwise specified, the correction value is calculated based on one of the maximum and minimum amounts of received light during the period when it was determined that the object TA was present and the other of the maximum and minimum amounts of received light during the period when it was determined that the object TA was not present. Whether or not a threshold value can be set is determined based on the difference between one of the maximum and minimum amounts of received light during the period when it was determined that the object TA was present and the other of the maximum and minimum amounts of received light during the period when it was determined that the object TA was not present. Furthermore, it is assumed that an initial value is set for the threshold value.
[0086] As shown in FIG. 10, first, the control unit 50 acquires the amount of received light during the period in which it was determined that the object TA was not present, that is, during the OFF period (S201).
[0087] Next, the control unit 50 acquires the amount of received light during the period during which it was determined that the object TA was present, that is, during the ON period (S202).
[0088] Next, the setting determination unit 53 determines whether or not it is possible to set a threshold value based on the amount of light received during the OFF period and the amount of light received during the ON period (S203). Specifically, the setting determination unit 53 makes the determination based on the difference between the minimum amount of light received during the OFF period and the maximum amount of light received during the ON period.
[0089] In addition, in step S203, the setting judgment unit 53 may make a judgment based on the difference between a value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was present and a value based on the distribution and variance in the amount of received light during the period when it was determined that the object TA was not present.
[0090] If it is determined in step S203 that the threshold value can be set, the setting unit 52 calculates a correction value based on the minimum amount of light received during the OFF period and the maximum amount of light received during the ON period (S204).
[0091] In step S204, the setting unit 52 may calculate the correction value based on the average amount of received light during the period when it was determined that the object TA was present and the average amount of received light during the period when it was determined that the object TA was not present. Also, the setting unit 52 may calculate the correction value based on a value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was present and a value based on the average and variance in the distribution of the amount of received light during the period when it was determined that the object TA was not 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 for the threshold value. After step S205, the control unit 50 performs steps S201 to S205 again.
[0093] On the other hand, if the result of the determination in step S203 is that the threshold value cannot be set, the output unit 80 outputs a message that the threshold value cannot be set (S206). After step S206, the control unit 50 ends the threshold value setting process S200.
[0094] The order of the sequences and flowcharts described in this embodiment may be changed as long as no contradiction occurs in the processing.
[0095] The above describes an exemplary embodiment of the present invention. According to the photoelectric sensor 100 and threshold setting method of one embodiment of the present invention, the threshold is set based on the amount of received light during a period when it was determined that an object TA was present and the amount of received light during a period when it was determined that an object TA was not present. This makes it possible to reflect changes in the amount of received light both when the object TA is present and when the object TA is not present in the threshold setting. Therefore, compared to conventional photoelectric sensors that are strongly affected by changes in the amount of received light when an object is not present, the threshold can be set more appropriately with respect to changes in the amount of received light over time.
[0096] The above-described embodiments are intended to facilitate understanding of the present invention and are not intended to limit the scope of the present invention. The present invention may be modified or improved without departing from its spirit, and equivalents are also included within the scope of the present invention. In other words, designs modified by those skilled in the art as appropriate are also encompassed within the scope of the present invention as long as they incorporate the characteristics of the present invention. For example, the elements of the embodiments, their arrangement, materials, conditions, shapes, sizes, etc., are not limited to those illustrated and can be modified as appropriate. Furthermore, the embodiments are merely examples, and partial substitutions or combinations of the configurations shown in different embodiments are, of course, possible. These are also encompassed within the scope of the present invention as long as they incorporate the characteristics of the present invention.
[0097] (Appendix) 1. A photoelectric sensor (100) for detecting an object (TA), a light receiving section (20) that receives light and obtains the 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 value; a setting unit (52) that sets the threshold value based on the amount of received light during a period in which it was determined that the object (TA) was present and the amount of received light during a period in which it was determined that the object (TA) was not 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 and obtaining a received light amount; an object determination step of determining whether or not the object (TA) exists based on the amount of received light and a threshold value; a setting step of setting the threshold value based on the amount of received light during a period in which it was determined that the object (TA) was present and the amount of received light during a period in which it was determined that the object (TA) was not present, Threshold setting method. [Explanation of symbols]
[0098] 10...main body, 11, 12...optical fiber, 13...head, 20...light-emitting unit, 21...LED, 22...LED drive circuit, 30...light-receiving unit, 31...PD, 32...amplification circuit, 33...A / D conversion circuit, 40...display unit, 45...operation unit, 50...control unit, 51...object determination unit, 52...setting unit, 53...setting determination unit, 60...interface for external devices, 70...storage unit, 80...output unit, 90...power supply unit, 100...photoelectric sensor, BC...belt conveyor, BG...background, BL...belt, S200...threshold setting process, TA...object.
Claims
1. A photoelectric sensor for detecting an object, a light receiving unit that receives light and obtains an amount of received light; an object determination unit that determines whether or not the object is present based on the amount of received light and a threshold value; a setting unit that sets the threshold value based on the amount of received light during a period in which it was determined that the object was present and the amount of received light during a period in which it was determined that the object was not present, Photoelectric sensor.
2. the setting unit calculates a correction value based on one of the maximum and minimum amounts of received light during the period in which it was determined that the object was present and the other of the maximum and minimum amounts of received light during the period in which it was determined that the object was not present, and sets the correction value to the threshold value. The photoelectric sensor according to claim 1 .
3. the setting unit calculates a correction value based on an average of the amount of received light during a period in which it was determined that the object was present and an average of the amount of received light during a period in which it was determined that the object was not present, and sets the correction value to 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 the distribution of the amount of received light during the period when it was determined that the object was present and a value based on an average and a variance in the distribution of the amount of received light during the period when it was determined that the object was not present, and sets the correction value to the threshold value. The photoelectric sensor according to claim 1 .
5. a setting determination unit that determines whether or not the threshold value can be set based on the amount of light received during the period when it was determined that the object was present and the amount of light received during the period when it was determined that the object was not present; the setting unit sets the threshold value when it is determined that the threshold value can be set. The photoelectric sensor according to any one of claims 1 to 4.
6. the setting determination unit determines whether or not the threshold value can be set based on a difference between one of the maximum and minimum amounts of received light during a period in which it was determined that the object was present and the other of the maximum and minimum amounts of received light during a period in which it was determined that the object was not present. The photoelectric sensor according to claim 5.
7. the setting determination unit determines whether or not the threshold value can be set based on a difference between a value based on an average and a variance in the distribution of the amount of received light during a period in which it was determined that the object was present and a value based on an average and a variance in the distribution of the amount of received light during a period in which it was determined that the object was not present; The photoelectric sensor according to claim 5.
8. an output unit that outputs the inability to set the threshold value when it is determined that the setting of the threshold value is not possible; The photoelectric sensor according to any one of claims 5 to 7.
9. A method for setting a threshold value of a photoelectric sensor for detecting an object, comprising: a light receiving step of receiving light and obtaining a received light amount; an object determination step of determining whether or not the object exists based on the amount of received light and a threshold value; a setting step of setting the threshold value based on the amount of received light during a period in which it was determined that the object was present and the amount of received light during a period in which it was determined that the object was not present. Threshold 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