OpAmp and diode, why having the diodes in the feedback?

Started by ericohman, April 09, 2010, 08:41:54 AM

Previous topic - Next topic

ericohman

I've seen many times that the diodes are in the feedback of the OpAmp, what difference does that make, compared to having them after the opamp (connected to ground)?



Here's diodes in the feedback stage:
http://www.co-bw.com/Guitar%20Files/Guitar%20Amplifiers%20-%20Overdrive%20&%20Distortion_files/a_mbb.gif
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

R.G.

One of the somewhat deeply buried quirks of opamps is that the feedback network is driven by the opamp in a way that's effectively a current-source drive, not a voltage source drive like we normally think of. This is the root of the difference.

Feedback-connected diodes are driven relatively very softly by this current source drive, and don't clip as hard as diodes to ground, which are driven by the output pin of the opamp through a resistance. (I notice you are missing the normal resistance in your schematic.)

It makes a difference in how hard the diodes are driven into clipping.

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.

potul

This is my understanding:

Diodes after the opamp are basically limiting the voltage to a certain value. So if signal is greater than a threshold, it gets cut to this value. The result on a sine wave is a signal that is somehow "squared".

Diodes in the feedback loop (TS style) are acting differently. They are reducing the amount of gain that the opamp can deliver. So, when signal gets above a certain value, the gain is reduced up to 1 (hence, the output signal gets smaller, but not cut to a max value). The end result in a sine wave is a smoother clipping. The peaks are not cut but only "reduced".

Regards,

Potul

ericohman

Quote from: R.G. on April 09, 2010, 09:20:28 AM
(I notice you are missing the normal resistance in your schematic.)
It makes a difference in how hard the diodes are driven into clipping.

Would that resistor go before the diodes? (Between opamp and diodes) following the signal direction...


For diodes after the opamp (and maybe also works the same on the feedback?):
If I double the amount of diodes, will that change the forward voltage of the diodes so that the same effect could be had using a single diode with twice the forward voltage.
Or does 2 diodes in series result in something different than 1 diode with twice of 1 diodes forward voltage?
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

Mark Hammer

Quote from: R.G. on April 09, 2010, 09:20:28 AM
One of the somewhat deeply buried quirks of opamps is that the feedback network is driven by the opamp in a way that's effectively a current-source drive, not a voltage source drive like we normally think of. This is the root of the difference.

Feedback-connected diodes are driven relatively very softly by this current source drive, and don't clip as hard as diodes to ground, which are driven by the output pin of the opamp through a resistance. (I notice you are missing the normal resistance in your schematic.)

It makes a difference in how hard the diodes are driven into clipping.
Which prompts the following naive question....
It is a frequent practice to reduce the harshness ("soften") of the clipping produced by diodes in the feedback loop by means of a resistance placed in series with them.  The only location I have ever seen such a resistance used is between the diodes and the inverting pin, like we see here in the mixer stage of the Boss BF-2: http://www.experimentalistsanonymous.com/diy/Schematics/Flangers/BOSS%20BF-2.gif.
It is my understanding that diode behaviour is affected by the current applied to it.  If the current is "coming" from the output of the op-amp, why doesn't this current limiting resistor go between the output pin and diodes, instead of "after" the diodes?

On a related note, one might suggest that the difference in clipping behaviour between a diode pair in the feedback loop, as opposed to going to ground from the output, is somewhat analogous to the relationship between feed-forward and feed-back control in a compressor/limiter.  The diode behaviour in the feedback loop is not only affected by the gain of the op-amp, but in turn affects the gain of the op-amp; not unlike the way a compressor that detects the envelope/level after the point where it alters the gain.  When diodes are placed after the output of an op-amp, they simply get what the get and do not influence what they get.

make sense?

ericohman

#5
Quote from: Mark Hammer on April 09, 2010, 09:46:31 AM
make sense?
Yes.

