Detection apparatus and method

A detection apparatus determines whether an output of the light-receiving unit meets a predetermined reference level when the light emission amount of the light-emitting unit is changed, under a condition that the output of the light-receiving unit changes according to a change in a light emission amount of the light-emitting unit. The detection apparatus detects, based on the output from the light-receiving unit, that the light emitted from the light-emitting unit to the light-receiving unit is blocked, under a condition that the light-emitting unit is emitting light based on a light emission amount emitted from the light-emitting unit when it has been determined that the output of the light-receiving unit meets the predetermined reference level.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a detection apparatus and a method for detecting whether light is interrupted.

2. Description of the Related Art

Conventionally, the reference position in a machine that drives mechanism therein is detected by mechanical switches or photo-sensors.

However, the mechanical switches include tolerance and backlash and therefore they are not suitable for detecting the reference position with high accuracy. In detecting the reference position using a photo-sensor, generally, a current (light emission amount) on the light emitting side is fixed at a predetermined level, and an output from the light-receiving side is detected by comparing with a threshold value as the reference position.

In this case, a light emission amount may be set to be large on the light-emitting side and a load resistance value may be set to be large on the light-receiving side, so that the output of the light-receiving side reaches a saturation level even though a very small current induced by the incident light flows on the light-receiving side.

With regard to the encoder, Japanese Patent Application Laid-Open No. 08-145722 discusses a technique that a current from the LED is controlled so that added up current of output currents from a plurality of sensors should be at constant level to prevent drop in detection sensitivity due to dark current. Regarding a threshold value for making a decision in detecting a position, U.S. Pat. No. 6,079,892 discusses a detection apparatus for detecting an edge of paper by reflected light.

In the conventional methods, however, the detected position will vary owing to factors, such as a light emission amount of the light-emitting-side LED in a photo-sensor, photoelectric conversion characteristics of a light-receiving sensor, signal-to noise characteristics of an output signal, and threshold value characteristics for digitizing an output signal.

More specifically, the output level of the photo-sensor changes with variation of the photo-sensor, and also due to the effects of environmental change, such as temperature and voltage, and deterioration with time. Therefore, a resulting problem is that the reference position to be detected changes, and thus it is impossible to detect the reference position with high accuracy.

This problem will be concretely described with reference toFIG. 7.FIG. 7illustrates relationship between mechanical positions and output levels when the photo interrupter is used as a photo-sensor.

InFIG. 7, the horizontal axis indicates the position of a reference position detection flag (light blocking plate). The vertical axis indicates the output level of the light-receiving sensor. The dotted line represents the width of the slit opening of the photo interrupter with respect to the positions of the reference position detection flag on the horizontal axis.

InFIG. 7, depending on the position of the reference position detection flag, the operation of the photo interrupter is illustrated in three states: a light-blocked state in which the light of the photo interrupter is completely blocked, a partially light-blocked state, and an open state in which all of the light reaches the light-receiving unit.

In the completely light-blocked state in which the reference position detection flag completely covers the slit opening of the photo interrupter, because the emitted light does not reach the light-receiving unit, the output level is at a level close to “0” (only a dark current flows). On the other hand, in the open state in which the reference position detection flag is positioned outside of the slit opening of the photo interrupter, the output level of the light-receiving sensor is at a high, almost saturated level.

Conventionally, the reference position is set to be at a position where an intermediate value between the output levels of the light-receiving sensor respectively obtained in the light-blocked state and in the open state. However, in this case, the reference position changes by the factors described above. In other words, by variations of the sensors, changes in the light amount emitted from the LED, and temperature changes, for example, the output level of the light-receiving sensor changes as indicated by the solid line, the dotted line, and the long and short dash line inFIG. 7, and therefore a detected reference position may vary.

SUMMARY OF THE INVENTION

The present invention is directed to an apparatus for detecting a reference position at which light is blocked, with high accuracy.

