LTspiceHelpXVII Guide
LTspiceHelpXVII Guide
LTspiceHelpXVII Guide
www.linear.com
www.analog.com
In memory of
Peanut, Spider and Toad.
Introduction
64-bit support
UNICODE(use any character of any living language in schematics,
netlists, or plot)
New device equations(e.g. IGBT, diode soft recovery, and an
arbitrary state machine)
Improved GUI, e.g., editors for most SPICE commands
Extensions to Microsoft Windows for schematic thumbnails and
schematic preview.
http://LTspice.linear.com/software/LTspiceXVII.exe
The software and related documentation are provided "AS IS" and
without warranty of any kind and Linear Technology Corporation
expressly disclaims all other warranties, express or implied,
including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. Under no
circumstances will LTC be liable for damages, either direct or
consequential, arising from the use of this product or from the
inability to use this product, even if we have been informed in
advance of the possibility of such damages.
Example Circuits
Efficiency Report
%HOMEPATH%\Documents\LTspiceXVII\examples\Educational
In the directory
%HOMEPATH%\Documents\LTspiceXVII\examples\jigs
Flag Description
-alt Set solver to Alternate.
Use ASCII .raw files. Seriously degrades
-ascii
program performance.
Run in batch mode. E.g. "XVIIx64.exe -b
-b deck.cir" will leave the data in file
deck.raw
-big Start as a maximized window.
Encrypt a model library. For 3rd parties
wishing to allow people to use libraries
-encrypt without revealing implementation details.
Not used by Linear Technology Corporation
models.
Batch conversion of a binary .raw file to
-FastAccess
Fast Access format.
Specify an .ini file to use other than
-ini <path>
%APPDATA%\LTspiceXVII.ini
-max Synonym for -big
Batch conversion of a schematic to a
-netlist
netlist.
-norm Set solver to Normal.
Batch conversion of a schematic to a PCB
-PCBnetlist
format netlist.
Force LTspice to store user preferences,
-registry MRU, etc. in the registry instead of the
file %APPDATA%\LTspiceXVII.ini
Start simulating the schematic opened on the
-Run command line without pressing the Run
button.
Allow MOSFET's to have up to 7 nodes even in
-SOI
subcircuit expansion.
-sync Sync release
Executes one step of the uninstallation
-uninstall
process.
Schematic Colors
Placing Components
Editing Components
Hierarchy
Basic Schematic Editing
The schematic capture program is used to create new schematics or
modify the example circuits provided. The circuit size and depth
of hierarchy is limited only by computer resources.
The program ships with over 2,000 symbols. These symbols cover
most of LTC's power ICs, opamps, comparators, and many general-
purpose devices for circuit design. You can also draw your own
symbols for devices you wish to import into the program.
Rotate: Rotate the sprited objects. Note this is grayed out when
there are no objected sprited.
Mirror: Mirror the sprited objects. Note this is grayed out when
there are no objected sprited
Draw Wire: Click the left mouse button to start a wire. Each
mouse click will define a new wire segment. Click on an existing
wire segment to join the new wire with an existing one. Right
click once to cancel the current wire. Right click again to quit
this command. You can draw wires through components such as
resistors. The wire will automatically be cut such that the
resistor is now in series with the wire.
Place GND: Place a GROUND symbol. This is node "0", the global
circuit common.
Move: Click on or drag a box around the objects you wish to move.
Then you can move those objects to a new location.
Drag: Click on or drag a box around the objects you wish to drag.
Then you can move those objects to a new location and the
attached the wires are rubber-band with the new location.
There is also a graphical symbol defined for node "COM", but this
node has no special significance. That is, it's not the SPICE
global common and it's not even a global node. It's just sometimes
convenient to have a graphical symbol associated with a node
distinct from ground.
1. You can type in the first few letters of the symbol name and
the browser will jump to that symbol.
4. Any of the symbol search paths set up in the control panel can
be selected.
Programming Keyboard Shortcuts
The menu command Tools=>Control Panel=>Drafting Options=>Hot Keys
allows you to program the keyboard short cuts for most commands.
Simply mouse click on a command and then press the key or key
combination you would like to code for the command. To remove a
shortcut, click on the command and press the "Delete" key.
PCB Netlist Extraction
The schematic menu command Tools=>Export Netlist allows you to
generate the ASCII netlist for PCB layout. Note that you would
have to make a set of symbols that have the same pin order as the
LTspice symbol. Some PCB tools don't even define their diode to
netlist against standard SPICE pin order. Also, LTspice symbol pin
numbers are often different than the Linear Technology product pin
numbers, especially when a product is available in more than one
package.
1. Expert Mode: This is the mode you use most of the time. Simply
point at the text you want to edit, like a component value,
right click, and type in the text you want. When you point at
the text, the mouse cursor will turn into a text caret if you
can edit it.
There are three exceptions to the above rule. There is one special
symbol, jumper, that does not translate into a circuit element,
but is a directive to the netlist generator that there are two
different names for the same electrically identical node. Another
exception is a symbol defined to have a prefix of 'X' and both a
Value and Value2 attributes defined. Such a component netlists as
two lines of SPICE:
.lib <SpiceModel>
<name> node1 node2 [...] <Value2>
.lib <ModelFile>
<name> node1 node2 [...] <SpiceModel> <Value> <Value2>
<SpiceLine> <SpiceLine2>
Adding Attributes
Attribute Visibility
The "Netlist Order" determines the order this pin is netlisted for
SPICE.
Adding Attributes
You can define default attributes for a symbol using the menu
command Edit=>Attributes=>Edit Attributes. The most important
attribute is called the "Prefix". This determines the basic type
of symbol. If the symbol is intended to represent a SPICE
primitive, the symbol should have the appropriate prefix, R for
resistor, C or capacitor, M for MOSFET, etc. See the LTspice
reference for a complete set of SPICE primitives available. The
prefix should be 'X' if you want to use the symbol to represent a
subcircuit defined in a library.
The symbol's attributes can be overridden in the instance of the
symbol as a component in a schematic. For example, if you have a
symbol for a MOSFET with a prefix attribute of 'M', it's possible
to override the prefix to an 'X' on an instance-by-instance basis
so that the transistor can be modeled as subcircuit instead.
Prefix: X
SpiceModel: <name of file including the spicemodel>
Value: <What ever you want visible on the schematic>
Value2: <The value as you want in the netlist>
Rules of Hierarchy
Zooming
Waveform Arithmetic
User-Defined Functions
Axis Control
Plot Panes
Color Control
Attached Cursors
The undo and redo commands allow you to review the different trace
selections no matter which method of selection is used.
If you click the same voltage or current twice, then all other
traces will be erased and the double clicked trace will be
plotted by itself. You can delete individual traces by clicking
on the trace's label after selecting the delete command.
You can also probe the current in a wire. To do this, hold down
the Alt key and click on the wire. The mouse cursor turns into a
current clamp meter to indicate it's pointing at this current
and the red arrow shows the direction of positive current.
2. Menu command Plot Settings=>Visible Traces:
Note that the size of the zoom box is displayed on the status bar
at the bottom so that you can quickly measure differences without
setting up attached cursors.
There are toolbar buttons and menu commands for zooming out,
panning, and returning to the autoranged zoom. The undo and redo
commands allow you to review the different zooms used.
Another zoom mode is to hold down the control key while moving the
mouse or turning the mouse wheel. The software will zoom and pan a
bitmap of the current plot to give an indication of what the plot
would like like when fully rendered. This mode is intended for
huge waveform files that take seconds to redraw.
Waveform Arithmetic
There are three types of mathematical operations that can be
performed on waveform data:
Operand Description
Convert the expressions to either side
&
to Boolean, then AND.
Convert the expressions to either side
|
to Boolean, then OR.
Convert the expressions to either side
^
to Boolean, then XOR.
+ Addition
- Subtraction
* Multiplication
/ Division
Name Value
E 2.7182818284590452354
pi 3.14159265358979323846
K 1.3806503e-23
Q 1.602176462e-19
You can use the menu command View=>FFT to perform a Fast Fourier
transform on various data traces.
LTspice uses a proprietary FFT algorithm that allows an arbitrary
number of datapoints, i.e., not limited to a power of 2.
Then the syntax is the same as the .param and .func statements
used for parameterized circuits. E.g., the line
For complex data, you can choose to plot either phase, group
delay, or nothing against the right vertical axis. You can change
the representation of complex data from Bode to Nyquist or
Cartesian by moving the mouse to the left vertical axis of complex
data.
Plot Panes
Multiple plot panes can be displayed on one window. This allows
better separation between traces and allows different traces to be
independently autoscaled. Traces can be dragged between panes by
dragging the label. A copy of a trace can be made on another pane
by holding down the control key when you release the mouse button.
Color Control
The menu command Tools=>Color Preferences colors allows you to set
the colors used for plotting data. You click on an object in the
sample plot and use the red, green and blue sliders to adjust the
colors to your preferences.
Attached Cursors
There are up to two attached cursors per plotting pane available.
You can attach a cursor to a trace by left mouse clicking on the
trace label. You can attach both cursors to a single trace by
right clicking on the trace label and selecting "1st & 2nd". You
can also attach the 1st or 2nd cursor or both cursors to any trace
by right clicking on that trace's label and using the Attached
Cursor drop down box. The attached cursors can be dragged about
with the mouse or moved with the cursor keys.
When there are active attached cursors, a readout display becomes
visible that will readout the data at the cursors and report the
difference.
Note that there is also mouse cursor readout independent of the
above attached cursor readout. As you move the mouse over the
waveform window, the mouse position is readout on the status bar.
If you drag the mouse as if you were going to zoom, the size of
box is displayed on the status bar. This lets you quickly measure
differences with the mouse cursor. If the horizontal axis is time,
then this time difference is also converted to frequency.
You can measure differences in this manner without performing the
zoom by either pressing the Esc key or right mouse button before
releasing the left mouse button.
The attached cursors can also be used to readout which trace
belongs to which run of a .step/.dc/.temp set of simulation runs.
You can navigate the cursor from dataset to dataset with the
up/down keyboard cursor keys and then right-click on the cursor to
see the step information for that run.
Save Plot Configurations
The menu commands Plot Settings=>Save Plot Settings/Open Plot
Settings files allow you to read and write plot configurations to
disk. Plot setting files are ASCII files that have a file
extension of .plt. The default filename is computed from the name
of the data file by replacing the data file's ".raw" extension
with ".plt" If such a file name exists when a data file is first
opened, that plot settings file is read for initial plot
configuration.
Each analysis type; .tran, .ac, .noise, etc.; has its own entry in
the plot settings file. It isn't possible to load the settings
from one analysis type to another. But you can use the plot
settings file from another simulation of the same analysis type.
Fast Access File Format
During simulation, LTspice usually uses a compressed binary file
format that allows additional simulation data to be appended
without modifying the rest of the file. But once the simulation is
completed, this file format can be slow to access for the purposes
of adding a single new plot trace from the file.
The conversion process can take a long time and use up to one
quarter of your physical memory. In fact, it can take more time to
convert the file to Fast Access format then was required for the
initial simulation. The exact time the conversion requires will
depend on such factors as the state of the hard disk fragmentation
and the amount of physical memory you have. During conversion, you
may find your machine is not very responsive to your mouse and
keyboard. It is possible to convert files in a batch command with
the following command line syntax:
Where <file> is the name of the .raw file you wish to convert to
Fast Access format.
This format is only supported for real data, not the complex data
from a .AC analysis.
Memory, RAM, and Address Space
LTspice was the first PC-based SPICE program to implement its own
64bit address space on the hard disk to allow one to view waveform
data files of essentially unlimited file size.
Introduction
Dot Commands
Circuit Elements
Circuit Description
Circuits are defined by a text netlist. The netlist consists of a
list of circuit elements and their nodes, model definitions, and
other SPICE commands.
You can also open, simulate, and edit a text netlist generated
either by hand or externally generated. Files with the extensions
".net", ".cir", or ".sp" are recognized by LTspice as netlists.
The order of the lines between the comment and end is irrelevant.
Lines can be comments, circuit element declarations or simulation
directives. Let's start with an example:
The first two lines are comments. Any line starting with a "*" is
a comment and is ignored. The line starting with "R1" declares
that there is a 1K resistor connected between nodes n1 and n2.
Note that the semicolon, ";", can be used to start a comment in
the middle of a line. The line starting with "C1" declares that
there is a 100pF capacitor between nodes n2 and ground. The node
"0" is the global circuit common ground.
Leading
Type of line
Character
* Comment
A Special function device
B Arbitrary behavioral source
C Capacitor
D Diode
E Voltage dependent voltage source
F Current dependent current source
G Voltage dependent current source
H Current dependent voltage source
I Independent current source
J JFET transistor
K Mutual inductance
L Inductor
M MOSFET transistor
O Lossy transmission line
Q Bipolar transistor
R Resistor
S Voltage controlled switch
T Lossless transmission line
U Uniform RC-line
V Independent voltage source
W Current controlled switch
X Subcircuit Invocation
Z MESFET or IGBT transistor
. A simulation directive, For example:
.options reltol=1e-4
A continuation of the previous line. The
"+" is removed and the remainder of the
+
line is considered part of the prior
line.
Suffix Multiplier
T 1e12
G 1e9
Meg 1e6
K 1e3
mil 25.4e-6
m 1e-3
u(or μ) 1e-6
n 1e-9
p 1e-12
f 1e-15
Keyword Nsteps
oct No. of steps per octave
dec No. of steps per decade
Total number of linearly spaced
lin steps between StartFreq and
EndFreq
The Fourier analysis is performed over the period from the final
time, Tend, to one period before Tend unless an integer Nperiods
is given after Nharmonics. If Nperiods is given as -1, the Fourier
analysis is performed over the entire simulation data range.
.FUNC -- User Defined Functions
Syntax: .func <name>([args]) {<expression>}
Note that global circuit common is node "0" and that a .global
statement is not required. Also, node names that of the form "$G_"
are also global nodes without being declared in a .global
statement.
.IC -- Set Initial Conditions
The .ic directive allows initial conditions for transient analysis
to be specified. Node voltages and inductor currents may be
specified. A DC solution is performed using the initial conditions
as constraints. Note that although inductors are normally treated
as short circuits in the DC solution in other SPICE programs, if
an initial current is specified, they are treated as infinite-
impedance current sources in LTspice.
This directive includes the named file as if that file had been
typed into the netlist instead of the .include command. This is
useful for including libraries of models or subcircuits.
.inc http://www.company.com/models/library.lib
.inc library.lib
Note that if the url you specify doesn't exist, most web servers
don't return an error, but return a html web page to be displayed
in your web browser that explains the error. LTspice can't always
read these pages as error conditions so you may get some cryptic
error message when the simulation tries to proceed with the
included html language error page included in the simulation as
valid SPICE syntax.
.LIB -- Include a Library
Syntax: .lib <filename>
.lib http://www.company.com/models/library.mod
.lib library.mod
Note that if the URL you specify doesn't exist, most web servers
don't return an error, but return a html web page to be displayed
in your web browser that explains the error. LTspice can't always
read these pages as error conditions so you may get some cryptic
error message when the simulation tries to proceed with the
included html language error page included in the simulation as
valid SPICE syntax.
Encrypted Libraries
* divide by 2 example
V1 1 0 pulse(0 1 0 1u 1u .5m 1m)
V2 c 0 pulse(0 1 0 1u 1u 5m 10m)
R1 2 0 1K
R2 3 0 1K
R3 4 0 1K
.machine
.state S0a 0
.state S0b 0
.state S1a 1
.state S1b 1
.rule S0a S0b V(1) < .5
.rule S0b S1a V(1) > .5
.rule S1a S1b V(1) < .5
.rule S1b S0a V(1) > .5
.rule * S0a V(c) > .5
.output (2) V(1) < .5
.output (3) V(1) > .5
.output (4) state
.endmachine
.tran 30m
.end
Note one can optionally state the type of analysis to which the
.MEAS statement applies. This allows you to use certain .MEAS
statements only for certain analysis types. The name is required
to give the result a parameter name that can be used in other
.MEAS statements. Below are example .MEAS statements that refer to
a single point along the abscissa:
Note that the above examples, while referring to one point along
the abscissa, the requested result is based on ordinate data(the
dependent variables). If no ordinate information is requested,
then the .MEAS statement prints point on the abscissa that the
measurement condition occurs:
Print the first time the condition V(x)=3*V(y) is met. This will
be labeled res6.
The range over the abscissa is specified with the points defined
by "TRIG" and "TARG". The TRIG point defaults to the start of the
simulation if omitted. Similarly, the TARG point defaults to the
end of simulation data. If all three of the TRIG, TARG, and the
previous WHEN points are omitted, then the .MEAS statement
operates over the entire range of data. The types of measurement
operations that can be done over an interval are
Print the value of average value of V(NS01) from the 1st fall of
V(NS05) to 1.5V after 1.1us and the 1st fall of V(NS03) to 1.5V
after 1.1us. This will be labeled res7.
.MEAS AC tmp max mag(V(out)); find the peak response and call it
"tmp"
The AVG, RMS, and INTEG operations are different for .NOISE
analysis than the analysis types since the noise is more
meaningfully integrated in quadrature over frequency. Hence AVG
and RMS both give the RMS noise voltage and INTEG gives the
integrated total noise. Hence, if you add the SPICE directives
.MEAS NOISE out_totn INTEG V(onoise)
the total integrated input and output referenced rms noise will
be printed in the .log file.
ii) Right click in the .log file and, execute context menu
command Plot .step'ed .meas data.
.MODEL -- Define a SPICE Model
Defines a model for a diode, transistor, switch, lossy
transmission line or uniform RC line
*
* This is the circuit definition
.params x=y y=z z=1k*tan(pi/4+.1)
X1 a b 0 divider top=x bot=z
V1 a 0 pulse(0 1 0 .5μ .5μ 0 1μ)
.tran 3μ
.end
Operand Description
Convert the expressions to either side
&
to Boolean, then AND.
| Convert the expressions to either side
to Boolean, then OR.
Convert the expressions to either side
^
to Boolean, then XOR.
The directive .save I(Q2) will save the base, collector and
emitter currents of bipolar transistor Q2. To save a single
terminal current, specify Ic(Q2).
The wildcard characters '*' and '?' can be used to specify data
traces matching a pattern. For example, ".save V(*) Id(*)" will
save every voltage and every drain current.
*
* This is the circuit definition
X1 a b 0 divider
V1 a 0 pulse(0 1 0 .5μ .5μ 0 1μ)
* this is the definition of the subcircuit
.subckt divider n1 n2 n3r1 n1 n2 1k
r2 n2 n3 1k
.ends
.tran 3
.end
Note that unique names based on the subcircuit name and the
subcircuit definition element names are made for the circuit
elements inserted by subcircuit expansion.
.TEMP -- Temperature Sweeps
This is an archaic form for the step command for temperature. It
performs the simulation for each temperature listed.
The syntax
is equivalent to
Examples:
steady: Stop the simulation when steady state has been reached.
The automatic steady state detection can fail either by being too
critical or not critical enough. You can interactively specify
steady state in the following manner: As soon as the simulation
starts, execute menu command Simulate=>Efficiency
Calculation=>Mark Start. The first time you execute this command
you tell LTspice you're going to manually specify the integration
limits. After the circuit looks like it's reached steady-state,
execute that command again. That will clear the history and
restart the Efficiency Calculation. Then, after awhile, as in you
see well more than 10 clock cycles, execute Simulate=>Efficiency
Calculation=>Mark End. Each time you execute Simulate=>Efficiency
Calculation=>Mark Start you restart the efficiency calculation and
clear the waveform history. This is a good method of preventing
the data file from becoming too large and slowing down plotting,
so it's recommended that you periodically execute
Simulate=>Efficiency Calculation=>Mark Start whenever it is clear
that you've accumulated substantial data that you don't want to be
included in the integration of efficiency.
2. ramp the step load to the next value in the list of currents at
the rate of 20A/μs.
4. change the step load to the next value in the list or quit if
there is none.
The load current starts with 0.5A at time 0, stays at 0.5A at 1ms,
switches to 0.1A at time 1.01ms, stays at 0.1A until 3ms, and
switches to 0.5A at 3.01ms and stays at 0.5A.
The PWL can have almost unlimited pairs of (time, value) sequence.
Circuit Element Quick Reference
Component Syntax
Axx n1 n2 n3 n4 n5 n6 n7 n8
Special functions
+ <model> [extra parameters]
Arbitrary behavioral
Bxx n+ n- <V=... or I=...>
source
Cxx n+ n- <capacitance>
+ [ic=<val.>] [Rser=<val.>]
Capacitor
+ [Lser=<val.>] [Rpar=<val.>]
+ [Cpar=<val.>] [m=<val.>]
Diode Dxx A K <model> [area]
Voltage dependent
Exx n+ n- nc+ nc- <gain>
voltage
Current dependent
Fxx n+ n- <Vnam> <gain>
current
Voltage dependent
Gxx n+ n- nc+ nc- <transcond.>
current
Current dependent
Hxx n+ n- <Vnam> <transres.>
voltage
Independent current
Ixx n+ n- <current>
source
Jxx D G S <model> [area] [off]
JFET transistor
+[IC=<Vds,Vgs>] [temp=<T>]
Mutual inductance Kxx L1 L2 L3... <coeff.>
Lxx n+ n- <inductance>
+ [ic=<val.>] [Rser=<val.>]
Inductance
+ [Rpar=<val.>]
+ [Cpar=<val.>] [m=<val.>]
Mxx D G S B <model> [L=<len>]
+ [W=<width>] [AD=<area>]
+ [AS=<area>] [PD=<perim>]
MOSFET transistor + [PS=<perim>] [NRD=<value>]
+ [NRS=<value>] [off]
+ [IC=<Vds, Vgs, Vbs>
+ [temp=<T>]
Lossy transmission
Oxx L+ L- R+ R- <model>
line
Qxx C B E [S] <model> [area]
Bipolar transistor
+ [off] [IC=Vbe,Vce][temp=<T>]
Resistor Rxx n1 n2 <value>
Voltage controlled Sxx n1 n2 nc+ nc- <model>
switch + [on,off]
Lossless transmission Txx L+ L- R+ R- ZO=<value>
line + TD=<value>
Uxx n1 n2 ncommon <model>
Uniform RC-line
+ L=<len> [N=<lumps>]
Independent voltage
Vxx n+ n- <voltage>
source
Current controlled Wxx n1 n2 <Vnam> <model>
switch + [on,off]
Subcircuit Xxx n1 n2 n3... <subckt name>
MESFET or IGBT Zxx D G S model [area] [off]
transistors + [IC=<Vds,Vgs>]
A. Special Functions
Symbol names: INV, BUF, AND, OR, XOR, SCHMITT, SCHMTBUF, SCHMTINV,
DFLOP, VARISTOR, and MODULATE
Syntax: Annn n001 n002 n003 n004 n005 n006 n007 n008 <model>
[instance parameters]
INV, BUF, AND, OR, and XOR are generic idealized behavioral gates.
All gates are netlisted with eight terminals. These gates require
no external power. Current is sourced or sunk from the
complementary outputs, terminals 6 and 7, and returned through
device common, terminal 8. Terminals 1 through 5 are inputs.
Unused inputs and outputs are to be connected to terminal 8. The
digital device compiler recognizes that as a flag that that
terminal is not used and removes it from the simulation. This
leads to the potentially confusing situation where AND gates act
differently when an input is grounded or at zero volts. If ground
is the gate's common, then the grounded input is not at a logic
false condition, but simply not part of the simulation. The reason
that these gates are implemented like that is that this allows one
device to act as 2-, 3-, 4- or 5- input gates with true, inverted,
or complementary output with no simulation speed penalty for
unused terminals. That is, the AND device acts as 12 different
types of AND gates. The gates default to 0V/1V logic with a logic
threshold of .5V, no propagation delay, and a 1Ohm output
impedance. Output characteristics are set with these instance
parameters:
Note that not all parameters can be specified on the same instance
at the same time, e.g., the output characteristics are either a
slewing rise time or an RC time constant, not both.
The exclusive XOR device has non-standard behavior when more than
two inputs are used: The output is true only when exactly one of
all inputs is true. Use the associative property of XOR's with
multiple XOR devices to implement an XOR block with more than two
inputs.
Operand Description
Convert the expressions to either side to Boolean,
&
then AND.
| Convert the expressions to either side to Boolean,
then OR.
Convert the expressions to either side to Boolean,
^
then XOR.
Note that LTspice uses the caret character, ^, for Boolean XOR and
"**" for exponentiation. Also, LTspice distinguishes between
exponentiation, x**y, and the function pwr(x,y). Some 3rd party
simulators have an incorrect implementation of behavioral
exponentiation, evaluating -3**3 incorrectly to 27 instead of -27,
presumably in the interest of avoiding the problem of
exponentiating a negative number to a non-integer power. LTspice
handles this issue by returning the real part of the result of the
exponentiation. E.g., -2**1.5 evaluates to zero which is the real
part of the correct answer of 2.82842712474619i. This means that
when you import a 3rd party model that was targeted at a 3rd party
simulator, you may need to translate the syntax such as x^y to
x**y or even pwr(x,y).
Name Description
Rser Equivalent series resistance
Lser Equivalent series inductance
Rpar Equivalent parallel resistance
Cpar Equivalent parallel capacitance
RLshunt Shunt resistance across Lser
m Number of parallel units
Instance temperature(for tempcos
temp in a corresponding .model
statement)
Initial voltage(used only if uic
ic
is flagged on the .tran card)
Cnnn n1 n2 Q=100p*x
Cnnn n1 n2 Q=x*if(x<0,100p,300p)
Examples:
D1 SW OUT MyIdealDiode
D2 SW OUT dio2
Ioffset+Iamp*exp(-(time-Td)*Theta)*sin(2*p*Freq*(time-
Td)+p*phi/180)
For times less than Td1, the output current is I1. For times
between Td1 and Td2 the current is given by>
I1+(I2-I1)*(1-exp(-(time-Td1)/Tau1))
I1+(I2-I1)*(1-exp(-(time-Td1)/Tau1))-(I2-I1)*(1-exp(-(time-
Td2)/Tau2))
Ioff+Iamp*sin((2.*p*Fcar*time)+MDI*sin(2.*p*Fsig*time)).
For times before t1, the current is i1. For times between t1 and
t2, the current varies linearly between i1 and i2. There can be
any number of time, current points given. For times after the last
time, the current is the last current.
Examples:
J1 0 in out MyJFETmodel
.model MyJFETmodel NJF(Lambda=.001)
J2 0 in out MyPJFETmodel
.model MyPJFETmodel PJF(Lambda=.001)
The JFET model is derived from the FET model of Shichman and
Hodges extended to include Gate junction recombination current and
impact ionization. The DC characteristics are defined by the
parameters VTO and BETA, which determine the variation of drain
current with gate voltage; LAMBDA, which determines the output
conductance; and Is, the saturation current of the two gate
junctions. Two ohmic resistances, Rd and Rs, are included. Charge
storage is modeled by nonlinear depletion layer capacitances for
both gate junctions; which vary as the -1/2 power of junction
voltage and are defined by the parameters Cgs, Cgd, and PB. A
fitting parameter B has been added. See A. E. Parker and D. J.
Skellern, An Improved FET Model for Computer Simulators, IEEE
Trans CAD, vol. 9, no. 5, pp. 551-553, May 1990.
The line
K1 L1 L2 L3 L4 1.
K1 L1 L2 1.
K2 L2 L3 1.
K3 L3 L4 1.
K4 L1 L3 1.
K5 L2 L4 1.
K6 L1 L4 1.
Name Description
Rser Equivalent series resistance
Rpar Equivalent parallel resistance
Cpar Equivalent parallel capacitance
m Number of parallel units
Initial current(used only if uic
ic
flagged on the .tran card)
Linear inductance temperature
tc1
coeff.
Quadratic inductance temperature
Tc1
coeff.
temp Instance temp
*
L1 N001 0 Flux=1m*tanh(5*x)
I1 0 N001 PWL(0 0 1 1)
.tran 1
.end
The upper and lower branches of the hysteresis major loop are
given by
and
*
L1 N001 0 Hc=16. Bs=.44 Br=.10 A=0.0000251
+ Lm=0.0198 Lg=0.0006858 N=1000
I1 0 N001 PWL(0 0 1 1)
.tran .5
.options maxstep=10u
.end
M. MOSFET
Symbol Names: NMOS, NMOS3, PMOS, PMOS3There are two fundamentally
different types of MOSFETS in LTspice, monolithic MOSFETs and a
new vertical double diffused power MOSFET model.
Monolithic MOSFET:
M1 Nd Ng Ns 0 MyMOSFET
.model MyMOSFET NMOS(KP=.001)
M1 Nd Ng Ns Nb MypMOSFET
.model MypMOSFET PMOS(KP=.001)
Example:
M1 Nd Ng Ns Si4410DY
.model Si4410DY VDMOS(Rd=3m Rs=3m Vto=2.6 Kp=60
+ Cgdmax=1.9n Cgdmin=50p Cgs=3.1n Cjo=1n
+ Is=5.5p Rb=5.7m)
Monolithic MOSFETS are four terminal devices. Nd, Ng, NS, and Nb
are the drain, gate, source, and bulk; i.e., substrate; nodes. L
and W are the channel length and width, in meters. AD and AS are
the areas of the drain and source diffusions, in square meters.
Note that the suffix u specifies μm and p square μm. If any of L,
W, AD, or AS are not specified, default values are used. PD and PS
are the perimeters of the drain and source junctions, in meters.
NRD and NRS designate the equivalent number of squares of the
drain and source diffusions; these values multiply the sheet
resistance RSH specified on the .MODEL control line. PD and PS
default to zero while NRD and NRS to one. OFF indicates an initial
condition on the device for DC analysis. The initial condition
specification using IC=VDS, VGS, VBS is for use with the UIC
option on the .TRAN control line, when a transient analysis is
desired starting from other than the quiescent operating point.
The optional TEMP value is the temperature at which this device is
to operate, and overrides the temperature specification on the
.OPTION control line. The temperature specification is ONLY valid
for level 1, 2, 3, and 6 MOSFETs, not for level 4, 5 or 8 BSIM
devices.
level model
------------------------------------------------------
1 Shichman-Hodges
Gate-source
overlap
Cgso capacitance per F/m 0. 4e-11
meter channel
width
Gate-drain overlap
capacitance per
Cgdo F/m 0. 4e-11
meter channel
width
Gate-bulk overlap
capacitance per
Cgbo F/m 0. 2e-10
meter channel
width
Drain and source
Rsh diffusion sheet Ω 0. 10.
resistance
Zero-bias bulk
junction bottom
Cj capacitance per F/m2 0. 2e-4
square meter of
junction area
Bulk junction
Mj bottom grading - 0.5 0.5
coefficient
Zero-bias bulk
junction sidewall
Cjsw capacitance per F/m 0. 1p
meter of junction
perimeter
Bulk junction
.50 level 1
Mjsw sidewall grading -
.33 level 2,3
coefficient
Bulk junction
saturation current
Js A/m2 0. 1u
per square-meter
of junction area
Bulk junction
saturation current
Jssw A/m 0. 1n
per meter of
sidewall
Tox Oxide thickness m 1e-7 1e-7
Nsub Substrate doping 1/cm3 0. 4e15
Surface state
Nss density 1/cm2 0. 1e+10
*]The model name VDMOS is used both for a N-channel and P-channel
device. The polarity defaults to N-channel. To specify P-channel,
flag the model with the keyword "pchan", e.g., ".model xyz
VDMOS(Kp = 3 pchan)" defines a P-channel transistor.
Example:
O1 in 0 out 0 MyLossyTline
.model MyLossyTline LTRA(len=1 R=10 L=1u C=10n)
Example:
Model Structure
VBIC Parameters
References:
Example:
S1 out 0 in 0 MySwitch
.model MySwitch SW(Ron=.1 Roff=1Meg Vt=0 Vh=-.5 Lser=10n Vser=.6)
The voltage between nodes nc+ and nc- controls the switch's
impedance between nodes n1 and n2. A model card is required to
define the behavior of the switch. See the schematic file
.\examples\Educational\Vswitch.asc to see an example of a model
card placed directly on a schematic as a SPICE directive.
where
A = log(Roff / Ron) / p
B = log(1 / (Roff * Ron)) / 2
L+ and L- are the nodes at one port. R+ and R- are the nodes for
the other port. Zo is the characteristic impedance. The length of
the line is given by the propagation delay Td.
This element models only one propagation mode. If all four nodes
are distinct in the actual circuit, then two modes may be excited.
To simulate such a situation, two transmission-line elements are
required. See the schematic file
.\examples\Educational\TransmissionLineInverter.asc to see an
example simulating both modes of a length of coax.
U. Uniform RC-line
Symbol Names: URC
N1 and N2 are the two element nodes the RC line connects, whereas
Ncom is the node to which the capacitances are connected. MNAME is
the model name and LEN is the length of the RC line in meters.
Lumps, if specified, is the number of lumped segments to use in
modeling the RC line. A guess at an appropriate number of lumps to
use will be made if lumps is not specified.
Voffset+Vamp*sin(p*Phi/180)
Voffset+Vamp*exp(-(time-Td)*Theta)*sin(2*p*Freq*(time-
Td)+p*Phi/180)
For times less than Td1, the output voltage is V1. For times
between Td1 and Td2 the voltage is given by
V1+(V2-V1)*(1-exp(-(time-Td1)/Tau1))
V1+(V2-V1)*(1-exp(-(time-Td1)/Tau1))-(V2-V1)*(1-exp(-(time-
Td2)/Tau2))
Voff+Vamp*sin((2.*p*Fcar*time)+MDI*sin(2.*p*Fsig*time))
For times before t1, the voltage is v1. For times between t1 and
t2, the voltage varies linearly between v1 and v2. There can be
any number of time, voltage points given. For times after the last
time, the voltage is the last voltage.
Example:
The current through the named voltage source controls the switch's
impedance. A model card is required to define the behavior of the
current controlled switch.
*
* This calls the circuit
X1 in out 0 divider top=9K bot=1K
V1 in 0 pulse(0 1 0 .5m .5m 0 1m)
*
* This is the subcircuit definition
.subckt divider A B C
R1 A B {top}
R2 B C {bot}
.ends divider
*
.tran 3m
.end
Z. MESFET and IGBT Transistors
Symbol Names: MESFET, NIGBT, PIGBT
Save Defaults
SPICE
Drafting Options
Netlist Options
Waveforms
Operation
Hacks
Internet Options
Compression
.options plotwinsize=0
Save Defaults
These settings are used when you don't explicitly state which
nodes should be saved in a simulation. Useful settings are "Save
Device Currents", "Save Subcircuit Node Voltages", and "Save
Subcircuit Device Currents". Device voltages and internal device
voltages are only of internal program development use.
Save Device Currents: Check this so that you can plot device and
terminal currents. You will also need it to be able to plot
dissipation.
Save Subcircuit Node Voltages: You will need to check this to plot
voltages in hierarchical designs.
Don't save Ib(), Ie(), Is(), Ig(): This saves only the
collector(drain) currents of transistors in the interest of
reducing the size of the output .data file. This is useful for
IC design, but it using it means that there isn't enough data
available to compute transistor dissipation.
Save Device Currents: Check this so that you can plot device and
terminal currents. You will also need it to be able to plot
dissipation.
SPICE
This pane allows you to define the various defaults for LTspice.
These defaults can be overridden in any simulation by specifying
the options in a .option statement in that simulation. Usually you
can leave these options as they are.
One default you may want to change is Trtol. Most SPICE programs
default this to 7. In LTspice this defaults to 1 so that
simulations are extremely unlikely to show any simulation
artifacts in their waveforms. Trtol affects the timestep strategy
more than directly affecting the accuracy of the simulation. For
transistor-level simulations, a value larger than 1 is usually a
better overall solution. You might find that you get a speed of 2x
if you increase trtol with out adversely affecting simulation
accuracy. Your trtol setting is remembered between program
invocations. However, most of the traditional SPICE tolerance
parameters, gmin, abstol, reltol, chgtol, vntol are not remembered
between program invocations in order to encourage use of the
default values. If you want to use something other than the
default values, you will have to write a .option statement
specifying the values you want to use and place it on the
schematic or keep the settings in a file and .inc that file.
Allow direct component pin shorts: Normally you can draw a wire
directly through a component and the wire segment shorting pins
is deleted. If you check it, the shorting wire will not be
automatically deleted.
Automatically scroll the view: Checking this box makes the view of
the schematic scroll as you move the mouse close the edge while
editing the schematic.
Cut angled wires during drags: During the Drag command, a non-
orthogonal wire will be broken into two connected wires if you
click along the middle of the wire
Draft with thick lines: Increases the all line widths. Useful for
generating images for publication.
This panel allows you to enter additional paths than the default
to find symbols and libraries. List each directory on it's own
line.
Waveforms
This pane allows you to configure some aspects of the waveform
viewer.
Use "XOR" type cross hair cursor: The XOR cursor is a cross hair
that is visible no matter what screen color is behind the
cursor. For example, if the background is black, the cursor is
white and visa versa. But note that it actually isn't an XOR
function, because the cursor is still highly visible even
against a grey background where the XOR'ed value has all
inverted bits but the color is not distinguishably different.
Using the "XOR" cursor is highly desirable, but not all video
hardware and drivers get this right. Hence LTspice supports an
opaque cursor that is in high contrast to the waveform window
background but not necessarily in high contrast to the plot
data. This less desirable cursor is the installation default
since some hardware can't do the "XOR" cursor properly.
Directory for .raw and .log datafiles: This is useful if you want
to specify a RAM disk or SSD drive for waveform data.
Operation
RAM for Fast Access Conversion: This allows you to tune memory
usage when you convert waveform data to fastaccess files format.
This pane of the Control Panel is used for the incremental updates
obtained from the web. LTspice is often updated with new features
and models. Use the menu command Tools=>Sync Release to update to
the current version. If you don't update for a couple months,
LTspice will begin to ask if you would like to check for updates.
LTspice never accesses the web without asking for your permission
to do so. LTspice contains no spyware or transmits any type of
data while obtaining the files it needs for updating.
Don't cache files: Neither cache nor use files cached on your
machine for the update.
Program Updates
Simulating Transformers
Third-party Models
Inductor Models
MOSFET Models
Efficiency Calculation
Custom Symbols
Memory Problems
Model Compatibility
SPICE Netlist
Paper Manual
Tutorials
Users' Group
SPICE Differentiation
So just why is LTspice better than other SPICE programs?
Sure, but what's the big TECHNICAL difference between LTspice and
any other SPICE out there? Aren't all SPICE's based on Berkeley
SPICE and essentially the same solver?
Note that article uses screen dumps from an old version of PSpice
for comparison to the better solver in LTspice, but the netlists
are machine readable and you can run them in the current versions
of commercial simulators to see that (i) the problems persist and
(ii) SPICE solver development as stopped at SPICE software
companies.
How can you possibly know whether a routine runs in on-chip CPU
cache or the PCB mounted RAM?
Once installed, there are two ways to getting the latest version.
You can always reinstall the program again as mentioned in
Installation Problems. The installer can optionally do an update
instead or full install so you don't lose your preference
settings. You don't have to remove the old version before
installing. The other possibility to get the latest release is
simply by using the Sync Release feature.
After you have updated your file to the latest version, the file
Changelog.txt in your root installation directory, usually at
C:\Program Files\LTC\LTspiceXVII\Changelog.txt, has a detailed
program revision list.
Can I go back to the old version after I execute the Sync Release
command?
No. All symbols, models, and programs are updated with the current
version. The component databases, standard.*, will be merged with
the new ones automatically. If you added new inductors or
capacitors, your devices will be preserved and merged with the new
ones from the update.
Simulating Transformers
How do I simulate a transformer?
Sure:
ii) Measure winding ESR with an ohmmeter. Use twice these values
in simulation since the resistance at frequency is higher than
the DC value. My experience with ferrite and switchers is that
it is usually nearly a factor of two higher.
iii) Short all but most inductive windings and measure the leakage
inductance with the DC LCR meter. Adjust the coupling
coefficient to match this, or for the case of two windings:
K = sqrt(1-Lleak/sqrt(L1*L2))
Lleak = sqrt(L1*L2)*(1-K*K)
v) Enjoy.
Basically there are two types of third party SPICE models, those
described with a .MODEL statement and those defined with a
.SUBCKT.
The way how to include the model in LTspice depends on whether the
model is given as a .MODEL statement or a .SUBCKT.
3. Now either
or
or
3. Either
or
2. Move the cursor over the body of the newly-placed NPN symbol
instance. Press <Ctrl>RightMouseButton. A dialog box will
appear. Change Prefix: QN to Prefix: X. This causes this
instance of the symbol to netlist as a subcircuit instead of
an intrinsic bipolar transistor.
4. Then either
or
You first (i) draw at least two inductors and then (ii) define the
K coefficient between the two inductors. See mutual inductance
section.
Yes, you can distribute the software freely whether you are a
Linear Technology customer or not. See the license section for
more details.
You need to add the keyword "steady" steady to the .tran command,
e.g., ".TRAN <time> steady". The program will detect the steady
state by checking the internal state of the switcher macromodel.
It doesn't work when a switching regulator part is not part of the
circuit because the steady state detection is implemented in the
model -- usually by looking for the the current flowing out of the
error amplifier to drop to zero as integrated over a switching
cycle. There must be exactly one voltage source in the circuit.
This will be identified as the input. There must be exactly one
current source in the circuit, though a resistor with the name of
Rload can be used instead. This will be identified as the load.
After the simulation is done, you can select the 'Efficiency
Report' under the 'View' menu to see the report on the schematic.
Custom Symbols
Can I create my own symbols?
Not very easily. The switching regulator models that ship with
LTspice XVII use a new hardware description language and new
intrinsic SPICE devices designed to encapsulate the behavior of
LTC's switching regulator products. Even if you succeed in making
a model with standard SPICE primitives, the simulation will run
orders of magnitude slower. Note that some people have made such
switching regulator models with standard SPICE devices. LTspice
can run these models and will usually outperform the simulator for
which they were targeted.
Memory Problems
How much memory do I need to run the program?
If you can run Windows, you can run LTspice XVII. We have spent a
great deal of effort in minimizing the memory requirement of this
program. There are no memory leaks. But waveform data requires
memory and that is where people run into trouble. An x64 OS will
be the best choice in this regard.
All the waveform data are stored on disk. Only the plotted traces
are loaded into RAM. Turning off the marching waveforms can reduce
the memory requirement. Note that for most analysis types, there
is no particular file size limit. You can generate and view .raw
files that are very many Gigabytes in size.
OK, I've done everything and I'm still running out of memory. What
can I do?
Just open the text file first and then run it. LTspice XVII will
recognize the file as a netlist if it has file extension of ".cir"
Exporting/Merging Waveform Data
Can I export the waveform data to other applications?
OK, that works for bitmaps, but can I get the data itself to an
application like Excel?
But isn't there any way to export the waveform data to other
applications without resorting to 3rd party software?
Yes. Make the waveform window the active window and use menu
command File=>Export.
Yes. Do the the FFT of the desired data. Before the FFT, the data
is interpolated to equally spaced time steps. Now do the FFT on
the FFT'ed data. That will recover the equally spaced time-step
data and export that.
Then enter the number of bins you want to use. LTspice uses a
proprietary FFT algorithm that works for an arbitrary number of
bins.
Step 1: Identify a point in the SMPS feed back loop where a low
impedance source is driving a high impedance input. Two
places are useful for this, either in series with the
feedback pin of the SMPS controller or between the output
to the top of the resistor divider going to the feedback
pin.
Step 3: Label the nodes to either end of this voltage source "A"
and "B" The direction of feedback should be from node A to
node B. For example, if the voltage source is connected
directly to the feedback pin, node B is the feedback pin
and node A is the one on the other side of the voltage
source.
.param t0=.2m
.tran 0 {t0+10/freq} {t0}
Notice that t0 appears in both the 2nd and 3rd parameters of the
.tran command. The 2nd parameter is the stop time. The difference
between start and stop times has been chosen as 10/freq, i.e., an
integral number of perturbation cycles. Ideally, the Fourier
analysis would be done over a period that is both an integral
number of perturbation cycles and switching cycles, but his isn't
always possible. Since loop gain must drop to less than unity at a
frequency that is a fraction of the switching frequency, there are
always more switching cycles than perturbation cycles and an
integral number of perturbation cycles is used with the hope the
error from a non-integral number of switching cycles will be small
since many switching cycles are included.
.param Freq=15K
Armed with the above technique, one might feel ready to go and
conquer SMPS design with Bode analysis of the feedback loop. I
understand the temptation. It'd be rewarding if one could traverse
the feedback loop identifying the components that gave rise to the
poles and zeros, strategize which zeros to move to cancel which
poles, and synthesize component values for the compensation
network components to achieve a stable feedback loop. But that's
pretty much exactly what you can't do with this technique or any
other frequency domain technique. Let me explain why.
%HOMEPATH%\Documents\LTspiceXVII\examples\Educational\FRA\Eg3.asc
Now, since each pole can cause a phase shift infinitesimally close
to 90° and the controller must cause some additional delay, one
might think that some circuit design is necessary to ensure a
stable feedback loop. But that's not really the case particularly
if one is using an aluminum electrolytic cap output filter
capacitor because it has ESR and that will put a zero in the
response. Also, since we buy compensation cap C1 a series
resistor, R1, that also puts another zero in the response.
Further, the delay from the controller is a very small fraction of
the switching frequency. At the loop crossover frequency and
below, that delay is negligible. This all means that the loop is
stable and it isn't possible to synthesize component values since
the loop is stable for all component values. This argument
basically is pointing out that as soon as the signal regulated by
the feedback loop of a current mode SMPS is well- described by the
current averaged over one switching cycle, that loop is stable.
The last advise I can offer answers how one can be sure that a
SMPS is stable and operating in current mode. The answer is to
start with the schematic on the front page of the datasheet. The
critical information there are the inductance value, output filter
capacitance, and external compensation component values. Some
datasheets give equations for computing these values, but I just
start with those values and adjust using time domain simulation to
evaluate the response. After all, the whole point of frequency
domain analysis is to improve the time domain response. With
current-mode switchers, it usually more direct to jump right to
time-domain simulation to check overshoot since stability has
already been achieved.
No. But there are reports that LTspice XVII does run on Linux
under WINE.
Copy the appropriate .rpm file to your machine and open it from
nautilus.
WINE is doing the best it can with the fonts it finds. It will do
better if you tell it how to find the font files from your Windows
system.
The PWL additional point editor doesn't look right under WINE?
Try using the native Windows .dll from your licensed Windows
system. The command line to then invoke LTspice from WINE is wine
-dll commctrl,comctl32=n XVIIx64.exe.
Every Linux user you ask will tell you that LTspice runs better
under Linux than Windows.
No.
Paper Manuals
What about a Paper Manual?
These help pages are the manual. They are set up such that you can
print them in one complete set, but please think of the
environment before doing so.
Voffset+Vamp*sin(p*Phi/180)
Voffset+Vamp*exp(-(time-Td)*Theta)*sin(2*p*Freq*(time-
Td)+p*Phi/180)
For times less than Td1, the output voltage is V1. For times
between Td1 and Td2 the voltage is given by
V1+(V2-V1)*(1-exp(-(time-Td1)/Tau1))
V1+(V2-V1)*(1-exp(-(time-Td1)/Tau1))-(V2-V1)*(1-exp(-(time-
Td2)/Tau2))
Voff+Vamp*sin((2.*p*Fcar*time)+MDI*sin(2.*p*Fsig*time))
For times before t1, the voltage is v1. For times between t1 and
t2, the voltage varies linearly between v1 and v2. There can be
any number of time, voltage points given. For times after the last
time, the voltage is the last voltage.
L+ and L- are the nodes at one port. R+ and R- are the nodes for
the other port. Zo is the characteristic impedance. The length of
the line is given by the propagation delay Td.
This element models only one propagation mode. If all four nodes
are distinct in the actual circuit, then two modes may be excited.
To simulate such a situation, two transmission-line elements are
required. See the schematic file
.\examples\Educational\TransmissionLineInverter.asc to see an
example simulating both modes of a length of coax.
SPICE Error Log Command
Use this command to display the simulation log file. A typical log
file is shown as follows:
Circuit: * LT1300-DC035A.asc
Date: Tue Oct 05 16:57:31 1999
Total elapsed time: 6.64 seconds.
tnom = 27
temp = 27
method = modified trap totiter = 14872
traniter = 14862
tranpoints = 3865
accept = 2986
rejected = 879
trancuriters = 0
matrix size = 12
fillins = 2
solver = Normal
K. Mutual Inductance
Symbol Names: None, this is placed as text on the schematic.
The line
K1 L1 L2 L3 L4 1.
K1 L1 L2 1.
K2 L2 L3 1.
K3 L3 L4 1.
K4 L1 L3 1.
K5 L2 L4 1.
K6 L1 L4 1.