Class D Speaker Driver - Page 1
Forum section: electronics / projects

author: gnuarm
author_rank: Super Contributor
timestamp: February 19, 2021, 07:25:06 pm
content: 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.

author: Benta
author_rank: Super Contributor
timestamp: February 19, 2021, 07:34:23 pm
content: And your question is?

author: gnuarm
author_rank: Super Contributor
timestamp: February 19, 2021, 07:48:15 pm
content: Quote from: Benta on February 19, 2021, 07:34:23 pmI 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?

author: Benta
author_rank: Super Contributor
timestamp: February 19, 2021, 08:12:17 pm
content: 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.

author: mikerj
author_rank: Super Contributor
timestamp: February 19, 2021, 08:39:46 pm
content: 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

author: gnuarm
author_rank: Super Contributor
timestamp: February 19, 2021, 10:02:11 pm
content: Quote from: Benta on February 19, 2021, 08:12:17 pmWhat 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.

author: Benta
author_rank: Super Contributor
timestamp: February 19, 2021, 10:38:00 pm
content: Quote from: gnuarm on February 19, 2021, 10:02:11 pmPower 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 DFor 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.

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 12:43:25 am
content: Quote from: Benta on February 19, 2021, 10:38:00 pmNot 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.QuoteThen 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.QuoteWhat 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.

author: bdunham7
author_rank: Super Contributor
timestamp: February 20, 2021, 12:49:37 am
content: 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.

author: drussell
author_rank: Super Contributor
timestamp: February 20, 2021, 02:07:05 am
content: Quote from: gnuarm on February 20, 2021, 12:43:25 amWhy would you run an audio amplifier output stage from the lowest voltage in your product? That would be silly.

author: drussell
author_rank: Super Contributor
timestamp: February 20, 2021, 02:12:12 am
content: Quote from: gnuarm on February 20, 2021, 12:43:25 amYou 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 whatyouare trying to accomplish.

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 02:37:39 am
content: Quote from: bdunham7 on February 20, 2021, 12:49:37 amYes, 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!

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 02:43:07 am
content: Quote from: drussell on February 20, 2021, 02:07:05 amExactly! 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.

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 02:47:31 am
content: Quote from: bdunham7 on February 20, 2021, 12:49:37 amThe 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

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 02:51:04 am
content: Quote from: drussell on February 20, 2021, 02:12:12 amNot 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.

author: bdunham7
author_rank: Super Contributor
timestamp: February 20, 2021, 03:00:49 am
content: Quote from: gnuarm on February 20, 2021, 02:47:31 amTypically 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.

author: coromonadalix
author_rank: Super Contributor
timestamp: February 20, 2021, 04:10:07 am
content: 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% efficiencyHave 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

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 06:27:26 am
content: Quote from: bdunham7 on February 20, 2021, 03:00:49 amYes, 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.

author: tooki
author_rank: Super Contributor
timestamp: February 20, 2021, 02:08:03 pm
content: 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.)

author: gnuarm
author_rank: Super Contributor
timestamp: February 20, 2021, 09:21:03 pm
content: Quote from: tooki on February 20, 2021, 02:08:03 pmNot 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.

author: bdunham7
author_rank: Super Contributor
timestamp: February 20, 2021, 09:33:23 pm
content: Quote from: gnuarm on February 20, 2021, 06:27:26 amI 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?

author: Zero999
author_rank: Super Contributor
timestamp: February 20, 2021, 09:55:08 pm
content: Quote from: gnuarm on February 20, 2021, 02:37:39 amA single transistor won't do, because it can only source, or sink. Two transistors are required for push-pull.

author: gnuarm
author_rank: Super Contributor
timestamp: February 21, 2021, 09:57:50 am
content: Quote from: bdunham7 on February 20, 2021, 09:33:23 pmYes, 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.

author: Zero999
author_rank: Super Contributor
timestamp: February 21, 2021, 02:28:17 pm
content: 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.

