State Variable Filter LPF noise

Started by MrStab, December 29, 2016, 08:34:57 PM

Previous topic - Next topic

MrStab

#100
i've finally given up my obsession with the "it's the mirroring!" thing. i'll read this like there's no tomorrow and see if there's anything else i'm missing:
http://cds.linear.com/docs/en/application-note/an148fa.pdf

also, phase has my gears turning... i wonder if something outwith the audible range is lagging to just the right phase-difference for oscillation. i'll need to read more on how that works, i get the basic criteria for oscillation but i'm not quite sure what data to look for beyond op-amp phase margin. i am finding a lot of useful articles & posts though, so hopefully it won't be long.
Recovered guitar player.
Electronics manufacturer.

MrStab

#101
i was reading up on Gain-Bandwidth Product and phase margin etc., had a wee look around in Spice to try and spot any problematic phase alignments in the ultrasonic range, then i came across this big b******!



blue is U1A's output, green (?) is the inverting input (referring to https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?dl=0 again). both the Full Cut and Full Boost graphs are without the oscillation fix. from the centre position of the BC pot onwards, the notch disappears.

i'm unsure what values to pump into LTSpice's "Universal Op-amp", if it's not universal enough already. i've set GBW to 2.2MHz as per the TLC2272, whereas the rest of the parameters remain at open-loop gain is 1Meg, slew 10Meg, phase margin 45, input impedance is 500Meg.

the sim on my phone ("EveryCircuit", surprisingly good for small stuff) even shows it, and allows for a "live" turning of the pot, which shows the notch disappearing VERY suddenly at the centre position.




current oscillation fix is 2k2 & 200p, for 362KHz roll-off. could it be that lowering the Q of that notch via. that RC is what's fixing the problem? it seems to respond more to that than where in the spectrum it's at, but that's inconclusive for now. i mean the resultant Q on U1A's output, as opposed to the signal returning to U1A's inverting input.
Recovered guitar player.
Electronics manufacturer.

Rob Strand

Quotei've finally given up my obsession with the "it's the mirroring!" thing. i'll read this like there's no tomorrow and see if there's anything else i'm missing:
http://cds.linear.com/docs/en/application-note/an148fa.pdf

That's a good reference and it discusses the right things but it might be hard picking up the subject from it.  Also, and more importantly, the emphasis in that paper is a single opamp.  It shows how things surrounding the opamp affect it's own local feedback loop making it unstable etc (despite the amplifier being designed to be stable - hence the title.)


When you have a large number of opamps arranged to form a loop, like your circuit.  The cumulative effect of all the phase shifts of the opamps causes instability around *that* loop.  This is a system level effect not a local effect.  This is independent of any local effects the paper mentioned (you have to fix the local problems first).

Quote
i was reading up on Gain-Bandwidth Product and phase margin etc., had a wee look around in Spice to try and spot any problematic phase alignments in the ultrasonic range, then i came across this big b******!

OK cool.   The first thing is you have to plot the  gain and phase of the "system level" feedback loop.  Not the response of circuit as it would be used.   For your circuit you must break loop as follows:
- Set the input voltage source to a short circuit.
- Cut the line between the output of U3 and the +input of U1A.
- Add a source drivng the +input of U1A
- Observe the output of U3
Doing this lets you see the gain and phase the loop sees.
Note also the behaviour depends on the controls.  It will be worst in the full cut-connection.

You then plot the frequency response.  It is quite a different view of the world compared to the normal operating frequency response.   If you look at the normal frequency response you might see peaks which indicate potential oscillation but it is not a reliable method and the "Phase Margin" and "Gain Margin" concepts don't apply.

So far I can't find any clear references on the topic mainly because this is a control theory problem and as a result you will get a lot of s-domain maths explanations.  The things to search for are "Stability", "Frequency Response Method", "Phase Margin" and "Gain Margin".
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Quotewith 2k2/100p for 723KHz rolloff (wtf!), it works fine in both modes. problem solved.

Those type of values are more what you would expect.    The 200kHz and above zone is where the common opamp circuits start to misbehave in terms stability.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

thanks for the info, Rob - i must've edited some stuff in my post while you were typing. main edits were that 2k2/200p were the actual working values for the oscillation fix (i forgot i paralleled 2x100p), and that it seems to be the resulting Q from U1A's output that has more effect than the placement on the spectrum. rolling off the erroneous value of 723KHz actually brings the problem back.

i'll use your walkthrough to try and dig deeper. i found a few more articles on oscillation since yesterday, so i'm taking on board all i can. i'll report back, possibly about 2 minutes in when i get confused. lol

cheers!
Recovered guitar player.
Electronics manufacturer.

