¿ªÔÆÌåÓý

Date

Re: Bug in "Waveform Arithmetic"?

 

--- In LTspice@..., "Dale" <dchishol@c...> wrote:
When entering a waveform expression using the "int()", "ceil()" or
"floor()" functions I get error messages that "int" (or "ceil" or
"floor") is an undefined symbol. For the record, the expression I'm
entering is:

int(32*V(3)/(2*pi))

and "V(3)" is a valid node voltage in my simulation.

Am I doing something wrong, or is this a program bug?

Thanks for suggestions
Dale

p.s. - I've also had problems using the sgn() function in
expressions for the "F" and "G" sources, though it seems to work
with "B" sources.
Hello,

The functions you named are not valid for waveform arithmetic and may
only be used in behavioral sources. Check the help file. Or better
still, check my included crib sheet which contains many functions not
listed in the help file as well several corrections to errors there.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Waveform Arithmetic:

The difference of two voltages; e.g., V(a)-V(b); can equivalently
written as V(a,b). The following functions are available (r denotes
real data only, c denotes complex data only):

Name | Function
-------------------+-----------------------------
sin(x) | sine
cos(x) | cosine
tan(x) | tangent
asin(x) | arc sine
acos(x) | arc cosine
atan(x) | arc tangent
atan2(y,x) r arc tangent of y/x
hypot(y,x) r hypotenuse: sqrt(x*x+y*y)
sinh(x) | hyperbolic sine
cosh(x) | hyperbolic cosine
tanh(x) | hyperbolic tangent
asinh(x) | arc hyperbolic sine
acosh(x) | arc hyperbolic cosine
atanh(x) | arc hyperbolic tangent
exp(x) | exponential
ln(x) or log(x) | natural logarithm
log10(x) | base 10 logarithm
sgn(x) r sign (0 if x = 0)
fabs(x) r absolute value
abs(x) | absolute value
sqrt(x) | square root
cbrt(x) | cube root
pow(x,y) r x**y
pwr(x,y) r abs(x)**y
pwrs(x,y) r sgn(x)*abs(x)**y
min(x,y) r the lesser of x or y
max(x,y) r the greater of x or y
limit(x,y,z) r equivalent to min(max(x,y),z)
table(x,x1,y1...) r interpolate values for x
where: x1<x2... r based on a lookup table
r of x-ordered point pairs
uramp(x) r x if x > 0, else 0
u(x) r unit step: 1 if x > 0, else 0
buf(x) r 1 if x > .5, else 0
!(x) or inv(x) r 0 if x > .5, else 1
rand(x) r random number between 0 and 1?
re(x) c real part
im(x) c imaginary part
ph(x) c phase
mag(x) c magnitude
db(x) c magnitude in dB
invdb(x) c 10**(x/20)



Waveform Arithmetic (continued):

The following operations, grouped in order of precedence of evaluation
(for complex data only +, -, *, /, and ** are available):

Symbol | Operation
--------+--------------------------------------------------
! | convert succeeding expression to Boolean then
| invert
** | floating point exponentiation
--------+--------------------------------------------------
/ | floating point division
* | floating point multiplication
% | floating point modulus (real data only)
--------+--------------------------------------------------
- | floating point subtraction
+ | floating point addition
--------+--------------------------------------------------
== | true if preceding expression is equal to
| succeeding expression, otherwise false
>= | true if preceding expression is greater than or
| equal to succeeding expression, otherwise false
<= | true if preceding expression is less than or
| equal to succeeding expression, otherwise false
> | true if preceding expression is greater than
| succeeding expression, otherwise false
< | true if preceding expression is less than
| succeeding expression, otherwise false
--------+--------------------------------------------------
^ | convert adjacent expressions to Boolean then XOR
| | convert adjacent expressions to Boolean then OR
& | convert adjacent expressions to Boolean then AND

True is numerically equal to 1 and False is 0. Conversion to Boolean
converts a value to 1 if the value is greater than 0.5, otherwise the
value is converted to 0.

The following keywords (global variables and constants):

Name | Value | Description
---------+---------------+----------------------------------
time | variable | time in seconds (real data only)
freq | variable | freq in Hertz (cmplx data only)
w | variable | freq in radians (cmplx data only)
i | sqrt(-1) | imaginary unity (cmplx data only)
e | 2.71828 |
pi | 3.14159 |
c | 2.99792e+008 | speed of light in m/s
boltz | 1.38062e-023 | Boltzmann constant
planck | 6.62620e-034 | Planck's constant
echarge | 1.60219e-019 | charge of an electron
kelvin | -2.73150e+002 | absolute zero in degrees C


B. Arbitrary behavioral voltage or current sources.

Symbol names: BV, BI

Syntax: Bxxx n1 n2 V=<expression>
+ [[ic=<value>] tripdv=<value>] [tripdt=<value>]
+ [Laplace=<func(s)> [window=<time>] [nfft=<number>]]

Bxxx n1 n2 I=<expression> [Rpar=<value>]
+ [ic=<value>] [tripdv=<value>] [tripdt=<value>]
+ [Laplace=<func(s)> [window=<time>] [nfft=<number>]]

The first syntax specifies a behavioral voltage source and the next
is a behavioral current source. For the current source, a parallel
resistance may be specified with the Rpar instance parameter.

