Playing with discrete class-A opamps on the simulator

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

magicchord

Well-known member
Joined
Jun 18, 2004
Messages
79
Location
ellay
I was adding components to the basic transistor class-A opamp circuit and ended up with this:

http://tinypic.com/wp7vl

I don't know if using the 20v zener to bias the bottom output transistor is a cool way to do it, or if there's any benefit to an all-NPN output, but it does simulate all right. What do you guys think?
 
> I don't know if using the 20v zener to bias the bottom output transistor is a cool way to do it, or if there's any benefit to an all-NPN output, but it does simulate all right. What do you guys think?

The Zener should work, though I would like a base-emitter resistor on Q6 to set Zener current (real Zeners are softer than Zener models).

All-NPN seems to have little or no virtue today. I was around when you could not get complements, and on an IC it is a hang-up, but for what you are doing I see no problem with a plain NPN/PNP output.

My main concern is: what is the current in Q7 Q6, also Q8 Q5? It seems to be super-sensitive to resistor ratios and transistor betas. And as I read this (without doing math), I think the whole output stage is cut-off? And if you take R1 to 1K, the output stage quickly goes 0mA, 1mA, 1Amp, boom. Or am I mis-reading it?

If it is working in cut-off: it may handle 1V 1KHz well under feedback, but would be prone to screw-up fine music with crossover distortion, and in real life to have parasitic oscillations as the transistors go in and out of cut-off. (And it can't honestly be called "Class A", though honesty is a relative thing when using that buzz-word.)

BTW: if you do aim at true Class-A outputs and this 14VRMS 150Ω load, each 2N3053 has to dissipate 1.33 watts. If I recall, 3053 is a TO-5 package and 1.33 watts is a heavy heat burden. (Sure, you would use TO-220 TIPs on a hunk of aluminum but your simulator only has the 3053.)

I don't see why R12 R5 have to be 2 Watt. They dissipate 0.11W at full power sine, 0.22W at full power square-wave, 10 Watts if the output is shorted and there is any DC offset.

The fancy supply decoupling R3 C6 C8 may be needed/nice in real life, but probably pointless in the simulator. The cap models are "perfect", no need to shunt a physically large cap with a small cap. The resistor may be helpful for checking rail-sag under load, but 0.1R on a 150R load isn't going to sag enough to matter in practice. And if you omit the R, the cap isn't needed: simulated power supplies are "perfect" so you don't need a cap to suck-off signal-crap on the rails, or long-wire resistance and inductance.

There are commercial designs not very different from this. The general direction can work, and work well.

flickinger-S-V.gif

Someone at the other place had these. My analysis suggested large variation of bias currents with supply variation; to use them with anything but +/-24V +/-0.5V tolerance would require replacing values. Replacing the output transistors could seriously upset things (the day this was designed, there was about ONE suitable transistor, made at one TI facility, and they were pretty uniform.) And of course the long-tail (R2) limits common-mode performance. (Not a big issue for high-gain or summing use.) Note that with 24V supply, the output can't swing higher than around +20V-- that's the price they paid for decent DC bias current stability. Oh: and offset voltage could be so bad (tenths of a volt), they gave you both a DC-coupled output for feedback and an AC-coupled output to give a no-DC signal to the next stage.

JLHbasic.gif

This is an old-old idea nobody uses enough. Vin must sit at just about 1.2V, so can tap one side of a diff-pair input without much restriction of common-mode range. It works better if "R2" is a current source. The idea is that the Beta of Tr2 Tr1 is "constant". This is not true, but may be true-enough if you don't mind trimming. Pick a bias current for the output stage. Divide by Beta. Make "R2" pass double that current (two Bases to feed). Tr3 forces "R2"s current to split between Tr2 and Tr1. The total current IS constant, a necessity for Class A, assuming the Betas are equal and constant, and that R5 current is very small compared to R2 current. (In study, leave R5 out. In practice, you need it to drain away Tr1's Base leakage.) And this current-split topology is very linear where traditional Class AB stages are rough: small signals. In practice Beta rises with temperature, which increases bias current, which increases heat: runaway! But with ample sinks (and maybe a little thermal feedback) it can work fine.

