¿ªÔÆÌåÓý

Date

Personal Problem to Link OpAmp with SubCircuit

 

Hello,

I have a problem with new symbol designing!

I'd like to design a simple amplifier circuit with the OpAmp TL071.
For that, I drawed a new symbol: TL071.asy
I set the attribute "Prefix : X"
I also set the attribute "SpiceModel" to the filename TL071.lib, which can be found in the directory C:\Programme\LTSpice\lib\sub\.
In the file TL071.lib, I saved the subcircuit like this:
.SUBCKT TL071 1 2 3 4 5
C1 11 12 3.498E-12
C2 6 7 15.00E-12
DC 5 53 DX
and so on...

Unfortunately, I don't get no circuit with the so-defined TL071 to work.
The error message tells:
"Error: Unknown device type in: xu1 n004 n001 n002 0 n002 tl071"

I think, it is because I didn't clearly define the library file where the TL071 subcircuit is saved. But I don't know no way to define a library in a schematics file.

What could I do to get my circuit with my self-designed OpAmp-Model to work?

Sincerely Yours,

Bernhard
______________________________________________________________________________
UNICEF bittet um Spenden f¨¹r die Kinder im Irak! Hier online an
UNICEF spenden:


Re: monolithic mosfet

 

--- In LTspice@..., Panama Mike <panamatex@y...> wrote:
Norbert,

If I were placing a MOSFET e.g. W=5u L=0.5u , and the length of
the
source and drain implants might be LS=1u LD=1u. LS,LD could be
defined with a .PARAM spice directive.

In some netlisters, the parameters AD AD PD PS NRS NRD can be
calculated automatically, e.g. AD=W*LD PD=2*LD+2*W NRS=LD/W.

Can the LTSpice netlister do this?

I can set .PARAM LD=1u, and I can use it in the "Monolithic
MOSFET"
popup attribute menu, but I can't pick up the device W for the
equation {W*LD} to enter in the AD box.
Yes. There's three ways to do it.

i) If using the nmos4 symbol you get the "Monolithic
MOSFET" dialog box. For length, type in {L}. And
then place a SPICE directive on the schematic such
as .param L=10u or ".step param L list 5u 7u 8u"
ii) How down the control key and right click on the body.
Enter L={L} on one of the attributes, SpiceModel, Value,
Value2, SpiceLine or SpiceLine2. These attribute names
mean nothing. Their values are concatenated for the
netlist.
iii) Move the mouse to the value of the MOSFET and right click.
Edit it to be something like "NM L={L} W={W}"

--Mike


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

Thanks Mike, that does work - but then the parameterization
is valid only for the 1 instance.

Every instance of the MOSFET symbol would need its
own .PARAM statement, and the maths entered manually.

In the end, the only way I could achieve what I wanted
was to copy the 'nmos4' MOSFET symbol, and make it a hierarchical
block 'norbmos4'

I then created a schematic 'norbmos4' for the new symbol, instantiated
an 'nmos4' in it with {L} {W} {M} for L W M and e.g. {LDIF*W} for
AD
etc.

Now I can instantiate any number of 'norbmos4' devices, add
PARAMS 'W=10u L=0.5u M=5' to this schematic block, and one
.PARAM LDIF=1u directive.

All I can say at the moment is that this netlists,and the simulator
doesn't complain - whether it works or not for simulation I don't
know yet.

The downside is that every NMOS device on my schematic is now a
'norbmos' subcircuit containing an 'nmos4'. The upside is that the
typical parasitics should be calculated for me.

On to my second day of using LTSpice .... looks good so far!

Regards,

Norbert.


Re: monolithic mosfet

 

Norbert,

If I were placing a MOSFET e.g. W=5u L=0.5u , and the length of the
source and drain implants might be LS=1u LD=1u. LS,LD could be
defined with a .PARAM spice directive.

In some netlisters, the parameters AD AD PD PS NRS NRD can be
calculated automatically, e.g. AD=W*LD PD=2*LD+2*W NRS=LD/W.

Can the LTSpice netlister do this?

I can set .PARAM LD=1u, and I can use it in the "Monolithic MOSFET"
popup attribute menu, but I can't pick up the device W for the
equation {W*LD} to enter in the AD box.
Yes. There's three ways to do it.

