risetime in LT Spice

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    
 Click to see the full signature
Reply to
John Larkin
Loading thread data ...

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      | 
 Click to see the full signature
Reply to
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.

--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin

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

...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
Jim Thompson

It's a cinch that you're not going to tell us.

--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin

I should tell _you_ how to measure risetime? ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
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.

--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
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?

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

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
Jim Thompson

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. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
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.
--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin
[about determining 10-to-90 percent 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%

Reply to
whit3rd

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.

Reply to
miso

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                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin

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 
 Click to see the full signature
Reply to
John Larkin

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

Yep.

Within a time accuracy of Tminstep

Yep. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
Jim Thompson

Make that Max Time-step

...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
Jim Thompson

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

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.

Reply to
miso

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

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

I am talking about quality

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.

Affect, not effect.

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

Now you're being silly.

--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin

"Silly" isn't an adequate descriptor for miso, "ignorant" is more appropriate. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
 Click to see the full signature
Reply to
Jim Thompson

He's trying to be obnoxious without the requisite skills.

--
John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    
 Click to see the full signature
Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.