0
Offline
Newbie
Karma: 0
Posts: 38
Fezes are cool
|
 |
« on: February 28, 2011, 04:15:00 pm » |
Hi, I was wondering if the circuit below will be able to drive a 0.2 W speaker?  The capacitor is used to remove the DC offset from the PWM output, and the voltage divider is used to reduce the vpp to 1 V. The 10 kOhm resistor is to reduce current to the OPAMP, and 20 kOHM is to multply the input by 2 so that the output wil be 2 V peak to peak. The transistors in the feedback loop helps to supply the required 125 mA to the speaker. I don't have an scope to test this out, so I'm wondering if someone can verify that this circuit will not blow up. Thanks, s3n4te
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #1 on: February 28, 2011, 05:04:09 pm » |
Looks like it will function OK to me. I would use a audio taper pot on the input signal to give one a volume control. Keep in mind that there will be some 'cross-over' distortion in your output when the signal passes through 0vdc and neither transistors are conducting. 'Hi-Fi' class A/B amps usually apply a little dc bias such the both transistors are conducting a few milliamps with zero signal so that there is a smooth transistion between positive and negative cross-over. However as you are feeding this amp stage square waves anyway it's not like you won't have terrible odd order harmonic distortion anyway. Now if you did some low-pass filtering before the input stage and fixed the cross-over bias you might get musical quality tones through the thing.
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 38
Fezes are cool
|
 |
« Reply #2 on: February 28, 2011, 06:53:28 pm » |
Would feedback cause the output to compensate for deadzone problem?
|
|
|
|
« Last Edit: February 28, 2011, 06:55:07 pm by s3n4te »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #3 on: February 28, 2011, 07:01:56 pm » |
Would feedback cause the output to compensate for deadzone problem?
No. Recall your transistor basics. The emitter/base junction will only conduct when the applied voltage is greater then around .6vdc, so there is a time while the signal is moving from 0 to .6v that the transistor can't conduct. This is the source of the so called cross-over problem as one transistor stops conducting and the other starts conducting. Any basic description/drawing of class AB amplifiers will explain the DC bias set-up where neither transistor is allowed to completely turn off no matter what the signal value is. In essence the amplifier runs in class A (at a low continuous current flow) until the signal is high enough to 'take control' of the conduction transistor and so enters class B operation. Lefty
|
|
|
|
« Last Edit: February 28, 2011, 07:03:28 pm by retrolefty »
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25566
Solder is electric glue
|
 |
« Reply #4 on: February 28, 2011, 07:08:33 pm » |
Why have you drawn 12v batteries all over the place? You just need a +12 rail and a -12v rail.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 38
Fezes are cool
|
 |
« Reply #5 on: February 28, 2011, 07:40:03 pm » |
I understand why there is distortion if there is no opamp there, but not when there is an opamp with the output is connected back to inverting input of the opamp. The output would always equal to the input * gain no matter if the transistors off when input is -0.7 -- +0.7V? Is this correct?
Edit: I did a Fourier analysis at the output with 10khz sine wave, and the THD is only 1.3%.
|
|
|
|
« Last Edit: February 28, 2011, 07:44:58 pm by s3n4te »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #6 on: February 28, 2011, 07:51:23 pm » |
I understand why there is distortion if there is no opamp there, but not when there is an opamp with the output is connected back to inverting input of the opamp. The output would always equal to the input * gain no matter if the transistors off when input is -0.7 -- +0.7V? Is this correct?
Yes the opamp feedback circuit will try and correct the situation, but then the output of the amp isn't the real reflection of the input signal (+ gain) for short period of time around zero input signal. It causes a 'notching effect' at zero crossing that is easily seen on a scope and can be heard if one knows what to listen for. Again just read up on basic audio amplifier circuits using discrete components and you will learn all there is to know about the subject. Modern IC audio amplifier chips do the same thing inside to eliminate the problem. Again this is a classic problem for any amplifier using bipolar voltage push-pull output stage, which allows DC coupling to the speaker. A single ended amp stage does not have this problem, but are very inefficient running in continuous class A operation (50% current flow with zero audio signal) and have to be capacitance coupled to the speaker. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 38
Fezes are cool
|
 |
« Reply #7 on: February 28, 2011, 08:35:57 pm » |
If I add active low pass filter would that cause my output wave to be triangular?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #8 on: February 28, 2011, 08:41:03 pm » |
If I add active low pass filter would that cause my output wave to be triangular?
Not for frequencies below the cutoff design frequency of the filter. Not sure how you are processing audio information via PWM output. Is this using some kind of PCM signal? Or are you just ramping up and down the PWM duty cycle using a audio sine wave table? It's hard to design an effective filter unless one knows the signal format being used. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #9 on: February 28, 2011, 08:50:10 pm » |
the output of the amp isn't the real reflection of the input signal (+ gain) for short period of time around zero input signal. It causes a 'notching effect' at zero crossing that is easily seen on a scope and can be heard if one knows what to listen for. Again Absolutely true. However, if s3n4te is only listening to square waves out of an Arduino, he probably won't even notice it. I told him that. Not clear why one would string all those discrete components together to make a low-power amplifier when you can get an LM386 for less than the price of a pack of chewing gum? Maybe he is trying to learn how to design audio circuits, it's still an honorable task. The 'golden ear' audiophiles still frown on using opamps or ICs in general in their megabucks systems, go figure.
PS: In his circuit he is taking the feedback signal not from the opamp output, but rather right from the speaker output tap, which is common for such audio amps.
|
|
|
|
« Last Edit: February 28, 2011, 08:57:07 pm by retrolefty »
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 23
Posts: 446
|
 |
« Reply #10 on: February 28, 2011, 09:42:05 pm » |
You can improve the crossover distortion by trying to keep the transistors biased. Try adding a few resistors as shown to see if it improves things. You will need to experiment with the exact values, that's half the fun of building amplifiers.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 38
Fezes are cool
|
 |
« Reply #11 on: February 28, 2011, 09:43:20 pm » |
Okay after taking your recommendations, I have adjusted the circuit to resemble this:  The diodes are to provide the dc bias to prevent crossover distortion, the pot for volume control, and 22pF cap for active low pass filter. What do you guys think?
|
|
|
|
|
Logged
|
|
|
|
|
Saint Petersburg, Russia
Offline
Full Member
Karma: 2
Posts: 103
Amateur
|
 |
« Reply #12 on: February 28, 2011, 09:58:50 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #13 on: February 28, 2011, 11:17:33 pm » |
What do you guys think? Yea, dump the 1k and 4k resistors, just wire the pot's wiper to the 10k resistor. Time to melt some solder?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #14 on: February 28, 2011, 11:20:58 pm » |
That's a rather Lo-Fi approch, but with square wave input who cares, it will make noise. 
|
|
|
|
|
Logged
|
|
|
|
|
|