Tripdv and tripdt control step rejection. If the voltage across a
source changes by more than tripdv volts in tripdt seconds, that
simulation time step is rejected.

The transfer function of the Laplace circuit element is specified by
its Laplace transform. The Laplace transform must be a function of s.
The frequency response at frequency f is found by substituting s with
sqrt(-1)*2*pi*f. The time domain behavior is found from the impulse
response obtained from the Fourier transform of the frequency domain
response. LTspice must guess an appropriate frequency range and
resolution. The response must drop at high frequencies or an error is
reported. It is recommended that the LTspice first be allowed to make
a guess at this and then check the accuracy by reducing reltol or
explicitly setting nfft and the window. The reciprocal of the value
of the window is the frequency resolution. The value of nfft times
this resolution is the highest frequency considered.

Expressions can contain the following:

o Node voltages, e.g., V(n1)

o Node voltage differences, e.g., V(n1,n2)

o Circuit element currents; for example, I(S1), the current
through switch S1 or Ib(Q1), the base current of Q1. However, it is
assumed that the circuit element current is varying quasi-statically,
that is, there is no instantaneous feedback between the current
through the referenced device and the behavioral source output.

o The keyword "time" meaning the current time in the simulation.

o Any user defined parameters or functions. For details, refer
to the .param and the .func simulator directives defined under the
Help subchapter on Dot Commands.

B. Arbitrary behavioral voltage or current sources (continued).

o The following functions:

Name | Function
-------------------+-----------------------------
sin(x) | sine
cos(x) | cosine
tan(x) | tangent
asin(x) | arc sine
acos(x) | arc cosine
atan(x) | arc tangent
atan2(y,x) | arc tangent of y/x
hypot(y,x) | hypotenuse: sqrt(x*x+y*y)
sinh(x) | hyperbolic sine
cosh(x) | hyperbolic cosine
tanh(x) | hyperbolic tangent
asinh(x) | arc hyperbolic sine
acosh(x) | arc hyperbolic cosine
atanh(x) | arc hyperbolic tangent
exp(x) | exponential
ln(x) or log(x) | natural logarithm
log10(x) | base 10 logarithm
sgn(x) | sign (0 if x = 0)
abs(x) | absolute value
sqrt(x) | square root
square(x) | x**2
pow(x,y) | x**y
pwr(x,y) | abs(x)**y
pwrs(x,y) | sgn(x)*abs(x)**y
round(x) | round to nearest integer
int(x) | truncate to integer part of x
floor(x) | integer equal or less than x
ceil(x) | integer equal or greater than x
min(x,y) | the lesser of x or y
max(x,y) | the greater of x or y
limit(x,y,z) | equivalent to min(max(x,y),z)
if(x,y,z) | if x > .5 then y else z
table(x,x1,y1...) | interpolate values for x
where: x1<x2... | based on a lookup table
| of x-ordered point pairs
uramp(x) | x if x > 0, else 0.
u(x) or stp(x) | unit step, 1 if x > 0, else 0
buf(x) | 1 if x > .5, else 0
!(x) or inv(x) | 0 if x > .5, else 1
rand(x) | random number between 0 and 1
ddt(x) | time derivative
idt(x) or sdt(x) | time integral: idt(x[,ic[,assert]])?
idtmod(x) | time integral with wrapping at 2*Pi
| idtmod(x[,ic[,mod[,offset]]])?
delay(x,y) | delay x by y seconds
absdelay(x,y) | absdelay(x,delay[,max_delay])?

B. Arbitrary behavioral voltage or current sources (continued).

o The following operations, grouped in order of precedence of
evaluation:

Symbol | Operation
--------+--------------------------------------------------
~ or ! | convert succeeding expression to Boolean then
| invert
** | floating point exponentiation
--------+--------------------------------------------------
/ | floating point division
* | floating point multiplication
--------+--------------------------------------------------
- | floating point subtraction
+ | floating point addition
--------+--------------------------------------------------
== | true if preceding expression is equal to
| succeeding expression, otherwise false
>= | true if preceding expression is greater than or
| equal to succeeding expression, otherwise false
<= | true if preceding expression is less than or
| equal to succeeding expression, otherwise false
> | true if preceding expression is greater than
| succeeding expression, otherwise false
< | true if preceding expression is less than
| succeeding expression, otherwise false
--------+--------------------------------------------------
^ | convert adjacent expressions to Boolean then XOR
| | convert adjacent expressions to Boolean then OR
& | convert adjacent expressions to Boolean then AND

True is numerically equal to 1 and False is 0. Conversion to Boolean
converts a value to 1 if the value is greater than 0.5, otherwise the
value is converted to 0.

o The following keywords (global variables and constants):

Name | Value | Description
---------+---------------+----------------------------------
time | variable | time in seconds
pi | 3.14159 |
boltz | 1.38062e-023 | Boltzmann constant
planck | 6.62620e-034 | Planck's constant
echarge | 1.60219e-019 | charge of an electron
kelvin | -2.73150e+002 | absolute zero in degrees C


Bug in "Waveform Arithmetic"?

Dale
 

When entering a waveform expression using the "int()", "ceil()" or
"floor()" functions I get error messages that "int" (or "ceil" or
"floor") is an undefined symbol. For the record, the expression I'm
entering is:

