What are the rules op amps in circuit order, ones to invert and ones to not.

Started by bushidov, January 12, 2020, 11:26:20 AM

Previous topic - Next topic

bushidov

Hi All,

What are the rules op amps in circuit order, ones to invert and ones to not. In looking at a lot of preamp, overdrive, and distortion pedal schematics, I am not sure I am seeing a pattern of when to, and when not to use a non inverting or inverting op amp.

Ideas? Any rules of thumb? Exceptions?

Sorry to bother everyone.
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."

- Antoine de Saint-Exupéry

Digital Larry

Off the top of my head,
- use non-inverting when really high input impedance is needed, like at the front of a guitar pedal
- if you have multiple signal paths that mix together (like in a flanger or chorus/vib) you can get different sounds sometimes by flipping the phase (which would usually be done by an inverting stage with a gain of -1)
- filters are their own beasts and probably should not be lumped in to this simplistic explanation
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

iainpunk

there are no real rules, but using one way over another might yield different results due to the different pros and cons

non inverting opamp can only boost, and some opamps are not stable at unity gain, the math is a little easier because you can just take the behavior of the passive feedback path and flip it up side down, a 6db/oct cut becomes a 6db/oct boost, a static -20db becomes a +20db

inverting opamps can also cut, which is handy when designing active tone stacks and the likes, they tend to be a bit more stable and its preferred by most engineers, the downsides are that the phase of the signal gets flipped upside down, which may have adverse effects when blending it back in later, another problem is input impedance, when aiming for high gains, you have to use enormous value resistors to not have a low input impedance. EDIT: higher value resistors tend do introduce more thermal noise than lower value ones

i hope this helps
friendly reminder: all holes are positive and have negative weight, despite not being there.

cheers

R.G.

The only rule I know of for inverting versus non-inverting is more of a humorous quip. It goes "Always invert, unless you can't."
That's intended for highest precision, lowest offset, best bandwidth, yada, yada kind of applications. For typical pedals, the needs of the application are so mild that you usually can't tell the difference.

The only semi-rule might be that you want a non-inverting opamp as an input buffer, if you use an opamp for an input. This is because you want an input impedance of 1M or more to avoid treble loss if a magnetic pickup guitar is plugged right into the pedal input, and the non-inverting opamp circuit is easier to get this high an impedance. It is >possible< to get an inverting input opamp circuit's impedance up to a meg or more, but its more complicated and demanding. If the non-inverting circuit works for an input, use it.

Another semi-rule is that your whole pedal should be non-inverting from input to output, at least to the extent that you can determine phase by counting inversions.

Other than those considerations, use the opamp as inverting or non-inverting however your circuit needs. There are other minor considerations that come in, but nothing near a rule.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Ben N

  • SUPPORTER

GibsonGM

  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

Ben N

Quote from: GibsonGM on January 13, 2020, 09:06:38 AM
Quote from: Ben N on January 13, 2020, 08:32:02 AM
Inverting for mixing parallel inputs.

For higher input impedance?
No, this would be a virtual earth mixer, which I am told has the benefit of the inputs not interfering with one another. If you need high input impedance, you would have to buffer the inputs.
  • SUPPORTER

merlinb

Inverting opamp stages are often noisier than non-inverting ones, especially in the hands of novice circuit designers. Non-inverting should probably be your 'default' choice for anything pedal related, until you actually need an inverting widget, such as for convenient mixing.

Steben

Quote from: merlinb on January 13, 2020, 10:30:32 AM
Inverting opamp stages are often noisier than non-inverting ones, especially in the hands of novice circuit designers. Non-inverting should probably be you 'default' choice for anything pedal related, until you actually need an inverting widget, such as for convenient mixing.

Not sure the noise comes from the topology on itself. As said before, inverting opamps need high impedances in line with the signal to have high input impedance. With carefully chosen build up of a circuit, you don't need high input impedances in those stages. That's why non inverting stages are recommended as an input stage.
Inverting stages are perfect for hard clipping stages and tone controls because they can have negative gain, where non inverting stages have a unity gain as minimum.