i) If using the nmos4 symbol you get the "Monolithic
MOSFET" dialog box. For length, type in {L}. And
then place a SPICE directive on the schematic such
as .param L=10u or ".step param L list 5u 7u 8u"
ii) How down the control key and right click on the body.
Enter L={L} on one of the attributes, SpiceModel, Value,
Value2, SpiceLine or SpiceLine2. These attribute names
mean nothing. Their values are concatenated for the
netlist.
iii) Move the mouse to the value of the MOSFET and right click.
Edit it to be something like "NM L={L} W={W}"

--Mike


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.


monolithic mosfet

 

If I were placing a MOSFET e.g. W=5u L=0.5u , and the length of the
source and drain implants might be LS=1u LD=1u. LS,LD could be
defined with a .PARAM spice directive.

In some netlisters, the parameters AD AD PD PS NRS NRD can be
calculated automatically, e.g. AD=W*LD PD=2*LD+2*W NRS=LD/W.

Can the LTSpice netlister do this?

I can set .PARAM LD=1u, and I can use it in the "Monolithic MOSFET"
popup attribute menu, but I can't pick up the device W for the
equation {W*LD} to enter in the AD box.

Regards,

Norbert


Re: Publications Dealing with Circuit Simulation & Spice?

 

Dale,

What are some good magazines or journals to watch for info
on circuit simulation, modeling, and SPICE? I can't find
any publication that seems to concentrate on these topics.
For example, the IEEE Journal of Solid State Circuits
published Boyle's paper on opamp macromodeling, but hasn't
had a lot of info on the topic in recent years. What should
I be reading to keep up?
I don't know that there's much published in magazines/journals.
Worldwide, there's very few people who work on SPICE internals
these days. Books a largely a better source. I really like
the 2nd Edition of _Semiconductor Device Modeling with SPICE_
by Giuseppe Massobrio and Paolo Antognetti.

--Mike

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.


Re: setting default Trise and Tfall for special function models

 

--- In LTspice@..., "Rose, Michael (Michael)"
<mrose2@a...> wrote:
I just wanted to pass along a little tip when using DFLOP special
function models. The rise and fall times default to 0 which will
cause incorrect switching when the flops are cascaded. You have to
add a Trise=xx value to the flop's Spiceline. According to the help,
Tfall will default to specified Trise so does not need to be
explicitly specified. Hopefully this might help save a bit of head-
sratching
.
Hello Michael,
I always prefer to specify a delay time for each D-flipflop or any
other digital gate. I don't think that Tr and Tf are necessary if you
already have specified Td.

Example: Td=1ns

Best Regards
Helmut


setting default Trise and Tfall for special function models

Rose, Michael (Michael)
 

¿ªÔÆÌåÓý

I just wanted to pass along a little tip when using DFLOP special function models. The rise and fall times default to 0 which will cause incorrect switching when the flops are cascaded. You have to add a?Trise=xx value?to the flop's Spiceline. According to the help, Tfall will default to specified Trise so does not need to be explicitly specified. Hopefully this might help save a bit of head-sratching.
?
Mike


Re: A question about the modeling in LT Spice -- results <> theory?

 

--- In LTspice@..., Jonathan Kirwan <jkirwan@e...> wrote:
On Wed, 30 Apr 2003 19:41:15 -0000, you wrote:

I tried my own math to get a new formula, because I couldn't
believe
that your formula is correct.
As I said, it seemed a little strange to me, too.

Assume that your period is very long compared to the time Ton.
No need for assumptions. Let's just do the math. Back to the
example, with slightly changed names (taken from my sheet of
notes):

,-- V
|
|
/
&#92; R1
/
|
Rp |
PWM >---/&#92;/&#92;/---x
[0..Vp] |
| C
-----
-----
|
|
gnd

Some definitions are in order:

V: Arbitrary DC voltage supply
Vp: Arbitrary PWM high-side voltage (low-side assumed gnd)
toff: PWM time within cycle, at gnd
ton: PWM time within cycle, at Vp

tcyc = ton + toff
Va = (V * Rp + Vp * R1) / (R1 + Rp)
Vb = V * Rp / (R1 + Rp)
R = R1 * Rp / (R1 + Rp)
k = 1 / (R*C)

Vb - Va*e^(-k*tcyc) + (Va-Vb)*e^(-k*toff)
VnodeLO = -----------------------------------------
1 - e^(-k*tcyc)