int(32*V(3)/(2*pi))

and "V(3)" is a valid node voltage in my simulation.

Am I doing something wrong, or is this a program bug?

Thanks for suggestions
Dale

p.s. - I've also had problems using the sgn() function in expressions
for the "F" and "G" sources, though it seems to work with "B" sources.


My suggestion: (Re: Tossed my bad cookies and am finally able to post here)

Dale
 

My preference would be to post in the "Files" section of this group.

{In the menubar along the left side of this window, click on "Files"
then drill down to Files>Lib>Sym, Files>Lib>Sub or Files>Lib>Sch as
appropriate. When you add a file, check the box labeled "Announce
this file addition to the group." (or something to that effect).}

The Gracious Moderator set up the structure in the Files area to
replicate the LTSpice direcctory structure. This was probably done as
a favor to us gray-haired old men who can never seem to remember the
topic of a post containing an interesting model if it's over a week old.

Dale


--- In LTspice@..., "analogspiceman" <analogspiceman@y...>
wrote:
Hi all,

I have some LT spice models to share and would like some advice as to
the best way to go about it (assuming there is sufficient interest).

I also could include some switch mode power supply designs and
information about some undocumented LTspice features.

Models I have developed (generally with symbols) include:
UC384X series of single output PWM control ICs
UCC38083 (dual output PWM control IC)
IR21064 (half bridge driver)
TL431A (shunt regulator - very difficult to simulate well)
V320LA40B (varistor)
An NTC inrush current limiter (with temperature output)
A photovoltaic panel
A one and two pole generic op amp model with reasonable BW, slew rate
limiting, voltage and current limiting, PSRR, noise and power draw
from the power supplies (these models work with "floating" power
supplies).
A neon bulb model.
An LISN model and techniques for simulating conducted EMI.
Methods for simulating realistic transformers.
Methods for generating average models of power switching circuits.

May (and should) I make a folder(s) into which I could upload the
files or would it be better to just dribble out the information on
request as inline text within a post?

analog spiceman


Tossed my bad cookies and am finally able to post here

 

Hi all,

I have some LT spice models to share and would like some advice as to
the best way to go about it (assuming there is sufficient interest).

I also could include some switch mode power supply designs and
information about some undocumented LTspice features.

Models I have developed (generally with symbols) include:
UC384X series of single output PWM control ICs
UCC38083 (dual output PWM control IC)
IR21064 (half bridge driver)
TL431A (shunt regulator - very difficult to simulate well)
V320LA40B (varistor)
An NTC inrush current limiter (with temperature output)
A photovoltaic panel
A one and two pole generic op amp model with reasonable BW, slew rate
limiting, voltage and current limiting, PSRR, noise and power draw
from the power supplies (these models work with "floating" power
supplies).
A neon bulb model.
An LISN model and techniques for simulating conducted EMI.
Methods for simulating realistic transformers.
Methods for generating average models of power switching circuits.

May (and should) I make a folder(s) into which I could upload the
files or would it be better to just dribble out the information on
request as inline text within a post?

analog spiceman


Re: Opamp models from Texas Instruments, Thank you very much

 

Hello,


thank you all very much for your prompt help.

The simulation runs now and I can compare the results to the
real world.



regards


Sven Hegewisch


Re: matlab interface

Ramprasad Potluri
 

On 24 Jun 2003 at 16:48, raj_sodhi99 wrote:

Hello,

I was wondering if anyone has written a generic routine to read the
raw ascii output file from the output of Ltsputil.exe and then to
bring the data into the Matlab environment for further manipulation or
post-processing.


Hello Raj,

The attached MATLAB function will do approximately what you want.
But, you could still write a better one.

Best wishes,

Ram.

% raw_get.m: Function to read the contents of an ASCII .raw file
% (in the following, simply called a ".raw file") that
% is generated by SwitcherCAD's LTspice program and
% extract each variable's into a separate vector.
%
% INPUT: "rawname" - Name (without the extension) of the .raw file.
%
% vars = [var1,var2,var3,...] - Vector of the identifiers of
% the variables whose values are needed to be extracted from
% the .raw file (var1, var2, etc are numbers greater than or
% equal to 0 and arranged in increasing order in the "vars"
% vector). This data is present in the first column
% following the line that contains the second instance of
% the word "Variables:" in the .raw file. In the .raw file,
% this data ends one line before the line containing the
% word "Values:".
%
% OUTPUT: X = [x1,x2,x3,...] - A matrix. x1 is the data for the
% variable var1, x2 is the data for the variable var2,
% etc. x1,x2,x3,... have the same number of rows and two
% columns each.
%
% PRECONDITIONS: The .raw file must be in the same folder as this
% m-file.
%
% The .raw file is ASCII.
%
% "var1", "var2", "var3",... are numbers arranged in
% increasing order.
%
% "rawname" does not contain the extension of the
% .raw file.
%
%
% AUTHOR : Ramprasad Potluri.
% E-MAIL : potluri@...
% DATE : April - 23 - 2003
%
%
% THANKS TO: helmutsennewald@... who explained to me the
% ASCII .raw file's format. His help was very timely.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function X = raw_get(rawname,vars)


%--------------

filename = [rawname,'.raw'];

fid=fopen(filename, 'rt');
% Open the .raw file whose name was specfied in the input
% variable "rawname".

line = fgetl(fid);
% read in the first line of the file.

K1 = findstr(line,'No. Variables:');
% find the string 'No. Variables:' in the line read above.

while K1 == [],
% While 'No. Variables:' is absent in the line, do this loop.
% This loop executes until 'No. Variables:' is found in the file.

line = fgetl(fid);
% Read the next line.

K1 = findstr(line,'No. Variables:');
% Check for the presence of 'No. Variables:' in this line.
end

% Now, we have completed reading the line that contains
% 'No. Variables:'. Now, fgetl() has positioned the counter at
% the beginning of the next line.


%-----------------

id_len = size('No. Variables:',2);
line_len = size(line,2);

% Next, extract into the variable "numvars" the total number of
% variables listed in this .raw file. This information is present
% after a blank space following 'No. Variables:'.

numvars = str2num( line( 1, id_len+1:line_len ) );

% Next, extract into the variable "numpts" the total number of
% points of each variable listed in this .raw file. This
% information is present on the line following the line on which
% 'No. Variables:' was found.

line = fgetl(fid);
id_len = size('No. Points:',2);
line_len = size(line,2);

numpts = str2num( line( 1, id_len+1:line_len ) );


%-----------------

% Next, search for the second instance of the word "Variables:".

line = fgetl(fid);
K1 = findstr(line,'Variables:');
while K1 == [],
line = fgetl(fid);
K1 = findstr(line,'Variables:');
end

% Now that this second instance has been found, skip "numvars+1"
% number of lines.

k = [];
for k = 1:numvars+1,
line = fgetl(fid);
end

% Now, the pointer is positioned in the beginning of the line
% immediately following the line conataining the word "Values:".


%---------------

% Next, extract the required data into the matrix "X".

sizevars = size(vars,2);
% Number of elements in the vars vector.

% Initialize some variables:

k = [];
vars0 = 1;

% Extract data into X:

for p = 1:numpts,
for k = 1:sizevars,
for l = vars0:vars(k)+1,
line = fgetl(fid);
end
vars0 = vars(k)+2;
temp = str2num(line);
if size(temp,2) == 3,
X(p,2*k-1:2*k) = temp(1,2:3);
else
X(p,2*k-1:2*k) = temp;
end
end
for q = vars(k)+2:numvars+1,
line = fgetl(fid);
end
end

fclose(fid);

%---------------------

% $$$ sizevars
% $$$ numXrows = size(X,1)
% $$$ numvars
% $$$ numpts


matlab interface

 

Hello,

I was wondering if anyone has written a generic routine to read the
raw ascii output file from the output of Ltsputil.exe and then to
bring the data into the Matlab environment for further manipulation
or post-processing. Since I did a cursory look on this forum, I did
not see anything of the sort, and so I'll probably write my own. What
is nice is that I can run DOS commands from within matlab, and so one
program (calling another) should do it all. If this would be useful
to the LTSpice community, let me know and I'll post it when I'm done.

yours,

Raj


Re: Opamp models from Texas Instruments, correction

 

--- In LTspice@..., "Helmut Sennewald"
<helmutsennewald@y...> wrote:
--- In LTspice@..., fenn hefisch <hefisch2000@y...>
wrote:
...
Then I checked the model text and discovered a surprising element.

* zero
ez 26 99 21 99 10
rz1 26 27 -900
cz 26 27 .2p
rz2 27 99 -100

This is a bypassed resistive divider, but both resistors have
negative values.
I replaced this part of the THS4271 with an equivalent circuit with
positive resistor values.

* zero
ez 26 99 21 99 10
rz1 26 27 900
ez1 260 99 26 99 -1
cz 260 27 .2p
rz2 27 99 100

First I checked the modified model with an open loop .AC
simulation.
The result has been exactly the same and so my circuit is
equivalent.
Hello again,
sorry I have seen it is only an approximation. It shows a little bit
too much phase shift at 1GHz. So please reduce the capacitor value
of "cz" to .15p for best approximation.

* zero
ez 26 99 21 99 10
rz1 26 27 900
ez1 260 99 26 99 -1
cz 260 27 .15p
rz2 27 99 100


Best Regards
Helmut



PS: There is a real equivalent circuit with positive resistors.
Accidentally the inductance has to be negative and here LTSPICE also
fails in .TRAN analysis. Please don't use it.
ez 26 99 21 99 10
rz1 26 27 900
lz1 27 270 -18n
rz2 270 99 100


Re: Opamp models from Texas Instruments

 

This is a bypassed resistive divider, but both resistors
have negative values. I replaced this part of the THS4271
with an equivalent circuit with positive resistor values.

First I checked the modified model with an open loop .AC
simulation. The result has been exactly the same and so
my circuit is equivalent.

The .TRAN simulation now runs without any problems!
Nice fix, Helmult.

My question to "Panama Mike" alias Mike Engelhardt:
---------------------------------------------------
Has LTSPICE in general problems with resistive dividers having
negative values in .TRAN analysis?
I assume that PSPICE will run this model even with the negative
resistors.
You can use negative resistors in LTspice with no problem.
Many opamp macro models use them, possibly becuase they're
generated by machine that doesn't check the sensibility of
what they produce.

I assume that PSPICE will run this model even with the
negative resistors.
Nope, PSpice has trouble with this model also. Usually when
LTspice has trouble with a PSpice model, PSpice will have
trouble with it also, though it might show up under slightly
different conditions. PSpice makes certain approximations
that LTspice does not make. One example is that it shorts
out current sources in the interest of making the circuit
easier to solve. Another is that PSpice is stuck on Gear
integration which is not as accurate as LTspice's modified
trap, but occasionally more numerically stable.

However, sometimes there is a model that PSpice can solve
that LTspice had a really hard time with. Therefor
there is now an alternate solver that is much more accurate
that the one in PSpice and that should take care of such
problems.

--Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


Re: Opamp models from Texas Instruments

 

--- In LTspice@..., fenn hefisch <hefisch2000@y...> wrote:
...
But the THS4271 produces just junk. After some 500 ps
the output will be some Megavolts.
The AC analysis on the other hand looks ok.

After several days of try and still error I don't know
what I am doing wrong.
Hello Sven,
I agree wih you, that LTSPICE cannot sucessfull run the THS4271 with
the .TRAN analysis, but the .AC analysis is ok.
I tried many simulator options, but nothing helped.
Then I checked the model text and discovered a surprising element.

* zero
ez 26 99 21 99 10
rz1 26 27 -900
cz 26 27 .2p
rz2 27 99 -100

This is a bypassed resistive divider, but both resistors have
negative values.
I replaced this part of the THS4271 with an equivalent circuit with
positive resistor values.

* zero
ez 26 99 21 99 10
rz1 26 27 900
ez1 260 99 26 99 -1
cz 260 27 .2p
rz2 27 99 100

First I checked the modified model with an open loop .AC simulation.
The result has been exactly the same and so my circuit is equivalent.

The .TRAN simulation now runs without any problems!

My question to "Panama Mike" alias Mike Engelhardt:
---------------------------------------------------
Has LTSPICE in general problems with resistive dividers having
negative values in .TRAN analysis?
I assume that PSPICE will run this model even with the negative
resistors.

Best regards
Helmut


PS: TI did a bad job here about open loop phase response.
Their model has -180 degrees at 1GHz whereas their graph in the data
sheet shows -130 degree.


Re: Opamp models from Texas Instruments

 

Sven,

The simulation ( transient analysis )with the AD8009
works as expected. But the THS4271 produces just junk.
After some 500 ps the output will be some Megavolts.
The AC analysis on the other hand looks ok.
It looks like the problem is in the model. I ran the
model in PSpice 9.2.3, the most recent version of the
target simulator of the model, and got the same results.
Here is a netlist based on your circuit that you can run
in either LTspice or PSpice. I removed the power source
impedances because PSpice doesn't handle those as part of
voltage sources.

You'll have to pick a different opamp or contact TI
about the error in the model. Good luck.

* THS4271.asc
R1 N001 0 100
R2 out N001 100
V1 N005 0 PULSE(0 1 0 0.1n 0.1n 10n 20n)
V2 0 N003 5
V3 N002 0 5
R3 N004 N005 0.1
XU1 N004 N001 N002 N003 out THS4271
.tran 0 20n 0
.inc TI.lib
.probe
.end

--Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


No files were attached

 

Hello,

my attached files did't appear, so I try to add then
to this post.

Thank you again for any help.

Sven Hegewisch




The library:

AD8009 SPICE model Rev B SMR/ADI 8-21-97

* Copyright 1997 by Analog Devices, Inc.

* Node assignments
* non-inverting input
* | inverting input
* | | positive supply
* | | | negative supply
* | | | | output
* | | | | |
.SUBCKT AD8009 1 2 99 50 28

* input stage *

q1 50 3 5 qp1
q2 99 5 4 qn1
q3 99 3 6 qn2
q4 50 6 4 qp2
i1 99 5 1.625e-3
i2 6 50 1.625e-3
cin1 1 98 2.6e-12
cin2 2 98 1e-12
v1 4 2 0

* input error sources *

eos 3 1 poly(1) 20 98 2e-3 1
fbn 2 98 poly(1) vnoise3 50e-6 1e-3
fbp 1 98 poly(1) vnoise3 50e-6 1e-3

* slew limiting stage *

fsl 98 16 v1 1
dsl1 98 16 d1
dsl2 16 98 d1
dsl3 16 17 d1
dsl4 17 16 d1
rsl 17 18 0.22
vsl 18 98 0

* gain stage *

f1 98 7 vsl 2
rgain 7 98 2.5e5
cgain 7 98 1.25e-12
dcl1 7 8 d1
dcl2 9 7 d1
vcl1 99 8 1.83
vcl2 9 50 1.83

gcm 98 7 poly(2) 98 0 30 0 0 1e-5 1e-5

* second pole *

epole 14 98 7 98 1
rpole 14 15 1
cpole 15 98 2e-10

* reference stage *

eref 98 0 poly(2) 99 0 50 0 0 0.5 0.5

ecmref 30 0 poly(2) 1 0 2 0 0 0.5 0.5

* vnoise stage *

rnoise1 19 98 4.6e-3
vnoise1 19 98 0
vnoise2 21 98 0.53
dnoise1 21 19 dn

fnoise1 20 98 vnoise1 1
rnoise2 20 98 1

* inoise stage *

rnoise3 22 98 8.18e-6
vnoise3 22 98 0
vnoise4 24 98 0.575
dnoise2 24 22 dn

fnoise2 23 98 vnoise3 1
rnoise4 23 98 1

* buffer stage *

gbuf 98 13 15 98 1e-2
rbuf 98 13 1e2

* output current reflected to supplies *

fcurr 98 40 voc 1
vcur1 26 98 0
vcur2 98 27 0
dcur1 40 26 d1
dcur2 27 40 d1

* output stage *

vo1 99 90 0
vo2 91 50 0
fout1 0 99 poly(2) vo1 vcur1 -9.27e-3 1 -1
fout2 50 0 poly(2) vo2 vcur2 -9.27e-3 1 -1
gout1 90 10 13 99 0.5
gout2 91 10 13 50 0.5
rout1 10 90 2
rout2 10 91 2
voc 10 28 0
rout3 28 98 1e6
dcl3 13 11 d1
dcl4 12 13 d1
vcl3 11 10 -0.445
vcl4 10 12 -0.445

.model qp1 pnp()
.model qp2 pnp()
.model qn1 npn()
.model qn2 npn()
.model d1 d()
.model dn d(af=1 kf=1e-8)
.ends

* [Disclaimer] (C) Copyright Texas Instruments
Incorporated 1999 All rights reserved
*
* THS4271 High Speed amplifier "macromodel" subcircuit
* updated using Model Editor release 9.2 on 11/05/02
at 13:11
* The Model Editor is a PSpice product.
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
*$
.subckt THS4271 1 2 3 4 5

*Offset and CMRR
Vos 1a 9 .005
Ios 1 2 .5u

* upper Vic range limit
drc1 16 17 dx
drc2 16 18 dx
Vcp 3 16 dc -0.4

* input stage
rc1 17 11 176.8
rc2 18 12 176.8
L- 2 2a .8n
q1 11 2a 13 qx1
L+ 1 1a .8n
q2 12 9 14 qx1
re1 13 10 159.07
re2 14 10 159.07
Cdif 1 1c 0.8p
Rcdf 1c 2 50
Ccm 2 2b 0.4p
Rccm 2b 99 50

* lower Vic range limit
d10 15 10 dx
v10 15 4 dc 1.2
Iee 10 4 dc 3e-3
Icc 3 4 15m
Rcc 3 4 2500

* gain stage and dominant pole
Ga 21 99 value =
{(limit(V(11,12),-.447,.447))*-35.6m}
ra 21 99 158k
ca 21 99 15.9E-12

* GAIN STAGE SWING LIMIT
DPC 21 23 dx
VPC 3 23 1.7
DNC 24 21 dx
VNC 24 4 1.74

* zero
ez 26 99 21 99 10
rz1 26 27 -900
cz 26 27 .2p
rz2 27 99 -100

* phase shift stage
gps 25 99 27 99 -100.0E-6
rps 25 99 10.0E3
cps 25 99 10E-15

Egnd 99 0 poly(2) 3 0 4 0 0 .5 .5
X_OP 25 99 3 4 5a THS4271_OP
Ro 5a 5b .1
Lo 5b 5 .2n
Rco 5c 99 10
Co 5 5c .8p

.ends
*$

* Output stage
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
.subckt THS4271_OP 1 2 3 4 5
* GAIN STAGE SWING LIMIT
DOPC 1 38 dx
VOPC 3 38 1.
DONC 48 1 dx
VONC 48 4 1.

* UPPER DRIVE STAGE
ROP 3 34 8.5
HLP2 34 33 VLP 30
VOP 33 32 0
HLP1 35 0 VOP 8
RLP 35 36 8
DLP 36 37 dx
VLP 37 0 0
EOP 32 31 Poly(2) 2 1 3 4 -.8 1 .5
DOP 31 5 dx

* LOWER DRIVE STAGE
DON 5 41 dx
EON 41 42 Poly(2) 1 2 3 4 -.8 1 .5
VON 42 43 0
HLN1 45 0 VON 15
RLN 45 46 8
DLN 46 47 dx
VLN 47 0 0
HLN2 43 44 VLN 45
RON 44 4 12

.ends
*$
*DIODE MODELS
.model dx D(Is=800.00E-18)
*$
.model qx1 NPN(Is=800.00E-18 Bf=272.73 af=0 kf=9e-22)
*.model qx1 NPN(Is=800.00E-18 Bf=272.73 af=2 kf=8e-8)
*$

Please note that the disclaimers and copyright notices
are shorted!


The circuit with AD8009:

Version 4
SHEET 1 880 680
WIRE -320 176 -80 176
WIRE -80 80 -80 176
WIRE -80 176 0 176
WIRE 0 80 144 80
WIRE 144 80 144 192
WIRE 144 192 64 192
WIRE 144 192 240 192
WIRE 32 160 32 144
WIRE 32 352 32 336
WIRE 240 192 288 192
WIRE -80 208 0 208
WIRE -224 288 -224 208
WIRE -224 208 -160 208
WIRE 192 336 192 320
WIRE 192 432 192 416
WIRE 32 240 32 224
FLAG -320 256 0
FLAG -224 368 0
FLAG 32 432 0
FLAG 192 320 0
FLAG 240 192 out
FLAG 32 144 v+
FLAG 192 432 v+
FLAG 32 240 v-
FLAG 32 336 v-
SYMBOL res -336 160 R0
SYMATTR InstName R1
SYMATTR Value 100
SYMBOL res 16 64 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R2
SYMATTR Value 100
SYMBOL voltage -224 272 R0
WINDOW 123 24 132 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -402 89 Left 0
SYMATTR Value2 AC 0.1
SYMATTR Value PULSE(0 1 0 0.1n 0.1n 10n 20n 1)
SYMATTR InstName V1
SYMBOL voltage 32 448 R180
WINDOW 0 24 104 Left 0
WINDOW 3 24 16 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 24 -12 Left 0
SYMATTR InstName V2
SYMATTR Value 5
SYMATTR SpiceLine Rser=0.1
SYMBOL voltage 192 432 R180
WINDOW 0 24 104 Left 0
WINDOW 3 24 16 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 24 76 Left 0
SYMATTR InstName V3
SYMATTR Value 5
SYMATTR SpiceLine Rser=0.1
SYMBOL res -64 192 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R3
SYMATTR Value 0.1
SYMBOL Opamps&#92;&#92;AD8009 32 128 R0
SYMATTR InstName U1
TEXT -226 506 Left 0 !.tran 0 20n 0


The circuit with THS4271:


Version 4
SHEET 1 880 680
WIRE -320 176 -80 176
WIRE -80 80 -80 176
WIRE -80 176 0 176
WIRE 0 80 144 80
WIRE 144 80 144 192
WIRE 144 192 64 192
WIRE 144 192 240 192
WIRE 32 160 32 144
WIRE 32 352 32 336
WIRE 240 192 288 192
WIRE -80 208 0 208
WIRE -224 288 -224 208
WIRE -224 208 -160 208
WIRE 192 336 192 320
WIRE 192 432 192 416
WIRE 32 240 32 224
FLAG -320 256 0
FLAG -224 368 0
FLAG 32 432 0
FLAG 192 320 0
FLAG 240 192 out
FLAG 32 144 v+
FLAG 192 432 v+
FLAG 32 240 v-
FLAG 32 336 v-
SYMBOL res -336 160 R0
SYMATTR InstName R1
SYMATTR Value 100
SYMBOL res 16 64 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R2
SYMATTR Value 100
SYMBOL voltage -224 272 R0
WINDOW 123 24 132 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -402 89 Left 0
SYMATTR Value2 AC 0.1
SYMATTR Value PULSE(0 1 0 0.1n 0.1n 10n 20n 1)
SYMATTR InstName V1
SYMBOL voltage 32 448 R180
WINDOW 0 24 104 Left 0
WINDOW 3 24 16 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 24 -12 Left 0
SYMATTR InstName V2
SYMATTR Value 5
SYMATTR SpiceLine Rser=.1
SYMBOL voltage 192 432 R180
WINDOW 0 24 104 Left 0
WINDOW 3 24 16 Left 0
WINDOW 123 0 0 Left 0
WINDOW 39 24 76 Left 0
SYMATTR InstName V3
SYMATTR Value 5
SYMATTR SpiceLine Rser=.1
SYMBOL res -64 192 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R3
SYMATTR Value 0.1
SYMBOL Opamps&#92;&#92;THS4271 32 128 R0
SYMATTR InstName U1
TEXT -226 506 Left 0 !.tran 0 20n 0


________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to


Opamp models from Texas Instruments

 

Hello,

first let me than you for this nice program.

I am rather new to simulation programs so I ran into
some
difficulties.

I try to simulate a small circuit with two different
opamps, the AD8009 from Analog Devices and the THS4271
from Texas Instruments. I downdloaded both models from
the net and made a library with them which I put in
the
standard library folder.

The simulation ( transient analysis )with the AD8009
works as expected.
But the THS4271 produces just junk. After some 500 ps
the output will be some Megavolts.
The AC analysis on the other hand looks ok.

After several days of try and still error I don't know
what I am doing wrong.

Every help will be appreciated.

The circuits have the filenames THS4271t.asc and
AD8009t.asc
and the library has the name opa.lib.
They are attached to this post.

Thank you

Sven Hegewisch


________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to


Re: Rotating components when placing in schematic

Howie, Brian (UK)
 

In Eagle (by CadSoft) I can rotate components by clicking the right
mouse button before placing. Would be a nice feature in LTSpice, too.

Greeting from Germany

Michael

Control R does it.

Brian

***
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
***


Rotating components when placing in schematic

telyn_de
 

Hello,

my name is Michael and I'm designing stage control systems for
theaters, opera houses etc.

I've been using LTSpice only for a few days by now (after been
completely unsatisfied with CircuitMaker 5 schematic editor).

