0
\$\begingroup\$

I have been working on an assignment for my uni course. The task is to simulate and present results of a simple bandpass filter. I tried to perform analysis using .step and .meas commands as can be seen below: enter image description here

Unfortunately the step analysis fails to find the f0 when the capacitance is 17nF (step 8) When i increase the number of steps some of them fail too. Rest of the .meas commands executes properly and I don't know why it happens. The whole simulation also executes properly. I managed to find that when I changed solver to normal got 2 fails in this simple 20 values sweep. Maybe it has to do with my commands or initial simulation parameters like Gmin, Abstol, Reltol etc. enter image description here

Please help :(

asc file can be downloaded from here: https://drive.google.com/open?id=1AwvurCTqInAp89SrHH47EMbKgvqiRny_

\$\endgroup\$
3
  • \$\begingroup\$ Switch x=mag(V(out)) with mag(V(out))=x, and it will work. \$\endgroup\$ Mar 18, 2020 at 17:55
  • \$\begingroup\$ Unfortunately it didn't help. The solution was to substract a very small value like 1e-9 from the compared x. Similar topic at ADI Engineering zone: ez.analog.com/design-tools-and-calculators/f/q-a/163106/… \$\endgroup\$ Mar 18, 2020 at 18:06
  • \$\begingroup\$ Hmm, ma' bad, I was talking from memory. I remember that sometimes, the proper order had to be obeyed. You can post the answer and select it as marked. It might help future searches for similar questions. \$\endgroup\$ Mar 18, 2020 at 18:18

1 Answer 1

1
\$\begingroup\$

Solution from ADI Engineer Zone: https://ez.analog.com/design-tools-and-calculators/f/q-a/163106/ltspice-meas-command-unexpected-single-fail-in-step-when-the-rest-passes-ok

Hello Marcin,

I have seen this kind of problem sometimes. The solution is very simple. Just compare with a smaller value. Often a factor of 1e.9 will be sufficient as in your case.

.meas AC f0 WHEN MAG(V(Out))=x*(1-1n)

Just one tip for better readability of the reaults with magnitude instead of dB.

.options meascplxfmt=polar

Helmut

\$\endgroup\$
3
  • \$\begingroup\$ Don't be shy to select this (the check mark). When someone will search for something similar, this question will appear as answered, so the people searching will know to look here for answer(s). \$\endgroup\$ Mar 19, 2020 at 14:44
  • \$\begingroup\$ Ermmm, I'm not shy it is just the "Stack" rules that allow me to accept my own answer only after 2 days. \$\endgroup\$ Mar 20, 2020 at 15:11
  • \$\begingroup\$ Ah yes, there's those, too. Don't mind those words, it's just an expression. :-) \$\endgroup\$ Mar 20, 2020 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.