help-gnucap
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnucap] Settling time measurement for underdamped systems


From: al davis
Subject: Re: [Help-gnucap] Settling time measurement for underdamped systems
Date: Thu, 16 Jul 2009 11:00:59 -0400

On Thursday 16 July 2009, Seshadri V wrote:
> Thanks for the insight. I tried the exact same logic for the
> measurement. The reason I am asking is because of the rise =
> last and fall = last statement.

It isn't "rise = last".  rise and last are keywords, totally 
independent.  "rise" says to find a rising crossing, the 
opposite of "fall".  "last" says to find the last one in the 
window, opposite of "first" which says to find the first one.


> When you have an output
> ringing multiple times before settling to the final desired
> value( say 10 significant but gradually decreasing swings
> before reaching 5 volts), when you use rise = last and fall =
> last, it would work fine if the last refers to the 10th
> swing. But I think the simulator has some kind of internal
> tolerance that detects the rising edge based on slopes or
> something and I came to that conclusion since the rise = last
> and fall = last specifies only the first swing and not the
> swings after that. Please correct me if I am wrong here and
> it would be nice if you can tell me how the rising and
> falling edges are detected when you specify rise = last and
> fall = last, I mean what conditions decide them?

Perhaps you need smaller time steps.  You should say "trace all" 
on the transient command so all time steps are saved.

The internal logic for finding a rising crossing is to look for 
a data point lower than the threshold followed by a data point 
higher than the threshold, then interpolate to find the time of 
the crossing.

"first" says to take the first one in the specified time 
interval.  "last" says to take the last one in the specified 
time interval.

> That is why I am looking for alternate logic to measure the
> settling time. This is a measurement syntax I would like to
> use in my test bench and I want it to be generic since I wont
> know if the output waveform has a damped response or an
> underdamped response.

That is why I suggested 10% to 90%.  It should work for both.

But I do see a problem ..  I didn't do anything to deal with 
error conditions.  You need to check that.

There's a big one here ..  cross returns infinity if it doesn't 
cross.  I suggested two of them .. one on each side of the band.  
If the signal is underdamped, it will never cross the one above, 
making it return infinity.  Then max selects the later one, 
which is infinity.

Now I see it ... this is really a bug.  It should return -inf 
when there is no crossing.  More specifically, if you say 
"first" it should return infinity when it doesn't cross, if you 
say "last" it should return 0 or -infinity.

I first thought 0, but for a DC sweep you can have negative 
input, so it should return -infinity.  I will change that.

In the file "measure_cross.cc" .. 
change line 78
from:
      double x_time = BIGBIG;
to:
      double x_time = (last) ? -BIGBIG : BIGBIG;

---------
another problem .. I gave you bad info.  oops.....

The "max" function is the "max" measure, so that line doesn't 
work.  I said I didn't test it.

Let me think about this one.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]