(Editor’s note : this is part of an on-going series of “dialogues” between the authors; there are links to the previous installments at the end, immediately above the “About the Authors” section. Also below are also two “Desert Island Design” articles, by one of the authors.)
[The setting: Dave and Dr. T: coming back from lunch . . .]
Dr. T: (Tamara Schmitz): Yum! Love those burritos!
Dave (Dave Ritter): Aren’t you trying a low-carb diet? You really should try the taco salad, lots of good stuff and no guilt … I mean, it’s just a salad!
Dr. T: So where were we? I think you were about to wax eloquent about the virtues of ‘true mixed signal processing’.
Dave: Absolutely. You can use digital almost anywhere you can use analog.
Dr. T: But there must be times when one is better. Let’s say I want to build an AGC amplifier. It would need to vary gain, and I can do that with Gilbert cells or variable gm amplifiers …
Dave: Or with a simple DCP: a digitally controlled potentiometer.
Dr. T: Yes, we make DCP’s. One of my favorite workhorse DCPs is the ISL95811 with low tempco, some memory and a small package (DFN or MSOP). People often use them to control DC levels, but they work well for lower frequency signals also…
Dave: Absolutely, but capacitances are lower inside a chip and a DCP can work to high frequency, so it can be a versatile gain control.
Dr. T: Okay, so I could do the gain control lots of ways. But I also need to sense the signal. I usually use a diode or transistor to rectify the signal and a differential integrator to add up the errors.
Dave: Yes, that works, but you could also use a comparator. Apply a DC level to one input and the signal to the other. Every time the comparator goes high (because the signal is higher than the DC reference) we can adjust our DCP downward to lower the signal.
Dr. T: Sounds pretty coarse. My analog approach is smooth. I detect the amplitude as an analog voltage and then feed it back to a gain control cell, and the whole thing can smoothly adjust for the signal. Your digital approach is choppy, right?
Dave: Well, sort of. But we can design the ‘coarseness’ of a digital control system to be whatever we like. The DCP you mentioned has 256 levels, but some have 1024 levels and can control a signal to within a tenth of a percent. That’s more than adequate for most applications.
Dr. T: Okay, so I agree that digital techniques can work, but what is the advantage? Why use a DCP and comparators when I can use a diode, a cap, and a gain cell?
Dave: Very good question. Let’s say the signal varies a lot, but we want to adjust for the long term average.
Dr. T: No problem, I can make my analog solution average for as long as you like: I just use a bigger capacitor.
Dave: Are you going to put that cap on the chip?
Dr. T: Well, that depends on the value. If it’s more than 100 pF it is probably too big for the chip. It would take too much area and make my chip too expensive. But I can always use an external cap.
Dave: But you will need an extra pin and your customer needs to buy a cap, using up expensive PCB area.
Dr. T: How can digital help?
Dave: One of the neat things about digital is how the time constants scale. If we had a time constant of, say, 1 msec using a 10-bit accumulator, we can add another 10 bits and get 1 sec average. If we add another 10 bits we’re averaging for more than 15 minutes. And digital circuits like this are small, probably smaller than your 100 pF cap.
Dr. T: Okay, so digital is good for doing long time constants without using big capacitors and extra pins, right?
Dave: Absolutely. And there’s another cool thing about digital control loops, like AGC’s: you can stop them.
Dr. T: I can stop my analog circuit ….
Dave: Not if you want the gain to remain the same. Analog loops need to run all the time to refresh their capacitors. Leakage currents or amplifier offsets will make them drift off the intended value. Digital loops can stop once a reasonable gain has been established and they just stay frozen. That’s a very useful feature in some applications.
Dr. T: I think we need to draw up two examples. Let’s sketch out my analog AGC using diodes and caps, and your digital AGC using comparators and DCPs.
Dave: Excellent. Here’s the digital version (Figure 1 ):
Figure 1: Digital AGC using window comparator, counter and DCP.
(Click on image to enlarge)
Dave: You can see the basic loop structure: the signal level is controlled by a DCP, the amplitude is detected using a window comparator, and the loop is closed via a digital counter which is acting as an error integrator. (The basic structure is a low pass filter of sorts, and it uses both analog and digital elements.)
Dr. T: And here’s the analog version in Figure 2 :
Figure 2: Analog AGC using transistor rectifier, analog integrator and Gilbert Cell multiplier..
(Click on image to enlarge)
Dr. T: My version controls the signal level using an analog multiplier cell (aka Gilbert Cell), detects the signal level by a two transistor rectifier, and closes the loop with a traditional op amp integrator.
Dave: And here’re a few plots (Figure 3 ) from simulations of both. Since we thought ahead to design for similar loop bandwidths, the responses are quite similar. The bottom plot shows the input signal (a high frequency sine wave) as it steps from a large amplitude signal at startup to a small signal in the center and then steps back up again.
Figure 3: Digital and analog AGC waveforms
(Click on image to enlarge)
Dr. T: Very interesting! I’m surprised by how similar they are. And it’s interesting that both loops react faster to a falling signal level than a rising level. In a normal linear loop I would expect to see the same time constant at each step.
Dave: A very astute observation. The issue is this: an AGC loop isn’t linear. The feedback does not go to a summing element as in a linear loop; it goes to a multiplying element, whether it’s a Gilbert Cell or a DCP.
Dr. T: Of course! The input signal is actually changing the loop gain, making it faster at high inputs and slower at low inputs. That must affect stability as well.
Dave: Yes. Fortunately we don’t have any delays in our loop. A significant delay between the gain control and the signal sensing would reduce phase margin, creating ringing and instability. The loop characteristics definitely change with signal level, so we have to design carefully for all anticipated signal ranges.
Dr. T: There’s always more to it than meets the eye. What about this ‘stopping the loop’ business: Why would I want to stop my loop?
Dave: I actually had a real example in my last project. We were equalizing a long length of cable and things could get very noisy. We never knew where the customer would route the cable. In an industrial setting there could be big motor starters or furnaces: large equipment that can generate large spikes. We used a digital loop to control our analog equalizer so that once it figured out how long the cable was (and how much to equalize) it simply stopped itself. That way, if a noise spike came along, the loop would ignore it.
Here’s a sim of our loops first settling and then in ‘frozen’ state where we don’t let the loop update anymore, Figure 4 :
Figure 4: Response of ‘frozen loops’: digital is stable, analog drifts
(Click on image to enlarge)
Dr. T: Well I have to say that this is really cool, and I’m really impressed that you came up with these colorful graphics so quickly.
Dave: Well actually, I figured you would ask about stopping the loop, so I ran the simulation last night.
Dr. T: You have opened my eyes. I can see that digital logic should have a place in my analog designs. Analog feedback solutions need large passive devices that might not fit inside a single chip. More importantly, they can’t be turned off.
Dave: Don’t give up on pure analog just yet. Remember that with analog you get an infinitely variable solutions and no switching noise from digital steps.
Dr. T: Once again, it’s all about trade-offs.
Previous “dialogues” in this series:
- Power Trip: Dealing with kVA issues, power factor, and smaller boost vs. buck regulators
- The elegance of ferrite beads as a circuit design and problem-solving component
- True engineers solve problems using the tools at hand: building a bandgap reference
- Matching your socks. . . and your inputs
- Avoiding op amp “motor boating” (also known as “inadvertent positive feedback”)
- A bypass-capacitor dialogue peels back the layers, Part 1
- A bypass-capacitor dialogue peels back the layers, Part 2: The theory of ground relativity
- A bypass-capacitor dialogue peels back the layers, Part 3: Continuing the discussion on layout considerations
Other related articles by Dave Ritter:
- Desert Island Design: Bridging the (filter) gap without software
- Desert Island Design: Bridging the (band) gap without software
About the authors
Dave Ritter grew up outside of Philadelphia in a house that was constantly being embellished with various antennas and random wiring. By the age of 12, his parents refused to enter the basement anymore, for fear of lethal electric shock. He attended Drexel University back when programming required intimate knowledge of keypunch machines. His checkered career wandered through NASA where he developed video-effects machines and real-time disk drives. Finally seeing the light, he entered the semiconductor industry in the early 90's. Dave has about 20 patents, some of which are actually useful. He has found a home at Intersil Corporation as a principal applications engineer. Eternally youthful and bright of spirit, Dave feels privileged to commit his ideas to paper for the entertainment and education of his soon to be massive readership.
Tamara Schmitz grew up in the Midwest, finding her way west with an acceptance letter to Stanford University. After collecting three EE degrees (BS, MS, and PhD), she taught analog circuits and test-development engineering as an assistant professor at San Jose State University. With 8 years of part-time experience in applications engineering, she joined industry full-time at Intersil Corporation as a principal applications engineer. In twenty years, she hopes to be as eternally youthful as Dave. .