Minimizing the class D distortion - Page 1
Forum section: electronics / projects

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: June 15, 2022, 06:53:21 am
content: The main distortion cause in class D amps is the dead time.The figure shows the open loop simulation of 1khz signal with 400khz switching and 50ns dead time. The output inductor carries a current depending inversely to its value and the switching frequency. When the load peak current is inferior to this current, at dead times, the reverse diodes of the outputs conduct, and the load gets its current from the discharging inductors and every thing goes well. The trouble starts when the load peak current exceeds the reserve current, the load goes floating at dead times and looses an offset current. To resolve this problem, is to detect this zone and add an offset voltage to the input. This what a patent of TI implemented in TPA325X series does.https://patents.google.com/patent/US7795970B2/enMuch simpler solution is to decrease the carrier frequency current to insignificant level by using a parallel L-C instead of L in output filter. The figure bellow shows the result with 20uh//(8nF+1ohm). The distortion passes from 2.4% to 0.18%. The 1 ohm is to limit the transient current, without it the distortion is 0.14%.Edit by gnif: No need for a thread title that yells (all caps).

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: June 15, 2022, 07:00:44 am
content: Output filter. The 10uH inductors are to show clean waves.

author: Zero999
author_rank: Super Contributor
timestamp: June 15, 2022, 12:47:22 pm
content: Sorry I can't help. I'm interested though. It looks like crossover distortion, which makes sense, since it's a type of dead time.

author: CaptDon
author_rank: Super Contributor
timestamp: June 15, 2022, 02:32:39 pm
content: Your example is for a full H-Bridge design which is now becoming very common not only for audio but for many applications like permanent magnet reversible motors with control loops. Most of the powerful audio amps are still two independent Half-Bridge output stages (Channel 1 and Channel 2) Which can function as a stereo amplifier or as a more powerful 'Bridged-Mono' mode where one channel will be driven 180 degrees out of phase and the load taken across the pair of channels. This allows greater flexibility for the same unit as the user decides what he wants the amp to do. Generally in the half bridge amplifiers there is the main 'restoring inductor' and often in series with the output will be a parallel resonant circuit tuned to the carrier frequency to suppress carrier radiation on the output mainly. I think the suppression tank circuit and the snubbing circuits to suppress destructive overshoots help eliminate the zero crossing dead time distortion since even during dead time there is current moving somewhere. Typical audio amps are 500Khz carrier with quality low distortion response up to 50Khz also showing very fast transient response with very little phase shift in the 20Hz to 20Khz audio range. The Peavey DECA 724 and 1200 schematics are on line and worth looking at how they did the output network. The DECA 524 has a truly weird half-bridge output.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: June 17, 2022, 12:27:37 pm
content: I simed in SE configuration, The distortion 400khz 50ns dt falls to 1.8% and with tank 0.15%. That is 11 times less distortion in SE than 13 times in BTL.The TDA8932 has 0.015% in SE for 1W/1khz but falls to 0.007% in BTL. I ordered a circuit board for $2 shipment inc. I will try it out hoping to get 0.0005% with tank.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 14, 2022, 08:47:08 am
content: I tried this idea on TPA3116d2. The 3$ board in PBTL had 30uH inductors that I replaced them with 10uH and modified the PCB to have them underside. On simulator, at 1W output without resonant tank the distortion measures 2.5% and falls to 0.06% with resonator, having a series resistor of 10 ohms. That's what I tried. The sound in not too bad without tank but gets harsh classD when multiple high pitch voices shout. With the C-R of 15nF and 10ohms 1W is applied the harshness disappears but the temperature of the chip goes much higher but acceptable and the 10 ohms 1W resistors becomes untouchable.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 14, 2022, 02:20:17 pm
content: I replaced the 10ohm 1W with 8.2ohm 5w ordinary "inductive" resistor. The chip got cooled.I use a floating differential input by a 600/10k transformer. The high frequencies are by far superior but no bass!

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 15, 2022, 08:27:16 am
content: Looking in more detail of TPA3116 I see that this is a different type of classD called BD type considering a standard to be AD type. Here what the DS speaks about.The main reason that the traditional class-D amplifier-based on AD modulation needs an output filter is that theswitching waveform results in maximum current flow. This causes more loss in the load, which causes lowerefficiency. The ripple current is large for the traditional modulation scheme, because the ripple current isproportional to voltage multiplied by the time at that voltage. The differential voltage swing is 2 × VCC, and thetime at each voltage is half the period for the traditional modulation scheme. An ideal LC filter is needed to storethe ripple current from each half cycle for the next half cycle, while any resistance causes power dissipation. Thespeaker is both resistive and reactive, whereas an LC filter is almost purely reactive.The TPA3116D2 modulation scheme has little loss in the load without a filter because the pulses are short andthe change in voltage is VCC instead of 2 × VCC. As the output power increases, the pulses widen, making theripple current larger. Ripple current could be filtered with an LC filter for increased efficiency, but for mostapplications the filter is not neededOn simulator with 400khz carrier 1W is still 2.5% distortion but as the inductor doesn't have carrier current in it there is no crossover type distortion which makes classD amps sound harsh.I wired the circuit to its simplest and 1.2Mhz gave very high quality sound. The board is adjusted to 36db gain that's why add 56k resistors to bring it to 20db. Of course the EMI is some problem here to comply FCC rules.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 16, 2022, 08:32:28 am
content: On simulator I could optimize the TPA3116 class BD type for 400khz. As I mentioned, the transfer function is far different than class AD. It resembles to pentode or mosfet output in class AB where above the class A region the gain increases. As the inductors don't have carrier current, it has very low bias this time, to increase it, I added 3.9nF capacitors to bring to linearity. As shows the distortion numbers, yes in open loop it has 5% THD but look at the relative phases of the odd harmonics, they are opposite phase. These opposite harmonics subtract with the other odd in phase harmonics and what is left after feedback, subtract that of the speaker. I am listening now since an hour with great pleasure.