According to an aspect of the present invention, a detection apparatus includes a control unit configured to control a light emission amount emitted from a light-emitting unit, a light-receiving unit configured to receive light from the light-emitting unit, and a determination unit configured to determine whether the output of the light-receiving unit meets a predetermined reference level when the light emission amount of the light-emitting unit is changed, in a condition that the output of the light-receiving unit changes according to a change of the light emission amount of the light-emitting unit under the control by the control unit, wherein the determination unit detects based on the output of the light-receiving unit that the light emitted from the light-emitting unit to the light-receiving unit is blocked, in a condition that the light-emitting unit is emitting light in accordance with the light emission amount emitted from the light-emitting unit when the determination unit determines that the output of the light-receiving unit meets the predetermined reference level.

DETAILED DESCRIPTION OF THE EMBODIMENTS

An exemplary embodiment of the invention will be described referring to a network camera, for example, to which the detection apparatus of the invention is applied.

FIG. 1is an external view of a network camera capable of panning and tilting. A panning device for horizontally rotating the image capturing unit and a tilting device for vertically rotating the image capturing unit are mounted on the base. This exemplary embodiment concerns a mechanically driven pan/tilt mechanism. As an example, a process for accurately detecting a reference position, which is used when operating the above mechanism, is described below.

FIG. 2is a block diagram of a pan/tilt network camera according to this exemplary embodiment. The network camera inFIG. 2includes a lens100, an image sensor110such as a CCD, a camera control unit120, an image processing unit130, a network processing unit140, a pan/tilt mechanism160as a detection unit.

Light transmitting through the lens100is converted into an electric signal by photoelectric conversion by the image sensor110under control of the camera control unit120. The electric signal is subjected to signal processing, image processing, and compression processing by the image processing unit130under control of the camera control unit120. The processed image data is transmitted to another apparatus connected to the network150via the network processing unit140.

In response to a command received from the other apparatus at the other end on the network via the network150or according to a predetermined sequence, the network processing unit140drives a pan motor or a tilt motor of the pan/tilt mechanism160to change the shooting direction of the network camera.

FIG. 3is a detailed block diagram of the pan/tilt mechanism160inFIG. 2. InFIG. 3, the pan/tilt control CPU200controls the whole operation of the pan/tilt mechanism160according to a computer-executable program.

The pan/tilt control CPU200performs comprehensive control of the pan/tilt mechanism160by reading a computer-executable program from ROM201(computer-readable medium).

The pan/tilt mechanism160includes a pan motor driver210, a pan motor215, and a reference position detection sensor (photo interrupter)220for panning. The pan/tilt mechanism160includes a current control unit225to control a light emission amount of the LED of the sensor220, and an analog to digital (A/D) converter230for A/D conversion of an output signal from the phototransistor of the sensor220.

The pan/tilt mechanism160includes a motor driver250for tilting, a tilt motor255, and a reference position detection sensor (photo interrupter)260for tilting. Furthermore, the pan/tilt mechanism160includes a current control unit265for controlling an emission amount of the LED of the sensor260, and an A/D converter270for A/D conversion of an output signal from the phototransistor of the sensor260.

FIGS. 4A to 4Cillustrate a positional relationship between a photo interrupter for detecting the reference position and a reference position detection flag. InFIGS. 4A to 4C, the photo interrupter500includes the LED510as the light-emitting element, and the phototransistor520as the light-receiving sensor of the light-receiving portion. The reference position detection flag530is formed by a light blocking plate. The light blocking plate is moved by the pan motor215(or the tilt motor255).

In response to a command from the pan/tilt control CPU200inFIG. 3, the pan motor driver210(or250) drives the motor215(255) for panning (or tilting). As a result, the relative position between the reference position detecting photo interrupter500and flag530changes.

FIG. 4Aillustrates the condition in which the flag530is located outside of the slit opening area of the photo interrupter500, and therefore the light from the light-emitting-side LED510is not blocked (open state).FIG. 4Billustrates the condition in which the flag530has come to the middle position of the slit opening area of the photo interrupter500, thus blocking part of the light emitted from the light-emitting-side LED510.FIG. 4Cillustrates the condition in which the flag530completely covers the slit opening area of the photo interrupter500to thereby intercept the light emitted from the LED510.

FIG. 5is a graph illustrating relationship between the light emission amount of the light-emitting-side LED510and the output level of the phototransistor520when the flag530is positioned outside of the photo interrupter500(in open state).

For convenience of explanation, this exemplary embodiment will be described assuming that the output level is higher when more incident light is received by the light-receiving unit and the output level is lower when less incident light is received. However, this depends on the circuit structure. However, it may be opposite to that. That is, the output level is lower when more incident light is received by the light-receiving unit and the output level is higher when the less incident light is received.

As illustrated inFIG. 5, normally, as the light emission amount of the light-emitting-side LED510is increased, the output level of the phototransistor520generally increases linearly.

When the light emission amount equal to or higher than a predetermined level, the output level of the phototransistor520is saturated and stays at a constant level. In this exemplary embodiment, the pan/tilt control CPU200determines an area where the output level changes almost linearly with respect to the light emission amount, and determines a reference position within the area.

As described above, the output level is saturated with more light amount than a predetermined level. Therefore, as illustrated inFIG. 5, the pan/tilt control CPU200determines that the output level of the phototransistor520has decreased below the saturation area and goes into the linear area as the light amount of the light-emitting-side LED510is decreased from the maximum light amount.

The light amount at this time is specified as a set light amount of the light-emitting-side LED510. Since the light amount of the light-emitting-side LED510is set at the determined light amount, the output level of the photo transistor520changes almost linearly with respect to the received light amount.

In other words, when the flag530enters the slit opening area and the flag530intercepts part of the light from the light-emitting-side LED510, the received light amount of the phototransistor520is limited according to the position of the flag530. At the same time, the output level of the phototransistor520can be obtained according to the limited received light amount.

More specifically, the light emission amount of the light-emitting-side LED510can be limited in the following manner, for example. The current flowing in the LED510is controlled to change by small amount at a time by using a D/A converter. The current flowing in the LED510is controlled by adjusting a current-limiting resistor using a 3-bit or 4-bit port.

FIG. 6is a graph illustrating relationship between the position of the flag53with respect to the photo interrupter and the output level of the phototransistor520. InFIG. 6, the horizontal axis indicates the position of the flag530and the vertical axis indicates the output level of the phototransistor520. The slit opening (width) of the photo interrupter is indicated by dotted lines with respect to the horizontal axis, which represents the position of the flag530.

The graph inFIG. 7indicates that the output level of the phototransistor520is saturated while the flag530is in the middle of the slit opening because the light emission amount of the LED510is too large.

In contrast, in the graph inFIG. 6, the output level is set so as not to be saturated even when the light is emitted to the slit opening in the slit open state as described above. Therefore, the output level of the phototransistor520changes almost linearly when the flag530extends in the slit opening.

Specifically, as illustrated inFIG. 6, the light emission amount of the light-emitting-side LED510is set according to the output level of the phototransistor520, which changes with variations of the components, the light amount change of the LED, deterioration with time, and environmental changes, such as temperature and voltage. Consequently, the output level of the phototransistor520changes almost linearly with respect to the position of the flag when it is positioned with in the slit opening portion.

A certain value of the output level of the phototransistor520, that is, an intermediate value of the output level between those of the open state and the light-blocked state is used as a threshold value. In this case, when the flag530is moved to an intermediate position of the slit opening, the output level of the phototransistor520becomes the similar value thereto, so that this intermediate position is designated as the reference position.

FIG. 8is an operation flowchart of the pan/tilt control CPU200(hereafter referred to as CPU200) when a reference position is detected.

FIG. 9is an operation flowchart of the CPU200detecting the output level of the phototransistor520with respect to the light emission amount of the LED510when the slit is in the open state in which the light from the light-emitting-side LED510is not at all blocked by the flag530.

