On the effect of Slew rate limiting in a Rat circuit

Started by Vivek, August 24, 2021, 06:20:12 AM

Previous topic - Next topic

Vivek


Much has been written about the choice of the low slew rate LM308 Opamp in the Rat. The TL072's slew rate is 13V/uS, the LM308 is 0.3V/uS ie around 40 times slower !

There are many myths and errors in previous analyses on the Interweb. I thought I will try to dispel some of those myths and errors, fully realizing that I will add new myths and error while doing so.

(Please forgive my temerity for pretending to be an EE when in fact I am a Chemical Engineer. Please jump in and pull my ears when you find a fallacy in my logic or a new myth being created)


Myth #1: An Opamp cannot output any wave of frequency more than some slew rate determined frequency
ELECTROSMASH wrote and I quote
QuoteThe Slew Rate.
It refers to how fast the op-amp can swing its output. If the signal to be amplified is too fast (high frequencies), the op-amp will not be able to perform properly, only amplifying signals below the slew rate limit.

This choice of words seems to indicate some kind of brickwall filter that fully stops all signals above some slew rate determined frequency.

That is just not true.

Here is a graph of the output in a Slew rate limited system :


We can see that in case the output of an opamp is too slow, it cannot keep up with the high rate of change of voltage of a sine wave close to the zero point. So the output follows a straight line up, with a slope = the Slew Rate of the Opamp.

When the sine wave input falls, it's the same story in reverse.

I feel the truth is:

If we input a sine wave that has a slope at zero crossing that is higher than the Slew rate of the Opamp, we get a triangle wave output, with lower amplitude than the desired Sine wave output. The frequency of the Triangle wave is the same as the desired Sine wave.


If we use an even higher frequency input, the effect gets more severe, and the output triangle wave gets smaller in amplitude. However, there is no brickwall where the Opamp totally stops outputting a signal.



The output is lower, however, there is still an output !!!

It is just not true that an Opamp can only process signals of a frequency that are lower than some slew rate limit. The fact is that the Opamp will process high frequency signals and distort them into Triangle waves. The Amplitude of the Triangle wave depends on how high the frequency of the desired output is.

The slew rate determines the maximum frequency and Amplitude of an undistorted Sine wave that the Opamp can deliver. But that Opamp can deliver triangle waves at higher frequency than the limit on undistorted sine waves.

So that's Myth #1 debunked for good !!

Myth #2 : While calculating the maximum frequency of output waves that are not Slew rate limited, we need to consider the point at which the Opamp gets clipped

ELECTROSMASH wrote :



In the equations to calculate the maximum frequency without Slew rate limits, he plugged in Vp of 9 Volts, that being the supply voltage.


AMZ wrote at http://www.muzique.com/news/calculate-slew-rate/ :

QuoteThe Rat pedal opamp would need to slew about 8.0v at 10kHz. Find the slew rate needed for the opamp.

Maybe he gave an allowance of 1V less than the 9V Vcc, for rail limits


Error of type 1 : If the Vcc is 9V, we cannot use Vcc as the Vp of a sine wave. It would be more correct to consider Vcc/2 as the Vp of a sine wave that can fit in a Vcc of 9V


Error of type 2 : All above is true for undistorted sine waves. The Rat distorts !!!!

Please see earlier post on why, for calculations of maximum frequency within slew rate limits, we need to consider the Vp that a distorted wave would have reached in case it was not clipped.

https://www.diystompboxes.com/smfforum/index.php?topic=127737.0


If the gain of the Opamp in a Rat is 1416x and we assume a guitar signal of 1Vp, then the correct Vp to use in Slew rate calculations is 1416Vp

Not 9V a la ELECTROSMASH
Not 8V a la AMZ
Not 4.5V which considers the bias point of the Opamp and rail to rail 9V output
Not 4V which considers bias point, and some limit to output swing that is less than rail at 9V


Then we suddenly find that the Maximum frequency that is not slew rate limited in a Rat is closer to 33Hz rather than the 5.3Khz as calculated by ELECTROSMASH

