Compensating the PG508

I got it to work and amplify, but the loop gain left a lot to be desired, so I decided to start over on the compensation. I also hooked up an unregulated power supply and a different output stage, partly because I wanted to see how the PSRR was doing, and partly because I wanted to reassemble the Ice Block with its original driver board.

It survived πŸ™‚

Now, you should never anthropomorphise amplifiers, they hate it! I swear that this one “wants” to blast electronic music from the 90s at high volume though. πŸ™‚

Found this in my junk pile, retro or what πŸ™‚

Having given the Ice Block its output stage back, I had to find another one for my experiments. A search of the junk pile yielded the remains of a Maplin 100W MOSFET amp kit. I’d have preferred to try BJTs, but the PG508 prototype was already set up to work with lateral MOSFETs.

Put it together and what have you got?

I tried the time-honoured method of soldering RC networks in random places, or maybe places that seemed to make a difference when touched with a damp finger. πŸ™‚ This improved it somewhat, but it still wasn’t doing a great job of correcting the output stage’s copious (and vintage correct!) crossover distortion.

Cordell to the rescue!

I eventually cracked Bob Cordell’s “Designing Audio Power Amplifiers” and spent an afternoon pondering Chapter 9, “Advanced Forms of Feedback Compensation”. It struck me that the PG508 topology is very similar to figure 9.7, except that the input stage doesn’t exist as such: the feedback node is the VAS input.

It also struck me that I’d already ended up with RC networks in the places shown in fig. 9.7 by trial and error, just with completely different values. R4 and C2 were in the original Tektronix PG508, and R5 C3, R3 C1 were my additions. So the obvious course of action was to change them to the values suggested by Cordell and see what happened.

Initial results weren’t great: it oscillated at 20MHz, but this was squelched by reducing R4 to 51 ohms. Having done this, performance was excellent: the 16pF C1 gave the extra loop gain I was looking for. I’d started out with 100pF here as that’s the value used in a Douglas Self Blameless amp. The Blameless input stage typically has 5-10x the gm of the PG508’s non-existent IPS, though. So funnily enough C1 needs to be 5-10x smaller to get comparable loop gain.

With these modifications the measured performance was 0.03% THD at full power at 10kHz, and 0.00something at 1kHz. The 10kHz figure seems high, but it’s now in the ballpark for a well functioning driver doing its best with a vintage MOSFET output stage. (Cordell’s AES paper quoted 0.02% at 10kHz with the Hawksford error correction turned off.)

Note that this THD figure is no better than I got with the old compensation and the Ice Block output stage. This just means that the Ice Block output stage must have about 3-5x less distortion than the single 2SK135/2SJ50 pair used here.

Slew rate was also improved, and stability with a capacitive load was just about acceptable: with 0.1uF slapped on the output it showed a few cycles of damped ringing but didn’t oscillate.

The circuit at the end of a hard day of soldering capacitors at random (and trying to find a LM317 or 7912 : ) )

I also took the opportunity to test out the opamp front end inspired by the Quad 405 and Cordell Super Gain Clone. I used an OPA2604 as it was the best opamp I had around. This works very nicely: it reduces the DC offset to 2mV, undoes the phase inversion inherent in the PG508 circuit, and increases the overall gain from 10 to 50.

Note that the opamp must be a FET input type because of the high impedance of the DC feedback path. Also, as the circuit has 2 LF time constants (the 1M/1u and the 47k/2u) with feedback around them, it functions as a 2nd order active high pass filter. It rolls off at 12dB/octave and can resonate if the time constants are too close together.

I basically copied this part from the Quad 405, so it must have done the same thing. I guess it was desirable to have a good rumble filter here in the days of vinyl. Arguably it still is in the era of small vented speaker cabinets and dubstep. πŸ™‚

PG508 audio amp part 2

I was so excited (honestly 8) ) about the idea of a PG508-based audio amp that I decided to try building it in real life.

Fig.1: This is what I made

I first tested the driver circuit with +-15V supplies, no output stage and pure dominant pole compensation. It oscillated happily at 6MHz, and to get it stable I had to go back to the original PG508 lag compensation network (the 51 ohm and 8n2) The back-to-back diodes helped the clipping behaviour: without them you can reverse bias the cascode transistors and burn out the LEDs if you really overdrive it.

Fig.2: DIY heatsinks for SOT-223 transistors