InFIG. 9, the CPU200set the current supplied to the light-emitting-side LED510at maximum (IFmax) in step S300. This exemplary embodiment is described referring to the photo interrupter500including the LED510as the light-emitting unit, for example. Therefore, an electric current is used as a parameter to control a light emission amount. However, for the present invention, the parameter to control the light emission amount is not limited to the electric current.

Then, in step S310, the CPU200detects the output level (LVLmax) of the phototransistor520when the light emission amount of the light-emitting-side LED510is at maximum. The CPU200starts searching for the linear area with reference to the output level (LVLmax) when the light emission amount is maximal.

Then, the CPU200decreases the current supplied to the light-emitting-side LED510(IF=IF×ΔIF). In other words, in S320, the CPU200gradually decreases the light emitting amount of the light-emitting-side LED510from the maximum light emission amount. The ΔIF is a predetermined value or an arbitrary value (need not be constant). Each time it reduces the light emission amount of the light-emitting-side LED510, in step S330, the CPU200detects an output level of the phototransistor520.

In step S340, the CPU200compares the output level detected in step S330with the previously detected output level at maximum light emission amount (LVLmax). In step S340, the CPU determines whether the output level detected in step330is lower by a predetermined ratio (K) than the output level at the maximum light emission amount. The K is a constant between 0 and 1, that is, a 10 percent (0.1) for example.

As is described above, when the light emission amount is too large, the output level of the phototransistor520is saturated. As a criterion to determine whether the relationship between the light emission amount and the output level has become linear from saturated state, it is determined whether the output level is lower by a predetermined ratio from the output level at the maximum light emission amount.

In the present exemplary embodiment, whether the output level lowers by a predetermined ratio using the value obtained by multiplying LVLmax by a constant “K”. However, the similar effect can be obtained if it is determined whether the output level lowers by a predetermined amount, not by a ratio.

In step S340, if it is determined that the output level of the phototransistor520after the light emission amount is decreased has decreased by a predetermined ration from the output level obtained at the maximum light emission amount (LVLmax) (YES in step S340), the CPU200determines that the relationship between the light emission amount and the output level has become linear. And the process advances to step S380.

In step S380, the CPU200determines the light emission amount obtained when the relationship between the light emission amount and the output level of the phototransistor520has become linear to be a light emission amount to be used when the reference position is detected (the set light amount inFIG. 5). In step S390, the CPU200determines that the output level of the phototransistor520at the determined light emission amount is the output level (LVLhigh) when the photo interrupter is in the open state.

On the other hand, in step S340, if it is determined that the detected output level has not decreased by a predetermined ratio from the output level at the maximum light emission amount (LVLmax) (NO in step S340), it is determined that the output level is in the saturation area, the process advances to step S350.

In step S350, the CPU200determines whether the output level of the phototransistor520is lower than a predetermined minimum level (LVLmin). In other words, the CPU200determines whether the light emission of the LED510has turned off or whether the output level is below the minimum level for position detection.

Normally, the output level does not fall below the minimum level. However, if the output level is not higher than the minimum level (NO in step S350), the process proceeds to step S370, and the CPU200determines that an error has occurred. And, the reference position detection process is finished.

If the output level is not lower than the minimum level (YES in step S350), the process advances to step S360. In step S360, the CPU200, as a result of gradually reducing the current supplied to the light-emitting-end LED510, determines whether the current falls to “0” or the turned-off state.

When the LED510is turned off (YES in step S360), the accurate reference position cannot be detected. Therefore, the process advances to step S370. In step S370, the CPU200generates an error signal, and the reference position detection process is finished. If the light emission amount does not fall to “0” (NO in step S360), the process returns to step S320, and the CPU200again executes a process to reduce the light emission amount, and repeats a series of steps.

As is described referring toFIG. 5, normally, in the photo interrupter500, as the light emission amount of the light-emitting-side LED510is reduced and when the light emission amount becomes lower than a predetermined amount, the output level of the photo interrupter520falls below the saturation level. In a repeating processes, when the condition of step S340is satisfied, the process goes out of a series of steps and proceeds to step S380.

