Saturday, March 27, 2021

Audio Amplifier Feedback - Estimating Poles in Lead-Lag Compensation Scheme

This post is a part of the series on audio amplifier feedback. The contents of the series can be found here.

In the last post, I postulated that a feedback network combining lead and lag compensation:

has a transfer function with two poles and two zeros:$$B(s)={R_g \over {R_f+R_g}}{{(s T_{z1}+1)(s T_{z2}+1)}\over{(s T_{p1}+1)(s T_{p2}+1)}}$$where $T_{z1}=R_f C_f$, $T_{z2}=R_n C_n$, $T_{p1} \approx (R_f || R_g +R_n)C_n$ and $T_{p2} \approx (R_f || R_g || R_n)C_f$.

The actual transfer function, calculated from the circuit theory, is$$B(s)={R_g \over {R_f+R_g}}{{(s T_{z1}+1)(s T_{z2}+1)}\over{(s(R_f||R_g)C_f+1)(s R_n C_n +1)+s(R_f||R_g)C_n}}$$As usual, it can be transformed into many equivalent forms as needed. The exact poles are the roots of the quadratic equation $${(s(R_f||R_g)C_f+1)(s R_n C_n +1)+s(R_f||R_g)C_n} = 0$$It can be solved algebraically, but the result is unwieldy and obscures, rather than clarifies, the placement of the poles.

Instead, it is easier to estimate the poles as follows. The time constant of the pole associated with $C_n$ is calculated by assuming that $C_f$ is an open circuit at the frequencies of interest and that the signal source (here, the output of the opamp) has zero impedance, then computing the equivalent resistance “seen” by the $C_n$, which is $R_f || R_g +R_n$.

The time constant of the pole associated with $C_f$ is calculated by assuming that $C_n$ is short circuit at the frequencies of interest and, again, that the output of the opamp has zero impedance, then computing the equivalent resistance “seen” by the $C_f$, which is $R_f || R_g||R_n$. 

The approximation is based on a number of assumptions that I may look at in a future post, but is surprisingly accurate (within 1% of the actual frequency for a reasonable audio band network). 

In any case, the exact roots are not that important. The approximate formulas help to see what shapes the loop gain, and what values can be changed to optimize it. For an experienced designer, the Bode plot by itself becomes sufficiently informative to skip the formulas altogether.

Saturday, March 20, 2021

Audio Amplifier Feedback - Combining Lead and Lag Compensation

This post is a part of the series on audio amplifier feedback. The contents of the series can be found here.

The lead and ag compensation schemes can be combined in one feedback network:

The transfer function of this lead-lag feedback network has two poles and two zeros:$$B(s)={R_g \over {R_f+R_g}}{{(s T_{z1}+1)(s T_{z2}+1)}\over{(s T_{p1}+1)(s T_{p2}+1)}}$$where $T_{z1}=R_f C_f$, $T_{z2}=R_n C_n$, $T_{p1} \approx (R_f || R_g +R_n)C_n$ and $T_{p2} \approx (R_f || R_g || R_n)C_f$.

For given $R_f$ and $R_g$, both zeros and one pole can be placed freely, which makes the combined compensation scheme quite flexible. 

Compare the $1/B$ feedback factor for the lead-lag compensation scheme (blue) with both lead (red) and lag (light blue) alone; green is the open-loop gain: 
It is clear that unlike the pure lead compensation, the combined scheme doesn't extend the bandwidth; unlike the pure lag compensation, it preserves the loop gain in the audio band; and from the rate-of closure, it appears that the phase margin is similar for all three compensation schemes.

One possible design procedure for the combined compensation scheme is:

  1. Choose $R_f$ and $R_g$ from the desired DC gain $(R_f+R_g)/R_g$ and the expected parasitic capacitances
  2. Choose the time constants for the first pole ($T_{p1}$) and both zeros ($T_{z1}$ and $T_{z2}$)
  3. Calculate $C_f=T_{z1}/R_f$
  4. Calculate $C_n=(T_{p1}-T_{z2})/(R_f || R_g)$ 
  5. Calculate $R_n=T_{z2}/C_n$

Saturday, March 13, 2021

Audio Amplifier Feedback - Lag Compensation

This post is a part of the series on audio amplifier feedback. The contents of the series can be found here.

Lag compensation involves an RC network connected between the inputs of an opamp:


It may be a bit difficult to understand, as feedback reduces the voltage across the compensation network, and thus reduces the effect of that network on the closed loop response. 