In the interest of getting something working quickly, I hooked it up to the output stage and power supplies of my ancient and long-suffering Ice Block amp, which conveniently happened to be partly dismantled with one driver board missing. It provides regulated +-65V and +-15V rails in addition to the main +-53V, so no worries about PSRR for the time being.

Fig.3: The heatsinks weren’t quite big enough.

To achieve stability with the Ice Block’s hefty lateral MOSFET output stage in the loop (2 pairs of double die Exicon FETs) I had to use both the original PG508 compensation and dominant pole compensation with an extra zero (the 1k and 100pF).

I think it’s a bit temperamental because there are 3 transistor stages in the loop enclosed by the dominant pole capacitor. The Douglas Self Blameless only has 2, and my previous attempts at adding a third stage to that (cascode connection of Cdom) also caused oscillations at a few MHz.

As with any half decent solid-state amp, THD+N was at the limit of my measurement system at 1kHz, and dominated by noise. I had to go to full power at 10kHz to see a meaningful distortion residual.

Fig.4: THD result at 10kHz, 100W into 9.4 ohms
Fig.5: Distortion residual at 100W, 10kHz. (Fancy scope on loan from work πŸ™‚ )

The distortion appears to be what Douglas Self called “gm-doubling”: in a push-pull circuit the gain is higher when both halves of the circuit are contributing, than when one half is cut off. And in the residual we see small lumps corresponding to increased gain around the zero crossings. I’m not entirely sure what part of the circuit is causing it. It may be the output stage, as that’s the usual culprit. It looks like it wants less bias, but the bias pot won’t go down any further. (Got to replace that TL431 with a TLV431)

I also tested the full power bandwidth, and it happily delivers 100W to 100kHz and beyond. I didn’t push it beyond 130kHz for fear of burning out the Zobel network.

A reading of 0.025% at 100W and 10kHz, with no filters engaged, is not to be sneezed at. I’d be perfectly happy with it, except the other un-hacked channel of the Ice Block does 0.009%! The PG508 circuit has some way to go before it can beat the original Alexander CFB.

While I had the equipment out, I also tried measuring distortion with a LF411 in place of the SSM2131 in the Alexander circuit. It made no noticeable difference at any power level, even though I’d persuaded myself that the LF411 sounded bad…

Tek PG508 output stage as audio amp

I recently came across this gem in the X Chapters supplement to the Art of Electronics 3rd edition. (Not reproducing here because of copyright. You need to buy the book anyway, it’s brilliant πŸ˜‰ )

Fig. 1: Tek PG508 nifty folded cascode with audio power amp output stage duct taped on.

Of course my first idea was to convert it to dominant pole compensation (C2) and bodge a standard audio power amp output stage onto it.

This worked very nicely in simulation, so the next step was to slap on an opamp front end ala Quad 405 or Cordell Super Gain Clone.

Fig.2: opamp adds voltage gain and functions as DC servo

The resulting circuit should give a lot of bang for the buck when used with a good quality FET input opamp. I expect it to outperform the Alexander CFB design in areas that matter, like HF THD, PSRR, playing well with the standard Bailey current limiter circuit, and not depending on an obsolete opamp or catching fire when overdriven.

This is a voltage feedback design, not current feedback, and won’t beat the Alexander’s slew rate without running the transistors at crazy idle currents. Besides being CFB, the Alexander driver circuit operated in Class AB and could call on arbitrary amounts of current when slewing was required. The price it paid for this was catching fire when overdriven πŸ™‚ and also crossover distortion generated in the opamp’s output stage, which is very audible if you use any other opamp than the original SSM2131. (And kind of audible even with the SSM2131 imo…)

So overall I am happy with this set of compromises and looking forward to trying it out in real life.

A new input stage for the Blameless?

Regular readers will know that I’m a fan of Douglas Self’s Blameless philosophy of audio power amp design. (An uncontroversial choice, as the Blameless topology is not really that different to designs you would have seen in Wireless World in the 1970s, or indeed the innards of Bob Widlar’s opamps.)

Probably the biggest problem I have with the Blameless is the huge bias and offset currents at the inputs, which require a low resistance feedback network to avoid a huge DC offset at the output. This sets off a chain of design compromises and ultimately the carbuncle of C1 and D9 (Fig.1) pops up.

