Need help figuring out OpAmp Clipping in LTSpice

Started by achen22, May 17, 2022, 03:54:45 PM

Previous topic - Next topic

achen22

Hi guys! I'm really new to Guitar Pedal building.

Currently, I've been working on making a really basic OpAmp based Overdrive pedal.

I started by making sure the OpAmp was correctly biased to 4.5v, and upon simulating it was so.

Now, I'm designing the Diode Clipping. However, I'm running into two problems:

1) I see from some other schematics that for the gain knob, which are often placed in the diode area (not sure how to refer to this place) is a 500k potentiometer. However, R5 (which I'm using as the potentiometer, I forgot how to do the .step command; I will check again later) only needs to be at 10k for the sinewave in simulation to be maxed out. Going higher to 500k doesn't change anything for some reason.

2) The clipping seems to be... uneven in the wrong direction? I'm going for soft clipping, but the left side of the peak is getting clipped instead of the right, which confuses me. Is it supposed to be like this?

I want to get this part working before I move on to the Volume and Tone controls.

My current schematic.


Both 10k and 500k pot:


What I imagine soft clipping and hard clipping to look like:


Another thing to note is: if I remove D1 and D2 completely, the waves get slammed to the rails and everything gets hard clipped. Why is this?

Any help is appreciated, including anything you notice in terms of designing practice that could be improved upon, incorrect use of jargon, etc.

Thank you so much!
Alex.

GibsonGM

#1
Hi Achen, welcome!  Good questions. 

1) make R7 + R4 something like 10k - 47k. I don't think 100k is TOO high, but 10k is more the norm to set the current in the bias network.
     Make R3 470k; 1M is a bit high, adds noise.  I BELIEVE but am  not sure that the bias resistor is usually about 10x the ones in the network.
R1 (pulldown resistor) can be 1Meg, you don't want that one low. The 10k there right now is very low and will suck your high end away. 470k and up please; typical is 1Meg there. 

2)  "10k and 500k pot" in your graph are showing very soft clipping.   I think you have it backwards!  The rounded tops of the wave you labeled 'hard clipping' indicate a gradual change rather than the fast, square-like tops of a hard-clipped wave. See 3 below.

3) Look at that 10k resistor in the feedback path, below the diodes. It's working with the 1k to set the gain of the opamp.  Right now the gain is only about 11; too low. If you crank up that gain amount, you'll see far more clipping - it takes a lot more than one would think to beat on the diodes.  The diodes in the FB network will be soft-clipped, yes, like in your 2nd graph (but far right side, not the middle peaks).   Changing out the 10k for your pot as in a Tube Screamer will let you vary the gain. 

Go here to read ALL about this kind of circuit, that will get you up to speed!  https://www.electrosmash.com/tube-screamer-analysis
  • 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...

antonis

#2
Welcome, also.. :icon_wink:

Quote from: GibsonGM on May 17, 2022, 04:16:09 PM
If you crank up that gain amount, you'll see far more clipping

Clipping level (signal amplitude) is restricted by diodes forward voltage drop so there is no "more" or "less" clipping dependent on gain.. :icon_wink:
What alters is unclipped waveform shape..
(the more the gain the more the steepness of the slope - like a trapezoidal with its sides tending to collimate..)

(only 'cause it's been a long time without teasing Sir Mike..) :icon_redface:

P.S.
Make R1 1M (at least) and delete C1 & R2..
(just to make things more plain..) :icon_wink:

"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..

GibsonGM

Quote from: antonis on May 17, 2022, 05:17:05 PM

Quote from: GibsonGM on May 17, 2022, 04:16:09 PM
If you crank up that gain amount, you'll see far more clipping

Clipping level (signal amplitude) is restricted by diodes forward voltage drop so there is no "more" or "less" clipping dependent on gain.. :icon_wink:
What alters is unclipped waveform shape..
(the more the gain the more the steepness of the slope - like a trapezoidal with its sides tending to collimate..)


Yes, yes, Antonis.  I think my belief in 'hitting the diodes as hard as possible' has more effect if they are not soft clippers in the FB loop, but after the opamp - and very high gain also will cause the opamp to clip there, often pleasantly.

Since the Vf is the limiter here - does that mean you can't make the opamp clip in this configuration?  I've never been clear on that.  It would appear so, now that you mention it.
  • 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...

Rob Strand

#4
QuoteWhat I imagine soft clipping and hard clipping to look like:
Symmetrical clipping is more like your hard clipping pic.  Soft vs hard is how curved the corners are.  Hard clipping approaches a square-wave with sharp corners.   When you add filtering it's a harder to interpret the wave shapes.

