Author Topic: (Sorry) op amps.  (Read 2677 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
(Sorry) op amps.
« on: November 20, 2017, 01:24:12 pm »
I've spent two days playing with op amps.  Everything is grand with DC: comparators, followers, neg fb gain etc. 

It's when I put a small AC signal in that I run into problems.

I have an input from my sound card, it's line level, +- about ~250mV around the ground on the RCA lead (normal 0V, it's 0V potential to the 0V rail on my breadboard)

The opamp has 0V-12V rails.

I have a 6V virtual ground from either a (variable) voltage divider or an opamp buffer producing 6V.

TLDR;
How do you correctly lift the input "ground" to the rail split virtual ground so you get VMax - Virtual Ground - VMin.  In my case 6V +- 250mV and 6V +- 2000mV on the output?


Skipping many hours of reading, you tubing, tinkering and genuine concern for my sound card RCA outputs.  I did manage to get an amplified signal.  But it had issues.

Basically I had to decouple the input via a series cap, apply a pull up voltage onto that signal to raise it up above the lower rail and I got a signal.

It felt very wrong applying (at first 2.5V) to the "output" of the RCA though even with the series cap "decoupling" it.  I tried the opamp buffer (rail splitter) to get 6V which tested out fine, but when I applied that to the input signal I got a pop and the channel went mute ( I mean the sound card cut it's output off and the headphones went off).  I don't think it liked it, but it thankfully recovered when I removed the voltage.

Back to using a voltage divider for the "virtual" ground at 2.5V.  I was able to get a maximum gain of about x4 before the op amp either clipped or just stopped working and the output collapsed.  So that was something like 800mV p-p.  If I wound the gain higher I clipped on the top rail, if I wound the reference voltage up the output collapsed.

I gather the issue is the op amp is amplifying the virtual ground as well, so if I give it +2.5V and add my +-200mV AC signal @ x4 gain I getting 800mV peak to peak on a 2.5x4=10V DC offset.  9.2V to 10.8V.  I confirmed this with the multi-meter.  If I took the ref voltage up the amp clipped until it collapsed against the top rail.  If I took the ref voltage down it collapsed against the lower rail.

So do I apply the virtual ground voltage to both inverting and non-inverting or ... more likely am I just in a muddle.

I think I'm just missing one piece of the puzzle or have miss interpreted something fundamental along the way regarding virtual ground on the op amp, versus the input signal ground.

(Also... assuming I get this working, how would I then be able to bias the output 6V -+1000mV back down to normal 0V ground to send on to something like a speaker?  Thinking out load, if I pass it through a series cap pulled to 0V ground on the speaker side, will that work?)
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: (Sorry) op amps.
« Reply #1 on: November 20, 2017, 01:41:31 pm »
Basically I had to decouple the input via a series cap

This is how it is usually done. You shall seek for application notes and reference designs from IC manufacturers, see how they suggest to implement stuff.
Example:

http://www.ti.com/lit/ds/symlink/tpa4861.pdf

Quote
apply a pull up voltage onto that signal to raise it up above the lower rail and I got a signal.

When use series capacitor, you don't apply voltage. You just create a "pop" when it is charged :) Again it is ok.
 

Offline aiq25

  • Regular Contributor
  • *
  • Posts: 241
  • Country: us
Re: (Sorry) op amps.
« Reply #2 on: November 20, 2017, 01:45:02 pm »
Do you have a schematic?

I'm not familiar with audio applications. You can use differential amplifiers to adjust DC levels or just a DC blocking cap with a resistor divider.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: (Sorry) op amps.
« Reply #3 on: November 20, 2017, 01:46:21 pm »
« Last Edit: November 20, 2017, 01:53:38 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #4 on: November 20, 2017, 03:31:12 pm »
The pop was probably the large 1uF cap, I replaced it with a 50nF cap and the pop is now tiny and the RCA backs off less.

I'm still lost.  So I took a step back and removed the op amp completely.

I put two probes on the input.  One before the cap (direct from the RCA).

RCA Output (Probe1) ---||--- (Probe2)
|                           
0V

With just that I get about 400mVpp on Probe1 and 200mVpp on Probe2.   Is this just expected loss across the coupling cap?

If I then pull the Probe 2 side up to 6V using a voltage divider I get about 100mVpp at Probe2 and a 6V DC offset (what I wanted).

RCA Output (Probe1) ---||--- (Probe2) --- 6V
|                           
0V

However if I try and pull Probe2 side up to 6V with the opamp buffer rail splitter the RCA output drops way down and I get about 70mVpp at Probe2 ... most of which is computer RF and it's virtually impossible to distinguish a signal on the oscilloscope.

So I'm thinking I'm screwing up the impedances.  Should the +6V from the virtual ground have a resistor on it?

I tried pulling Probe2 side to ground with a 10K resistor, but it didn't make any difference or muted the signal all together.

RCA Output (Probe1) ---||--- (Probe2) --- 6V --- 10K --- 0V
|                           
0V

If I can get this bit right, then it's a start.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: (Sorry) op amps.
« Reply #5 on: November 20, 2017, 03:35:29 pm »
With just that I get about 400mVpp on Probe1 and 200mVpp on Probe2.   Is this just expected loss across the coupling cap?

I would say unacceptable signal level loss. Decoupling capacitance is too small. Don't go below 0.1uF (100 nF). 1uF seems about right. And don't worry about pops. They are expected for simple/single_power_rail amps.

Further reading:
https://www.allaboutcircuits.com/tools/capacitor-impedance-calculator/
« Last Edit: November 20, 2017, 03:41:47 pm by ogden »
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #6 on: November 20, 2017, 03:46:08 pm »
I found this:
Quote
Line outputs usually present a source impedance of from 100 to 600 ohms. The voltage can reach 2 volts peak-to-peak with levels referenced to ?10 dBV (300 mV) at 10 k?. The frequency response of most modern equipment is advertised as at least 20 Hz to 20 kHz, which corresponds to the range of human hearing. Line outputs are intended to drive a load impedance of 10,000 ohms; with only a few volts, this requires only minimal current.
Source: https://en.wikipedia.org/wiki/Line_level#Line_out

Does that mean I should have something like this, below, to AC couple it and give it the 10k impedance it expects to drive?

RCA Output ---||---> 6Vgnd --> amplifier input
|
10K
|
GND

The capacitor impedance is tiny compared to 10K  it's like 100Ohms.

I would say unacceptable signal level loss. Decoupling capacitance is too small. Don't go below 0.1uF (100 nF). 1uF seems about right. And don't worry about pops. They are expected for simple/single_power_rail amps.
Further reading:
https://www.allaboutcircuits.com/tools/capacitor-impedance-calculator/

I'm less worried about the pops and more where I hear them and the result after them.  The headphone amp has a line level pass through, it's just electrically wired through.  As the same time it's driving the headphones via it's own amp.  I hear the pop through the headphones and the channel I just hooked up drops to considerably lower volume that the untinkered channel.
« Last Edit: November 20, 2017, 03:48:52 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #7 on: November 20, 2017, 03:57:12 pm »
Actually I think in my original circuit the signal (Probe 1 side) has no circuit path.  It's floating in the breeze.  The oscilloscope sees the 400mV only because it has a GND on the probe shared with the line input.  The left side of the circuit before the cap has no route to GND, so no current.  When I then pull that floating voltage through the cap and up to 6V it gets all but lost in the noise.

I don't have anymore time to play this afternoon, I'll have to pick it up later.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: (Sorry) op amps.
« Reply #8 on: November 20, 2017, 04:03:39 pm »
Here is a discussion of a simple amplifier with rail splitter circuit and it talks directly about the problems you are having:

https://electronics.stackexchange.com/questions/153911/single-supply-op-amp-audio-amplifier

Here is a much better article but for more advanced circuits:

http://www.ti.com/sc/docs/apps/msp/journal/nov2000/nov_08.pdf
 
The following users thanked this post: paulca

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #9 on: November 20, 2017, 04:30:06 pm »
Here is a discussion of a simple amplifier with rail splitter circuit and it talks directly about the problems you are having:

https://electronics.stackexchange.com/questions/153911/single-supply-op-amp-audio-amplifier

Here is a much better article but for more advanced circuits:

http://www.ti.com/sc/docs/apps/msp/journal/nov2000/nov_08.pdf

Ah ha!
Quote
C3 blocks DC so that the divider only works on your AC signal, not the DC bias point.

That solves the "amplifying the DC offset" issue.

I might get somewhere now.

Thanks.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: (Sorry) op amps.
« Reply #10 on: November 20, 2017, 06:35:31 pm »
Actually I think in my original circuit the signal (Probe 1 side) has no circuit path.  It's floating in the breeze. The oscilloscope sees the 400mV only because it has a GND on the probe shared with the line input.  The left side of the circuit before the cap has no route to GND, so no current.

What you say actually does no makes sense unless you do not connect GND of the signal source to GND of the amplifier. If GND of the both are common and ground of both probes are connected to said GND connection - nothing is floating in the breeze. You shall try to show circuits you are talking about - to avoid misunderstandings
« Last Edit: November 20, 2017, 06:39:27 pm by ogden »
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #11 on: November 20, 2017, 08:10:18 pm »
It works!

The output from my PC is foul for noise, but the caps filter it right out.

It's an LM741 and it obviously doesn't make a good audio amp, so I'm not even going to connect it to a speaker.  It was just an exercise in opamps and AC.

It responds to anything above about 30Hz and cuts off hard at about 15KHz.  Not sure if that's the LM741 or more likely the RC values.



Thanks for all the help I learnt a lot today.

Next on the list is back to digital stuff (programming an LCD display from the PI), thankfully as this analogue stuff is hard on the head.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #12 on: November 22, 2017, 12:56:27 pm »
Actually I think in my original circuit the signal (Probe 1 side) has no circuit path.  It's floating in the breeze. The oscilloscope sees the 400mV only because it has a GND on the probe shared with the line input.  The left side of the circuit before the cap has no route to GND, so no current.

What you say actually does no makes sense unless you do not connect GND of the signal source to GND of the amplifier. If GND of the both are common and ground of both probes are connected to said GND connection - nothing is floating in the breeze. You shall try to show circuits you are talking about - to avoid misunderstandings

I was getting all confused with the whole AC coupling cap considering it as being effectively an insulator and only the fluctuations in current influencing the other side.  So I then seen the signal wire from the RCA as "floating" with no connection to ground.

Of course this is not true, but it's still an area of confusion.

Out of interest, I did connect it to GND on the input side of the AC coupling cap via a 10K and it did absolutely nothing (visible).
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: (Sorry) op amps.
« Reply #13 on: November 22, 2017, 02:21:31 pm »
The RCA jacks on your sound card are probably connected to earth ground inside the PC.  Is there any part of your amplifier that is referenced to earth ground?  Probably not...  It depends on the power source.

However, the ground lead on your scope probe IS referenced to earth ground.  So, the ground side of your signal is probably going to earth by way of the power cord and then coming back in via your scope probe.

There really are no one wire circuits.

 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4038
  • Country: gb
Re: (Sorry) op amps.
« Reply #14 on: November 22, 2017, 02:48:05 pm »
The RCA jacks on your sound card are probably connected to earth ground inside the PC.  Is there any part of your amplifier that is referenced to earth ground?  Probably not...  It depends on the power source.

However, the ground lead on your scope probe IS referenced to earth ground.  So, the ground side of your signal is probably going to earth by way of the power cord and then coming back in via your scope probe.

There really are no one wire circuits.

The anomaly is that my scope probe is not referenced to earth ground in any way when I pull the power cord out of the laptop just it's internal battery 0V.  Note the scope is on the laptop, RCA outputs from the PC.  Using a scope on a laptop battery allows this test and allows me to be absolutely sure I cannot short the probes to ground and fry stuff.

One route the signal has to complete a circuit is through the AC coupling cap, through the amp breadboard circuitry and into the PSU GND which (IIRC) is floating, not clamped to the earth binding post.  Eventually I assume that ends up some how onto the mains neutral.

The shorter path is of course that the signal ground on the breadboard is shared with the PSU ground, so it will take the shortest route to that ground after passing through the AC coupling cap.

Of course if I disconnect the RCA GND from the breadboard I still get signal but with a huge 50Hz mains hum as the signal circuit is forced to travel all the way through the whole Breadboard, PSU, Mains plugs etc.  I expect if I used my phone as audio source (assuming it was running on battery) this route would not be available and I would get no signal at all.  Similarly if I ran the breadboard amp on a battery there would be no GND path either and no signal.

My only confusion was with the AC coupling cap as I was thinking of it as an isolator/insulator when of course it's not and current does pass through it and potential does exist across it.  The fact the only route to GND for the signal exists beyond it doesn't matter, it is still a route.  I watched some videos on the theory of capacitors and it gets pretty complicated pretty quickly.
« Last Edit: November 22, 2017, 02:51:00 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf