Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

risetime in LT Spice

2,011 views
Skip to first unread message

John Larkin

unread,
Aug 9, 2014, 3:03:33 PM8/9/14
to


Got a suggestion for making 10/90 risetime measurements in LT Spice?

I need to do that a lot, as I tweak other things. I can do it manually on the
waveform plot, but that's a nuisance. I have two waveforms of interest, one
electrical, the other a simulated optical waveform.

I could fake some sort of window comparators, which would at least be a little
easier to measure on the plot. Or maybe make some linear ramps that run from 10%
to 90% of the waveforms that I care about

I want two big red 7-segment LED displays that show the rise times.


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation

Jim Thompson

unread,
Aug 9, 2014, 3:46:24 PM8/9/14
to
On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
<jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>
>
>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>
>I need to do that a lot, as I tweak other things. I can do it manually on the
>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>electrical, the other a simulated optical waveform.
>
>I could fake some sort of window comparators, which would at least be a little
>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>to 90% of the waveforms that I care about
>
>I want two big red 7-segment LED displays that show the rise times.

Numerically that's done with a .MEAS statement, see
LTspiceTutorials.zip on the Simulation Tools & Macros Page of my
website.

...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| San Tan Valley, AZ 85142 Skype: skypeanalog | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.

John Larkin

unread,
Aug 9, 2014, 3:51:23 PM8/9/14
to
On Sat, 09 Aug 2014 12:46:24 -0700, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
><jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>
>>
>>
>>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>>
>>I need to do that a lot, as I tweak other things. I can do it manually on the
>>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>>electrical, the other a simulated optical waveform.
>>
>>I could fake some sort of window comparators, which would at least be a little
>>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>>to 90% of the waveforms that I care about
>>
>>I want two big red 7-segment LED displays that show the rise times.
>
>Numerically that's done with a .MEAS statement, see
>LTspiceTutorials.zip on the Simulation Tools & Macros Page of my
>website.
>
> ...Jim Thompson

How would you construct a .MEAS statement to measure a rise time? It's not a
simple calculation.

Again, I can run a linear ramp to convert rise time to a single voltage. Might
do that.

Jim Thompson

unread,
Aug 9, 2014, 4:03:09 PM8/9/14
to
On Sat, 09 Aug 2014 12:51:23 -0700, John Larkin
<jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>On Sat, 09 Aug 2014 12:46:24 -0700, Jim Thompson
><To-Email-Use-Th...@On-My-Web-Site.com> wrote:
>
>>On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
>><jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>
>>>
>>>
>>>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>>>
>>>I need to do that a lot, as I tweak other things. I can do it manually on the
>>>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>>>electrical, the other a simulated optical waveform.
>>>
>>>I could fake some sort of window comparators, which would at least be a little
>>>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>>>to 90% of the waveforms that I care about
>>>
>>>I want two big red 7-segment LED displays that show the rise times.
>>
>>Numerically that's done with a .MEAS statement, see
>>LTspiceTutorials.zip on the Simulation Tools & Macros Page of my
>>website.
>>
>> ...Jim Thompson
>
>How would you construct a .MEAS statement to measure a rise time? It's not a
>simple calculation.
>
>Again, I can run a linear ramp to convert rise time to a single voltage. Might
>do that.

In PSpice (Probe post-processor) I just click on a macro "measure
risetime in this specified x-range"... and the answer pops up.

If you want a circuit to measure risetime... you _know_ how to do that
>:-}

John Larkin

unread,
Aug 9, 2014, 5:55:46 PM8/9/14
to
On Sat, 09 Aug 2014 13:03:09 -0700, Jim Thompson
It's a cinch that you're not going to tell us.

Jim Thompson

unread,
Aug 9, 2014, 6:17:37 PM8/9/14
to
On Sat, 09 Aug 2014 14:55:46 -0700, John Larkin
I should tell _you_ how to measure risetime?

John Larkin

unread,
Aug 9, 2014, 6:46:49 PM8/9/14
to
On Sat, 09 Aug 2014 15:17:37 -0700, Jim Thompson
The point is to write an expression in LT Spice that computes a rise time. I
don't know how to do that.

I just did it with a circuit, a current source charging a cap through two series
switches, with switch thresholds 0.1 and 0.9 volts, basically a
window-comparator+current-source charging a cap. Like any window comparator, it
fires again on the falling edge, which is OK in this case. My rise times show up
as voltages, 1 volt per ns, I can park the cursor on.

