The University of Evansville LTSpice IV Component Library

advertisement
The University of Evansville
LTSpice IV Component Library
University of Evansville
December 30, 2008
LTspice IV is a high-performance, general-purpose circuit simulation program. It was developed by
Linear Technology for simulation of their switch mode power supplies. LTspice IV may be
downloaded for free from http://www.linear.com. (The direct link to the program is
http://ltspice.linear.com/software/LTspiceIV.exe). LTspice IV uses LTspice as its circuit simulation
engine. LTspice is one of many modern derivatives of the SPICE (Simulation Program with Integrated
Circuit Emphasis) program originally developed at UC Berkeley in the 1970s. LTspice is an enhanced
SPICE and uses standard SPICE program syntax. Note: You may see references to SwitcherCAD III or
LTspice with SwitcherCAD III in the on-line documentation. The program is now know as LTspice IV.
LTspice IV is a very powerful circuit simulation tool, but it can be a little intimidating to use for
students who are just starting in circuits or electronics. The University of Evansville LTspice IV library
is designed for students who have no previous experience with circuit simulation. The UE library uses
symbols that are most commonly found in introductory circuits and electronics texts. It uses default
models for diodes, transistors and operational amplifiers that are usually adequate for simulation of
homework problems. The behavior of the default models can be changed by changing model
paramters. The UE models use parameters that are consistent with the models used in introductory
electronics courses.
In many cases the UE library components are implemented using what are known as SPICE
subcircuits. The simulations will be slower than those using LTspice IV native components. (With a
reasonably fast computer you will notice little difference in speed when simulating circuits commonly
encountered in introductory circuits and electronics courses.) The library is designed to be added to an
existing LTspice IV installation without overwriting any existing symbols or libraries. This allows the
standard LTspice IV components to be used along with the UE components if desired.
The UE library is designed so that students can start using LTspice IV without having to learn the
SPICE circuit description language. (A SPICE circuit description file is known as a netlist.) As you
progress in electronics you will want to learn more about SPICE models and netlists. You will want to
write your own diode and transistor model statements. The LTspice IV online help is excellent and
contains a very good description of SPICE syntax and statements. There are also several good books
available on the SPICE simulation language and models.
SPICE is certainly one of the most accurate circuit simulation programs available, but no circuit
simulation program is perfect. Simulation can be a valuable design and analysis tool, but it is never an
acceptable substitute for design verification using a prototype circuit on a breadboard.
Basic Components
The basic components (resistors, capacitors, inductors) in the UE library have small triangles near one
terminal so that the positive current direction assumed by LTspice IV can be easily determined from the
schematic. The standard LTspice IV resistor symbol is shown as R1 in Figure 1 below, while the UE
resistor is shown as R2. The assumed positive current direction in R2 is into the terminal near the
triangle, through the device, and then out the other terminal. A negative current in R2 would imply that
the current is flowing in the opposite direction. (To determine the assumed positive current direction in
the default LTspice IV R1 component you must examine the Spice netlist.) UE library basic
components have default values whereas the LTspice IV components do not. (You will normally need
to change the values from the defaults regardless.) The default values of UE library resistors,
capacitors, and inductors is 1 kΩ (1000 Ohms), 1 μF (1 x 10-6 Farads), and 1 mH (1 x 10-3 Henrys)
respectively.
Figure 1: LTspice IV and UE Resistor Symbols
Dependent Sources
There are four types of dependent sources. There are voltages source whose voltage is a multiple of
either a voltage or current elsewhere in the circuit. These are known as voltage-dependent voltage
sources (or V of V sources) and current-dependent voltage sources (or V of I sources) respectively.
There are also current course whose current is a multiple of either a current or voltage elsewhere in the
circuit. These sources are known as current-dependent current sources (I of I sources) and voltagedependent current sources (I of V sources).
Dependent sources in the UE library (and in LTspice IV) look different than the standard dependent
source symbols. The standard symbol for a dependent source is the same as that used for an
independent source (or often a diamond symbol is used for the dependent source). Algebraic notation
is used to indicate the dependent relationship. For example, next to an independent voltage source you
may see notation such as 10 V or 10 sin(2000 t) which indicates that the generated voltage does not
depend on any other voltage or current in the circuit. Next to a dependent voltage source you might see
notation like 100 vA (for a voltage-dependent source) or 20 iB (for a current-dependent source). Instead
of this algebraic notation the UE library voltage-dependent symbols include a pair of terminals that
must be wired to the corresponding voltage dependency (vA) and the current-dependent symbols
include a wire through which the sensed current must be routed.
The default LTspice IV and UE Voltage-Dependent Voltage Source symbols are shown in Figure 2.
The LTspice IV symbol name for this component is “e” while the UE name is “v_of_v_1”. The two
components are very similar in the way in which they are used. The voltage at the generating pair of
terminals is a constant multiple of the voltage present at the sensing pair of terminals. Right-click on
the symbol to bring up the Component Attribute Editor window in which the gain value (Av) can be
changed. The UE library dependent sources are implemented as SPICE subcircuits and the standard
SPICE subcircuit parameter passing mechanism is used to set the multiplier value for the dependent
source. The multiplier must be written as Av=1, Av=2k, Av=1/500, etc. (You must specify the
parameter name and value with an equal sign in between.) An error will occur during simulation if you
try to use just 1, 2k, 1/500, etc.
Figure 2: LTspice IV and UE Voltage Dependent Voltage Source Symbols
Figure 3 shows a circuit that uses a voltage-dependent voltage source. (This circuit uses the
“v_of_v_2” source in which the voltage polarity of the sensing terminals is opposite that of the
“v_of_v_1” source. Either source can be used with equivalent results in any circuit. Using the
“v_of_v_2” source in this schematic allows the schematic to be drawn without crossing any wires.)
The voltage produced by the dependent source is twice the voltage across resistor R1 (as measure from
the left side of the resistor to the right side of the resistor). Note that making connections to the sensing
pair of terminals has no effect on the rest of the circuit.
Figure 3: Example Use of the Voltage Dependent Voltage Source
The LTspice IV and UE voltage-dependent current sources are shown in Figure 4. The LTspice IV
symbol name is “g” while that for the UE symbol is “i_of_v_1”. They produce a current which is a
multiple of the voltage at the sensing pair of terminals. Connections to the sensing pair of terminals are
made similarly to the voltage-dependent voltage source.
Figure 4: LTspice IV and UE Voltage Dependent Current Source Symbols
The LTspice IV and UE current-dependent current sources are shown in Figure 5. The LTspice IV
name for this symbol is “f” while the UE symbol name is “i_of_i_1”. These sources produce a current
that is a constant multiple of another current in the circuit. The UE component is much simpler to use
than the LTspice IV component and only its operation will be described here. The UE symbol includes
a sensing wire. The current gain is changed by right-clicking on the source and changing the value Ai
in the Component Attribute Editor.
Figure 5: LTspice IV and UE Current Dependent Current Source Symbols
Figure 6 shows an example circuit using the current dependent current source. In this example the
current source is producing a current equal to twice the current flowing (from left-to-right) through
resistor R1. (Note that the assumed positive direction of the sensing current is in the direction of the
arrow next to the sensing wire.) The sensing wire is a short circuit and must be placed in series with
whichever component whose current you are sensing.
Figure 6: Example Use of the Current-Dependent Current Source
The LTspice IV and UE current-dependent voltage sources are shown in Figure 7. The LTspice IV
symbol name is “h” while that for the UE symbol is “v_of_i_1”. They produce a voltage which is a
multiple of the current flowing elsewhere in the circuit. The UE symbol includes a sensing wire.
Connections the sensing wire are made similarly to the current-dependent current source.
Figure 7: LTspice IV and UE Current Dependent Voltage Source Symbols
Diodes
Transistors
Op Amps
Download