<<

TUTORIAL

DESIGN AND OPERATION OF AUTOMATIC GAIN CONTROL LOOPS FOR RECEIVERS IN MODERN COMMUNICATIONS SYSTEMS

his article is intended to provide insight VGA TYPES into the effective operation of variable There are two major classes of VGA in use Tgain (VGA) in automatic gain today. The first is the so-called IVGA (input control (AGC) applications. Figure 1 is a gen- VGA), which can be regarded as a passive eral block diagram for an AGC loop. The in- variable attenuator followed by a fixed-gain put passes through the VGA to produce . The second type is the output VGA the output level to be stabilized. The detec- (OVGA), which is essentially equivalent to a tor’s output is compared against a setpoint fixed-gain amplifier followed by a passive at- voltage to produce an error signal, which is tenuator. then integrated to produce a gain control volt- An IVGA is the preferred choice for a re- Fig. 1 VGA-based AGC age. This is applied to the control input of the ceive AGC system because the available out- loop block diagram. ▼ VGA. The attenuator shown be- tween the VGA and the detec- VGA (LINEAR IN dB) SIGNAL tor is used to align the maxi- This article is intended OUTPUT mum output level of the VGA SIGNAL INPUT with the maximum input level to provide insight into the of the . effective operation of variable RF ATTEN DETECTOR In the course of this article several key issues will be ad- gain amplifiers (VGA) dressed, including VGA types, C integ Rstab Rin loop dynamics, detector types, in automatic gain control the operating level of VGA and (AGC) applications. − the operating level of the detec- + tor. Then an example applica- ERROR INTEGRATOR tion revolving around an AD8367 VGA will be presented DANA WHITLOW SETPOINT INPUT RSSI OUTPUT for further discussion of the Analog Devices material. Beaverton, OR TUTORIAL

vide considerable reduction of the law influences the dependency of the LOG LINBNV ripple. loop’s equilibrium level on the input’s RMS SQLAW One of the benefits of using an waveform or crest factor. +20 IVGA in an AGC loop is that the Four detector types will be consid- +10 VGA’s gain control voltage bears an ered here: envelope detector; square- 0 accurate logarithmic relationship to law detector; true-RMS detector; and −10 the input signal level when the loop is log detector.