author: bdunham7
author_rank: Super Contributor
timestamp: February 21, 2021, 05:03:46 pm
content: Quote from: gnuarm on February 21, 2021, 09:57:50 amBy 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-pinput 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.QuoteIf 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?

author: gnuarm
author_rank: Super Contributor
timestamp: February 21, 2021, 08:26:24 pm
content: The FPGA has 3.3V outputs, but I have control over the logic and can tristate if useful. My thinking is to generate a pair of opposite polarity, non-overlapping signals from the FPGA to control the high and low side drivers. Zero's design avoids using a level shifter for the high side by AC coupling a common drive signal.I'm sorry, but I still don't get why you are talking about saturation. In a D class amplifier the goal is to saturate. I'm not trying to build a class B amplifier. Well, I'm not thinking of it as class B since the only values that will be fed into it are max of either polarity, which pretty much makes it class D. By not saturating power is being expended in the transistors that is not needed.I think it is pretty clear I'm not grasping something fundamental about what you are saying.One thing I realized running Zero's simulation, I had not looked at the 2N7002's Ron, it's a bit high for this, so I'll need different transistors no matter what. Minimizing the BoM is something I prefer, but on this project there's no point. I'm not the only designer and people seem to be happy throwing whatever part onto the board regardless of what else is already in use.

author: gnuarm
author_rank: Super Contributor
timestamp: February 21, 2021, 08:41:06 pm
content: Quote from: Zero999 on February 21, 2021, 02:28:17 pmActually, your circuit turns off both transistors when no AC is present. So it's safe in that regard which is useful since the idle state is no pulses. The PWM signal is at least 32 kHz, but that might be too low I've realized. So perhaps 128 kHz or even 256 kHz. That lowers the resolution of the value being output (33 MHz clock), but there are ways to dither the PWM to get more resolution than allowed by a simple PWM.The 32 kHz rate is not too low for the speaker, but it will be harder to filter out for EMI purposes. The chips work at higher frequencies to make them easier to filter. In fact, many claim "no filter required" but I expect they are referring to the need to filter for acoustic purposes. They talk about using ferrites in the filter, but even at 250 kHz ferrites are not effective. Ferrites will help with much higher frequencies, but not the fundamental. I don't recall EMI standards. Are the sub MHz frequencies not such an issue?

author: bdunham7
author_rank: Super Contributor
timestamp: February 21, 2021, 08:59:32 pm
content: Quote from: gnuarm on February 21, 2021, 08:26:24 pmI only mentioned it because you expressed specific concerns about shoot-through with the push-pull arrangement. Saturating the transistors will limit the rate at which you can switch the output state without having both transistors on at the same time. Without seeing the actual setup, I wouldn't know whether this is a concern or not.

author: Zero999
author_rank: Super Contributor
timestamp: February 21, 2021, 09:42:43 pm
content: Quote from: gnuarm on February 21, 2021, 08:41:06 pmThe problem is if the input is left to float when the power is applied, both Q1 & Q2 simultaneously turn, as C2 & C3 charge.QuoteOnce it's settled to the steady state, with C2 & C2 charged, it should be fine with the input floating.QuoteWhat sort of sound do you want to produce? I thought it was just a square wave. 32kHz should be fine. Keep the cable to the speaker short, make it a twisted pair and EMI won't be a problem.

author: james_s
author_rank: Super Contributor
timestamp: February 22, 2021, 12:12:50 am
content: I've used some little class D amp modules, I forget the part number but I got them for 99c shipped which is not much more than the cost of a single mosfet. They're tiny and work well, nothing on the module besides the IC and a few passives. Easier than designing something.

