Author Topic: Class D Speaker Driver  (Read 17638 times)

0 Members and 2 Guests are viewing this topic.

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Class D Speaker Driver
« on: February 19, 2021, 07:25:06 pm »
Without giving it much thought I expected to drive a speaker with a single FET.  I think that is not totally realistic at 1 to 2W.  I'm thinking of a half bridge drive and rather than roll my own, I figured I'd use a chip.  Lots of class D amps out there, but way more than a FET in every respect including size, complexity, cost.

I looked for simple half bridge driver chips and lots of them are really gate drivers which seem to require a boost circuit which means the output needs to be toggling all the time.  This app won't be doing that...  so will the chip function properly?  I don't know. 

These parts otherwise seem good for the job, TTL compatible drive voltages simple interfaces... well, some of them.  One that is otherwise suited to the job is designed for being driven by a Hall effect sensor and barely describes the action interface. 

All the class D parts I've seen are a bit pricier than I'd like, several dollars.  The gate and motor drivers can be under half a dollar.  Allegro makes a line of parts that should do the job, A3901 and A3909 both look like candidates.  They could be used as full bridge drivers.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7179
  • Country: de
Re: Class D Speaker Driver
« Reply #1 on: February 19, 2021, 07:34:23 pm »
And your question is?

 
The following users thanked this post: tooki

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #2 on: February 19, 2021, 07:48:15 pm »
And your question is?

I didn't know a question is required.  Just looking for comments, particularly from anyone who has done this. 

I was looking at a similar configuration for generating a negative voltage from a positive rail.  In the end the 7660 is the simplest and cheapest solution.  It is similar in having a few FETs used as switches on the output.  With appropriate inputs and separated outputs for each FET a single device could be used for both applications (can you say analog switch?).  But the current drive is higher for the speaker, enough so I'm not likely to find such a device other than a motor controller.  Maybe there are analog switches out there somewhere that will do both functions...  Not sure it's important enough to worry with.

So any thoughts?
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7179
  • Country: de
Re: Class D Speaker Driver
« Reply #3 on: February 19, 2021, 08:12:17 pm »
My thought is that for 1...2 W it's not worth the effort, a class B would be fine. But you may have special requirements.

 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3671
  • Country: gb
Re: Class D Speaker Driver
« Reply #4 on: February 19, 2021, 08:39:46 pm »
Rather than rolling your own with discrete mosfets and a driver etc. why not just buy an integrated class D amplifier?  They are common and inexpensive e.g. https://www.digikey.com/catalog/en/partgroup/class-d-amplifier/184
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #5 on: February 19, 2021, 10:02:11 pm »
My thought is that for 1...2 W it's not worth the effort, a class B would be fine. But you may have special requirements.

What effort exactly?  What class B alternative exists?  I didn't see much when I looked about.  There are plenty of devices that will pump out ~1 W max on 5V, but aren't rated for more voltage. 

I'd like to minimize the current consumption.  We have 7.5V which is regulated to 5 and 3V with linear regs.  Higher impedance speakers draw less current wasting less power. 

Maybe you are right and I should not try to optimize this so much.  There are tons of cheap class D driver chips.  To find one that runs from 7.5V means a much bigger package and a bigger price.  Doesn't hurt to look at alternatives though. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7179
  • Country: de
Re: Class D Speaker Driver
« Reply #6 on: February 19, 2021, 10:38:00 pm »
Higher impedance speakers draw less current wasting less power. 

Power is power. Whether it's at a high voltage or a low voltage or a low impedance or a high one: no difference.

The difference when discussing speaker amplifiers is: where's the power dissipated?

Ideally: only in the speaker. That's the promise of class D.
Otherwise: also in the power output stage of a class B amplifier.

For a 500 W amp it makes sense to go to class D
For a 1...2 W amp, I'd say that the power savings using class D are marginal compared to complexity and power dissipation in the control circuitry.

 
The following users thanked this post: tooki

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #7 on: February 20, 2021, 12:43:25 am »
Higher impedance speakers draw less current wasting less power. 

Power is power. Whether it's at a high voltage or a low voltage or a low impedance or a high one: no difference.

The difference when discussing speaker amplifiers is: where's the power dissipated?

Ideally: only in the speaker. That's the promise of class D.

Not completely correct.  As I said, 7.5V is supplied to the board.  5V and 3V are regulated using linear regs.  So if you run from 3.3V you will have to draw more current to output the same power which burns more power in the regulators.  If the "amp" is run from the 7.5V rail there is no additional power in the regulators.


Quote
Otherwise: also in the power output stage of a class B amplifier.

Then there is the issue that the signal being produced is a trapezoid with rise and fall times only in the 10% range.  So even a class B amp would be fairly efficient when the max volume is produced.  I'm not actually certain of the volume level we will need since it depends on a number of uncontrolled or not yet analyzed factors like the cabinet size and configuration, but it is an alarm.  I have a minimum level spec, but no max.   ;D

