LT Spice odd Frequency Response after adding power Cap?

Started by seedlings, May 29, 2014, 10:26:45 AM

Previous topic - Next topic

seedlings

I don't hear this on the breadboard, and it should be pretty easy to hear.  Why does LTSpice make this frequency response notch after adding a 220uF power rail cap?  It took me forever to discover that this cap was why the frequency response looked so terrible.

Without cap:



With cap:


Schematic:



CHAD

teemuk

Not sure about the effect of that cap per se but that power supply line will definitely need more decoupling.

It's not sound practice to cascade several gain stages like that without proper RC decoupling in between.

Fit another RC power supply filter in between 2nd and 3rd gain stage and see if that cures the issue.

seedlings

Quote from: teemuk on May 29, 2014, 10:46:59 AM
Not sure about the effect of that cap per se but that power supply line will definitely need more decoupling.

It's not sound practice to cascade several gain stages like that without proper RC decoupling in between.

Fit another RC power supply filter in between 2nd and 3rd gain stage and see if that cures the issue.

Perhaps, but I do not hear the reduction in bass and peak in the low-mids at all with or without the 220uF cap on the breadboard circuit - only on the LTspice response graph.  It doesn't sound like there is any additional filtering required.  I just wondered if there was a reason why LTSpice simulation was so far off?

CHAD

Digital Larry

Are you sure that your second and third stages are grounded?  The ground triangle is sort of "sitting" on the wire but it's not obvious that it's connected.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Thecomedian

Have you tried putting the decoupling cap behind a switch so you can put it in and out of the circuit while testing, and see if you can hear a volume or frequency response change?

Aren't R3 and C9 forming a low pass filter for the AC signal?

The difference at the notch is 10 dB, and the difference from 100 hz to first dotted line is 7dB without cap and 12 dB with cap.


QuoteAre you sure that your second and third stages are grounded?  The ground triangle is sort of "sitting" on the wire but it's not obvious that it's connected.

ground and nodes automatically snap together if they occupy the same space in a schematic.
If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

seedlings

Quote from: Digital Larry on May 29, 2014, 11:45:07 AM
Are you sure that your second and third stages are grounded?  The ground triangle is sort of "sitting" on the wire but it's not obvious that it's connected.

Good eyes, but yes.  Hovering over the horizontal line returns, "This is ground".

Quote from: Thecomedian on May 29, 2014, 12:16:11 PM
Have you tried putting the decoupling cap behind a switch so you can put it in and out of the circuit while testing, and see if you can hear a volume or frequency response change?

Aren't R3 and C9 forming a low pass filter for the AC signal?

The difference at the notch is 10 dB, and the difference from 100 hz to first dotted line is 7dB without cap and 12 dB with cap.


I understand what you're saying, but how could fiiltering DC voltage affect the AC wave output at the end?  confused  ???

CHAD

teemuk

Because of lack of proper decoupling.

Ideally the rail should be steady DC, but once you insert series resistance to the power supply the power supply voltage will vary according to current draw. There will be an "AC" component. You have three stages drawing current, two of them in same phase, one in opposite. You want to decouple these stages with proper RC filtering so that current draw of one stage doesn't reflect into the other through the power supply. Basically, to prevent feedback between stages through the power supply rail That's why it's called decoupling, in opposite to usual signal coupling you have between the stages.

So, try if increased decoupling cures the issue...

Why it makes that peak... perhaps a resonant frequency, perhaps a simulation error. But if you power several gain stages from a source with considerable series resistance you need proper decoupling.

seedlings

#7
Quote from: teemuk on May 29, 2014, 01:36:42 PM
Because of lack of proper decoupling.
...
You want to decouple these stages with proper RC filtering so that current draw of one stage doesn't reflect into the other through the power supply. Basically, to prevent feedback between stages through the power supply rail That's why it's called decoupling, in opposite to usual signal coupling you have between the stages.