Jim Thompson

unread,
Aug 9, 2014, 8:15:20 PM8/9/14
to
On Sat, 09 Aug 2014 15:46:49 -0700, John Larkin
I think I can extract the script that PSpice uses... that would
certainly give you a starting place. What does the LTspice .MEAS
command actually do?

>
>I just did it with a circuit, a current source charging a cap through two series
>switches, with switch thresholds 0.1 and 0.9 volts, basically a
>window-comparator+current-source charging a cap. Like any window comparator, it
>fires again on the falling edge, which is OK in this case. My rise times show up
>as voltages, 1 volt per ns, I can park the cursor on.

Sure. Make an ideal peak detect and hold and you don't have to be
finicky with the cursor.

Jim Thompson

unread,
Aug 9, 2014, 9:12:00 PM8/9/14
to
On Sat, 09 Aug 2014 12:51:23 -0700, John Larkin
<jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>On Sat, 09 Aug 2014 12:46:24 -0700, Jim Thompson
><To-Email-Use-Th...@On-My-Web-Site.com> wrote:
>
>>On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
>><jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>
>>>
>>>
>>>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>>>
>>>I need to do that a lot, as I tweak other things. I can do it manually on the
>>>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>>>electrical, the other a simulated optical waveform.
>>>
>>>I could fake some sort of window comparators, which would at least be a little
>>>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>>>to 90% of the waveforms that I care about
>>>
>>>I want two big red 7-segment LED displays that show the rise times.
>>
>>Numerically that's done with a .MEAS statement, see
>>LTspiceTutorials.zip on the Simulation Tools & Macros Page of my
>>website.
>>
>> ...Jim Thompson
>
>How would you construct a .MEAS statement to measure a rise time? It's not a
>simple calculation.
>
>Again, I can run a linear ramp to convert rise time to a single voltage. Might
>do that.

What kind of rise-times are you talking, and what kind of accuracy are
you looking for? Even behavioral elements can be troublesome if
you're pushing toward minimum time-step.

John Larkin

unread,
Aug 9, 2014, 10:01:49 PM8/9/14
to
On Sat, 09 Aug 2014 18:12:00 -0700, Jim Thompson
2 ns, but that's meaningless. It could be 2 ps or 2 weeks. 1% accuracy is fine,
since I'm just tuning for best risetime.

whit3rd

unread,
Aug 10, 2014, 5:16:46 PM8/10/14
to
On Saturday, August 9, 2014 7:01:49 PM UTC-7, John Larkin wrote:

[about determining 10-to-90 percent risetime]

> .... 1% accuracy is fine,
> since I'm just tuning for best risetime.

But that 10/90 criterion is just a convenient way to line up an analog
oscilloscope! For Spice simulation, I'd prefer a dummy capacitor
(tenth of a picofarad?) and ammeter; capture the peak current to
get the slew rate. Peak-capture is a robust way to get your
estimate, since the signal hangs around the peak value for a few
samples. Catching the fast rise is spotty at best, you need better
than 1% determination of two times, during a fast transient where
Spice is hard-pressed for data points. Why depend on hundreds of
samples per rise, when ten per rise will get your peak to 1% ?

It's rare, in my experience, that the 10% or 90% values are significant;
any thresholds ought to be closer to 50%

miso

unread,
Aug 10, 2014, 5:21:24 PM8/10/14
to
John Larkin wrote:

I'm assuming you know that Spice simulation parameters need to be tweaked to
measure accurate rise/fall times. At the very least, I would use a 4
parameter .tran statement at the very least, if not tweaking the tolerances.

Spice doesn't conserve charge, and shuffling around charge is at the heart
of timing.


John Larkin

unread,
Aug 10, 2014, 8:25:54 PM8/10/14
to
Risetime is significant because my customer specified it. For his physics, it
makes sense.

People in the picosecond business sometimes use 20/80 rise time, to avoid
skin-effect drool, but I can't get away with that.

John Larkin

unread,
Aug 11, 2014, 1:28:43 PM8/11/14
to
Does the voltage on a cap not go as the integral of the current?
Within reasonable limits of time quantization, I mean.

It sure looks like it does. Capacitive ramps are dead-on.


--

John Larkin Highland Technology, Inc

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

Jim Thompson

unread,
Aug 11, 2014, 1:41:19 PM8/11/14
to
On Mon, 11 Aug 2014 10:28:43 -0700, John Larkin
<jla...@highlandtechnology.com> wrote:

>On Sun, 10 Aug 2014 14:21:24 -0700, miso <mi...@sushi.com> wrote:
>
>>John Larkin wrote:
>>
>>I'm assuming you know that Spice simulation parameters need to be tweaked to
>>measure accurate rise/fall times. At the very least, I would use a 4
>>parameter .tran statement at the very least, if not tweaking the tolerances.
>>
>>Spice doesn't conserve charge, and shuffling around charge is at the heart
>>of timing.

"Spice doesn't conserve charge"... Miso's lack of Spice knowledge
shows again. Most modern CMOS models are charge-controlled devices.

>>
>
>Does the voltage on a cap not go as the integral of the current?

Yep.

>Within reasonable limits of time quantization, I mean.

Within a time accuracy of Tminstep

>
>It sure looks like it does. Capacitive ramps are dead-on.

Yep.

Jim Thompson

unread,
Aug 11, 2014, 2:05:32 PM8/11/14
to
On Mon, 11 Aug 2014 10:41:19 -0700, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Mon, 11 Aug 2014 10:28:43 -0700, John Larkin
><jla...@highlandtechnology.com> wrote:
>
>>On Sun, 10 Aug 2014 14:21:24 -0700, miso <mi...@sushi.com> wrote:
>>
>>>John Larkin wrote:
>>>
>>>I'm assuming you know that Spice simulation parameters need to be tweaked to
>>>measure accurate rise/fall times. At the very least, I would use a 4
>>>parameter .tran statement at the very least, if not tweaking the tolerances.
>>>
>>>Spice doesn't conserve charge, and shuffling around charge is at the heart
>>>of timing.
>
>"Spice doesn't conserve charge"... Miso's lack of Spice knowledge
>shows again. Most modern CMOS models are charge-controlled devices.
>
>>>
>>
>>Does the voltage on a cap not go as the integral of the current?
>
>Yep.
>
>>Within reasonable limits of time quantization, I mean.
>
>Within a time accuracy of Tminstep

Make that Max Time-step

miso

unread,
Aug 12, 2014, 3:12:37 AM8/12/14
to

Learn something, or don't comment on things you don't understand.

> http://www.designers-guide.org/Forum/Attachments/chg-cons.pdf

If your analysis accumulates charge error, such as in cyclic converters, you
will most certainly see the charge conservation errors.

There are charge conserved models, but the way spice works, the net effect
is charge will not be conserved perfectly. I am talking about quality
circuits, not the kind you design.

As I had already mentioned, you should use the 4 parameters on the .tran.
The way spice works is it essentially picks the time step, and then uses
curve fitting to make it fit to your specified time step. This causes huges
errors in Fourier analysis, but it does effect timing edges.

Also to note, in any circuit where you care about rising/falling edges, you
need to insure that you perform simulations at difference size steps. That
is, a large step may be slew limited, i.e. a nonlinear effect, but a small
step is a direct function of bandwidth.



John Larkin

unread,
Aug 12, 2014, 10:08:59 AM8/12/14
to
On Tue, 12 Aug 2014 00:12:37 -0700, miso <mi...@sushi.com> wrote:

>
>Learn something, or don't comment on things you don't understand.

How do you propose to stop me from discussing things here?

>
>> http://www.designers-guide.org/Forum/Attachments/chg-cons.pdf
>
>If your analysis accumulates charge error, such as in cyclic converters, you
>will most certainly see the charge conservation errors.

>
>There are charge conserved models, but the way spice works, the net effect
>is charge will not be conserved perfectly.

Charge isn't conserved perfectly in a real circuit. It seldom matters.


I am talking about quality
>circuits, not the kind you design.

I design interesting stuff and sell it. It's fun. People like our products
enough to buy more, and occasionally give us awards. If you have other standards
for success, well, enjoy.


>
>As I had already mentioned, you should use the 4 parameters on the .tran.
>The way spice works is it essentially picks the time step, and then uses
>curve fitting to make it fit to your specified time step. This causes huges
>errors in Fourier analysis, but it does effect timing edges.

Affect, not effect.

Charging an ideal capacitor from an ideal current source doesn't sound like it
strains LT Spice's default settings.

>
>Also to note, in any circuit where you care about rising/falling edges, you
>need to insure that you perform simulations at difference size steps. That
>is, a large step may be slew limited, i.e. a nonlinear effect, but a small
>step is a direct function of bandwidth.