author: moffy
author_rank: Super Contributor
timestamp: July 16, 2022, 11:00:17 pm
content: The waveform looks terrible for a sine wave. Also if you are modelling a speaker with your 8 ohm resistor, they are much more complex than that, including inductance and frequency dependant components which will interact in real life.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 17, 2022, 01:20:00 am
content: Indeed, by view it is not a beautiful sine wave. If you low bias a push pull output mosfets with degenerating source resistors you get a similar result. This to show you that the class BD has a different character than standard class D. bellow is the sine wave of AD and BD mode with lower biased 820pf.The impedance of the load is in bridge decoupled by 220nF and doesn't effect the LC resonance of each output. In BD mode the differential output doesn't see the carrier as the outputs have the same phase.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 17, 2022, 02:17:43 am
content: After listening the sound of classD with my tank distortion reducer and the classBD with bias, for me the classD is dead, long live the classBD. Next week I'll record the sound and post it.

author: moffy
author_rank: Super Contributor
timestamp: July 17, 2022, 02:33:05 am
content: Look forward to listening results. If you have any classical I would appreciate that as a symphony orchestra has both wide dynamic and frequency range that makes it easier to pick up blemishes.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 17, 2022, 03:40:45 am
content: Two things:1. Feed back on inductor current. Which, with an H-bridge, you might need a Hall effect sensor to facilitate that, though there are current sense amps that will handle pretty generous range, too.2. Servo the current setpoint based on voltage, thus setting voltage gain and distortion.#1 runs fast (loop BW somewhat less than Fsw), and corrects for errors due to inverter switching. This eliminates the above distortion.#2 runs slightly slower (say Fsw/10?) and sets output impedance, gain and etc. At high frequencies, it runs somewhat open loop (use pole-zero compensation), for which, the output likewise needs impedance equalization to maintain reasonable output impedance and flatness at the top end (typically a C || (R+C) network).Splitting the control into two separate loops, also divorces the LC output filter's poles, so that they can be treated separately -- and the whole system can potentially run faster than their cutoff would suggest.You may prefer voltage-mode control anyway, if Fsw is fairly low; but this should not be a problem here.Not that this is an SMPS project, but the current limit also provides short-circuit protection trivially, and, on that note, is perfectly usable as an SMPS if you make it DC coupled.As for the existing design without controls (or voltage mode only), what dead time is it? You can -- and probably should -- set dead time very narrow, as tight as you can afford given the control and driver circuitry: within 10s of ns should be reasonable. You likely will have to use a driver that does NOT implement dead-time control itself.What you get, with short deadtime, is very little difference between hard and soft switching, and full synchronous rectification with minimal recovery. The pulses can even be overlapping slightly (negative dead time, as it were), which is equally acceptable, so long as the switching loop inductance is well designed and snubbing is provided. Yes, rather than minimizing inductance, you may add some instead. Having it as a lumped element, is easier to snub. Value is easy enough to calculate: say you're doing 100V 10A output range, well, a peak of say half that or 5A for, let's say the drivers have worst-case +/-20ns timing, is L = V dt / dI = (100V) (20ns) / (5A) = 0.4uH. And snub that with, let's say Vpk <= 50V so at a maximum peak current of 15A, that's 50V/15A = 3 ohms. Which can be R or R+L across the inductor, or across each switch, or with a clamp diode, etc.Tim

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 17, 2022, 12:54:08 pm
content: Thank you Tim for so much advice. The dead time I am considering here is 50ns. I simulated with GaN with 5ns, it gives 0.07% THD at 100W in open loop.What concerns the feedback, the PSRR curves betray the NFB applied as the classD amps rely only upon feedback for power supply ripple rejection.Below are the curves of TDA8932, TPA3116, and TPA3221 That I suppose the 325x series are similar. The first has only 20db for 20khz and the phase shift is 90°, This result mediocre high frequency performance as it needs minimum 50db to be a good amplifier. The TPA3116 as the block diagram shows is two pole at 1.5khz followed by two zeros at 4khz and gets 55db at 20khz with a phase shift of less then 45°. This results exceptional performance. Unfortunately it was not adopted in 32xx series and gets insufficient 40db.Bruno Putzeys uses self oscillating circuit and applies 90db NFB flat to 60khz, as stability is not a problem.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 17, 2022, 04:38:26 pm
content: Interesting, double integrator for feedback. Well, that's guaranteed to oscillate (180 deg. phase shift), but, a class D amp is supposed to, right?That has the advantage of faster asymptotic behavior; same as (I think?) "noise shaping" on a S-D ADC. Except it's not clocked as S-D is, but chopped against a ramp in the continuous-time domain. But I think to much the same end. Which indeed should give lower distortion to higher frequencies.Also current sense, but not as cascaded loops as I described, but just for peak current I would guess. But yeah, that 3116 sounds quite reasonable.Again, you don't need GaN to look at very short dead time, or indeed interleave; but if you choose to go that way, you can of course get far tighter. Especially with typical drivers having speed in the few ns range.Tim

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 17, 2022, 08:24:22 pm
content: Few years ago, I applied extra 15db NFB on TPA3116 and recorded comparatively to 300b/2A3C SET amplifier posted on youtube here.https://www.youtube.com/channel/UCX4dG3sAluj726rIz9XKg1Q/videos

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 18, 2022, 02:02:13 pm
content: I need some advice to understand why the chip is getting warmer.If it is a normal type with 220nF grounding capacitor, then the switching occurs at +/-700ma, shown on first graph. If I bias in BD mod with 6.8nF for both branches, then the switching occurs at +/-100ma but runs on idle, warmer then in first case. Why?I was listening all day paying attention on high pitch sounds as there is the most difference. Unintentionally I passed male voices to be amazed by the rich generous low mid sound reminding me the 8 track or reel tape style sound. No doubt this amp has more tube sound then the 2A3C.What is for sure, I did not minimize the classD distortion, I evaporated it. The amp now behaves as a class AB type.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 20, 2022, 11:00:14 pm
content: I tried to decrease the chip dissipation in vain. If something should go hot why not a resistor. So, instead of biasing with a capacitor, I bias now with a resistor dissipating 1W. The resulting wave is more beautiful and the 3rd and 5th harmonics are still opposite phases.I will determine the value by listening.If the resistor is shorted, the amp becomes class AD, if cut, it becomes class BD. Should this be class abD

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 21, 2022, 01:52:13 am
content: In what way is this component for "biasing"? Looks like a common mode filter element to me.Tim

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 21, 2022, 03:00:24 am
content: The bias is not a dc component, it is the carrier current induced in the inductors. This is my invention in class BD. The induced ac current act exactly as the dc bias current in class ab.This current is not easy to determine exactly as the precedent stage's distortion also interfere.The TPA3116 has a distortion for 1Khz about 0.025% with at least 60db NFB, this means in open loop it is 25% THD most of it the two differential amps. As the output stage generates opposite phase 3rd and 5th to subtract with the driver's, how much bias is not easy to determine. My distortion measurement doesn't work in differential and only 16 bit.A quick trial gave very good sound with 50 ohms heating alone as the chip is cold. Well, if quality is needed, efficiency has to be scarified.I have a pirate CD of Sinatra, I never could listen with all my dozen of class A and SET amps. For the first time I am enjoying it at this moment.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 21, 2022, 09:15:42 am
content: I went through all documents on line about class BD modulation searching about carrier frequency preference to be high or low, I found nothing. So, I tried it out on TPA3116 switching between 400khz and 1.2M, I didn't find by listening, slightest difference. So better to run at lowest to keep the chip cool.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 22, 2022, 08:37:51 am
content: I passed test music to qualify this amp. I took 3 stars without problem. The exceptional low notes as reel band and fluid transparent extreme highs I never heard such. The trouble started by the requiem of Verdi that I attribute four stars, NO NO NO, garbage sound when the choral of 300 voices, 70+ instruments burst. This is due to large phase rotation 1khz-4khz in loop gain. I have already resolved in the passed by driving the inputs with differential current sources. I installed it and yes the Verdi sound good but all the goodies faded out. I don't understand why with differential input I lose the low notes.I designed a simpler circuit keeping the unbalanced input and provided 26db extra NFB by post filter, adjustable by the emitter resistors, maybe with four extra transistors it will be perfected.I have no hope that TPA3116 can run stand alone, but the problem is no more class D, just common feedback troubles.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 23, 2022, 03:19:56 am
content: Before I proceed with the design, I wanted to be sure about datasheet and sim models. First I found that the inputs are not differential. If I feed the same input to both input, I get exactly the same level the same sound. Probably is the case for PBTL, both inputs have the same polarity . If either input, instead of being grounded, I leave it open, on sim, the gain falls from 20db to 4.3db, in reality it does absolutly nothing except at start up plops. This means the inputs don't receive feedbacks.Knowing better about the gain, on sim now I can have only 10db NFB from post filter. Because feeding the input by high impedance about 600kohms, the gain of the chip alone passes from 20db to 0db. If feedback was on the input it would be 14db extra NFB.Talking about getting the feedback signal from differential output, is to invert one side and add to the other. I made a quick model, It looks working.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 23, 2022, 08:40:08 pm
content: Just for curiosity.With AD modulation, the filtered output has dc component of VCC/2 and gets max from 0 to VCC. With BD modulation, see the bellow graphs, is very different. First it is 3 state and goes bellow 0 and above VCC. The difference is the output.To feedback from post filtering, the story is more complicated in BD as re filtering causes instability.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 23, 2022, 11:26:52 pm
content: Rectification: The above curves are for BD modulation with the bias resistor, without it, the pulses remain in 0 VCC domain.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 24, 2022, 05:01:51 am
content: This circuit provides the required feedback signal without filtering. I applied with it 16db NFB and see the result in step and 1khz. To keep in mind that my simulated PWM is with triangular wave, if the TPA3116 uses sawtooth ramp, lower NFB to be used as it samples once instead of twice with triangle.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 25, 2022, 08:17:25 am
content: I want at all cost keep the magnificent bass of this amp all by giving extra NFB. For that I made a transconductance buffer to feed the chip with 500k impedance. I wired the circuit bellow that will acquire the feedback in the other input. As you notice the input transistor's behavior is not effected by the other one but the differential current is obtained in current mirror subtraction.First I had to use the mute to start up, to hear bright sound. I can see on scope the low frequencies attenuated by feedback from sagging power supply, a problem to resolve but what concerns the requiem of Verdi, even that of Mozart doesn't sound garbage any more, the voices are distinct.The input stage has a voltage gain with 9.1k chips input impedance of -1db giving a total of 35db gain to be decreased by feedback. On simulator, the input stage has 0.0002% THD and the feedback 0.0025%.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 25, 2022, 01:00:17 pm
content: No, I couldn't get back the magnificent low mid sound back. I will try another input buffer using gyrator as some call which is simulated inductor. The output impedance seen by the chip ia more than 1Mohm which can give extra 3db NFB. The input transistor has 0.008% THD full scale.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: July 27, 2022, 09:06:11 am
content: I wired the second circuit with post feedback. The low mid particular sound didn't came back except when I reduce the gain back to 20db. It looks like that it is an anomaly that the TPA3116 is creating , and when I apply more NFB, it is getting corrected. In tape recorders it is also the case where only 9.5cm/s has such sound. In 80's, I tried to give the cassette tapes 4.75cm/s the same sound in vain.The feedback signal extractor worked without flaw. As it is the first time I am able to visualize the output, I want to see how my biasing technique is really working. The post extra feedback is useful at high power to compensate the non linearity of the output inductors. With my 97db efficiency speakers, I will not hear much post feedback effect as the sound at this stage is already far from what I can expect from the best classA .I thank to all who followed this thread, even in silence, you were encouraging me.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 09, 2022, 10:11:58 am
content: I bought a TPA3110 2×15W module for $1.5 to try it in class abD, The loop function betrayed by PSRR is shown bellow to be more linear than that of 3116. The sound is simply high fidelity although the chip is fake with apple logo instead of TI. Unlike the 3116 it reproduces the most difficult requiems of Verdi and Mozart with perfection. The high frequencies are precise and ultra clean, aah my class abD, I love it. Unfortunately, the 8 track style low mids of 3116 is absent, and the 3116 was artificially over sharpening the extreme high frequencies, nothing such with 3110.I ordered STA516 150W output stage, to use the 3110 or 3118 as modulators, for that I will add a dead time eraser shown in the circuit. May be I will use both modulators selectable to have it flavored or neutral.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 11, 2022, 08:02:03 am
content: Unlucky for me, the tpa3116 I was using that sounded as 8 track style is defective. I replaced with an identical board and the sound doesn't have any flavor. The input of this, is differential, unlike the defective the one. If only I can know how to make this also defective.