In my previous experiments I tried a matched pair for the input stage, but it made absolutely no difference. The collector currents aren’t necessarily matched, so neither will be the base currents. The biggest improvement was had by using high beta input transistors such as the now-obsolete BC213C. (MMBT5087 would be a suitable 21st century replacement.)

Fig.1: My original Blameless driver board

Revisiting this, I discovered that my first attempt at building it was badly unbalanced because of the clip detector (Q14 in fig 1) which robs a lot of base current from Q9. The other side of the mirror has Q12 robbing from it, but Q14 takes much more as it’s a high voltage part with low beta.

Fig.2: Improved version (complete model amp in LTSpice)

By adding a beta helper transistor to the input mirror (Q14 in fig 2) the imbalance due to base currents can be eliminated. The beta helper’s base current is drawn from one side of the mirror, and the base current of the Darlington VAS (Q2, Q17) comes from the other side. By setting R15=R7, Q2 and Q14 will run at the same collector current, so if they are matched for beta, their base currents will also be the same, and the whole input stage will be perfectly balanced to a first order.

(It’s not balanced to a second order because the current drawn from Q14 emitter by Q8-Q11 bases isn’t necessarily the same as that drawn from Q2 by Q17 base, but the imbalance due to this should be tiny. The clip detector can now be hung off Q8, Q9 bases with impunity. 2 transistors are now used to get a 2:1 ratio as required for balance with the current sourced by Q3. I used the same type of transistors as Q8, Q9 for improved balance, so a cascode Q23 is now needed because of their limited voltage rating.)

The other side of the problem was limited beta in the input stage. One of the pillars of the Blameless philosophy is to run the input stage at a high current to give it lots of gm, which you then throw away with emitter resistors. The goal is good slew rate, and the price paid is the high input bias currents.

We attacked the input offset current issue by improving balance of the collector currents (and hence base currents) but if we could reduce the input bias current too, the offset current would decrease still further in proportion.

A promising approach seemed to be replacing the input transistors for Sziklai pairs. (Q6, Q15, and Q7, Q16 in Fig 2.) Now the actual input transistor Q6 can run at a low current (300uA in this case) while Q15 conducts the remainder of the high current needed for decent slew rate. We have a double win because the Sziklai pair is more linear than a plain transistor.

Adding more and more transistors inside a feedback loop is always dodgy, and running one of them at low current where its Ft will be reduced especially so. In this case though, I think the bandwidth will still be adequate. The whole mess is cascoded by Q12, Q13, so there will be no Miller effect to slow Q6, Q7 down. The degeneration from R5, R6 should also help to stabilise things.

The LTSpice simulation of this showed an overall DC offset of 20uV, a huge improvement on my previous Blameless driver board. Of course this is with perfectly matched virtual transistors, but I think the real thing will do pretty well when built with BCM846/856 matched pairs. They specify Vbe to be matched within 1mV, and (what really matters for this circuit) beta to be matched within 10%, which works out at a 100nA worst case input offset current.

The overall result is that the DC offset and clip indicator trims from my original design can be done away with, and the impedances in the input and feedback networks can be increased by a factor of 10, for the same worst case DC offset of about 10mV at the speaker terminals. This means that C1 the obnoxious 1000uF electrolytic can be replaced by something more audiophile grade: the same 10uF plastic film capacitor that used to be the input DC block.

This is what the simulation says, so now I have to build one and see if it works in real life… πŸ™‚

Wolfson Pi Audio Card – first impressions

Ever since the Raspberry Pi came out, I’ve been experimenting with its audio capabilities. The latest audio gizmo available for it is the Wolfson Pi Audio Card, which promises 24 bit, 192kHz recording and playback, with analog and digital I/O, for a very reasonable price. So of course I ordered one straight away. πŸ™‚

After waiting a month I finally got my hands on it. The software installation is somewhat unclear so I will document what I did here. I didn’t want to use the Wolfson official image as it was a massive 8GB download. I started with a copy of the image that I developed for PiTunes, and applied this patch to it, which adds the Wolfson kernel and the support files for the audio card. I then changed mpd.conf to use audio output device hw0,0 (it was previously 1,0 for the USB audio device) and added a call to SPDIF_playback.sh in my .bash_login file, to set the card up for digital output.