Va - Vb*e^(-k*tcyc) + (Vb-Va)*e^(-k*ton)
VnodeHI = ----------------------------------------
1 - e^(-k*tcyc)

I think we are agreed already, up to this point. If not, let me
know.

Okay, now I want to compute the ripple (dI/I) in R1 in the above
circuit. Right?

Given:

VnodeMEAN = (VnodeHI + VnodeLO) / 2
Hello Jon,
be aware that this VnodeMEAN is not the necessary the average of the
signal. It is the middle between the two peaks.


ton = -R*C*ln((2-dI/I)/(2+dI/I))
I was too lazy to follow the whole math.
If you put your Vp=V into my formula it would look like

ton = R*C*dI/I

Your factor ln((2-x)/(2+x)) can be very good approximted by
ln((2-x)/(2+x)) = -x
Even for x = 0.5, the error is only 2%.

If I apply that to your formula, I will get:

ton = R*C*dI/I

So both formulas are very equal.

Thanks for your exact calculation.

Best Regards
Helmut


(No subject)

Arnold Esper
 

Hello Steve,

thanks for this fine example of using the rand-function.

Arnold
*
*

Mike, I found your use of the RAND function for Monte Carlo a very
interesting work around. In using this approch it looks like the
value generated by RAND repeats each time the simulation is run. It
also appears that the RAND function is biased more towards 1 than 0
based on purely casual observation. I also figured out (duh) that
you want to space the seed numbers choosen for RAND further apart
than the number of random points being used to maximize independance.

To others in the the group, here is a very simple sample circuit
using the RAND fuction to perform a tolerance study. I modified
Mike's approach to make it a little easier to identify what is being
done and set the tolerance to calculate +/- the desired tolerance.
You may need to take care of the word wrap on the last line to
eliminate the extra line feed, depending on how you cut and paste.

Version 4
SHEET 1 1340 680
WIRE -80 256 -80 144
WIRE -80 144 64 144
WIRE 64 144 64 256
WIRE 64 336 64 448
WIRE 64 448 -16 448
WIRE -80 448 -80 336
WIRE -16 464 -16 448
WIRE -16 448 -80 448
FLAG -16 464 0
FLAG 64 144 Out
SYMBOL C:&#92;Program&#92; Files&#92;LTC&#92;SwCADIII&#92;lib&#92;sym&#92;res 48 240 R0
SYMATTR InstName R1
SYMATTR Value {R1calc}
SYMBOL C:&#92;PROGRA~1&#92;LTC&#92;SwCADIII&#92;lib&#92;sym&#92;current -80 336 R180
WINDOW 0 24 88 Left 0
WINDOW 3 24 0 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName I1
SYMATTR Value 1
TEXT 160 184 Left 0 !.param R1calc={R1*(1+2*Tol*(RAND(X)-1/2))}
TEXT 160 208 Left 0 !.step param X 1 200 1
TEXT 160 160 Left 0 !.param Tol=0.1; +/-10% tolerance
TEXT 160 136 Left 0 !.param R1=1000
TEXT 160 232 Left 0 !.op
TEXT 160 320 Left 0 ;Select V(Out) when simulation starts. It
should be 1V +/- 100mV


Publications Dealing with Circuit Simulation & Spice?

Dale
 

What are some good magazines or journals to watch for info on circuit
simulation, modeling, and SPICE? I can't find any publication that
seems to concentrate on these topics. For example, the IEEE Journal
of Solid State Circuits published Boyle's paper on opamp
macromodeling, but hasn't had a lot of info on the topic in recent
years. What should I be reading to keep up?

Thanks for your suggestions
Dale


Re: A question about the modeling in LT Spice -- results <> theory?

Jonathan Kirwan
 

On Wed, 30 Apr 2003 19:41:15 -0000, you wrote:

I tried my own math to get a new formula, because I couldn't believe
that your formula is correct.
As I said, it seemed a little strange to me, too.

Assume that your period is very long compared to the time Ton.
No need for assumptions. Let's just do the math. Back to the
example, with slightly changed names (taken from my sheet of
notes):

,-- V
|
|
/
&#92; R1
/
|
Rp |
PWM >---/&#92;/&#92;/---x
[0..Vp] |
| C
-----
-----
|
|
gnd

Some definitions are in order:

V: Arbitrary DC voltage supply
Vp: Arbitrary PWM high-side voltage (low-side assumed gnd)
toff: PWM time within cycle, at gnd
ton: PWM time within cycle, at Vp

