Class D feedback and stability

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
last night I simulated a version with the PFFB stolen from the TPA3xxx-PDF (adjusted for other filter-values) and it appears to work fine, but I do not pretend to fully understand why its stable or not....

Any ideas on how to simulate the gain/phase margin for a classD? I'm guessing that the integrator+comperator+powerstage would need to be replaced with a linear equivalent- but how do we do that?

Kind Regards TroelsM
 
Feedback is a very broad topic, it's complex and it covers many domains.
Respectable manufacturers invest in expensive equipment designed to analyze the response of a loop, but most do it by trying until they get a sufficiently stable design. Loop stability takes time and no one has that time.
It's not a secret, it's just very hard to understand.

I suppose you can study feedback for switchmode power supplies, since class d amps are quite similar to them.
 
Any ideas on how to simulate the gain/phase...

LTspice was created for essentially this problem in switcher power supplies.
It was sufficiently fast to run a stepped time simulation for very many switch power cycles and reveal the mean behaviour of the loop.
The Tian technique to show Return Ratio of linear amplifiers can be extended to Class-D as you propose, but my experience with Tian is all in linear amps so I don't know the details.
I dimly recall LT had some literature how to do this for switched mode power supplies.
There are also published papers in the Control Theory journals, some downloadable, and power supply articles in EE journals.
As Bogdan wrote, the theory should be fairly similar.
But it's not exactly simple.

Best wishes
David
 
Last edited:
Disabled Account
Joined 2010
I never found a model of TPA3255 usable for LTSpice. TI publishes models for their own simu called TINA, which is imho not half as good as LTSpice. But for my knowledge even there is no model for TPA325x available.

As loop stability depends on the internal behaviour of the chip, I gave up simulating these and do empirical compensation in a real test setup.
 
Last edited:
Disabled Account
Joined 2010
To simulate the behaviour of the output filter this very simple approach might be useful
 

Attachments

  • spice.png
    spice.png
    71.4 KB · Views: 440
Did a few test last night and I think, that I'm close to the distortion limit set by the large deadtime of the IR2184. I'm getting from 0.02% to 0.1% depending on the level and load. This can be reached with and without PFFB.

So although PFFB might be good, it still wont correct for deadtime-errors right?

Is it correct that deadtime-error will have a smaller effect if the switch-freq is lowered? - the deadtime is the same, but the pulse-width is longer and thus relative dead-time-error is smaller?

Kind regards TroelsM
 
Update.

I tried to get the PFFB to work, but it never got really good. Distortion got lower, but then stability with a square-wave ( no load or highly inductive load) got worse.

So I went back to the idea of taking some feedback from the current in the filtercap. With my first tries it lead to a DC-offset that I could not understand. Now I include a cap to block DC in that feedback-path and it work very well.

Please see the attached schematic for the conceptual idea.

I'm not sure if the "Cap-current-feedback" actually lowers distortion, but it makes a huge difference with "taming" the unloaded filter.

The prototype-circuit appears to be pretty stable even without a zobel at the output.

I have never seen this done in DIY-amplifiers and I'm still unsure if there is any benefits besides the damping of the filter-response.
But if it does not hurt anything and it helps to control the output in no-load-situations, I think thats a big improvement for the small number of xtra components.

What do you think? -and have you seen similar implementatons?

Kind regards Troels
 

Attachments

  • CapCurFeedback.PNG
    CapCurFeedback.PNG
    34.9 KB · Views: 364
Disabled Account
Joined 2010
Relative dead-time error is smaller, but your loop gain will most likely be also smaller....
Your approach comes close to mine (taming TPA3255). This is a PFFB that only is effective in the vicinity of the output filter resonant frequency (~50kHz) thus doing a great deal stabilisation, even w/o any load. But in the audio band it hardly makes a difference.
 
Disabled Account
Joined 2010
@voltwide: Was that a response to me? - I dont see how my solution is similar to the idea you proposed, but I'm probably not getting the complete picture.

Kind regards TroelsM
Yes. This may not be evident on the first glance at your circuit.
Your feedback is a differentiating one, coming with a leading phase. I did the same with one small cap from post filter output to input of TPA3255. Together with the input resistance this RC creates the characteristic hi-pass filter.
 
Thank you for assisting me. I'm beginning to realize how much stuff I have forgot ( or maybe never knew? )

Your feedback is a differentiating one, coming with a leading phase. I did the same with one small cap from post filter output to input of TPA3255. Together with the input resistance this RC creates the characteristic hi-pass filter.