I also removed the invocation of pikeyd from /etc/rc.local, as the keypad and encoder were not present. They can’t be used anyway, since the Wolfson audio card hogs all of the GPIO pins. It doesn’t really matter, as MPD can always be controlled remotely.

On firing this up, I was surprised to find that it worked first time! πŸ™‚ I verified the output to be bit perfect at 24 bit, 96kHz. This is possibly the best value for money HD audio source you can get anywhere: you should be able to pick up a Raspberry Pi, a Wolfson Audio Card, a wifi dongle and a hard disk for under Β£100.

Current dumping for dummies?

This article (series of them with any luck) is inspired by Nick de Smith’s Quad 405 project. He was getting better distortion figures than my Blameless build: 0.002% at 20kHz! And from an amp that operated in Class-B and needed no bias adjustment or thermal compensation, how could this be? I had tried to understand the current dumping concept before, and failed, but this time I was determined!

And this time I had some help from Keith Snook’s excellent resource on the Quad amps. His series of “DCD Mods” to the original Quad circuit actually make the operating principle clearer. And, he had a copy of the classic Wireless World article: “Current dumping – does it really work?” by Lipshitz and Vanderkooy.

So here is a simple, intuitive (and maybe even correct? πŸ™‚ ) explanation of how current dumping works. Please refer to Snook’s DCD Mod-3 schematic, as well as the diagrams below, in which I’ve reduced the circuit to the bare minimum possible.

Current dumping amp simplified

You can see that the amp consists of three parts. First, a Class-A, current feedback error amp. In the DCD Mod-3 circuit, the inverting input of this amp is TR2 emitter, the non-inverting input is TR2 base, and the output is TR7 collector.

Second, a hefty Class-B output stage that runs with no idle current. In the DCD Mod-3 this is TR8, TR9, TR10 and associated parts.

Third, what Nick de Smith referred to as the “Maxwell-Wien Bridge”. This is obvious in the DCD Mod-3 schematic. I’ve drawn it in the same way here, but I’ve labelled the components Z1, Z2, Z3, Z4 in accordance with Walker and Albinson’s original analysis.

Then, to make things a little clearer, I’ve drawn the circuit again, but replaced Z2 and Z4 with resistors, of values roughly equivalent to their reactances at 20kHz.

We’re now in a position to see intuitively how the circuit works. The error amp is looking at the output from the output stage, fed back to its inverting input through Z1,Β and comparing it to the desired audio signal on its non-inverting input. It amplifies the error by a factor of -(Z2/Z1) which is -100 in my circuit. This amplified error drives the output stage, like in any normal audio amplifier. But a portion of it is also fed forward directly to the speaker through Z3. This forms a potential divider with Z4, so the speaker sees the fed-forward signal attenuated by a factor of roughly Z3/Z4, which is 100.

So, the error got amplified by -100 and then attenuated by 100 again. It follows that the error gain to the speaker is just -1. In other words, an equal and opposite signal cancelling the original error, to give a perfect output. So, we’ve rederived the original Walker balance condition: Z2/Z1 = Z3/Z4, or Z1Z3 = Z2Z4 as Walker wrote it.

(I’ve taken some liberties with a “1” here and there: the potential divider really attenuates by a factor of 101. But so did Walker and Albinson and everyone else. I’ve also assumed that the output stage’s output impedance is negligible, and its input impedance is high enough not to load the error amp down and kill the feedforward signal. Again, I believe these assumptions were also made in the Quad 405 design.)

However, as every amplifier geek knows, Z2 is a capacitor and Z4 is an inductor. In fact, I remember Quad’s full page ads in the hi-fi press, that showed nothing but a picture of the inductor and the Queen’s Award logo.

Intuitively, what now happens is that the error amp integrates the error, but Z3 and Z4 are now a high-pass network that differentiates it again, so the feedforward works just the same as if Z2 and Z4 were resistive. But using reactances leads to some elegant synergies: each one ends up doing at least two good things at once, hence presumably the Queen’s Award.

Using a capacitor for Z2 gives classic dominant pole “Miller” compensation for the error amp, with all the associated benefits.

Using an inductor for Z4 saves power, isolates the output stage from nasty capacitive loads, and low-pass filters the remaining distortion harmonics.