Now my question:
Is there any easy way (other than clicking the Rotate Button) to
rotate components when placing ?

In Eagle (by CadSoft) I can rotate components by clicking the right
mouse button before placing. Would be a nice feature in LTSpice, too.

Greeting from Germany

Michael


Re: What does 'Fatal Error: doAnalyses: Iteration limit reached' mean?

 

Massimo,

Please can you report some additional information about the alternate
solver? Which are the main differences between the two solvers?

Is it possible to understand why you have added this new solver? Are
there some limitations in the old one? Which are the circuits in which
the new solvers is more accurate?
The alternate solver uses a sparse matrix package that
accumulates much less internal round-off error. The new
sparse solver uses (what I call) a vertical solution method.
It runs at about half the simulation speed but 1000x more
accurately as far as the matrix solution goes in the test
cases that caused the investigation.

For practical circuits, there's no need for it. But some
opamp macro models use unphysical components that lead to a
difficult-to-solve linearized circuit matrix. I found three
ways to solve the problem, but only released the method to
use a more accurate sparse matrix solver that has less round-
off error because (i) it was of the most general use and (ii)
it's the hardest for other SPICE programs to duplicate. This
also gives a nice diagnostic that allows one to check if
numerical round-off is an issue by switching between solvers.
I think it's an interesting, very high-power means to solve
the problem and I don't know of any other SPICE in academia
or commerce that uses this vertical solution technology.
Intellectual property concerns don't allow me to feel
comfortable revealing the theory behind the implementation,
but you should find the operation to be exactly as I describe.

