# Class D and triangle wave linearity

#### ian field

Joined Oct 27, 2012
6,536
There was a discussion not too long ago about the possible distortion from a RC triangle wave compared to a linear triangle wave. I'm attempting to see if there is any using my usual graphic approach.

If anyone remembers this thread, such as Ron H, point me to it please.

The RC waveform was done to scale using this thread, and was done to scale. It is as precision as I can make it. It appears there is very little difference between the two, though I would be the first to admit that the resolution is too low.

To me it appears it would be very usable.
.
In a recent issue of Elektor magazine, they published a 555 based class-D amp with a voltage to current converter, they claim pretty good considering triangle linearity.

#### Wendy

Joined Mar 24, 2008
23,464
I have had this concept how to prevent shoot through in relatively high power H bridges. When I started drawing it it turned out to be more of a challenge than I thought. I had to use a truth table to figure out the gates I needed. The P-channel MOSFETs use reverse logic, a 1 turns them off, a 0 turns them off.

C1 C2|Q1 Q2 Q3 Q4
.0....0|..0...0....1...1
.0....1|..1...0....1...0
.1....0|..1...0....1...0
.1....1|..1...1....0...0

So I ended up with an OR, AND, NAND, and NOR gates respectively.

Q1 & Q3 require voltage translation from the gates.

This how I did it. The schematic is not completely finished. but almost there.

This takes forever to draw using remote access.

Using a 24VDC and a 8 ohm speaker I calculate 36W RMS with a sine wave, and 70W RMS with a square wave.

Using a 36VDC and a 8 ohm speaker I calculate 80W RMS with a sine wave, and 162W RMS with a square wave.

Dropping the speaker impedance will also increase the power out.

#### Attachments

• 24.8 KB Views: 77
Last edited:

#### Wendy

Joined Mar 24, 2008
23,464
OK, almost to the point of writing article. I need to build this to test it first.

If you see anything wrong please let me know.

#### Attachments

• 15 KB Views: 93
• 22.9 KB Views: 72

#### THE_RB

Joined Feb 11, 2008
5,438
Bill, have you seen the 8-pin push-pull driver ICs they use for MOSFET driving?

Most will drive an amp, and they have inbuilt shoot through protection (via a tiny delay).

One of those chips would be a perfect class-D push pull output stage direct to speaker.

#### Wendy

Joined Mar 24, 2008
23,464
You have a part number? Please?

#### Alec_t

Joined Sep 17, 2013
14,389
If you see anything wrong please let me know.
Running a sim of this, assuming a speaker inductance of 50uH, I'm seeing voltage spikes of ~ +- 200V on the outputs of the 555s. Could that be a problem? What would a typical real inductance value be?

#### ian field

Joined Oct 27, 2012
6,536
I have had this concept how to prevent shoot through in relatively high power H bridges..
If by preventing shoot through, you mean dead time control - this is elegantly handled in many SMPSU chips such as the UC2524 etc.

#### ian field

Joined Oct 27, 2012
6,536
Bill, have you seen the 8-pin push-pull driver ICs they use for MOSFET driving?

Most will drive an amp, and they have inbuilt shoot through protection (via a tiny delay).

One of those chips would be a perfect class-D push pull output stage direct to speaker.
In most I've seen, the internal oscillator produces narrow pulses - these clock a JK to give 50:50 duty cycle, the narrow pulses are combined into some logic gates to produce the dead time.

#### ian field

Joined Oct 27, 2012
6,536
Running a sim of this, assuming a speaker inductance of 50uH, I'm seeing voltage spikes of ~ +- 200V on the outputs of the 555s. Could that be a problem? What would a typical real inductance value be?
Its fairly common practice to put a L/C LPF between the PWM bit and the speaker.

#### THE_RB

Joined Feb 11, 2008
5,438
In most I've seen, the internal oscillator produces narrow pulses - these clock a JK to give 50:50 duty cycle, the narrow pulses are combined into some logic gates to produce the dead time.
No the parts I'm thinking of have no oscillator. They are just a fast halfbridge (usualy two halfbridges in the one 8pin IC).

Bill, this one looks perfect;
http://www.vishay.com/docs/70007/si9986.pdf

1A, 200kHz capable, shoot through proof, and incredibly simple to drive.

Just connect the SA and SB pins to ground if you don't need current sensing.

#### Wendy

Joined Mar 24, 2008
23,464
But the MOSFETs are internal to this device. I need something to drive external MOSFETs.

Still, an interesting device. Thank You.

#### ian field

Joined Oct 27, 2012
6,536
But the MOSFETs are internal to this device. I need something to drive external MOSFETs.

Still, an interesting device. Thank You.
The 3525 is like a 3524 - but optimised for driving MOSFETs.

Its designer probably never envisaged it being used for a class D amplifier - so getting that to work might be the challenge.

#### THE_RB

Joined Feb 11, 2008
5,438
But the MOSFETs are internal to this device. I need something to drive external MOSFETs.
...
1. It is a great MOSFET driver, just connect its output through a low ohms resistor to the gate (assuming it's driving an NFET).

2. If it is for an amplifier you don't need external FETs, it will drive up to 1A into an 8 ohm speaker. That's a pretty good amp volume.

#### Wendy

Joined Mar 24, 2008
23,464
I figure these MOSFETs will take surges as high as 3A (24V) or 4.5A (36V), so that driver chip isn't really usable. With a sine wave the RMS will be 2.1A.

I hate it when I totally forget a subject. There was a time I had M-derived filter down, now I've got to read up on it from scratch. Too many brain cells have died between now and then I guess.

There is a chance the values I come up with will be totally unusable, a common problem with filters, but nothing tried nothing gained. I know the RF versions are a stone cold female dog to tune, I once spent a day tuning a RF bandpass. But when you get them right the frequency responses are a thing of beauty.

Here is the setup for the problem...

I need to figure out the parts used for Figure 2 for a notch at 100Khz and a roll off around 22Khz. It isn't complex, I just need to relearn the subject (dangit!).

Wikipedia is not helping, they tend to make too many assumptions. Fortunately for me I still have all my old text books.

I have figured out I'll have two PCBs (or prototype PCBs) due to the current extremes.

#### Attachments

• 2.2 KB Views: 62

#### Wendy

Joined Mar 24, 2008
23,464
OK, taint done with the high power design, but getting close. Current state of the drawing.

#### Attachments

• 38.3 KB Views: 73

#### THE_RB

Joined Feb 11, 2008
5,438
I like the way you floated U6 to do the PFET driving.

Re the output filter, maybe you are overthinking this? The speaker inductance itself will remove 95% of the PWM frequency and the mechanical moment (inertia) of the speaker will remove all the rest.

Even on commercial class-D amp chips etc they just run a couple of ferrite beads, one on each speaker lead.

#### Wendy

Joined Mar 24, 2008
23,464
Probably, but if nothing else it should could keep MOSFETs cool. I don't plan on heat sinking them very substantially.

#### Wendy

Joined Mar 24, 2008
23,464
Well, I wound my first toroid today. I used a inductance meter and got 62-63uH. I was pleasantly surprised the calculated length of wire worked out, I did not bother to count turns. The calculated ohms for 8 ft. of 24 gauge wire is not bad, around 0.2Ω. Not great, but usable. Superglue is your friend doing this, and I figured out some tricks that make it easier, like folding the 8ft of the 9ft length 4 times to bring it down to 2 ft feeding through the toroid. Hope it works well, I suspect it will work good enough.