06 LTSpiceIV
06 LTSpiceIV
06 LTSpiceIV
Part of Electronics & Control Division Technical Training Series by Nicholas Lombardo
Purpose
The purpose of this document is to give a basic guide to getting started in using LT Spice IV SPICE
simulator and show some examples of things you can do. Most of this information was compiled by
experimentation and online guides which I have used in the past to develop my abilities to use this
software.
SPICE simulators are extremely important in analog circuit design and are practically required for
anyone interested in a Microelectronics Focus. Even if you don’t plan to focus in electronics, familiarity
in a SPICE simulator will enrich your learning experience for required analog electronics courses (EE330
& EE430) and is handy for design problems you may face at some point in your career.
This is by no means a comprehensive guide, and is only for introduction and basic circuit construction
purposes. This guide provides a cursory overview of basic use of the software, and should allow you to
explore its capabilities with some confidence. This is the tip of the iceberg when it comes to using circuit
simulation tools, and hopefully will get you to the point where you can start learning comfortably on your
own.
Table of Contents
What is LT Spice IV?
I think that Linear Technologies, maker of LT Spice IV, gave a great description of the program on their
download page:
LTspice IV is a high performance SPICE simulator, schematic capture and waveform viewer with enhancements and
models for easing the simulation of switching regulators. Our enhancements to SPICE have made simulating
switching regulators extremely fast compared to normal SPICE simulators, allowing the user to view waveforms for
most switching regulators in just a few minutes. Included in this download are LTspice IV, Macro Models for 80% of
Linear Technology's switching regulators, over 200 op amp models, as well as resistors, transistors and MOSFET
models.
SPICE Simulators are very powerful tools for circuit analysis. It also functions as a great schematic editor
if you just need to draw up a general schematic for your project or for a technical report. Learning to use
a SPICE Simulator is especially useful for classes with analog electronic circuit analysis (EE330 & EE430).
LT Spice IV differs from other Spice simulators in that it was developed by and populated with Linear
Technology devices. You can import external libraries to add a specific part using generic Spice files
easily if you need to make a specific simulation with parts you have specced in advance.
Free Download:
http://www.linear.com/designtools/software/
Basic Setup & Getting Started
After opening LT Spice, you can start a new schematic or open an existing one. To start a new schematic
press the new schematic button in the upper left of the window:
On the Windows version, there are dozens of buttons on the toolbar and this guide will go over the useful
ones throughout the next steps concerning building a basic circuit. In the Mac version, you will have to
rely
Building a Circuit
These are the basic tools on the toolbar along the top of the Schematic Editor. They can all be accessed
with hotkeys which are intuitive for common components: (R) Resistor, (L) Inductor, (C) Capacitor, (G)
Ground, (D) Diode.
Less obvious is the Component button (F2) which opens a vast catalog of available parts and
systems which are included by default with LT Spice IV. You can search for parts by name or by clicking
the [categories] on the left.
The Draw Net (F3) button allows you to draw connections (nets) between components. This turns the
cursor into a dashed crosshair to help align nets and keep things organized. In the scope of the schematic,
these nets are like ideal wires with zero impedance. Start by pressing CTRL-G to show the grid, place two
resistors (R), and a few nets to connect them in series.
Circuit Under Construction
After placing a component with properties such as resistance, the values will need to be set if you plan to
run a simulation. To set this property, right-click the component and enter a value. LT Spice IV supports
some shorthand notations for value magnitudes such as Kilo and milli by placing the letter after the
number (ex. 100n = 100e-9 = 0.1u).
For most components, you have the option of choosing a predefined part. This allows you to model
specific components that you have chosen to use and can be very useful when designing an analog circuit
for real-world use. If you do not select a specific part (ex. LM741 Op-Amp), most components placed will
act ideal by default (no ESR or parasitic capacitance).
Linear Technologies has a handy guide for importing third-party devices which can be found here:
http://www.linear.com/solutions/1083
Important Default Hotkeys
These are a few of the important default hotkeys that you will use constantly when working in LT Spice.
Some hotkeys are only available in the Windows version of LT Spice, and Mac versions may need a simple
workaround (ex. on Mac, R does not create a resistor, and it must be placed by finding it in the F2 catalog
window). Windows-only defaults are marked with an asterisk (*).
Component
F2 Open component catalog for selecting
Catalog
F4 Create Port Create a port for naming nodes in the circuit or create a ground
SPICE
S Place SPICE directive
Directive
Changing Default Hotkeys
You can also easily change or get an overview of the default hotkeysby pressing the
Control Panel
button
(or
Tools > Control Panel)
, navigating to the
Drafting Options
tab, and pressing the
Hot Keys
button.
Voltage & Current Sources
Voltage and Current sources can be added to your design by selecting them in the Component Symbol
window (F2). A general purpose voltage source can be found by searching for “vol” in the text search bar
as shown below:
By default, sources are ideal DC sources, but can be given advanced settings to create an AC signal such as
a PWM or sinusoid waveform. To do this, right-click the source once it has been placed and click
Advanced .
Running a Simulation
Before running a simulation, all of the components and sources should be given values, and a ground
node (G) must be declared and connected to the circuit. For this simple example, the circuit should look
like what is shown below.
Pressing the run simulation at this point will bring up the simulation configuration window where
you can edit the type of simulation. The default and most simple simulation is a transient analysis where
the circuit is simulated for a determined period of time.
After running the simulation and setting a stop time for a transient analysis, a blank plot pane will open
with your specified time period on the x-axis. You can now click on the circuit in different locations to get
information on the voltage, current, and power at specific nodes and components.
Below are three examples of locations you can click to get information on the circuit
● Left-click on net:
Clicking on a net will give you the voltage with respect to ground at that node as
a function of time on the plot pane.
● Left-click on component: Clicking directly on a component will give you the current through the
component as a function of time.
Image Source:
http://tinyurl.com/ntmefp9
Not shown above are a few other probes you can use with shortcuts:
● Alt-Click on component:
This will display the power dissipation of a component (cursor turns into
a thermometer)
● Alt-Click on a net/wire:Show current through the net (cursor turns into a multimeter with arrow)
● Multiport Devices: For components such as transistors where there are more than two nodes, you
can click right where it connects to the circuit to see individual currents
Clicking different locations will add more plots to the pane so they can be analyzed easily. To remove
nets you can right-click the plot or simply double-click a probe area on the schematic to isolate it’s plot
and remove others.
Basic Spice Directives
After running the simulation, you may have noticed that there is some black text placed on the schematic
that says
.trans 10 or whatever you set the stop time to be. This is a SPICE directive and can be used to
do things such as set variable values and create step parameters. You can edit these directives by
right-clicking on them.
Below is an example where the resistor values for R1 and R2 were set by variables named R1 and R2
respectively. In order to use a variable value you must set the component values between {curly
brackets} or the simulation will not run. You can also use math operations as long as they are within the
curly brackets (ex.
{15*(R1*R2)/(R1+R2)} ).
In this example,
.param R1 = 10k is pretty self-explanatory and it will set the parameter R1 to 10k. Less
obvious is the use of the command .step param R2 = 1k 10k 2.25k . This creates a step parameter
and will run the simulation for each step in the setup. This command says that R2 should vary from 1k to
10k with a step size of 2.25k, creating 5 simulations with the separate values (1k, 3.25k, 5.5k, 7.75k, 10k).
The plot pane shows the source voltage (green) and the voltages at R2 for the 5 simulations run (blue).
Examples
This is an example of using one of the predefined subsystems (linear voltage regulator) and a linear DC
sweep simulation. The top plane is a plot of source voltage (green, scale on left), versus source current
(increases from about 0A to over -2A as the regulator becomes active, scale on right).
The bottom plane shows the diode voltage (blue, scale on left) and the diode power dissipation (red, scale
on right.
AC Analysis (Second-Order Bandpass Filter)
This is an example of using a simple second-order RC bandpass filter and an AC analysis. The resultant
plot is essentially a Bode plot of the output voltage with respect to the input voltage.
Transient Analysis (Inverting Amplifier)
This is an example of using an ideal simulated Op-Amp (OP7) to create an inverting amplifier. This was
taken from EE430 Lab Manual and shows a transient analysis of an inverting amplifier with Av gain of -5.
Note the port name and connections to create the positive and negative DC source voltages for the
Op-Amp and location of ground nodes.
Transient Analysis (PWM Filtering)
This is an example adapted from the training series on Arduino Analog I/O on the subject of PWM
filtering. The voltage source was set to produce a 500Hz PWM signal with duty cycle of 60% and
amplitude of 5v (top plot). After the low pass filter at Vout (lower plot), it can be seen that there is a small
ripple voltage, and the higher frequencies are filtered out to leave a DC voltage of roughly 3.0v (60% of
5v).
Step Parameter (Full-Wave Bridge Rectifier)
This is an example of a full-wave bridge rectifier (EE330) which converts a center-grounded AC signal of
120v amplitude and frequency of 60 Hz (top plot) into a rectified output of roughly 120v DC. This example
also uses the step parameter directive to show the effects of using a 10uF filter capacitor (green, high
ripple voltage) and a 100uF filter capacitor (blue, lower ripple).