(the fact that the Rat does output sound when you play a note on the high e string is further proof that the there is no brick wall filter as implied in Myth #1)




My understanding of the slew implications in the Rat is as follows:

Creation of new harmonics due to slew rate limits :

The output of the LM308 wil be slew rate limited at some very low frequency. That depends upon the frequency and the amplitude of the input signal.

The slew rate limited output will start to look like triangle waves.

Triangle waves are made up of odd harmonics of the fundamental

That is a bad thing if we wanted Sine wave output, but in this case, we want a distorted output. We have used a high gain to bash the output against the rail. If that did not fully expose our murderous intent, we then slash the poor output with shunt diodes.

So in the Rat, Slew rate limitations introduce more harmonics into a system that already creates a very huge amount of harmonics. No big deal.

Reduction of output amplitude with frequency

As explained earlier, if we keep input amplitude the same and alter frequency, then for higher and higher frequencies, the slew rate limited, triangle wave output will have progressively smaller and smaller amplitude

But the Rat already has RC filter to reduce high frequency content.

So slew rate effect of output amplitude is no big deal and can be calculated in / compensated.

However for clipped Opamps that are also Slew rate limited,

Suppose we have a gain of 1415x at 1Khz and suppose we have a gain of 500 at 10Khz due to slew rate limits and we feed input 1Vp signals,

And we chop the signal at +/- 4.5V peak due to rail saturation,

We will not be able to see the effect of lower amplitude since both conditions lead to output fully jammed against the rails.


Reduction of output amplitude with frequency and input amplitude

The desired slew rate of a sine wave output depends upon both the frequency and the amplitude (remember : The calculations need to use that amplitude that the output would have reached in case it was not clipped)

So we see that in case we play a slide from the 2nd fret to the 14th fret, the frequency will progressively get higher and the input amplitude will progressively get lower. The effect of slew rate limits is hard to fully predict in this case. But we know there will be some dynamic effect.


LTSPICE analysis of slew rate effects in RAT

Slew rate induced distortion is not an LTI process. Some of the analyses in LTSPICE assume linear behavior. For example, a frequency response graph assumes that there is no distortion, due to its assumption of very low input signal.

Anyway, I tried to compare some LTSPICE graphs of a Rat with LM308 against a Rat with TL072, to see what differences LTSPICE would come up with, fully knowing that by definition, there will be errors in the graphs.


Here is a graph of output of Rat with LM308 and Rat with TL072 for input of 1Vp at 1Khz:


We can see that the slope of LM308 is slew limited to 0.23V/uS, which is approximately the Slew limit of the Spice model. The LM038 is slew limited for 1Vp input at 1Khz (which again proves that the ELECTROSMASH calculation of 5.3Khz is erroneous)

The slope of the TL072 is 0.75V/uS and this Opamp is not in its slew rate limited zone.

We can see that the two Opamps have different maximum voltage swing at 9V power supply.

And here is a graph of input 1Vp and frequency increased to 10Khz


We see that the LM308 remains in its slew rate limited region, with a slope of 0.24V/uS. However the output is more severely distorted.

The TL072 is still cruising along well with a slope of 2.7V/uS, well within its Slew rate specification. It's output still looks quite square.

The effect of lower amplitude of waves deeper into Slew rate limits is not observed since the output that could be 500Vp till 1416Vp is being clipped to around Vcc/2 ie we still get a wave limited to Vcc/2.


Frequency Response graph

Quote from: Steben on September 15, 2008, 06:29:17 AM
It seems a lower slew rate acts as a low-pass filter.

Quote from: Steben on August 22, 2021, 01:16:28 PM
It was my understanding <Slew Rate> functioned as a dynamic treble cut, in other words with low enough output amplitude, you notice nothing frequency wise, while at high amplitude the treble can't be produced by the opamp. This all depends then on the slew rate and caps etc etc etc....
In other words: dynamic, while a cap in the feedbakc loop is not dynamic but a treble cut.

I plotted the frequency response of a Slew Rate limited Opamp for a lark, knowing that Slew Rate Induced Distortion is not a linear process and hence a frequency response can be meaningless. Yet, it might hint at some truth, or at least, offer data for a comparison


It appears that the lower slew rate of the LM308 in blue converts to reduced high frequency response. This is as expected, even if the exact numbers cannot be relied upon.

However this lower response could be preferred. It can also be designed in / designed out by changing a frequency determining capacitor.

I would expect that a TL072 will sound brighter in a Rat than a LM308 since its much higher slew rate will allow it to respond to high frequency in a better way. But if we changed one cap and matched the responses, it is possible that the effect of slew rate on frequency response can be nullified / enhanced / diminished as per our design wishes. It is possible that Rat with TL072 and modified frequency response sounds to the ear to be quite similar to an unmodified Rat with a LM308.

Dynamic change in frequency response due to Slew rate

After repeating all earlier caveats and assumptions when tryng to plot a frequency response of a non linear system, here is a graph of frequency response at Opamp output for a LM308 based rat and a TL072 based Rat,

With inputs of 0.01Vp, 0.1Vp and 1Vp, all at 1Khz


We can see that the shape of the frequency response curves changes slightly with input amplitude and frequency. The graph looks as pretty as the sand dunes in Dubai. However , I dont know what exactly it means, how it sounds and if it can claim to be representative of what is really going on.

New harmonics created due to Slew Rate Induced Distortion:

The Rat is meant to distort. The clipping is quite severe and creates a lot of harmonics anyway. So whats the effect of Slew Rate induced distortion in a system that already has Rail clipping (and then hard clipping too) ?

Basically, what are the differences in harmonics between

i) A huge sine wave that is clipped to a small square wave
and
ii) A huge triangle wave that is clipped to a small square wave  ?

