Building a TPA3132 amp board

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I want a tiny, efficient, cheap class-D amp for active speakers. Both for hifi and for a portable battery powered setup.
I've read the thread about the chinese tpa3116 boards. While they are cheap, they look like they all suffer from bad board layout and worse components.
I'd like to build one that satisfies these requirements:
- High efficiency both at no output and when playing music with low crest factor at full power into 8Ohm.
- Low distortion.
- Doesn't radiate like a WWII radio jammer.
- Is cheap to build.

This is what i've got so far: https://github.com/rosvall/tpa3132-amp

This is my first SMD layout, so i'd like to know if it looks reasonable. Routing high frequency, high current stuff through 0.2mm traces makes me feel dirty.

I really don't know what i'm doing with the EMI related stuff - the output snubber circuits, ferrite beads and stitching ground planes. A little help would be appreciated.

Feel free to clone it and start hacking.
 
For active speakers it would probably be a good idea to have signal sensing turn on/off with timer output. For example a NJU7181 chip have everything you need integrated at an extremely low power consumption. Drive the SDZ (and FAULT) pin directly with the output, ie. no connection directly to Vcc. There are other similar chips but this one provides everything that is needed in one simple package and it costs about $0.50 each.

http://semicon.njr.co.jp/eng/PDF/NJU7181_E.pdf

Note that there's probably no need for sensing 2hz signals so the 10µF input capacitor could just as easily be 220nF instead.

Also note you need a voltage divider or some other voltage regulator to supply the chip.
 
Last edited:
For active speakers it would probably be a good idea to have signal sensing turn on/off with timer output. For example a NJU7181 chip have everything you need integrated at an extremely low power consumption. Drive the SDZ (and FAULT) pin directly with the output, ie. no connection directly to Vcc. There are other similar chips but this one provides everything that is needed in one simple package and it costs about $0.50 each.

http://semicon.njr.co.jp/eng/PDF/NJU7181_E.pdf

Note that there's probably no need for sensing 2hz signals so the 10µF input capacitor could just as easily be 220nF instead.

Also note you need a voltage divider or some other voltage regulator to supply the chip.

That is a good idea. I'll see if can squeeze that in.

WRT the output LC filters, I definitely wouldn't mind getting rid of the inductors. I just fear the efficiency would suffer from using the speaker as filter. I can't find any numbers though. Also, what about the harmonics and stuff from 400kHz up to where the ferrite starts working?
 
WRT the output LC filters, I definitely wouldn't mind getting rid of the inductors. I just fear the efficiency would suffer from using the speaker as filter. I can't find any numbers though. Also, what about the harmonics and stuff from 400kHz up to where the ferrite starts working?

You mean the AM frequency band? That's what the modulation is specifically designed to suppress so no problems there, it's higher order harmonics that can cause problems so a ferrite bead is used to suppress that.

Efficiency penalty of a ferrite bead is in the range of 0.3% to 2.1% depending on the speaker inductance.
 
The ferrite beads i've looked at really don't do much up to about 30MHz with any sort of DC bias. That makes me slightly uncomfortable.

That is energy wasted in the ferrite bead or the speaker?

They don't need to. The FM radio band is 100MHz +-10%, so the ferrite beads needs to have their impedance maximum there. Fortunately, that's also what the vast majority of ferrite beads is designed for.

I cannot stress enough that in my opinion the audio quality is a lot better with ferrite beads instead of LC output filter. The bass and lower midrange is a lot better detailed and controlled but it's the very high range that really stands apart. In that regard it's like the difference between a (high quality) .mp3 and a .wav file.

Lower efficiency means a higher percentage is lost in the amp heat sink but you have almost zero loss in the ferrite beads themselves due to the high frequency impedance resonance and the ultra low series resistance. They do not get even remotely warm. Output inductors on the other hand can get burning hot with added loss and even lower audio quality as a consequence due to thermally variable resistance and inductance as well as saturation in some cases.
 
Last edited:
https://github.com/rosvall/tpa3132-amp/tree/filterless

I've removed the LC filters and replaced it with some beefier ferrite beads. Then i took a look at the eval board and realized that it was much nicer than what i was doing, so i changed the output routing completely. And i copied their RC-snubbers.

Any idea if it's going to behave?

I'm not really sure what i'm looking for with the ferrite beads, apart from a DC bias of up to 5A. The ones i've found ( http://datasheet.octopart.com/HI3312X101R-10-Steward-datasheet-65586.pdf ) look kind of large.
I'm pretty sure i've overdone it with the vias.
I'm feeling a bit out of my depth with this stuff.

Anyway, this layout did free up a lot of space for power management and whatnot. So there's that.
 