In the "diodes to ground after the opamp"-case, what difference does it makes to put several diodes in series?
Is it only a matter of at what voltage the signal will be clipped?

Say a diode will clip the signal at 1VAC.. If I have 2 diodes in series to ground, and 2 more going the opposite way (for symmetrical clipping).
Will that make the signal clip at 2VAC? Voltage drop + voltage drop (series)...

Question 2:
Does clipping behave the same way when using:
4 diodes in total with each diodes voltage drop 1V
2 diodes in total with each diodes voltage drop 2V
(Diodes to ground)

EDIT: easier to understand my second question with a picture I guess... :)
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

anchovie

Quote from: ericohman on April 09, 2010, 10:23:57 AM
Does clipping behave the same way when using:
4 diodes in total with each diodes voltage drop 1V
2 diodes in total with each diodes voltage drop 2V

Depends if they're the same type of diode or not. Different materials/types can round the corners at the clipping points in different ways.

Make good use of the forum search facility - plenty of people have built distortions/overdrives with switchable diodes.
Bringing you yesterday's technology tomorrow.

ericohman

#7
Quote from: anchovie on April 09, 2010, 11:02:40 AM
Different materials/types can round the corners at the clipping points in different ways.

Does the rounding of the clipping change due to having two of the same diode in series, or, does diodes in series raise the "headroom" of the signal before clipping (clipping at twice the voltage due to having 2 diodes in series)...

...or both :)

I just don't see the reason why there's sometimes a LOT of diodes in series.... does it do something different than if you would substitute all those diodes with another diode, one with the same spec as all the diodes in series together.
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

Mark Hammer

The quality of clipping at the moment when the signal reaches the forward voltage should be no different when that forward voltage is 250mv, 500mv, 1v, 2v, etc.  the diode path either conducts, or it doesn't.  Tiny differences in the "knee" of different diodes occur at such high speeds that their impact on spectral content below 10khz is inaudible.

What WILL be different, though, is what proportion of the input signal will meet that critical forward voltage.  This is where I like to invoke the notion of "proximity to clip" - the distance between the signal amplitude and the amplitude required for diode conductuion and clipping to occur.

The critical element to your understanding here is to understand what is special about guitar signals.  Guitar signals are NOT the same as signal generators, in that the amplitude of the signal keeps changing.  The biggest shift is from what happens during the first few 1/10ths of a second, when the string produces all sorts of harmonic content which sums with the fundamental, to what happens AFTER that point, when the string (which IS a piece of steel, after all) self-damps and refuses to wiggle in any way other than long-ish wavelengths (i.e., the fundamental).  On top of that, the physics of the bridge and body, plus whatever you do with the butt of your hand, can absorb a lot of string energy.  So, initially, the signal can be well above the clipping threshold, but very soon thereafter drop below that threshold.  The higher the threshold, the shorter a period of the note's "lifespan" the clipping will take place.  When the signal is well above the clipping threshold for a lengthy part of the held note, we tend to describe that as "fuzz", with the "zzz" part lasting quite a while.  When the clipping threshold is met only very briefly, we might say that the circuit has added some "bite", and might use the term "overdrive" to describe it; "overdrive" being used to refer to those circumstances where the circuit briefly runs out of headroom.

Think of 7'5" Yao MIng (the basketball player) skipping into the room for a bit and then walking, then crouching.  Initially, he will hit his head on the ceiling when his bounce results in an elevation of the top of his head....but it won't last.

Because the proportion of the note's lifespan where clipping occurs will change the perceived tone (harmonic content added only briefly, vs over a more extended period), people mistakenly think that different combinations of diodes clip differently.  They don't.  They just permit different amounts of the input signal to be clipped, and THAT produces a different heard sound.