With the risk of demonstrating my lack of basic knowledge: I'm still not sure that the 2 solutions are the same. The current in the LC-cap will rise before the voltage over the cap. So if we can use the current in the cap instead of the voltage over the cap we get a better phase-margin?

Kind regards TroelsM
 
Disabled Account
Joined 2010
Thank you for assisting me. I'm beginning to realize how much stuff I have forgot ( or maybe never knew? )


With the risk of demonstrating my lack of basic knowledge: I'm still not sure that the 2 solutions are the same. The current in the LC-cap will rise before the voltage over the cap. So if we can use the current in the cap instead of the voltage over the cap we get a better phase-margin?

Kind regards TroelsM
Yes, I think so
 
Thinking a bit more about it, I think that our solutions actually are pretty close. If you take a small cap from the output and feed it back to the integrator input it will be the current in the cap that is the actual feedback-signal. That makes it close to the idea I was following, but yours are probably simpler and more elegant.

I have tested "my" idea a bit more and it really helps to tame the LC-resonance. but I see no difference in the distortion-numbers.

I think that the feedback from the cap also helps to control the behavior during clipping so that would be an extra benefit.

I'l compare it with your idea soon.

Kind regards TroelsM
 
I think that the feedback from the cap also helps to...

Hi Troels

I think it would be really useful to have a Bode plot of the feedback.
You seem to already have most of what is required, in the LTspice ASC that you posted.
I think you just need to linearize the switch element.
There's plenty of literature about this, have you looked at this option?

Best wishes
David
 
Hi Dave

Yes, I looked at it shortly and, yes I would be a great help, but I cannot remember how to do it.. - I'm pretty sure it was part of my EE-education, but I have no clue :)

I can model most of it, but as you say the switching part is tricky to translate. The delay in the signal-chain also needs to be included as it will add a phase-shift that somewhat independent of frequency.

There must be a standard way to model a classD? thinking about it, I think I saw a simple model in one the threads here? - maybe the one about modelling the Hypex Ncore? I should give that a try later.

In the end there is some very important aspects that needs other models and real-life testing as well: start-up behavior, clipping, shut-down, and such.

Kind regards TroelsM
 
Disabled Account
Joined 2010
Thinking a bit more about it, I think that our solutions actually are pretty close. If you take a small cap from the output and feed it back to the integrator input it will be the current in the cap that is the actual feedback-signal. That makes it close to the idea I was following, but yours are probably simpler and more elegant.

I have tested "my" idea a bit more and it really helps to tame the LC-resonance. but I see no difference in the distortion-numbers.

I think that the feedback from the cap also helps to control the behavior during clipping so that would be an extra benefit.

I'l compare it with your idea soon.

Kind regards TroelsM


Keep in mind that the small cap has maximum effect close to the output filter resonant frequency voltage peaking, but very little in the audio band. So it helps stabilisation but does hardly improve THD - this is a different story.
 
Hi Dave

Yes, I looked at it shortly and, yes I would be a great help, but I cannot remember how to do it.. - I'm pretty sure it was part of my EE-education, but I have no clue :)

I can model most of it, but as you say the switching part is tricky to translate. The delay in the signal-chain also needs to be included as it will add a phase-shift that somewhat independent of frequency.

There must be a standard way to model a classD? thinking about it, I think I saw a simple model in one the threads here? - maybe the one about modelling the Hypex Ncore? I should give that a try later.

In the end there is some very important aspects that needs other models and real-life testing as well: start-up behavior, clipping, shut-down, and such.

Kind regards TroelsM

Look into building the NCore Modulator :D, the schematic is in the public domain and its worth studying, don't really care knowing hypex is snooping around.. members seems to be careful about this particular schematic :confused, this is a diyaudio forum not a commercial audio dictatorship. :lickface:
 
...but I cannot remember how to do it...
There must be a standard way to model a classD?...

There's information on the net about how to do this for Switch Mode Power Supplies, should be essentially identical for class D.
I have only just started to look at Class-D/Switch Mode after an apprenticeship in linear amps.
So I don't know the literature or history but surely someone has done this?*

In the end there is some very important aspects that needs other models and real-life test...

Yes, clip behavior is, by definition, non linear so the linearized model obviously won't work.
Probably best done with TRAN simulation followed by real-life tests.
Even the experts admit that the transient behavior is easiest just to measure on a prototype.

Best wishes
David

* A search shows not even one mention of a Tian feedback loop probe.
It seems no one has actually done this in DIYaudio.
I am more interested in switch mode amplifiers in the style of Labgruppen rather than class D, but it could be a useful practice exercise.
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.