Symmetrical amp clipping behavior - help needed

I tried this - and it looks to me that we just can't place functions referring to param sequences (list) as a SPICE directive.
It must be placed in "Plot Defs File" - right click on the plot -> view -> Plot Defs File.
Add it in there, and save the file.
Then you can add trace with stb() as an expression.
 
I tried that too - no joy.
Error is 'undefined symbol in <<stb>>()'.

It looks like the .func in the plot.defs is not seen.

If you take my .asc and do this, does it work for you?

BTW I routinely use .param and .step on the schematic screen with no issues.
Which make sense as they are sim directives, nothing to do with plotting results.

Jan
 
Last edited:
Here is another way to use Tian probe. It also tries to find the gain and phase margins (see View->SPICE Error log).
 

Attachments

  • tian.zip
    tian.zip
    2 KB · Views: 61
  • tian.JPG
    tian.JPG
    282.1 KB · Views: 132
Minek is right. It won't work as a .func SPICE directive in the .asc schematic. It will give exactly the error you are getting, I think.

I suspect when you add the function in the "Add Trace" it is giving you the right answer. I believe some people keep the function saved in a text file and copy/paste into the "Add Trace" dialog.

I do not know why it is not working as a function in the plot.defs file. Weird.
 
I have a basic question on the configuration of the probes. I see different setups, looking from the circuit to be measured output to the feedback network.

See attached. All 4 setups give exactly the same result. Which makes sense as the measurement sources are AC so there's no difference in 'polarity'.
Am I right?

Jan
 

Attachments

  • tianset.PNG
    tianset.PNG
    18 KB · Views: 138
You need to extend the AC analysis to 100MHz. Phase goes to -180 at around 50MHz.

Yes, 100MHz, now it's OK. Thanks for a great tool!

Another issue I found: if I use your method, with the probe subcircuit, the result is an open loop response that drops below 0dB at high frequencies which I guess is realistic.

When I use the method as shown in the attachment, the open loop gain doesn't drop below +27dB, which must be in error.

But I can't find any difference between the two setups.
What am I missing?

Jan
 

Attachments

  • tiannosub.PNG
    tiannosub.PNG
    12.9 KB · Views: 140
Last edited:
No that doesn't change anything. The .step overrules it anyway, and it is a handy way to exclude the tian stuff when you want to do a .tran or .noise.

I now see that the actual calculation formula between your subcircuit probe and the one I picked up from Russell's post is different. Hmm.

1/(1/(2*(I(Xlp:Vi)@1*V(Xlp:x)@2-V(Xlp:x)@1*I(Xlp:Vi)@2)+V(Xlp:x)@1+I(Xlp:Vi)@2)-1) versus
-1/(1-1/(2*(I(Vi)@1*V(Vend)@2-V(Vend)@1*I(Vi)@2)+V(Vend)@1+I(Vi)@2))

Edit: they both give the same result ...

Jan
 
Last edited:
I moved both the LoopGainProbe.asc and the .asy in the folder where I have my project.

I can import the .asy as is normally done, and run the sim.
But when I try to plot I get this error:

"Unknown current requested: I(Vi)"

How does that work with the subcircuit, is that automatically 'opened' or parsed, or do I need to point to it explicitly somewhere?

I have checked the Tools menu boxes to save subcircuit voltages and currents.

I tried .include LoopGainProbe.asc on my circuit, but that threw an error "Multiple instances of 'Flag'"...

Jan