Calculating Settling time in LTSpice

Thread Starter

varun171

Joined Jan 15, 2025
20
SettlingTime ED_10k.png

I have this particular waveform and want to find the settling time of the signal in LTSpice. It resembles somewhat of an exponential sinusoid that settles at a particular time. I have tried a lot of ways and there seem to be a lot of flaw in my logic. Would there be any way in LTSpice to measure the settling time of these three signals? I am not certain of the steady state voltage as it changes as I make changes in the circuit
 

Thread Starter

varun171

Joined Jan 15, 2025
20
Define "settling time" for that waveform.
I would like to know the time where the signal oscillates about a certain voltage and oscilaltions stay within a certain percent of that final value. For the green waveform by eyeballing it, I can tell it oscillates about the 50 mV level at around 2ms. Is there a way to get a precise timestamp?
 

Papabravo

Joined Feb 24, 2006
22,082
I would say no. You can define some notion "steady state" by subtracting the average value from the RMS value over some number of cycles, but an analytical formula for the point where that first happens is probably not possible. You could try sliding a 5-cycle window along the waveform one cycle at a time to see where "steady state" appears to begin and call it done, but you still have an uncertainty of one cycle.

This is a much different problem than the settling time in the step response of a 2nd order system, because you can describe the function and solve for a specific value.
 

eetech00

Joined Jun 8, 2013
4,705
I would like to know the time where the signal oscillates about a certain voltage and oscilaltions stay within a certain percent of that final value. For the green waveform by eyeballing it, I can tell it oscillates about the 50 mV level at around 2ms. Is there a way to get a precise timestamp?
if you can do the math, you can apply it to .meas statements. Its much more accurate.
 

Thread Starter

varun171

Joined Jan 15, 2025
20
You could take the average of each cycle, and then determine when that average reaches your desired steady-state value, but your precision is limited by the cycle period.
[/This was a approach that I thought of but then I'm not sure how I would implement it. Is there something like loops I can use in combination with the .MEAS directive or do I have to write one statement for each cycle, in which case I would have a couple hundred AVG measurements depending on the period
 

Thread Starter

varun171

Joined Jan 15, 2025
20
Sorry, I'm not that familiar the the .MEAS command to know if it can be done, but someone else may be able to help with that.
No worries. For the time being I have exported the waveform to a text file and processing it in matlab. Thank you everyone for your suggestions
 

Papabravo

Joined Feb 24, 2006
22,082
AFAIK the type of .measure statements that apply to a range over the abscissa, operate as a post processing script with no looping or other control structures. In addition the operations that can be performed on an expression of the simulation data enumerated in a .save command are:
  1. AVG - Average
  2. MAX - Find the maximum
  3. MIN - Find the minimum
  4. PP - Find the Peak-to-Prak value
  5. RMS - Find the RMS value
  6. INTEG - The integral of the expression
 
Top