Abstract:
A photoelectric sensor and a control method thereof are provided, the photoelectric sensor includes a driving pulse generating unit, generating a driving pulse of different cycles; a light-emitting part, receiving the driving pulse to emit light; a light receiving part, receiving the light reflected by a detected object to generate a light receiving signal; an output unit, processing the light receiving signal to output a detection signal; and a control unit, controlling the driving pulse generating unit to generate a first driving pulse of a sleep cycle in usual, and triggered by a variation of the detection signal to control the driving pulse generating unit to generate a specified number of second driving pulses of a duty cycles, the duty cycle is formed by two or more specific cycles, an average of the specific cycles serves as the duty cycle, and the duty cycle is shorter than the sleep cycle.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the priority benefit of China patent application no. 201610110157.9, filed on Feb. 29, 2016. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification. 
       BACKGROUND OF THE INVENTION 
       [0002]    Field of the Invention 
         [0003]    The invention relates to a photoelectric sensor and a control method of the photoelectric sensor, and particularly relates to a photoelectric sensor capable of saving energy and a control method of the photoelectric sensor. 
         [0004]    Description of Related Art 
         [0005]    Generally, a photoelectric sensor applies an oscillation circuit to produce a light projecting pulse to periodically drive a light projecting element, and in an object detection region, a detected object blocks or reflects the light coming from the light projecting element, and a light receiving element cannot receive the light from the light projecting element or the light receiving element receives the light from the light projecting element to generate a light signal, and determines whether the detected object exists based on the light signal. 
         [0006]    In the photoelectric sensor, a pulse generated by the oscillation circuit is generally a pulse with a fixed pulse width and fixed period. However, in recent years, the idea of energy saving draws more attention. 
         [0007]    In order to achieve the effect of energy saving, a patent literature 1 (Japan patent No. 6-209250) discloses a photoelectric switch. In the photoelectric switch of the patent literature 1, an oscillation circuit used for producing the light projecting pulse is connected to a start detection circuit, where the start detection circuit is used for determining whether an environment where the photoelectric switch is located is suitable for detecting an object and a human body, etc. In case that the start detection circuit determines that the current environment is not suitable for the photoelectric switch to implement detection, the oscillation circuit produces a long first period T 1 , and in case that the start detection circuit determines that the current environment is suitable to implement the detection, the oscillation circuit produces a second period T 2  shorter than the first period T 1 . In this way, by setting two different pulse periods, during the long first period T 1 , the energy consumed by a light-emitting device is decreased, so as to save the energy. 
         [0008]    A patent literature 2 (U.S. Pat. No. 5,331,150A) discloses another photoelectric switch. In the photoelectric sensor, when a state of an optical path is changed, the oscillation circuit is changed from a state of producing the pulse with a long period to a state of producing the pulse with a short period, so as to achieve the effect of energy saving. 
         [0009]    Moreover, an interference signal is a main reason causing a detection error of the photoelectric sensor, so that it is important to improve an anti-interference performance of the photoelectric sensor. 
         [0010]    However, in the aforementioned patent literatures, there is no content related to anti-interference technique. 
         [0011]    Patent literature 1: Japan patent No. 6-209250 
         [0012]    Patent literature 2: U.S. Pat. No. 5,331,150A 
       SUMMARY OF THE INVENTION 
       [0013]    The invention is directed to a photoelectric sensor, which is capable of saving energy and has good anti-interference performance. 
         [0014]    In order to resolve the aforementioned problems, the invention provides a photoelectric sensor, and the photoelectric sensor includes a driving pulse generating unit, which is adapted to generate a driving pulse of different cycles; a light-emitting part, which is adapted to receive the driving pulse to emit a light corresponding to the driving pulse; a light receiving part, which is adapted to receive the light comes from the light-emitting part and reflected by a detected object to generate a light receiving signal; an output unit, which is adapted to process the light receiving signal to output a detection signal; and a control unit, which is adapted to control the driving pulse generating unit to generate a first driving pulse of a sleep cycle in usual, where the control unit s triggered by a variation of the detection signal to control the driving pulse generating unit to generate a specified number of second driving pulses of a duty cycle, and the duty cycle is formed by two or more specific cycles with different lengths, and an average of the two or more specific cycles is taken as a value of the duty cycle, and the duty cycle is shorter than the sleep cycle. 
         [0015]    In one disclosure of the invention, the specific cycles include a first cycle and a second cycle with a length different to a length of the first cycle, and the first cycle and the second cycle are alternated. Alternatively, the specific cycles include a plurality of cycles with lengths sequentially becoming longer or shorter. 
         [0016]    In one disclosure of the invention, the driving pulse generating unit includes a system clock generating unit, which is adapted to generate a system clock; a frequency dividing unit, which is controlled by the control unit to generate the first driving pulse and the second driving pulses according to the system clock; and a selection unit, which is controlled by the control unit to select the first driving pulse or the second driving pulses. 
         [0017]    In one disclosure of the invention, the control unit determines lengths of the duty cycle and the sleep cycle according to a size of the detected object and a moving speed of the detected object. 
         [0018]    In one disclosure of the invention, a ratio of the sleep cycle and the duty cycle is 10-15. 
         [0019]    In one disclosure of the invention, the specified number is an integer of 4-8. 
         [0020]    The invention provides a control method of a photoelectric sensor, and the control method is adapted to control the photoelectric sensor, where the photoelectric sensor includes a driving pulse generating unit, a light-emitting part, a light receiving part, an output unit and a control unit. The control method of the photoelectric sensor includes a driving pulse generating step: generating a driving pulse of different cycles by the driving pulse generating unit; a light-emitting step: receiving the driving pulse by the light-emitting part to emit a light corresponding to the driving pulse; a light receiving step: receiving the light which is from the light-emitting part and reflected by a detected object to generate a light receiving signal; an output step: processing the light receiving signal by the output unit to output a detection signal; and a driving pulse determination step: controlling the driving pulse generating unit by the control unit to generate a first driving pulse of a sleep cycle in usual, where the control unit is triggered by a variation of the detection signal to control the driving pulse generating unit to generate a specified number of second driving pulses of a duty cycle, and the duty cycle is formed by two or more specific cycles with different lengths, and an average of the two or more specific cycles is taken as a value of the duty cycle, and the duty cycle is shorter than the sleep cycle. 
         [0021]    In one disclosure of the invention, the specific cycles include a first cycle and a second cycle with a length different to a length of the first cycle, and the first cycle and the second cycle are alternated. Alternatively, the specific cycles include a plurality of cycles with lengths sequentially becoming longer or shorter. 
         [0022]    In one disclosure of the invention, the driving pulse generating unit includes a system clock generating unit, which is adapted to generate a system clock; a frequency dividing unit, which is controlled by the control unit to generate the first driving pulse and the second driving pulses according to the system clock; and a selection unit, which is controlled by the control unit to select the first driving pulse or the second driving pulses. 
         [0023]    In one disclosure of the invention, the control unit determines lengths of the duty cycle and the sleep cycle according to a size of the detected object and a moving speed of the detected object. 
         [0024]    In one disclosure of the invention, a ratio of the sleep cycle and the duty cycle is 10-15. 
         [0025]    In one disclosure of the invention, the specified number is an integer of 4-8. 
         [0026]    According to the above description, the invention provides the photoelectric sensor and the control method thereof capable of saving energy and having good anti-interference performance. 
         [0027]    In order to make the aforementioned and other features and advantages of the invention comprehensible, several exemplary embodiments accompanied with figures are described in detail below. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0028]    The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. 
           [0029]      FIG. 1  is a block diagram of a whole structure of a photoelectric sensor according to an embodiment of the invention. 
           [0030]      FIG. 2  is a timing diagram of an operation of the photoelectric sensor according to an embodiment of the invention. 
           [0031]      FIG. 3  is a timing diagram of an operation of the photoelectric sensor according to a variation example of the invention. 
           [0032]      FIG. 4  is a timing diagram of an operation of the photoelectric sensor according to another variation example of the invention. 
       
    
    
     DESCRIPTION OF EMBODIMENTS 
       [0033]    Embodiments of the invention are described below with reference of figures. A photoelectric sensor  1  of the invention is used for detecting a detected object with a larger volume on a production line. 
         [0034]    First, description is made with reference of a structure of the photoelectric sensor  1  of a first embodiment of  FIG. 1 .  FIG. 1  is a block diagram of a whole structure of the photoelectric sensor  1  according to the first embodiment of the invention. 
         [0035]    The photoelectric sensor  1  of the first embodiment includes a system clock generating unit  2 , which is adapted to generate system clock pulse signals with a same cycle and a same pulse width; a frequency dividing unit  3 , which includes a frequency dividing module m and a frequency dividing module n, where the frequency dividing module m modulates the system clock pulse signal to produce a pulse signal with a periodically alternating duty cycle T 1 , and the frequency dividing module n modulates the system clock pulse signal to produce a pulse signal with a sleep cycle T 2 , where the duty cycle T 1  is formed by a first cycle T 11  and a second cycle T 12  with a length different with that of the first cycle T 11 , and a value of the duty cycle T 1  is an average of the first cycle T 11  and the second cycle T 12 , and the sleep cycle T 2  is longer than the duty cycle T 1 , the first cycle T 11  and the second cycle T 12 . The photoelectric sensor  1  further includes a selection unit  4 , which is controlled by a control unit  8  to select the pulse signal with a cycle of the duty cycle T 1  or a pulse signal with a cycle of the sleep cycle T 2  to serve as a driving signal for outputting; a light-emitting part  5 , which includes a light-emitting element  52  capable of emitting light and a light-emitting driving unit  51  adapted to drive the light-emitting element  52 ; a light receiving part  6 , which includes a light receiving element  62  used for receiving the light coming from the light-emitting element  52  and a light amplification module  61  used for amplifying a light receiving signal coming from the light receiving element  62 ; and an output unit  7 , which is adapted to process the light receiving signal amplified by the light amplification module  61  to output a detection signal. 
         [0036]    Operation of the photoelectric sensor  1  is described below with reference of  FIG. 2 . In the following description, a situation of stating the photoelectric sensor  1  in case that the detected object is located on an optical path between the light-emitting element  52  and the light receiving element  62  (which is referred to as a detecting optical path hereinafter) is described below. 
         [0037]      FIG. 2  is a timing diagram of the operation of the photoelectric sensor  1 . In  FIG. 2 , the output signal is delayed by a response time Td of the sensor relative to the light receiving signal. 
         [0038]    When the photoelectric sensor  1  is started, the system clock generating unit  2  keeps generate the system clock pulse signal, and the frequency dividing module m generates the pulse signal of the duty cycle T 1 , and the frequency dividing module n generates the pulse signal of the sleep cycle T 2 . 
         [0039]    Then, since the detected object exists on the detection optical path, the control unit  8  controls the selection unit  4  to select the pulse signal of the sleep cycle T 2  to serve as the driving signal for outputting to the light-emitting driving unit  51 , and the light-emitting driving unit  51  drives the light-emitting element  52  by the sleep cycle T 2 , such that the light-emitting element  52  emits light in the sleep cycle T 2 . By selecting the pulse signal of the long sleep cycle T 2  to serve as the driving signal, an energy saving effect is achieved. 
         [0040]    Since the detected object exists on the detection optical path, the light receiving element  62  is shielded and cannot receive the light coming from the light-emitting element  52 , and the output unit  7  does not output the detection signal. 
         [0041]    Along with movement of the detected object, when the detected object does not exist on the detection optical path, the light-receiving element  62  may receive the light coming from the light-emitting element  52 , and now the output unit  7  outputs the detection signal. 
         [0042]    Now, based on variation of a state of the detection signal of the output unit  7  (the detection signal is changed from a low level to a high level), the control unit  8  controls the selection unit  4  to select the pulse signal of the duty cycle T 1  to serve as the driving signal for outputting to the light-emitting driving unit  51 , and the light-emitting driving unit  51  drives the light-emitting element  52  by the duty cycle T 1 , such that the light-emitting element  52  emits light in the duty cycle T 1 . Now, since the detected object does not exist on the detection optical path, the light receiving element  62  may receive the light coming from the light-emitting element  52 , and the output unit  7  outputs the detection signal. 
         [0043]    When the light-emitting element  52  emits light in the duty cycle T 1  by 4 times, and the output unit  7  outputs the detection signal corresponding to the driving signal by 4 times, the control unit  8  controls the selection unit  4  to select the pulse signal of the sleep cycle T 2  to serve as the driving signal for outputting to the light-emitting driving unit  51 , and the light-emitting driving unit  51  drives the light-emitting element  52  by the sleep cycle T 2 , such that the light-emitting element  52  emits light in the sleep cycle T 2 . 
         [0044]    Then, the sleep cycle T 2  is kept driving the light-emitting element  52  until the state of the detection signal output by the output unit  7  is varied. When there is no output signal corresponding to the driving signal, it represents that a new detected object is appeared on the detection optical path. Now, the light coming from the light-emitting element  52  is shielded by the detected object, and the light receiving element  62  cannot receive the light coming from the light-emitting element  52 , such that the output unit  7  does not outputs the detection signal. Based on the variation of the state of the detection signal of the output unit  7 , the control unit  8  controls the selection unit  4  to select the pulse signal of the duty cycle T 1  to serve as the driving signal for outputting to the light-emitting driving unit  51 , and the light-emitting driving unit  51  drives the light-emitting element  52  by the duty cycle T 1 , such that the light-emitting element  52  emits light in the duty cycle T 1 . 
         [0045]    When the light-emitting element  52  emits light in the duty cycle T 1  by 4 times, and the output unit  7  still does not output the detection signal corresponding to the driving signal by 4 times, the control unit  8  controls the selection unit  4  to select the pulse signal of the sleep cycle T 2  to serve as the driving signal for outputting to the light-emitting driving unit  51 , and the light-emitting driving unit  51  drives the light-emitting element  52  by the sleep cycle T 2 , such that the light-emitting element  52  emits light in the sleep cycle T 2  until the state of the detection signal of the output unit  7  is again varied. 
         [0046]    Then, the aforementioned operations are repeated. 
         [0047]    In the aforementioned embodiment, only when the state of the detected object on the detection optical path (the state of the detection signal of the output unit) is varied, i.e. from a state with the detected object to a state without the detected object, or from the state without the detected object to the state with the detected object, the selection unit  4  selects the pulse signal of the duty cycle T 1  which has a period shorter than the sleep cycle T 2  to drive the light-emitting device  52  by the duty cycle T 1 , and the pulse signal is constructed by alternating a pulse signal with a cycle of the first cycle T 11  and a pulse signal with a cycle of the second cycle T 12  which has a length different to the length of the first cycle T 11 , and the sleep cycle T 2  is longer than the first cycle T 11  and the second cycle T 12 , and when the state of the detected object on the detection optical path is not changed in usual, the light-emitting element  52  is always driven in the sleep cycle. In this way, not only the power consumed by the light-emitting element is decreased to save energy, the duty cycle T 1  is constructed by two different alternated cycles, such that compared with the situation that the duty cycle is a single cycle, an interference signal with a frequency that is the same with the single cycle can be eliminated, so as to improve a detection accuracy of the photoelectric sensor. 
         [0048]    Moreover, time lengths of the duty cycle T 1  and the sleep cycle T 2  can be determined according to a length of the detected object and a moving speed of the detected object on a production line. For example, based on an average moving speed of the detected object, a time that the detected object with the shortest length passes through the photoelectric sensor  1  is a sum of the time of a plurality of (for example, 4 in the present embodiment) the duty cycles T 1  and the time of a plurality of (for example, 4, 3, 5, or 10, etc.) the sleep cycles T 2 . 
         [0049]    An example of pulse widths of the duty cycle T 1  (the first cycle T 11 , the second cycle T 12 ) and the sleep cycle T 2  is provided below. A width of the driving signal is, for example, 2-2.5 microseconds (ms), the first cycle T 11  is 30 ms, the second cycle T 12  is 50 ms, and the sleep cycle T 2  is 400 ms, if an average of the first cycle T 11  and the second cycle T 12  is taken as the value of the duty cycle T 1 , a ratio of the sleep cycle T 2  and the duty cycle T 1  is 10. 
         [0050]    The values of the duty cycle T 1  (the first cycle T 11 , the second cycle T 12 ) and the sleep cycle T 2  are only an example, and the ratio of the sleep cycle T 2  and the duty cycle T 1  is not limited to 10, which can be 10-15, and preferably 13. In this way, the photoelectric sensor may perform detection in good conditions. 
         [0051]    Moreover, in the aforementioned embodiment, the duty cycle T 1  is constructed by alternating the first cycle T 11  and the second cycle T 12 , though the invention is not limited thereto. 
         [0052]    Variations of the invention are described below with reference of  FIG. 3  and  FIG. 4 .  FIG. 3  is a timing diagram of the operation of the photoelectric sensor according to a variation of the invention, and  FIG. 4  is a timing diagram of the operation of the photoelectric sensor according to another variation of the invention. 
         [0053]    As shown in  FIG. 3 , the frequency dividing unit  3  may further have a frequency modulation module (now shown) disposed in the downstream of the frequency dividing module in. In this case, the frequency dividing module m modulates the system clock pulse signal to produce the pulse signal with the same duty cycle, and the frequency modulation module modulates the pulse signal of the duty cycle to produce the pulse signal of the cycles T 11   a,  T 12   a,  T 13   a  with lengths thereof sequentially becoming longer, and the duty cycle T 1  is an average of the cycle T 11   a,  the cycle T 12   a,  the cycle T 13   a.    
         [0054]    As shown in  FIG. 4 , the frequency dividing unit  3  may further have a frequency modulation module (now shown) disposed in the downstream of the frequency dividing module m. In this case, the frequency dividing module m modulates the system clock pulse signal to produce the pulse signal with the same duty cycle, and the frequency modulation module modulates the pulse signal of the duty cycle to produce the pulse signal of cycles T 13   b,  T 12   b,  T 11   b  with lengths thereof sequentially becoming shorter, and the duty cycle T 1  is an average of the cycle T 13   b,  the cycle T 12   b,  the cycle T 11   b.    
         [0055]    In the aforementioned embodiment, taking a situation that when the output unit  7  continuously outputs 4 output signals corresponding to the duty cycle, the selection unit  4  selects the pulse signal with the cycle of the sleep cycle T 2  to drive the light-emitting element  52  as an example for description, though the number of the output signals used for triggering the selection unit  4  to select the pulse signal of the sleep cycle T 2  is not limited to 4, which is, for example, greater than 4, and is preferably 4-8. In this way, the photoelectric sensor may perform detection in good conditions. 
         [0056]    In the aforementioned embodiment, the sleep cycles T 2  are assumed to be equivalent, though the invention is not limited thereto, and the sleep cycles can be gradually increased, and when the light-emitting element emits light by 4 times and the state of the output signal is not changed, i.e. the state of the detected object is not changed, the sleep cycle is changed to a constant value. In this way, the detection accuracy is improved. 
         [0057]    It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.