Indeed, Z2 is the compensation cap, and Z4 the output coil, that most classic power amp designs need anyway. The only component that a classic amp doesn’t have is Z3. This suggests to me that an ordinary amp could be converted to a current dumper by just adding a resistor from the driver stage through to the speaker end of the output coil. (It also suggests that Quad’s ads should have showed a 47 ohm resistor instead of an inductor.)

A current-feedback amp with a hefty driver, like the Alexander, seems like it would be the best candidate, but I think it should be possible with a “Blameless” type voltage-feedback circuit, too. The only complication is that when you go to voltage feedback, Z1 isn’t a single resistor any more. Its effective value, as far as bridge balance is concerned, is the attenuation through the feedback network, divided by the input stage transconductance.

I could be wrong, but if this is true then the usual Blameless values give a value for Z1 of about 2500 ohms. That means the output coil would need to be 5 times bigger, or Z3 5 times smaller. That makes it 8 ohms, so in order to drive it, the error amp becomes an output stage and we’re back to square one! So, the Alexander is a much more attractive candidate for conversion, as it has Z1 = 750 ohms and Z2 = 100pF, giving a value for Z3/Z4 similar to the Quad 405.

I’ll leave you with a puzzle: In the DCD Mod-3 circuit (and indeed every other Quad 405 circuit) what are D5 and D13 for?

Cordellicious results

So, the low distortion oscillator is all put together.

Oscillator innards.

And it works very nicely.

Oscillator working, whee

When the oscillator output is connected straight to the analyser input, it reads around the analyser’s specified floor (0.0021%) between 20Hz and 20kHz. The above picture shows 0.0017% at 1kHz with the 80kHz low pass filter engaged.

I took it home and used it to test my new Selfless Amp against the old Ice Block. The “Selfless” was somewhat degraded from its earlier bench test results because of hum induced by the transformer, but it still managed around 0.002% at 1kHz and 0.008% at 20kHz. (Both about 70W into 8 ohms: the readings at lower powers were inflated by the hum, and noise from the preamp.) The Ice Block couldn’t match this with 0.005% at 1kHz and 0.015% at 20kHz. In fact, one of the channels had 0.3% and whacking the amp made it jump around frantically. (The distortion reading, not the amp itself! :p) Turned out the speaker relay was bad, which gives me an idea for another project…

Cordell oscillator success

Well, the Cordell low distortion oscillator worked a treat! It didn’t work right away: I left a connection out of the PCB. And then I didn’t have a TL074 chip, so I tried a LMC660, and the chip blew up for some reason, which had me puzzled.

(I just checked the LMC660 datasheet: It’s specified for 15V total supply voltage. I fed it +/-16, a total of 32V. Whoops.)

Then, Cordell’s schematic calls for a 2N4091 JFET, a device with a high Idss and low on-resistance, but I couldn’t find any of those. I tried a BF245C, but it wasn’t strong enough. The AGC loop just whacked the gate as far positive as it could go, trying to turn the JFET “more than full on”. So I kept adding more of the things in parallel, until I saw the AGC go negative by a volt or two. I ended up with 5 of them, bodged onto a piece of stripboard.

A J111 would probably have been a better choice. These are the ones Douglas Self recommends as analog switches in “Self On Audio”, and they have a similar 30 ohm Rds(on). JFETs are so variable, though, you never know what you’ll get.

Frequency control with the “Blue Velvet” pot works great! There’s no noticeable amplitude bounce. Well, except for the fact that it’s backwards: anticlockwise to increase. I couldn’t see any easy way to dismantle the pot and reverse the action.

And, first time on the distortion analyser: 0.0015% at 1kHz! πŸ™‚ That’s better than the analyser’s own spec.

Stay tuned as we post some pics and stuff the thing into the spare bay of the DA4084.

Blameless finished!

Here it is, pretty much done! The weather was pretty bad this weekend, so I spent most of it in the workshop, wiring everything up.

Besides the stuff I’ve already written about, there is a soft-start module (built rather messily on a tagboard), and a preamp/protection PCB. This contains Douglas Self’s anti-thump and DC offset protection circuit, a thermal cutout circuit using the spare diodes in the ThermalTrak power transistors for junction temperature sensing, and a balanced line input stage using the INA137 and NE5532.

Here are some pics.

Gut Shot 1

The 10kHz square wave response, just short of clipping, into a dummy load.

I’ll do some whole-system THD measurements some other time. (I broke the Williams Memorial Oscillator. πŸ™‚ )