In a description ofFIG. 9, a method of detecting a current value when the output level starts to fall, by gradually decreasing the current from the maximum current (maximum light emission amount). Similar results can be obtained by another method, such as a method for detecting a linear area by starting from a minimum current (minimum light emission amount) and detecting the linear area just before the output level is saturated.

FIG. 8is a flowchart illustrating the processing performed by the CPU200when a reference position is detected. The process will be described referring to the pan motor215, but the similar process is executed for the tilt motor255. It is assumed that the flag530is placed in the slit opening area of the photo interrupter500(in the state inFIG. 4C). In a case where the flag is not located in the opening area (in the state inFIG. 4A), step S100is not required.

The CPU200gives a command to the pan motor driver210to drive the pan motor215. As a result, the flag530is moved. In other words, by this process, in step S110, the photo interrupter500is set to be in the open state that the light from the LED510is not interrupted as illustrated inFIG. 4A.

As illustrated inFIG. 4A, when the photo interrupter500is in the open state, in step S110, the CPU200determines the light emission amount (IFln) described referring toFIG. 9and detects the output level (LVLhigh) of the phototransistor520.

A detailed processing of the operation is as described above. More specifically, the process in step S110corresponds to those of steps S300to S390inFIG. 9. The description of the operation that is performed if the process proceeds to step S370inFIG. 9is not repeated inFIG. 8.

Then, the CPU200issues a command to the pan motor driver210to drive the pan motor215. In other words, the photo interrupter500is in the light-blocked state as illustrated inFIG. 4C(S120).

When the photo interrupter is in the light-blocked state, the CPU200detects the output level of the phototransistor520when the light emission amount is at a value determined in step S110, and, in step S130, sets the detected output level as an output level in the light-blocked state (LVLlow).

In step140, the CPU200determines a threshold value level (LVLth) based on the output level in the open state (LVLhigh) and the output level in the light-blocked state (LVLlow). Referring to this threshold level, for example, an intermediate value of the two levels (LVLth=(LVLhigh+LVLlow)/2) or a weighted average of those two levels as a threshold value level.

A threshold value level LVLth is calculated based on the LVLhigh and the LVLlow. However, a value of 50% or 55% of the LVLhigh, for example, may be determined as the threshold value level LVLth.

When the threshold value level for detecting a reference position has been determined, the CPU200performs a reference position detection operation by driving the pan motor215via the pan motor driver210. In step S150, the CPU200moves the flag530to change the photo interrupter500from the light-blocked state to the open state by the operation in step S120.

Furthermore, in step S160, the CPU200detects the output level of the phototransistor520, which changes with the above-described operation. In step S170, the CPU200determines whether the output level of the phototransistor520is larger than the threshold level determined in step S140.

If it is determined that the detected output level (LVL) is larger than the threshold value (LVLth) or equal to the threshold value (YES in step S170), the process advances to step S200. In step S200, the CPU200determines that the position of the flag530is the reference position. Then, in step S210, the CPU200stops the drive of the pan motor215, and ends the process.

If the CPU200determines that the detected output level of the phototransistor520is not higher than the threshold value (NO in step S170), the process proceeds to step S180. In step S180, the CPU200determines whether the flag530has passed the slit area and entered the open state area driven the pan motor.

If, in step S180, the flag530has moved to the open state illustrated inFIG. 4Awithout the output level of the phototransistor520exceeding the threshold value (YES in step S180), the process advances to step190and the CPU200determines that an error has occurred.

FIGS. 10A and 10Bare diagrams for schematically illustrating the reference position detection process.FIG. 10Aillustrates the relationship between the position of the flag530and the output level of the phototransistor520.FIG. 10Bis illustrates a moving operation of the flag530and a process of detecting the output level of the phototransistor520at each position of the flag when the reference position is detected.

