Class D amplifier produces no audio at LM393 output

Thread Starter

mike_canada

Joined Feb 21, 2020
239
classd.jpg.pngclassd.jpg.png

I'm trying to make my own class D amplifier out of discrete components then eventually sampling the output using LED.

So far, the class AB amp (to the right of capacitor CMPC) is working with lots of heat (guess that's my consequence for choosing TIP31C and TIP32 transistors instead of better ones).

The reason I want to explore class D amplifiers is because I could probably somehow turn it into a VU meter (a circuit that converts sound to light pulses) without generating heat and I'm afraid if I use a class A amp then I'll create more heat.

So I ran some tests starting with the 555 timer and ignoring everything else. I wanted to hear what a triangle wave sounded like. and I couldn't hear a thing!

I even modified the triangle wave circuit so it matches a standard astable multivibrator circuit made from a 555. I tested 555 pin 2 (by connecting a capacitor and speaker in series to it to ground) and no sound. As soon as I disconnected the speaker+capacitor from pin 2 and hooked it to pin 3 (the out pin), I get a high pitched sound (expected).

I ran the same kind of tests with LTspice and a connection to pin 3 shows a square wave from 0 to VCC. If I tested on the triangle wave output on both circuit configurations, I get a triangle waveform with a smaller amplitude. This time it goes from 0 to about 4.8V (which probably explains why I hardly hear anything).

Anyways, Instead of the above circuit, I connected pin 3 of the 555 timer to the amp input (on the 393) through a capacitor. I also connected an external sound source (my PC earphone jack playing loud music) to another input in the same amp (on the 393) then output to speaker, capacitor and to VCC (because LM393 output is open collector).

I got no results but when I switched the input source, I could hear only the local oscillator (from 555). I couldn't hear the music from the PC at all. I thought maybe I would hear pulses of sound since both inputs are changing but I don't even hear that.

Am I picking the wrong parts? or what am I doing wrong?

I want to see that I can get a normal class D amplifier to work from discrete parts before I move on to converting it to a stereo VU meter without heat.
 

Papabravo

Joined Feb 24, 2006
21,158
It is usual to show the power connections on an LM393. Where are they?
Down below the amplifier. So where are the bypass caps? Biasing the inverting(-) input at ground means the 555 can never change the comparator state. Where did this circuit come from?
Check out this reference
https://pdfserv.maximintegrated.com/en/an/AN3977.pdf
It suggests that you need a triangle oscillator to sample the AC signal. The 555 may be configured to do that but the swing is between ground and Vcc. If the comparator is going to work in single supply mode then AC the inputs must be centered at Vcc/2. If your AC input is ground referenced then the comparator requires a bipolar supply and the triangle needs to do the same.
 
Last edited:

crutschow

Joined Mar 14, 2008
34,280
You seem to be mixing apples and oranges.
Why are you trying to feed a Class D PWM switching signal into a Class AB analog amplifier?
That makes no sense.
 

Thread Starter

mike_canada

Joined Feb 21, 2020
239
I made parts of it. The triangle wave oscillator circuit portion came from this site actually when they were teaching about making a class D amplifier.
 

Thread Starter

mike_canada

Joined Feb 21, 2020
239
Why are you trying to feed a Class D PWM switching signal into a Class AB analog amplifier?
I thought maybe the resulting signal was meant to be smaller because the triangle wave input goes only as high as about 5V and the audio input could go higher and by mixing the signals I thought I'd get a much lower output so I figured if I added an amplifier then I can notice the signal.
But if I made an overkill, then I'll ditch the class AB amplifier stage and see if the LED can light in sync with the music.
 

Papabravo

Joined Feb 24, 2006
21,158
I made parts of it. The triangle wave oscillator circuit portion came from this site actually when they were teaching about making a class D amplifier.
In order to use a sawtooth or triangle waveform to convert an analog waveform into a PWM signal they need to be closely matched in terms of amplitude and offset. In this way the duty cycle will vary between approximately 1% and 99%. If you try to mix and AC waveform with a single supply device you will get crap for an output.
1659488418669.png
Changing the parameters will increase or decrease the distortion.
 
Last edited:

LesJones

Joined Jan 8, 2017
4,174
You are feeding the square wave output (Pin 3) of the 555 into the + input of the LM393. You need to use the ramp signal from the top of the timing capacitor. This signal will have a lower limit of about 1/3 of Vcc for the 555 and an upper limit of about 2/3 of the Vcc of the 555. You will also need to bias the - input of the LM393 to 1/2 of Vcc of the 555.

Les.
 

Ian0

Joined Aug 7, 2020
9,667
Interesting idea, and should work well enough to give you proof-of-concept. I can see two errors which @LesJones and @Alec_t have pointed out.
I would suggest using a comparator with push-pull outputs (TLC3702, for example), then removing CMPPU, CMPC, 56k and 10k resistors, BWCAP and the resistor across it, and replace the small-signal bipolar transistor by a small MOSFET.
I wish you luck when it comes to completing the feedback loop!
 

Thread Starter

mike_canada

Joined Feb 21, 2020
239
You are feeding the square wave output (Pin 3) of the 555 into the + input of the LM393. You need to use the ramp signal from the top of the timing capacitor. This signal will have a lower limit of about 1/3 of Vcc for the 555 and an upper limit of about 2/3 of the Vcc of the 555. You will also need to bias the - input of the LM393 to 1/2 of Vcc of the 555.

Les.
555.png

Ok so I'm trying to make the sawtooth waveform larger but instead I get a large square wave when I measure Q1 collector output. I played with C2 R3 R4 and R5 and had no luck. C2 I didn't want to go too low or I wouldn't capture the signal.
 

Ian0

Joined Aug 7, 2020
9,667
You don't need the sawtooth larger - it should approximately be the same peak to peak as your input signal. A 555 with a 9V supply will give a 3V p/p sawtooth.
A line level signal is 775mV rms, or 2.2V p/p
Your original circuit is correct, the output to the comparator comes from pin 2 and 6
 

Ramussons

Joined May 3, 2013
1,404
View attachment 272897View attachment 272897

I'm trying to make my own class D amplifier out of discrete components then eventually sampling the output using LED.

So far, the class AB amp (to the right of capacitor CMPC) is working with lots of heat (guess that's my consequence for choosing TIP31C and TIP32 transistors instead of better ones).

The reason I want to explore class D amplifiers is because I could probably somehow turn it into a VU meter (a circuit that converts sound to light pulses) without generating heat and I'm afraid if I use a class A amp then I'll create more heat.

So I ran some tests starting with the 555 timer and ignoring everything else. I wanted to hear what a triangle wave sounded like. and I couldn't hear a thing!

I even modified the triangle wave circuit so it matches a standard astable multivibrator circuit made from a 555. I tested 555 pin 2 (by connecting a capacitor and speaker in series to it to ground) and no sound. As soon as I disconnected the speaker+capacitor from pin 2 and hooked it to pin 3 (the out pin), I get a high pitched sound (expected).

I ran the same kind of tests with LTspice and a connection to pin 3 shows a square wave from 0 to VCC. If I tested on the triangle wave output on both circuit configurations, I get a triangle waveform with a smaller amplitude. This time it goes from 0 to about 4.8V (which probably explains why I hardly hear anything).

Anyways, Instead of the above circuit, I connected pin 3 of the 555 timer to the amp input (on the 393) through a capacitor. I also connected an external sound source (my PC earphone jack playing loud music) to another input in the same amp (on the 393) then output to speaker, capacitor and to VCC (because LM393 output is open collector).

I got no results but when I switched the input source, I could hear only the local oscillator (from 555). I couldn't hear the music from the PC at all. I thought maybe I would hear pulses of sound since both inputs are changing but I don't even hear that.

Am I picking the wrong parts? or what am I doing wrong?

I want to see that I can get a normal class D amplifier to work from discrete parts before I move on to converting it to a stereo VU meter without heat.
You may get an output if you use Pin 2 (6) output from the 555 instead of pin 3.
 

crutschow

Joined Mar 14, 2008
34,280
Below is the simulation of a PWM circuit using LM339/393 comparators that should work for your VU meter:
The simple R9C3 filter is just for the simulation to show the recovered audio output from the PWM signal (in practice the VU meter will act as the filter).

Depending on the VU meter impedance you likely will have to add a transistor buffer switch on the PWM output.

1659624542901.png
 

dl324

Joined Mar 30, 2015
16,839
Ok so I'm trying to make the sawtooth waveform larger but instead I get a large square wave when I measure Q1 collector output. I played with C2 R3 R4 and R5 and had no luck. C2 I didn't want to go too low or I wouldn't capture the signal.
I felt sorry for you and members who have to try to read your schematic. We don't draw wires over text (or components or symbols). It doesn't help that the LTspice symbol is retarded; pin order symbols are rarely useful for anything other than indicating routing congestion and, therefore, should rarely be used in schematics.
1659626336377.png
It still doesn't make much sense. It's not going to generate a sawtooth waveform. Leaving pin 5 floating is questionable. Leaving pin 4 floating is even more questionable.

We usually take the output from the timer output and if you want a sawtooth waveform, you need an integrator.
 
Last edited:

Audioguru again

Joined Oct 21, 2019
6,671
The output from the comparator will be PWM if its inputs are correctly biased at half the supply voltage and one input has a triangle waveform (not a squarewave) and the other input has audio.

Then when you feed the very high frequencies of the PWM to the inductance of a speaker there will be hardly any current in the speaker due to the high reactance of the inductance at very high frequencies.

A class-D amplifier usually has a lowpass filter feeding audio to the speaker.

I fixed your class-AB amplifier circuit:
 

Attachments

MisterBill2

Joined Jan 23, 2018
18,167
View attachment 272897View attachment 272897

I'm trying to make my own class D amplifier out of discrete components then eventually sampling the output using LED.

So far, the class AB amp (to the right of capacitor CMPC) is working with lots of heat (guess that's my consequence for choosing TIP31C and TIP32 transistors instead of better ones).

The reason I want to explore class D amplifiers is because I could probably somehow turn it into a VU meter (a circuit that converts sound to light pulses) without generating heat and I'm afraid if I use a class A amp then I'll create more heat.

So I ran some tests starting with the 555 timer and ignoring everything else. I wanted to hear what a triangle wave sounded like. and I couldn't hear a thing!

I even modified the triangle wave circuit so it matches a standard astable multivibrator circuit made from a 555. I tested 555 pin 2 (by connecting a capacitor and speaker in series to it to ground) and no sound. As soon as I disconnected the speaker+capacitor from pin 2 and hooked it to pin 3 (the out pin), I get a high pitched sound (expected).

I ran the same kind of tests with LTspice and a connection to pin 3 shows a square wave from 0 to VCC. If I tested on the triangle wave output on both circuit configurations, I get a triangle waveform with a smaller amplitude. This time it goes from 0 to about 4.8V (which probably explains why I hardly hear anything).

Anyways, Instead of the above circuit, I connected pin 3 of the 555 timer to the amp input (on the 393) through a capacitor. I also connected an external sound source (my PC earphone jack playing loud music) to another input in the same amp (on the 393) then output to speaker, capacitor and to VCC (because LM393 output is open collector).

I got no results but when I switched the input source, I could hear only the local oscillator (from 555). I couldn't hear the music from the PC at all. I thought maybe I would hear pulses of sound since both inputs are changing but I don't even hear that.

Am I picking the wrong parts? or what am I doing wrong?

I want to see that I can get a normal class D amplifier to work from discrete parts before I move on to converting it to a stereo VU meter without heat.
The comparator is connected as a classic zero crossing detector. Unfortunately does not seem to cross zero. So there is one problem.The startof a fix will be to bise the inverting input to about half of the amplitude of the triangle wave from the 555 timer IC.
 

Thread Starter

mike_canada

Joined Feb 21, 2020
239
I thought dropping the resistors further at the top transistor in audioguru's circuit would contribute to heat because of ohms law vs the transistor wattage rating? I'm going to resort to simply the class AB because that is easier for me to work with. I never thought of a 10K in series with the audio signal. and I did 4.7 ohms at the emitters because thats the closest I have to 1 or 2 ohms but I could drop. Then again, maybe no matter what I do, I'll need a heat sink.
 

Ian0

Joined Aug 7, 2020
9,667
I thought dropping the resistors further at the top transistor in audioguru's circuit would contribute to heat because of ohms law vs the transistor wattage rating? I'm going to resort to simply the class AB because that is easier for me to work with. I never thought of a 10K in series with the audio signal. and I did 4.7 ohms at the emitters because thats the closest I have to 1 or 2 ohms but I could drop. Then again, maybe no matter what I do, I'll need a heat sink.
If you're using @Audioguru again 's Class AB circuit you need none of the circuitry around the comparator, and you just have a standard audio amplifier. You need the 10k in series with the signal because it is an inverting amplifier - the base of the transistor is equivalent to the inverting input of an op-amp. 56k/10k sets the gain to be 5.6
If you really want it to be Class D, see my recommendation in post #9, and you may need a heatsink because the output stage isn't perfectly efficient but it will need a much smaller heatsink than if it were class AB.
 
Top