That is unfortunate. Well, there's always the option to build it from the ground up. Basically, you'd just need an input amplifier and a comparator like here Signal Detecting Auto Power-On Unit. Just scrap all unneeded parts relating to the relay. And choose op-amps that run at very low idle current.

On the new PCB layout; what a mess. I'm pretty confident in saying that it will have huge issues.
 
That is unfortunate. Well, there's always the option to build it from the ground up. Basically, you'd just need an input amplifier and a comparator like here Signal Detecting Auto Power-On Unit. Just scrap all unneeded parts relating to the relay. And choose op-amps that run at very low idle current.
It just seems like it would take up a bunch of precious board space. What i really want to squeeze in is an active 4th order linkwitz-riley crossover :)
On the new PCB layout; what a mess. I'm pretty confident in saying that it will have huge issues.
I'm sort of new to this, i'd really appreciate some more specific criticism.
 
It just seems like it would take up a bunch of precious board space. What i really want to squeeze in is an active 4th order linkwitz-riley crossover :)

For what purpose? In a general amplifier design it is inherently a bad idea to include active filters as most people would want these to be adjustable, not only in frequency but also in topology, slope, etc etc.

For while you might like a 4th order LR xo, other people would probably prefer hybrids of 2nd order BW HP and 2nd order LR LP to get a phase and amplitude coherent filter. Or a bandpass filter. Or something completely different. Or nothing at all which means it's all just wasted space.

The circuit above was just a reference. There's tons of ICs that integrate an input amplifier and a comparator directly on a single chip cutting away most of the external parts.

In regards to circuit lay-out, I'll get back with a more detailed analysis.
 
For what purpose? In a general amplifier design it is inherently a bad idea to include active filters as most people would want these to be adjustable, not only in frequency but also in topology, slope, etc etc.

For while you might like a 4th order LR xo, other people would probably prefer hybrids of 2nd order BW HP and 2nd order LR LP to get a phase and amplitude coherent filter. Or a bandpass filter. Or something completely different. Or nothing at all which means it's all just wasted space.
You do, as always, have a very good point. It would make it a lot less versatile. But this amp is specifically for active speakers now, without the output filter.
And I think a cheap, all-in-one active (two way) speaker amp with XO would be useful. But, yeah, configurability. I suppose the right way to it would be with a DSP, and the cheap way would be with a couple of fixed frequency versions and a trimmer for tweeter volume.

The circuit above was just a reference. There's tons of ICs that integrate an input amplifier and a comparator directly on a single chip cutting away most of the external parts.
I was considering something stupid like amplifying the difference of the 3V-biased positive inputs, a diode detector and the mute input. But it just dawned on me, that any sort of auto-power off will put a lower limit on output volume. I imagine it would be quite fiddly to get right. How annoying is it, in your experience?

In regards to circuit lay-out, I'll get back with a more detailed analysis.
I appreciate you taking the time to do this. I'll try to tweak the layout image to be a bit more clear.
 
1) Ground planes. There's such a thing as too much of a good thing can be bad, and in regards to ground planes this is the case. What's important is to realize there are two (three) separate ground planes that should not be mixed together. There's the PGND which essentially is all the connections to GND from the chip outputs, PVCC decoupling, and the GND connection from the power source. And then there the AGND which is all signal and logic ground connections as well as separate AVCC decoupling if used. The third ground plane is the bottom ground plane which is often seen and used as PGND. Ground planes must be starred to the chip pad and AGND and PGND should only be connected in one place. Usually through PIN 4 to chip pad. There's a fourth and fifth ground plane if the CRC are ground referenced. These should be connected by separate ground connections for each channel to the star ground.

1a) Connect GNDs of PIN 17, 20, 21, and 24 to chip pad. Not to anywhere else.
1b) Decouple AVCC separately to AGND with 2 ceramic capacitor identical to those after the bulk cap on PVCC
1c) AM1, AM2, AM3 and MUTE should be ground connected through PIN 4, not directly to chip pad.
1d) Negative inputs must be grounded close to input terminals unless you use differential (balanced) inputs. Otherwise you will have no sound.

2) Output section.

2a) The ferrite beads are inductors so they should be paired as close together as possible so that any stray RF noise radiated are negated by the opposite radiation of the opposite rail. There should be no ground plane or any other connection running directly below the ferrite beads on the same side of the board at least but preferably and if possible not on either side.
2b) Bootstrap capacitors must be as close to the chip as possible and should be rated to at least 4 times the supply voltage, and preferably 10 times or more. They must be ceramic and to achieve the lowest possible ESL use 1210 or 0805 sizes. Do not use 1206 types.
2c) The CRC section should be close to the output terminals. There are many advantages to be had if it is not ground referenced but instead referenced directly to the opposite rail, just remember that the voltage rating has to be doubled. If a ground reference is used, make a separate connection directly to the star ground on the ground plane side. Avoid using the PGND or ground plane if possible.

2d) Don't know why you have 2 RCs filters on either side of the ferrite beads. Drop the one closest to the chip.

3) Ferrite beads on power connection? Why?
 
Last edited:
1) Ground planes. There's such a thing as too much of a good thing can be bad, and in regards to ground planes this is the case. What's important is to realize there are two (three) separate ground planes that should not be mixed together. There's the PGND which essentially is all the connections to GND from the chip outputs, PVCC decoupling, and the GND connection from the power source. And then there the AGND which is all signal and logic ground connections as well as separate AVCC decoupling if used. The third ground plane is the bottom ground plane which is often seen and used as PGND. Ground planes must be starred to the chip pad and AGND and PGND should only be connected in one place. Usually through PIN 4 to chip pad.

[...]

1b) Decouple AVCC separately to AGND with 2 ceramic capacitor identical to those after the bulk cap on PVCC
Ordinarily I'd agree with you, but the datasheet doesn't really talk about an analog ground. Their eval board doesn't use split ground (or power) either (as you can see i've taken quite a bit of inspiration from that board). At this point I'm not sure if pin 4 really is AGND or it's a error in the datasheet or what. I think i'm going to hit up TI and ask them what's going on.

I did initially split AVcc off and decouple that separately, before i found the eval board. Then i just thought **** it, if they can pull that off, so can i. Still, if it would improve the SNR or whatever in any significant way, sure, i'll change it.

There's a fourth and fifth ground plane if the CRC are ground referenced. These should be connected by separate ground connections for each channel to the star ground.

[...]

2c) The CRC section should be close to the output terminals. There are many advantages to be had if it is not ground referenced but instead referenced directly to the opposite rail, just remember that the voltage rating has to be doubled. If a ground reference is used, make a separate connection directly to the star ground on the ground plane side. Avoid using the PGND or ground plane if possible.
That makes sense. But i guess the bigger issue is that i don't really know what it is i'm trying to fix with that (C)RC-snubber. Where is that energy, spectrum-wise, and how much is common-mode? I should probably read up on this stuff. :eek:


1a) Connect GNDs of PIN 17, 20, 21, and 24 to chip pad. Not to anywhere else.
And route the return path of the output filtering through the bottom?

1c) AM1, AM2, AM3 and MUTE should be ground connected through PIN 4, not directly to chip pad.
I get that that is the right way, but they're digital inputs and connected with very low impedance to (the supposed ;)) AGND pin.

1d) Negative inputs must be grounded close to input terminals unless you use differential (balanced) inputs. Otherwise you will have no sound.
Whoops. I'm adding a 5th pin for GND.

2a) The ferrite beads are inductors so they should be paired as close together as possible so that any stray RF noise radiated are negated by the opposite radiation of the opposite rail.
That makes sense. But I can't see a good way to do that without messing up the return path for the positive output filters.

There should be no ground plane or any other connection running directly below the ferrite beads on the same side of the board at least but preferably and if possible not on either side.
That i can fix.

2b) Bootstrap capacitors must be as close to the chip as possible and should be rated to at least 4 times the supply voltage, and preferably 10 times or more. They must be ceramic and to achieve the lowest possible ESL use 1210 or 0805 sizes. Do not use 1206 types.
All passives are 0805. It would be a lot neater with 0603, but those aren't compatible with my caffeine intake.

2d) Don't know why you have 2 RCs filters on either side of the ferrite beads. Drop the one closest to the chip.
Copied it from the eval board. The eval board has the nice property of being FCC part 15 compliant. Yes, what i'm doing is entirely cargo cult - i don't know **** about EMC compliance, i don't even have a spectrum analyzer. I just figured, what the hell, if it can dissipate some ringing or whatnot, great.

3) Ferrite beads on power connection? Why?
My reasoning is basically just more ferrite = less EMI. Might as well try to nip the problem of a radiating power supply cable in the butt.

I apologize for being a bit contrarian and ignorant, i know it's a frustrating combination. I do appreciate your help though.
 
Hey. You don't have to take my advise :) I'm just a perfectionist. Please note that evaluation boards are just that. Boards to demonstrate the function of the chip and a reference for designers. They are never meant as being the only and final implementation, and there's many things that can be done a lot better.