The opamp in an inverting hard clipper is almost impossible to clip (the only topology I think) unless the clipping devices have such a treshold they do nothing. Non inverting clippers can push the opamp into clipping easily if the signal is large enough. Perhaps that is why TS style circuits tend to be discussed on what opamp used.
There are some oddities though. The Marshall Bluesbreaker for example features soft clipping inverting stage. Yet the (non-inv) input stage has such a gain that when it is maxed the signal is still high enough to clip the inverting opamp. It is all math. And taste. Just to show "soft clipping" is very relative.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Ben N

Since you mention TS style circuits, I seem to recall someone (Paul Cochrane, maybe?) saying somewhere that the way not to have that clean undertone that TSes are famously supposed to have is to use an inverting opamp in the clipping stage, like (some of) the Xotic booster/overdrives do. Someone more technically savvy than me will have to explain why that is so, or if it is so.
  • SUPPORTER

amptramp

Quote from: Ben N on January 13, 2020, 03:35:33 PM
Since you mention TS style circuits, I seem to recall someone (Paul Cochrane, maybe?) saying somewhere that the way not to have that clean undertone that TSes are famously supposed to have is to use an inverting opamp in the clipping stage, like (some of) the Xotic booster/overdrives do. Someone more technically savvy than me will have to explain why that is so, or if it is so.

If you have an inverting diode clipper stage, once you are at a high enough level and gain to start clipping, nothing remains of the input signal.  If you have a non-inverting clipper like a Tube Screamer, regardless of how much gain you have dialed in and how hard the clipping is, there is always a gain of one for the input signal superimposed on the clipped signal.  If you have a gain of ten in the non-inverting stage, there will still be a gain of one for the input signal.  With an inverting stage, everything goes through the clipper and the original signal disappears.

anotherjim

Some noninverting opamp filters also always let through the input unaffected at x1 and add gain. For a feedback arrangement that is Rin=Rf in the passband, then the gain is x2.
Play with that here...
http://sim.okawa-denshi.jp/en/opampkeisan.htm
The noninverting is not a good choice for anti-alias/clock filter use.


R.G.

Quote from: merlinb on January 13, 2020, 10:30:32 AM
Inverting opamp stages are often noisier than non-inverting ones, especially in the hands of novice circuit designers. Non-inverting should probably be you 'default' choice for anything pedal related, until you actually need an inverting widget, such as for convenient mixing.

There are enough asterisks that go with that to make me comment. Non-inverting stages are also often noiser than inverting ones. It depends on your definition of "often", which depends on what your history as a designer is as well as the needs of the circuit. Designing for low noise requires attention to the inherent device noise and the circuit resistances as well as the source impedance, which you pretty much simply have to ignore in pedals, not knowing what is going to be hooked up to it.

For inverting stages, you can use the source impedance of the source as the "input resistor" in determining gain, and run the non-inverting input AC grounded to minimize its input noise contribution. This tends to set the feedback resistance as low as it can be to minimize its thermal noise as well. The remaining input noise is the noise from the source, the feedback resistor noise, and the inherent noise of the two input devices.

But pedal inputs are not nearly as noise-sensitive as something like a magnetic phono cartridge, the source level being about a factor of ten higher. Noise is a consideration, but not enough to warrant only designing with non-inverting stages.

Inverting stages have certain advantages, among them:
> freedom from exceeding common mode range problems; you just can't move the input voltage at the input pins; this is a real problem with certain opamps, notably everybody's jellybean favorite, the TL07x series
> non-interactive mixers
> different options in trading off noise performance versus other circuit attributes
> The ability to get below a gain of one without using a voltage divider on the non-inverting input, as mentioned.

Frankly, I consider non-inverting stages to be more tricky to design well. Not only do you have to get the bias point and feedback setup right, you have to drive the inverting side of things through a "side input" that has its own considerations. I

My best advice on opamps is what I first said: don't rely on rules, go do the learning in order to design well. In this, it's much like learning to play the guitar.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Rob Strand

QuoteMy best advice on opamps is what I first said: don't rely on rules, go do the learning in order to design well. In this, it's much like learning to play the guitar.
Probably the best advice in general.

Rules get the job done quicker and perhaps get the job done (most of the time) without understanding all the details.   The difference between professional and a beginner is the professional might use the rules as a starting point and then scrutinize the design later but a beginner might take that as being the "best" solution. 

Quote
Ideas? Any rules of thumb? Exceptions?
Apart from the stuff already mentioned  there are many differences between inverting and non-inverting configurations.  If these differences are a problem then that forces you to use one form over another.