MrStab

do you mean short the very input to ground, and anything particular for the voltage source? just a 1VAC sine?
Recovered guitar player.
Electronics manufacturer.

Rob Strand

Quotedo you mean short the very input to ground, and anything particular for the voltage source? just a 1VAC sine?
The original input source is replaced by a short circuit to ground.   The added voltage source is 1V AC so the final dB plot represents the gain of the circuit (1Vin 1V out ==> 0dB gain).    The source is just an AC source, same as what you have been using for your AC analysis (sine as such often implies a transient analysis in spice).



Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

ok, input shorted, 1VAC sine on U1A+ input, output from U3A shows:



hmm, nothing too weird that i can see. the phase does veer towards a full 360 from the input, towards the end of the slope, but as you said, those concepts don't apply. seems the evidence disappears when the circuit is configured like this.

control theory... that's a new lead i haven't tried before. i'll do some googling, with "for dummies" suffixed. i'm a bit excited, even though the problem has a solution for a while, it's both interesting and reassuring to start realising what the actual cause is.

the build i gave to that band seems to be working well, i asked them to pay particular attention to this issue and they had no clue what i was on about. they wanna stress-test it some more, so i'll know more by the end of the week.

cheers!
Recovered guitar player.
Electronics manufacturer.

Rob Strand

I think the boost/cut pot is on boost as the gain is very low.  Try setting to cut.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

#109
those are definitely the readings from either extreme, with the one with the slight bump at 400KHz being the Boost. maybe i'm doing something wrong. input is grounded (on the DC-free side of a cap, ofc), U3 to U1A+ line is cut, voltage source goes to the + input and measuring is done from U3 output.

results seem to be the same whether or not the input buffer is there, but if i disconnect it and short the input side of R1 straight to Vref, there's a very slight but unremarkable difference.

what the hell have i created?!! lol
Recovered guitar player.
Electronics manufacturer.

MrStab

here are the results with the input buffer removed and R1/adjoining BC pot lug shorted to Vref (same order: full cut, full cut w/ fix, full boost):

Recovered guitar player.
Electronics manufacturer.

Rob Strand

OK I think I know what is wrong now, it's because your simulation is single supply.  The added AC source that connects to the +input is stuffing-up the opamp biasing.  Instead of connecting that source to ground connect it to Vref instead.    (This configuration isn't 100% correct but it should improve things.)

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

gah, i'm an idiot - i forgot to set the DC value on the voltage source. levels much more logical now:



the crazy-low values should've given me some clue, but in fairness, i've never done this before so wasn't really sure what to expect.
Recovered guitar player.
Electronics manufacturer.

PRR

> LTSpice's "Universal Op-amp"
> GBW to 2.2MHz...open-loop gain is 1Meg, slew 10Meg, phase margin 45, input impedance is 500Meg.


"2.2MHz" -- my SPICE reads that as MILLI Hz. I have to spell "meg". However I suspect a 0.0022 Hertz GBW would not be giving even dubious audio plots.

OL Gain 1Meg with GBW 2MegHz is accurate above 2Hz, which is all you need. 45 deg is a customary phase margin. As none of your nodes are as high as 1Meg, 500Meg or even 500K input is "don't care" because this will bootstrap.

I do not know what "slew 10Meg" is. If you are only doing .AC analysis it does not matter (.AC is a fictional world anyway). In .TRANS a poor slew will slice large high frequency waves, you can find pictures in the interweb. This opamp will not be slewing for any reasonable audio, so if .TRANS says it does, you know this parameter is wrong or wrongly-expressed (SPICE is fussy).
  • SUPPORTER

MrStab

#114
it's good to know that the parameters are fine for this application at least, thanks Paul. i entered "2.2Meg", not "MHz", but i have noticed that a plain "M" will make things milli.

hey that is a weird one for the slew rate, now i think about it. i want a 10 megavolt/second slew rate!
Recovered guitar player.
Electronics manufacturer.

PRR

Slew is often specced as "micro Seconds". So 10 Meg "could" be 10 million Volts in one second, which would be 10V/uS, which is a fine fast audio rate.

> i want a 10 megavolt/second slew rate!

You may have it. Expressed in Volts/SECOND, TL0xx is 7,000,000 Volts per Second, and faster chips abound.

So I guess it makes perfect sense. Just real units instead of the customary shortcuts.
  • SUPPORTER

MrStab

right enough, i shouldda multiplied it. strange to look at it in whole numbers like that, i guess the software has to have some sort of consistency with so many variables. next time i'm messing around with a 4558 dirt circuit or something where slew matters, i'll have some clue what to change.
Recovered guitar player.
Electronics manufacturer.