Here's what I'm thinking.  The circuit on my breadboard is basically a variation of Zvex's Box of Rock.  In that schematic there is no additional power filtering between power stages.  In tube amp builds, I realize the RC filters continue to filter the rectifier ripple to the preamp sections (in addition to dropping voltage).  In this simulation, the circuit is starting with ideal DC that doesn't need filtering, and there should be very minimal current change in each of the MOSFETs with transient peaks, and a minimal current change through a 47 ohm resistor is very, very minimal.  The box of rock shows an 82 ohm resistor.

This circuit (in the first post) is on my breadboard.  It sounds good.  There is no tonal difference in sound with or without the 220uF cap in the circuit.

Box of Rock schematic for reference (note absence of RC filters between stages):
http://3.bp.blogspot.com/-kq989pNrtME/TxQ5v0UVl8I/AAAAAAAAAkQ/tQV0VA6M2QQ/s1600/zvex_boxofrock_schematics.jpg

CHAD

teemuk

Did you try my suggestion...?

Because I did simulate it and guess what.... Additional decoupling (namely another 100R+470uF RC power supply filter between the 2nd and 3rd gain stage) eliminates that resonant peak.


But do continue ignoring advise about sound design practices. Not my loss. I just wonder why you even ask advise if you are not willing to accept it...

Thecomedian

#9
Quote from: seedlings on May 29, 2014, 12:25:47 PM
Quote from: Digital Larry on May 29, 2014, 11:45:07 AM
Are you sure that your second and third stages are grounded?  The ground triangle is sort of "sitting" on the wire but it's not obvious that it's connected.

Good eyes, but yes.  Hovering over the horizontal line returns, "This is ground".

Quote from: Thecomedian on May 29, 2014, 12:16:11 PM
Have you tried putting the decoupling cap behind a switch so you can put it in and out of the circuit while testing, and see if you can hear a volume or frequency response change?

Aren't R3 and C9 forming a low pass filter for the AC signal?

The difference at the notch is 10 dB, and the difference from 100 hz to first dotted line is 7dB without cap and 12 dB with cap.


I understand what you're saying, but how could fiiltering DC voltage affect the AC wave output at the end?  confused  ???

CHAD

Normally AC signals pass from input to ground through emitter or source. A bypass cap on source parallel to resistor can massively increase gain.

You got an appreciable gain boost for the circuit by putting a decoupling cap on, which is really mostly to smooth DC from an unclean source like rectified AC. If it's a battery, a decoupling cap isn't really necessary.

Previously, due to the lack of any other grounds except on Sources for transistors, AC signal could only take that path.

5k is comparatively a short circuit to 1.5 meg.

So you have this: Gate -> Source -> Se -> ground.
Putting another path to ground above the Drain resistor, which is only 2.7k, leads to this. Gate -> Source||Drain -> 2.7k||5k -> ground.

AFAIK there's no rules against the AC signal using the collector or drain of a transistor to escape to ground if there's a DC+AC or AC to ground path for it to take. If this is true, the AC signal now sees 2.7k||5k for 1.7k resistance to ground. It's close to a bypass cap to ground for the AC, but not quite.

If this is true, that's why you see gain. Normally, Collector or Drain resistors are a much larger value than Emitter or Drain resistors. http://www.beavisaudio.com/schematics/Electro-Harmonix-LPB-1-Schematic.htm
Original Zvex circuit: http://3.bp.blogspot.com/-kq989pNrtME/TxQ5v0UVl8I/AAAAAAAAAkQ/tQV0VA6M2QQ/s1600/zvex_boxofrock_schematics.jpg

You can see Drain resistors are much higher ohms than Source resistors.

The notch is probably coming from having created a Notch frequency filter due to the complex interactions. I'd try to find the highest frequency shown on the simulation curve or something that can be divided in half for a whole number, it's lower octave and it's higher octave, and play those three together while putting the cap in and out of circuit, if it were me.

I could be wrong though.

Quote from: teemuk on May 29, 2014, 02:05:02 PM
Did you try my suggestion...?

Because I did simulate it and guess what.... Additional decoupling (namely another 100R+470uF RC power supply filter between the 2nd and 3rd gain stage) eliminates that resonant peak.


But do continue ignoring advise about sound design practices. Not my loss. I just wonder why you even ask advise if you are not willing to accept it...

