boost and cut from non-inverting opamp amplifier

Started by bartimaeus, October 24, 2020, 07:35:24 PM

Previous topic - Next topic

bartimaeus

hello! super basic question here... i'm trying to wire up a non-inverting amplifier to get unity gain, boost, or cut from a DPDT on/off/on toggle switch, with separate controls for the boost and cut levels. does this seem like it'd get the job done?



some questions that immediately spring to mind: would i be better off always boosting, and then attenuating for "unity"? should i be worried about the value of the input resistor, when i short out the pot in the feedback loop?

thank you for any thoughts or advice!

Rob Strand

What you have is fine but you can do it with a single SPDT by switching R2 instead of RV1, then RV2 and R2 switch to ground.

You can see the pattern in the front end of this Peavey schematic, top left.   Ignore C5, R5, S1.

http://www.freeinfosociety.com/media/images/2085.gif

The advantage of your circuit is it shorts RV1 which reduces noise.  However by choosing a smaller RV1 value you can get the noise down to a low level.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

bartimaeus

thank you very much for the fast feedback!

being able to use an spdt is pretty handy, though i do want to keep this as low-noise as possible. i did some googling about feedback resistor values, and ended up with this:


do you think this will be best of both worlds? i read it's good to add a resistor on the input that matches the one in the feedback loop for "offset current compensation"?
https://electronics.stackexchange.com/questions/56727/what-is-the-purpose-of-a-resistor-in-the-feedback-path-of-a-unity-gain-buffer


Rob Strand

Quotedo you think this will be best of both worlds? i read it's good to add a resistor on the input that matches the one in the feedback loop for "offset current compensation"?
For audio you normally aren't too concerned about offset currents because audio eventually high-pass filters the DC somewhere along the way.   If you are building circuits which amplify DC and you want the DC offsets to be stable then it's something that is of a major concern.


The NE5532 probably shouldn't be driving any lower than 600ohm.     Since your output could feed 1K (R4) the feedback resistors probably shouldn't present below about 1.5k in order to keep the load above 600 ohms.

A hidden source of noise is the 1M input resistor R1 and the impedance of input source.   The size of C1 has an impact as well.  The NE5532 has a high input noise current so high input impedances contribute to noise.    If the input source is a guitar then the input impedances isn't low so the sets a limit to how low the noise can go.        All said and done there is often little gain using feedback resistors less than about 4.7k.

FWIW, there's a whole lot of finer points regarding bias current compensation.   The correct way to do it is the DC impedance feeding each opamp input has the same resistance.    The DC resistance to the opamp + input isn't just the series resistance R5, it is R1 + R5.  So as you can see you should match 1M+100R on the opamp - input.   That's going to be a lot of noise!    If you *had* to do bias current compensation you would use 1M+100R on the opamp -input but put a cap across the feedback resistor so there is no noise for AC.   However that would still be wrong.   The other point is the DC resistance presented to the opamp - pin  RV1 in parallel with R2.    Anyway as you can see to do bias compensation correctly there's many details.  For audio it's something to be aware of but you don't want to be compromising the noise or adding a whole lot of components to solve a problem that does't need to be solved.

But ahhh, there's still more.   In your circuit the DC offset changes because the circuit has DC gain and that's going to cause a pop when you change between the two settings.   The way around that would be a cap in series with RV1.    You will also need to put a 1M resistor across the switch so RV1 doesn't completely switch out, it leaves a 1M DC path so the cap doesn't cause pop.

You should put a 2M2 resistor to ground on the input to stop pops when you plug in the input.

   
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

bartimaeus

#4
thank you again for taking the time to explain this! as always, blindly applying techniques from google just causes more problems huh!

in this case, i'm happy to say it's just for audio haha! so i'll let any offset currents be. but i appreciate you explaining the right ways to deal with it!

as for the 2M2, is it acceptable to just make R1 a higher value and move it to the other side of C1, so it can set the input impedance and shunt any stray current from the cap to ground?



i tried using values near the 4.7k you mentioned while also keeping them big enough to (mostly) avoid it turning this into a highpass filter at higher gain.

Rob Strand