Besides the sparse matrix solver, there is no other intended
difference between the two SPICE solvers in the current
release. There's basically two copies of LTspice in the
executable because the new matrix solver is not compatible
with the old one so a copy of LTspice had to be modified to
work with it.

Anyway, I recommend only using the normal solver unless you
run into singular matrix issues. The normal solver usually
will be just as accurate as the alternate solver since round-
off error in the sparse matrix is rarely the limiting factor
to the accuracy of your circuit's solution. If you develop
macro models for others to use in possibly other simulators,
I definately recommend that you use the normal solver, or
could end up with a model that only LTspice can solve.

But of course I appreciate people testing both solvers and
reporting any un-intended differences between them. It was
a huge reorganization of the code to have two versions of
LTspice in the same executable. I find the feedback I
get from this, other groups, and individually extremely
valuable to the quality of the program.

--Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


Re: What does 'Fatal Error: doAnalyses: Iteration limit reached' mean?

 

Dear Mike,

Please can you report some additional information about the alternate solver? Which are the main differences between the two solvers?

Is it possible to understand why you have added this new solver? Are there some limitations in the old one? Which are the circuits in which
the new solvers is more accurate?

Thanks

Massimo

Panama Mike wrote:

I wrote:

> ...The fix is not yet in the general release
> which is still Version 2.03f of May 23, 2003.
> It's going to take another week or two before the
> MOS3 fix make it into the general release because
> that will also include the new sparse matrix solver.
>
> But in the meanwhile, please try out this executable:
>
>
This MOS3 fix and the alternate solver with the new
sparse matrix package is now in the general release.
This makes the above mentioned url obsolete and no
longer available.
Version 2.03h implements a major reorganization of
most of the underlying code. Please report any
problems you might encounter as soon as you can.
--