For the loop gain, however, lead-lag compensation does make a difference. Consider the following schematic: 
From the point of view of the feedback signal, the compensation network $R_N C_N$ is connected in parallel to $R_I$ and modifies the transfer function of the feedback network as follows:$$B={Z_I \over {Z_I + Z_F}}={{R_I \over {R_I + R_F}} \times {{s R_N C_N +1} \over {s (R_N + R_I||R_F)C_N +1}}}$$
The compensation network adds to the loop gain a pole at $\omega_p = {1 \over {(R_N + R_I||R_F) C_N}}$ and a zero at $\omega_z = {1 \over {R_N C_N}}$; note that $\omega_p < \omega_z$ (green is the forward gain of the amplifier, blue is $1/B$):

The loop gain is reduced by 3dB at $\omega_p$ and keeps falling until the zero cancels the effect of the pole, including the extra phase lag. The crossover shifts to a lower frequency, where the phase lag is smaller, increasing the phase margin (here, green is the loop gain without compensation, blue is the loop gain with lead-lag compensation):
The net effect of lag compensation is a reduction of the loop gain at higher frequencies without the phase lag that would normally be associated with such a reduction.

Compare lag compensation to dominant pole (e.g. Miller) compensation with the same bandwidth (green is the loop gain without compensation, blue - with lead-lag compensation, red - with dominant pole compensation):

Lag compensation allows more loop gain at lower frequencies while providing a very similar phase margin. Due to the finite gain of the amplifier, the closed loop frequency response with lead-lag compensation (blue) is slightly different from that with a dominant pole (red):

Sometimes in the lead-lag compensation network, either R of C is omitted. If R is omitted and C is left alone:
the feedback network transfer function becomes $$B={Z_I \over {Z_I + Z_F}}={{R_I \over {R_I + R_F}} \times {1 \over {s (R_I||R_F)C_C +1}}}$$ There is no zero anymore to compensate for the additional pole, and for stability, a zero would usually need to be introduced separately:

If C is omitted and R is left alone:
then the feedback network transfer function becomes $$B={Z_I \over {Z_I + Z_F}}={{R_G \over {R_G + R_F}} \times {R_1 \over {R_1 + R_G||R_F}}}$$ Since ${R_1 \over {R_1 + R_G||R_F}}<1$, the loop gain is decreased across all frequencies.

Useful links:

Saturday, March 6, 2021

Audio Amplifier Feedback - Rate-of-Closure

This post is a part of the series on audio amplifier feedback. The contents of the series can be found here.

Earlier in this series of posts, I showed that the loop gain is the product of open loop gain $A$ and the feedback network gain $B$: $LG = A \times B$:


If one plots the magnitudes $|A|$ and $|{1 / B}|$ on a logarithmic scale, the difference between these two plots corresponds to the loop gain magnitude: ${{|A|}_{dB}} - {{|{1 / B}|}_{dB}} = {{|LG|}_{dB}}$:

The crossover point where the two plots meet, and where the magnitude of the loop gain becomes unity (or 0dB), is important for the circuit's stability: if the phase lag around the feedback loop reached 180°, the circuit becomes unstable. The difference between the phase lag and 180° is the phase margin $\phi_m$:

Here, the phase margin is negative and the circuit is unstable. One of the objectives of compensation is to keep the phase margin sufficiently positive. A practical requirement is to keep the phase margin of at least 30° in the range of frequencies where the magnitude of loop gain is between 10dB and -10dB.

Rate-of-closure or ROC is a tool to estimate the phase margin from the logarithmic plots of $|A|$ and $|{1 / B}|$. ROC is defined as the difference between the slopes of the $|{1 / B}|$ and of the $|A|$ curves at the crossover frequency. Once we know the ROC, we can estimate the phase margin as $$\phi_m=180° - 4.5 \times ROC$$ where $\phi_m$ is in degrees and ROC is in dB/decade. In the example below, ROC 1 is about 45 dB/decade, so $\phi_m$ is about $180° - 4.5 \times 45 = -25°$. ROC 1 is about 25 dB/decade, so $\phi_m$ is about $180° - 4.5 \times 25 = 65°$:

A more detailed discussion of rate-of-closure can be found in this excellent article by Sergio Franco.

How does this concept apply to the lead compensation discussed in my last post? Let's take the above example and add a lead compensation capacitor, which introduces a pole-zero pair into the feedback network transfer function $B$. If the crossover point falls between the pole and the zero, where the $|1/B|$ curve slopes down, ROC decreases, indicating a higher phase margin:

Here, ROC 1 is about 35 dB/decade, indicating $\phi_m$ about $180° - 4.5 \times 35 = 20°$ (compare to -25° without the compensation capacitor).

If the compensation capacitor is too small, $|1/B|$ curve slopes down at the frequencies higher than the crossover, the ROC remains high, and the phase margin remains low:

If the compensation capacitor is too large, $|1/B|$ curve slopes down at the frequencies lower than the crossover, returning to horizontal at the crossover point. Again, the ROC remains high, and the phase margin remains low:

That is, as stated in my previous post, the value of the lead compensation capacitor is critical. If it is too high or too low, it will not improve the phase margin.