QuoteSince the Vf is the limiter here - does that mean you can't make the opamp clip in this configuration?  I've never been clear on that.  It would appear so, now that you mention it.
On a non-inverting configuration the gain can never be less than one so no matter what the diodes do the input signal must leak through.  From that perspective a tube screamer has a natural clean blend.  Adding more feedback diodes makes the clipped part of the signal larger with respect to the clean signal that leaks through ie. it changes the clipped/blend balance.

With the diodes present the opamp is operating completely under feedback control.   However, if the input signal is high the clean blend signal and diode voltage add and the total voltage can cause the opamp to clip.   In this case the feedback is lost and the clipped waveform is determined by the opamp. 

The other way you can clip the opamp is by using enough diodes in series that overall diode voltage drop is greater than the swing available from the opamp.  That means you can clip the opamp provide there's enough gain and you don't need a large input signal like the previous case. (also clean blended part will be small in relative terms.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

GibsonGM

Thanks Rob. I knew about 'the qualities of the TS' (clean blend), but not why.  I actually don't like that, and never use diodes in the feedback loop, so never gave it much thought.  If I'm going to clean blend, I'd like to control is with a split/blend setup.  TS does kick an amp good tho! 

So to be clear, any additional gain that is above the diodes' Vf simply manifests as more clean signal, which blends with the clipping action of the diodes?
  • 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...

Rob Strand

#6
QuoteSo to be clear, any additional gain that is above the diodes' Vf simply manifests as more clean signal, which blends with the clipping action of the diodes?
Not quite.   The amount of clean stays constant (equal to the input signal) then by increasing the you drive the diode clipping part harder.   You might perceive some increase in the "clean" part as you increase the gain but that comes from the diode part.

If you have an inverting opamp with feedback diodes there's no clean blend going on but you still hear some clean getting through. That's because the diodes still let the original signal through.  That's particularly true when the gain isn't set that high and the diode don't clip much.   It's this same "clean" that gets through when you increase the gain in the non-inverting case.  (The difference being the non-inverting case mixes some real clean as well.)

In theory: the non-inverting clipper is like a blend of x1 mixed with an inverting type clipper (*but* with the inversion removed with another opamp).   I say "in theory" because if the opamps clip it throws a spanner in the works because the opamps clip at different points.  For the inverting opamp with clipping diodes, you can prevent the opamp from clipping altogether simply by using few enough diodes that the diode swing is less than the opamp clip limit set by the power rails.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

Quote from: achen22 on May 17, 2022, 03:54:45 PMGoing higher to 500k doesn't change anything for some reason.

Because you simmed an artificial half-volt signal.

Try a realistic signal which fades to under 10mV. For a 1k lower resistor, the upper (variable) needs to be 400k to hit 4V peak (about the limit under a 9V battery). "All controls should go to 11" makes 500k.
  • SUPPORTER

GibsonGM

#8
Quote from: Rob Strand on May 17, 2022, 08:36:33 PM
QuoteSo to be clear, any additional gain that is above the diodes' Vf simply manifests as more clean signal, which blends with the clipping action of the diodes?
Not quite.   The amount of clean stays constant (equal to the input signal) then by increasing the you drive the diode clipping part harder.   You might perceive some increase in the "clean" part as you increase the gain but that comes from the diode part.


Ok...lots of good info in your reply - thanks!  But that's what I was getting at - driving the diodes harder by increasing the gain (naturally).  So you vary from a rounded, mellow clipping which becomes more squared as we increase the gain - no? Then you'll hit opamp clipping, and the whole thing becomes square :icon_biggrin:

From Antonis' reply above, "Clipping level (signal amplitude) is restricted by diodes forward voltage drop so there is no "more" or "less" clipping dependent on gain.. :icon_wink:
What alters is unclipped waveform shape..
(the more the gain the more the steepness of the slope - like a trapezoidal with its sides tending to collimate..)"

From this I take that the diodes clip when we exceed Vf, and we will have no increase in amplitude of the signal.  BUT, if we increase gain in the loop, the slope of each cycle will become steeper (which I've seen many a time on my scope)...more distortion - since this 'steepness' isn't clipping - what is it doing to the sound of the signal?  (what happens when you push a larger signal thru a network that clips it? Increased harmonics would be my guess, odd ones) 
OR

Is that 'increase in slope' simply representing more clean signal coming thru?  Sorry to beat it to death, mostly curious; if I had a TS here that I could throw on my scope I could probably answer this myself!

  • 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...

antonis

Quote from: GibsonGM on May 17, 2022, 10:03:06 PM
the diodes clip when we exceed Vf, and we will have no increase in amplitude of the signal.
Diodes don't clip.. Amp does.. :icon_wink:
It should be more techically correct to put it as:
"When amp output voltage exceeds diodes forward voltage drop we have an -almost- 100% negative feedback occurrence, hence the whole configuration behaves as a voltage follower of unity gain (for non-inverting configuration..)


Quote from: GibsonGM on May 17, 2022, 10:03:06 PM
BUT, if we increase gain in the loop, the slope of each cycle will become steeper (which I've seen many a time on my scope)...more distortion - since this 'steepness' isn't clipping - what is it doing to the sound of the signal?

It squares it..
(can't describe the audible impression of a cartesian coordinates graph..)

Quote from: GibsonGM on May 17, 2022, 10:03:06 PM
Is that 'increase in slope' simply representing more clean signal coming thru?

In case of "more" refers to signal area/acreage, yes..!! :icon_wink:
(more energy in the same time period hence more power..)
"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..

GibsonGM


Quote from: antonis on May 18, 2022, 07:52:15 AM
It should be more techically correct to put it as:
"When amp output voltage exceeds diodes forward voltage drop we have an -almost- 100% negative feedback occurrence, hence the whole configuration behaves as a voltage follower of unity gain (for non-inverting configuration..)


(more energy in the same time period hence more power..)

Thanks Antonis, now I can see what is happening. 
  • 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...

Digital Larry

TS is a pretty clever circuit.  It does NOT flatten out the peaks of your signal, it preserves them, unless they get hot enough to clip the op amp or I guess there may be some variations that do clip using additional back to back diodes to ground on the output.  The additional harmonics are not generated by the peaks, but rather the knee generated between the "body" of the signal and the peaks.  As far as I know this does not correspond to any known amp overload characteristic.  Or does it?

Back when I was studying all this (which has to be represented in scientific notation in terms of years ago) I found it fascinating to consider "where" the diode I-V curve presents itself and how big it is in any given circuit.

In the basic TS circuit, that point is mid-waveform when the output voltage reaches Vf, and the I-V curve is compressed (divided) by the gain of the amplifier, so it winds up being relatively sharp at high gains (other than the fact that it doesn't flatten out the top).  Whereas back to back diodes to ground on the output DO flatten the waveform tops and the diode curve is relatively a much larger part of the waveform.  I don't know that I described this all that well.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

antonis

Quote from: Digital Larry on May 18, 2022, 08:51:32 AM
In the basic TS circuit, that point is mid-waveform when the output voltage reaches Vf, and the I-V curve is compressed (divided) by the gain of the amplifier, so it winds up being relatively sharp at high gains (other than the fact that it doesn't flatten out the top).
:o :o :o


Quote from: Digital Larry on May 18, 2022, 08:51:32 AM
I don't know that I described this all that well.

:icon_mrgreen:

P.S.
As almost perfect description as almost incomprehensible.. :icon_lol:
"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..

Rob Strand

#13
QuoteBut that's what I was getting at - driving the diodes harder by increasing the gain (naturally).  So you vary from a rounded, mellow clipping which becomes more squared as we increase the gain - no? Then you'll hit opamp clipping, and the whole thing becomes square
To first order approximation that's correct.  In reality the diode clipping isn't dead flat.   From a textbook point of view that's the diode dynamic resistance (rd).   If the diode is 600mV @ 1mA then at 10mA it will be about 700mV and at 100uA it will be about 500mV.  So something gets through.

QuoteFrom this I take that the diodes clip when we exceed Vf, and we will have no increase in amplitude of the signal.  BUT, if we increase gain in the loop, the slope of each cycle will become steeper (which I've seen many a time on my scope)...more distortion - since this 'steepness' isn't clipping - what is it doing to the sound of the signal?  (what happens when you push a larger signal thru a network that clips it? Increased harmonics would be my guess, odd ones)
OR

Is that 'increase in slope' simply representing more clean signal coming thru?  Sorry to beat it to death, mostly curious; if I had a TS here that I could throw on my scope I could probably answer this myself!
It's an interesting topic.   If you play different guitars into a high gain pedal the character of the two guitars
comes through despite the heavy clipping.   I'm calling this the "character" of the original signal instead of "clean" because there's so much distortion and it's unlikely the original signal gets through unmodified but intuitively there's a fine line between the two.

I think it is valid to think of the sloped part as as letting some of the original signal through.  As the signal passes through the zero crossing the diodes are off and the original signal has a chance to pass.   The high gain makes the origin signal stronger.  The short time the signal passes through the non-clipped region is short which reduces the average amount of original signal.   A second effect is the harmonics that make up the original signal will case deviations in the zero crossings of the clipped signal, that allows information to be leaked through the clipper by modulation.

It would be interesting to prove mathematically what actually gets through around the zero crossings and how much of the original signal can be reconstructed (like reconstructing analog from digital sample but in this is case we have short segments of the original signal).  I suspect someone has already done this and it would require considerable mathematical effort.

The other place where the original sneaks through is the diode dynamic resistance mentioned above.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.