author: gnuarm
author_rank: Super Contributor
timestamp: February 22, 2021, 12:46:05 am
content: Sure, it's hard to communicate these things without a design in front of you.I'm still considering my options. Since a self designed driver will take so many different parts, I'm still considering a single chip amp or motor driver. I haven't found a simple class D amp that will work from 7.5V. Above 5V they all seem to become large handling many watts, also the $$$ start mounting.This motor driver seems to ring all the bells.https://www.onsemi.com/pub/Collateral/LV8548MC-D.PDFIt will actually work from 5V to the full battery voltage and will drive both speakers. One issue I'm not certain of is the "standby" state. Seems having all the inputs low puts the device in a low power state which takes 7 us to exit from. If I want the reverse drive to not have any overlap (this part doesn't seem to have any internal timing to prevent that) and use the LL input state the chip goes into standby with the 7 us delay exiting. But I think I can use HH for the non-overlap state. The doc calls this "brake", but I think it connects both outputs to the positive rail forming a current loop. This is easy to exit from without passing through the LL state. I just wish they gave more timing info, but I expect it will be ok at 256 kHz.One problem with the H bridge chips is that I need to detect the current to tell if the speaker is open or shorted. So maybe a home rolled design is required.

author: gnuarm
author_rank: Super Contributor
timestamp: February 22, 2021, 07:14:04 am
content: I think I have settled on a part that will do the job. It's a dual full bridge motor controller, LV8548MC. This will give the maximum range of power and require essentially no additional components, it's cheap, readily available and works with all the voltages in the system.https://www.onsemi.com/pub/Collateral/LV8548MC-D.PDFThe only fly in the ointment is the lack of current monitoring... but I think I've figured that out. The current monitor only needs to be crude to detect no current (open speaker) and far too much current (shorted speaker). The resistance of the FETs is not as low as in other devices and specified to be within a 2:1 range. I can time the measurement to coincide with the low side FET being turned on and use LVDS inputs on the FPGA as comparators. The other motor drivers had too low resistance to produce enough voltage for this to work. Who would have thought the "crappy" part would be the desired one?This will use a lot of I/Os on the FPGA, 12 total. Those comparators are using 8, two for each measurement. Otherwise this is a simple driver approach. I always knew the current sensing would be tricky. Rather than use four comparators, I could use two as the inputs for two ADCs. But that still requires two outputs for the feedback signal so only saving two I/Os. We should have plenty of I/Os, so not likely a problem.

author: bdunham7
author_rank: Super Contributor
timestamp: February 22, 2021, 02:49:31 pm
content: Wow! That alarm must be pretty important.If I may ask, what action will your device take if it senses a failure in the speaker drive system?

author: wizard69
author_rank: Super Contributor
timestamp: February 22, 2021, 05:21:03 pm
content: Buy a buzzer that makes the noise you want and switch it on an off with that single transistor. I work with machinery from dozens probably hundreds of manufactures and nobody would even bother with a speaker as an alarm. The usual approach is some sort of buzzer or possibly a bell. It doesn't matter what the controller is made of either, could be a custom CNC, PLC or a single board computer. It comes down to what you waste your time on and noise makers are not a place to do that.Quote from: gnuarm on February 20, 2021, 02:47:31 am

author: gnuarm
author_rank: Super Contributor
timestamp: February 22, 2021, 08:39:46 pm
content: Quote from: bdunham7 on February 22, 2021, 02:49:31 pmFirst, there is redundancy in the alarm speakers. So if one is not working it sounds a separate alarm indicating the "alarm" is not working 100%. lol Yeah, I know. This is for a circuit that someone's life depends on, an open source ventilator.The overall design has multiple fail safes. Human foibles are not as well accommodated. That's not my problem. I'm coding parts of the FPGA and much of the control circuit board.

author: gnuarm
author_rank: Super Contributor
timestamp: February 22, 2021, 08:44:45 pm
content: Quote from: wizard69 on February 22, 2021, 05:21:03 pmI guess that while you quoted my post, you missed the part where I said...Quote from: gnuarm on February 20, 2021, 02:47:31 amI appreciate that you think you are helping, but this is not a hobby project. There are specific guides and specifications. The sounds produced by this equipment are in fact clearly indicated and a simple buzzer does not suffice other than as a backup which we are indeed using to indicate a failure in the alarm system itself.