A common one for audio is putting a cap across the feedback resistor to roll-off the highs.   The inverting configuration does what you expect but the non-inverting case does not have the same roll-off at high frequencies as it levels off at at gain=1.    The higher the gain of the non-inverting stage the better it approximates the roll-off.

High gain non-inverting stages can use a small gain setting resistor to ground and the input impedance is set independently.  A high gain inverting stage can end-up with a low input impedance.

Another one is common-mode input range.   Inverting has no-limits,  non-inverting depends on the opamp.    A stage which can swing to the rails driving an opamp with limited common-mode input range can result in some unexpected (and weird) behaviours.  It affects the sound of audio equipment.   With test equipment it can break the design.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

merlinb

Quote from: R.G. on January 14, 2020, 11:25:18 AM
There are enough asterisks that go with that to make me comment. Non-inverting stages are also often noiser than inverting ones. It depends on your definition of "often", which depends on what your history as a designer is as well as the needs of the circuit.
Please note my inclusion of "especially in the hands of novice circuit designers. "
My veiled point was that novices usually have a vague idea that they need high input impedance, but they don't always know where or why, and are liable to put hundreds-of-kohms resistors around inverting stages almost be default. They hiss. At least with non-inverting you have half a chance they will use a 1Meg bias resistor (which is usually OK no matter where you are in the signal path) and more 'reasonable' resistors in the feedback loop. Admittedly, it's no guarantee they won't still come up with a hiss machine like the MXR Dist+, but I stand by my advice: non-inverting until you definitely need inverting.

R.G.

I got your point in the original post. Our disconnection seems to be not on circuits but on what to tell beginners.

My cut on this is that beginners should be told (1) what to do or not do to keep them safe, (2) what to do to solve the immediate problem (3) why they're advised that way and (4) in cases that need more learning, a pointer to the more learning and an admonishment to go learn.

Rules are a substitute for thinking. They can be useful in certain cases where thinking the problem through yet again, or where action before learning is needed. But in cases where you really ought to be thinking the problem through, rules actually impede EVER learning. It's the same as my basic beef with internet calculators - if you can't do the underlying math, you do not understand what the calculator is telling you, and unless you go learn the underlying principles, you will never understand it. The crutch is too handy.

IMHO, if you don't understand what you're "designing" you are not designing, you are tinkering. There's nothing particularly wrong with that as a pastime, and I think it's much better than doing jigsaw puzzles, for instance, but it's not designing. And it's not a holier-than-thou attitude that I know design and no one else does, it's an opinion that more people should be good designers and I want to encourage them to learn.

I feel an obligation to tell beginners not just WHAT to do, but WHY, and to encourage them to learn what underlays the why, and in what situations something else applies. And that's why I disagreed with you. It's not on the basis that non-inverting stages are less noisy. It's that details matter, and that non-inverting stages are not always noisier, and that more learning would help sort those situations out so that a beginner can get to the understanding of picking noninverting versus inverting, and where those would be most useful and why, including noisiness and other things. 

I think I just took a broader view of what's good for beginners. I want to teach them to fish in fresh AND salt water.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

bushidov

Thanks guys. And I do appreciate R.G.'s insight on "rules = not learning" premise. I was looking at this more from a beginners perspective as a topic of generality, so, just "Rules of Thumb" kind of thing.

But more to R.G.'s point, if someone makes a "Rule of Thumb", it does beg the question: "why is that a rule of thumb?"

That's where learning the design ideas start to come into play for me. Hearing the "Well, in a lot of scenarios it works this way, but have you considered when this happens... yada yada yada. The reasons why are..."

I'm glad you folks not just stated the rule of thumb, but the "whys", which is really what I was looking for. I am new to design, but I also am not going to any school or anything, so my only real way of "knowing how to learn" the subject matter is asking the more experienced folks, such as yourselves.

Thanks again for you time in posting all of this!
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."

- Antoine de Saint-Exupéry

Steben

Triodes were years and years (I mean just after the medieval times) the most linear low distortion devices without much circuitry design. The arrival of operational amps as a component completely overruled this and nowadays people love the triode because of its "sound".
  • SUPPORTER
Rules apply only for those who are not allowed to break them

merlinb


composition4

I actually really enjoyed reading Nineteen Eighty Four, probably should have read it years ago.