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.

[youtube=http://www.youtube.com/watch?v=ppfeYf2zTM4&w=470]

17 thoughts on “Class-D Audio Amplifier Makes It From Breadboard To PCB

  1. 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. 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.

  3. 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.

  4. 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!

  5. 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.

  6. 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

  7. @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

  8. @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.

  9. @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.

  10. 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…

  11. 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.

  12. 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 to DroneCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.