Author Topic: My first audio amplifier (and it's really bad)  (Read 2378 times)

0 Members and 1 Guest are viewing this topic.

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
My first audio amplifier (and it's really bad)
« on: May 09, 2019, 07:51:31 pm »
I'm requesting your help because I can't make it work very good. By very good, I'm mean relatively to what I expected from it, and by that I mean very poor quality but at least the sound gets louder without saturating at Vcc/5.

Attached below is the schematic of it.

As you can see, it works with a general purpose LM358P OpAmp (I don't expect it to be very great for audio), followed by an emitter follower based on a Darlington pair of two random BJTs I had on my bench.

I won't discuss about the quality of it, the only big problem is that it saturates like crazy when the output is more than 2V peak-to-peak and I'm not quite sure why (it's a way to say that I haven't got any idea).

The strange thing is that if I increase Vcc, it ceases to saturate for one second and then it saturates again. It's like the operating point of the transistor changes for a second while the capacitor charges or discharges itself.

I tried several things. I'm not sure about what value to put for Re. All I've noticed is that under 100 Ohms, no significant improvement can be observed apart from the temperature of the room, and above 10 KOhms, the output signal amplitude decreases too much.

The value of C doesn't seem to change anything, except that under 100nF, the low frequency are cut off too much.

The whole point of the capacitor was to avoid biasing the transistor myself, but since its emitter is connected to -Vcc (in the beginning, it was connected to 0V), I'm not sure wether it is useful anymore. I tried to connect the loud speaker directly to the emitter of the transistor without any major improvement, or without any improvement at all.

I tried to connect the other pin of the loudspeaker to -Vcc (it is a very cheap loudspeaker, under $1, I don't really mind if I destroy it accidentally), and it improved things a bit, but that's a very ugly "solution" since it can damage the loudspeaker. Actually, I don't really know why this improved the saturation.

So, two questions : how do I reduce the saturation, and how do I choose Re and C?
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: My first audio amplifier (and it's really bad)
« Reply #1 on: May 09, 2019, 08:29:53 pm »
Erf... Re is typically a small value to provide a bit of local negative feedback (called "emitter degeneration"). You also need to insert a resistor in series with the collector and take your output from the collector.

Finally, you'll also need to modify the circuit so that the transistors are biased into conduction with a current through the collector load resistor equal to the maximum current you wish to draw from the amplifier (Class A operation). Applying a constant positive voltage to the op-amp non-inverting input will get the ball rolling, but this will NOT be stable. I leave it to you to dig a little deeper into how to solve this problem (hint - diodes can help here).

 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #2 on: May 09, 2019, 09:09:41 pm »
also bare in mind, that the LM358/324 is not a good choice for Audio; it's an opamp for DC which can go close to negative/gnd rail, what makes it a good single supply opamp, but not for AC because of the crossover distortion.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: My first audio amplifier (and it's really bad)
« Reply #3 on: May 09, 2019, 10:01:25 pm »
The loop isn't closed at DC, so it won't work. The output will just clip at either extreme.

Yes, people may complain about the LM358 having crossover distortion, but that's a non-issue for this circuit because it only sources, never sinks current, so no crossover distortion.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3382
  • Country: gb
Re: My first audio amplifier (and it's really bad)
« Reply #4 on: May 09, 2019, 10:10:06 pm »
Don't vary the closed loop gain to change the output as you are currently doing.  Fix the closed loop gain, and use the potentiometer to vary the input into the amplifier.  You will need to bias the input at around half the supply voltage.

What is the value of Rc and what is you speaker impedance? As someone else has mentioned this design is (or will be) a Class A amplifier since your output stage can only source current, you have to rely on Rc to sink it.  With a suitable value of Rc, and correct biasing this can work but will be horribly inefficient, the output transistor and Rc will be burning lots of power even with little or no output, requiring a big heatsink. 

Consider adding a complementary PNP output stage so that your amplifier can "push" and "pull" current, you will then have a Class B output.  It will sound bad with lots of crossover distortion, so then you can find out how to bias both output transistors into partial conduction to fix this, and end up with a Class AB, which is how the vast majority of linear amplifiers operate.

The 10uF output capacitor is woefully undersized for a typical 4 or 8 ohm speaker, this will block all low to mid frequencies; for an 8 ohm speaker it will start rolling off below about 4kHz, (8kHz for a 4 ohm speaker!).  Even for low fidelity you need at least 10 times the capacitance, and it you want to put music through it maybe 100 times.
 

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #5 on: May 09, 2019, 10:46:21 pm »
Erf... Re is typically a small value to provide a bit of local negative feedback (called "emitter degeneration"). You also need to insert a resistor in series with the collector and take your output from the collector.

Finally, you'll also need to modify the circuit so that the transistors are biased into conduction with a current through the collector load resistor equal to the maximum current you wish to draw from the amplifier (Class A operation).

You seem to think that I want a common emitter mounting, but what I want is an emitter follower aka common collector, to buffer the output of the op-amp.

Applying a constant positive voltage to the op-amp non-inverting input will get the ball rolling, but this will NOT be stable.

I don't really understand what you're talking about.

also bare in mind, that the LM358/324 is not a good choice for Audio; it's an opamp for DC which can go close to negative/gnd rail, what makes it a good single supply opamp, but not for AC because of the crossover distortion.

Yes, as I said, I don't expect anything great of it, but I don't think such a big saturation may be explained by a bad op-amp for audio.

The loop isn't closed at DC, so it won't work. The output will just clip at either extreme.

Yes, people may complain about the LM358 having crossover distortion, but that's a non-issue for this circuit because it only sources, never sinks current, so no crossover distortion.


That's what I thought first, but then I tried to remove the capacitor to close the loop at DC, but that didn't really make things better. Also remind that the input hasn't got any DC component, so that shouldn't matter. I tried to offset the input to put a DC component, and of course, it didn't work anymore.

And, yes, I probably expect that it is a bad design, since I haven't got any experience nor really understand what I'm doing nor really checked on the internet to find a better basis, but I really would like to understand why it is bad before looking at something that works better.

Thank you very much for your help.
 

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #6 on: May 09, 2019, 11:06:07 pm »
What is the value of Rc and what is you speaker impedance? As someone else has mentioned this design is (or will be) a Class A amplifier since your output stage can only source current, you have to rely on Rc to sink it.  With a suitable value of Rc, and correct biasing this can work but will be horribly inefficient, the output transistor and Rc will be burning lots of power even with little or no output, requiring a big heatsink.

I think you probably misread my bad handwriting, I wrote Re but it looks like Rc, sorry for that.

As I said, I let Re be between 100 to 10k, with no major differences, so I let it at 1k. And, yes, I know class A are terribly I inefficient, like less than 10%, but I just wanted to quickly try it, and now I'm stuck because it doesn't work.

The impedance of the loud speaker is 150 +/- 20 according to the datasheet, so it is not that loud of a speaker. Its frequency response is awful so I don't really mind losing a lot of low frequencies, and I won't use it anyway, I just want to make it work before moving on to a better circuit.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: My first audio amplifier (and it's really bad)
« Reply #7 on: May 10, 2019, 10:51:58 am »
There are a few things I missed when in my previous post.

Where's the input coming from?

The output needn't be AC coupled. You have a bipolar power supply, so you might as well make use of it.

There was no limit to the maximum gain. With the potentiometer set to full, the op-amp will be in open loop so will saturate at either rail. As mentioned above, fix the gain and use the potentiometer to attenuate the input. I've AC coupled the 4k7 resistor to the negative rail so it doesn't have a high DC gain, which would amplify the op-amp's offset voltage and pass it through the speaker. The total gain of the circuit is now 0 to just over 200.

The potentiometer shouldn't have any DC in it, so AC coupling it is a a good idea.

This circuit is class A and very inefficient. It will dissipate 20W and only give 1W RMS into an 8 Ohm load! Re should be rated for over 10W and the BD439 must be n a good heatsink.
« Last Edit: May 10, 2019, 10:57:43 am by Zero999 »
 

Offline dzseki

  • Frequent Contributor
  • **
  • Posts: 524
  • Country: hu
Re: My first audio amplifier (and it's really bad)
« Reply #8 on: May 10, 2019, 11:11:04 am »
An NJM4556 opamp would drive your speaker right away.
HP 1720A scope with HP 1120A probe, EMG 12563 pulse generator, EMG 1257 function generator, EMG 1172B signal generator, MEV TR-1660C bench multimeter
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: My first audio amplifier (and it's really bad)
« Reply #9 on: May 10, 2019, 11:39:15 am »
You seem to think that I want a common emitter mounting, but what I want is an emitter follower aka common collector, to buffer the output of the op-amp.

Sorry, yes, I quickly looked at your sketched circuit then wrote my post and made some poor assumptions/conclusions from such. Regardless, similar advice applies in that the emitter resistor in a Class-A single-ended emitter follower needs to be lower in value than the expected load impedance and the standing current flowing through both (ie - when no signal is being amplified) needs to exceed the maximum load current. That is the definition of Class-A operation after all, and its your only choice of operating mode for a single-ended audio amplifier.

Applying a constant positive voltage to the op-amp non-inverting input will get the ball rolling, but this will NOT be stable.

I don't really understand what you're talking about.

It no longer applies, but basically, if the emitter resistor is connected to a negative supply and the feedback (to the op-amp (-) input) is taken from junction of emitter and emitter resistor (not after the DC blocking capacitor, which shouldn't be needed now, anyway) then the op-amp will automatically force the transistor to operate in Class-A as it tries to maintain the output at 0V (with no signal input, that is). If the transistor wasn't biased on enough then the output would be a negative voltage, after all.

EDIT - well I see that Zero999 handed you the solution on a silver platter!  :-DD

EDIT 2 - fixed quoting
« Last Edit: May 10, 2019, 01:48:03 pm by MagicSmoker »
 

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #10 on: May 10, 2019, 11:49:16 am »
Until now, the signal was coming from my function gen. I just output a sine wave between 50 and 100 mVpp, and adjusted the gain until I saw saturation.

So, I will try your modification as soon as I can and will say if it works better.

But why do Re have to be so small ? In my (very small) experience, it works even with bigger values.

And finally, so, what was the reason the output saturated only at about 2Vpp when then rail is at 5 times the voltage? From what I read of what you wrote, is that because my configuration amplified the offset of the Opamp? I'm not quite sure since the capacitor was precisely removing this DC component. Also, I'm not quite sure why the feedback is connected to -Vcc and not to ground through the divider.

Thank you for your help.

EDIT:
EDIT - well I see that Zero999 handed you the solution on a silver platter!  :-DD

Yes, indeed, and that's very kind of him. In general, I see that people on this forum are very kind and helpful. By the way, I should emphasise that my point is more to understand why it works or doesn't work than to make it work and use it, because, as everyone said, it will be awfully inefficient anyway.
« Last Edit: May 10, 2019, 11:56:33 am by jtruc34 »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: My first audio amplifier (and it's really bad)
« Reply #11 on: May 10, 2019, 12:21:21 pm »
Until now, the signal was coming from my function gen. I just output a sine wave between 50 and 100 mVpp, and adjusted the gain until I saw saturation.

So, I will try your modification as soon as I can and will say if it works better.

But why do Re have to be so small ? In my (very small) experience, it works even with bigger values.

And finally, so, what was the reason the output saturated only at about 2Vpp when then rail is at 5 times the voltage? From what I read of what you wrote, is that because my configuration amplified the offset of the Opamp? I'm not quite sure since the capacitor was precisely removing this DC component. Also, I'm not quite sure why the feedback is connected to -Vcc and not to ground through the divider.
Re forms a potential divider with the output load. The transistor can only pull the voltage across the load, towards the positive rail. It's the job of Re to pull the load voltage towards negative. Lowering Re will increase the possible negative output swing, at the expense of greater power dissipation. Increasing it will have the reverse effect. If you don't have adequate heatsinking, then no doubt it will work better, if Re is high, but you won't get so much voltage swing.

Re could be replaced with a constant current sink, but that would require another transistor, which would be better employed converting it to class AB operation.

The feedback potential divider is AC coupled to -V and has a DC gain of 1. It theoretically makes no difference whether it goes to 0V, -V or +V, since it has the same effect at AC, as the power supply rails should be properly decoupled i.e. have capacitors in parallel with them. The reason was to provide DC bias across the coupling capacitor.
 

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #12 on: May 10, 2019, 12:40:05 pm »
OK, thank you very much. But since my loud speaker has about 150 Ohms impedance, Re probably doesn't need to be that low, does it?

And I still don't understand why my amplifier was saturating at only Vcc/5 output.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: My first audio amplifier (and it's really bad)
« Reply #13 on: May 10, 2019, 01:47:14 pm »
OK, thank you very much. But since my loud speaker has about 150 Ohms impedance, Re probably doesn't need to be that low, does it?

And I still don't understand why my amplifier was saturating at only Vcc/5 output.

You should have stated the impedance of the speaker, otherwise people assume 8Ohms which is the most common one. I agree, for 150Ohms, Re can be higher, try 100R to start with.

The output was saturating because Re drops a significant voltage.
 

Offline jtruc34Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ch
Re: My first audio amplifier (and it's really bad)
« Reply #14 on: May 10, 2019, 03:33:53 pm »
I already stated it in another answer, according to what someone else asked me, sorry that you didn't see it. Yes, 100R is about what I have.

So, if it is because of Re, changing its value would have made things better, but it didn't... I'm lost  |O  :-DD
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: My first audio amplifier (and it's really bad)
« Reply #15 on: May 10, 2019, 04:13:18 pm »
I already stated it in another answer, according to what someone else asked me, sorry that you didn't see it. Yes, 100R is about what I have.

So, if it is because of Re, changing its value would have made things better, but it didn't... I'm lost  |O  :-DD

The feedback resistance ratio given by Zero999 above might be asking too much of a sloppy op-amp like the LM358. As a first-pass I'd limit the voltage gain to around 10x and avoid the use of very large resistance values in general. Try 100k for the feedback resistor and 10k for the shunt resistor.

As for the value of the emitter resistor, that really depends on how much (reasonably linear) negative output swing you need. Consider if it was 100R and the speaker impedance is 100R, then the positive half of the waveform can swing nearly to the positive supply on account of the transistor providing it, but for the negative half of the waveform the best the transistor can do is turn completely off, allowing all of the output to come from the emitter resistor, which being equal to the speaker impedance in this example means you get a maximum of 1/2 the negative supply. This will make for a most unpleasant listening experience even if high fidelity, per se, isn't the goal. With a 10R emitter resistor the negative swing can approach 90% of the rail but standing current increases to around 1A (a 0V output the effective collector-emitter resistance of the transistor will be 10R).

Hopefully that is enough of an explanation to set you on the right path without doing all the thinking for you.

 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: My first audio amplifier (and it's really bad)
« Reply #16 on: May 10, 2019, 10:27:21 pm »
Yes, the LM358 doesn't have sufficient bandwidth for a gain of 200, at audio frequencies, perhaps it will be fine for voice, but not much else. It would be better to split the gain between two stages.

I already stated it in another answer, according to what someone else asked me, sorry that you didn't see it. Yes, 100R is about what I have.

So, if it is because of Re, changing its value would have made things better, but it didn't... I'm lost  |O  :-DD
Forgive me for not reading everything in the minutest detail. In future please put important details like that either in the first post or even better, the schematic. Few people will have time to read everything.

As mentioned above the Re drops voltage. The lower its value, the less voltage it will drop, for a given current, as per Ohm's law. Unfortunately, because the DC voltage across it is 10V, irrespective of its value, the DC current, will also increase, as the value is reduced.

Here's a simulation showing a 100R load with the amplifier set for a gain of 101. The clipping doesn't go away until R3 is lowered to 20R. Increasing it only makes it worse.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf