Re: AGC circuit adjustment
Alright, here goes. I googled around and could not find a simple explanation. But, basically, there are control loops all around you. If you have a PLL, a voltage regulator, a heater controller, an elevator, a car, or basically any system where you want it to do something, you observe that something (position, temperature, voltage, etc), and use a circuit to control it, that system is called a control loop. Long ago, people realized that there are certain aspects of designing the control loop that dictate its response to perterbations. Lets say you are driving your car down the road, a dog jumps out, you swerve the wheel, the car jumps to the left but too far, you then turn the wheel to the right--but again too far and you careen the other way....after a few more tries you finally get the car driving straight down the road again. The gain of the steering wheel, you might say, might have been a littlt too high because the system almost lost control and went unstable--ie a finitite input (the dog jumping in front) almost made you crash the car (an infinite response).
In circuits, like PLLs, an almost unstable system would result in similar undesireable effects--high spurious sidebands, a lot of ringing (and therefore settling time) when changing frequency, and high "phase noise bumps".
Control loops are pretty complicated, and you seldom can model all of the characteristics and quirks. But often control engineers make some assumptions to simplifiy the analysis. One assumption often made is that the system is a "linear system". In this case--a log amp--obviously that is non-linear, but you could say that aroun a -25 dBm power level, it acts "piecewise linear" for a small power range. Therefore at -25 dBm you can guess that it has a fixed gain (Pin/Vout slope). That describes its gain magniitude only, but you need to know something about its phase response also. Why? Because:
In a linear simple feedback system there is a forward gain, lets call it G. There is also a feedback path, lets call it H. Control theory will tell you that in the frequency domain, if you call s=jω, the closed loop system resonse is T(s)= output/input =G(s)/(1+GH(s))
So for various types of inputs, you can predict the output (approximately) by using this simple equation.
We will not get into the complexities of various inputs, such as steps, and how to convert from the freqeuncy domain to the time domain. But if you look at the equation, it is obvious by inspection that the system will go unstable when the denominator goes to zero. That is because if you are dividing by zero, the system gain is infinits (ie for any input, the output is infinite).
So, a simplistic way of thinking about this is that you need to keep your closed loop control loop from getting close to having a zero magnitude in the denominator! When you run a PLL program (from analog devices or national semiconductor), and it tells you to use certain capacitors and resistors in the control loop filter, it is figuring our the gain and frequency response of the loop filter needed to keep the denominator of that equation from going to zero. It is that simple.
Added after 17 minutes:
So, back to our problem. IF the agc circuit is unstable, the first thing you want to do is figure out how close to zero the denominator of the closed loop gain equation is getting at various frequencies. If at some frequency, it gets close to zero, there is your unstable circuit cause!
Once again based on all the simplifiying previous assumptions, you are analyzing to see if 1 + GH(s) = zero anywhere in frequency. But GH(s), if you think about it, is the "open loop response". That means the forward gain times the reverse feedback gain. So, you can make a pretty good prediction of closed loop response by simply analyzing the open loop response.
On good way to visualize this is called a Bode plot. This is a two graph plot, that shows open loop gain magnitude vs frequency, AND open lop phase shift vs frequency.
Most control loops have a "lowpass" gain response. That is, as the frequency gets higher and higher, the open loop gain gets less and less. At some frequency, the gain goes through unity (or 0 dB). At that exact frequency, WHAT IS THE OPEN LOOP PHASE DOING? Why do you want to know? Because if the magnitude of GH(s)=1, and its phase is 180 degrees, then the denominator of the closed loop transfer function is 1+ GH(s) = 1 + 1 [angle 180] = 1 -1 =0. So you would be dividing by zero.
Here is a site with some bode plot stuff:
https://www.swarthmore.edu/NatSci/echeeve1/Ref/LPSA/Bode/BodeReviewRules.html
Note that an sort of term 1/S, or K/S (where K is a constant) Has a fixed phase shift of -90 degrees. I won't go into why.
In my previous post, it looks to me like the log amplifier will have an S plane transfer function with a 1/S term in it. That means the log amp should have a phase shift, as far as the control loop is concerned, of -90 degrees.
This is not that uncommon. In PLL's, the VCO is an integrator of phase, so it also has a transfer function of Kvco/S. That is, the VCO starts off with at least -90 degrees of phase shift in a PLL circuit. IF you add a simple integrator after it to control the phase locked loop, you have designed an unstable system, since the loop filter integrator also has a transfer function of Klf/S, or a -90 degree phase shift too. So your open loop transfer phase would be -180 degrees at all frequencies--the worst place possible to operate! In PLL's , this is simply fixed by adding something called a Zero (often the zero is formed by putting a resistor in series with the capacitor of the loop filter). By selecting the value or R and C carefully, you can get the open loop transfer phase to be something else, say -120 degrees, when the open loop transfer gain goes thru 0 dB--resulting in a stable PLL.
So, IF I am right an the transfer function of the log amp is something like K/S, you are kind of screwed. You already ate up 90 degrees of the total 180 degrees you have to make the control loop stable. If you replace the log amp with a RF amp and diode detector, that had a transfer function of Kdet, then you do not loose the 90 degrees, and you are that much more likely to have a stable AGC circuit.
Of course, you can analyze the control loop filter of the agc circuit, add a zero to it at just the right frequency, and get a stable control loop from the log amp based AGC circuit also.
That is the simple explanation. See what I meant.