There is a lot more at JLH Class-A amplifier site.
 
I learn from a page elsewhere on that website that Mr. John Linsley Hood has died this year. This is sad news. Audio circuit enthusiasts are well-advised to read his books; you'll learn a lot.
 
> I would like a base-emitter resistor on Q6 to set Zener current...

D'oh! Need more sleep. You need a base-emitter resistor for speed, to drain off stored charge on the transistor Base so it will turn-off sometime. Your plan will turn-on well, but for turn-off you simply stop putting current into the Base. Yes, the transistor won't conduct without base current, but there is charge stored in the base junction from when it was turned on. If you just put in no current at all, this charge drains through the base-emitter junction, keeping the transistor partly on. Charge decays, current drops, but as current drops the charge decays slower. It will take many many microseconds to be come negligible. Meanwhile, under feedback, the upper transistor has to supply load current, plus whatever current the lower transistor is flowing while it decays.

(In this case, a severe swing may put the Zener in "reverse bias" as its upper end falls negative of the lower Base. Most (not all) Zeners become "normal" diodes when that happens. That will suck-out stored base charge real quick. That would be valid in digital design, maybe. It is too bang-clang for audio.)

There are a few situations where a transistor can work OK without a base-emitter resistor or current sink. But rare in audio.
 
>My main concern is: what is the current in Q7 Q6, also Q8 Q5?
Well, in CircuitMaker, Q7 & Q6 have about 185ma collector current. Q8 & Q5 about 4ma.

> It seems to be super-sensitive to resistor ratios and transistor betas.
Yes, and to supply voltage being exactly +-20v.

>And as I read this (without doing math), I think the whole output stage is cut-off?
No, but the input diff pair is close.

> And if you take R1 to 1K, the output stage quickly goes 0mA, 1mA, 1Amp, boom. Or am I mis-reading it?
Taking R1 to 1k increases Q7 & Q6 collector current to 480ma, Q8 & Q5 to 7ma, and output offset goes to hell.

>If I recall, 3053 is a TO-5 package and 1.33 watts is a heavy heat burden.
Yes, they'd definitely have to have heat sinks :)

>I don't see why R12 R5 have to be 2 Watt.
Well, it's all the DC going through them that heats 'em up.

>There is a lot more at JLH Class-A amplifier site.
Yup, I'm gonna check that out fer shure, PRR. I knew this was a slightly screwy circuit. Thanx for your insight.
 
> in CircuitMaker, Q7 & Q6 have about 185ma collector current. Q8 & Q5 about 4ma.

Because R10 D3 D4 Q3 and R1 dumping up into R2 or R14 give 0.589333V across the B-E junctions of Q8 Q5, and the particular model you have will flow 4mA with that voltage. But a 3% change in Q3 current will cause a 2-times (200%) change in Q8 Q5, because the current of a BJT rises so sharply with V(be). Using real transistors instead of SPICE transistors will also give wildly different operating current, depending which device you stick in. And how warm it is.

And if Q7 Q6 flow 185mA when Q8 Q5 flow 4mA, 185/4= 46, which sounds suspiciously like the Beta of a 2N3053 working at 185mA. Or for a more precise estimate: Q9 Q4 suck out about 2mA, leaving 2mA for the Bases of Q7 Q6, and 185/2= 92, which I bet IS the model's Beta for that current level. At least the ratio of Q7/Q5 or Q6/Q8 is fairly constant for different current: it will always be Beta which will (for 2N3053) be gently falling 100mA-400mA and only a 2:1 or 3:1 spread for different devices of that type-number. That is, it does not have the 60:1 hyper-sensitivity of Q8 Q5 current to Q3 current, just the 3:1 sensitivity of device tolerance spread.

Always beware of any plan where the current ratio of two stages is nearly as high as the Beta of the devices. Beta changes (different transistors, different types, or temperature) will give different results. Ico leakage can lead to runaway (Silicon pretty much eliminates this). And in audio amplifiers, if the driver does not have excess current to waste, then it may be unable to drain-off base charge, and high frequency response will be slow (and in push-pull, unbalanced). Your Q9 Q4 will drain leakage and base-charge, but exasperate the sensitivity to change in Q8 Q5 current.