The “A” inFIG. 10Bindicates an initial condition when a reference position is detected, which is an open state (the state inFIG. 4A) in which the photo interrupter500is in a state where the light from the LED510is not blocked. The black dot indicates the position of the flag530in the open state. The arrow indicates the moving direction of the flag530.

The “B” indicates an initial condition when the reference position is detected, which is a light-blocked state (the state inFIG. 4Bor4C) in which the light from the LED510is blocked in the photo interrupter500. The black dot indicates the position of the flag530in the light blocked state and the arrow indicates the moving direction of the flag530.

In the initial condition indicated by “A” inFIG. 10B, (1) the output level (LVLhigh) of the phototransistor520in the open state (the state inFIG. 4A) is determined.

Then, (2) the flag530is moved in the arrow direction to detect the output level in the light blocked state, and the output level in the light blocked state (LVLlow) inFIG. 4Cis determined.

Then, (3) while the flag530is moved in the arrow direction to detect the reference position, the output level of the phototransistor520is detected, and the position where the threshold value (LVLth) is exceeded is determined as the reference position.

On the other hand, at “B” inFIG. 10B, (1) the flag530is moved in the arrow direction (to the open side) to detect the output level (LVLhigh) of the phototransistor520in the open state (the state inFIG. 4A). This movement of the flag530is performed in step S100inFIG. 8.

Then, (2) the flag530is moved in the arrow direction to detect the output level in the light blocked state, and the output level in the light blocked state (LVLlow) inFIG. 4C.

And, (3) while the flag530is moved in the arrow direction in order to detect the reference position, the output level of the phototransistor520is kept being detected, and when the output level exceeds the threshold value (LVLth), the position is determined as the reference position.

As described above, the light emission amount from the light emitting unit520is controlled so that the output level of the phototransistor520as the light receiving sensor changes linearly in the slit opening area. Therefore, it is possible to always detect a highly reproducible reference position with high accuracy without being affected by variations of the components, environmental changes such as temperature and voltage, and deterioration with time. Consequently, it is possible to control the shooting direction of the camera with high accuracy.

In a second exemplary embodiment, an exemplary embodiment configured to detect a reference position without moving the flag530in such a manner as illustrated inFIG. 4C. As described above, the output level in the light blocked state (LVLlow) is the output level of the phototransistor520in the light blocked state, that is, when the light passing through the slit opening of the photo interrupter500is blocked with the flag530.

In the light blocked state, the light emission amount of the LED510is basically unrelated with the output level of the phototransistor520so long as there is no leaking light. As a result, the output level in the light blocked state (LVLlow) is determined by a dark current of the phototransistor520.

In the second exemplary embodiment, after the output level (LVLhigh) of the phototransistor520in the open state is detected, the light blocked state is obtained by stopping the light emission of the LED510. In this light blocked state, the light-blocked output level (LVLlow) of the phototransistor520is detected.

Since the subsequent operation is similar to the operation performed in the first exemplary embodiment, its description is not repeated. By the arrangement as described, the reference position can be detected at high speed.

In a third exemplary embodiment, an embodiment is described which uses the output level in the open state (LVLhigh) without using the output level in the light blocked state (LVLlow) for detecting a reference position.

The output level in the light blocked state (LVLlow) is determined by a dark current of the phototransistor520. Since the light-blocked output level is affected by environmental condition, but in terms of absolute value, this output level is not large. Therefore, in this third exemplary embodiment, the output level in the light blocked state (LVLlow) is not detected.

More specifically, after the output level of the phototransistor520in the open state (LVLhigh) is detected, a threshold value is determined only based on the output level in the open state (LVLhigh). The threshold value (LVLth) is ½ of the output level in the open state, i.e., LVLth=LVLhigh/2, for example.

Thus, the reference position can be detected only by using the output level in the open state. In the third exemplary embodiment, because the output level in the light blocked state (LVLlow) is not detected, the reference position can be detected at higher speed.

This application claims priority from Japanese Patent Application No. 2008-226987 filed Sep. 4, 2008, which is hereby incorporated by reference herein in its entirety.