(dB) − o 20 in equilibrium. This means that the P −30 gain control voltage may also be used ENVELOPE DETECTOR −40 as an excellent received signal (RECTIFIER) −50 strength indicator (RSSI). The output voltage of the enve- 0 5 10 15 20 25 30 lope detector is proportional to the TIME (ms) LOOP DYNAMICS magnitude of the instantaneous RF ▲ Fig. 2 Simulated response of AGC loop Response time is an important is- input voltage. Assuming that suffi- to large amplitude steps for various detectors. sue when designing any AGC loop. cient low pass filtering is applied at There is usually a compromise be- its output to eliminate RF ripple, this put level at low is relatively tween having the loop respond to un- detector produces a voltage propor- independent of the gain setting. This desired input level fluctuations as tional to the envelope amplitude of is the desired trait for an AGC sys- rapidly as one would like, and having the RF signal. tem, whose very object is to maintain it undesirably modify amplitude mod- Assuming that the loop’s band- a constant output in the face of vary- ulation on the signal. Additionally, width is made sufficiently small as to ing input signal amplitude. large and/or abrupt changes in the in- avoid significant gain pumping, the The OVGA is generally ill suited put level may lead to unacceptable effect of the loop using an envelope to AGC applications because of its re- recovery behavior, necessitating fur- detector is to stabilize the average duced output signal handling capabil- ther adjustments of the response rectified voltage of the signal. The re- ity at low gain settings and therefore time. sulting power is therefore dependent will not be discussed further here. The issue of excessive loop band- on the RF signal’s envelope wave- When a single IVGA is used in a width deserves a bit more explana- form. Such a loop acting on a con- situation in which the VGA sets the tion. If the loop responds too quickly, stant-envelope signal such as GSM system floor, the output SNR is it will introduce undesired gain mod- will produce an average output power essentially independent of the input ulation arising from the loop’s efforts which is different than that for a signal; it does not improve as is often to stabilize the output level of a signal heavily-amplitude-modulated signal, preferred. Occasionally, it is desirable containing legitimate amplitude mod- such as CDMA or 64QAM. to cascade two VGAs in order to ame- ulation. This is referred to as “gain The output of the envelope detec- liorate this behavior or simply to ob- pumping.” In the context of digital tor cannot go negative no matter how tain more gain control range. Doing , the presence of apprecia- weak the input signal, but may reach so requires proper coordination of ble gain pumping can result in signifi- extreme positive values in response to the gain control inputs of the two de- cant modulation errors and perhaps very strong . Starting with the vices. even noticeable spectral re-growth in AGC loop in equilibrium, a sudden If the gain control of only the sec- extreme cases. A tolerable value of large increase in input amplitude ond stage VGA is manipulated in the gain pumping would generally be only causes a very large initial increase in weak signal regime, the signal level to a fairly small fraction of 1 dB. detector output, which very rapidly the first stage VGA’s amplifier in- drives the loop towards lower gain. creases with increasing input level, so DETECTOR TYPES (DETECTOR On the other hand, an abrupt reduc- the output SNR improves with in- LAW) tion of the input signal level (no mat- creasing input level. It is necessary to One convenient aspect of an AGC ter by how many dB) cannot reduce hand off the gain control from the loop is that the detector need not nec- the detector output below zero, and second stage to the first stage only essarily have a very wide dynamic the loop’s best response is to slew to- when overload of the first stage’s am- range over which it obeys any particu- wards equilibrium at a fairly low rate plifier is imminent. lar law. This is because the detector until the detector output begins to Alternatively, the two gain control operates at a constant average level change by a significant fraction of the inputs may simply be driven in paral- when the AGC loop is in equilibrium; reference voltage, at which point the lel, in which case the output S/N (ex- thus, the detector should only need to recovery trends towards an exponen- pressed in dB) improves at half the cope accurately with the level range tial decay. In the slew rate limited re- rate at which the input level (also ex- associated with a modulated signal. gion, the gain of the signal path is pressed in dB) rises. In cases where However, as mentioned earlier, the varying at a constant number of dB the VGAs used have residual ripple in detector’s response law (that is linear, per second. their gain control functions, an addi- log, square law, etc.) can play a signifi- Figure 2 shows the behavior of tional benefit of this approach can be cant role in determining the loop’s dy- such a loop for a large input level obtained if the two gain control input namic response during large, abrupt step (note that curves for all four de- signals are intentionally offset by half changes in signal level. Perhaps more tector types are superimposed on this the period of the ripple. This can pro- importantly, the detector’s response plot). These results were obtained TUTORIAL from simulations in which the VGA of the signal path that is square law has a shallow slope for high input lev- has representative limits on the gain brings forth the possibility of the els, resulting in a diminished re- range and on the maximum output large-step response being different sponse rate to sudden increases in level. The detectors contrived for from that of the simple envelope de- signal level. At the other extreme, the these simulations have no particular tector, which can indeed be seen in square-law detector’s small slope near limits, on the grounds that in most the figure. Note that the RMS detec- zero input level gives it a very slug- practical situations the designer will tor has a slightly slower recovery from gish response to large decreases in in- scale the circuit so that the detector a large downward amplitude step put amplitude. Conversely, the does not limit appreciably before the than does the standard envelope de- square-law detector exaggerates the VGA does. tector, but a slightly faster recovery response to large signals, giving the (and a bit of overshoot) from a step fastest response to increasing signals. SQUARE-LAW DETECTOR up in input amplitude. In common The envelope and RMS detectors, This type of detector has an in- with the square-law detector, the having intermediate characteristics, stantaneous output which is propor- true-RMS detector will make the give response speeds in between. tional to the square of the instanta- AGC loop’s equilibrium point inde- neous RF input voltage, which is pendent of the RF signal waveform. OPERATING LEVEL equivalent to saying that its output is It should be noted that the pres- OF DETECTOR proportional to input power. This be- ence of the long-time-constant low Ideally the operating level of the havior, when incorporated into an pass filter in this detector may have a detector should be set as high as pos- AGC loop of sensible bandwidth, marked influence on loop dynamics; sible in order to minimize the error makes the loop’s equilibrium average indeed, this filter may even provide due to residual DC offsets. However, output power independent of the in- the dominant pole in some designs. other considerations often rule. For put waveform. As with the envelope This time constant must therefore be signals with , detector, the output can never go coordinated with the remainder of the peak input to the detector when negative, resulting in the loop having the loop design. the loop is in equilibrium must be no a similar tendency towards slew rate higher than what the detector will limited behavior when reacting to LOG DETECTOR support, and so the average must be abrupt decreases in input amplitude. This type of detector produces an lower. Even for constant-envelope The response to large abrupt increas- output proportional to the logarithm signals, the average level must be rea- es in input amplitude can be even of the RF input voltage. Because this sonably lower than the maximum, so more striking, however, because the behavior is complementary to that of that there is room for the detector square-law detector characteristic ex- the linear-in-dB VGA in the loop, the level to increase if the system input aggerates the effect of the input in- resulting loop dynamics are those of a level increases; otherwise, there crease. The extent to which this hap- linear system, assuming that signal could be little or no error signal to pens depends on the clipping level of level fluctuations during transients drive the loop back towards equilibri- either the VGA or the detector, remain within the measurement um. Note that there will generally be whichever appears at a lower level. range of the log detector. Subject to unequal amounts of room for the de- that assumption, the AGC loop’s re- tector output to swing up or down TRUE-RMS DETECTOR sponse to abrupt large changes in in- from the design equilibrium level, This detector comprises a square- put level will not be slew-rate limited, which will make the apparent attack law detector followed by a low pass and will often be faster to recover and decay speeds of the loop differ. filter followed by a square-root func- from amplitude decreases. tion. The low pass filter performs the As with the envelope detector, the DESIGN EXAMPLE “mean” operation associated with the equilibrium point of an AGC loop us- OF A WORKING AGC LOOP root-mean-square (RMS) function, ing the log detector will depend on Let’s now put the above considera- and it should have a sufficiently long the RF input waveform. tions to work in a practical design. time constant to smooth the output The design assumptions and goals are variations of the squaring detector COMPARISON OF RESPONSES as follows: that would otherwise arise from the WITH DIFFERENT DETECTORS • Signal modulation: W-CDMA (15 legitimate modulation of the signal. The AGC loops whose simulation users); symbol rate = 3.84 Msym- Because of the square-root ele- results are shown were designed so bols/s ment in this detector, the average that the small-signal response speeds • IF frequency: 380 MHz output is proportional to the signal are identical. The results show that • VGA: AD8367 voltage, not power, so the loop’s re- the loop’s large-step transient re- • Detector: AD8361 (true RMS, for sponse to small abrupt decreases or sponse is markedly dependent on the waveform independence) increases of signal level should essen- type of detector. At one extreme, the • Power supply: 5 VDC tially be the same as that for an enve- log detector gives the fastest response From these, reasonable constraints lope detector, provided that the to large abrupt decreases in input lev- will be established for operating lev- added filter pole within the RMS de- el because the logarithmic curve has els to maximize the adjacent channel tector is correctly compensated for a very steep slope for low inputs, power ratio (ACPR) and AGC loop elsewhere in the loop. The fact that which exaggerates the loop’s re- bandwidth (to avoid excessive gain the added pole is located in a region sponse. However, the log detector pumping). TUTORIAL