That makes sense. But i guess the bigger issue is that i don't really know what it is i'm trying to fix with that (C)RC-snubber. Where is that energy, spectrum-wise, and how much is common-mode? I should probably read up on this stuff. :eek:

And route the return path of the output filtering through the bottom?

That makes sense. But I can't see a good way to do that without messing up the return path for the positive output filters.

It's for EMI suppression in general, more specifically the first C works in combination with the ferrite bead to from a 2-pole filter in the FM frequency range. The RC part works at the switching frequency (and in the AM frequency range) by reducing overshots when the output transistors turn on and off. None of them should be common mode, if anything they are differential, which is why they can be referenced the the opposite rail instead of ground.

Referring to the opposite rail also eliminates 3 components, ie. you only need one CRC node instead of two. And eliminates the need for the return ground connection as well.

All passives are 0805. It would be a lot neater with 0603, but those aren't compatible with my caffeine intake.

It's the psychical shape, not size, that dominates how much ESL an SMD capacitor has so naturally 0603 types would be just as bad as 1206 types (well, almost). Don't think you can get bootstrap caps in less than 1210 size if the advise of 10 times supply voltage rating is followed.

My reasoning is basically just more ferrite = less EMI. Might as well try to nip the problem of a radiating power supply cable in the butt.

Adding resistance, even very little, to the power supply line is definitely not a good idea. Trust that your power supply can supply clean power, or fix that. Don't mess with the power inputs.

I get that that is the right way, but they're digital inputs and connected with very low impedance to (the supposed ;)) AGND pin.

Still not a good reason to cut corners. But sure the AMs can be connected directly to the chip pad. The MUTE pin should not though.
 
Last edited:
Hey. You don't have to take my advise :) I'm just a perfectionist. Please note that evaluation boards are just that. Boards to demonstrate the function of the chip and a reference for designers. They are never meant as being the only and final implementation, and there's many things that can be done a lot better.
I do want to get the most out of this chip. And i do want to do things the right way. It's just that most design choices are compromises. Slicing up the top ground pour will invariably result in worse thermal performance. But if it results in noticeably better performance in some other way i'm good with that.

It's for EMI suppression in general, more specifically the first C works in combination with the ferrite bead to from a 2-pole filter in the FM frequency range. The RC part works at the switching frequency (and in the AM frequency range) by reducing overshots when the output transistors turn on and off. None of them should be common mode, if anything they are differential, which is why they can be referenced the the opposite rail instead of ground.

Referring to the opposite rail also eliminates 3 components, ie. you only need one CRC node instead of two. And eliminates the need for the return ground connection as well.
The BD-modulation scheme, with both outputs switching in the same direction at the same time ought to generate some amount of common-mode noise.

It's the psychical shape, not size, that dominates how much ESL an SMD capacitor has so naturally 0603 types would be just as bad as 1206 types (well, almost). Don't think you can get bootstrap caps in less than 1210 size if the advise of 10 times supply voltage rating is followed.
Ok, i get it, but why the big deviation from the datasheet? Faster rise time? Illuminate me.

Adding resistance, even very little, to the power supply line is definitely not a good idea. Trust that your power supply can supply clean power, or fix that. Don't mess with the power inputs.
It's coupling switching noise (from the amp) back into the power supply cable i'm worried about. Also, these ferrite beads have <4mOhm of DC resistance.

Still not a good reason to cut corners. But sure the AMs can be connected directly to the chip pad. The MUTE pin should not though.
They're digital inputs with hysteresis. I don't get it. What sort of problem is going to arise?
 
The BD-modulation scheme, with both outputs switching in the same direction at the same time ought to generate some amount of common-mode noise.

Enough to necessitate using 3 extra components and a difficult to optimally route ground connection. Not in my opinion but yours may vary.

Ok, i get it, but why the big deviation from the datasheet? Faster rise time? Illuminate me.

Ceramic capacitor are not very linear nor noise free when voltages near their rated voltage. You should always use ceramic capacitor with 10 times (4 times minimum) the voltage rating required in every case where the capacitor is in the direct signal path (bootstrap capacitors are in the direct output signal path).

It's coupling switching noise (from the amp) back into the power supply cable i'm worried about. Also, these ferrite beads have <4mOhm of DC resistance.

If it's a problem for you use external ferrite beads. Not on-board.

They're digital inputs with hysteresis. I don't get it. What sort of problem is going to arise?

Probably none but it is still good practice to keep something that is referenced to a specific rail also to be ground referenced to the same.

I also recommend using the FAULTZ pull-up connection of MUTE as described in the data sheet. Although the data sheet is completely wrong in how it's actually done. If done like the data sheet suggests it will work, and will likely damage the chip. Do it as it's done in the eval board instead.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.