Class-D audio amplifier makes it from breadboard to PCB

[Ben Laskowski's] been working on a Class-D audio amplifier for several months. What you see above is the most recent version of the amp. A class-D amplifier uses transistor switching (or in this case MOSFET switching) to generate the pulse-width-modulated signal that drives the speaker. This is different from common amplifiers as it doesn’t generate the kind of heat that traditional amplifiers do, making it much more efficient.

After the break you can hear it demonstrated. It’s operating off of a single-supply laptop brick and we do hear a bit of a hum coming through the system. Still, we’re quite pleased at the power and quality the small board can put out. Take a look at a post from November to get a handle on what went into development. If you still hunger for more details, [Ben's] shared the bulk of his prototyping materials in the github repository.

Comments

  1. Tim says:

    how are you clocking the PWM rate? Also, on most Class D amplifiers, you see 2 inductors per speaker on the output filter, one on the “+” side and one on the “-” side.

    What I would love to see here is an FPGA or something similar used to take a digital audio input (I2S for example), and convert it to PWM signals used to drive the MOSFET gate drivers.

    Add a S/PDIF to I2S converter and/or an ADC with I2S output and you’d have a really sweet (and possibly much higher fidelity) class D amplifier

  2. NishaKitty says:

    Seems to have a lot of humm in the amplifier >.>

  3. mIK says:

    Use it to drive a sub with a low pass and the hum won’t be there. I’m not sure I would use class D for full range with plenty of class T digital full range chips out there.

    Hint — Most mono amplifiers for 12v car audio applications are class D (or better) for subwoofer applications, while most full range amps are AB or T.

  4. bulgingcaps says:

    Are those giant capacitors in your pocket, or are you just happy to see me?

    And if they are capacitors, I hope you discharged them…

  5. Matt says:

    Sounds like 60 or 120Hz hum… perhaps line noise isn’t adequately isolated from the DC input to the board. Not terribly surprising with the step-down transformer to rectifier to capacitors that it looks like is being used, a linear regulator after that to drop the voltage just a bit would reduce a lot of the hum I think.

    mIK – class T amps are just a product name for what are actually class D amplifiers. Seems that they use delta-sigma modulation and a digital feedback loop, but it’s still a class D.

  6. Chamon says:

    Hum like that is certainly ground loop. Eye-balling the PCB there are cut outs in the ground plane. That cannot happen! Audio PCB design must be almost as careful as RF, although not for the crappy reasons audiophile tend to feed people. But hum is a real audio design nightmare!

    BTW, great work! The amp looks really nice!

  7. Ivan says:

    I have 3 laptop bricks laying around, waiting to be used. I might use one for a quick bench supply.

  8. Drone says:

    Site is down. 02:55 GMT Sun. 22 May 2011.

    Aren’t there class-D chip-amps available these days? Class D is a pain. Not only do you have to deal with an A/D, then you have to do PWM, then volume control is a hassle (control supply voltage, Which then throws off optimum values of L and C?) Long time since I looked at a class-D discrete build from scratch.

  9. Spence says:

    @drone – I’ve used a bunch of OEM class-D boards by Sure Electronics sold on http://www.parts-express.com/. When I get some time ill post a 6×6 amp/matrix I build with them.

  10. Matt says:

    Volume control can be done as simply as using a dual-gang potentiometer on the signal inputs. Actually class-d has become very simple, you can buy premade modules based on Tripath Chips (fully integrated ICs) and all you have to do is hook up a suitable power supply and you’re away. If you’re building a discrete version then this one is particularly popular: http://www.diyaudio.com/forums/class-d/166214-ucd-25-watts-1200-watts-using-2-mosfets.html

  11. Diago says:

    @mIK Your phrase “Class D or better” sounds like we’re classifying eggs or surface continuity…that Class A is the best class. Class A was just the first type, Class B the second, etc… And extending what Matt said, Class T is just Tripath’s brand of Class D amps.

    @Drone Check these little beauties and their cohorts; they’re very easy to use, inexpensive and sound great:

    http://focus.ti.com/docs/prod/folders/print/tpa3112d1.html

    http://focus.ti.com/docs/prod/folders/print/tpa3106d1.html

  12. Chris says:

    @Drone: What’s the A/D and variable supply voltage for? A Class D amp is just an oscillator, comparator, and an output stage. All of which can be fulfilled (although poorly) by a single 555.

    I designed a Class D amp in SPICE, using only a LM339 and some discretes. Works great in simulation. I have no plans to build or publish it, I did it only to practice and learn. If I need a real Class D amp I probably will get one of those chip amps, or a pre-assembled PCB using one from Ebay since they’re so cheap.

  13. space says:

    @Matt
    That hum comes form lack of negative feedback loop form speaker terminals to input signal terminals. This allows PSU hum to be modulated to PWM signal in output stage.
    It just needs one more opamp per channel and some resistors and capacitors.

  14. hospadaruk says:

    Class D amps are just so darn cheap as a complete package, I don’t think I could ever bring myself do build one. I recently used this guy: http://www.parts-express.com/pe/showdetl.cfm?Partnumber=300-385 for a boom-box I built. I had considered building my own amp, but the cost of the amp chip alone is almost as much as the amp (amp was $15 when I bought it).

  15. Ben says:

    Hi everyone, thanks for your comments!

    @Tim: the amp is of the self-oscillating type. On the breadboard, I measured the frequency at around 250kHz. With the decent PCB layout and much faster gate drivers in use now, I’d expect that frequency to be even higher.

    @Matt: right you are… If I used a laptop power brick as I suggest in the writeup, the hum should be gone. I just used the transformer/rectifier/capacitor combo as I didn’t have a sacrificial power brick on hand.

    @Chamon: I think it’s just a bad experimental power supply. The only ground connection is at the audio input. That’s not ideal, but the key is that there are no other direct ground connections.

    @Drone: The L and C values shouldn’t depend on the supply voltage. They DO depend on the load (speaker) impedance, though. Right now, they are close to ideal for an 8 ohm speaker.

    @space: There is negative feedback from the switching node of the output transistors. I didn’t take it from the speaker terminals due to the tendency of the RLC filter to cause instability when included in the closed-loop transfer function. You are right, though; with extra R’s and C’s I could make a compensation network and include the filter output in the feedback loop as well.

    It’s true that Class-D amps are readily available these days. I just wanted to see how good I could make one from scratch. It worked well on the breadboard, hence the PCB…

  16. blue carbuncle says:

    Somehow missed this the other day. Nice write up and execution :) Also, thanks for the great links HaD folks. Got me some ordering to do ;) Agree with most above that the hum should disappear with the power brick. I had never even heard of Class T lol.

  17. Miroslav says:

    Hi, the project looks great. I think I’m gonna make it. But I have a few questions before that. I’ll be glad if you answer them.
    What is the range for the power supply? For the 2 wings and single power supply?
    What has better performance? The version with 2 wings ot single powerd module?
    Thanks,
    Best regards.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,742 other followers