Distorsions in class D

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi All!

I am triying to learn about switch mode amps.
For my first step I am going for a simple PWM.
One of my concerns were the distorsions, which might be caused by different dead times of the switching bridge.
In contrafiction to normal common sense on this, my simulations did not show massive increasing distorsions with higher dead time.

My simulation is a simple one. Simple PWM, staright forward.
For basic distorsion analysis and learning to understand... without feedback.
I analyzed the direct PWM signal, right after generation from by comparing the audio siganl against a triangle...
And I analyzed the output signal of the power bridge...
At small dead times they are more or less the same.
At high dead times the difference is smaller than expected.
Even at dead times around 800ns!
Also not clear for me is, how I can get quite high distorsion around the 70 harmonics (around 14kHz). I cannot be the high HF-ripple of the signal, because the switching frequency was 70kHz.

The triangle signal for the comparator has a frequency of 70kHz ==> switching frequency 70kHz. I simulated a 200Hz audio signal and checked for 100 harmonics.
This covers the audioable range and can still be handled by the demo version of ORCAD 9.2.

Further on I checked what happens at small signals. About 10% of max. output level.
Here I was quite unlucky.
The distorsion went up to 30...40...50% !!!!
Please refer to the attached file. It contains the simulation schematic and the output file. At the end of the output file you can see the results of the FFT.

Looking forward to your comments
Markus
 

Attachments

  • pwm.txt
    20.4 KB · Views: 243
Hi Pafi,
unfortunately I do not have any other format.
But the text file of my first post should show the simulated schematic.
Didn't it work to open the file?

I simulated without load and picked the signal after a simple RC-filter of 1k/6.8nF.
Already the filtered signal of the simplest generated PWM shows that distorsions... this is what is confusing me.

Yes I agree the main distorsion were always at the same frequency independend from the dead time and independend from the signal level. But the percentage of that distorsion is depending very much on the signal level. It seems like the absolute signal at 14kHZ is constant and if I decrease the signal then the relation between that undesired 14khz signal and audio signal becomes poor....
 
Hi Markus,

I too would very much like to know more about this. Why 100 harmonics? From what I've read I dont' think anyone tests with more more than 8 or so, why? I'm not exactly sure. The more you use, the looooooooonger it's going to take to complete.

I've also read something about doing additional "hard filtering" of the output to help sort out switch noise ...

Did adjusting the dead times effect this 70khz noise?
Circuit I'm working on is a little different, the THD decreases with increased power output, but gets rather poor at lower input levels.

I would like some standard types of tests we could do easily with pspice which would be meaningfull to the cause.

-Signal to noise ratio...I understand that's output - input...Must have to account for the gain though? How can this be done on pspice.

-A standard and meaningfull THD test....8 harmonics or 100 or 1000???? Additional filtering required for switch mode? Best settings in setting up the test for the best results.

-Can THD be graphed simultaneously with stepped power levels?

-Anything else I don't know enough about to have thought of.

-Said tests which could easily be reproduced IRL with real components and equipment for direct comparison with simulation, as in, standard scopes.

-At what point, if any, does pspices THD become unreliable? Once it's become so good that you just have to build it in order to improve it further with real test equipment.

-What things such as dead time, on resistance, etc, contribute to THD, and in what way? Where does second harmonic, or third harmonic distortion come from in class D?

These questions need answers.

Thanks for starting this thread, hope it keeps growing for a long time to come.

Chris
 
maybe a screenshot? I won't install OrCAD again. I did it once and it was a nightmare. (Usage too.)

"Yes I agree the main distorsion were always at the same frequency independent from the dead time and independent from the signal level."

I didn't write about frequency. I wrote about voltage.

"But the percentage of that distorsion is depending very much on the signal level."

Yes. If distorted components don't change, and input level decrease, then the distortion ratio will obviously grow.

This output filter is not real, and has very different effect than LC output filter.

I didn't check your file, but note that time step must be lower than 7 ns, if you want 0,1% accuracy. Is it so now? I guess not. (Distortion on theoretically perfect PWM signal indicates imperfect simulation.)
 
Hi Chris!
I also hope that this thread will grow and help for better understanding.
In fact I do not have answers for most of your quetsions.
I analyzed 100 harmonics because I wanted to see the full audioable frequency range.
I di not expect any issues at the 70 harmonic (means at 14kHz).
In fact I am not 100% sure if the simulation is tricking me.... you never know...
On the other hand I picked small steps for the transient analysis and the probe trace look exactly correct to what I would expect.
Up to know I have no major reason for doubts against the simulation. If you would use the default settings of ORCAD then
there might be bigger deviations. But typically you can see if the traces in the probe window show long linearized lines and strange corners. So you normally you notice if the simulation is rubbish.
And additional I think, distorsion below 0.1 % may just have the meaning "low distorsion". ...would not trust if 0.1 or 0.05....
That's another reason why I started this analysis without feedback.
But of course simualtion time is high if you do not have a very fast computer. To be honest, I used my laptop from work, because it is 5 times faster than my private desk top.

I wish I could also use one of our LeCroy scopes which we have in work.... But that's not possible, so I will have to deal with my old
analog tube base Tektronics with defect triggering ... :xeye:
But I think it will still take me some time before I can go to practice with that amp anyway...
:cannotbe:

Bye and good night to all
Markus
 
High Pafi,
the 5us is the max allowed step size.
The spice algorithm uses smaller steps, whereever needed.
Even if you do not limit them 5us. But without limit the simulation sometimes gets unstable and convegrence is poor. Also the steps which psice really choose depend in a some way on that max limit....
You can see if the are to big when you check the traces, there the 800ns dead are perfectly displayed.....
 
