Abstract:
An optical signal detection apparatus and method for a computer mouse compares two output signals of a first photo-transistor and a second photo-transistor to obtain a reference signal. Then a pulse signal generating unit utilizes the reference signal to generate a series of pulse signals each occurring when the voltage level of the reference signal is changed. Thereafter a sample and hold circuit samples and holds the voltage value of the output signals of the photo-transistors at the moments that pulse signals are generated. A dynamic reference voltage generating unit uses the sampled voltage values to calculate a dynamic reference voltage. The voltage level of the dynamic reference voltage is varied with the output signals of the photo-transistors. By using the dynamic reference voltage to compare with the output signals of the photo-transistors, the on/off statuses of the photo-transistors can be precisely detected.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of Invention  
           [0002]    The present invention relates to an optical signal detection method and apparatus for a computer mouse, and more particularly to a detection technology which calculates a reference voltage signal based on the input signal from a moving mouse, to precisely determine the movement status of the mouse.  
           [0003]    2. Related Art  
           [0004]    With reference to FIG. 7, a part of a conventional circuit, where only the X-axis detecting circuit is shown, for detecting the signals of a computer mouse comprises a roller ball ( 60 ), a disk ( 61 ) defined with multiple radially extending slits (not numbered), a light emission diode ( 62 ), two photo-transistors ( 63 ,  64 ) and two comparators ( 65 ,  66 ). The disk ( 61 ) is secured to a rotary shaft that is driven by the roller ball ( 60 ).  
           [0005]    When a user operates the mouse, the rotary ball ( 60 ) transmits the disk ( 61 ) to rotate via the rotary shaft, whereby the two photo-transistors ( 63 ,  64 ) can be turned on/off by the discontinuous light signals that are emitted from the light emission diode ( 62 ) through the slits of the disk ( 61 ). By determining the phase difference of the two output signals (X 1 , X 2 ) from the two photo-transistors ( 63 ,  64 ), the movement direction along the X-axis of the mouse is recognized. Furthermore, the detection of the movement direction along the Y-axis is achieved by another pair of photo-transistors (not shown). Since the operation of the Y-axis photo-transistor is substantially the same as the foregoing description, the explanation for the Y-axis photo-transistor is omitted.  
           [0006]    Since the voltage level of the output signal from the two photo transistors ( 63 ,  64 ) will vary with the movement speed of the mouse, two rheostats (R 1 , R 2 ) are provided to fine tune the voltage level. By choosing an appropriate resistance value of each rheostat (R 1 , R 2 ), the voltage level can be properly controlled in the allowable range, so that the two comparators ( 65 ,  66 ) can be operated correctly.  
           [0007]    However, since the reference voltage level of each comparator ( 65 ,  66 ) is predetermined, and the resistance value of each rheostat (R 1 , R 2 ) is set as a proper constant value, once the voltage level of the output signals of each photo-transistor ( 63 ,  64 ) is over low or over high, the comparators ( 65 ,  66 ) can not correctly determine whether the photo-transistors ( 63 ,  64 ) are turned on or not. Thus the movement of the computer mouse can not be precisely presented.  
           [0008]    With reference to FIG. 8, to solve the foregoing problem, another conventional signal detection circuit has been developed. The circuit utilizes a comparator ( 71 ) to receive the output signal of a photo-transistor ( 70 ). A reference voltage (V−), which is input to a terminal denoted with “−”, of the comparator ( 71 ) is a feedback signal, wherein the feedback signal is from the output of the comparator ( 71 ) which be further processed by an up/down counter ( 72 ) and a D/A converter ( 73 ). By using such a circuit design, the comparator ( 71 ) obtains a variable reference voltage (V−) based on the output signal of the photo-transistor ( 70 ). Although such a circuit design having the variable reference voltage can overcome the drawback of the foregoing circuit of FIG. 7, the entire circuit layout becomes more complex than that because the up/down counter ( 72 ) and the D/A converter ( 40 ) are involved. Further, the manufacturing cost of such a circuit is high.  
           [0009]    To overcome the shortcomings, the present invention provides an optical signal detection method and apparatus for a computer mouse to mitigate and obviate the aforementioned problems.  
         SUMMARY OF THE INVENTION  
         [0010]    An objective of the invention is to provide an optical signal detection method and apparatus for a computer mouse to calculate a variable reference voltage based on the output signal of the photo-transistor and to provide to a comparator, so as to make the comparator accurately determine the movement of the computer mouse.  
           [0011]    Another objective of the invention is to provide an optical signal detection method and apparatus for a computer mouse to simplify the circuit design and reduce the production cost.  
           [0012]    To achieve the objectives, the apparatus in accordance with the present invention comprises:  
           [0013]    a comparator comparing a first output signal X 1  of a first photo-transistor with a second output signal X 2  of a second photo-transistor to output a reference signal;  
           [0014]    a pulse signal generating unit connected to the output of the comparator to generate the pulse signals based on the rising edges or falling edges of the reference signal;  
           [0015]    a sample and hold circuit connected to the output of the pulse signal generating unit, the first photo-transistor and the second transistor, to sample and hold the voltage value of the output signal of the two photo-transistors based on said pulse signals;  
           [0016]    a dynamic reference voltage generating unit connected to the output of the sample and hold circuit to calculate a dynamic reference voltage according to the sampled and held voltage value;  
           [0017]    wherein by comparing said dynamic reference voltage with the output signal of the photo transistors, digital signals representing the on/off statuses of the photo-transistors are accurately obtained, and the digital signals are further processed to determine the movement of the computer mouse.  
           [0018]    Other objects, advantages and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0019]    [0019]FIG. 1 is a circuit block diagram of a first embodiment of an optical signal detection apparatus for a computer mouse in accordance with the present invention;  
         [0020]    [0020]FIG. 2 is a waveform view shown output signals of two photo-transistors in accordance with the present invention;  
         [0021]    [0021]FIG. 3 is circuit diagram shown a reference voltage generating unit and a sample and hold circuit in accordance with the present invention;  
         [0022]    [0022]FIG. 4 is a waveform view of a calculated reference voltage in accordance with the present invention;  
         [0023]    [0023]FIG. 5 is another waveform view of a calculated reference voltage in accordance with the present invention;  
         [0024]    [0024]FIG. 6 is a block diagram of a second embodiment of an optical signal detection apparatus for a computer mouse in accordance with the present invention;  
         [0025]    [0025]FIG. 7 is a part of a conventional signal detection circuit; and  
         [0026]    [0026]FIG. 8 is a circuit block diagram of a conventional signal detection circuit. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0027]    With reference to FIG. 1, a first embodiment of an optical signal detection apparatus in accordance with the present invention comprises a first comparator ( 10 ) with an output, a pulse signal generating unit ( 20 ) connected to the output of the comparator ( 10 ), a sample and hold (S/H) circuit ( 30 ) connected to an output of the pulse signal generating unit ( 20 ), and a dynamic reference voltage generating unit ( 40 ) receiving output signals of the S/H circuit ( 30 ).  
         [0028]    The input signals of the first comparator ( 10 ) denoted with “X 1 ” and “X 2 ” respectively represent the output signals of two photo-transistors (not shown) of the X-axis movement detection. The circuit design of Y-axis is the same as the X-axis, so only the description for X-axis movement detection is disclosed hereinafter.  
         [0029]    With reference to FIGS. 1 and 2, by comparing the output signals (X 1 , X 2 ) with each other by the comparator ( 10 ), a reference signal (a) with square waveform is output from the comparator ( 10 ). The change point of the voltage level of the reference signal (a), i.e. from low to high (the rising edge) or from low to high (the falling edge), occurs when the voltage of the two output signals are equal. The reference signal (a) is further input to the pulse signal generating unit ( 20 ). The pulse signal generating unit ( 20 ) employs the high frequency sampling means to detect the voltage level variation of the reference signal (a). Thereby the signal generating unit ( 20 ) will generate the pulse signals (b) or pulse signals (c) based on the rising edge or falling edge of the reference signal (a).  
         [0030]    With reference to FIG. 2, the pulse signals (b) or (c) are further input to the sample and hold circuit ( 30 ). At the moment the pulse signals are generated, the voltage value of one of the output signals (X 1  or X 2 ) from the photo-transistors is sampled and held by the sample and hold circuit ( 30 ). Because the output voltage values of the two output signal X 1  and X 2  are equal at the moment that the pulse signals are generated, the sampled and held voltage value can be taken from whether the signal is X 1  or X 2 . These sampled and held voltage values are further input to the dynamic reference voltage generating unit ( 40 ).  
         [0031]    The dynamic voltage generating unit ( 40 ) employs a present sampled value X(n) and several former sampled values X(n−1), X(n−2), X(n−3) . . . , to calculate a dynamic reference voltage Y(n). The present invention provides two calculation ways (A) and (B) to obtain the dynamic reference voltage Y(n).  
                        (   A   )     :                Y        (   n   )         =         1   2     ·     X        (   n   )         +       1   4     ·     X        (     n   -   1     )         +       1   8     ·     X        (     n   -   2     )         +   …                             
 
         [0032]    This formula uses the present sampled value X(n) and the former sampled values X(n−1), X(n−2), X(n−3) . . . to obtain the dynamic reference voltage Y(n). By rearranging the equation (A), the relationship between the reference voltage Y(n) and the sampled values can be rearranged to a transfer function:  
         Y        (   n   )       =         1   2       1   -       1   2          Z     -   1             .                           
 
         [0033]    Based on the transfer function, the voltage generating unit ( 40 ) can be deemed as a low pass filter.  
           (   B   )     :                Y        (   n   )                    =         1   2     ·     X        (   n   )         +       1   2     ·     X        (     n   -   1     )                                 
 
         [0034]    The above formula only utilizes a present sampled value X(n) and a previous sampled value X(n−1) to calculate the dynamic reference voltage Y(n).  
         [0035]    The transfer function of equation (B) can be rearranged as  
         Y        (   n   )       =       1   2     +       1   2            Z     -   1       .                               
 
         [0036]    Furthermore, the sample and hold circuit ( 30 ) can be designed to perform two different sampling ways, i.e. the full cycle sample and the half cycle sample. The full cycle sample represent the sample action only occurs once at each complete cycle of the reference signal (a). With reference to FIG. 2, for example, if the sample and hold circuit ( 30 ) employs the full cycle sample way, the sample action occurs at the moment that pulse signals A, C are generated. Further the pulse signals (c) also can be employed to the full cycle sample way.  
         [0037]    If the sample and hold circuit ( 30 ) adopts the half cycle sample way, both pulse signals (b) and (c) are together applied for sampling, i.e. the sample action occurs at the moment that pulse signals A, B, C and D are generated. It is noted that both the full cycle sample way and the half cycle sample way are suitable to be applied in the foregoing calculations (A) and (B).  
         [0038]    With reference to FIG. 3, to implement the first calculation (A) described earlier, a practical circuit layout of the sample and hold circuit ( 30 ) and the reference voltage generating unit ( 40 ) comprises a first switch ( 31 ) and a second switch ( 32 ) to connect an input signal X 1  that is output from the photo-transistor (not shown). A first capacitor ( 33 ) and a second capacitor ( 34 ) are respectively connected to the first switch ( 31 ) and the second switch ( 32 ). A third switch ( 41 ) and a fourth switch ( 42 ) are further respectively connected to the two capacitors ( 33 ) ( 34 ).  
         [0039]    With reference to FIGS. 2 and 3, if the sample and hold circuit ( 30 ) and the reference voltage generating unit ( 40 ) shown in FIG. 3 adopt the half cycle sample way, when the first pulse signal A is generated, the first switch ( 31 ) and the fourth switch ( 42 ) are quickly closed. Thus the voltage value (V 1 ) of the signal X 1  is sampled and held in the first capacitor ( 33 ). The close time of the first switch ( 31 ) is determined by the pulse width of pulse signal A. When the second pulse signal B is generated, the second switch ( 32 ) and the third switch ( 41 ) are closed. The voltage value (V 2 ) is sampled and stored in the second capacitor ( 34 ). The close time of the second switch ( 32 ) is determined by the pulse signal B. When the first switch ( 31 ) and the second switch ( 32 ) are both open, the third switch ( 41 ) and the fourth switch ( 42 ) are both closed. Thereby the two capacitors ( 33 ) ( 34 ) are deemed as connected in parallel. When two capacitors ( 33 ) ( 34 ) are connected in parallel, the voltage potential stored in the two capacitors ( 33 ) ( 34 ) are added together and averaged. Thus the dynamic reference voltage Y(n) is obtained. Since the input signal X 1  is not a constant voltage, the dynamic reference voltage Y(n) is varied with the input signal X 1 .  
         [0040]    With reference to FIG. 4, the stimulated waveform chart represents the input signals (X 1  and X 2 ) and the dynamic reference voltage Y(n) that is calculated by the first calculation formula (A), where  
         Y        (   n   )       =         1   2     ·     X        (   n   )         +       1   4     ·     X        (     n   -   1     )         +       1   8     ·     X        (     n   -   2     )         +   …                           
 
         [0041]    [0041]FIG. 5 is another stimulated waveform chart, wherein the dynamic reference voltage is calculated by the second calculation formula (B), where  
         Y        (   n   )       =         1   2     ·     X        (   n   )         +       1   2     ·       X        (     n   -   1     )       .                               
 
         [0042]    Whether the first calculation formula (A) or the second calculation formula (B), the dynamic reference voltage is proved to vary with the input signals X 1  and X 2 .  
         [0043]    With reference to FIG. 1 again, the calculated dynamic reference voltage Y(n) is further input to a second comparator ( 50 ) and a third comparator ( 52 ). The two comparators ( 50 ,  52 ) further respectively receive the input signals X 1  and X 2 . Since the two comparators ( 50 ,  52 ) utilize the dynamic reference voltage Y(n) to compare with the input signals X 1  and X 2 , the status (on/off) of the photo-transistors can be accurately detected. The output signals, which are the digital signal form, (X 1out , and X 2out ) of the two comparators ( 50 ,  52 ), are further input to a coordinates calculating unit to determine the movement of the computer mouse.  
         [0044]    With reference to FIG. 6, the second embodiment of the present invention is substantially the same as the first embodiment of FIG. 1. The change is that the outputs of the two comparators ( 50 ,  52 ) are further respectively connected to a noise eliminator ( 54 ,  56 ) to filter the noises contained in the output signals.  
         [0045]    The invention may be varied in many ways by a skilled person in the art. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications are intended to be included within the scope of the following claims.