Class D amp using LM319 comparator

This means lesser charging current means lesser voltage needed to charge and discharge giving more flatter ramping output voltage. This will also give smaller peak to peak output as the result. In this demo, R7, C4 output node yields +/- 240mv of ripple voltage (triangular wave) riding on ~6 volts DC. See fig. C with overlaid linear signal combined.

Some of you may think that 240 millivolts of triangular wave is too small for LM319 to amplify? Rest assured fellas, most comparators are designed to amplify differential voltages smaller than 5 millivolts of overdrive. So, 240mv of this sort is way too easy for LM319.

Now we are done! Biasing the comparator using this reference is the next easiest thing to do.

Let`s analyze the drawing of Fig. 1. Notice the DC bias resistor R10 connected to output pin 12 of U2? This node produce more than 11 volts of continues pulses at 50% duty factor, but I simply tap R10 on that output node because this is the best possible source of DC bias to pin 10 of U1 – meaning it will always seat at the crossover voltage of the triangular wave appearing on pin 9 to obtain the required 50% duty factor. Another possible DC bias to pin 10 is to use trimmer pot connected to VCC and ground then the center wiper goes to R10 but adjusting it to half of VCC to sample the crossover point of that triangular wave appearing on pin 9 would be very tricky to achieve. It works ok in sim, and also in real world (sort of) but when switched off for a while (coffee brake) and then on again, it needs recalibration again ouch!. Temperature drift and VCC fluctuation affect that trimpot DC bias. With the circuit I made above, node B always follows the crossover point of node A at all cost – it is immune to parametric changes mentioned above.

Fig. D shows simulation of what’s going on at the output of pin 12 of U2.

Sim of pin 12 output of U2DC bias for pin 10 of U1

Fig. E. Output waveform at node A and B.

3 thoughts on “Class D amp using LM319 comparator”

  1. Hey, just read your post on how to build a class D amp using lm319 comparator. Im willing to build a class d amplifier and i´m gonna generate the pwm in the same way as you did cause it seems to be pretty wise. I got a couple questions for you: 1)After simulating your first circuit on LTSpice I couldn´t help noticing that the negative input of the second comparator has a DC value different from the DC value of the triangular signal that is at the positive input. I read several times the third page of you post in which you explain wih a simulation how the negative input should follow the average value of the triangular wave form. Therefore I can´t understand why there is a little offset difference in the simulation (this affects the comparison between the audio signal and the triangular) . And I don´t understand what you intend to achive by adding the refference to the original circuit : “I will add tuning mechanism at the output of U2 inserted between R3 and R7 because this is the culprit in making the duty factor to ~51%. R7 effectively add resistance to R3 during charging of C2 but discharges quicker via output transistor without R7 ugh!” Guess the question here is: what am I missing?/ why the offset of the signals at the input of the comparator don´t equate on my simulation?. 2) I was wondering if by any chance did you measure the THD for the amp?. I know it sounded good, but just wondering. As it regards the class D I´m designing i want to make a 100watt (RMS) over an 8 ohm load. I´m gonna use IRF2110 and mosfets in a full bridge topology (probably taking feedback from the load). Any suggestions?

  2. Hello,
    Thanks for your interest regarding this article. I will answer your question soon after I fixed my laptop that refuses to boot after windows 10 update. As of now, I am answering you via my smartphone. There are at least 7 visitors asking the same way (privately) as you did but I want to publish your question with my answer via comment section so that it will serve as my answer to those dudes as well. Regards.

  3. Hey, just realize what the mistake was. The two RC networks after the first comparator act as you explained in your post. The thing is that the RC network that clamps the negative input of the second comparator to the offset value of the triangular waveform (cross over point ) takes over 500ms to reach the rigth offset value. I should have looked at the .op rather the transient simulation . I realized when I saw that in an image you posted a transient simulation for 1000ms.

    I understand what your tunning mechanism is now. You add the trim pot along with the diodes to be able to change the period of the triangular, guess I was way too tired yesterday when I first read it.

    Very good job dude, your circuit is both cheap a reliable with good outcomes.
    I´ve been strugling to find easy class D amp circuit implementations.

Leave a Reply

Your email address will not be published.

*