Thursday, March 30, 2017

Quick Followup

Six Transistors and the Truth?

After two more days of thought and a little advice from a nice fellow at diyaudio, I propose a few changes to the "final" circuit. My latest version looks like this:

(Note that the changed part number on Q3 is just a typo fix, the previously listed part was the PNP complement to the correct one.)

Distortion is now below 0.1% at 5W. For thermal purposes, Q2 could actually be two C4883s in parallel, sharing the current.

I'm planning on making a PCB and box for this circuit. I'll post pictures when I'm done.

Wednesday, March 29, 2017

Four Transistors and the Truth (Part 2)

Power In, Power Out

At the end of the last post, we had an amplifier capable of about a half Watt of power output with about 2.5W of dissipation (at Vcc=24V.) The limiting factor causing distortion was clearly available current: the output voltage distorted around 3Vpp, far from the supply. It occurred to me to try removing R6 and R7--lo and behold more power was had! Now R5 determined the current draw of the amplifier nearly directly.

With this change, I did some simulation and found the following:

At R5 = 10k: Ivcc = 0.25A, Pout = 0.2W @ 1% distortion
At R5 = 3.3k, Ivcc = 0.75A, Pout = 2.7W @ 1% distortion (3.7W @ 10%)
At R5 = 2.2k, Ivcc = 1.0A, Pout = 5.0W @ 1% distortion (6.2W @ 10%)
At R5 = 1k, Ivcc = 2.0A, Pout = 6.8W @ 1% distortion

With a value of 2.2K, the amplifier actually beats the original specs given for the Amp Camp Amp. It also needs some serious cooling, dissipating about 15W in Q2 and 8W in Q3.

The final circuit is thus:

Finishing Touches

I was putting together a cute little box with jacks, independent 24V AC/DC converter (you can find one by Drok on Amazon for $15ish that works great!) and such, I took another look at my circuit hoping to squeeze any last bit of performance I could out of it. I also hadn't settled on the exact value of Rc, I found 3.3k worked with just passive cooling while 2.2k worked with a small fan (actually, I used a spare miniature CPU heatsink and some thermal adhesive.)

Out of curiosity, I simulated the current flow through R5 and found it was between 3 and 11mA. I replaced the resistor with a constant current source of 7mA and, what do you know, everything got better. Distortion went down, power handling went up.

Next, I replaced the imaginary current source with a pair of 2N3906 transistors and a resistor to ground acting as a current mirror. Distortion actually went down further, although total power draw went up (depending on the mirrored current.)

The amplifier now solidly outperformed the design it was based on. The new "final" circuit (for now...) is:


Six transistors, six resistors, and three capacitors. Not bad.

5W RMS, 0.34% distortion, 1.25A draw at 24V (with R5 = 3.3k.)

Gain, you say?

