0
\$\begingroup\$

I am using LTSpice and I am trying to run a simulation for multiple resistor values in a DC op pt simulation. I need to measure the resistance at a node as well as the current through the varying resistor. I am using:

.step param VAR list val1 val2 val3 ... valn

to simulate the resistor but I cannot seem to find the proper way to get the measurements I need from that. I have tried using

.meas op RESULT find V(myNode) at VAR = val1.

to find the voltage for the first value val1 but I can't figure out how to make it run the list or to measure the current through VAR

\$\endgroup\$
1
  • \$\begingroup\$ This may help. \$\endgroup\$
    – Long Pham
    Commented Mar 24, 2020 at 15:37

2 Answers 2

0
\$\begingroup\$

Just add this line

.meas OP I_VAR AVG I(VAR)

This assumes that you are interested in measuring the average current flowing through a resistor called VAR and the result is saved in a variable called I_VAR. For RMS current replaces AVG with RMS. This line of code is going to be called only if you run a OP (Operation Point) simulation. For transient, you can replace OP with TRAN.

The results can be seen in the erro log (Ctrl + L). There you can right click and select plot. A new window will open and then you can plot the current vs. the resistance values.

\$\endgroup\$
0
\$\begingroup\$

If you're running a DC op point (.op), then stepping a value will bring up the waveform window showing the variation of the .stepped value as the X-axis. The number of plot points will be as many as the .step command has, so it will be easy to simply navigate the cursors with left and right arrow keys.

Otherwise, have you tried this, for example:

.meas RESULT find I(R1) at VAR=val1
\$\endgroup\$
3
  • \$\begingroup\$ How would you modify the command '.meas RESULT find I(R1) at VAR=val1' to measure all values of I(R1) for VAR = val1, VAR = val2, VAR = val3 ... VAR = valn? \$\endgroup\$ Commented Mar 24, 2020 at 19:49
  • \$\begingroup\$ @CalebCapps Unless it's a large list of stepped values, with a copy-paste+modify. But if the list is large, your best bet is to actually run a .tran simulation, not .op, for a short period of time, and only use one .meas command, which will be executed for every step, so the current will be measured for all the values of the .step command. \$\endgroup\$ Commented Mar 24, 2020 at 21:49
  • \$\begingroup\$ the list I was working with was around 10 values, but with a large variety ranging from 50 to 10k without regular intervals to step. I ended up exporting the trace data which had the exact info I need from the simluation \$\endgroup\$ Commented Mar 26, 2020 at 4:53

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.