Quoteblindly applying techniques from google just causes more problems huh!

in this case, i'm happy to say it's just for audio haha! so i'll let any offset currents be. but i appreciate you explaining the right ways to deal with it!
Electronics can be a pain sometimes, too many details.

Quoteas for the 2M2, is it acceptable to just make R1 a higher value and move it to the other side of C1, so it can set the input impedance and shunt any stray current from the cap to ground?
You need to keep you 1M on the IC side of C1.  That biases the opamp (DC-wise).   You could make the 2M2 a 10M if you like.

This site generally has circuit which are good examples to follow,
https://sound-au.com/project149.htm

The circuit uses 150k input, which is a bit low.  Notice also the 560 ohms.   That helps stop RF.   If you make that resistor too high it will add to the noise.    Also notice he doesn't use the 2M2/10M on the input, he relying on the socket shorting the cap.   That works in all cases except when you have a lead plugged in with nothing on the other end.

Quotei tried using values near the 4.7k you mentioned while also keeping them big enough to (mostly) avoid it turning this into a highpass filter at higher gain.
Yes, that's the right reasoning.   Small resistors means you need bigger caps to prevent high-pass filtering.  Large resistors let you use smaller caps but a some point the noise increases.

I just noticed yet another source of popping when you change the switch.   There will be a small DC offset at the output of the opamp.   In boost mode that DC voltage passes through to the buffer input cap.   However when you switch to boost mode that DC voltage passes through a divider which will divide down the DC.  The change in DC causes a DC glitch which cases a pop.    The only way to remove it is with more caps.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

Make your output cap 10uFd. While 0.1uFd is plenty to drive full bass into guitar cord impedances, The low impedance of the opamp (most amplifiers) also serves to sop-up stray hum pickup on the output lead, and a small cap spoils that benefit.

And PLAGIARIZE!! A whole generation of SS amplifiers start with a variable-gain NI opamp. Typically a pot from +23dB to -30dB, but you can pick your three set-gains and use a switch.
  • SUPPORTER

bartimaeus

Quote from: Rob Strand on October 25, 2020, 01:50:06 AM
You need to keep you 1M on the IC side of C1.  That biases the opamp (DC-wise).   You could make the 2M2 a 10M if you like.

oh i see, thanks for clearing that up!

QuoteThe circuit uses 150k input, which is a bit low.  Notice also the 560 ohms.   That helps stop RF.   If you make that resistor too high it will add to the noise.    Also notice he doesn't use the 2M2/10M on the input, he relying on the socket shorting the cap.   That works in all cases except when you have a lead plugged in with nothing on the other end.

thank you again for your help :) that schem does seems fairly straightforward, but i'd still be confused by some of the stuff he doesn't explain. speaking of which, i notice he has a cap in series with the negative input resistor to ground – what's the benefit of that if it's not switchable?

Quote
I just noticed yet another source of popping when you change the switch.   There will be a small DC offset at the output of the opamp.   In boost mode that DC voltage passes through to the buffer input cap.   However when you switch to boost mode that DC voltage passes through a divider which will divide down the DC.  The change in DC causes a DC glitch which cases a pop.    The only way to remove it is with more caps.

oh, nice catch! could I get away with a 1M resistor to ground next to RV2, to avoid using so many big caps?



Quote from: PRR on October 25, 2020, 04:42:00 PM
Make your output cap 10uFd. While 0.1uFd is plenty to drive full bass into guitar cord impedances, The low impedance of the opamp (most amplifiers) also serves to sop-up stray hum pickup on the output lead, and a small cap spoils that benefit.

i'm using this as an input to an eq, which is why there's not much output filtering. but i never knew that about opamps preventing/fixing hum! usually i'd use 470nf and 100k to ground for the output, would that still do the job?

Quote
And PLAGIARIZE!! A whole generation of SS amplifiers start with a variable-gain NI opamp. Typically a pot from +23dB to -30dB, but you can pick your three set-gains and use a switch.
i'm always a bit nervous to steal too much, because there's often extra stuff going on that i don't understand. hopefully i can do a better of it once i finally finish reading the art of electronics!