Quote
For a 500 W amp it makes sense to go to class D
For a 1...2 W amp, I'd say that the power savings using class D are marginal compared to complexity and power dissipation in the control circuitry.

What is your standard to say the wasted power is not important?  Are you aware of the overall design?  The power lost from the energy source may not be a big issue, but the power poured into the board is an issue. 

Mostly I don't see a down side to class D.  I can get two amps on one device for some $0.60... not much more than a couple of transistors. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9439
  • Country: us
Re: Class D Speaker Driver
« Reply #8 on: February 20, 2021, 12:49:37 am »
You mentioned a 'trapezoid' signal--is this just a beeper or annunciator of some kind?  Why would you need to drive the speaker with both polarities?  You can just use the signal to turn a transistor completely on and completely off, it should sound about the same.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline drussell

  • Super Contributor
  • ***
  • Posts: 1855
  • Country: ca
  • Hardcore Geek
Re: Class D Speaker Driver
« Reply #9 on: February 20, 2021, 02:07:05 am »
Not completely correct.  As I said, 7.5V is supplied to the board.  5V and 3V are regulated using linear regs.  So if you run from 3.3V you will have to draw more current to output the same power which burns more power in the regulators.  If the "amp" is run from the 7.5V rail there is no additional power in the regulators.

Why would you run an audio amplifier output stage from the lowest voltage in your product?  That would be silly.
 

Offline drussell

  • Super Contributor
  • ***
  • Posts: 1855
  • Country: ca
  • Hardcore Geek
Re: Class D Speaker Driver
« Reply #10 on: February 20, 2021, 02:12:12 am »
For a 500 W amp it makes sense to go to class D
For a 1...2 W amp, I'd say that the power savings using class D are marginal compared to complexity and power dissipation in the control circuitry.

What is your standard to say the wasted power is not important?  Are you aware of the overall design?  The power lost from the energy source may not be a big issue, but the power poured into the board is an issue.

You say total power consumption is an issue, yet you are using linear regulators.

I'm afraid you're going to have to be a lot more specific than your vague description about what your intended application is and what the requirements are if you want any kind of useful answers. 

Nobody here knows what you are trying to accomplish.
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #11 on: February 20, 2021, 02:37:39 am »
You mentioned a 'trapezoid' signal--is this just a beeper or annunciator of some kind?  Why would you need to drive the speaker with both polarities?  You can just use the signal to turn a transistor completely on and completely off, it should sound about the same.

Yes, but that requires more current to get the same power since the current only flows part of the time.  In fact it imparts a DC component that produces no sound in the speaker.  I've done the math on this before and pulsed DC has an AC and a DC component with the DC producing nothing but heat.  To look at it another way, consider that the power is proportional to the voltage (or current) squared.  Half the duty cycle at twice the voltage (or current) is twice the power, but it's the same Vpp, so the same sound from the speaker.  Consider that the speaker is pushed out, but never pulled back, just allowed to "float" wasting much of the energy in the spring. 

I started out thinking I could use a single transistor and a DC blocking cap, but that was far short of the goal... brain cramp!
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #12 on: February 20, 2021, 02:43:07 am »
Not completely correct.  As I said, 7.5V is supplied to the board.  5V and 3V are regulated using linear regs.  So if you run from 3.3V you will have to draw more current to output the same power which burns more power in the regulators.  If the "amp" is run from the 7.5V rail there is no additional power in the regulators.

Why would you run an audio amplifier output stage from the lowest voltage in your product?  That would be silly.

Exactly!  That's why I'm looking for something to run on the 7.5V rail, but that cuts the number of options hugely.  Seems 5V is the sweet spot for such components with all the mobile devices these days.  The components that run on higher voltages get large and powerful very quickly.  They are still cheap, but I don't need a 29 pin device rated for 15W to run 1-2W into a couple of speakers.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #13 on: February 20, 2021, 02:47:31 am »
You mentioned a 'trapezoid' signal--is this just a beeper or annunciator of some kind?  Why would you need to drive the speaker with both polarities?  You can just use the signal to turn a transistor completely on and completely off, it should sound about the same.

The purpose of the signal is as an alarm.  Waveform characteristics are provided, frequency, harmonic content, envelope and cadence.  That's not hard to manage.  I just need to get it to the speaker with a minimum of kerfuffle in the electronics.  I don't know why I thought a transistor would do the job, lol
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #14 on: February 20, 2021, 02:51:04 am »
For a 500 W amp it makes sense to go to class D
For a 1...2 W amp, I'd say that the power savings using class D are marginal compared to complexity and power dissipation in the control circuitry.

What is your standard to say the wasted power is not important?  Are you aware of the overall design?  The power lost from the energy source may not be a big issue, but the power poured into the board is an issue.

You say total power consumption is an issue, yet you are using linear regulators.

I'm afraid you're going to have to be a lot more specific than your vague description about what your intended application is and what the requirements are if you want any kind of useful answers. 

Nobody here knows what you are trying to accomplish.

Not asking you to design the system.  If you would like to participate in the greater design, I would be happy to talk to you about it and introduce you to the project lead.  How about we don't get into all the details here.  They really are not relevant. 

Perhaps you are not aware that linear regulators can be more efficient than switchers depending on voltage?  They are also less noisy.  Noise can be a big issue. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9439
  • Country: us
Re: Class D Speaker Driver
« Reply #15 on: February 20, 2021, 03:00:49 am »
I don't know why I thought a transistor would do the job, lol

Typically it would if you were less picky about efficiency.  However, if you want it to be that good, you can use two transistors (a complementary pair like 2N3904/2N3906 might work) and a blocking capacitor, plus a few resistors and such, in a single supply push-pull configuration. 
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Online coromonadalix

  • Super Contributor
  • ***
  • Posts: 8822
  • Country: ca
Re: Class D Speaker Driver
« Reply #16 on: February 20, 2021, 04:10:07 am »
Why not use an lm386, cheap and easy to implement 4 -12 vdc operation ?

Your mosfet idea is overkill for a simple 1-2 watt output, and trying to get a 90% efficiency

Have you checked  class A thru  H operations, and the requirement(s) ?   

I never saw a low voltage class D,  i did saw  class H amplifiers down to 9-12vdc 

 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #17 on: February 20, 2021, 06:27:26 am »
I don't know why I thought a transistor would do the job, lol

Typically it would if you were less picky about efficiency.  However, if you want it to be that good, you can use two transistors (a complementary pair like 2N3904/2N3906 might work) and a blocking capacitor, plus a few resistors and such, in a single supply push-pull configuration.

Yes, I have considered that, but it requires coordination of the two transistors to prevent shoot through.  This board needs to be as quiet as possible and a pair of FETs shorting the power rail to ground for some ns is not a good idea. 

At this point I'm happy with several class D amps from Diodes, Inc.  They are cheap, simple and you can even get them at JLCPCB.  One is a dual and has a mode switch for AB operation.  The speakers I've found will be able to take the full power from the device, so in AB mode it won't be much worse than class D other than there will be no EMI to speak of.  They run the modulator at 250 kHz and claim it doesn't need chokes to prevent a bunch of EMI, but they do recommend a ferrite bead on each speaker line for class D.  At least that chip gives me choices.  PAM8406, $0.21 in quantity at LCSC, $0.40 elsewhere. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 15995
  • Country: ch
Re: Class D Speaker Driver
« Reply #18 on: February 20, 2021, 02:08:03 pm »
Why not just use a complete buzzer module? They come in every imaginable voltage rating, and you just give them voltage and they beep. You can get really loud ones if need be. (Look at alarm system vendors.)
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #19 on: February 20, 2021, 09:21:03 pm »
Why not just use a complete buzzer module? They come in every imaginable voltage rating, and you just give them voltage and they beep. You can get really loud ones if need be. (Look at alarm system vendors.)

Not trying to make just any sound.  I think I mentioned there are specific goals.  They do make modules for this specific function, but they are very expensive and likely not readily available in quantity. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9439
  • Country: us
Re: Class D Speaker Driver
« Reply #20 on: February 20, 2021, 09:33:23 pm »
Yes, I have considered that, but it requires coordination of the two transistors to prevent shoot through.  This board needs to be as quiet as possible and a pair of FETs shorting the power rail to ground for some ns is not a good idea. 

 PAM8406, $0.21 in quantity at LCSC, $0.40 elsewhere.

I meant BJT without biasing so all you would need to do is avoid saturating them and shoot-through wouldn't be an issue.  Minimal parts needed too.

So you'll have high-quality stereo sound!  But doesn't this require you to power it through one of your linear regulators?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22459
  • Country: gb
  • 0999
Re: Class D Speaker Driver
« Reply #21 on: February 20, 2021, 09:55:08 pm »
You mentioned a 'trapezoid' signal--is this just a beeper or annunciator of some kind?  Why would you need to drive the speaker with both polarities?  You can just use the signal to turn a transistor completely on and completely off, it should sound about the same.

Yes, but that requires more current to get the same power since the current only flows part of the time.  In fact it imparts a DC component that produces no sound in the speaker.  I've done the math on this before and pulsed DC has an AC and a DC component with the DC producing nothing but heat.  To look at it another way, consider that the power is proportional to the voltage (or current) squared.  Half the duty cycle at twice the voltage (or current) is twice the power, but it's the same Vpp, so the same sound from the speaker.  Consider that the speaker is pushed out, but never pulled back, just allowed to "float" wasting much of the energy in the spring. 

I started out thinking I could use a single transistor and a DC blocking cap, but that was far short of the goal... brain cramp!
A single transistor won't do, because it can only source, or sink. Two transistors are required for push-pull.
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: Class D Speaker Driver
« Reply #22 on: February 21, 2021, 09:57:50 am »
Yes, I have considered that, but it requires coordination of the two transistors to prevent shoot through.  This board needs to be as quiet as possible and a pair of FETs shorting the power rail to ground for some ns is not a good idea. 

 PAM8406, $0.21 in quantity at LCSC, $0.40 elsewhere.

I meant BJT without biasing so all you would need to do is avoid saturating them and shoot-through wouldn't be an issue.  Minimal parts needed too.

So you'll have high-quality stereo sound!  But doesn't this require you to power it through one of your linear regulators?

Yes, using transistors at all in a totem pole arrangement is an issue.  I'm not sure what you mean by "without biasing" and "avoid saturating".  Wouldn't those two things be mutually exclusive?  Maybe I'm not picturing what you are saying.  I believe when you say avoid saturation you mean class A or AB operation.  How is that done without biasing? 

Just to be clear, the goal is not "high quality stereo" sound.  The two channels are for redundancy, not stereo.  We are also not trying for audiophile quality THD or frequency response or anything else.  We have a frequency range to provide that is slightly beyond telephony range.   

If you have a simple circuit for a class D amplifier using transistors I'm all about that.  The one I came up with would have required three FETs for a single ended drive and either two outputs with the timing controlled from the FPGA (the source of the audio) or a circuit to prevent shoot through that I have not designed before.  Orrrrr I can use one of the many class D amplifier chips that I'm finding. 

I spent some more time with the problem today and it looks like a speaker will work from the 7.5V supply with a single ended driver.  It slightly misses the mark at the 9th harmonic, but the cabinet and surroundings have not been taken into account (which won't be).  So I think I'm going with this speaker and a three transistor driver.  I just need a simulation model for the speaker and I can sim it in LTspice to make sure the details are good.  The vendor seems willing to provide Thiele-Small parameters.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22459
  • Country: gb
  • 0999
Re: Class D Speaker Driver
« Reply #23 on: February 21, 2021, 02:28:17 pm »
If it's only ever going to be AC, BJTs can be biased and AC coupled to the I/O port, which shouldn't be allowed to float, otherwise both transistors will turn on, causing a short circuit. An additional pair of emitter followers may be required, if more base drive is required.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9439
  • Country: us
Re: Class D Speaker Driver
« Reply #24 on: February 21, 2021, 05:03:46 pm »
Yes, using transistors at all in a totem pole arrangement is an issue.  I'm not sure what you mean by "without biasing" and "avoid saturating".  Wouldn't those two things be mutually exclusive?  Maybe I'm not picturing what you are saying.  I believe when you say avoid saturation you mean class A or AB operation.  How is that done without biasing? 

By unbiased, I meant a Class-B amplifier where there is no quiescent current (other than leakage) in the idle state.  In a plain push-pull setup, you would need about 1.2Vp-p input before you got any output, anything less and both transistors stay off. 

Avoiding saturation means just that--limiting the base current to avoid a saturated transistor which has a delayed turn-off, which is the only way you would ever have shoot-through with what I'm describing.  This is quite unlikely to be an issue at audio frequencies with small-signal transistors as saturation recovery will usually be under 1µs.  Saturation will also obviously involve clipping and distortion, not that a Class-B amp will be all that nice in the first place.

Quote
Just to be clear, the goal is not "high quality stereo" sound.  The two channels are for redundancy, not stereo.  We are also not trying for audiophile quality THD or frequency response or anything else.  We have a frequency range to provide that is slightly beyond telephony range.   

If you have a simple circuit for a class D amplifier using transistors I'm all about that.  The one I came up with would have required three FETs for a single ended drive and either two outputs with the timing controlled from the FPGA (the source of the audio) or a circuit to prevent shoot through that I have not designed before.  Orrrrr I can use one of the many class D amplifier chips that I'm finding. 

I spent some more time with the problem today and it looks like a speaker will work from the 7.5V supply with a single ended driver.  It slightly misses the mark at the 9th harmonic, but the cabinet and surroundings have not been taken into account (which won't be).  So I think I'm going with this speaker and a three transistor driver.  I just need a simulation model for the speaker and I can sim it in LTspice to make sure the details are good.  The vendor seems willing to provide Thiele-Small parameters.

If your FPGA is providing the audio I assume the signal is single-ended (with a DC component) referenced to your board's common or ground, the same as  your power supplies?  If so, what is its output level in the 'OFF' state when there is no alarm?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->