Previous bench measurements on variation is acceptable. An estimate The loop bandwidth designed will the AD8367 had revealed that of the desired loop bandwidth will apply only for small deviations from the best ACPR at 380 MHz occurs be made by passing a W-CDMA sig- the AGC loop’s equilibrium level. with an output level of about 112 nal through a spectrum analyzer Large transients will behave differ- mVrms, which gives about –12 dBm with very wide resolution band- ently because of the nonlinear char- into 200 Ω. width, zero span and linear detec- acter of the loop, and simulation tor, and observe what video band- and/or breadboarding will be relied Detector Operating Level width results in 0.5 dB p-p output upon to investigate the large signal The peak-to-average power ratio variation. The result turns out to be behavior. for the chosen signal is about 18 dB. 200 Hz, which means the initial de- The next items on the agenda are When operating from a 5 V supply, sign of the AGC loop will have a the determinations of the incremen- the maximum output level of the 200 Hz bandwidth. The simulation tal gains of the VGA and of the detec- AD8361 is about 4.8 V (from the and measured results will be used tor from the loop dynamics view- AD8361 datasheet). The squarer in to see how this choice works out. point. For the VGA, this means the the detector will be assumed to go slope of Vout versus control voltage, into clipping at the same input level RMS Detector Filter not the RF gain. that results in maximum output, for a The RMS detector’s “mean value” CW signal. Thus, assuming that the filter comprises an internal filter re- VGA Gain peaks of the modulated signal should sistance combined with an external Vin and Vout will represent RMS val- not drive the detector’s squarer into shunt capacitance. The effective val- ues of the VGA’s RF input and output, clipping when the loop is in equilibri- ue of the filter resistance varies with respectively, and Vg will represent the um, the average output level of the drive level, from about 2000 Ω at gain control voltage. From examination detector must be such that it is at very low drive level down to about of the AD8367 performance data in the least 18 dB below 4.8 V; 4.8 × 10–18/20 500 Ω at maximum drive level. For datasheet for 240 MHz, combined with = 604 mV. Since the conversion gain this example a value of 1.8 kΩ will be a bit of extrapolation and rounding, 0 of the detector is 7.5 V/Vrms, the used, which was determined empiri- dB of gain is found to occur at a control loop-equilibrium level at the detec- cally for the operating level estab- voltage of 0.1 V and the control slope is tor’s input should be 604 mV/7.5 = 80 lished earlier. 50 dB/V. By formulating and then dif- mVrms. In general, an AD8361 would be ferentiating Vout with respect to Vg at This level can be obtained from taken into the lab with a W-CDMA the equilibrium output of 112 mVrms, the desired output level of the VGA signal source in order to ascertain a the incremental slope is evaluated to be Ω by adding a series resistor of 90 , suitable filter value. Howev- 0.6447 Vrms/V. which combines with the 225 Ω input er, the previous measurement for loop resistance of the AD8361 to form a bandwidth gives a clue that allows a Next the Detector Slope voltage divider that achieves the de- reasonable estimate of the required The nominal conversion gain of sired result. Note that this loads the value to be made. A loop bandwidth the AD8361 is 7.5. However, a 90 Ω output of the VGA with 315 Ω, which of 200 Hz resulted in a 0.5 dB p-p (~6 series resistor was added at the input means that the lowest additional par- percent) variation of detector output. of the detector; this has the effect of allel load impedance on the VGA It so happens that this is just about reducing the detector’s effective gain would be 547 Ω in order to satisfy its the maximum amount of variation of to 5.357, which is the value that will design minimum load impedance of RMS filter level that still gives good be used in the loop analysis. 200 Ω. However, in this case more RMS accuracy. So, the bandwidth of than half of the VGA’s power output this filter will simply be made equal to Avoidance of Excessive is going to be feeding the detector. 200 Hz, which requires a filter capaci- Recovery Delay This could be remedied by driving tor of about 0.44 µF against the 1.8 If the loop is left sitting with a very the VGA end of the 90 Ω resistor kΩ filter resistance. low (or zero) input signal level for a with an emitter follower, raising the time, the output voltage of the inte- input impedance of the overall detec- Loop Dynamics Design grator will continue to rise until it tor by the beta of the transistor used A first order loop will be devel- reaches saturation of the op-amp as in the follower. This would free up al- oped, with a small-signal bandwidth the loop tries to find more gain. most all the output current capability of 200 Hz. Note that the RMS detec- When a significant signal does sud- of the VGA for use by the useful load. tor’s filter already contributes one denly arrive at the system input, one pole at 200 Hz, so the remainder of has to wait for the integrator’s output Estimation of Target the loop will clearly need to take this to ramp back down to 1 V before the AGC Loop Bandwidth into account. This will be achieved by loop can begin reducing the gain. To Here a judgment call must be choosing Rcomp to create a zero at reduce this “overload delay” a 4.3:1 made, based on an empirical mea- 200 Hz in conjunction with Cinteg attenuator is inserted between the in- surement, to establish the maxi- (see Appendix A). The response tegrator and the control input of the mum loop bandwidth that will avoid speed of all the other elements in the VGA so that the positive limit (nearly intolerable gain pumping. For pur- loop is so much faster than that of the 5 V) of the integrator’s output is poses of this design example, it is desired loop that all other poles can about equal to the maximum effec- assumed that up to 0.5 dB p-p gain be safely ignored. tive control input (1 V) to the VGA. TUTORIAL

