Gorn Overdrive: Li'l help

Started by Fancy Lime, March 21, 2020, 02:28:27 PM

Previous topic - Next topic

rankot

Quote from: Fancy Lime on April 15, 2020, 04:58:33 PM
Oh and one more thing: What's "hyper-triangular"? Never heard that term but it sounds appropriately Star-Treky.

https://www.diystompboxes.com/smfforum/index.php?topic=108221.0
  • SUPPORTER
60 pedals and counting!

Fancy Lime

Alright, so here is the promised long winded explanation. I tried to make it accessible for beginners. If questions remain, feel free to ask. I don't have to tell those who disagree with my reasoning that they are welcome to express their disagreement, because they will anyway. But please don't hold back, I may be wrong about everything. Anyway:





What does an opamp do?

An opamp tries to keep the non-inverting and inverting input at the same voltage at all times by varying its output accordingly. What the output needs to do in order to make that happen and whether that is possible at all, depends on the configuration of components around the opamp. The negative feedback loop generally allows the opamp to keep the inputs equal and therefore to act as a linear amplifier. Let's look at the basic non-inverting amplifier topology:



We shall call the voltage at the inverting input Vi, the voltage at the non-inverting input Vn, and the voltage at the output Vo. The feedback resistor Rf and the ground resistor Rg form a voltage devider between the output and the inverting input. Because the transfer function of the voltage divider is: Vo = Vi*((Rf+Rg)/Rg) , and we know that Vi = Vn, we can calculate the amplification of the stage. To nobody's surprise, we can rearrange the last equation to the more familiar form of the non-inverting opamp transfer function: Vo = Vn*(1+Rf/Rg).

That's all great but not really news to anyone. The important point to make here is, that the voltages at the inputs are always the same at all times (assuming we stay within the limits of the opams capabilities), no matter what resistors we put in. That means, Vi is independent of Vo and completely determined by Vn. So how do the output and the inverting input communicate if the voltage of the latter is independent of the former? Current!



What is a resistor?

One way of looking at a resistor is as a translator between voltage and current. An ideal resistor (and for our purpose we can assume resistors to be ideal) exhibits Ohmic Behavior, i.e. it follows Ohm's Law: V = R * I, for the entirety of it's specified use conditions. Non ohmic devices still follow Ohm's Law but only "locally" in an I/V plot; this will be important later. It is no coincidence that if we plug Ohm's Law into the transfer function of the non-inverting opamp amplifier (or the inverting one, for that matter), we find that the currents through Rf and Rg are the same. This is how the opamp keeps the inverting input the same as the non-inverting. It pushes exactly as much current through Rf as is "lost" to ground via Rg (we will assume that the input currents of the opamp are very small compared to the currents going through the resistors and therefor need not be considered). And Ohm's Law tells us what voltage the output needs to assume for that to happen.



So what? And what about diodes?

If we replace the feedback resistor with a pair of diodes, what changes and what remains the same? We will ignore the parallel resistance from the gain pot for this discussion because it is not important for an understanding of the principles. Vi is still the same as Vn, so the voltage across Rg is still Vn. Because Ohm's Law still applies to Rg, the current that the opamps output needs to supply to the inverting input via the negative feedback loop also remains the same. But diodes are not ohmic resistors, so what voltage swing the output needs to perform in order to supply that current is different.



What is a diode?

An ideal diode is something that blocks all current if the voltage across it is less than the threshold (aka. breakdown) voltage but lets all current pass above that threshold. This is how we mostly think about diodes: A perfect insulator or a perfect conductor, depending on the voltage across it. We are all aware that this is not *really* true. However, the significance of the error we make by this simplification is *very* different for different diodes and different circuit topologies. The region where it is usually most interesting for our purposes, is the so called "knee", the transition from mostly blocking current to mostly letting it through. In this knee region, the current through a diode is still a function of the voltage across it, just not a linear one as Ohm's Law would be. If we look at infinitesimally small changes in voltage, we can derive an inclination from the I/V curve, which is nothing other than an inverse resistance because Ohm's Law tells us I/V = 1/R. So we can look at a diode as a variable resistor that changes it's resistance as a function of the applied voltage: the resistance becomes smaller as the voltage becomes larger. Interestingly, the change of "local resistance" seems to be a linear function of voltage for extended regions along the current axis, at least for Zener diodes in forward breakdown. The resistance of the diode, which changes with voltage and current, is called Dynamic Resistance. We will be coming back to that. The total equivalent resistance of a diode is the dynamic resistance integrated from I=0 (or V=0) to the current (or voltage) of interest.



