Abstract:
An interpolation device for a scale arrangement receives sine wave and cosine wave signals indicative of a measuring data from the scale arrangement and calculates a DC offset value, an amplitude coefficient and an amount of a phase drift on the basis of the received signals. The interpolation device outputs a correct angle signal upon removing a DC offset, a gain level error, a gain unbalance and a phase drift from received signals. Therefore, the interpolation device realizes a mechanical structure of the scale arrangement to be simple.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to improvements in an interpolation device for a scale arrangement, and more particularly to an interpolation device for a scale arrangement which arrangement is used for detecting a rotational position of a motor, movement of a table in a machine tool and the like. 
     2. Description of the Prior Art 
     Various types of scale arrangements have been proposed and practically used in order to detect a position of a moving subject such as a rotational position of a motor or a movement of a table in a machine tool. A typical scale arrangement has a sensor such as a magnetic sensitive element which implements a readout of a scale in the form of electrical signals of a sine wave and a cosine wave, and obtains the moving direction and position by analyzing the detected signals. 
     However, it is difficult to make a scale arrangement so as to keep a distance and an angle between a scale T and a sensor S constant during the operation of the scale arrangement. For example, the sensor S generates a wave relative to the scale T as shown in FIG. 5, and the inclined angle of the sensor S relative to the scale T becomes different in the forward movement and the backward movement as shown in FIG. 6. Furthermore, Abbe&#39;s error occurs when the sensor S is not aligned parallel with the scale T in a non-contact type scale arrangement as shown in FIG. 7. Accordingly, a signal detected by the sensor S includes various errors. For example, a DC offset voltage O A , O B  is included in the signal as shown in FIG. 8; a deviation of a gain level is generated as shown in FIG. 9; a gain of the sine wave signal and the gain of the sine wave signal becomes different as shown in FIG. 10; and a phase drift between the sine wave signal and the cosine wave signal is generated. Although these errors are negligible in a scale arrangement which is not required to have a high discrimination, these errors can not be negligible when a scale arrangement is required to have a high discrimination such as 0.5 μm, 0.1 μm or 0.05 μm. Furthermore, such errors appear as a fatal error in a long-size scale arrangement requiring a high discrimination. Conventionally, the generation of such errors during movement of the sensor S has been prevented by the improvement of the mechanical structure. However, this mechanical improvement requires a fine machining degree in the structure, and therefore raises the production cost. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide an improved interpolation device for a scale arrangement which device automatically and electronically corrects the measuring errors. 
     An interpolation device according to the present invention is for a scale arrangement and comprises a first input means which receives an input sine wave signal from the scale arrangement and a second input means which receives an input cosine wave signal from the scale arrangement. A first output means has a first offset value calculating circuit which calculates an offset value of the input sine wave signal and a first amplitude coefficient calculating circuit which calculates an amplitude coefficient of the input sine wave signal. The first output means outputs an interpolated sine wave signal from which the offset value of the input sine wave has been removed and which has a first predetermined amplitude coefficient according to the values from the first offset value calculating circuit and the first amplitude coefficient calculating circuit. A second output means has a second offset value calculating circuit which calculates an offset value of the input cosine wave signal and a second amplitude coefficient calculating circuit which calculates an amplitude coefficient of the input cosine wave signal. The second output means outputs a cosine wave signal from which the offset value of the input cosine wave is removed and which has a second predetermined amplitude coefficient according to the values from the second offset value calculating circuit and the second amplitude coefficient calculating circuit. A correcting means corrects a phase drift between the sine wave signal from the first output means and the cosine wave signal from the second output means. The correcting means outputs a correct measured angle on the basis of the corrected sine and cosine wave signals in phase drift. A decision means decides an accomplishment of one period of measuring period on the basis of the correct measured angle signal of the correcting means and outputting a synchronizing signal to the first output means, the second output means and the correcting means. 
     With this arrangement, it becomes possible to remove the errors of the signal without improving a high machining accuracy of a mechanical structure. This provides an inexpensive and high-productive scale arrangement with high accuracy. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     In the drawings, like reference numerals designate like elements and like parts throughout all figures, in which: 
     FIG. 1 is a block diagram which shows a first embodiment of an interpolation device for a scale arrangement according to the present invention; 
     FIG. 2 is a block diagram of a preferred example of a decision circuit applied to the interpolation device of FIG. 1; 
     FIG. 3 is a block diagram which shows a second embodiment of the interpolation device for the scale arrangement according to the present invention; 
     FIG. 4 is a block diagram which shows a third embodiment of the interpolation device for the scale arrangement according to the present invention; 
     FIG. 5 is a view showing a reading characteristic of the scale arrangement; 
     FIG. 6 is a view showing an installing condition of sensors in the scale arrangement; 
     FIG. 7 is a view which shows another reading characteristic of the scale arrangement; 
     FIG. 8 is a graph showing an offset of a signal characteristic of the scale arrangement; 
     FIG. 9 is a graph showing a deviation of a gain level of the signal characteristic of the scale arrangement; 
     FIG. 10 is a graph which shows an unbalance of gain of the signal characteristic of the scale arrangement; 
     FIG. 11 is a graph which shows a phase drift of the signal inputted in the interpolation device according to the present invention; 
     FIG. 12 is a graph which shows a relationship between the detected signal and a digital signal thereof; and 
     FIG. 13 is a graph which shows a relationship between an amplitude and angle of sine and cosine waves. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring to FIG. 1, there is shown a first embodiment of an interpolation device for a scale arrangement according to the present invention. 
     As shown in FIG. 1, sensors 1 and 2 in the interpolation device obtain inputs B and A, respectively which inputs are represented by the following equations (1) and (2): 
     
         A=K.sub.A sin(θ+X)+O.sub.A                           (1) 
    
     
         B=K.sub.B cosθ+O.sub.B                               (2) 
    
     where K A  is an amplitude coefficient of the input A; K B  is an amplitude coefficient of the input B; O A  is an offset value of the input A; O B  is an offset value of the input B; and X is a phase shift. 
     The input B is transmitted into a digital signal through an A/D converter within the sensor 1, and the converted signal is applied to one of two input terminals of the adder 3. The other input terminal of the adder 3 receives an average value (offset value) of an amplitude signal in a previous operation from an average circuit 5. As a result of the adding in the adder 3, a digital signal B 1  from which an offset has been removed is outputted from the adder 3. Since the offset value is obtained as an average value between a maximum amplitude B max  and a minimum amplitude B min  as shown in FIG. 8, the average value O B  in the previous operation is represented by the following equation (3): 
     
         O.sub.B =(B.sub.max +B.sub.min)/2                          (3) 
    
     Since the digital signal B 1  is obtained by subtracting the offset value O B  from the input B, the digital signal B 1  is represented by the following equation (4): 
     
         B1=B-O.sub.B =K.sub.B cos θ                          (4) 
    
     The obtained digital signal B 1  is applied to peak hold circuits 7 and 9, and a divider 13. The peak hold circuit 7 holds the maximum value B max  of the input B according to a signal from a decision circuit 15. The peak hold circuit 9 holds a minimum value B min  of the input B according to the signal from the decision circuit 15. The outputs from the peak hold circuits 7 and 9 are applied to the averaging circuit 5. In the averaging circuit 5, an average value is calculated as shown in the equation (3). The obtained average value is changed in polarization and then kept on. The output from the averaging circuit 5 is applied to an adder 11 wherein the output from the averaging circuit 5 is added with the maximum value B max  from the peak hold circuit 7. The value K B  obtained by the adder 11 represents an amplitude coefficient of the signal B and is derived by the following equation (5): ##EQU1## The value B 1  represented by the equation (4) and the value K B  represented by the equation (5) are inputted into the divider 13, and a value B2 is obtained by dividing the equation (4) by the equation (5) and therefore represented as a normalized cosine wave by the following equation (6): ##EQU2## 
     Similarly, the input signal A is processed in the device shown in FIG. 1. That is, the input signal A is converted into a digital signal by an A/D converter of the sensor 2. Next, an offset value O A  is subtracted from the converted digital signal through an adder 4. Further, a value A 1  is normalized by the divider 14. Such translations are represented by the following equations (7), (8), (9) and (10): ##EQU3## 
     A latch circuit 17 latches data sin(θ+X) by every input of the maximum value B max  into the peak hold circuit 7. Since the signal B takes a maximum value when θ=2 nπ (n is positive integer), the latch circuit 17 latches a value A3 represented by the following equation (11): 
     
         A3=sin(θ+X)=sin(2 nπ+X)=sin X                     (11) 
    
     An inverse function X=sin -1  A3 of the equation (10) is obtained by an inverse function generator 20. The obtained inverse function X is applied to adders 19 and 21. On the other hand, an inverse function generator 16 outputs a value θ=cos -1  B2. Then, the value θ=cos -1  B2 is added to the value X in the adder 19. More particularly, when θ takes a value positioned in the first or third quadrant, the output value from the adder 19 becomes θ+X. When in the second or fourth quadrant, the output value from the adder 19 becomes θ-X. A function generator 22 generates a cosine wave signal cos(θ±X) according to the output θ±X from the adder 19. 
     An inverse function generator 18 generates a value θ+X=sin -1  A2 and applies to an adder 21. In the adder 21 the value θ+X=sin -1  A2 from the inverse function generator 18 is added to the signal X from the inverse function generator 20. More particularly, when θ takes a value positioned in the first or third quadrant, the output value from the adder 21 becomes (θ+X)-X. When in the second or fourth quadrant, the output value from the adder 21 becomes (θ+X)+X. The polarity of the value X is determined according to the plus or minus character of cos(θ+X). 
     The adder 21 outputs θ=θ+X-X, and the function generator 23 generates a correct sine wave signal sinθ by removing the phase drift from the input signal. The inverse function generator 24 calculates tanθ according to sinθ from the function generator 23 and cosθ from the divider 13, and outputs θ which is an inverse function of tanθ. With these operations in the interpolation device, a correct measured output θ is obtained upon removing the phase drift during a detection by the sensor. 
     The manner of operation of the decision arrangement 15 will be discussed hereinafter in detail with reference to FIG. 2. 
     Since a scale readout on the scale S is obtained as a periodical function, the explanation of this embodiment is proceeded upon assuming that one period λ of the periodical function is 200 (λ=200). As shown in FIG. 12, one period of the periodical function is corresponding digital signals 0 to 199. Accordingly, when the sensor is moved in the forward direction (rightward in FIG. 12), the digital signal suddenly decreases from 199 to 0. When the sensor is moved in the backward direction (leftward in FIG. 12), the digital signal suddenly increases from 0 to 199. Accordingly, it is necessary to detect the moving direction of the sensor first. The latch circuit 67 keeps a previously measured signal and outputs it to the comparators 69 and 70. The previously measured signal is compared with predetermined values 20 and 180 in the comparators 69 and 70, respectively. The comparator 69 outputs a logical output 1 (high level) when the previous digital signal is larger than 180. The comparator 68 outputs a logical output 1  (low level) when the present digital signal is smaller than 20. Both outputs supply a logical input 1 to one of two input terminals of an AND circuit 81 through an AND circuit 75 and an OR circuit 83. This input is applied to a clock CK of a latch circuit 79, and the latch circuit 79 latches the digital signal. At this time, a D flip-flop 77 is set according to the output of the comparator 69 such that the data in the forward direction is valid. 
     Similarly, the comparator 70 outputs an output 1 when the previous digital signal is smaller than 20. When the digital signal is larger than 180, the comparator 71 outputs a logical output 1. Both outputs supply a logical input 1 to one of two input terminals of an AND circuit 82 through an AND circuit 73 and an OR circuit 84. This input is applied to a clock CK of a latch circuit 80 such that the latch circuit 80 latches the digital signal. At this time, a D flip-flop 78 is set according to the output of the comparator 70 such that the data in the backward direction is valid. Since the output of a comparator 89 is 0 in both above-mentioned case, a clock input of a D flip-flop circuit is set at 0 (low level). 
     For example, when the sensor is moving in the forward direction, an input A of the comparator 89 is increasing and at last a condition A≧B is satisfied. In this situation, the clock input of the D flip-flop circuit 91 becomes 1 (high level), and the D flip-flop circuit 91 is set. Next, a D flip-flop circuit 92 is set, and a D flip-flop circuit 93 is set according to the output of the D flip-flop circuit 92. Accordingly, the D flip-flop circuit 93 outputs a decision output indicative that the sensor has moved one period (has passed a portion between digital signals 199 and 0). When the D flip-flop circuit 92 is turned on, the D flip-flop 77 is turned on. When the D flip-flop 92 is turned off by a next clock input, the D flip-flop 78 is turned on. Accordingly, the data in both directions is treated to be valid, and the operation is repeated to a next period. 
     With this arrangement of the interpolation device according to the present invention, since errors generated by the mechanical play during the moving operation of the sensor is electrically interpolated, the mechanical structure of the scale arrangement formed is simple. 
     FIG. 3 shows a second embodiment of the interpolation device of the scale arrangement according to the present invention. In the drawing, same numerals designate same parts and elements as that in FIG. 1, and the explanation thereof are facilitated herein. 
     A divider 25 receives an output K B  of an adder 11 and an output K A  of an adder 12 and outputs an output K B  /K A . A multiplier 26 receives a signal represented by the equation (8) from the adder 4 and a signal K B  /K A  from the divider 25 and outputs an output A2 which is represented by the following equation (12): ##EQU4## By this calculation, an amplitude of a sine wave signal becomes the same as that of a cosine wave signal. By adding the output of the adder 3 to the output of the multiplier 26 at an adder 28, a signal A3 represented by the following equation (13) is obtained. 
     
         A3=K.sub.B {sin(θ+X)-cos θ}                    (13) 
    
     The equation (13) is modified as represented by the following equation (14): ##EQU5## Since K A  &#39; in the equation (15) indicates an amplitude, the peak hold circuit 30 holds the value represented by the equation (15). 
     Similarly, by adding the output of the adder 3 to the output of the multiplier 26 at an adder 27, a signal A3 represented by the following equation (13) is obtained. 
     
         B3=K.sub.B {sin(θ+X)+cos θ}                    (16) 
    
     The equation (16) is modified as represented by the following equation (17): ##EQU6## 
     Since K B  &#39; in the equation (18) indicates an amplitude, the peak hold circuit 29 holds the value represented by the equation (18). By dividing the value held in the peak hold circuit 30 by the value held in the peak hold circuit 29 at the divider 31, a value represented by the following equation (19) is obtained. ##EQU7## The obtained value outputted from the divider 31 is modified by an inverse function generator 33 as shown by the following equation (20): ##EQU8## The equation (15) is modified into the following equation (21): ##EQU9## Similarly, the equation (18) is modified into the following equation (22): ##EQU10## Accordingly, by dividing the output of the peak hold circuit 29 by the output of the peak hold circuit 30, a value represented by the following equation (23) is obtained. ##EQU11## Since the output of the adder 28 has been applied by the equation (14), the equation (14) is rewritten by using the equation (21) as follows: ##EQU12## Therefore, by multiplying the output of the adder 28 represented by the equation (24) and the output of the divider 32 represented by the equation (23) at the multiplier 35, a value represented by the following equation (25) is obtained: ##EQU13## By deforming the equation (17) as implemented in the equation (22), the output of the adder 27 is represented by the following equation (26): ##EQU14## Since the amplitude of the equation (26) is the same as that of the equation (25), the following equation (27) is obtained by the division of the equation (26) by the equation (25). ##EQU15## An inverse function generator 24 calculates an inverse function of the equation (27) and outputs a valued represented by the following equation (28): ##EQU16## An inverse function generator 33 calculated an inverse function of the equation (19) and outputs a value represented by the following equation (29): ##EQU17## 
     Accordingly, the adder 36 calculates the sum of the output of the inverse function generator 24 represented by the equation (28) and the output of the inverse function generator 33 represented by the equation (29) and outputs a signal as follows: ##EQU18## 
     The signal is correct without phase lag X and used as a measured output. The signal is applied to a decision box 15 as mentioned above and used for generating a synchronizing signal. Accordingly, errors generated by the mechanical lag during the moving operation of the sensor is interpolated electrically, it is possible that the mechanical structure of the scale arrangement formed is simple. 
     Referring to FIG. 4, there is shown a third embodiment of the interpolation device of the scale arrangement according to the present invention. In the drawing, same numerals designate same parts and elements as that in FIG. 3, and the explanation thereof are facilitated herein. 
     A divider 32 output a signal represented by the equation (23) ##EQU19## An inverse function generator 37 outputs an inverse function of the equation (23) as follows: ##EQU20## In an adder 34, ##EQU21## is added to the value represented by the equation (30). Then, the multiplier 38 outputs X which is twice the output of the adder 34. Function generators 39 and 40 generate signals sinX and cosX, respectively, by using the output of the multiplier 38. The plus-minus signal inversion of the signal sinX is transformed in the signal inverse circuit 41. Then, the plus-minus signal inverted value is added to 1 in an adder 43, and a signal represented by the following equation (31) is ouputted from the adder 43. 
     
         C=1-sinX                                                   (31) 
    
     In a multiplier 44, the output of the adder 3 represented by the equation (4) and the signal represented by the equation (31) are multiplied, and a signal represented by the following equation (32) is outputted: 
     
         B5=K.sub.B cosθ.(1-sinX)                             (32) 
    
     The signal B5 represented by the equation (32) is added to the signal obtained by implementing the signal inversion 49 of the output of the adder 3 in an adder 45, and a signal represented by the following equation (33) is outputted: ##EQU22## The signal B6 is added to the output of the multiplier 26 represented by the equation (12) in an adder 46, and a signal represented by the following equation (34) is outputted from the adder 46. ##EQU23## Next, the signal represented by the equation (34) is multiplied with an inverse number of cosX from the divider 42 in a multiplier 47, and a signal represented by the following equation (35) is outputted. ##EQU24## 
     On the basis of the signal represented by the equation (35) and the output of the adder 3, an inverse function generator 24 generates a signal represented by the following equation (36) and then outputs a signal represented by the following equation (37): ##EQU25## 
     The obtained signal θ is a correct value without a phase drift and applied as a result of a measured signal. With this arrangement of the interpolation device according to the present invention, since errors generated by the mechanical lag during the moving operation of the sensor is interpolated electrically, it is possible that the mechanical structure of the scale arrangement is simply formed simple.