http://youtu.be/ygr5AHufBN4

It's no problem if he wants to ignore it, but the original circuit it's based on is designed to sag and tweak like overdriving tubes, so there's a reason it's not built "sound audio practice". It doesn't hurt anything if you offer help and it's not taken.

QuoteOverview:
The Box of Rock™ is Z.Vex Effect's first "distortion" pedal, highly specialized to simulate the "everything on 10" sound of a classic Marshall ® JTM45 non-master-volume amplifier.

If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

seedlings

Quote from: teemuk on May 29, 2014, 02:05:02 PM
Did you try my suggestion...?

Because I did simulate it and guess what.... Additional RC filters between the stages reduce that resonant peak.


But do continue ignoring advise about sound design practices. Not my loss.

My apologies.  You've given insightful advice on circuits and filtering, thank you.  I don't at all mean to counter what you're saying, because I am an advice taker.  Yes, I added filtering and the peak disappeared in the sim just like you said it would.  With an ideal voltage source and ideal components and ideal math, I am only trying to understand why weird freq response in the sim, and not in real life.

CHAD

teemuk

Quote..the original circuit it's based on is designed to sag and tweak like overdriving tubes, so there's a reason it's not built "sound audio practice".

Better decoupling of stages isn't really going to decrease sagging. But it will prevent issues like motorboating or those strange resonant peaks in frequency response.

If you look at tube designs, even designs that are not so "HiFi" and meant to be overdriven, you will find that they also employ that sort of decoupling, especially between gain stages in which signals have the same phase.

We will probably revert back to this age old wisdom, which in fact was more relevant during days of tube amps than it is now with opamp designs and all, when the signal has strange "put put" sound in it or just strange oscillations in general.

Thecomedian

#12


Quote from: teemuk on May 29, 2014, 01:36:42 PM
Because of lack of proper decoupling.

Ideally the rail should be steady DC, but once you insert series resistance to the power supply the power supply voltage will vary according to current draw. if you power several gain stages from a source with considerable series resistance you need proper decoupling.

Voltage sag, in other words, right? I assume the successful creator of Zvex Box of Rock put only a lowly 47u cap as a decoupler for a reason, but I'm not saying it's to reduce sag. Sag is a desired effect by the creator.

http://www.thegearpage.net/board/archive/index.php/t-41413.html


If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

teemuk

QuoteVoltage sag, in other words, right?

Sometimes voltage sag but in case of decoupling we are more interested in audio signals also getting fed to the power supply lines. If the power supply lines aren't adequately AC bypassed (so that they form a very low impedance termination to AC signals) the audio signals will as well modulate the power supply rail. This modulation then gets passed on to all stages within the same power supply node and there you have feedback. When it's positive you can have all sorts of oscillations.

RC filtering in between stages, "decoupling", is a practical and simple way to prevent that from happening.

Sag? That will happen if you have enough current draw. Overall you can regard it more as the whole DC voltage of the power supply rail decreasing. Different phenomenon from stage currents and voltages modulating the rail.

seedlings

From the original circuit, increase C4 to 1uF or more and response returns to normal...  Lots of interactions at work that I need not try to understand.

CHAD

teemuk

Plot the response of the power supply rail.

It explains a lot.

You will notice that it has that very same peak in frequency due to insufficient decoupling.

Not surprisingly the peak is close to corner frequency of hi-pass filter of the 3rd stage, the point where phase shift is highest. And like I mentioned earlier, the 3rd stage provides positive feedback to the first stage via the insufficently decoupled power supply rail.

By lowering the hi-pass filter's corner frequency (22nf -> 1 uF) the frequency of the resonant peak in power supply rail is moved sufficiently below the corner frequency of the hi-pass filter and this is enough to damp the resonance at signal line.


Now simulate it with another 47R + 220uF RC decoupling filter placed in between 2nd and 3rd stage. This attenuates plenty of the feedback between the stages. You will see how such filter even better decreases the resonant frequency at power supply nodes. It becomes ridiculously evident with that original 22nF coupling cap value.

