On Sat, 26 Apr 2003 21:18:05 -0000, you wrote:
Hello Jon,
please take a look(pobe) at your pulse source in LTSPICE.
If you specify tr=0 and tf=0, then LTSPICE takes a guess about
the rise and fall time of 10% or something like that.
10%!! Egads. Okay. I see it! Thanks.
The effective duty cycle in SPICE is always
d = ((trise+tfall)/2 + twidth)/Tperiod
You assumed only twidth/Tperiod .
Now it's obvious that the average voltage is different, because of
the definitions.
Okay. I can see the issues much more clearly, now.
1. Approach:
If you specify a very small tr and tf of 1ns, then the difference
between both definitions will be very small.
Interesting. I used 1ns and it's much better. Thanks, again.
I also tried dropping in 1ps, 10ps, and 100ps. What a disaster!
The simulation made a total mess of the pulse voltage. I can't
even explain it, but it is definitely wrong. 1ns works. But
that's about it. Is there some threshold here?
Anyway, with 1ns, it leave me within a margin of error I can
tolerate: 1.751mV p-p vs a calculated 1.750mV p-p, which is
fine. It's shifted off by a DC error of 140uV, but that's
probably due to the remaining rise and fall times. ... Ah, yes.
Using t_on of (25us-1ns) and a period of 50us puts it right on
the mark.
Okay. I think I've got the picture, now.
I've got to keep all these details in mind.
2. Approach:
The other possibility is to use a new width value of
T_width_spice = T_width - (t_tise + t_fall)/2
Width specification in SPICE:
____________
/ \
/ \
______/ \________
| |<-- Tw----->| |
Tr Tf
|<---- Tper ---->|
My advice for LTSPICE:
Never specify 0 for tr and tf in LTSPICE. At least use something very
low compared to your width if you want to neglect it.
Yes. That's what I did and it looks pretty good.
I still wonder about why 1-100ps causes it to go crazy. But
whatever the reason, that must be why LT Spice doesn't accept
true square edges being applied. I need to read more about the
details of the calculations used.
Much thanks to you!!!
Jon