1. Field of the Invention
The present invention relates to an optical encoder and a controller for the same, especially to a DSP-based optical encoder performing interpolation by inverse trigonometric function in original analog signal and counting by hysteresis comparison, thus achieving high resolution.
2. Description of Prior Art
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. The noise of the AC servomotor can be advantageously reduced if the optical encoder wheel can provide higher resolution. However, the commercially available optical encoder wheel has limited resolution even though interpolation is used.
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.
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 MMI200-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.
In generally, the output signal of the optical encoder is analog sinusoidal signal and can be processed by digital scheme to obtain fine division.
The fine division method can be classified into phase fine division and amplitude fine division and which is stated in more detail hereinafter. 1. Direct Fine Division
This scheme is quadruple frequency method shown in
2. Phase Fine Division with Resistor Chain
The A, B phase signals from the optical encoder are further phase-divided by resistor chain. The original signals are divided into n equal partitions by adders and subtractors. However, the amount of resistors is increased and the accuracy of the resistors is demanding when more partitions are needed. The most common partition number is around 20.
3. Composition of Resistor Chain
As shown in
A=U0 sin α
B=U0 cos α
The composite signals generated from the resistor chain are:
The A, B phase signals have 90 degree phase difference and can be expressed into two orthogonal vectors (V1, V2) and a signal Vk tapped therefrom has following expression:
For example, U.S. Pat. No. 5,920,494 disclosed a fine division by composition of resistor chain, wherein multiple divisions (1×, 2×, 5×, and 10×) are provided without the problem of missing pulses.
4. Amplitude Fine Division
The amplitudes of the A, B phase signals are equally divided into n partition. As shown in
5. A/D Fine Division with Lookup Table
The phase fine division with resistor chain needs 120 resistors and 40 comparators when the division number is 20, which is cumbersome when better precision is needed. The ration of the A, B phase signals can be expanded in Taylor series to obtain phase information. A lookup table stored in ROM can be used to speed up the calculation time, as shown in
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. The signal is compensated by orthogonal adjustment for amplitude, DC level. Part of the calculation task is off-loaded to lookup table and electronic circuit when the DSP and MPU are also used for servo control.
However, the above-mentioned optical encoder still cannot exploit the operation speed of current DSP for providing better resolution.
The present invention is intended to provide a DSP-based optical encoder performing interpolation by inverse trigonometric function in original analog signal and counting by hysteresis comparison, thus achieving high resolution.
Accordingly, the present invention provides an optical encoder and a controller for the same. The optical encoder comprises a controller for processing output signals of an optical sensor. The optical sensor generates output periodic signals with quadrature phase difference after receiving light passing a glass plate with etched pattern. The controller comprises a pair of analog amplifiers for amplifying quadrature periodical output signals of the optical sensor, a pair of A/D converters electrically connected to the analog amplifiers for digitalizing the output of the analog amplifiers, a pair of hysteresis comparators electrically connected to the optical sensor for performing hysteresis comparison for the output of the optical sensor, an up/down counter electrically connected to the pair of hysteresis comparators for up/down counting the output of the hysteresis comparators and a firmware unit electrically connected to the pair of A/D converters and the up/down counter for performing interpolation for the quadrature periodical output signals and counting for the hysteresis compared signals. Therefore, optical encoded result of higher resolution can be achieved.
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:
The first analog amplifier 110A and the second analog amplifier 110B receive the A, B phase signals with 900 phase difference from the light sensor 240, namely, sin and cosine signals with following expressions:
A=U0 sin θ
B=U0 cos θ
The A, B phase signals with 900 phase difference, after amplification by the first analog amplifier 110A and the second analog amplifier 110B, are digitalized by the e first ADC 150A and the second ADC 150B, and then sent to the firmware unit 170 for frequency multiplying processing.
In above formula, the angle θ can be known by lookup table. On virtue that tan θ has period of π(−π/2 to π/2), the output signals Ap, Bp of the first hysteresis comparator 120A and the second hysteresis comparator 120B can be quadruple processed to know the angle θ is in which quadrant. The counter 160 can performing counting according to the output signals Ap, Bp of the first hysteresis comparator 120A and the second hysteresis comparator 120B. Provided that the glass plate 210 has 2500 A, B phase signals with 90° phase difference, the optical encoder 10 can provide resolution of 2500 ppr×4=10000 ppr. If there is 180 partitions additionally set for 0−π/2 for π=tan−1(A/B), then the overall resolution of the optical encoder 10 is 1800000 ppr.
In the block diagram shown in
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.