A FLASH INTERPOLATOR ASIC WITH BUILD-IN AMPLITUDE MEASUREMENT CIRCUIT ^■^Anton Pleteršek, ^Roman Benkovič ^Department of LMFE (Laboratory for Microelectronics), Faculty for Electrical Engineering, Ljubljana, Slovenia ^IDS d.o.o., Design head-quarter. Tehnološki park, Ljubljana, Slovenia Keywords: Interpolation, amplitude measurement, orthogonal signals, flash interpolator, automatic gain control, encoder. Abstract: A flash interpolation circuit converts a pair of periodic and orthogonal sine-signals into a stream of periodic - phase shifted sinusoidal signals, the amplitudes of which can be combined to produce useful information about the peak amplitude of the input sine-signals, independently of the signal's frequency. An interpolation factor of 4 is shown to be sufficient for measuring amplitudes with an accuracy of 5.8 %. The interpolator architecture, combined with an amplitude measuring system, has been designed, integrated as a part of the interpolator ASIC, evaluated and analyzed. The ASIC is designed and processed in 0.35 em CMOS technology. Bliskovni interpolator z vgrajenim merilnikom amplitude Kjučne besede: interpolator, merjenje amplitude, pravokotni signali, bliskovni interpolator, avtomatična kontrola ojačanja, kodirnik. Izvleček: V članku je opisano bliskovno interpolacijsko vezje za pretvorbo analognih sinusnih in ortogoninih signalov v množico prav tako sinusnih - fazno zamakinjenih signalov, ki predstavljajo osnovno informacijo za nov algoritem merjenja amplitude. Merjenje je neodvino od frekvence signalov, interpolacijsko število 4 pa zadošča za preciznost merjenja 5.8%. Algoritem je podan in preizkušen v interpolacijskem vezju, ki je bilo procesirano v 0,35um tehnologiji CMOS. 1. Introduction Atypical application in the motion control field is in magnetic or optical linear and rotary encoders, the major part of which comprises integrated electronics. In general, the electronics comprise an opto-sensing area or hall sensors structure, analog front-end and signal conditioning, and a fast interpolator and digital signal processing unit. The front-end performs sensors supply, sensors excitation and signal magnification functions. The operation speed of the encoders, based on magnetic sensors, is usually much slower than one based on light modulation. This holds true mainly for magnetic rotary encoders, the speed of the magnetic linear encoders being faster, but usually never exceeding the speed of optical encoders /1/, /4/, /16/, /21/, /24/, /31/and /35/. An analog signal generated from a sensors array is amplified and digitized to provide incremental orthogonal digital signals named track A and track B. Before digitizing the analog signals they can be further interpolated to achieve better measurement resolution /2-3/, /6-7/, /11/, /13/, /18/, /22/, /25/, /28/, /29/ and /35/,The same is true for an absolute type encoder which can perform absolute position detection /9/, /14/, /20/, /32/. In the case where more than 7-bit resolution is required, analog signals conditioning need to be implemented. This includes equalization of the sine and cosine signal amplitudes, their offset equalization and phase difference adjustment to 90 degrees. The most common practice is adjusting analogue front-end parameters via a serial interface or reprogramming them with access to internal EEP-ROM /12/. Automatic offset measurement and cancellation are relatively simple /17/, the phase measurement and correction and the amplitude regulation and measurement being more complicated /5-6/, /11/, /25/, /28/, /38/ and /42/. A magnitude and phase estimation algorithm has been published /5/ for a signal with time-varying frequency. The method is slow and requires modest computations. Squaring algorithm using analog multipliers is a well known method for obtaining/extracting DC information from sine-cosine signals /36/. The main disadvantages are the limited linear input voltage range and its temperature behavior Also the flash interpolator circuits that comprise the signal generating circuit, of which the out-of-phase signals are generated by gain stages having different magnifications, are much slower /37/. The appropriate comparators circuit /37/ compares signals at different common mode levels, which may additionally cause different delays and offsets. The Cordic-based Loeffler discrete cosine transform (DCT) architecture is presented in /41/. It requires high level of digital complexity and is very suitable for low-power and high-quality codecs. Anything that can affect the accuracy of the final application is related to the overall decoder system's components /9/, /19-20/, /40/, /43/, /44/ and to the applied algorithms /27/, /28/. Therefore, the question of calibration is system related. The aim of this work is to present a less precise, but cost-effective and robust amplitude measurement algorithm, based on a flash interpolating circuit, suitable for VLSI integration on "system on chip SoC". Amplitude measurement is a basic pre-processing step for automatic signal-amplitude correction and for the AGC function. The major advantage of the proposed method is that there is no need for an extra system clock. Due to the lower silicon area consumption, low power consumption and signal frequency independent measurement method, the present solution is suitable for use in all integrated automatic signal conditioning systems. This paper is organized as follows. The typical application - encoder - that uses AMM, and the design considerations are described in Section 2. A detailed description of the proposed flash interpolation method using sine wave input signals with an interpolator-inherent principle of amplitude measurement are described in the third and in fourth Section. The results of measurements are presented in Section 5. 2. Encoders - Basic Principles An optical encoder translates an angular or linear position into an electrical signal. It is typically composed of a light source (LED), a main scale with a built-in optical grating with measuring period MP, and an optical scanner that is composed of an opto-sensor array and a reading scale with a built-in optical grating with a reading period, RP. The scanning head is usually composed of reverse polarized photodiodes that produce the quadrature signals, together with an additional photodiode (DF) that generates the index signal that is used for absolute position encoding. In short, as the scanner moves along the main scale the amount of light from the light source is modulated. The electrical signal that is produced by the opto-sensor in the optical array is also modulated. As we have seen, the encoder produces two ninety-degree shifted (quadrature) signals A+, A- and B+, B- (Figure 1 b). The signals in Figure 1 b are periodic; this periodicity corresponds to the movement of the scanner head with constant velocity along the main scale One period of the signal corresponds to a movement of the scanner head equal to the grating period (MP, RP). In general, the signals are not periodic in time, but are periodic in relation to the displacement along the main scale. The signals A+, A-, and B+, B- in Figure 1 b are also not pure sine-cosine, but, in reality, are distorted and contain harmonic components. The incoming signals are also imbalanced in phase, offset and amplitude. The encoder system therefore requires signal conditioning prior to interpolation. The two pairs of signals from optical array are usually transformed into voltages with a fully-differential voltage amplifier to remove the large DC component and suppress even harmonics to produce the signals to be further interpolat- ed. The voltage amplifier should have a low output impedance to drive the resistive interpolation network. The two quadrature signals enable the position of the scanner head to be detected at all times, just by measuring the values of these two signals. To achieve high interpolation accuracy, the amplitude of the incoming sine signals should be regulated to the acceptable maximum level. The signals can be digitized directly by an analog comparator The two resulting digital signals (signal F4 and F8 in Figure 1 b) will still be in quadrature and all information be in the low-high and high-low transitions of the signals. There are four such transitions per grating period (MP, RP). Therefore the intrinsic resolution of the encoder is one fourth of the grating period. Alternatively, interpolation can be used to increase the resolution. An incremental type encoder outputs a pair of digital square waves Ao and Bo (Figure lb) that are 90 degrees apart and convey, for instance, the change in the shaft's position, and direction of rotation. An absolute type encoder, on the other hand, detects an absolute position. Optical or magnetic encoders are widely used transducers that have applications in robotics, manufacturing, motors, and the hi-tech industry/1 /, /14/, /23/, /24/ and /26/. All these may have incremental or absolute encoders. 3. Flash Interpolator - Theory and Fundamentals The basic architecture of the proposed flash interpolation converter consists of four matched resistive chains, connected in a symmetric bridge (Figure 1 a). The resistivity of each chain is R^The differential channel signals CH-Aand CH-B, ordinary and inverted (A+, A-, B+, B-), are connected to opposite sites of the bridge, the voltages of which are of equal amplitude, but phase shifted by 0 and 180 degrees (CH-A) and by 90 and -90 degrees (CH-B) as shown in Figure 1 b. An interpolation factor of IP=4 is chosen as an example. Thus interpolator circuit in Figure la consists of four resistive chains, each having IP resistors 4 (r1 to r4 with total resistivity of R, = It also consists of 1 twice as many voltage comparators, CI to C8, connected to the taps of the bridge. Each comparator always compares tap voltages on the same common mode (CM) level, as shown from simulations in Figure 2 (si, s2, to s16). Each comparator compares two voltages, shifted in phase by exactly 180 degrees. Although all comparators operate at the same CM level, they differ in performance, which causes INL and DNL errors of the output code (variations of the separation time). Interpolator linearity is also limited by the resistors' matching requirements. Resistance values in the chain are calculated according to the shape of the incoming orthogonal and differential signals connected to the bridge corners (A+, A-, B+, and B-). Angle resolution K is defined by interpolation resolution set by IP within a single chain interval of 90 angle degrees. K is a constant: A. Pleteršek, R. Benkovič: A Flash Interpolator ASIC With Build-in Amplitude Measurement Circuit Informacije MIDEM 40(2010)2, str. 107-114 90 —, where/P is defined in (6). (1) From the present example of orthogonal sine signals, calculation of the resistivity of the chain resistors in a resistor bridge is: tcs ^Vdda H tdc A+ o- CH-A Fl o- rl cs Flo- Pi P2 rfH U p3 1'4 <3- CI-I-B F5 <3- P4 F6 o- r6 P5 F7 o- P6 F8 <3- A-o- P7 f teal -c>Uenv \f P8 CH-A Pio Ici CH-A -oGI A- r'l Nl -0 02 N2 -oG3 N3 -oG4 N4 CH-B ~o Cj5 B+ -<3 N5 -o G6 N6 N7 -o Gl /c8\ i n /• 'cS' N8 -o G8 A+ J^'dda! ml nI)! HE 5H—<»"■ CS CH-A ^Ni (a) signal-angle calculation on individual resistor tap: a, =I-K; 1=1, 2, ...,IP, (2) where maximal angle is amax = 90 deg, and resistors are: D r \ n cosfaO 45deg/y bridge cross at the same points (y1, y2, y3 and y4) which are multiples of 45 degrees. The ripple extremes exist at multiples of a=45/2 degree: 4-IP ® (8) from which it follows that IP=4 is sufficient to realize amplitude measuring (AMM) and automatic-gain control (AGC) functions. The extremes of the Uenv envelope are: global minima that are at even multiples of a, where a is 22.5 angle degrees, and are defined as: cos(a)+sin(a) sin(90-a) (9) Vpmm = Vp = Vp-0.107m Vp is the peak amplitude of the input sine signal. maxima that are at odd multiples of a and are defined as: Vpmax = Vp = 0.76536 si„(a)+^2!Mz^.cos(a) cos(a)+sin(a) (10) As the interpolation factor IP increases, the signal amplitudes on the resistor bridge taps closer to input signals increase, while the ripple extremes remain at multiple of the 22,5 degrees (Figure 2). An interpolation factor IP of 4 is therefore optimum for the proposed algorithm. Because the minima are global, a ripple of 5,825% of the peak input amplitude Vp is a minimum and is defined as: rippleM= Vripm = "^E^l^^^P]^ . iqo (^ i) The ripple function Vrip(a) can also be described using a general modulo function, valid over the whole signal period: Vrip(a) = Vp sin + COS mod— a mod— 4 1 ■ 4 . n sm — 4 (12) and the extreme functions are: Fig. 2. Simulated waveforms of the phase shifted signals Pi and Ni on the symmetrical resistive bridge of an interpolator from Figure 1a. The shadow area Vr is an envelope range (envelope ripple), showing also local minima and maxima. Signals P2, N2, P6, and N6, as well as input signals from CH-A (A+, A-) and from CH-B (B+, B-), do not contribute to minimization of the envelope ripple. All signals have the same period and offset as input signals, but differ in amplitude and phase shift. The tracking accuracy depends on differential amplifier gain and offset voltage. All signals within one segment of the f Vrip _max{n)=Vrip (2« + l)- — andis: 0.76536. Vp, (13) where maxima are positioned at all odd multiples of ; Vrip _min(fl)= Vrip -andis: 0.707706. Vp, (14) minima are positioned at all even multiples of , where n ranges from.....-2, -1, 0, 1, 2.....and where radians is equal to 22.5 angle degrees. Any other search for maxima in terms of "searching for minima above global minima" is much more complex and requires much higher speed Ici circuits, the tracks of which have to be controlled by extra - fast comparators. 4.1 Identifying the Non-ideality Sources Resistor/-7 mismatch of 1% and 2% (Figure la) is taken as an example for analysis shown in Figure 3. The larger r1 resistivity then required slightly reduces the maximum at the corresponding angle position, as is shown in detail on top of the picture (curves r1_1%_mis and r1_2%_mis). It is evident that the comparator offset cannot affect the sine signals on resistors' taps. On the other hand, the offset voltage of the differential stages Dif drastically affects the envelope extremes. As the Dif is in a source follower configuration, its offset contributes directly with a unity gain to the envelope change as is shown, as an example, for 10mV offset (curve Dif_ 10mV_offset) and for-1 OmV offset (curve Dif_-10mV_offset). It is also clear that each Dif stage contributes only at an appropriate angle position area (we put offset voltage to Dif stage in the Id block only - Figure 1a). tCXTKKWL