''~``
( o o )
+------------------.oooO--(_)--Oooo.------------------+
| |
| e-mail: gaspari@... |
| |
| ICQ # = 166939207 |
| |
| PGP fingerprint16: |
| 76 80 F2 F9 8D 70 F3 D1 42 2B CD 80 29 49 CB 25 |
| |
| .oooO |
| ( ) Oooo. |
+---------------------&#92; (----( )--------------------+
&#92;_) ) /
(_/


Re: Symbol Creation

Steve Steckler
 

Thanks Mike

Panama Mike wrote:
Steve,

> Just an observation of a very minor issue that LT is probably
> aware of -
>
> When creating an IC symbol (I was drawing a 64-pin LQFP)and when
> inserting pins which are vertically oriented, there are
> occasionally trailing graphics when these pins are placed. I
> notice it usually happens after 6 or 7 vertically oriented
> pins have been placed.

Thank you very much for reporting this.? The fix will be availible
when the next minor update is released.

--Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!



To unsubscribe from this group, send an email to:
LTspice-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


Do you Yahoo!?
- Now only $29.95 per month!


Re: Symbol Creation

 

Steve,

Just an observation of a very minor issue that LT is probably
aware of -

When creating an IC symbol (I was drawing a 64-pin LQFP)and when
inserting pins which are vertically oriented, there are
occasionally trailing graphics when these pins are placed. I
notice it usually happens after 6 or 7 vertically oriented
pins have been placed.
Thank you very much for reporting this. The fix will be availible
when the next minor update is released.

--Mike

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


Re: Models for BB INA111AP

D Chisholm
 

I have models for the INA111 from an old Burr-Brown databook (pre-Texas Instruments). They seem to have produced 3 versions: a Basic model, called ".SUBCKT INA111/BB"; an "Enhanced" model, called ".SUBCKT INA111E/BB"; and another enhanced model called ".SUBCKT INA111Z/BB". About 30K bytes (over 500 lines) altogether for the 3. These are probably the same models you will get from TI, but I assembled them into a single file & posted to this group under the "Files>Lib>Sub" heading.

p.s. - You might still find the whole collection of Burr-Brown models at <ftp://nyquist.ee.ualberta.ca/pub/cookbook/spice/> or some other site that actually archives files, rather than linking to the manufacturer's current web pages.

Hao Fu wrote:

Hi,

It seems that this device is not among the existing examples in LTspice. This device is primarily used for medical instrumentation and data acquisition. Can someone tell me what it takes to make a custom model for it? What is the minimum number of parameters from its data sheet that should be taken into account?


Thanks,

Hao