You can achieve the same sound out of a 2+2 diode arrangement as you can from a 1+1, or a dual-LED pair, if the gain applied to the signal prior to the diodes is adjusted appropriately. Apply less gain to a signal hitting a 1+1 pair and you'll get the same tone as more gain applied to a 2+2 combo.  And so on.  This is, of course, one of the reasons why a booster before a distortion sounds different than a booster after a distortion.

One of the caveats I have to mention here is that the 1+1 = 2+2 = LED+LED equivalence is VERY hypothetical.  We guitarists live in a 9v world, meaning that gain is NOT unlimited.  So, while in theory one should be able to just keep cranking the gain to produce the same quality of clipping with different diode arrangements, the facts are that at a certain point the circuit itself runs out of headroom, and what you end up with is the interaction between the specific diodes+gain arrangement and whatever the headroom limitations do to the signal.  However, yet again, do NOT confuse that result with something arising purely from the diodes.

ericohman

#9
Thank you Mark for that explanation.

Are zener diodes in the feedback the softest kind of clipping diode setup, and LED's being more hardly clipped, less knee?


Is there some circuit that can modify the amplitude of the attack of the note so that is has less amplitude.. like a compressor backwards? Compressor can make the sound snappier, what about the opposite..more like a "fade in" sound on the attack of notes..

like the sound of playing with tremolo.. it can sometimes make the attack of notes sound less snappy (when note is being hit in a sweet spot of the tremolo rate that is :) )
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

anchovie

Quote from: ericohman on April 09, 2010, 11:24:39 AM
Is there some circuit that can modify the amplitude of the attack of the note so that is has less amplitude.. like a compressor backwards? Compressor can make the sound snappier, what about the opposite..more like a "fade in" sound on the attack of notes..

Boss Slow Gear.
Bringing you yesterday's technology tomorrow.

R.G.

Quote from: Mark Hammer on April 09, 2010, 09:46:31 AM
Which prompts the following naive question....
It is a frequent practice to reduce the harshness ("soften") of the clipping produced by diodes in the feedback loop by means of a resistance placed in series with them.  The only location I have ever seen such a resistance used is between the diodes and the inverting pin, like we see here in the mixer stage of the Boss BF-2: http://www.experimentalistsanonymous.com/diy/Schematics/Flangers/BOSS%20BF-2.gif.
It is my understanding that diode behaviour is affected by the current applied to it.  If the current is "coming" from the output of the op-amp, why doesn't this current limiting resistor go between the output pin and diodes, instead of "after" the diodes?
The short answer is that if the diode pair and resistor are in series and nothing is connected to the middle between them, it matters not a whit. The current applied to diodes+resistor and the resulting sum of the voltages is the same if the resistor is before or after the diodes, as long as you're not looking at the voltage in the middle. That's different in the two cases, but the current/voltage at the endpoints of the series string is not affected at all.

QuoteOn a related note, one might suggest that the difference in clipping behaviour between a diode pair in the feedback loop, as opposed to going to ground from the output, is somewhat analogous to the relationship between feed-forward and feed-back control in a compressor/limiter.  The diode behaviour in the feedback loop is not only affected by the gain of the op-amp, but in turn affects the gain of the op-amp; not unlike the way a compressor that detects the envelope/level after the point where it alters the gain.  When diodes are placed after the output of an op-amp, they simply get what the get and do not influence what they get.
make sense?
Yep. That's an equivalent control-theory view of the situation.

Quote from: ericohman on April 09, 2010, 11:15:20 AM
Does the rounding of the clipping change due to having two of the same diode in series, or, does diodes in series raise the "headroom" of the signal before clipping (clipping at twice the voltage due to having 2 diodes in series)...

...or both :)

I just don't see the reason why there's sometimes a LOT of diodes in series.... does it do something different than if you would substitute all those diodes with another diode, one with the same spec as all the diodes in series together.
Both. Subbing in two diodes produces an equivalent with twice the voltage at any point. This produces the same *percentage* roundness of the conduction corner, compared to the whole diode voltage, but it's (to twist a geometric term) twice the radius of curvature. This matters because a signal going through a clipping diode shows clipping not proportional to the diode, but proportional to the size the signal would be if not limited by the diode clipping, and how much of that signal "above" the diode threshold is in the rounded part.