Now you're being silly.

Jim Thompson

unread,
Aug 12, 2014, 11:02:41 AM8/12/14
to
"Silly" isn't an adequate descriptor for miso, "ignorant" is more
appropriate.

John Larkin

unread,
Aug 12, 2014, 11:08:34 AM8/12/14
to
He's trying to be obnoxious without the requisite skills.

Jim Thompson

unread,
Aug 12, 2014, 1:30:58 PM8/12/14
to
On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
<jjla...@highNOTlandTHIStechnologyPART.com> wrote:

>
>
>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>
>I need to do that a lot, as I tweak other things. I can do it manually on the
>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>electrical, the other a simulated optical waveform.
>
>I could fake some sort of window comparators, which would at least be a little
>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>to 90% of the waveforms that I care about
>
>I want two big red 7-segment LED displays that show the rise times.

See...

RisetimeMeasurement.pdf

on the Simulation Tools & Macros Page of my website.

Jim Thompson

unread,
Aug 12, 2014, 2:17:55 PM8/12/14
to
On Tue, 12 Aug 2014 10:30:58 -0700, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
><jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>
>>
>>
>>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>>
>>I need to do that a lot, as I tweak other things. I can do it manually on the
>>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>>electrical, the other a simulated optical waveform.
>>
>>I could fake some sort of window comparators, which would at least be a little
>>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>>to 90% of the waveforms that I care about
>>
>>I want two big red 7-segment LED displays that show the rise times.
>
>See...
>
> RisetimeMeasurement.pdf
>
>on the Simulation Tools & Macros Page of my website.
>
> ...Jim Thompson

RealPulse.pdf

has been added to my Simulation Tools & Macros Page to clear up some
questions that are sure to follow.

John Larkin

unread,
Aug 12, 2014, 2:48:23 PM8/12/14
to
On Tue, 12 Aug 2014 11:17:55 -0700, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Tue, 12 Aug 2014 10:30:58 -0700, Jim Thompson
><To-Email-Use-Th...@On-My-Web-Site.com> wrote:
>
>>On Sat, 09 Aug 2014 12:03:33 -0700, John Larkin
>><jjla...@highNOTlandTHIStechnologyPART.com> wrote:
>>
>>>
>>>
>>>Got a suggestion for making 10/90 risetime measurements in LT Spice?
>>>
>>>I need to do that a lot, as I tweak other things. I can do it manually on the
>>>waveform plot, but that's a nuisance. I have two waveforms of interest, one
>>>electrical, the other a simulated optical waveform.
>>>
>>>I could fake some sort of window comparators, which would at least be a little
>>>easier to measure on the plot. Or maybe make some linear ramps that run from 10%
>>>to 90% of the waveforms that I care about
>>>
>>>I want two big red 7-segment LED displays that show the rise times.
>>
>>See...
>>
>> RisetimeMeasurement.pdf
>>
>>on the Simulation Tools & Macros Page of my website.
>>
>> ...Jim Thompson
>
> RealPulse.pdf
>
>has been added to my Simulation Tools & Macros Page to clear up some
>questions that are sure to follow.
>
> ...Jim Thompson

I just use an LT Spice pulse generator and add an LC lowpass filter if
I want to soften the corners.

Jim Thompson

unread,
Aug 12, 2014, 3:06:57 PM8/12/14
to
That works, but the drawback is it must be tailored to each
application. In my RealPulse component, you just set VL, VH, TD, TR,
TF, PW and PER like you would with the "classic" VPULSE.

In addition it actually sets TR and TF as the 10%-90% value, not
0%-100% as in the "classic" VPULSE, and you don't have to subtract off
TR/TF from PW as in the "classic" VPULSE.

In other words the "classic" VPULSE sucks >:-}

All my extra custom component creations are to bring Spice simulations
as close as possible to real world.

My personal symbol library in PSpice, Mylib.slb, contains 871
personalized symbols, most with customized functionality.

I addition I've modified some other symbol libraries that come with
PSpice to meet my own needs... not exactly a Kosher thing to do, if I
were still updating, but I'm not... Cadence updates for the PSpice
simulator are mostly worthless, AND costly to boot.

John Larkin