What does that mean for our opamp circuit?

If we think of the diodes as a variable resistor and put that in place of Rf from earlier, we can understand the implications of clipping diodes and their characteristics for the output voltage of the circuit. At low Vo, Rf is large, so the amplification is large. As Vo increases due to the large amplification, Rf is getting smaller, making the amplification factor smaller as well. This rounds of the peaks of the waveforms. Huston, we have clipping!



What is special about low voltage Zener diodes?

Zener diodes actually exhibit two different kinds of breakdown in forward direction. At high voltages, the so called avalanche breakdown is dominant. Avalanche behavior is pretty close to that of an ideal diode, with high resistance before the trheshold, a sharp knee, and after the knee, the current that can pass through the device is almost completely independent of the voltage across it (i.e. very low remnant resistance). This is the characteristic that I always considered "typical Zener bahavior" and it is what makes these things so useful as voltage regulators. However, at Zener voltages below about 5V, the behavior is very different. Here, actual Zener breakdown dominates, which is a far cry from ideal diode behavior. That is why low voltage Zeners are actually pretty bad as voltage regulators unless they are operated at a constant and well defined current. You can see the dependece of the characteristic shape of the I/V curve in Fig. 14, taken from the Vishay datasheet of the BZX84 series Zeners:



https://www.vishay.com/docs/85763/bzx84v.pdf
The fundamental curve characteristic trends are the same for other Zener series because they are dictated by the physics of the breakdown mechanism. As you can see in the figure, the "nominal Zener voltage" is taken at 5mA. The 8.2 Zener breaks down at 8.2V no matter if the current pushed through is 2mA or 35mA. But the 2.7 Zener varies a lot. At 2.7V it can pass 5mA, but at 2.0V it can already pass 2mA, and at 3.5V it can pass 45mA.



But which of these numbers is relevant for us?

If we assume that our ground resistor Rg is 1kΩ, and we have a 100mV signal at the non-inverting input, then the opamp will make it so that the same voltage is present at the inverting input and our old friend Georg tells us that 0.1mA flow across Rg. And as we have seen earlier, the same amount of current needs to flow through the diodes. Well and good but the voltage corresponding to 0.1mA in the I/V plot is pretty impossible to read from Fig. 14. Luckily, the Vishay datasheet also has the dynamic resistances plotted in Fig. 3. This plot shows us that the dynamic resistance of the low voltage Zeners is pretty high at down to 0.2mA. If we extrapolate the curve for 2.7 a bit down from 0.2mA to 0.1mA, we land somewhere close to 1kΩ. If these data would extend another two orders of magnitude below where they do, we might even be able to calculate the static resistances at the relevant currents and thereby extend the I/V plot to where we need it. With the data we actually have, we can only reason quantitatively. So let's do that.



Let's define the dynamic resistance a little more concisely. It is essentially an application of Ohm's Law to an infinitesimally small section of the I/V or V/I graph. The former formulation gives us inverse resistance, which is a bit cumbersome, so let's take the latter formulation. Then we get:
ΔV/ΔI = r
Wherein the Delta denotes local change and lowercase r is the dynamic resistance. What that means is, that if we have a large r, then we need a lot (relatively speaking) of change in voltage across the diode in order to achieve a given change in current. In Fig. 3 we see that for the 2.7 and 3.6 Zeners, the dynamic resistance is fairly large (especially compared to the medium voltage Zeners in Fig. 4) and it does not drop off as steeply as for the 4.7, 5.1, and 5.6 models. This is relevant because our input signal is dynamic. Assuming again Rg=1kΩ, we get a current demand through the diodes of 0.1mA at 100mA input signal (about "average" for single notes, very approximately, of course) and 1mA at 1000mV (about peak voltage of a chord). Becuse r stays high in this range, we need a big ΔV throughout relevant guitar input signal conditions to satisfy the current conditions of the opamp. And this is what makes the clipping knee soft. But it is different than using a resistor in series with a pair of diodes because the resistor is not dynamic. With the Zeners we sneak into clipping very gradually. With the series resistor, we would still have a sharp knee but a "hill on the plateau" above it.

