## Friday, February 26, 2021

### Audio Amplifier Feedback - Lead Compensation

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

So far in this series of posts, I have been looking at shaping the loop gain of an amplifier by modifying its forward gain $A$:

Although I only scratched the surface of that topic, let me move to the gain of feedback network $B$.

Consider a hypothetical amplifier from my earlier post with three poles at 1kHz, 1MHz and 20MHz inside a feedback loop setting the ideal closed loop gain at 20dB:
As discussed in that post, the amplifier's accumulates just under 180 degrees of phase lag at the frequency where the loop gain is unity (crossover frequency), its phase margin is close to zero, and the amplifier is on the verge of becoming a generator:
Connect a small capacitor in parallel to the feedback resistor:
Although the forward gain (green curve) does not change, the ideal closed loop gain (the inverse of the feedback network's gain, blue curve) now has a kink:
Compare the loop gain with (brown curve) and without (red curve) the capacitor:
The capacitor extends the bandwidth from 4.4MHz to 6.7MHz and improves the phase margin from zero to 43 degrees. This is called lead compensation. Intuitively, the capacitor "speeds up" the feedback loop - extends its bandwidth and compensates some of the phase lag introduced in the forward path $A$.

Unlike dominant pole (e.g. Miller) compensation, lead compensation does not affect the loop gain at low frequencies, so there is no tradeoff between stability and loop gain, definitely a positive. On the other hand, where dominant pole compensation decreases the amplifier's bandwidths, lead compensation extends it, which may be problematic. As the zero-loop-gain frequency increases, high frequency poles add to the phase lag, the impact of parasitics increases, the variations in the parameters of parts with voltage and current become more important, the construction of the amplifier requires more attention, and so on.

The analysis of lead compensation can be found in many, many sources, such as Op Amps for Everyone by Ron Mancini, Operational Amplifiers: Theory and Practice by James K. Roberge, or this Burr-Brown application bulletin. The gist of it is that with the compensation capacitor, the loop gain becomes: $$LG=A \times B=A {R_2 \over {R_1+R_2}}{{s R_1 C + 1} \over {s(R_1 || R_2)C+1}}$$ The capacitor introduces a zero at $\omega_z={1 \over {R_1 C}}$ and a pole at $\omega_p={1 \over {(R_1 || R_2) C}}$; note that $(R_1 || R_2) < R_1$, so $\omega_z < \omega_p$. For the schematic above, the zero is at 2.85MHz, and the pole is at 28.5MHz.

Textbooks say that the properly placed zero should cancel one of the amplifier's poles. The reality is more complex. First, lead compensation only works when the crossover frequency (where the loop gain become unity) occurs between the pole and the zero:
That is, the value of the lead compensation capacitor cannot be chosen arbitrarily. While increasing the Miller compensation capacitor always improves stability (at the cost of reduced loop gain), the lead compensation capacitor must have just the right value. Too much or too little won't improve the phase margin. In addition, too large a capacitor will still extend the bandwidth, bringing all the associated costs but no benefits of better stability.

Second, in a real circuit, selecting the value of the compensation capacitor is even more difficult because the forward gain and the crossover point are not fixed. With the signal, the parameters of various components change, the crossover point moves, and the lead compensation may become ineffective.

Third, a limitation specific to the lead compensation with a single capacitor is that, for a given closed-loop gain, the pole and the zero cannot be placed independently: $${\omega_p \over \omega_z}={{R_1 C}\over{(R_1 || R_2)C}}={R_1\over{R_1 || R_2}}={{R_1+R_2} \over R_2}={1+{R_1 \over R_2}}$$
That is, the zero and the pole are separated by a factor equal to the amplifier's ideal closed loop gain at DC as set by the feedback network. For an amplifier with 20dB gain, the pole will always be a decade higher than the zero. This fixed relationship is not always convenient.

The workaround for that last problem is to add a resistor in series with the capacitor:
The loop gain becomes $$LG=A {R_2 \over {R_1+R_2}}{{s (R_1 + R_3) C + 1} \over {s(R_1 || R_2 + R_3)C+1}}$$ and allows placing the zero and pole independently. In this example, the capacitance was decreased slightly to keep the zero at 2.85MHz, but the pole now is at 15MHz, not 28.5MHz as before.

Another version places the resistor differently:
but achieves a similar result: $$LG=A {R_2 \over {R_1+R_2+R_3}}{{s R_1 C + 1} \over {s(R_1 || (R_2 + R_3))C+1}}$$ Here a slightly higher capacitance was chosen to compensate for the smaller $R_1$ and keep the zero at 2.85MHz. The pole is at 14.3MHz.

## Saturday, February 20, 2021

### Audio Amplifier Feedback - LTP with LR compensation

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

Since my previous post was about shaping the open loop gain of a long-tail pair (LTP) with an RC network across the load, it seems to be a convenient moment to talk about LR compensation of an LTP:

The compensation network consists of an inductor $L$ in series with an optional resistor $R$, connected between emitters of the differential amplifier. Intuitively, at low frequencies where the impedance of the $RL$ network $Z_{RL}=R+sL$ is low compared to $R_e$, the $RL$ network reduces the degeneration added by $R_e$ and increases the transconductance of the LTP. At high frequencies, where $Z_{RL}$ is high compared to $R_e$, the $RL$ has little effect, and the LTP is degenerated by $R_e$:
To find out exactly how the transconductance changes in between these two extremes, I need to consider the small signal equivalent emitter circuit of the LTP:
Here, $r_e = {V_T \over I_E}$ is the emitter intrinsic resistance. The transconductance of the LTP with $RL$ compensation is $$g_m={1 \over {2 r_e+(R+sL)||(2 R_e)}}={{sL+(R+2R_e)} \over {2(R_e+r_e)(sL+R+2(R_e||r_e))}}$$ and has a pole at $s=-{{R+2(R_e||r_e)} \over L}$ and a zero at $s=-{{R+2R_e} \over L}$.

For example, the Bode plot above was generated with $R_e=220 ohm$, $R=0ohm$, $L=100 \mu H$ and $r_e={V_T \over I_E} = {{25mV} \over {1mA}}=25ohm$. With these values, the pole is at $s=-{{R+2(R_e||r_e)} \over L} = -{{0+2(220||25)} \over 10^{-4}} \approx -450k$, or $71.5kHz$, and the zero is at $s=-{{R+2R_e} \over L} = -{{0+2 \times 220} \over 10^{-4}} = -4.4M$ or $700kHz$.

One word of caution is that low $R$ in the $LR$ network undoes the degeneration added by $R_e$ and thus makes the LTP more susceptible to overload and nonlinearity, as discussed in the post of input stage linearity. The intended outcome is, of course, that the extra transconductance available with low $R$ increases loop gain, which reduces the differential input voltage seen by the LTP and improves its linearity. However, depending on the specific implementation, the loss of degeneration with low $R$ may become problematic.

Another potential problem is that the inductor is an effective antenna and will increase inductive coupling of noise from e.g. power supply rails into the LTP. The standard remedy is to use a shielded inductor and/or use two inductors in series connected in anti-phase, so that noise coupled into one is cancelled by the other.

## Tuesday, February 16, 2021

### Burning Amp BA-3b (Balanced) Updated Power Supply

In my previous post of the Burning Ampifier 3 Balanced, I mentioned that I replaced the CRC filters in the power supply with 100mF + 10mH + 100mF CLC filters per rail per channel. Here are some pictures of the new power supply:

From left to right, you can see two toroidal power transformers with a soft start mounted on top; four bridge rectifiers; first four capacitors, one per channel per rail, with their discharge resisotrs; four chokes; the other four capacitors; and the PCBs with the from ends, mounted on the rear wall of the chassis. On the far side, there are six pairs of power MOSFETs mounted on a heatsink. Here is a close-up shot showing how the capacitors and chokes are mounted:

The capacitors are Vishay/BCcomponents MAL2 101 16104, chokes are Hammond 159ZJ. The power transformers are from Antek.

## Saturday, February 13, 2021

### Audio Amplifier feedback - LTP with Frequency Dependent Load

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

In a number of previous posts, I looked at shaping the gain of a simple common emitter stage by applying frequency dependent local feedback. Local feedback, however, is not the only available gain-shaping tool. Another commonly used way is to add frequency dependent load.

Consider a simple long tail pair (LTP):

The analysis of the LTP can be found in many places online; my favorite is the ECE 3050 class notes by Marshall Leach. For small signals, the LTP is essentially a voltage dependent current source with transconductance $g_m={1 \over r_e} = {I_E \over V_T} = {I_{LTP} \over {2 V_T}}$ loaded with $R_1$ and $R_2$:

Clearly, by making $R_1+R_2$ frequency dependent, the gain $${v_o \over v_{diff}} = {{v_{C1}-v_{C2}} \over v_{diff}} = {{v_{diff} \times g_m(R_1+R_2)} \over v_{diff}} = g_m(R_1+R_2)$$ can also be made frequency dependent. For example, one can connect an RC network across $R_1+R_2$:

This modifies the load impedance from $R_1+R_2$ to $${(R_1+R_2)||({R_c+{1 \over {s C_c}}})}={(R_1+R_2){{(s R_c C_c+1)} \over {s(R_1+R_2+R_c)C_c+1}}}$$ with a zero at $\omega_z={1 \over {R_c C_c}}$ and a pole at $\omega_p={1 \over {(R_1+R_2+R_c) C_c}}$.

With the values shown, the zero is at 1.6MHz and the pole is at 2.65kHz (blue trace); for comparison, the green trace shows the response of the same LTP without the RC network:

In principle, the input impedance of the next stage (e.g. a common emitter amplifier) should be included into the calculation as connected in parallel to $R_1$ and/or $R_2$. That does not affect the zero, but the position of the pole can be more difficult to find. Note that the input impedance of a typical second stage of an audio amplifier with Miller compensation falls with frequency and can be quite low, pushing the pole to a higher frequency. This usually is a desirable outcome as it limits the phase lag introduced by the pole within the amplifier's bandwidth.

If the LTP is loaded not with resistors but with a current mirror, the formulas above still hold if you use the actual load impedance instead of $R_1+R_2$. The load would include the input impedance of the next stage in parallel with the output impedances of the differential pair itself and of the current mirror. For higher load impedance, the pole moves to a lower frequency. At the limit, if the differential pair is a pure current source with infinite output impedance, and the RC network is its only load, the pole appears at $w_z=0$.

## Saturday, February 6, 2021

### Audio Amplifier Feedback - NCore style compensation

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

After analyzing the two-pole compensation scheme with the C-R-C "T" network, it became clear that compensating an audio amplifier is not just about ensuring stability, but about shaping (usually maximizing) the loop gain in the audio range of frequencies. This can be achieved in many different ways, and here is another one.

At the 131st AES convention in 2011, Bruno Putzeys presented a paper titled High-Order Analog Control of a Clocked Class-D Audio Amplifier with Global Feedback Using Z-Domain Methods, discussing the details of then-new Class D amplifier technology, marketed by Hypex under the trade name NCore. An NCore amplifier has an analog control loop with five poles, one real plus two complex pairs. One pair comes from the LC output filter, and the others come from the following circuit:

An opamp is enclosed in a local feedback loop, part of which is the same C-R-C "T" network that is used in the two-pole compensation scheme. $R_f$ and $C_f$ add another pole-zero pair, and the transfer function of the whole circuit has the following form:
$$H(s)={v_o(s) \over v_i(s)}={A \over s}{(s+\omega_{z1})(s+\omega_{z2}) \over {s^2+{\omega_0 \over Q}s+\omega_0^2}}$$where $\omega_{z1}={1 \over {R_f C_f}}$, $\omega_{z2}={1 \over {R_t (C_1 + C_2)}}$, and $\omega_0=\sqrt{1 \over {R_f R_t C_1 C_2}}$.
That is, it includes an integrator (pole at $\omega=0$), zero at $\omega_{z1}$, a pair of poles with the corner frequency $\omega_0$, and another zero at $\omega_{z2}$, in this order. The positions of all poles and zeros can be chosen freely, although some values may be impractical given the parasitics.

For example, with the first zero at 72Hz, the pair of poles at 46kHz, and the second zero at 720kHz, the Bode plot looks like this:

Light blue is the Bode plot of an amplifier with NCore compensation network around its second stage. The gain set by the global feedback is the blue trace. As in previous posts, for comparison are also shown the same amplifier uncompensated (green) and with two-pole compensation (red).

This compensation network keeps the loop gain at about 55dB in the audio range of frequencies. (As I posted earlier, some experts believe that a flat loop gain across the audio range has a more palatable sonic signature compared to that of the loop gain falling at higher frequencies.) As the frequency increases beyond the corner frequency of the pole pair, the loop gain falls, first at 40dB/decade, then at 20dB/decade, ensuring sufficient phase margin and thus stability.