Consider: You put a 0.8V peak signal into a 0.7V threshold diode. The threshold is not sharp, but is rounded (actually, exponentially curved, but to simplify, rounded) from 0.5V until there-ain't-no-more at 0.7V. The top 0.3V of the signal is rounded-down by the diode. Now put a 100V peak signal into the same diode. The resulting signal shows no roundness of the edges at all. The corner of the signal is razor sharp. That's because the signal spends almost none of it's size in the round transition zone. It passes through all of the diode roundness so early that the sides are essentially vertical and the top essentially flat.

It's the relative size of the putative unclipped signal to the size of the diode rounded corner that makes for soft versus hard clipping, not the number of diodes. A Schottky diode has a pretty sharp corner. But it looks almost entirely undistorting if you bias it and feed in a 10mV signal right on its conduction corner. In fact, diodes are often used as amplitude modulators in RF signals, which are very small. The signal is so small compared to the corner that the distortion can be neglected entirely. And the old Vox amplifiers used a diode bridge as a linear tremolo modulator by making the signal through the modulation diodes quite small. It's the relative size of signal and corner that makes for sharp/soft edges. How much of the signal is in the diode conduction knee, versus below (and unclipped) and would-be-above (and fully clipped).
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.

ericohman

Quote from: anchovie on April 09, 2010, 11:42:00 AM
Boss Slow Gear.

Interesting!
A subtle dose of that effect could be interestinging to implement sometime.
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

ericohman

I did a few quick tests. The value of R1 makes a lot of difference...

http://djoman.dyndns.org/spice/diode_clipping_02.gif

http://djoman.dyndns.org/spice/diode_clipping_03.gif

http://djoman.dyndns.org/spice/diode_clipping_04.gif

http://djoman.dyndns.org/spice/diode_clipping_05.gif


I will study some diode articles later today. I think I have gotten things wrong.
Silicon voltage drop = 0.7V
Germanium voltage drop = 0.3V
Zener = ?

2.
I have thought that the forward voltage drop is the value where the signal will be clipped at, that's not correct is it?
That would make any silicon diode behave the same for a clipping purpose in a stompbox...
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

Herec

I believe Zener diodes have the same foward bias voltage drop as a silicon, so .7 V.

However, in the breakdown region, they can vary. I've used ones with voltage drops when they're in the breakdown region of 6 V and 15 V.

Mark Hammer

Quote from: ericohman on April 09, 2010, 12:36:56 PM
I did a few quick tests. The value of R1 makes a lot of difference...

http://djoman.dyndns.org/spice/diode_clipping_02.gif
http://djoman.dyndns.org/spice/diode_clipping_03.gif
http://djoman.dyndns.org/spice/diode_clipping_04.gif
http://djoman.dyndns.org/spice/diode_clipping_05.gif

I will study some diode articles later today. I think I have gotten things wrong.
Silicon voltage drop = 0.7V
Germanium voltage drop = 0.3V
Zener = ?
2.
I have thought that the forward voltage drop is the value where the signal will be clipped at, that's not correct is it?
That would make any silicon diode behave the same for a clipping purpose in a stompbox...
The series resistance limits the current, and the current influences the diode behaviour.

You know, now that you drew it to my attention, seems to me that one could use something like the SWTC architecture to vary the clipping quality, except that the cap to ground from the pot wiper would be replaced with diodes.

very interesting....

ericohman

#16
I've done some test before with calculating resistor values to power LED with 9V battery.

White LED has a higher "forward voltage" (if that's what it's called) than a red LED.
Does that mean that if I would have a distortion box with red leds, and swap them with white leds, that I will be less of clipping.