"Normal" diodes also have a dynamic resistance. But it is usually desirable for most diode purposes, that this be as small as possible at the targeted operating currents and, more importantly, drops off as steeply as possible around the threshold voltage. The other notable exception to this behavior apart from low-V Zeners are germanium diodes. This is one of the main reasons that prompted development of Si diodes as a better alternative. Unfortunately, Ge diodes are plagued with a bunch of other problems, as well, like enormous temperature effects, reliability issues, huge fabrication tolerances, and an utter lack of detailed datasheets for types that are still obtainable today. So I would not design with Ge diodes in this day and age if I can help it.

You can hear the soft clipping transition effect very nicely in Arons sound samples, especially the latter third of each. With the standard diodes, there is this somewhat brittle sizzling as long sustained notes drop out of clipping. With the Zeners, the clipping fades into the background much more seamlessly and naturally. You can also hear that the Zener arrangement reacts more strongly to playing dynamics, although this is better experienced by playing yourself than by listening to a recording.



Some design tips:

When using 2V7 Zeners as clippers, know your currents and choose your circuit impedances accordingly. In a non-inverting opamp stage, use 500-5000Ω of resistance for the ground leg, else you get too high thresholds or too little current variation for the Zener effect to matter. Same goes for the input resistor when using this arrangement in an inverting opamp stage. By strategically placing additional caps and resistors in the feedback loop and the ground (or input) leg, you can vary the impedance independently of the frequency response. This will affect the frequency dependent clipping characteristics of the Zeners more than it would normal diodes. This may be worth experimenting with but I have not tried it.






Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

iainpunk

Quote from: Fancy Lime on April 16, 2020, 01:16:35 PM
Alright, so here is the promised long winded explanation. I tried to make it accessible for beginners. If questions remain, feel free to ask. I don't have to tell those who disagree with my reasoning that they are welcome to express their disagreement, because they will anyway. But please don't hold back, I may be wrong about everything. Anyway:


nice write up, 10/10, would watch again
                                                           - Iain
friendly reminder: all holes are positive and have negative weight, despite not being there.

cheers

Fancy Lime

One more thing I forgot to mention: The gain pot has of course some influence on the currents and therefore on the Zener clipping. That influence is different when using a gain pot in the ground leg, compared to one in the feedback loop. We will leave it  as an exercise for the reader to figure out how exactly :icon_wink:   Or you can just try it, I guess.

Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

aron

This mod sounds good with my tiny Champ! Even though the Champ is bright, the pedal kicks in and there's no more "fizz" like the usual 1N4148 clipping. Very nice!

bluebunny

Here's my build:



I just gave it a very quick test with my Champ-a-like and it's very versatile - thanks Andy.  I just need to turn my "tinny/woody" switch around...   :icon_redface:
  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

bluebunny

In case anyone finds it useful, this is the vero layout I used:

  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

antonis

Extremely useful, indeed..!!!  :icon_eek:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

aron

Love that Gorn on that pedal!!!!

EBK

I might "accidentally" build one of these instead of something else in my queue.   :icon_wink:
  • SUPPORTER
Technical difficulties.  Please stand by.

bluebunny

  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

EBK

Quote from: bluebunny on July 27, 2020, 11:18:55 AM
Be careful, Eric!   :icon_eek:
The danger has passed.  Turns out, I just don't have the parts.  I have the op amp and the scrap of veroboard, but I don't seem to have anything else (diodes and pots, mainly) that I would need at the moment.  I have zener diodes in every available voltage above 3.0V though.  :icon_neutral:
  • SUPPORTER
Technical difficulties.  Please stand by.