Maker Pro
Maker Pro

Class D audio amp

HANKMARS

Jul 28, 2019
498
Joined
Jul 28, 2019
Messages
498
I am constructing a class D audio amp. The plans I have are using am LM393 dual comparator for mixing audio signal with high freq triangle wave. The response time of the 393 is 1.5μs. I suspect that if the response time is this lengthy, slew rate also is lengthy. My triangle wave is at 200KHz, time period 5μs. 1.5μs is a big chunk out of 2.5μs transition. I have 2 - AD811 on hand that produce my 200 KHz as an output very nicely. The AD811 were a bit pricey. Also it would be convenient to have dual amps in one package. Any suggestions as to comparator choice. Their outputs will drive an IR2110 MOSFET driver.
 

HANKMARS

Jul 28, 2019
498
Joined
Jul 28, 2019
Messages
498
Correction. The comparator will be driving a BJT which will drive the MOSFET driver.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
Try the LM311. It has a 200μs response time. Note that it requires a pull up resistor on its output.
 

crutschow

May 7, 2021
834
Joined
May 7, 2021
Messages
834
For your interest, here's the LTspice simulation of a PWM circuit using a transistor sawtooth generator with about a 250kHz frequency, along with a fast LT1720 comparator:
The Demod output is from a low-pass filter to show the demodulated PWM signal.

upload_2022-4-18_7-38-53.png
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
You would normally use a triangular wave rather than a sawtooth for best linearity.
 

crutschow

May 7, 2021
834
Joined
May 7, 2021
Messages
834
You would normally use a triangular wave rather than a sawtooth for best linearity.
How does that affect linearity?
I would think it would be the linearity of the wave slope that determines the linearity.
 

HANKMARS

Jul 28, 2019
498
Joined
Jul 28, 2019
Messages
498
How does that affect linearity?
I would think it would be the linearity of the wave slope that determines the linearity.
I'm thinking that a 50% duty cycle of a square wave will produce a more accurate reproduction of the audio range signal. Maybe plug it in to your simulator and look for a bit of difference on the audio out.
 

crutschow

May 7, 2021
834
Joined
May 7, 2021
Messages
834
I'm thinking that a 50% duty cycle of a square wave will produce a more accurate reproduction of the audio range signal.
How does whether its a triangle or a sawtooth affect the duty-cycle accuracy of the square-wave?
Either a triangle or a sawtooth will generate a 50% duty-cycle when the modulation input is 1/2 the PP voltage of either wave-shape.
 

CircutScoper

Mar 29, 2022
300
Joined
Mar 29, 2022
Messages
300
How does whether its a triangle or a sawtooth affect the duty-cycle accuracy of the square-wave?
Either a triangle or a sawtooth will generate a 50% duty-cycle when the modulation input is 1/2 the PP voltage of either wave-shape.

You're right of course, but for a given frequency, the slope (dv/dt) of the ramp of a sawtooth of a given amplitude is only half as fast as that of the sides of a triangle.

But which augers for better accuracy/fidelity is another question entirely.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
Using a saw tooth will skew the PWM pulses leading to distortion.
Re the LM311, my post should have read 200ns not 200μs.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,648
Joined
Nov 17, 2011
Messages
13,648
I tried to look up the difference of sawtooth vs. triangular in a class D amplifier. Found lots of personal opinions, little fundamental technical data.
In fact, some applications from renowned manufacturers use either sawtooth or triangular waveforms.

Then I came across this article. It also states that both carrier waveforms can be sed. It then goes on, however, to describe the relevant difference on pages 12 ff.: With a triangular waveform you effectively double the sampling rate which makes filtering at the output easier.
Distortion or linearity are not mentioned as an issue when choosing one carrier waveform over the other.
Probably the difference between the two is of purely theoretical interest once the carrier frequency is above a certain threshold.
 

crutschow

May 7, 2021
834
Joined
May 7, 2021
Messages
834
Using a saw tooth will skew the PWM pulses leading to distortion.
The "skew" is just a shift in time of each PWM pulse from the center of the sawtooth.
Since that is a constant shift for each pulse, I don't see how that can add distortion to the modulated signal.
 

Nanren888

Nov 8, 2015
622
Joined
Nov 8, 2015
Messages
622
Probably the difference between the two is of purely theoretical interest once the carrier frequency is above a certain threshold.
It's been some time since I worked in this stuff, but from memory, the comparator without sample-and-hold implements what was called "natural sampling" which has advantages. Since the effective sampling rate is not significantly higher than the signal (low-pass) bandwidth, this may have some advantage. Sort of depends on the integrity that you need in the end.
For many applications, this, as suggested, might be just a theoretical concern.
Quite prepared to be wrong. Just from memory.
 

Nanren888

Nov 8, 2015
622
Joined
Nov 8, 2015
Messages
622
What "sample and hold" ?
Sorry, I assume this was a bit of a theoretical aside, of little practical impact.
.
It's a one-bit converter with "natural sampling". That is, the edges occur when the waveform crosses a threshold, there is no pre-defined sample time nor sample-and-hold as might be more normal in conversion.
Natural sampling, allowing the waveform to choose the sampling point had some advantages; the details or justification of which, I frankly can't remember. Regarding the sawtooth versus the triangle; could speculate that having two such times, may have advantages over having one.
 

crutschow

May 7, 2021
834
Joined
May 7, 2021
Messages
834
Sorry but I have no idea what that means in regard to generating a PWM signal. :confused:
There is no "sampling" as such.
 

Nanren888

Nov 8, 2015
622
Joined
Nov 8, 2015
Messages
622
Then I came across this article.
Actually, now that I have taken time to actually read some of the offered paper, it does introduce these concepts, natural versus uniform sampling, on page 9 and explains it somewhat.
In my terms, each upward or downward slope of your sawtooth takes a single sample between the times of the extremes. In this comparator approach the timing of that sample is determined by the waveform and the slope waveform. In more traditional conversion, the signal level would be samples at some point in the period and converted. The paper and reference [4] suggest this natural sampling has benefits.

effectively double the sampling rate
As pointed out, using a symmetrical up & down waveform effectively doubles the sample rate as you get one transition & natural sampling point on the up & one on the down.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
The "skew" is just a shift in time of each PWM pulse from the center of the sawtooth.

That is exactly the point. It is the shift in time that creates the distortion.
 
Last edited by a moderator:
Top