2
\$\begingroup\$

I want to find the settling time (i.e. the voltage at C1 not leaving a band of 1% anymore) of a step response in a circuit like this:

Simple circuit

The step response looks like this:

Step response

As I have a more complicated case and a lot of variables I want to determine the settling time efficiently using the .meas command. The trigger would be the rising edge of V1, but how can I find the point in time, where the response won't leave my 1% band anymore? The number of oscillations is not known.

\$\endgroup\$
7
  • \$\begingroup\$ Will the circuit always be the same (with varying component values)? \$\endgroup\$
    – Huisman
    Commented Mar 20, 2020 at 13:10
  • \$\begingroup\$ yes. I'll have several nested .step commands to permutate my configurations. The netlist will stay the same, only values change. \$\endgroup\$
    – DPF
    Commented Mar 20, 2020 at 14:32
  • \$\begingroup\$ Why don't you simple use the mathematical approach: calculate the damping \$\alpha\$, determine the applicable solution and find when the exponential term decays such that the result is 1%. \$\endgroup\$
    – Huisman
    Commented Mar 20, 2020 at 21:35
  • \$\begingroup\$ Because my real network is much more complex, including transmission lines and real operational amplifiers. \$\endgroup\$
    – DPF
    Commented Mar 21, 2020 at 22:03
  • 1
    \$\begingroup\$ @Huisman I think he meant that his complex network will stay the same and only the .stepped parameters change, while you probably referred to the 1st picture. \$\endgroup\$ Commented Mar 22, 2020 at 12:20

1 Answer 1

4
\$\begingroup\$

You can use this command:

.meas tmp find V(o) when abs(v(o)-1)=0.01 fall=last

Alternatively, you can concoct something like this for a more "dynamical" approach:

test

I commented out the .step card so that the results are a bit more visible. This is just one approach. Note that this implies knowing the I/O step value(s). I suppose you can do that by simple subtraction, but you know what cases you have for that.

\$\endgroup\$
2
  • \$\begingroup\$ This is great! Is there any possibility to specify a maximum time for the search for the "last" fall? \$\endgroup\$
    – DPF
    Commented Mar 23, 2020 at 7:51
  • 1
    \$\begingroup\$ @DPF I don't think you can, but there is an option to specify the delay from which the count starts, td=<...>[seconds], which can be appended to the command line. Though, I tried recreating the circuit now, and with or without td, the same results appeared, both in IV and XVII. Also, instead of [...] find V(o) [...], you can use [...] find time [...] to find the time, directly, but the way I wrote it allows you to also see the value of V(o). \$\endgroup\$ Commented Mar 23, 2020 at 9:14

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.