tcyc = ton + toff
Va = (V * Rp + Vp * R1) / (R1 + Rp)
Vb = V * Rp / (R1 + Rp)
R = R1 * Rp / (R1 + Rp)
k = 1 / (R*C)

Vb - Va*e^(-k*tcyc) + (Va-Vb)*e^(-k*toff)
VnodeLO = -----------------------------------------
1 - e^(-k*tcyc)

Va - Vb*e^(-k*tcyc) + (Vb-Va)*e^(-k*ton)
VnodeHI = ----------------------------------------
1 - e^(-k*tcyc)

I think we are agreed already, up to this point. If not, let me
know.

Okay, now I want to compute the ripple (dI/I) in R1 in the above
circuit. Right?

Given:

VnodeMEAN = (VnodeHI + VnodeLO) / 2

InodeLO = (V - VnodeLO) / R1

InodeHI = (V - VnodeHI) / R1

InodeMEAN = (V - VnodeMEAN) / R1

Then:

dI/I = (InodeLO - InodeHI) / InodeMEAN

(V - VnodeLO) / R1 - (V - VnodeHI) / R1
dI/I = ---------------------------------------
(V - (VnodeHI+VnodeLO)/2) / R1

(V - VnodeLO) - (V - VnodeHI)
dI/I = -----------------------------
V - (VnodeHI+VnodeLO)/2

VnodeHI - VnodeLO
dI/I = -----------------------
V - (VnodeHI+VnodeLO)/2

2 * (VnodeHI - VnodeLO)
dI/I = -------------------------
2 * V - VnodeHI - VnodeLO

Okay, that's my definition for dI/I. Now, what I'd like to do
is to insist that this dI/I be under some threshold, as in:

dI/I <= RIPPLE

So, since I have exact expressions for VnodeHI and VnodeLO,
let's substitute those exact expressions and solve. I'll
proceed quickly, so I won't show all the work (too much typing,
frankly.) But if you disagree with any, just yell at me:

dV(R1) = VnodeHI - VnodeLO

1 + e^(-k*tcyc) - e^(-k*ton) - e^(-k*toff)
= (Va - Vb) * ------------------------------------------
1 - e^(-k*tcyc)

Also,

2*Vmean = VnodeHI + VnodeLO

(Va+Vb)*(1-e^(-k*tcyc))+(Va-Vb)*(e^(-k*toff)-e^(-k*ton))
= --------------------------------------------------------
1 - e^(-k*tcyc)

Before getting back to the dI/I equation, some short-hand might
help keep this smaller:

k0 = e^(-k*tcyc)
k1 = e^(-k*ton)
k2 = e^(-k*toff)

and since tcyc = ton + toff:

k2 = k0 / k1

So, substituting the above pieces:

1 + k0 - k1 - k0/k1
2 * (Va - Vb) * -------------------
1 - k0
dI/I = -----------------------------------------------------
(Va + Vb)*(1 - k0) + (Va - Vb)*(k0/k1 - k1)
2 * V - -------------------------------------------
1 - k0


2 * (Va - Vb) * (1 + k0 - k1 - k0/k1)
dI/I = -------------------------------------------------
(2*V - Va - Vb)*(1 - k0) - (Va - Vb)*(k0/k1 - k1)

Here's where the new twist comes in, which I didn't mention in
my earlier post. It's simply that my V is set to the same value
as my Vp. In this case, then, V = Vp = Va.

So, we have:

2 * (Va - Vb) * (1 + k0 - k1 - k0/k1)
dI/I = --------------------------------------------------
(2*Va - Va - Vb)*(1 - k0) - (Va - Vb)*(k0/k1 - k1)


2 * (Va - Vb) * (1 + k0 - k1 - k0/k1)
dI/I = -------------------------------------------
(Va - Vb)*(1 - k0) - (Va - Vb)*(k0/k1 - k1)


2 * (Va - Vb) * (1 + k0 - k1 - k0/k1)
dI/I = -------------------------------------
(Va - Vb) * (1 - k0 - k0/k1 + k1)


2 * (1 + k0 - k1 - k0/k1)
dI/I = -------------------------
(1 - k0 - k0/k1 + k1)


2 * (k1 + k0*k1 - k1^2 - k0)
dI/I = ----------------------------
k1 - k0*k1 - k0 + k1^2


