METHOD AND APPARATUS FOR PROCESSING ANGULAR DATA FROM ENCODER

Abstract: An apparatus for processing angular data obtained from an encoder, comprising an arithmetic circuit (4) for processing angular data by using encoder signals of different phases as triangular wave signals, a storage (5) for storing corrective data for correcting an angular error between the encoder signal and the triangular wave signal by using the data from the arithmetic circuit (4) as the address, a circuit (6) for adding the data from the arithmetic circuit (4) to the corrective data from the storage (5), and a converter (7) for effecting angle conversion depending on the quadrant of the encoder signal.

Description: The present invention relates to a method and an apparatus for computing angle data for encoders, and a technique for interpolating detection signals in a detecting device for detecting the positions of a table and motor of a machine tool with an NC apparatus or the like. A rotary pulse encoder, which is mounted on a motor shaft or the like, and a linear pulse encoder, which is attached to a worktable or the like, are known as detecting devices for detecting the positions of a table and motor of a machine tool with an NC apparatus, whereby the amount of movement and moving speed of a moving body are detected. Usually, in these pulse encoders, a phase-A signal, a sine-wave signal (Ksin), and a phase-B signal, a sine-wave signal (Ksin ± π/2) with a phase difference of 90° from the phase-A signal, are generated as the moving body moves, and an interpolation signal is formed from these two sine-wave signals to obtain angle data, whereby the resolutions of positions and speeds are improved. One such interpolation technique is known, in which sine-wave signals and cosine-wave signals from a signal source are supplied to a converter circuit that is composed of a plurality of resistors and a comparator array. As another interpolation means, there is a known a method in which angle data  are obtained by inputting values a and b, obtained by A/D conversion of phase-A and phase-B sine-wave signals, to arithmetic means 4, as shown in FIG. 14, for computing tan -1 (a/b). The arithmetic operation of the inverse transform of this tangent is carried out by Taylor development calculation. Moreover, another proposed interpolation technique is one comprising A/D converters and storage means such as a ROM. FIG. 15 is a block diagram for illustrating a conventional interpolating device using a storage element. In the interpolating device shown in FIG. 15, values a and b obtained by A/D conversion of phase-A and phase-B sine-wave signals are inputted to storage means 8 such as a ROM. The storage means 8 is stored with interpolated angle data, and outputs the angle data  with digital signals from A/D converters 1 and 2 used as addresses. FIG. 16 is a diagram showing relations between addresses and storage contents of the storage means in the conventional interpolating device provided with the A/D converters and the_storage means. In FIG. 16, the axis of abscissa represents X-direction addresses, while the axis of ordinate represents Y-direction addresses. Each address corresponds to the values of sine and cosine waves converted into digital signals by the A/D converters. For example, when each address is represented by 8 bits, the value of each axis is represented by 256 addresses from 0 to 255. The storage contents are stored in positions corresponding to the individual lattices composed of the X- and Y- direction addresses. In FIG. 16, the portions loaded with the storage contents are hatched. A circle shown in the drawing indicates position data represented by signals A and B, and the position data are fetched by appreciating the storage contents on a circle defined by addresses corresponding to the input signals A and B. However, in the case where a converter circuit composed of resistors and a comparator array is used in the conventional interpolation technique, for example, the resistors and the comparator array pose problems such as a high cost and a large occupation space. Furthermore, in where tan -1 (a/b) is to be computed, there is a problem that the Taylor development calculation requires a complicated arithmetic circuit. In the case of an interpolating device provided with the A/D converters and the storage means, its storage contents must be previously loaded corresponding to all the addresses, so that large-capacity storage means is necessary. Typical prior-art encoder angle data computation methods and apparatuses can be found in EP-A-0408799, and in pages 183, 184 of IEEE Conference Record of Instrumentation and Measurement Technology Conference, held May 14-16, 1991. The latter document includes a description of how distorted quadrature signals can be compensated, using deviation quantities averaged over repeated readings. The object of the present invention is to provide an encoder angle data computation method and computation apparatus, capable of solving the aforementioned conventional problems, and capable of interpolating angle data by means of a simple arithmetic circuit and small-capacity storage means. According to the present invention, a first angle is computed from two sine-wave encoder signal outputs in different phases by using an equation for obtaining an angle from two sine-wave signal outputs in different phases, and a second angle is computed by using an equation for obtaining an angle from two triangular-wave signal outputs in different phases, whereby an angle error, the difference between the second angle and the first angle corresponding thereto, is previously stored in angle error data storage means, correspondingly to the second angle. During operation, two encoder signal outputs in different phases are obtained, and the second angle is obtained from these output data by means of angle computing means. Then, the first angle is obtained by adding the angle error, corresponding to the obtained second angle, to the second angle by means of adder-subtracter means. Preferably, the two encoder signal outputs are obtained in the form of absolute values, and the second angle in the first quadrant is calculated from these output data, while the quadrant, whether first, second, third, or fourth, in which the first or second angle is located is discriminated by recognizing the respective signs, positive or negative, of the two encoder signal outputs, and the calculated second angle in the first quadrant is converted into an angle in the discriminated quadrant. Further preferably, the angle error stored corresponding to the second angle is restricted so that the second angle ranges from 0 to π/4, and the angle error corresponding to a range of π/4 to π/2 for the second angle is obtained based on the angle error data within the range of 0 to π/4 for the stored second angle. As described above, two encoder signals A and B in different phases can be interpolated (divided) by first carrying out a simple calculation, A/(A + B), without computing  = tan -1 (A + B) each time, and then fetching the angle error data previously stored in the storage element and adding it as correction data to the result of calculation. The quantity of data to be stored in the storage element can thereby be made smaller. Brief Description of the Drawings FIG. 1 is a block diagram for-illustrating encoder angle data computation according to the present invention; FIG. 2A is a diagram for illustrating the delivery of two sine-wave encoder signals in different phases; FIG. 2B is a diagram for illustrating the delivery of two triangular-wave encoder signals in different phases; FIG. 2C is a diagram for illustrating angle errors according to the present invention; FIG. 3 is a signal diagram showing relations between sine-wave signals, triangular-wave signals, and correction data; FIG. 4 is a table showing relations between addresses of correction data storage means and the correction data; FIG. 5 is a diagram for illustrating the relations between the addresses of the correction data storage means and the correction data; FIG. 6 is a diagram for illustrating quadrant conversion; FIG. 7 is a diagram showing relations between quadrants and angle data; FIG. 8 is a diagram for illustrating the reduction of the capacity of the correction data; FIGS. 9A to 9C are diagrams for illustrating relations between encoder signals and triangular-wave signals; FIG. 10 is a diagram for illustrating the adjustment of the correction data; FIGS. 11 to 13 show showing examples of circuit configurations for adjusting the correction data; FIG. 14 is a diagram for illustrating the computation of angle data according to conventional arithmetic operation; FIG. 15 is a block diagram for illustrating a conventional interpolating device using a storage element; and FIG. 16 is a diagram showing relations between addresses and storage contents of the storage means in a conventional interpolating device provided with A/D converters and the storage means. First, the principle of angle data computation according to the present invention will be described. A phase-A signal, that is, an output signal based on a = Ksin, is obtained from a first encoder. A phase-B signal, that is, an output signal based on b = Ksin( + π /2) = Kcos, is obtained from a second encoder. As shown in FIG. 2A, the relations between an angle  and the respective outputs a and b of the phase-A and phase-B signals can be represented by a circle with a radius K around a point of intersection between two rectangular coordinate axes. An ordinate-axis component of a line segment OP connecting the center O and one point P on the circle represents the output a of the phase-A signal, 'while an abscissa-axis component represents the output b of the phase-B signal. Further, the angle  is an angle of the line segment OP as measured in the counterclockwise direction from the abscissa-axis portion on the right of the origin 0. The quadrant, whether first, second, third, or fourth, in which the point P is located is settled depending on the combination of the respective signs, positive or negative, of the outputs a and b. In general, the angle  (0 ≦  < 2π) is obtained by judgement as to whether the outputs a and b are positive or negative and calculation of  = tan -1 ( a / b ). According to the present invention, however, the rotational angle  is not obtained directly from these outputs a and b according to the above equation (1). First, (a) it is determined whether a and b are positive or negative (or whether present angle  is in first, second, third, or fourth quadrant), and (b) calculation is carried out for  d = { a /( a + b )} · (π/2). where 0 ≦  d < π /2. The above equation (2) is an equation for determining angle  d from the encoder output values a and b when the outputs a and b are triangular-wave signals, individually. In most cases, therefore, the angle  d obtained according to the above equation (2) is not equal to the angle  (0 ≦  < π/2) obtained according to the foregoing equation (1). Hence, (c) a correction value equivalent to Δ  d =  -  d is given in advance in correlation with [ d, Δ  d], and this Δ  d is added to the angle  d obtained according to equation (b) ( =  d + Δ  d). However, (d) the corrected angle  is to satisfy 0 ≦  d < π/2, so that the true angle  (0 ≦  < π /2) is obtained by adding quadrant information defined in (a) to the corrected angle. The angle determined by the triangular-wave signals a and b (a + b = R) can be illustrated by a line segment (square) that connects (R, O), (O, R), (-R, O), and (O, -R) on two rectangular coordinate axes, as shown in FIG. 2B. An ordinate-axis component of a line segment OQ connecting an intersection point O of the two axes and a point Q on that line segment represents a, while an abscissa-axis component represents b. Also, the product of the ordinate-axis component a of the line segment OQ and (π/2)/R is the angle  d (0 ≦  d < π /2) to the axis of abscissa. An embodiment of the present invention will be described on the premise mentioned above. FIG. 1 is a block diagram for illustrating the encoder angle data computation according to the present invention. Referring to FIG. 1, phase-A and phase-B sine-wave signals differing in phase by π /2 are delivered from two encoders to A/D converter means 1 and A/D converter means 2, respectively. The A/D converter means 1 and 2 convert the inputted encoder signals into digital signals a and b, and apply them to quadrant discriminating means 3, individually. The quadrant discriminating means 3 discriminates one of the first to fourth quadrants to which the encoder signals belong depending on positive or negative of the inputted digital signals a and b. The digital signals a and b are further applied to arithmetic means 4, and arithmetic data signals  d, which are assumed to be triangular-wave signals, are computed according to the aforementioned equation (2), that is,  d = {| a | /(|a| + | b | )} · (π/2) is calculated. Correction data storage means 5 reads out correction data Δ  d (more specifically, Δ  d1, Δ  d2, Δ  d3, Δ  d4, ···) stored with addresses, which are the arithmetic data  d (more specifically,  d1,  d2,  d3,  d4, ···) computed by the arithmetic means 4, and delivers them to adder-subtracter means 6. The adder-subtracter means 6 adds up arithmetic data  dj and correction data Δ  dj. ( dj + ▵  dj), thereby correcting errors resulting from assuming the signals to be the triangular-wave signals. Since this ( dj + ▵  dj) is an angle formed when the encoder signals are in the first quadrant, it is converted into an angle corresponding to the quadrant to which the encoder signals belong, in response to a quadrant signal from quadrant discriminating means 3. Described in the following is angle errors between sine-wave signals and triangular-wave signals and the correction data Δ  d for correcting the angle errors. With respect to the first quadrant (a ≧ 0, b ≧ 0), the angle signal  obtained on the bases of the phase-A and phase-B sine-wave signals delivered from the first and second encoders, according to the aforementioned equation (1), is given by  = tan -1 (a/b). On the other hand, the angle  d calculated with the phase-A and phase-B signals regarded as triangular-wave signal outputs is d = {a/(a + b)} · (π/2), so that the angle errors Δ  d are given by ▵ d =  - d = tan -1 (a/b) - {a/(a + b)} · (π /2). where a → A, b → B. then  d = A A + B x π 2 (see Equation (2)) ( A + B ). d = π 2 . A , B . d = π 2 A - A . d , = A ( π 2 - d ) ∴ A B = d π 2 - d on the other hand,  = tan -1 A B (by Equation (1)) therefore ▵ d = - d (see Equation (3)) = tan -1 ( d π 2 - d )- d According to Equation (3)', ▵d is determined by d. With respect to this ▵d: ▵d = 0 when  = 0, and thus the value of the phase-A signal is represented by a = Ksin = 0; ▵d = π/4 - π/4 = 0 when  = π/4, and thus the value of the phase-A signal, a = Ksin, and the value of the phase-B signal, b = Kcos, are equal, that is, when a = b; Δ  d = π /2 - π /2 = 0 when the values of the phase-A and phase-B signals are a = Ksin = K and b = Kcos = 0, respectively; when the angle changes from  (0 <  < π/4) into [π /2 -  ], the value of the phase-A signal changes from a into b, while the value of the phase-B signal changes from b into a, so that the angle errors Δ  d in this case are written as follows by replacing a with b and b with a in the aforementioned equation (3). Δd = tan -1 (b/a) - {b/(a+b)} · (π/2) = π /2 - tan -1 (a/b) - {1 - [a/(a+b)} · (π /2) = -tan -1 (a/b) + {a/(a+b)} · (π/2). The above equation (4) indicates that the angle errors when the angle is  (0 <  < π/4) and the angle errors when the angle is [π/2 - ] have equal absolute values and opposite signs. FIG. 2C is a diagram illustrating these facts. As is obvious from FIG. 2C, the angle errors Δ  d when the angle obtained according to the aforementioned equation (2) is  d (0 ≦  d ≦ π /4) and the angle errors Δ  d when the angle is [π /2 -  d] have opposite signs and equal absolute values. Thus, the angle errors Δ  d corresponding to angles within the range of π /4 ≦  d ≦ π /2 can be detected by previously obtaining the correlations between the angles  d and the angle errors ▵  d within the range 0 ≦  d ≦ π /4 by calculation or the like. That is, all the angle errors Δ  d where 0 ≦  d ≦ π /2 (first quadrant) can be determined. These values can be obtained in like manner for other quadrants. FIG. 3 is a signal diagram showing relations among the sine-wave signals, triangular-wave signals, and correction data. In FIG. 3, (a), (b) and (c) illustrate the sine-wave signals, triangular-wave signals, and angle errors Δ  d, respectively. The angle errors Δ  d are signals with a cycle of π /2, and are symmetrical with respect to a center point corresponding to π /4. Described in following is the correction data storage means 5 for storing the angle errors Δ  d as correction data. In the description to follow, the angle errors Δ  d will be-referred to as "correction data". The correction data storage means 5 can be formed of a storage element such as a ROM, and stores the correction data Δ  d with the arithmetic data  d computed by the arithmetic means 4, which serves as addresses. FIG. 4 shows relations between addresses  a of the correction data storage means 5 and the correction data Δ  d. The addresses  a are loaded individually with the correction data Δ  d. FIG. 5 shows relations between the addresses  a and the correction data Δ  d. In FIG. 5, (a) represents relations of the addresses  a to the arithmetic data  d, while (b) represents relations of the correction data Δ  d to the addresses  a. As shown in FIGS. 4 and 5, the addresses  a are set as discrete values of  a1,  a2, · · · ,  ai,  aj,  ak, · · ·, for example. On the other hand, the arithmetic data  d may take some other values than aforesaid discrete values, according to the aforementioned equation (2). Thus, one of the addresses  a is made to correspond to the arithmetic data  d in a certain range, as shown in FIG. 5(a), the correction data Δ  d are made to correspond to the addresses  a in a one-to-one fashion, as shown in FIG. 5(b), and the correction data Δ  d are stored corresponding individually to the addresses, as shown in FIG. 4. The arithmetic data  d and the correction data Δ  d added together by the adder-subtracter means 6 are based on the first quadrant, so that when the encoder signals are in any other quadrant, data quadrant converter means 7 converts the quadrant in response to the quadrant signal obtained from the quadrant discriminating means 3. FIG. 6 is a diagram for illustrating this quadrant conversion. Thus, in the case of FIG. 6, when the angle in the first quadrant is , angular relations are established so that (π - 6 ), (π + ), and 2π -  are given in the second, third, and fourth quadrants, respectively. FIG. 7 shows relations between the quadrants and the angle data. Thus, in the case where the signals a and b from the encoder are given, for example, based on a > 0 and b > 0, respectively, the quadrant discriminating means 3 concludes that the encoder signals are in the first quadrant, and the data quadrant converter means 7 outputs the angle data . On the other hand, when the signals a and b are given based on a > 0 and b < 0, respectively, the quadrant discriminating means 3 concludes that the encoder signals are in the second quadrant, and the data quadrant converter means 7 outputs the angle data (π - ). In the case where the signals a and b are given based on a < 0 and b < 0, respectively, the quadrant discriminating means 3 concludes that the encoder signals are in the third quadrant, and the data quadrant converter means 7 outputs the angle data (π + ). On the other hand, when the signals a and b are given based on a < 0 and b > 0, respectively, the quadrant discriminating means 3- concludes that the encoder signals are in the fourth quadrant, and the data quadrant converter means 7 outputs the angle data (2π - ). According to the above embodiment, the correction data storage means 5 is stored with the correction data Δ  d corresponding to the addresses  a for angles from 0 to π /2 in the first quadrant, and the capacity required for storage can be reduced by utilizing the symmetric characteristic of the correction data ▵  d. Referring now to FIG. 8, the reduction of the storage capacity required for the correction data Δ  d will be described. The correction data ▵  d corresponding to the addresses for angles from 0 to π/4 are prepared, and (a) the correction data Δ  d having the address  a corresponding to the output  d of the arithmetic means 4 is fetched when  d is given as 0 ≦  d < π /4, and (b) the correction data Δ  d having the address  a corresponding to [π /2 -  d] is fetched, and its sign is inverted when  d is given as π /4 ≦  d < π /2. Referring to FIG. 8, the case (b) will be described. When the output  d is on a point E (at a distance s of positive movement from the point for π /4), the correction data ▵  d having an address indicated by a point F (at a distance s of negative movement from the point for π /4) is fetched, and its sign is inverted. The following is a description of another embodiment of correction data computation according to the present invention. In the case of the previously described embodiment, the correction data for correcting the errors is calculated by being compared with the triangular-wave signals on the premise that input signals are sine-wave signals. The correction data are unnecessary if the input signals are triangular-wave signals. Thus, in the case where the input signals are sine-wave signals, the errors between the sine-wave signals and the triangular-wave signals are corrected by means of the computed correction data, and angle signals are computed as the triangular-wave signals. In contrast with this, the following embodiment is a case in which the input signals are periodic signals whose magnitudes, like-those of the sine-wave signals or triangular-wave signals, change with the angle, although the waveforms are neither those of sine-wave signals nor those of triangular-wave signals. The interpolation of the angle data in these synchronizing signals with arbitrary waveforms will be discussed in the following. FIG. 9A shows the relation between a sine-wave signal A and a triangular-wave signal B. The correction data computed according to the foregoing embodiment are data for correcting the input waveform of the sine-wave signal B into the triangular-wave signal A, and the correction data are based on the premise that the input waveforms are those of triangular-wave signals. Signal waveforms delivered from actual encoders, compared with these triangular-wave signals, are not always those of sine-wave signals. For example, in an optical encoder that detects angles on the basis of changes in the quantity of transmitted light caused by relative movement of stationary and moving slits, the quantity of light applied to a light receiver varies due to leakage of light or the like, so that ideal triangular-wave signals cannot be obtained. For example, synchronizing signals, neither triangular-wave signals nor sine-wave signals, are obtained, as indicated by dashed line C in FIG. 9B or two-dot chain line D in FIG. 9C. A satisfactory correction effect cannot be obtained if the correction data based on input waveforms of sine-wave signals are applied to the signals with arbitrary waveforms. In this embodiment, therefore, the correction data obtained on the basis of the sine-wave signals are used; and correction data capable of producing a satisfactory correction effect are made available by adjusting those correction data. In this embodiment, as shown in FIG. 10, the correction data Δ  d obtained on the basis of a sine-wave signal is multiplied by 1/2 n , whereupon adjusted correction data Δ  d' are obtained. In FIG. 10, the correction data Δ  d is 5-bit binary data including data 0, 1, 2, 3 and 4. The data length of this correction data is not limited to five bits and may be adjusted to any number of bits. Hereinafter, this data will be represented in the display format of [4, 3, 2, 1, 0]. In general, binary data increases or decreases by 1/2 or a multiple of 2 at a time when its numerical value is changed by the unit of bit. For instance, if the correction data ▵  d [4, 3, 2, 1, 0] is shifted toward the LSB by one bit, correction data Δ  d' [3, 2, 1, 0], which is equivalent to the product of the correction data ▵  d and 1/2 (= 1/2 1 ), is obtained. If the correction data is shifted toward the LSB by two bits, correction data Δ  d' [2, 1, 0], which is equivalent to the product of the correction data Δ  d and 1/4 (= 1/2 2 ), is obtained. In contrast, if the correction data is shifted toward the MSB by one -bit, correction data Δ  d' [4, 3, 2, 1, 0, 0], which is equivalent to the product of the correction data Δ  d and 2 (= 1/2 -1 ), is obtained. The degree of data correction in calculating the angle data from the input waveforms can be adjusted by using the correction data Δ  d' adjusted by the aforesaid arithmetic operation. For example, in the case where the input waveforms are those of triangular-wave signals, the correction data Δ  d is directly used without adjusting the correction data  d. On the other hand, in the case where the input waveforms resemble those of triangular-wave signals, the extent of adjustment of the correction data ▵  d by means of the correction data Δ  d' [3, 2, 1, 0], based on the multiplication by 1/2 (= 1/2 1 ), can be reduced by arithmetic operation such that the correction data Δ  d is shifted toward the LSB by one bit. Further, in the case where the input waveforms are more similar to those of triangular-wave signals more and require a lower degree of correction, the extent of adjustment of the correction data Δ  d by means of the correction data Δ  d' [2, 1, 0], based on the multiplication by 1/4 (= 1/2 2 ), can further be reduced by arithmetic operation such that the correction data Δ  d is shifted toward the LSB by two bits. Further, in the case where the input waveforms are ones obtained by flattening the top and bottom peak portions of sine-wave signals and more similar to rectangular waves more, the extent of adjustment of the correction data Δ  d by means of the correction data Δ  d' [4, 3, 2, 1, 0, 0], based on the multiplication by 2 (= 1/2 -1 ), is increased by arithmetic operation such that the correction data Δ  d is shifted toward the MSB by one bit. The extent of adjustment of the correction data is not limited to 1/2 or multiples of 2, and these multiples may be combined to obtain various multiplication factors, such as 3/4 (= 1/2 + 1/4). The adjustment of the correction data can be made by moving the bits of the correction data represented by binary numbers, as mentioned before. These bits can be moved by either hardware or software means, and the extent of adjustment can be selected by using any available means in accordance with the input waveforms. For example, selection signals may be externally inputted in accordance with the input waveforms so that the movement amount of the bits can be changed, and the extent of adjustment can be selected. Referring now to FIGS. 11 and 13 showing examples of circuits, a case in which the extent of adjustment of the correction data is selected by means of hardware will be described. The circuit of FIG. 11 represents a case in which all the correction data are used without being adjusted (hereinafter referred to as total correction), the circuit of FIG. 12 represents a case in which the half the value of the correction data is to be used with the correction data multiplied by 1/2 for adjustment (hereinafter referred to as 1/2 correction), and the circuit of FIG. 13 represents a case in which 1/4 of the value of the correction data is to be used with the correction data multiplied by 1/4 for adjustment (hereinafter referred to as 1/4 correction). In FIGS. 11 to 13, a portion P1 is a circuit portion that forms signals for selecting the correction data, and P2 is a circuit portion that selects the correction data for adjustment in response to correction data selection signals. Signals S1 and S2 are applied to the correction data selection signal generating portion P1, whereby selection signals for adjusting four types of correction data can be formed. Further, the correction data  d obtained in the aforementioned manner are applied to the correction data selecting portion P2. Bit data for each bit of the correction data Δ  d is selected in accordance with a selection signal from the correction data selection signal forming portion P1, and is outputted as adjusted correction data Δ  d'. FIGS. 11 to 13 show cases in which 5-bit data [4, 3, 2, 1, 0] is inputted as the correction data Δ  d. FIG. 11 shows a case in which the total correction data is selected. When "1" is applied to the signals S1 and S2, the correction data selecting portion P2 selects data for each bit of the correction data Δ  d, and data for all bits, first bit to fifth bit, are delivered to the data terminals. Thereupon, all data of the correction data Δ  d can be selected. FIG. 12 shows a case for the 1/2 correction. If "1" and "0" are applied to the signals S1 and S2, respectively, the correction data selecting portion P2 selects data for the individual bits, except the LMS bit, of the correction data Δ  d, and delivers 4-bit data, first bit fourth bit, to the data terminals. By doing so, the half of the value of the correction data Δ  d can be selected. Further, FIG. 13 shows a case for the 1/4 correction. If "0" and "1" are applied to the signals S1 and S2, respectively, the correction data selecting portion P2 selects data for the individual bits, except the LMS bit and next bit, of the correction data Δ  d, and delivers 3-bit data, first bit to third bit, to the data terminals. By doing so, 1/4 of the value of the correction data Δ  d can be selected. As discussed in the foregoing, according to the present invention, there can be provided an encoder angle computation method and computation apparatus, in which the angle data can be interpolated by means of a simple arithmetic circuit and small-capacity storage means.

Claims: An angle data computation method for an encoder, comprising steps of: (a) computing a first angle () from two sine-wave encoder signal outputs (a, b) in different phases by using an equation for obtaining an angle from two sine-wave signal outputs in different phases, characterised by : computing a second angle (d) by using an equation for obtaining an angle from two triangular-wave signal outputs in different phases, thereby previously storing an angle error (▵d), the difference between the second angle (d), and said first angle () corresponding thereto, correspondingly to the second angle (d); (b) obtaining two encoder signal outputs in different phases and determining said second angle (d) based on said data; and (c) obtaining said first angle () by adding said angle error (Δd), corresponding to said obtained second angle (d), to the second angle (d). An angle data computation method for an encoder according to claim 1, wherein said two encoder signal outputs (a, b) are obtained in the form of absolute values, and the second angle (d) in the first quadrant is calculated from these data, while the quadrant, whether first, second,' third, or fourth, to which said first or second angle belongs, is discriminated by recognizing the respective signs, positive or negative, of the two encoder signal outputs (a, b), and said calculated second angle (d) in the first quadrant is converted into an angle in said discriminated quadrant. An angle data computation method for an encoder according to claim 1 or 2, wherein said angle error (▵d) of said step (a) stored corresponding to the second angle (d) is defined to be within a range from 0 to π/4, and the angle error corresponding to a range of π/4 to π/2 for the second angle (d) is obtained by using angle error data for the range of 0 to π/4 for the second angle (d). An angle data computation method for an encoder according to any one of the preceding claims, wherein said second angle (d) serves as an address when the angle error (▵d) is stored corresponding to the second angle in said step (a). An angle data computation method for an encoder according to any one of the preceding claims, wherein said angle error (▵d) to be added in said step (c) is not the angle error stored in said step (a) itself, but is an adjusted value thereof corresponding to a deviation from sine waves of the encoder signals (a, b). An angle data computation method for an encoder according to claim 5, wherein said adjusted value is made by increasing or decreasing said stored angle error (▵d) based on a multiplication factor of 2 n (n is a positive or negative integer) or a combination of 2 n . An angle data computation apparatus for an encoder, comprising: angle error data storage means (5) for storing an angle error (▵d), the difference between a first angle (), calculated from two sine-wave encoder signal outputs (a, b) in different phases by using an equation for obtaining an angle from two sine-wave signal outputs in different phases, and a second angle (d), calculated from said two sine-wave encoder signal outputs (a, b) by using an equation for obtaining an angle from two triangular-wave signal outputs in different phases, correspondingly to said second angle (d); angle computing means (4) for receiving the input of two encoder signals (a, b) in different phases and computing and outputting said second angle (d) based on said input signals by using an equation for obtaining an angle from two triangular-wave signal outputs in different phases; and adder means (6) for obtaining said first angle () by adding the angle error (▵d), corresponding to the second angle and stored in said angle error data storage means (5), to the second angle (d) computed by said angle computing means (4). An angle data computation apparatus for an encoder according to claim 7, wherein said angle computing means (4) computes the second angle (d) after converting said two encoder signal outputs (a, b) into absolute values, and which comprises quadrant discriminating means (3) for discriminating- the quadrant, whether first, second, third, or fourth, to which said first or second angle belongs, by recognizing the signs, positive or negative, of the encoder signal outputs (a, b), and data quadrant converter means (7) for converting the second angle (d) calculated by said angle computing means (4) into an angle in said discriminated quadrant. An angle data-computation apparatus for an encoder according to any one of claims 6 to 8, wherein the angle error data stored in said angle error data storage means (5) includes only those data obtained when the second angle (d) ranges from 0 to π /4, and which comprises a means for obtaining the angle error corresponding to the second angle based on the stored angle error data for the range of 0 to π/4 for the second angle when the second angle ranges from π/4 to π 2.

Inventors: TANIGUCHI MITSUYUKI, YAMAGUCHI HIROSHI, TANIGUCHI, MITSUYUKI, YAMAGUCHI, HIROSHI, TANIGUCHI, MITSUYUKI FANUC MANSHON HARIMOMI, YAMAGUCHI, HIROSHI ROOM 201
Applicants: FANUC LTD
Application year: 1996
Main classification: G01D5
IPC codes: G01D5