Principles & Applications
Principles & Applications
Principles & Applications
Charles A. Schuler
LTspice/SwitcherCad III
(revised 1/30/2008)
Mirrored components
Simulate
Move
Zoom In
Drag
Pan
Undo
Zoom Out Find
Auto Scale Redo
Delete Rotate
Copy Mirror
Paste Place Comment
Place SPICE Directive
Place a resistor
and right click it
to enter its values.
Or, click Select Resistor
to view a Standard list.
Here it is!
A SPICE model for the BFR540
.MODEL BFR540 NPN + RBM = 5.00000E+000
+ IS = 1.04516E-015 + RE = 3.53552E-001
+ BF = 1.84359E+002 + RC = 1.34000E+000
+ NF = 9.81774E-001 + EG = 1.11000E+000
+ VAF = 4.16981E+001 + XTI = 3.00000E+000
+ IKF = 1.00000E+001 + CJE = 1.97895E-012
+ ISE = 2.32436E-013 + VJE = 6.00000E-001
+ NE = 2.02825E+000 + MJE = 3.32695E-001
+ BR = 4.39917E+001 + TF = 7.45719E-012
+ NR = 9.92532E-001 + XTF = 1.14072E+001
+ VAR = 2.09773E+000 + VTF = 3.15854E+000
+ IKR = 1.66296E-001 + ITF = 1.56917E-001
+ ISC = 1.29849E-016 + CJC = 7.93745E-013
+ NC = 1.06486E+000 + VJC = 1.85522E-001
+ RB = 5.00000E+000 + MJC = 8.41656E-002
+ IRB = 1.00000E-006 .ENDS
Also, a SPICE model can be added
directly to the schematic.
Adding a model to a schematic
• Copy the model to the clipboard.
– Left click and hold and drag over the model and then capture it
with Control+C. e.g. .MODEL 1N4001 D IS=29.5E-9 RS=73.5E-
3 N=1.96 CJO=34.6P VJ=0.627 +M=0.461 BV=60 IBV=10U
• Click on .op on the toolbar
• Paste the model into the window.
– Control+V.
• Click OK.
• Place the model on your schematic with a left click.
• This method is often preferred when sharing circuits with
others.
– The necessary model or models are imbedded in the circuit
file.
Where does one obtain SPICE
models?
• Search the Internet … many are available as
free downloads or can be copied to the clipboard
and then pasted into Windows Notepad (or onto
your schematic via .op on the toolbar). Some
links are provided at the end of this presentation.
• Search device manufacturers’ websites.
• Modify an existing model.
• Create your own.
– Software is available. http://
www.intusoft.com/spicemod.htm
• Or, you can use a subcircuit.
Subcircuits (.SBCKT)
• Are often used when repetition occurs.
– Better than cluttering the schematic with redundant
information
• Also can be used to replace a complicated
device such as an OP-AMP, a DIAC or a TRIAC.
• The next slide shows a common dimmer circuit
where the DIAC and TRIAC functions are
defined by subcircuits.
– LTspice has pre-defined schematic symbols for
DIACS and TRIACS, but no corresponding models.
More about models and subcircuits
Models given as .MODEL statements are for intrinsic SPICE
devices such as diodes and transistors. The .MODEL
statement gives the parameters for the specific component.
The general behavior of the device is already known by
SPICE … only the parameters need to be given to finish
specifying the component's electrical characteristics.
On the other hand, models given by .SUBCKT statements
define the modeled component by a collection of intrinsic
SPICE devices. For example, the SPICE model of an opamp
would be given as a subcircuit. In the previous slide, the
SPICE models of a DIAC and a TRIAC were specified as
subcircuits.
LTspice is useful for analyzing
circuits designed by others.
• It is sometimes only necessary to use it to
review and experiment with circuit files
that have already been created.
– Many can be found in the LTspice
subdirectories.
– Some examples are available for download.
This is an outstanding example:
http://cmosedu.com/cmos1/book.htm
How to run an existing circuit file
• From the File menu, select Open. Make sure the file type is
set to Schematics.
• Some good examples are available in
C:\ProgramFiles\LTC\SwCADIII\examples\Educational
(created on your hard drive when you install LTspice).
• Some appropriate examples for the McGraw-Hill basic skills
series are available on the website: http://highered.mcgraw-
hill.com/sites/0073106941/student_view0/lt_spice_instructio
ns_and_support_files.html (You probably have these files if
you obtained this presentation from the McGraw-Hill site.)
• The next slide shows a circuit from Schuler’s book. To view
the dc voltages and currents, a dc analysis is selected by
first clicking on Simulate, then Edit Simulation Cmd.
– The SPICE directive is .op.
CMRR
SPICE directive
for dc analysis
The DC operating point
selection provides all
node voltages and device
currents.
Placing the
9.6W
cursor here
shows the
-12V current and the
-88W dissipation in R5,
28.8W 1.2W
as shown below.
12W -3.6W
Move the cursor to the desired node. When the cursor changes
to a probe, click the left mouse button to view the waveform.
Can you see the 60 Hz common-mode component at the collector of Q2?
Move the cursor to the collector. Left click and now two waveforms are shown.
The next slide demonstrates the
value of simulation when evaluating
circuit performance.
• The differential amplifier circuit is much
improved with a stiff current source.
• The common-mode rejection ratio (CMRR)
is remarkably better.
– The common mode signal cannot be seen in
the output.
• Circuit simulators make it easy and fun to
investigate issues such as this.
The 60 Hz common-mode signal is too small to be seen here.
Threshold waveform
Output
555 one-shot
There are
three Three plot
important panes add
waveforms clarity.
here.
A dc offset is also available.
• The next slide shows a D/A converter.
• The input waveforms were separated by right-
clicking on the node name, e.g. V(b1), as shown
below, and adding a dc offset of +2 volts.
• It also shows how colors can be chosen by using
Tools→Color→Preferences→Selected
Item→Waveform→Background→Grid→Axis
V(b1)+2 dc offset
+6 dc offset
+4 dc offset
Separate plot plane
+2 dc offset
0 dc offset
Current waveforms
• Moving the cursor to the inside area of a
component, after a transient analysis has
been run, displays the current waveform in
that component.
• When the cursor morphs to a current
probe:
– left click to see the current waveform.
• This is illustrated in the next slide.
The current probe, like the voltage probe, shows time variations after
a transient analysis. Here, the current in R1 averages 2 mA (which
was measured earlier in a dc analysis) and the current fluctuations in
R1 are easy to see.
Output
Input Spice
directive
Ctrl+left-click the label
to measure bandwidth.
Here, the only change is the transistors. This
illustrates the need for proper SPICE models
when investigating issues such as bandwidth.
The BFR540 is a high-frequency transistor.
2N3904 BFR540
The .measure directive
• Is useful to find instantaneous values and values over
intervals
LTspice generates
several kinds of files.
To save disk space
and avoid clutter, these
files can be deleted
automatically.
Tools Color Preferences