Discussion:
[Help-gnucap] Yet another newbie question
Johannes Bauer
2008-07-09 13:23:06 UTC
Permalink
Hello list,

well, I'm stuck with yet anther (probably) ridiculously easy problem. As
you may have seen in my last post, I'm currently just using RC
components - which gets boring fast ;-)

Now I wanted to use a diode, for example. However I have to specify a
model as a value - now one really silly question is: How do I find out
what models are available for diodes? I tried some standard values like
1N4001 and 1N914 none of which were recognized.

Is there also a way to use operational amplifiers? I'd guess that would
be the "U: Logic Device" family in analog mode, but again - the problem
with knowing which models are supported. Tried the LM324, but no luck again.

Thanks for your patience...
Kind regards,
Johannes
al davis
2008-07-09 16:00:23 UTC
Permalink
Post by Johannes Bauer
Now I wanted to use a diode, for example. However I have to
specify a model as a value - now one really silly question
is: How do I find out what models are available for diodes? I
tried some standard values like 1N4001 and 1N914 none of
which were recognized.
If you need to ask that question, you probably can get by with
just guessing. Just make a model statement taking the
defaults:

.model 1n4001 d

If you need a little more accuracy than that, adjust the
parameter IS to get the expected forward voltage.

As you get more advanced, you can look on the web for specific
models. Google for "1n4001 spice model" and see what you find.
It should ultimately lead you to something of the form:

.model 1N4001 D (and a bunch of name-value pairs)

You could just use that, but if you want that kind of detail you
should look at several to see how much they vary.

Usually, most Spice models work with gnucap, but it cannot be
guraranteed.

There are so many devices, from so many vendors, that it is
impossible to keep track of them all.
Post by Johannes Bauer
Is there also a way to use operational amplifiers? I'd guess
that would be the "U: Logic Device" family in analog mode,
but again - the problem with knowing which models are
supported. Tried the LM324, but no luck again.
No .. the "U" is not an op-amp.

Op-amps are more complex devices, so you need to decide what
kind of model you want.

If you need to ask, you can probably get by with a very simple
model. Use a voltage controlled voltage source (VCVS, type E).

Eop (out1 0 in+ in-) 10000

If you need to model clipping, use the "tanh" behavioral
modeling function to specify open loop gain and clip voltage.

Eop (out1 0 in+ in1) tanh(10000, 12)

If you need something a little better, make a subckt with two
controlled sources and a dominant pole. If you don't know how
to do this, the VCVS is probably all you need.

If you need better, google for a spice model. (or in the
future .. Verilog-A model) .. Op-amp models are usually
subcircuits, designed for a particular variant of Spice. Some
work, some don't. The only way to know is to try it. These
models have lots more detail. If you are just beginning, you
are better off without it.
Johannes Bauer
2008-07-13 12:30:17 UTC
Permalink
I keep responding to your mail address, Al - sorry about that, I didn't
realize (yet again) the mailing list doesn't set the Reply-To field.
Post by al davis
Usually, most Spice models work with gnucap, but it cannot be
guraranteed.

Oh okay, I didn't realize this. Thanks a lot for the pointer.
Post by al davis
If you need better, google for a spice model. (or in the future ..
Verilog-A model) .. Op-amp models are usually subcircuits, designed
for a particular variant of Spice. Some work, some don't. The only way
to know is to try it. These models have lots more detail. If you are
just beginning, you are better off without it.

In future development, when I have adjusted everything to my needs, I'll
indeed start to play around with certain OP-Amps as the stuff I'm doing
is exploiting them quite a bit regarding their GBP for example. Not all
Op-Amps will do.

For now, however, I'm just playing around - still I tried using real
models as this will be what I'll be using in future.

And indeed, I got it running - kind of. As an example, I took the model
for the most simple LM324 from
http://www.national.com/models/spice/LM/LM324.MOD - I had to rename the
subcircuit as gnucap appearently cannot cope with slashes in the
subckt-name (originally it was "LM324/NS", I renamed to "LM324" and it
worked).

Thanks again for your help!
Kind regards,
Johannes
Johannes Bauer
2008-07-13 12:30:52 UTC
Permalink
Op-amp models are usually subcircuits, designed for a particular
variant of Spice. Some work, some don't. The only way to know is to
try it.

Hmm, one more question: I've now tried out models for the LM324,
MC33079, TL071 and TLC274. Only the LM324 worked - all others reported a
message like:

gnucap> print tran v(nodes)

FB.X4: cannot be used as current probe

Is there some easy way to fix this, as I believe there's something I'm
doing wrong again rather than broken model files.

Kind regards,
Johannes

Continue reading on narkive:
Loading...