In other words, is the "forward voltage" the value where the signal will be clipped? Or, maybe I mean, maximum voltage, anything above will just be a flat... that R1 resistor in previous post did a lot with the value of clipping too... shit.. well, THIS is basically what I'm wondering:
If you have an idea of how the clipping should look like in a scope, do you control it by choosing different diodes or do you alter for example the R1 resistor shown in previous post?

I've seen the 1n4148 is often used in various overdrive/distortion pedals that all sounds very different. So I believe I might have answered my own question....(that the diode in use has less to do with the clipping than the resistors and stuff around it)

The reason I got into this whole thing (reading and trying to learn about opamps and diode clipping) was that I took some photos on a solid state amplifier I've had forever.. (posted in another thread). People here helped me with a schematic. I have some plans to do build a clone with some modification with the tone stack and pre clipping shaping. But the major difference is that I would like to rebuild a clone of it running of a 9V battery. Preferably with some popular quad opamp since the ka3403 wants +18V and -18V.

I believe the clipping is possible to mimic, even with a 9V supply and another opamp, though obviously, I have a lot to learn :D
For reference, here's that schematic:
http://djoman.dyndns.org/levin/images/levin_retro15_schematic.gif
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

earthtonesaudio

Quote from: ericohman on April 09, 2010, 10:23:57 AM
EDIT: easier to understand my second question with a picture I guess... :)


If everything but forward voltage was equal, the 4-diode version would have half the capacitance of the 2-diode version, and sound brighter.

ericohman

Just read this:
http://www.sound.westhost.com/articles/soft-clip.htm

Here's some info about the selection of value for R1:
By using diodes, the relatively soft knee of the diode conduction curve provides exactly the waveform that we need. There is an inevitable cost though, and to understand why, we need to examine the conduction characteristics of a diode. It is commonly taken that conventional silicon diodes conduct at 0.65V, although the actual figure varies depending on the type of diode and the current.

The value of R1 is surprisingly very important. If it is too high, there will be considerable distortion at even relatively low levels because of the inherently non-linear resistance of the diodes. If R1 is too small, performance at lower levels is improved, but the source amplifier (preamp, CD player, etc.) may be forced into premature clipping because of the loading. As shown, 2.2k is a reasonable compromise, but if you are willing to include an opamp that can drive low impedances (such as the NE5532 or OPA2134 dual devices), you can reduce R1 to about 680 ohms without having to worry about hard clipping from the preamp.


R1 effect can be seen here:
http://djoman.dyndns.org/spice/diode_clipping_02.gif
http://djoman.dyndns.org/spice/diode_clipping_03.gif
INSTAGRAM: http://instagram.com/perkabrod
Scroll past all car stuff to see my vintage amps and stompboxes ;)
Eric // Skellefteå, Sweden.

amptramp

Just a couple of comments here:

1. The question of whether to connect the resistor or the diodes to the inverting pin of the op amp was decided correctly for the Boss BF-2 with the diodes connected to the op amp output and the resistor at the inverting input.  What you are trying to avoid here is capacitance to ground from the inverting input and the resistor will have less capacitance than two paralleled diodes.  This capacitance will reduce the feedback and increase gain at high frequencies and if severe enough, can cause oscillation or a high-frequency response peak.

2. Sometimes the suggestion has come up about using LED's for clipping and mounting them through the box so you can see when they clip.  Cute idea but you will find a problem here: an LED is a relatively good (though leaky) photodiode.  I was working on a sunlight-usable optical touch screen design one time using scanned LED's and photodiodes where the major problem was infrared getting into the silicon photodiodes.  I tried an experiment using green LED's as photodiodes to avoid the infrared and they worked, but the leakage was too high to use as I had intended.  Beware!  If you have the clipping LED's on the outside, they will respond to ambient light and generate a nasty hum with incandescent or buzz with fluorescent lights and your clipping threshold will go down and soften with an increase of ambient light.