1Vp input at 1Khz, Output of LM308 in blue, TL072 in red :


I drew circles around the tip of the FFT peaks, to make it easier to see the differences.

It appears that the two FFT match closely on the Odd harmonics, but the TL072 with faster slew rate has higher level of even harmonics. Since pure square waves and Triangle waves only have Odd harmonics, I do not fully understand this difference.



BOTTOM LINE

A. The reduced frequency response of a slew rate limited amp is not noticeable since it has been compensated with choice of other components.

B. The reduction in output amplitude of a slew rate limited Amp is not noticeable since the waves are jammed up against and chopped at rail

C. There is some dynamic filtering going on. How effective / noticeable that is can only be checked with A/B listening with different Opamps.


I request peer review of this material. Thanks !!!!

antonis

#1
Quote from: Vivek on August 24, 2021, 06:20:12 AM
I request peer review of this material.

Plz feel free to request whatever you wish.. :icon_wink:

(Rob wrote something about hitting a wall with any velocity you like but you seem to insist hitting the wall till your skull brakes apart..)

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

antonis

#2
Well, I don't get what happend here (posts deleted, posts reloaded, locked, unlocked, etc..) but let it be.. :icon_smile:

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

PRR

> AMZ wrote at

His first two examples use peak to peak.

His third example omits that qualifier. Is there any reason to think it isn't p-p also? So 7V, 8V, whatever. Indeed once slewing starts we tend to a straight line all the way rail to rail (or as near as can get).
  • SUPPORTER

Steben

#4
The graphs of the frequency response are very very very alike with different inputs.... enough to claim no real difference IMHO.
On one hand strange on the other ... neh ... just avoid slew rate as design element I guess.
As I concluded IMHO slew rate affects in a dimension or scale way beyond a useful dynamic scale.
Very high gain circuits (less would render slew rate out of the picture) ment to produce a clipped signal simply barely give decent results when playiong with very low inputs. So digging for dynamic effects is useless. In other words: the slew rate effect is rather static within the purpose of for example a rat.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Vivek

Hi Steven,

It was your questions that prompted me to do a study !!!

I found that for a clipping distortion circuit with treble cut by external components, it appears that low Slew rate does not have any large effect on frequency response or amplitude.

Regarding dynamic change while a note is being played, there might be a slight difference.

r080

I haven't read the whole thing yet, but in fairness to Electrosmash, "only amplifying signals below the slew rate limit" is still correct from some point of view, since the output is attenuated, as you have shown. What are saying does give clarity to the fact that it is not a brick wall limit.
Rob

Vivek

You are right. Signals above slew limit are attenuated, not brickwalled.

I read that sentence along with another sentence on ELECTROSMASH site about "muting high harmonics" hence I wanted to clarify the issue.


Rob Strand

#8
When you hit the slew limit, by definition the differential input amp is saturated and outputting full current into the output cap.   That means the feedback is blocked in the same way the feedback is clock when the output clips.    The error signal (the voltage difference between the opamp + and - inputs) rises.   The signal slope at the peaks is zero *but* the slew limit waveform is still rising up.   The reason for that is the error signal is still high.   The error signal remains high until you reach the point where the sloped triangle waveform intersects the target waveform.    *if* the slope at that point is too high the slew-limit starts in the opposite slope.

The slew-rate limited edges roll-off the spectrum.   In effect the slew-rate shapes the output spectrum.
You can see this on pages 7 to 9 of this document,
ntuemc.tw/theme/design/EC_lecture 2.pdf

From that you might conclude the slew-limited waveform sounds smoother.     Something else is the filtering break-points are a function of the *time* spent in the slope limited regions.   If we consider the simple case where the opamp does clip then that time is more or less fixed and determined by the slew-rate. (Calculate where that roll-off point is.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.