author: bdunham7
author_rank: Super Contributor
timestamp: February 22, 2021, 08:47:17 pm
content: Quote from: gnuarm on February 22, 2021, 08:39:46 pmDoes the FPGA have other functions or is it just the alarm?

author: gnuarm
author_rank: Super Contributor
timestamp: February 22, 2021, 09:03:03 pm
content: Quote from: bdunham7 on February 22, 2021, 08:47:17 pmLol! Remember, "just" is a four letter word! To manage the alarm, some 5 different parameters are measured with ADCs, others are detected with binary inputs and a UI provides the management of limit settings and other operating parameters not associated with the alarm... no point in having two UIs.The idea is to separate the alarm function so it can be separately approved, no dependency on the MCU software and no interference with the operation of the machine. Think of it as the MCU does the work of running the machine and the FPGA is the overlord watching for mistakes.

author: Zero999
author_rank: Super Contributor
timestamp: February 22, 2021, 09:34:39 pm
content: Quote from: wizard69 on February 22, 2021, 05:21:03 pmIf you look inside lots of alarm modules you'll find, they quite often have a speaker driven by an amplifier and an oscillator, or a synthesiser. Obviously this doesn't apply to plain old bells and buzzers, but certainly does to those which make more complex sounds, that can be changed/varied, i.e. the type with a small switch, or multiple inputs for different sounds.If the intention is to integrate this into a small, compact enclosure, then it certainly makes sense to use a speaker, class D amplifier and software/hardware synthesiser, especially if there's an FPGA sitting there with a lot of unused gates, ready to do the job. It has the advantage of flexibility:the alarm sound can be changed with a little programming, rather than having to change the entire alarm module, if it can't make the desired sound.A similar principle applies to other things such as switched mode power supplies and motor drives: in an industrial application, it would be preferable to use a ready built module, but in mass produced consumer electronics, it's often cheaper to add it to the PCB and there might not be space, for a bulky industrial module.

author: gnuarm
author_rank: Super Contributor
timestamp: March 04, 2021, 08:09:49 pm
content: Quote from: Zero999 on February 21, 2021, 09:42:43 pmThis AC biasing idea does not work for this use. The square wave is not always full volume. I was planning to use PWM to control the amplitude. This biasing centers the PWM signal at some voltage level on the high side that no longer turns on the high side transistor when the duty cycle is very low (from the source perspective). The drive at the PNP base becomes 1.5 V more positive than the high rail, but only swings to -0.14 V relative to the emitter when the PNP should be turning on.Direct drive only takes one more device to level shift the signal. I prefer FETs because of the limitations of hfe with higher currents in bipolar transistors.I'm wondering if this requires a push-pull arrangement at all. The high side switch provides current into the speaker, but can the low side switch be replaced by a Schottky diode to ground as is used in switching power supplies. Then only one output is required. Or the configuration can be reversed with a low side driver to ground and a diode to the V+ rail. The only disadvantage is the other end of the speaker is connected to the V+ rail, but through a capacitor which removes the DC component.I'll try running a sim on that.

author: Zero999
author_rank: Super Contributor
timestamp: March 05, 2021, 11:07:07 am
content: Quote from: gnuarm on March 04, 2021, 08:09:49 pmYes, the AC couped configuration does impose limits on the duty cycle, but that only applies at DC. My guess is that your simulations were conducted, either with fixed duty cycles, which don't reflect the reality of a continous cycle sweeping between 5% and 95%, or the coupling capacitors were undersized. The audio signal should have no net DC component, so the duty cycle, averaged over the entire waveform period will be 50%. The capacitors need to be big enough to pass the lowest frequency component of the signal, without shifting the bias point. It's no good just selecting values which are adequate for the switching frequency, if the audio signal can go down to 20Hz.No, a push-pull arrangement is required if you want to avoid DC in the speaker coil. If you want half-bridge, then an AC coupling capacitor is required, unless it's a bipolar power supply. A buck converter only outputs current flowing in one direction. In low power applications, it might be acceptable to just connect one side of the speaker to +V and the other to a transistor, but half of the power will be dissipated as heat in the speaker coil, which is only tolerable at low power levels.I thought you'd settled on the LV8548MC? If only one channel is required, the two can be connected in parallel for low on resistance.

