Measuring settling time

Home Forums General Electronics Measuring settling time

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16321
    Anonymous
    Guest
    Hi dear people,
    I’m simulating a control system (with a PID regulator) with LTSPICE ver.4.21, and I’m trying to optimize. For each simulation I want to calculate the 5% settling time. I’ve found the .measure instruction inside a script file, but I can’t understand how it works. Is it possible to define a range of values (285-315) and calculate the time to enter in it without came out? The command

    .MEAS TRAN SettlingTime5pc FIND V(Uscita) WHEN (V(Uscita)=285 || V(Uscita)=315) cross=last

    doesn’t work. How can I define a range?
    #16467
    Cribald
    Participant
    Credits: 39

    Hello rbacchi,

    You were on the right track. I’ve applied the .MEAS directive to this simple second order RLC circuit:
    I’ve chosen the components values ​​to make it quite underdamped:


    go to “View” menu, and click SPICE Error Log file (or CTRL+L).

    the higher value is the settling time. If you want a 2% settling time, simply set settling_percent=2.

    #16468
    Anonymous
    Guest
    Magic Cribald,
    your solution works perfectly!
    Do you think may be possible to use an instruction that prints the max value between the two times?

    Thank you a lot,
    Roberto
    #16469
    Cribald
    Participant
    Credits: 39

    Ciao Roberto,

    add directive:

    .MEAS TRAN settling_time PARAM max(t_lo_settling,t_hi_settling)

    #16470
    Anonymous
    Guest

    Two times Magic!

    It works perfectly!
    Thank you a lot
    Roberto
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.