2 * (k1 - 1) * (k0 - k1)
dI/I = ------------------------
(-k1 - 1) * (k0 - k1)


2 * (1 - k1)
dI/I = ------------
1 + k1

That little assumption removes a lot from here. There's no k0!!
It's gone! The solution for k1 is then this obvious result:

2 - dI/I
k1 = --------
2 + dI/I

Of course, we can now substitute for k1, again:

2 - dI/I
e^(-k*ton) = --------
2 + dI/I

Or,

ton = -(1/k) * ln((2-dI/I)/(2+dI/I))

Or...

ton = -R*C*ln((2-dI/I)/(2+dI/I))

Which was my original assertion. The PWM cycle time just
disappears.

Of course, all this assumes that V = Vp. A not-uncommon
situation.

Interesting?

Jon


Re: A question about the modeling in LT Spice -- results <> theory?

Jonathan Kirwan
 

On Wed, 30 Apr 2003 19:41:15 -0000, you wrote:

--- In LTspice@..., Jonathan Kirwan <jkirwan@e...> wrote:
On Sun, 27 Apr 2003 00:50:31 -0000, Helmut wrote:

Hello Jon,
sorry that I forgot to tell you that I assumed 50% duty cycle. The
absolute voltage ripple is at maximum for the 50% and thus it is a
good formula for the worst case ripple estimation.

My Vp' has been your (Va-Vb).
Hi. I've played around with this on paper for a bit, this
morning. What came out is interesting, I think. Here's that
circuit, again:

,-- V
|
|
/
&#92; R1
/
|
R2 | [Vnode]
PWM >---/&#92;/&#92;/---x
|
| C1
-----
-----
|
|
gnd

I'm actually looking at the ripple across R1 as a percentage of
that voltage, ((VnodeHI-VnodeLO)/(V-VnodeMEAN)). What's
important to me isn't (VnodeHI-VnodeLO)/VnodeMEAN or the
absolute magnitude of (VnodeHI-VnodeLO).

This is because I'm playing with a design for a PWM-driven
two-quadrant current source/sink for a pin-driver. The
important element is the current through R1 and I need to
control the current noise below some arbitrary limit I set.
Things get better for me as Vnode gets closer to ground. What's
worrisome to me is what happens as I let Vnode get close to V,
since although the ripple voltage is declining some as V is
approached, the (V-VnodeMEAN) is also declining rapidly, as
well.

Your equation, which simplifies itself using the worst case
situation for dV, could be used to estimate the largest ON time
for the PWM. But it's overly aggressive for my use. It turns
out that the exact solution, using full exponentials without
approximations, yields a surprisingly simple resulting equation
which is exact, as well as simple.

If you remember, the exact form, before simplifying to yours is:

1+e^(-tcyc/(R*C))-e^(-ton/(R*C))-e^(-toff/(R*C))
dV = (Va-Vb) * ------------------------------------------------
1 - e^(-tcyc/(R*C))

If I specify a maximum RIPPLE in (dV/V) [or (dI/I), I suppose],
what I'd like to do is find the largest "ton" time, where:

RIPPLE >= dV / (V - VnodeMEAN)

It turns out that it is:

ton <= -R*C*ln((2-RIPPLE)/(2+RIPPLE))

Quite a bizarre result, when I first saw it:

It suggests that the on-time for my use is independent of the
PWM cycle time!

Hello Jon,
I tried my own math to get a new formula, because I couldn't believe
that your formula is correct.
It's remained true in my explorations. I'll send you some BASIC
code, if you'd like, which doesn't rely on my development but
uses numerical methods applied to basic principles. Neat.

I think it's a matter of talking at cross-purposes, though. I
don't have time, right now, to document my steps. But they are
on paper and I can translate them, later on today. I'll also
get a chance then to more carefully read your post and reply.
This is just a quick one to say that I've seen what you've
written.

By the way, while the ton time remains set by the unitless
ripple error and the RC time constant, independent of PWM cycle
time, the minimum current allowed is still a function of both of
these. I didn't mean to imply that.

Thanks very much for your considerations in all this and I will
get my calcs out, for you.

Until later on (perhaps three or four hours from now),
Jon


Re: A question about the modeling in LT Spice -- results <> theory?

 

--- In LTspice@..., Jonathan Kirwan <jkirwan@e...> wrote:
On Sun, 27 Apr 2003 00:50:31 -0000, Helmut wrote:

Hello Jon,
sorry that I forgot to tell you that I assumed 50% duty cycle. The
absolute voltage ripple is at maximum for the 50% and thus it is a
good formula for the worst case ripple estimation.

My Vp' has been your (Va-Vb).
Hi. I've played around with this on paper for a bit, this
morning. What came out is interesting, I think. Here's that
circuit, again:

,-- V
|
|
/
&#92; R1
/
|
R2 | [Vnode]
PWM >---/&#92;/&#92;/---x
|
| C1
-----
-----
|
|
gnd

I'm actually looking at the ripple across R1 as a percentage of
that voltage, ((VnodeHI-VnodeLO)/(V-VnodeMEAN)). What's
important to me isn't (VnodeHI-VnodeLO)/VnodeMEAN or the
absolute magnitude of (VnodeHI-VnodeLO).

This is because I'm playing with a design for a PWM-driven
two-quadrant current source/sink for a pin-driver. The
important element is the current through R1 and I need to
control the current noise below some arbitrary limit I set.
Things get better for me as Vnode gets closer to ground. What's
worrisome to me is what happens as I let Vnode get close to V,
since although the ripple voltage is declining some as V is
approached, the (V-VnodeMEAN) is also declining rapidly, as
well.

Your equation, which simplifies itself using the worst case
situation for dV, could be used to estimate the largest ON time
for the PWM. But it's overly aggressive for my use. It turns
out that the exact solution, using full exponentials without
approximations, yields a surprisingly simple resulting equation
which is exact, as well as simple.

If you remember, the exact form, before simplifying to yours is:

1+e^(-tcyc/(R*C))-e^(-ton/(R*C))-e^(-toff/(R*C))
dV = (Va-Vb) * ------------------------------------------------
1 - e^(-tcyc/(R*C))

If I specify a maximum RIPPLE in (dV/V) [or (dI/I), I suppose],
what I'd like to do is find the largest "ton" time, where:

RIPPLE >= dV / (V - VnodeMEAN)

It turns out that it is:

ton <= -R*C*ln((2-RIPPLE)/(2+RIPPLE))

Quite a bizarre result, when I first saw it:

It suggests that the on-time for my use is independent of the
PWM cycle time!

Hello Jon,
I tried my own math to get a new formula, because I couldn't believe
that your formula is correct.