author: strawberry
author_rank: Super Contributor
timestamp: September 11, 2022, 08:39:39 am
content: a bit of salt for better flavorD stands for distortion

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 11, 2022, 08:41:25 am
content: Examining the defective nice sounding one, it looks to be fake as the writings are printed were the original is laser graved. The working one didn't pass the test of the two requiems, that is, it is as bad as the fake and without flavor whereas the 3110 has astonishing fine sound best to be used either 2×10W or as modulator for STA516, of course in class abD

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 11, 2022, 08:51:26 am
content: Quote from: strawberry on September 11, 2022, 08:39:39 amIn late 70's, a colleague engineer built a classD amp as portable guitar amplifier, a circuit from Hitachi databook. The sound was so horrible, that as you, I said D stands for distortion. As engineers it is our duty to make this type of amplifiers sound good, as analog is already dead. This what I accomplished with the class abD. The TPA3110 circuit plus a pair of 220nF and a 3W 50 ohm resistor cost less than $2.5 try it out, it works with laptop PSU.

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 12, 2022, 08:47:18 am
content: The DS says:. For good transient performance, the impedance seen at each of the two differential inputs should be the same.As my defective chip has non symmetrical inputs, I made the good one also dissymmetrical by giving a gain of 36db on negative with 9.1k internal impedance and 16db on positive with 110k impedance. Now I have the good one also flavored with 8 track sound, sharpened high frequencies and on bonus extra bass. As it is just input impedance matter, it can be switched with balanced and unbalanced to have it neutral/flavored mode. I will apply this now on 3110.