30 0.4 0.20

0.3 ) 20 0.15 dB 0.2 ( 0.10 0.1 10 0.05 0 0 −0.1 0 LEVEL (dB) − −0.2 10 − ELATIVE GAIN 0.05 LEVEL (dB) −0.3 R −20 −0.10 −0.4 0 0.02 0.04 0.06 0.08 0.10 0 2 4 6 8 10 12 14 16 18 20 −30 TIME (s) TIME (ms) −40 ▲ ▲ Fig. 3 The prototype circuit response to Fig. 5 The prototype circuit has about 0 2 4 6 8 10 12 14 16 18 20 0.2 dB p-p gain pumping. small amplitude steps is symmetrical and TIME (ms) shows exponential recovery. ▲ Fig. 4 The prototype circuit response to prototype loop’s response to small Calculation of Component Values large amplitude steps is asymmetrical and and large (30 dB) input level steps, In the loop, a net gain (excluding exhibits slow-rate-limited recovery. respectively. Figure 5 shows the the integrator for the moment) of 0.644 and can sink even less. Therefore, 50 measured gain pumping obtained by (VGA incremental slope) • 5.357 (ef- Ω capturing the signal at the gain-con- k is chosen for Rin in order to mini- fective detector slope)/4.3 (for the Vagc trol input of the VGA with an oscillo- = mize total loading on the AD8361’s atten) 0.803, is obtained. For a loop output, which leads to a value of scope and scaling into dB. bandwidth of 200 Hz, the loop gain 12.78 nF for Cinteg. Finally, in order CONCLUSION should be unity at that frequency. If the to compensate for the 200 Hz pole in rest of the loop has a gain of 0.803, the Numerous basic and finer points the RMS detector, Rcomp is chosen as integrator must have a gain of 1.0/0.803 62.3 kΩ to provide a loop zero at 200 of AGC design have been discussed, = 1.245, which requires that the reac- Ω and a detailed example of a practical Hz with Cinteg. A 10 k pulldown is tance of Cinteg at 200 Hz be 1.245 times design was worked out. Practical con- π also added on the AD8361’s output to the value of Rin. Mathematically, 1/(2 siderations and difficulties encoun- • • = • • improve its effective sinking capacity. 200 Cinteg) 1.245 Rin; Rin Cinteg tered along the way were empha- = 639.2 µs. Lab Tests sized, as opposed to reiterating text- Now another constraint must be A prototype circuit was construct- book loop design equations. Finally, a also noted, which is that the AD8361 ed according to the schematic in Ap- working circuit was constructed and cannot source very much current, pendix A. Figures 3 and 4 show the measurement results presented. ■

RF OUT (TO 50 Ω LOAD) +5 V 160 AD8367 1 14 ICOM ICOM 2 13 10 nF ENBL HPFL AD8361 10 nF 0.1 µF 3 12 1 8 RF IN INPT VPSI VPOS SREF 4 11 2 7 MODE VPSO 10 nF 10 nF IREF VRMS 91 0.44 uF 5 10 3 6 68 GAIN VOUT RFIN FLTR 10 nF R1 C2 6 9 4 5 DETO DCPL PWDN COMM 7 8 U2 ICOM OCOM 0.1 µF 220 pF U1 3.3 nF 10 K R4 33 k 12 nF 62 K

C1 R3

R5 10 k Vrssi R2 49.9 K 4 − 2 6 + 7 3 OPERATING SETPOINT 0.1 uF 47 K U3 APPENDIX A 10 nF AD589 12 V SCHEMATIC OF BREADBOARD OF EXAMPLE +5 V CIRCUIT USING A TRUE-RMS DETECTOR. 10 K 3.3 K