Now which one you think is better design practice; decreasing hi-pass filtering of gain stages (prominent altering of tone) or sufficiently decoupling the power supply (no tone alteration)...? Circuit that is prone to oscillation or circuit that is not?


seedlings

Quote from: teemuk on May 30, 2014, 09:17:01 AM
Plot the response of the power supply rail.

It explains a lot.

You will notice that it has that very same peak in frequency due to insufficient decoupling.

Not surprisingly the peak is close to corner frequency of hi-pass filter of the 3rd stage, the point where phase shift is highest. And like I mentioned earlier, the 3rd stage provides positive feedback to the first stage via the insufficently decoupled power supply rail.

By lowering the hi-pass filter's corner frequency (22nf -> 1 uF) the frequency of the resonant peak in power supply rail is moved sufficiently below the corner frequency of the hi-pass filter and this is enough to damp the resonance at signal line.



Could you post a screen shot of how you recommend the additional filtering?  I added a 47R and 10uF to ground between R8 and R12, but the peak in the power rail is still present.  De-emphasized, but present.  How about removing the 47R altogether, but leaving the 220uF?  That goes back to theoretical ruler flat DC.

CHAD

mac

QuotePerhaps, but I do not hear the reduction in bass and peak in the low-mids at all with or without the 220uF cap on the breadboard circuit - only on the LTspice response graph.  It doesn't sound like there is any additional filtering required.  I just wondered if there was a reason why LTSpice simulation was so far off?

You are getting the notch at node 17 after R5, right?
But have you plotted the output at R99999 with and without the cap? The addition of this cap may have no effect there.
Have you checked that node 17 remains the same after adding/removing the cap. LTSpice sometimes changes nodes, but since you're going to gnd it might not be the case.

Your simulation lacks a guitar circuitry. The coil inductance, resistance and wire capacitance interact in funny ways with the input stage.

mac

mac@mac-pc:~$ sudo apt install ECC83 EL84

head_spaz

seedlings;

It's called "Intermodulation Distortion", commonly referred to as: IMD.
In short... it's a byproduct of gain stages 'cross-talking' to their peers via the power rails.
The cure is to 'stiffen' the rails with decoupling... effectively lowering the power rail's impedance.

Texas Instruments has written a paper that describes this phenomenon quite well. See: sboa077.pdf.

Glad I could be of service. :icon_wink: And good luck with your project/education.

"May all your dreams come true - and your nightmares cease." ~ dwm
Deception does not exist in real life, it is only a figment of perception.

seedlings

#19
Quote from: mac on May 31, 2014, 05:02:52 PM
You are getting the notch at node 17 after R5, right?
But have you plotted the output at R99999 with and without the cap? The addition of this cap may have no effect there.
Have you checked that node 17 remains the same after adding/removing the cap. LTSpice sometimes changes nodes, but since you're going to gnd it might not be the case.

Your simulation lacks a guitar circuitry. The coil inductance, resistance and wire capacitance interact in funny ways with the input stage.

mac



The plots from my original post are at the top of the two 50K resistors at the end, so LTSpice does factor in the power rail peak at that node.  Yes, I need to start simulating the guitar circuitry... I see that in other posts and need to add to simulations (still learning, but thank you!).

Quote from: head_spaz on May 31, 2014, 06:43:56 PM
seedlings;

It's called "Intermodulation Distortion", commonly referred to as: IMD.
In short... it's a byproduct of gain stages 'cross-talking' to their peers via the power rails.
The cure is to 'stiffen' the rails with decoupling... effectively lowering the power rail's impedance.

Texas Instruments has written a paper that describes this phenomenon quite well. See: sboa077.pdf.

Glad I could be of service. :icon_wink: And good luck with your project/education.

"May all your dreams come true - and your nightmares cease." ~ dwm

I've heard that term before, and thanks for the link.  The project is fine, and I haven't ever heard the peak, even with the circuit on PCB and boxed up... (little noisy - like white noise 'shhhh' at the upper range of the SHO style 10k gain knob on Q1 source, but sounds good). I always figured that I was just doing something wrong with the LTSpice software.

As always, DIYSB is quite the helpful community!  Thank you all for sharing your thoughts and offering correction.

CHAD