unread,
Aug 12, 2014, 4:30:59 PM8/12/14
to
On Tue, 12 Aug 2014 12:06:57 -0700, Jim Thompson
I don't Spice nearly as much as you do, and I want to keep things
simple, preferably everything in one .asc file and all plainly
visible. That's one reason I like to make things out of parts, and not
out of text.

Updates to LT Spice are relatively inexpensive.

Jim Thompson

unread,
Aug 12, 2014, 4:45:27 PM8/12/14
to
On Tue, 12 Aug 2014 13:30:59 -0700, John Larkin
What is shown in the upper left of...

<http://www.analog-innovations.com/RealPulse.pdf>

is what appears on the schematic... as you can plainly see on the
first page of...

<http://www.analog-innovations.com/RisetimeMeasurement.pdf>

The first link just shows a symbol library shot of my pulse generator.

It's not "out of text".

Keeping "everything in one .asc file" is poor practice... I've had
several clients now who can't send me a readable .asc because of the
way LTspice sets up symbol calls.

Someday you _may_ become Spice-literate >:-}

John Larkin

unread,
Aug 12, 2014, 6:08:12 PM8/12/14
to
On Tue, 12 Aug 2014 13:45:27 -0700, Jim Thompson
Looks like a lot of text to me.

>
>Keeping "everything in one .asc file" is poor practice... I've had
>several clients now who can't send me a readable .asc because of the
>way LTspice sets up symbol calls.

Symbol calls? I haven't had that problem. How is putting a design into
multiple files reliable than putting it in one file?

>
>Someday you _may_ become Spice-literate >:-}


As I said, I don't simulate a lot. What I do simulate works just fine.

Some day you may become FPGA literate. But probably not.

Jim Thompson

unread,
Aug 12, 2014, 6:27:29 PM8/12/14
to
On Tue, 12 Aug 2014 15:08:12 -0700, John Larkin
Have you looked at the netlist of one of your .asc schematics ??

>
>>
>>Keeping "everything in one .asc file" is poor practice... I've had
>>several clients now who can't send me a readable .asc because of the
>>way LTspice sets up symbol calls.
>
>Symbol calls? I haven't had that problem. How is putting a design into
>multiple files reliable than putting it in one file?

Bulk. If every one of my schematics contained also each symbol I'd
probably need a 100X sized hard-drive.

>
>>
>>Someday you _may_ become Spice-literate >:-}
>
>
>As I said, I don't simulate a lot. What I do simulate works just fine.
>
>Some day you may become FPGA literate. But probably not.

FPGA programming is not exactly rocket science >:-}

Jim Thompson

unread,
Aug 12, 2014, 6:30:10 PM8/12/14
to
On Tue, 12 Aug 2014 15:27:29 -0700, Jim Thompson
Missed making one comment. If I want to send a PSpice schematic to
someone who doesn't have my libraries, there's a tool that will
package ONLY the needed files so the client can read them.

That's one of many tools that LTspice lacks.

John Larkin

unread,
Aug 12, 2014, 7:24:23 PM8/12/14
to
On Tue, 12 Aug 2014 15:30:10 -0700, Jim Thompson
If you want to buy a hammer with LED illumination, LCD force readout,
lithium battery pack, and wifi, go for it. My old wooden hammer drives
nails just fine.

And LT Spice lets me simulate latchup-free blinker circuits.

rickman

unread,
Aug 12, 2014, 8:00:10 PM8/12/14
to
On 8/9/2014 3:03 PM, John Larkin wrote:
>
>
> Got a suggestion for making 10/90 risetime measurements in LT Spice?
>
> I need to do that a lot, as I tweak other things. I can do it manually on the
> waveform plot, but that's a nuisance. I have two waveforms of interest, one
> electrical, the other a simulated optical waveform.
>
> I could fake some sort of window comparators, which would at least be a little
> easier to measure on the plot. Or maybe make some linear ramps that run from 10%
> to 90% of the waveforms that I care about
>
> I want two big red 7-segment LED displays that show the rise times.

Did you ever get your automatic rise time measurement?

--

Rick

John Larkin

unread,
Aug 13, 2014, 3:23:04 PM8/13/14
to
This isn't bad:

https://dl.dropboxusercontent.com/u/53724080/Circuits/Timing/Rise_Time.jpg

I put the cursor on the red plateau, and the voltage is equivalent to
risetime in ns. That's faster and more precise than drawing a 10/90
box and reading delta-t.

It would be nice to have a "DVM" that displays a computed value
somewhere.
0 new messages