Abstract:
An angle-calculation apparatus for three-phase optical encoder receives three-phase sinusoidal signals 120 degree phase from the optical encoder and obtains angle information for a motor rotor. The angle-calculation apparatus includes an A/D converter, a digital signal processor (DSP), a phase digitalizer and a digital counter. The A/D converter converts three-phase analog signals of the optical encoder into three-phase digital signals. The phase digitalizer converts the three-phase analog signals into digital phase signals. The digital counter generates a counting value based on the digital phase signals. The DSP performs an inverse trigonometric function calculation on a relatively linear region of the three-phase digital signals to obtain the angle information. The DSP obtains the rotation turn number and rotation direction of the motor rotor according to the counting value.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to an angle-calculation apparatus and angle-calculation apparatus method for optical encode, especially to an angle-calculation apparatus and angle-calculation apparatus method for three-phase optical encoder. 
         [0003]    2. Description of Prior Art 
         [0004]    The AC servomotor generally comprises an optical encoder wheel to sense angle information of a rotator, this angle information can be used to determine an electromagnetic field for driving stator current. Therefore, the speed of the AC servomotor can be precisely controlled 
         [0005]      FIG. 1  shows the schematic diagram of a prior art AC servo motor. The angular position of rotor in a motor  10  is detected by an optical encoder  12  and processed by a signal processing unit  20  to obtain angular information. The angular information is processed by a speed estimation unit  14  to obtain an estimated motor rotational speed. A speed controller  30  receives the estimated motor rotational speed and a speed command to control a controller module  32  and an IGBT module  34  in order to generate a motor speed control signal. The motor speed control signal can be used to precisely control the rotational speed of the motor  10 . 
         [0006]    The noise of the AC servomotor can be advantageously reduced if the optical encoder wheel can provide higher resolution. The conventional ways to enhance resolution for grating type optical encoder wheel includes: 1. Increasing the mark number on the optical encoder wheel. 2. Fine division by electronic skill. 3. Using different optical principle. The first method has limited effect because manufacture difficulty and diffraction phenomenon. The second method is more feasible because the mechanical structure does not need immense change. The third method needs to change the original architecture, such as using laser diode. Moreover, different optical design such as diffraction or interference are involved to enhance resolution. 
         [0007]    The fine division for existing optical encoder includes following four types. 1. The fine division mechanism is incorporated into the optical encoder such as GPI 9220, DRC 25D, RSF MS 6X series. 2. Standalone product, such as RENISHAW RGE series, HEIDENHAIN EXE 605 and SONY MJ100/110, MJ500/600/700 Series Interpolation Module. 3. The fine division mechanism is integrated into controller card or other products such as MM1200-PC/104. 4. The fine division mechanism is integrated into motor such as Fanuc, Mitsubishi. The fine division skill can provide 4-2048 times enhancement or more, which depends on the quality of original signal and signal compensation skill. 
         [0008]    The fine division method can be classified to phase fine division and amplitude fine division. The A, B output signals from an encoder are quasi-sinusoidal signal and can be expressed as: 
         [0000]      A=U 0  sin α 
         [0000]      B=U 0  cos α 
         [0009]    U.S. Pat. No. 6,355,927 discloses an amplitude fine division method, wherein A, B output signals of different amplitudes are under subtraction operation and processed by logic gate to achieve fine division. 
         [0010]    As the speed of DSP and MPU is increased, the fine division scheme can be implemented by ADC with the help of DSP and MPU. The signals are actively or passively adjusted for higher resolution.  FIGS. 2 and 3  show block diagram and flowchart for an implementation of electronic fine division. As shown in  FIG. 2 , the output angular information Sin ω and Cos ω of the encoder  12   a  are processed by an ADC  22   a  to convert into digital signals SIN X and COS X. The output angular information Sin ω and Cos ω of the encoder  12   a  are processed by a phase digitizer to obtain a digital signal M. The digital signal M is processed by the high speed signal processing portion  26   a  to generate a turn number signal N and a phase signal PH to provide quadrant and comparison information to the DSP  28   a . With reference to  FIG. 3 , the DSP  28   a  determine the rotor angle θ according to the digital signals SIN X and COS X, the turn number signal N and the phase signal PH. 
         [0011]    The etching technology for glass plate cannot satisfy the requirement of high resolution optical encoder. To obtain higher resolution, interpolation is performed to the quasi sinusoidal signals, which is produced by passing light through optical grating on the glass plate. In prior art angle-calculation method for motor rotor, sine signal and cosine signal (90 degree different to the sine signal) are used as source signals, and inverse function of tangent (Tan) or phase lock loop is used for angle calculation. However, full-amplitude portion is used for the sine signal and cosine signal. The source signals are required to be pure sinusoidal. The angle calculation is degraded when the source signals have harmonic component other than pure sinusoidal waves. 
         [0012]    The sinusoidal signals with 90 degree difference are used to evaluate the impact of harmonics on interpolation angle: 
         [0000]    
       
         
           
             A 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 θ 
               
               + 
               
                 
                   1 
                   8 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 3 
                  
                 θ 
               
               + 
               
                 
                   1 
                   32 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 5 
                  
                 θ 
               
               + 
               
                 
                   1 
                   128 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 7 
                  
                 
                     
                 
                  
                 θ 
               
             
           
         
       
       
         
           when 
         
       
       
         
           
             B 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 
                   sin 
                    
                   
                     ( 
                     
                       θ 
                       - 
                       
                         π 
                         2 
                       
                     
                     ) 
                   
                 
               
               + 
               
                 
                   1 
                   8 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 3 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       π 
                       2 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   32 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 5 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       π 
                       2 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   128 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 7 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       π 
                       2 
                     
                   
                   ) 
                 
               
             
           
         
       
     
         [0013]    The interpolation angle θ calculated by the inverse function of tangent 
         [0000]    
       
         
           
             θ 
             = 
             
               
                 tan 
                 
                   - 
                   1 
                 
               
                
               
                 A 
                 B 
               
             
           
         
       
     
         [0000]    with fine division method shown in  FIGS. 2 and 3  will have periodic error of ±2.5% because of harmonics. Therefore, the prior art angle-calculation method cannot achieve high resolution and has no robustness. 
       SUMMARY OF THE INVENTION 
       [0014]    It is the object of the present invention to provide an angle-calculation apparatus and angle-calculation apparatus method for three-phase optical encoder with robustness and high resolution. 
         [0015]    Accordingly, the present invention provides an angle-calculation apparatus for three-phase optical encoder, which receives three-phase sinusoidal signals 120 degree phase from the optical encoder and obtains angle information for a motor rotor. The angle-calculation apparatus includes an A/D converter, a digital signal processor (DSP), a phase digitalizer and a digital counter. The A/D converter converts three-phase analog signals of the optical encoder into three-phase digital signals. The phase digitalizer converts the three-phase analog signals into digital phase signals. The digital counter generates a counting value based on the digital phase signals. The DSP performs an inverse trigonometric function calculation on a relatively linear region of the three-phase digital signals to obtain the angle information. The DSP obtains the rotation turn number and rotation direction of the motor rotor according to the counting value. The relative linear region of the three-phase digital signal is a feasible region between the cross points of the three-phase digital signal to minimize the effect of non-ideal sinusoid signal. 
     
    
     
       BRIEF DESCRIPTION OF DRAWING 
         [0016]    The features of the invention believed to be novel are set forth with particularity in the appended claims. The invention itself however may be best understood by reference to the following detailed description of the invention, which describes certain exemplary embodiments of the invention, taken in conjunction with the accompanying drawings in which: 
           [0017]      FIG. 1  shows the schematic diagram of a prior art AC servo motor. 
           [0018]      FIG. 2  shows block diagram for an implementation of electronic fine division. 
           [0019]      FIG. 3  shows flowchart for an implementation of electronic fine division. 
           [0020]      FIG. 4  shows the block diagram for the angle-calculation apparatus for three-phase optical encoder according to the present invention. 
           [0021]      FIG. 5  shows the feasible region in the three-phase signals according to the present invention. 
           [0022]      FIGS. 6A and 6B  illustrate the 12 different sections of the feasible region. 
           [0023]      FIG. 7  is a perspective view of an optical encoder. 
           [0024]      FIGS. 8A to 8C  show the internal components in a three-phase optical encoder of the present invention. 
           [0025]      FIGS. 9A and 9B  show the output result of phase digitizer in forward and reverse directions. 
           [0026]      FIGS. 10A and 10B  demonstrate the counting by a state machine. 
           [0027]      FIG. 11  demonstrates another counting scheme. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0028]    The present invention utilizes a principle different from prior art scheme, wherein in prior art scheme two phase signals, namely, sine and cosine signals, are used. In the present invention, three-phase signals with 120 degree phase difference are used to obtain the angle of rotor. The three-phase sinusoidal signals A, B and C in the present invention have following expressions: 
         [0000]    
       
         
           
             A 
             = 
             
               
                 U 
                 0 
               
                
               sin 
                
               
                   
               
                
               θ 
             
           
         
       
       
         
           
             B 
             = 
             
               
                 U 
                 0 
               
                
               
                 sin 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         2 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
             
           
         
       
       
         
           
             C 
             = 
             
               
                 U 
                 0 
               
                
               
                 sin 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         4 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
             
           
         
       
     
         [0029]      FIGS. 8A to 8C  show the internal components in a three-phase encoder of the present invention.  FIG. 8A  shows the schematic view of the encoder wheel in the three-phase encoder of the present invention, which is similar to that in related art.  FIG. 8B  shows the photo diode in the three-phase encoder of the present invention, wherein three regions in middle section of the drawing represnet the light reception areas for the three-phase signals A, B and C in the present invention.  FIG. 8C  shows the photo mask for the three-phase encoder of the present invention, wherein three regions in the middle section are corresponding to masks for the three-phase signals A, B and C in the present invention. As can be seen from  FIGS. 8A to 8C , the three-phase encoder composed of the encoder wheel, the mask and the photo diode can produce three-phase signals A, B and C with 120 degree phase difference therebetween. 
         [0030]    With reference to  FIG. 5 , the angle-calculation method of the present invention uses middle portion of the three-phase signals A, B and C for interpolation operation. The middle portion of the three-phase signals A, B and C has higher robustness for sinusoidal property. More particularly, the middle portion of the three-phase signals A, B and C can be preferably referred to as interpolation feasible region defined by the region between cross points of the three signals A, B and C. The interpolation feasible region is relatively linear and is not sensitive to the sinusoidal property of the curves, thus reducing interpolation error. 
         [0031]    In the present invention, the offset and amplitude variation of the three signals A, B and C are assumed to be follows: 
         [0000]    
       
         
           
             A 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 θ 
               
               + 
               
                 V 
                 a 
               
             
           
         
       
       
         
           
             B 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 
                   sin 
                    
                   
                     ( 
                     
                       θ 
                       - 
                       
                         
                           2 
                            
                           π 
                         
                         3 
                       
                     
                     ) 
                   
                 
               
               + 
               
                 V 
                 b 
               
             
           
         
       
       
         
           
             C 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 
                   sin 
                    
                   
                     ( 
                     
                       θ 
                       - 
                       
                         
                           4 
                            
                           π 
                         
                         3 
                       
                     
                     ) 
                   
                 
               
               + 
               
                 V 
                 c 
               
             
           
         
       
     
         [0032]    For simplicity, provided that V 0 =V a =V b =V c , the interpolation process for the three phases signal is stated below. 
         [0033]    For instantaneous signals A, B and C, two variables V 0  and U 0  are defined as follows: 
         [0000]        V   0 =( A+B+C )/3  (1) 
         [0000]        U   0 =√{square root over ((( A−V   0 ) 2 +( B−V   0 ) 2 +( C−V   0 ) 2 )*2/3)}{square root over ((( A−V   0 ) 2 +( B−V   0 ) 2 +( C−V   0 ) 2 )*2/3)}{square root over ((( A−V   0 ) 2 +( B−V   0 ) 2 +( C−V   0 ) 2 )*2/3)}  (2) 
         [0034]    To exploit the relatively linear region for the three phases signals, the 2π period is divided into  12  regions according to the relative amplitudes among the three-phase signals A, B and C. Therefore, the relatively linear region for the three phase signals can be used, as shown in  FIGS. 6A and 6B . The equation for determining angle θ for each region is shown below.
       IF C&gt;A&gt;0,       
 
         [0000]      θ= a  sin(( A−V   0 )/ U   0 )  (region 1)       ELSEIF A&gt;C&gt;0,         
         [0000]      θ=π/3 −a  sin(( C−V   0 )/ U   0 )  (region 2)       ELSEIF B&lt;C&lt;0,         
         [0000]      θ=π/3 +a  sin(( V   0   −C )/ U   0 )  (region 3)       ELSEIF C&lt;B&lt;0,         
         [0000]      θ=2π/3 −a  sin(( V   0   −B )/ U   0 )  (region 4)       ELSEIF A&gt;B&gt;0,         
         [0000]      θ=2π/3 +a  sin(( B−V   0 )/ U   0 )  (region 5)       ELSEIF B&gt;A&gt;0,         
         [0000]      θ=− a  sin(( A−V   0 )/ U   0 )  (region 6)       ELSEIF C&lt;A&lt;0,         
         [0000]      θ=π+ a  sin(( V   0   −A )/ U   0 )  (region 7)       ELSEIF A&lt;C&lt;0,         
         [0000]      θ=4π/3 −a  sin(( V   0   −C )/ U   0 )  (region 8)       ELSEIF B&gt;C&gt;0,         
         [0000]      θ=4π/3 +a  sin(( C−V   0 )/ U   0 )  (region 9)       ELSEIF C&gt;B&gt;0,         
         [0000]      θ=5π/3 −a  sin(( B−V   0 )/ U   0 )  (region 10)       ELSEIF A&lt;B&lt;0,         
         [0000]      θ=5π/3 +a  sin(( V   0   −B )/ U   0 )  (region 11)       ELSEIF B&lt;A&lt;0,         
         [0000]      θ=2 π−a  sin(( V   0   −A )/ U   0 )  (region 12) 
         [0047]    In practial application, the inverse sine function (a sin) can be performed by lookup table. The instaneous sampling value of the three-phase signals A, B and C are used to calculate the average and the averaged offset for the three-phase signals A, B and C according to formulas (1) and (2). In prior art method, the amplitude change can be calculated by inverse tangent operation for sine and cosine signals. However, the offset for the sine and cosine signals cannot be calculated. In the present invention, the interpolation error is reduced even when the three-phase signals A, B and C have positive/negative offsets. 
         [0048]    The impact of harmonics can also be evaluated for the angle-calculation apparatus of three-phase optical encoder according to the present invention with similar example before: 
         [0000]    
       
         
           
             A 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 θ 
               
               + 
               
                 
                   1 
                   8 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 3 
                  
                 θ 
               
               + 
               
                 
                   1 
                   32 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 5 
                  
                 θ 
               
               + 
               
                 
                   1 
                   128 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 7 
                  
                 
                     
                 
                  
                 θ 
               
             
           
         
       
       
         
           
             B 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 
                   sin 
                    
                   
                     ( 
                     
                       θ 
                       - 
                       
                         
                           2 
                            
                           π 
                         
                         3 
                       
                     
                     ) 
                   
                 
               
               + 
               
                 
                   1 
                   8 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 3 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         2 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   32 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 5 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         2 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   128 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 7 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         2 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
             
           
         
       
       
         
           
             C 
             = 
             
               
                 
                   U 
                   0 
                 
                  
                 
                   sin 
                    
                   
                     ( 
                     
                       θ 
                       - 
                       
                         
                           4 
                            
                           π 
                         
                         3 
                       
                     
                     ) 
                   
                 
               
               + 
               
                 
                   1 
                   8 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 3 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         4 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   32 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 5 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         4 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
               + 
               
                 
                   1 
                   128 
                 
                  
                 sin 
                  
                 
                     
                 
                  
                 7 
                  
                 
                   ( 
                   
                     θ 
                     - 
                     
                       
                         4 
                          
                         π 
                       
                       3 
                     
                   
                   ) 
                 
               
             
           
         
       
     
         [0049]    The method of the present invention has periodic error of only ±0.6% due to harmonics, which has lower than harmonics error in prior art method. 
         [0050]    The photo diode can generate 2500 sinusoidal signals (A, B and C signals) with 120 degree phase difference for a glass plate of 2500 marks per revolution. The 2500 sinusoidal signals are processed by hysteresis comparator and signal counter (hexagonal frequency) to produce 2500*6 pulses per revolution. The angle can be determined by lookup table. The synthetic resolution is 2700000 ppr when the table for θ=sin −1  A has 90 segments in the angle range 0˜ π/6 . 
         [0051]      FIG. 4  shows the block diagram for the angle-calculation apparatus  20  for three-phase optical encoder  16  according to the present invention. The angle-calculation apparatus  20  receives the three-phase signals A, B and C from the optical encoder  12  and obtains a rotation angle signal. The angle-calculation apparatus  20  comprises an analog-to-digital converter (ADC)  22  to convert the three analog angle signals A, B and C (namely, sin (x), sin (x−2p/3), sin(x−4p/3)) into three digital signals SIN X, SIN Y and SIN Z. The angle-calculation apparatus  20  further comprises a phase digitizer  24  and a digital counter  26  to obtain a count value signal N based on the three analog angle signals A, B and C (namely, sin (x), sin (x−2p/3), sin(x−4p/3)). The three digital signals SIN X, SIN Y and SIN Z and the count value signal N are processed by a digital signal processor (DSP)  28  to obtain a rotation angle for the motor rotor. 
         [0052]    The above-mentioned count value signal N can be generated by following way. 
         [0053]    The three-phase signals A, B and C have 120 degree phase difference and the phase digitizer  24  processes the three-phase signals A, B and C to obtain pulse signals (digital phase signals) Ca, Cb and Cc in forward direction and reverse direction, as shown in  FIGS. 9A and 9B . The digital counter can be implemented by a state machine as shown in  FIGS. 10A and 10B . There are six different combinations for the pulse signals Ca, Cb and Cc. The six different combinations are used as binary coding and the counting for the three-phase signals can be determined with reference to the current state of the state machine. 
         [0054]    With reference to  FIG. 10A , the status coding of the state machine is as below: 
         [0055]    When Ca is of high level, Cb is of low level and Cc is of low level, the coding status is corresponding to State  1 . 
         [0056]    When Ca is of low level, Cb is of high level and Cc is of low level, the coding status is corresponding to State  2 . 
         [0057]    When Ca is of high level, Cb is of high level and Cc is of low level, the coding status is corresponding to State  3 . 
         [0058]    When Ca is of low level, Cb is of low level and Cc is of high level, the coding status is corresponding to State  4 . 
         [0059]    When Ca is of high level, Cb is of low level and Cc is of high level, the coding status is corresponding to State  5 . 
         [0060]    When Ca is of low level, Cb is of high level and Cc is of high level, the coding status is corresponding to State  6 . 
         [0061]    With reference to  FIG. 10B , the state machine has following operation: 
         [0062]    The first example is that the current status of the state machine is State  5  (when Ca is of high level, Cb is of low level and Cc is of high level) and the encoder is moved in a forward direction. When the state machine detects that the input will change its state to State  1  (when Ca is of high level, Cb is of low level and Cc is of low level), the count value of the counter is added by one and the coding status of the state machine is changed to State  1  from State  5 . 
         [0063]    The second example is that the current status of the state machine is State  5  (when Ca is of high level, Cb is of low level and Cc is of high level) and the encoder is moved in a reverse direction. When the state machine detects that the input will change its state to State  4  (when Ca is of low level, Cb is of low level and Cc is of high level), the count value of the counter is decreased by one and the coding status of the state machine is changed to State  4  from State  5 . 
         [0064]    The third example is that the current status of the state machine is State  5  (when Ca is of high level, Cb is of low level and Cc is of high level). When the state machine detects that the input is neither State  1  nor State  4 , the state machine judges that an interference signal is present. Therefore, the count value of the counter is not changed and the state machine stays in original status. 
         [0065]      FIG. 11  shows another way for counting the three-phase signals A, B and C. The counted signals Ca, Cb and Cc are processed to generate a short-pulse train signal and a direction signal. When the encoder operates, a short pulse is generated to indicate that at least one of the counted signals Ca, Cb and Cc has changed. 
         [0066]    When the pulse signals Ca, Cb and Cc manifests a forward rotation, the direction signal is reset to low level. When the pulse signals Ca, Cb and Cc manifests a reverse rotation, the direction signal is set to high level. Therefore, the counter can generate count value with increasing value and decreasing value by the short-pulse train signal and the direction signals. 
         [0067]    The advantages of the present invention can be summarized as follows: 
         [0068]    1. The method has robustness for non-ideal sinusoidal wave. 
         [0069]    2. The method has better linearity for interpolation and lower interpolation error. 
         [0070]    3. The method can provide higher resolution. 
         [0071]    Although the present invention has been described with reference to the preferred embodiment thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have suggested in the foregoing description, and other will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.