author: gnuarm
author_rank: Super Contributor
timestamp: March 05, 2021, 09:27:27 pm
content: I have "settled" on several approaches but there's always something that nags at me and I end up revisiting this. The issue with the half bridge is the current spikes that seem to be inevitable. I think that might have been from the AC coupled drive not turning off fast enough causing shoot through even with some ns of non-overlap. The motor drivers are not specified how fast they can work. The class D audio amps either won't work from 7.5 V or are big clumsy things intended for high power... or both. TI has some chips that require 8 V to work, lol.So last night I simulated a full bridge using MOSFETS and separate drives for high and low sides with level shifting for the high side drive. Don't have to worry about overlap as I am only using one path at a time pulsing it on and off. The other pair is used for the other direction. I'm happy to post an LTspice file if anyone is interested. It seems to work pretty well with max current spikes of 100's of mA rather than amps. A 10 uF cap on the power rail does a good job. I have ferrites on the leads to the speaker. Many audio data sheets show small caps to ground on these outputs for noise issues. Is one cap across the output just as good or should they be common mode to ground?I'd like to get models of the components in use. The FETs have models but I haven't plugged them in (LTspice is a PITA in that regard) yet. I don't know much about the ferrite beads. LTspice only has Würth ferrites but I modified one a bit to match up better to the ferrites I am using. Then there is the speaker... I can bug the vendor for an electrical model. Seems they are willing to provide Thiele-Small parameters which I can calculate electrical parameters.So at the moment this is the approach I want to follow. I can add a resistor to the ground path for the low side sources to measure current. Each speaker uses six transistors, but the power path parts can be a combination N and P channel package limiting the board space requirement. I guess the bottom line is this approach gives more confidence of working while still being inexpensive and not complex. The only concern really is EMC.

author: gnuarm
author_rank: Super Contributor
timestamp: March 09, 2021, 07:17:30 pm
content: So when an H bridge motor controller is in freewheel, is that all transistors open, or both ends grounded? What is brake mode? It appears they call freewheel opening all transistors, but the inductor current has to go somewhere, so through the body diodes (or protection diodes) with voltage drop and dissipation. Connecting both ends of the load to ground (or both to power) routes the current through a low resistance path dissipating less power, so why is this called "brake" mode? I think it is because there are two separate back EMFs, one inductive and the other a motor back EMF. The inductive EMF always resists a change in current, -L di/dt. The motor EMF is from the motor turning in the magnetic field. When opening the circuit on a rotating motor with current the two have opposite signs. So the inductive EMF will channel through the diodes until dissipated. The motor EMF does not flow which is good because it would brake the motor, hence "brake" mode. These are two separate effects.I found the MP6519 motor controller which has means of measuring the current. The data sheet does not describe the output operation in enough detail for me to know the alternate state of the outputs when in current limit mode (PWM in other words). The part has a mode pin that controls the direction of applied voltage. It generates an internal saw tooth to control the PWM width. One end of the load is pulled high and the other low in a PWM duty cycle set by the current in the load and the input control. Sooo...What I don't know is what the other state of the output transistors is. I'm guessing it is the free wheeling mode where the output FETs are all off, aka "freewheeling" conducting the inductive back EMF current through the body diodes. Not sure if this is good for a speaker. What states does a class D amp use exactly? Is that the difference with a motor controller?

author: gnuarm
author_rank: Super Contributor
timestamp: March 09, 2021, 07:21:48 pm
content: The big fly in the ointment for most drivers I've found is the lack of current measurement. One way around this is to add a series resistor in the speaker path connected via a diode bridge. Then the current in the resistor is always unidirectional even if not ground referenced so an op amp is needed. But that's a few extra parts. I would need to go back over the class D amp list to find something not overly complex that works at 7.5V.