One thing I haven't mentioned is the gain of the amplifier. It's actually less than one. To get that 5W figure, the input signal needs to be 8.6V for an output of about 8.1V. I'm using a Fiio headphone amplifier as a pre-amp which happily supplies this. Perhaps there's an argument in there that gain really is the purpose of a pre-amplifier, but I'm not sure. Either way, the "obvious" solution of increasing R2 to boost gain in the circuit results in considerably increased distortion. A different solution is clearly in order but I'm not too invested in pursuing it right now. The current design meets most of my requirements (it requires active cooling or a heatsink I don't own) and sounds nice to my ears--I call it a win.

Sunday, March 26, 2017

Four Transistors and the Truth

What It Takes

First, the truth. I'm not the first to say it but it could stand to be repeated more: when it comes to amplifiers, the last Watt is important but it's the first that you need to know has your back.

Where can you find a good Watt? I spent the last few days looking and this is post is about what I found.

Punk Ethos

To me, punk rock is the freedom to create, freedom to be successful, freedom to not be successful, freedom to be who you are. It's freedom. -Patti Smith
When I want something, one of the first questions I like to ask is "Can I make it myself?" Now, I happen to have thousands of electronic parts lying around, so this comes with a boulder of salt but then again, Ms. Smith wouldn't get far without equipment either. You need something to play those chords on, anyways.

There are plenty of extant designs and plenty of books too (Douglas Self wrote a personal favorite, if you're interested.) A quick search for "amplifier circuit" will get you a mix of Electronics 101 common-emitters and variously incomplete or poorly explained circuits.

Let's add to the mess:


This circuit is both incomplete and a common-emitter amplifier! It is, however, a genuine single-ended Class-A amplifier.

It needs a few things before it'll be any use, though. I'll start with the goal: besides being able to make it, my requirements were as follows

  1. Enough power to play a reasonable speaker reasonably loud. (A nice vague goal that turns out to be about 3W RMS.) Reasonable here defined entirely around my personal preferences.
  2. Low distortion at this power. I shot for 1% THD.
  3. No heatsink I didn't already have and passive cooling only. (I happened to have a TO-220 and two TO-246 heatsinks.)
  4. No purchase necessary... use only what I already have "in stock."

Four Transistors

I started with a design that had similar goals: the "Amp Camp Amp" designed by Nelson Pass (you can get a nice kit, so I'm told, at the diyaudio store.)

It looks like this:
and boasts 5W of power. However, the distortion at that power is around 3%. My goal was 1%, which it hits a little before 2W. Additionally, it's a MOSFET-based design and I didn't have any of those. It was a good start, though.

The first step was to make a SPICE netlist for the circuit. I did and everything checked out, so I replaced the MOSFETs with a model of the BJTs I had on hand. Running it again, the results were (predictably) disappointing--in the ballpark of a tenth of a Watt before 1% distortion.

I built one anyways, just to see if it would work that well, and it did. It was actually surprising how far that tenth of a Watt got me, nicely reinforcing my thoughts on amplifier power. Then it was back to the netlist.

A little thinking and a lot of experimentation later, I came up with the following circuit:

How About Three?

After building this one, I discovered by accident that the transistor Q4 isn't doing anything for the circuit and could be completely removed along with R6. C2 stays, though. No power was gained from that, though.

The next advance came from a second look at P1 in the original circuit. It's there to bias Q3 but Q1 (Q4 in the original) is not a JFET anymore. JFETs are depletion-mode (ie "normally off") by definition, hence the ground connection. With the bipolar NPN in its place, R3 should instead provide a positive bias. The place to do that is between R5 and C2.

This gives a reasonably useful amplifier (do note that it probably won't work without decoupling and bulk capacitors on the supply.) You can also drop the ballast resistors R7 and R8, since they need to be of a high-power (read: expensive) type and aren't doing much at this point.

From here, it took a little luck to see any improvement. I spent some time messing with the feedback resistor that controls the gain of the amplifier to no real avail. Decreasing it, if your source is high enough voltage, reduces distortion somewhat--as does increasing C1 to around 220uF. Nothing major either way.

I got a little frustrated and started trying things that I didn't think would help, but as luck would have it, found something that did: an additional transistor between Q1 and Q3. (I think it's a matter of increased beta but, honestly, I'm not sure.) The new schematic looked like this:


Almost There

But you'll have to wait until the next post!

Saturday, March 25, 2017

Humble Power

About Music

This blog will float between a variety of topics but at the center will be music--specifically, enjoyment of music and the technology surrounding recreation of recorded works.

To begin, I want to touch on music from an electronic perspective. Music, being sound, is a vibration; chiefly traveling (at least at some point) through the compression and decompression (fancy word: rarefaction) of air. It is no great leap to imagine music as a vibration of electrical energy.

When a sound moves through air, the air moves locally--back and forth away and towards the sound source--but does not travel in the general sense. Put another way, when sound moves air, it also moves it back. So it is with electrical sound, in the form of alternating current (i.e. AC.) Much like, say, hula-hooping takes energy but ultimately does not move you much of anywhere, AC power is still capable of performing work without the "lightning-bolt" flow of electricity we picture.

With a complex vibration like music the associated power is not evenly distributed, ebbing and flowing with what musicians call the 'dynamics'. We can describe it in terms of peaks, averages magnitudes, and various other terms. For the point I'm building up to, I will simply note that the average power of music is almost always much less than the peak power (even in a highly compressed Oasis song.) Rules of thumb suggest a figure of 10% is likely still generous.

About Watts

Watts are the unit of electrical power. If you've ever bought a speaker or an amplifier, your familiar with them as a metric loosely associated with loudness. A quick Googling will tell you amplifiers can be found with a staggering array of different Watt ratings: 15, 25, 100, 1000... so on.

Speakers, too. I'm sitting next to two--one is a large PA cabinet that says it can handle 2000W and another a '70s model that says 40W. What neither of them say is how loud they actually are, their efficiency.

A look at one of the most popular aftermarket speaker suppliers (Parts Express) will show you that the actual drivers that make up a speaker (formally, drivers are transducers; devices that transform energy from one form to another) advertise their efficiency as some number of dBSPL, anywhere from high 70s to 110 or so. This number, 'decibel sound pressure level', tells you that the speaker creates that much 'sound pressure' given the right one Watt stimulus (although it doesn't tell you what that stimulus is) when measured from 1 meter away.

This is a few steps abstracted from what you'll hear when you actually use the speaker, to say the least.

The first thing to note is that SPL is measured in decibels (hence the 'dB') and that decibels are logarithmic, a math term that doesn't actually matter because our ears are exactly the same. What isn't in decibels here is the Watt rating, leading to great confusion.

If I were king of the world, I'd force audio folks to write power in decibels--but they don't.

To throw a further wrench in it, when electrical engineers write Watts this way, they use a different sort of decibel. The difference in magnitude between 3dBW and 6dBW is the same as the difference between 3dBSPL and 9dBSPL. This is confusing, but fortunately, for a good reason: SPL is a measure of pressure not acoustic power and once the dust settles on the math, it works out that adding 3dBW to a system is enough to add 3dBSPL. It's pretty convenient.

About You

Onward to the question of "how loud will it be, anyways?"

The answer, in terms of SPL, is that it will be as loud as the efficiency of the speaker plus the dBW of the source. One Watt is 0dBW which is why we quote efficiency at one Watt. Does this mean that a 1W amplifier and a 90dBSPL speaker will play your music at 90dBSPL? (which would mean standing one meter from your speaker was like standing ten meters from a jackhammer?)

Sort of.

If you're listening to a sine wave of the right frequency, perhaps. But music is mostly a tenth as loud as it is sometimes. If your theoretical 1W amplifier plays the loudest moment at its full power, mostly you'll be standing over a football field away from the jackhammer.

Please understand I'm not trying to tell you what amplifier to buy. That involves a lot more than 'how many' Watts--turns out it's rather more about 'what' Watts, but that's for the next post, not this one.