Parameters, steps and measurements
Automate design exploration with .param, .step and .meas.
Instead of editing values by hand and re-running, let LTspice sweep them and report results. Three directives do the job.
- .param name=value defines a variable you can use in braces, such as {Rval}.
- .step param name start stop increment (or list values) re-runs the whole simulation for each value.
- .meas computes numbers such as maximum, rise time or the value at a given time, and prints them in the log.
- Set the resistor value to {Rval} (with braces).
- Run: you get four overlaid curves, one for each resistance.
- Open View > SPICE Error Log. It lists vmax and t63 for every step.
- Use right-click in the log > Plot .step'ed .meas data to graph a measurement against the stepped value.
Combine .step with .ac to see how component values move the cutoff frequency of a filter.