Assume that your period is very long compared to the time Ton.
The capacitor will be charged to a voltage of
dV=Ton*Vp*(R1/(R1+R2)/(R1*R2/(R1+R2)*C) = Ton*Vp/(R2*C). Now assume a
very long period so that the capacitor will be discharged totally.
I believe this is the worst case.
The voltage dV is then the total ripple voltage too. Let's further
assume the mean voltage drop V1 on R1: V1 = V*R1/(R1+R2).
This is because I assumed a Ton/Tcyc << 1 is worst case.

So we get:
RIPPLE = dv/V1 = Ton*Vp/(R2*C) / (V*R1/(R1+R2))

RIPPLE = Vp/V * Ton/(R*C)

Ton = R*C * RIPPLE * V/Vp
-------------------------
or
Ton <= R*C * RIPPLE * V/Vp as the upper limit

Example: R*C=1ms Ripple=0.01 Vp=14, V=5
Ton < 0.001*0.01*5/14 = 3.6us


Some comment to your formula:
Ton = 1ms*0.01 = 10us

My simulation shows that my 3.6us are correct. So your formula
seems to be wrong.

Anyway it was a nice exercise for me and still a surprising result.
I always check formulas with simulations/numerical calculations.

Best Regards
Helmut


Re: A question about the modeling in LT Spice -- results <> theory?

Jonathan Kirwan
 

On Sun, 27 Apr 2003 00:50:31 -0000, Helmut wrote:

Hello Jon,
sorry that I forgot to tell you that I assumed 50% duty cycle. The
absolute voltage ripple is at maximum for the 50% and thus it is a
good formula for the worst case ripple estimation.

My Vp' has been your (Va-Vb).
Hi. I've played around with this on paper for a bit, this
morning. What came out is interesting, I think. Here's that
circuit, again:

,-- V
|
|
/
&#92; R1
/
|
R2 | [Vnode]
PWM >---/&#92;/&#92;/---x
|
| C1
-----
-----
|
|
gnd

I'm actually looking at the ripple across R1 as a percentage of
that voltage, ((VnodeHI-VnodeLO)/(V-VnodeMEAN)). What's
important to me isn't (VnodeHI-VnodeLO)/VnodeMEAN or the
absolute magnitude of (VnodeHI-VnodeLO).

This is because I'm playing with a design for a PWM-driven
two-quadrant current source/sink for a pin-driver. The
important element is the current through R1 and I need to
control the current noise below some arbitrary limit I set.
Things get better for me as Vnode gets closer to ground. What's
worrisome to me is what happens as I let Vnode get close to V,
since although the ripple voltage is declining some as V is
approached, the (V-VnodeMEAN) is also declining rapidly, as
well.

Your equation, which simplifies itself using the worst case
situation for dV, could be used to estimate the largest ON time
for the PWM. But it's overly aggressive for my use. It turns
out that the exact solution, using full exponentials without
approximations, yields a surprisingly simple resulting equation
which is exact, as well as simple.

If you remember, the exact form, before simplifying to yours is:

1+e^(-tcyc/(R*C))-e^(-ton/(R*C))-e^(-toff/(R*C))
dV = (Va-Vb) * ------------------------------------------------
1 - e^(-tcyc/(R*C))

If I specify a maximum RIPPLE in (dV/V) [or (dI/I), I suppose],
what I'd like to do is find the largest "ton" time, where:

RIPPLE >= dV / (V - VnodeMEAN)

It turns out that it is:

ton <= -R*C*ln((2-RIPPLE)/(2+RIPPLE))

Quite a bizarre result, when I first saw it:

It suggests that the on-time for my use is independent of the
PWM cycle time!

What?? Yes! For my needs, my limit on ripple amounts to
specifying the longest possible on-time for the PWM, whatever
the PWM period might be. This is true, as calculations appear
to bear out. A shorter PWM period simply means that my ripple
requirement will always be met, no matter the duty cycle. A
longer PWM period means I need to be careful not to exceed this
on-time. Frankly, I have to admit that my intuition didn't tell
me this result, beforehand.

Anyway, there it is. If you want to, see if you can derive this
same result or else tell me why it should have been obvious to
me without the math involved. I'd be happy to learn new
intuitive viewpoints -- I'm still working this through my mind,
this morning, and I expect at some point I'll see the "Ah, so
that's why." But I wouldn't mind getting that point sooner, if
you can point out the obvious path for me. (I'll also show my
math work, if you'd like.)

Jon


typo in LT Spice dialog

Jonathan Kirwan
 

The "Edit Simulation Command" dialog box says:

"Maximun Timestep:"

where it should say:

"Maximum Timestep:"

Jon


Thanks Mike and Helmut

 

Thanks for the help on the Table format. It is nice to get this kind
of help and support.


Re: A question about the modeling in LT Spice -- results <> theory?

Jonathan Kirwan
 

On Sun, 27 Apr 2003 00:50:31 -0000, you wrote:

sorry that I forgot to tell you that I assumed 50% duty cycle. The
absolute voltage ripple is at maximum for the 50% and thus it is a
good formula for the worst case ripple estimation.

My Vp' has been your (Va-Vb).
Well, it all makes sense and it feels nice when everything goes
together neatly and well. Probably all of this should go onto a
web page or two, somewhere, with all the supporting work shown
for those who are interested in the derivations.

Jon


Re: A question about the modeling in LT Spice -- results <> theory?

 

--- In LTspice@..., Jonathan Kirwan <jkirwan@e...> wrote:
On Sat, 26 Apr 2003 22:18:02 -0000, you wrote:
....
Since Tau=R*C and tcyc=Tpwm, this turns into:

dV = (1/4) * (Va - Vb) * Tpwm / Tau

Which looks a heck of a lot like your:

Vpp = 0.25 * Vp' * Tpwm / Tau
However, this makes explicit and clear that there is one more
assumption playing into this, than just Tau >> Tpwm; namely,
that it also assumes that ton=toff and thus that the PWM duty
cycle is 50%. Which is an "average assumption."
Hello Jon,
sorry that I forgot to tell you that I assumed 50% duty cycle. The
absolute voltage ripple is at maximum for the 50% and thus it is a
good formula for the worst case ripple estimation.

My Vp' has been your (Va-Vb).

Best Reagrds
Helmut


Re: A question about the modeling in LT Spice -- results <> theory?

Jonathan Kirwan
 

On Sat, 26 Apr 2003 22:18:02 -0000, you wrote:

I have tried your 1ps too. It's really wrong with
.tran 0.1 for example.

It is simulated correctly, if you specify a minimum step size like
.tran 0 0.1 0 1u .
Yes, I see. Thanks. So it's just a matter of "being too dumb"
about what's been specified. It's up to me to tinker a little.
Small price to pay.

------------------------------------------------------------------
By the way, I have a nice approximation formula for the PWM ripple
voltage:

Vpp = 0.25 * Vp' * Tpwm / Tau

Vp' = Voltage pulse at the output without capacitor(C=0) and with
zero bias voltage(V=0V). Vp' = Vp * R1/(R1+R2)
Tau = C * (R1*R2)/(R1+R2)
Tpwm = period of the PWM
My RC is your tau and my tcyc is your Tpwm. I'm not quite sure
what your Vp' is, though. Is it my Va or my Vb or something
else?

But here's my derivation. Let's see...

1+e^(-tcyc/(R*C))-e^(-ton/(R*C))-e^(-toff/(R*C))
dV = (Va-Vb) * ------------------------------------------------
1 - e^(-tcyc/(R*C))

Using Taylor's for a first-order estimate, it comes out to:

dV = (Va - Vb) * 0

Which definitely isn't right, so taking it out to the next order
of Taylor's yields:

tcyc^2 - ton^2 - toff^2
dV = (Va - Vb) * -----------------------
tcyc * (tcyc + 2*R*C)

Which seems pretty darned close to right.

Ah!! Now it dawns on me! Your Vp' is my (Va - Vb)! Here's
why:

Looking at the above 2nd-order Taylor's estimate, the
denominator has the factor, (tcyc + 2*R*C). But since we are
assuming that RC >> tcyc, which should be true if we are doing
our job in filtering, then (tcyc + 2*R*C) is about 2*R*C. No
point bothering to add in a disappearing tcyc, so just drop it.
That leaves us with:

tcyc^2 - ton^2 - toff^2
dV = (Va - Vb) * -----------------------
tcyc * 2*R*C

so,

| tcyc ton ton toff toff |
dV = (Va - Vb) * | ---- - ---- * --- - ---- * ---- |
| 2RC tcyc 2RC tcyc 2RC |

Still a little messy, but let's assume that ton is about 1/2 of
tcyc (and so is toff, then.) In this case, it becomes:

| tcyc 1 1/2*tcyc 1 1/2*tcyc |
dV = (Va - Vb) * | ---- - --- * -------- - --- * -------- |
| 2RC 2 2RC 2 2RC |

so,

| tcyc 1 tcyc |
dV = (Va - Vb) * | ---- - --- * ---- |
| 2RC 2 2RC |

or,

| 1 tcyc | 1 tcyc
dV = (Va - Vb) * | --- * ---- | = --- * (Va - Vb) * ----
| 2 2RC | 4 R*C

or,

dV = (Va - Vb) * tcyc / (4*R*C)

Since Tau=R*C and tcyc=Tpwm, this turns into:

dV = (1/4) * (Va - Vb) * Tpwm / Tau

Which looks a heck of a lot like your:

Vpp = 0.25 * Vp' * Tpwm / Tau
However, this makes explicit and clear that there is one more
assumption playing into this, than just Tau >> Tpwm; namely,
that it also assumes that ton=toff and thus that the PWM duty
cycle is 50%. Which is an "average assumption."

Thanks, again!

Jon


Re: A question about the modeling in LT Spice -- results <> theory?

 

--- In LTspice@..., Jonathan Kirwan <jkirwan@e...> wrote:
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:
____________
/ &#92;
/ &#92;
______/ &#92;________

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

Hello John,
I have tried your 1ps too. It's really wrong with
.tran 0.1 for example.

It is simulated correctly, if you specify a minimum step size like
.tran 0 0.1 0 1u .


------------------------------------------------------------------
By the way, I have a nice approximation formula for the PWM ripple
voltage:

Vpp = 0.25 * Vp' * Tpwm / Tau

Vp' = Voltage pulse at the output without capacitor(C=0) and with
zero bias voltage(V=0V). Vp' = Vp * R1/(R1+R2)
Tau = C * (R1*R2)/(R1+R2)
Tpwm = period of the PWM

Best Regards
Helmut