ok, some screen shots

At small signal levels the HF of the switching is of course making a noise floor which is higher than the audio signal. But this noise floor has its fundamental at 70kHz and should not be the resaon for the undesired signal with a frequency of 14kHz....


OK, I must sleep now...
Bye
Markus
 
Hi,

I didn't check your file, but note that time step must be lower than 7 ns, if you want 0,1% accuracy. Is it so now? I guess not. (Distortion on theoretically perfect PWM signal indicates imperfect simulation.)

In simulations I normally opt for a compromise between what looks like decent waves and total simulation time, so I keep the time step at 10ns. Should I perhaps change this for THD tests? They take awhile anyway.

A time step of 5uS must give you some ugly waves though, should try at least in the nano range for a THD test. If you can simulate with less harmonics you'll regain alot of the simulation speed you lost by alterting the time step like that. Seven harmonics is alot faster than 10 for example. Which brings us back to the question....how many is usefull?

There is another option in the THD settings "print values in the output file every X seconds", any recommendations for that?

Hi Subwo1
Hello, I suspect that the low correlation between dead time and distortion is related to not using feedback. When the loop is closed, more dead time causes less synchronicity between the input and the feedback signals.

That kind of makes sense, I'm trying to visualize this effect..basically your saying the feedback would kind of amplify the deadtime effect..thereby increasing distortion..instead of cancelling it? Hmmm.....hard concept to grasp..at first. In this sense feedback worsens distortion rather than improves, hence the importance on minimizing, and I assume matching deadtimes.

Very good, thank you.

Chris
 
Marcus!

I didn't mean 0,1% distortion, I mean 0,1% accuracy. (0,1% of the amplitude of triangle. This means 1% distortion at 10% output level.)

You can use higher modulation freq. to lower the simulation time. The distortion doesn't depend on frequency too much. (If there is no feedback.)

(I have a Celeron 366, and I have never had any serious problem on simulation time.)
 
Hi Pafi,

Good seeing you,

This means 1% distortion at 10% output level.
Just curious as to how you work that out?

Good point about speeding up simulations times by increasing frequency, it does do wonders. However when I do THD simulations I use 1khz "center" frequency in order to try and maintain some standard in conjuction with everyone elses tests, this way I have a better feeling regarding the value of the results.
What do you think? Would there be any reason to use other "center" frequencies as well, aside from simulation speed?

Thank you,
Chris

PS: Some good movies on tonight so I'm out for a little while at least, yet thank all participants, and am very glad this thread is off to a great start!
 
Hi Chris!

Assuming the error is constant, distortion is inverse proportional to signal level. 0,1% at full load is just an estimation based on phase-amplitude conversion of triangle-wave. T/2=7us means peak-to-peak, therefore 7 ns means 0,1% error (+/-6dB :) )

"Would there be any reason to use other "center" frequencies as well, aside from simulation speed?"

Definitely! For example Markus use 200 Hz, because he make the amp for a sub-bass box. Other reasons can be found (professional high-speed OPAs measured at 1 or 5 MHz), but I have to sleep too now!

Markus!

OK, spice may use smaller time-steps, but you can never know if they are small enough.
 
Hi Pafi!
... hope you had a better sleep,,, ;)
Thanks, you are right.
To allow 5us step is to huge.
The traces in the probe window are looking fine, but the FFT is running mad.... For me it is not obvious, why the FFT is giving really crazy results (not only some single percent wrong, but 40%.. !!!), while the probe traces are looking fine....

Anyway I reduced the step size to 5ns and spice world is looking more or less reasonable now. I am attaching the new output-text-file.

THANKS A LOT!
Markus


P.S.
My simulation philsophy:
For the first steps I am going to investigate the principle.
Here I often use ideal components, from which I know their behaviour very well. Also this helps to speed up simulation and I can spend the processors math power to simulate fundamental circuit properties like the planned switching, dead time etc...
With that model then I am typically just playing around.
Picking 100 harmonics instead of 10 was also just "playing". In the past I often found real weaknesses, before they could blow the real circuit later. But of course sometimes you are getting tricked by simulation... as it happened to me yesterday...
OK, I will keep in mind: Even if the probe traces are looking fine, even then the steps can still be to huge....
By the way: I was wondering about Randy Slone's Audio Amplifier construction manual, some months ago. He is showing tons of simulation results, where already the probe traces are showing obviously long simulation steps (especially chapter 7, cross over distorsion)....
 

Attachments

  • pwm_5ns.txt
    20.4 KB · Views: 72
Hi Markus!

You're welcome! I just woke up. :) I like simulating with ideal components or simplified modells for first step too! At PWM this is the most I can, because no simulaton program capable of simulate well my real circuit. (At least I don't know one.)

In continous operation time step is not so big problem. If time step is 1/500 of period, then simulation is perfect. (In PWM too, but here the period is the carrier's one, instead of base-band signal!)

I think explanation of bad result is that FFT algorithm can't handle varying time-steps. It need all of the points. Or sampling rate was too small. It must be over 200*f_carrier (yes, 14 MHz at least)! If you were filter first, then sampling rate could be lower.
 
Hi,

I had implemented additional output filtering in my simulation using one the ABM low pass block. It did it's job that was evident from viewing the output, had placed cut off around 50Khz.

With my circuit harmonic distortion should be flat, then you see a peak at the switching frequency, I found it curious this additional filtering didn't remove this switching distortion from the FFT results? Or any of it's harmonics after it. Spice weakness?

Also, it's clear to me I need to read up on acoustics and frequency domain signal analysis, Can anyone recommend a good link for that sort of info?

Thanks,
Chris
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.