That first schematic I posted is not very different than yours, except it is a lot more stable against supply voltage and part value variations. It is "worse" because the input long-tail is a resistor, instead of your semi-constant-current source. But the second stage has a large emitter resistor R7, which drops a voltage much greater than a Vbe. Ignoring Vbe, then the second stage flows a current that is just about 1/3rd of the R2 current. That does not change much with Vbe of 0.6V, 0.7V, or really 0V to 1V. It isn't that stable overall: the output devices have small emitter resistors that drop much less than a Vbe, so small changes in 2nd stage current make large changes in output stage current. And being Class A, if output current gets too small it can't drive a load well, if too large it burns-up (these were small epoxy transistors half the height of a TO5 case). So that plan needed supply voltages held to about +/-30% to "work", and maybe +/-10% to meet all specs. But that is not an unreasonable tolerance for a regulated supply. And since they were putting at least 40V on 40V-rated transistors, the supplies had to be regulated anyway.

Or use your input with the second plan (converted to PNP on bipolar supplies and omit the output cap). Model it without R5, or a high value. And using a current source for R2 is a nice touch. I suggest a 1mA current source for "R2" and maybe 10K for R5, just for starters. You have to change your R2 R14 values to about double to get the 2*Vbe voltage needed for Tr3 Base, and you strictly only need one. (Which one? That's left as the Exercise For The Student.) That should work great, though input pair balance under feedback will wander as temperature and Tr3 Vbe varies. The elegant fix for that is a current mirror in place of your R2 R14. It not only forces both sides of the input pair to near-equality, it at least doubles the gain.

In real life you would have to trim the "R2" current source to get the desired idle current in the output stage, since that varies with output device Beta. And as a practical matter, you have to start low, bring it up to maybe 80% of design current, and let it cook for an hour before the final setting. Allow time for Beta to drift (probably higher) as it gets hot.

Output stage current: peak load current isn't going to be any more than 118mA. You could idle at 59mA, though that lets current fall to zero on the "off" side. We really don't want to hit the current where 1/Gm is greater than the emitter resistors (though that's not critical with the Hood topology). For 39Ω emitter resistors, stay over 1mA at minimum... hell, just idle 10% hotter than "necessary": 65mA target current, 60mA-70mA production spread. If power and heatsinking are cheap (they are cheaper than hand-trims), bias for 70mA-90mA.
 
Well, I'll have to print out your reply and study it carefully, but that's OK, this is cool. :)

I took a page from the book of Mr. Linsley Hood and redesigned the output circuit:

http://tinypic.com/x6d0m

I'm staying with the NPN output topology for the time being because I think it gives more of that 2nd order distortion that all the kids are raving about :D

It's an improvement I think, though still sensitive to transistor betas as you suspect. It's a challenge to trim the resistor values to null out the offset and I'm sure that when I build this for real it'll be nothing like the simulation. Nonetheless, I'm learning a lot.
 
> redesigned the output circuit:

Hmmm. At first glance, it can't work. On second thought, it might, but it seems unhappy.

Nevermind my ideas. As you say, it is really about "learning a lot". It is a long road to the glamorous high-pay career of Famous Circuit Designer, but a fun road to travel on even if you never reach the peak. (In this case, the peak requires as much or more self-promotion and luck as design skill.)

But if you will take a tip from a Grumpy Old Man: good circuits are NOT designed in SPICE. Good circuits start in the mind, maybe aided by pencil and paper. You can save a little paper with a slide-rule or basic calculator, but it isn't necessary. If a circuit is going to work, be happy, be producable without fussy fine-trim, and keep working in hot sun or cold rooms, you can prove it with pencil and 2-place math. You need to be able to imagine or sketch a plan, guess the voltages and currents, check and refine your guess, and know if it is basically going to work as expected. In a "good" circuit, any part could change by 20% and you could not tell by input/output measurements. If you have to keep playing with bias to get the output from falling against the supply rails, it isn't going to work in real life.

Yeah, there are times when you need 2% or 1% resistors. A 24dB/oct filter with four R-C networks can wind up at the wrong frequency or corner-shape if all the resistors are 5% off the nominal value. 10% gain-set resistors cause 1dB/2dB gain error, which may be noticed in a many-stage system where small errors accumulate. But the inside of a feedback amp "should" be very un-fussy. Notice how well IC chips do, and their internal resistors vary 30% from lot to lot.
 
PRR, I agree with everything you have said. Yet since I am a newbie to discrete audio circuits after years of building things out of ICs, SPICE is a great tool for me to learn what happens when I "do this" without blowing things up.

Things got a lot less fussy after I put in the current mirror as you suggested:

http://tinypic.com/xaglf

What's a good way to adjust collector current in the output transistors? I ended up increasing the value of the emitter resistors to do that, but doing that really limited the voltage headroom of the output.

Thanks for your contributions to this fun exercise.
 
> What's a good way to adjust collector current in the output transistors? I ended up increasing the value of the emitter resistors to do that, but doing that really limited the voltage headroom of the output.

And what I (the grumpy old man) am saying is: if SPICE does your calculations, you don't have to understand the circuit, not at a gut-level. And you probably won't. Then it is all a guessing game, not a Design.

Here's the key situation:
MCquadout.gif


If we omit Q7 Q6, we see that Q4 has equal top and bottom resistors, flowing the same current, so they will have the same voltage drop. So we know R4 and R18 have the same voltage.

(Minor correction: R4 carries Q4 Base current, R18 does not. We wave our hand and say "Q4 has Beta of over 50, so the error is under 2%, negligible for a first approximation!")

Add on Q7 Q6 and R12 R5. Assume that at idle, Q7 and Q6 flow "the same" current: no current to the load at idle, and no/negligible current flowing to/from the Q4 stage. If that is true (not yet proven), then R12 and R5 have the same voltage drop.

We also see that Q6 action forces R5 to have "the same" voltage as R18. (It will really be 0.5V to 1.0V less due to Vbe.)

And we assume (or hope) that overall-feedback action forces the output to Zero (not yet proven, but if this doesn't happen then the whole idea is useless).

So if R4 and R18 have the same voltage, and R5 voltage is the same as R18, and R12 voltage is the same as R5, and total supply voltage is 40V, then the only answer which fits all the constraints is all resistors have 40V/4= 10V across them.

We can go back and fix the small errors we ignored. R4 carries base current for all three transistors, R18 does not, so they are not quite equal. Using our first guess that Q4 passes 10V/1K= 10mA and that Q7 Q6 pass 4V/100Ω= 100mA, and hoping that all Betas are 100, R4 has 2.1mA more current than R18, or 12.1mA versus 10mA. And noting that Vbe drops 10V on the base to about 9.4V on R5, Q7 Q6 current may be more like 94mA instead of 100mA. SPICE can do this type sucessive approximation. What SPICE will never tell you is: "This design will always waste about half the total supply voltage in the emitter resistors!" You might suspect this after repeated trial and error, but trying to solve it in your mind with a pencil will soon suggest that this is not a promising path to follow.

I'm not sure you have spotted, or fully digested, the fact that this is NOT the Hood output circuit. You have got one transistor backward. It makes a difference.

A more subtle issue: what is the voltage gain? And since it is a push-pull amplifier (or appears to be), you should ask about the voltage gain on each side. Q4 and Q7 form a pair of emitter followers: the output wants to follow Q4's Base at unity voltage gain. Q4 and Q6 form a pair of common-emitter stages, which normally give very large voltage gain. While there is some degeneration in R4 (Q4 probably works about unity voltage gain), Q6 (without Q7) seems to have 100Ω in the emitter and a 10KΩ load (not shown here), or voltage gain of 100. Now when you put Q7 back in, Q6 sees a heavy load as Q7's emitter tries to follow Q4's base. You have two sides that don't agree what voltage to put out. Such schemes can work, but don't really want to. It is like hitching a big horse and a small horse to the same plow: the plow will pull to one side unless you adjust the hitch cross-bar to balance the load so both horses balance. And as in horses, such schemes can usually only balance for one specific condition (you usually balance for the full-load case, in horses or amps, and just tolerate unbalance when working light.)

> SPICE is a great tool for me to learn what happens when I "do this" without blowing things up.

Well, you could also use one 9V battery and no resistor under 330Ω. You can't "blow up" 1/4W resistors or 300mW transistors with those values. OTOH, with parts costing $0.10 or about 1 minute's wages (or 20 seconds of classroom time), a cup full of dead parts may be the cheapest education you could ever give yourself. I still think the mind is the primary design tool, with pencil or breadboard to aid memory and visualization.
 
[quote author="PRR"]I'm not sure you have spotted, or fully digested, the fact that this is NOT the Hood output circuit. You have got one transistor backward. It makes a difference. [/quote]

Yeah, I knew it was backward; it seemed intuitively "right" from a DC perspective and since Q4 was destined to have about unity voltage gain, I thought it didn't matter. No?

[quote author="PRR"]A more subtle issue: what is the voltage gain? And since it is a push-pull amplifier (or appears to be), you should ask about the voltage gain on each side...when you put Q7 back in, Q6 sees a heavy load as Q7's emitter tries to follow Q4's base. You have two sides that don't agree what voltage to put out...[/quote]

I don't know. I guess I thought that Q7 and Q6 are just regulating the flow of current from the + and - supplies at that part of the circuit and that differences in voltage gain were not something for me to worry about.

[quote author="PRR"]Well, you could also use one 9V battery and no resistor under 330Ω. You can't "blow up" 1/4W resistors or 300mW transistors with those values. OTOH, with parts costing $0.10 or about 1 minute's wages (or 20 seconds of classroom time), a cup full of dead parts may be the cheapest education you could ever give yourself. I still think the mind is the primary design tool, with pencil or breadboard to aid memory and visualization.[/quote]

Point taken. I guess it's time to drag out the breadboard and order me a bunch of parts. :wink:

Thanks much.
 
Well, this circuit is what I breadboarded and tested over the weekend. It does work but the matching of the input diff pair and even the current mirror on the diff pair is very critical.

What's some ways I can make this circuit a little less fussy, and also a little more stable? I set the gain at about 30dB for testing because it would burst into oscillation at lower gains. Circuits on a breadboard don't always behave anyway.

Distortion at 0dBu is about .03% straight across the audio frequency range. Almost entirely 2nd harmonic, which is what I was after.

http://tinypic.com/17x1k2
 
I will.
Here's what changes I was thinking of making:

MCopampREV.jpg


I went back and reread your earlier post on how to properly bias a Linsley Hood output circuit, and it finally sank in. I replaced the 10k on the main current source/mirror with 100k, got rid of the 110 ohm resistor on the input circuit current source, and replaced the 330 ohm on the polarity inverter with 100k. I'm gonna see how that works when I get home tonight. It should set the output device current at about 20ma, which gives it enough juice to drive a 600 ohm load.
The input diff pair seems to be okay too. The sim says it has about 750 nanoamp input base current, which is just a little more than the average NE5534 has.
I also added the 300ohm in series with the compensation capacitor in an attempt to give the circuit a better phase margin.
Remove the 47 ohm resistors from the output? I had to add them when my transistors kept going into thermal runaway. It's more convenient to measure output device current by just measuring the voltage across a resistor, too :)

Thanks PRR.
 
[quote author="magicchord"]I will.
Here's what changes I was thinking of making:

MCopampREV.jpg


...Thanks PRR.[/quote]

I breadboarded the circuit in my previous post. Its behavior and performance are much improved. It's very stable at a gain of 4 (I didn't try it at unity gain). Distortion at +4 dBu is less than .003% from 5Hz to 10kHz; at +20 dBu it's about .006%.

Open loop gain seems to equal the sum of Q1 beta and Q8 beta - around 90,000 to 100,000.

I listened to some music through it and it's as clean as you'd want.

I like the simplicity of this amplifier. Gonna do a bit more tweaking and then I think I'm going to make something out of it :)

Thanks for the lessons.
 
[quote author="NewYorkDave"]I like the fact that you used 4401s and 4403s throughout. Those are my "jellybeans" that I always keep around (along with 3904s and 3906s).

How does it manage into 600 ohms?[/quote]

Yeah, I had bought a few 2N2219s to use as output devices but after I destroyed 3 of them, I reasoned I'd be better off destroying 4401s that cost 1/10th as much and that I had 100 of in a bag :) Looking at the circuit, it seems like the output transistors should have the same beta as all the others anyway (bottom Q has voltage gain? Wrong?)

I haven't tested it on 600 ohms but I think it'll drive it up to 12v peak. Those 47Rs can be reduced to 10R (PRR sez get rid of 'em but I'm being conservative).
I'm considering a version with 2 sets of output transistors in parallel that can drive 150 ohms. With 20-25 mA per device, probably won't even need heat sinks.
 
> Open loop gain seems to equal the sum of Q1 beta and Q8 beta - around 90,000 to 100,000.

Actually it may be total current gain -times- the ratio of load to input impedance. Or something along those lines.(*)

> MCopampREV.jpg

The "problem" with this is: Q4 current determines Q1 Q2 current, which needs to be a specific value to set your gain-bandwidth product (the way this and most tranny amps are compensated) and any input bias current spec you might like. But output bias current is Q7 current/2 times Q9Q10 Beta. And Beta can be 100 or 300. If Q7 passes 0.2mA, 0.1mA to each output Base, the output stage idle current could be 10mA or 30mA. 10mA is just barely enough for 12V peaks in 600Ω. 30mA times 15V is 0.450 Watts, more than plastic jellybeans can honestly stand long-term (and much more than you need). And if you built a 16-ch board with 3 opamps per channel, power demand could be 0.5A or 1.5A. And then your idiot purchasing manager buys a crate of 2N4401 "equivalents" with Beta of 50 or Beta of 500, and your heat and power demand and output capacity is all over the place.

I think Q7 current should be trimmed on final test to give the desired idle current. If you actually know the type-number you will use, a 3:1 or 4:1 variation should cover any part in the bag. If you shop for bargains, you should probably have a 10:1 trim range. Yet you probably do not want a 10:1 range of idle current in Q1Q2, so Q4 current should be fixed.

(*) Ah: without no stinkin SPICE, I can write the voltage gain.

For pull-down, about 2*(Rl/(Hib10)*(Hib10*Hfe10*Hfe8)/Hib1

In this case, Hib10 must include the 47Ω resistor. HOWEVER, Hib10 drops out! So we have simply:

about 2 * Rl * Hfe10 * Hfe8 / Hib1

about 2 * 600Ω * 150 * 150 / 200Ω = 135,000

I have ignored some "leakage": Hoe of Q1Q6 is not infinite, R4 diverts signal and reduces effective Hie10. As a practical matter, I would not count on half of that calculated gain. Your observed gain of 100K is between my calculated and pesimistic estimates. Note that while R22 drops out, load impedance directly impacts voltage gain. Infinite load, infinite gain! Actually Hoe will limit you to more like 500-1,000 per collector, or around 500K unloaded. So voltage gain will not rise much for loads higher than about 3K.

Frequency response: Under compensation: C1 and Hie Q1 Q2 give unity gain about 2MHz. Slew rate is about 0.15mA/220pFd= 0.7 V/uS. Frankly, a hot 741 can match this speed.

Without compensation: looking at the gain equation, and ASSuming load is pure resistance (it never is), and that Hib1 is resistive (it will be to very high frequency), and further assuming Q8 Q10 have Hfe of 150 and Ft of 300MHz, we see Hfe dropping at 300MHz/150= 2MHz, so overall gain is flat to 2MHz but then drops 12dB/oct to unity gain a bit past 300MHz.

I may be ignoring some major roll-off, but it seems to me it could be compensated less heavily to get some speed and slew. This is still always the killer issue in BJT opamp design. But with these fast output devices, and pole-splitter compensation, seems to me you can aim for unity-gain up around 50MHz, with C1 about 10pFd.

The next step is to throw some resistance in Q1 Q2 emitters: you lose DC gain but you need a smaller C1 to get the same GBW and that gives better slew. And if this is hand-built in small lots, C1 can be selected for the specific closed-loop gain it will run at. You might use one value for unity gain, another for gain of 2 (many inverters), another when gain will never be less than 10.
 
Back
Top