author: strawberry
author_rank: Super Contributor
timestamp: September 12, 2022, 04:51:24 pm
content: placing D class amplifier inside OPamp feedback loop, could compensate LC network nonliniarities (with some limitations)

author: Kokoriantz
author_rank: Frequent Contributor
timestamp: September 12, 2022, 07:45:33 pm
content: The TPA 311X series have max gain of 36db, it is possible to use the 16db of it to post filter feedback. TI website gives a passive solution for that. The circuit I tried on #29 does very good job. I prefer to use rather higher quality inductors. For STA516, I will use these :https://www.sagami-elec.co.jp/en/product/detail.php?type=7G14D, it costs $2 each but I must buy minimum 10 pieces.For lower power, a Chinese Copy of Sagami 2×10uH in a single package 9.5A, I paid $3.43 :https://www.aliexpress.com/item/1005003536543610.html?spm=a2g0o.productlist.0.0.2d1d2d7eH6DRcH&algo_pvid=4d9a45b3-d110-4916-aa6e-f35735c3c987&algo_exp_id=4d9a45b3-d110-4916-aa6e-f35735c3c987-12&pdp_ext_f=%7B%22sku_id%22%3A%2212000026212313835%22%7D&pdp_npi=2%40dis%21USD%214.1%213.2%21%21%21%21%21%402103255b16603614128058381e9c67%2112000026212313835%21sea&curPageLogUid=LSrbrPXOVlDjis a better solution than adding opamp or my circuit.The TPA3128 looks very similar to 3110 except has 90mhom instead of 240mohm to output 30W@8 ohm.NXP has also class BD intended chips up to 400W, but their feedback are conceived as analog chip amps with 20db NFB @ 20khz. I will still try it out with TDA8932, a board costs less than $2.