100% found this document useful (2 votes)
173 views

(Analog Device) Ltspice - Basics

Uploaded by

zelin99
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
173 views

(Analog Device) Ltspice - Basics

Uploaded by

zelin99
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

LTspice IV Basic Lab Class

Presented by Thomas Mosteller ADI FAE

Copyright © 2017 Analog Devices. All rights reserved.


2

Why Use LTspice?


 Stable SPICE circuit simulation with
 Over 2500 macromodels of
 Unlimited number of nodes
Linear Technology products
 Schematic/symbol editor
 Waveform viewer  1400+ power products
 Library of passive devices
 Fast simulation of switch mode power supplies
 Steady state detection
 Turn on transient
SPICE = Simulation
 Step response Program with Integrated
 Efficiency / power computations Circuit Emphasis
 Advanced analysis and simulation options
 Not covered in this lab class (sort of)
 Outperforms or as powerful as pay-for tools
 In other words LTspice is free!
 Automatically builds syntax for common tasks

LTspice is also a great schematic capture / BOM tool


© 2017 Analog Devices
3

How Do I Get LTspice and Documentation?

 Go to http://www.linear.com/software
 Left-Click on Download LTspice IV
 Follow the instructions to install

© 2017 Analog Devices


4

How Do I Get Started using LTspice?

© 2017 Analog Devices


5

How Do I Get Started Using LTspice?

 Demo Circuits: Use one of the 100’s demo circuit available on


linear.com
 Designed and Reviewed by Factory Apps Group
 Go to http://www.linear.com/software or browse through the part’s webpage
(right column)

 JIG Files: Use a pre-drafted test fixture (JIG)


 Provides a good starting point, but is not production-ready
 Used to prove out part models, and are not complete designs.
 Components are typically “ideal” components and will need to be modified
based on your operating conditions

 Blank: Use the schematic editor to create your own design


 LTspice contains models for most LTC power devices and many more

© 2017 Analog Devices 5


6

Demo Circuits on linear.com


Go to http://www.linear.com/software or …

What if I’m browsing the part’s webpage?


© 2017 Analog Devices 6
7

Demo Circuits on linear.com (cont.)


Go to the part’s webpage
http://www.linear.com/product/LTM4620

© 2017 Analog Devices


8

What are Demo Circuits ?


Circuits designed and reviewed by factory apps group

What if I cannot find a demo circuit ?

 It remains the customer’s responsibility to verify proper and reliable operation in the
actual application
 Printed circuit board layout may significantly affect circuit performance and reliability

© 2017 Analog Devices


9

How Do I Get Started Using LTspice?

 Demo Circuits: Use one of the 100’s demo circuit available on


linear.com
 Designed and Reviewed by Factory Apps Group
 Go to http://www.linear.com/software or browse through the part’s webpage
(right column)

 JIG Files: Use a pre-drafted test fixture (JIG)


 Provides a good starting point, but is not production-ready
 Used to prove out part models, and are not complete designs.
 Components are typically “ideal” components and will need to be modified
based on your operating conditions

 Blank: Use the schematic editor to create your own design


 LTspice contains models for most LTC power devices and many more

© 2017 Analog Devices


10

Pre-drafted Test Fixture


 These simulations / designs are not production-ready
 Used to prove out part models, and are not complete designs.
 Components are typically “ideal” components and will need to be
modified based on your operating conditions

 It remains the customer’s responsibility to verify proper and reliable operation in the
actual application
Printed circuit board layout may significantly affect circuit performance and reliability
©2017 Analog Devices
11

Opening a Test Fixture

3. Click
Here

1. Edit menu, 2. Search for


select macromodel
“Component” (ex. LT8640)
© 2017 Analog Devices
12

Opening a Test Fixture

Voilà !

© 2017 Analog Devices


13

How Do I Get Started Using LTspice?

 Demo Circuits: Use one of the 100’s demo circuit available on


linear.com
 Designed and Reviewed by Factory Apps Group
 Go to http://www.linear.com/software or browse through the part’s webpage
(right column)

 JIG Files: Use a pre-drafted test fixture (JIG)


 Provides a good starting point, but is not production-ready
 Used to prove out part models, and are not complete designs.
 Components are typically “ideal” components and will need to be modified
based on your operating conditions

 Blank: Use the schematic editor to create your own design


 LTspice contains models for most LTC power devices and many more

© 2017 Analog Devices


14

Start With a New Schematic


 To open up a blank schematic screen select “File”
Menu and “New Schematic”

Blank schematic
a.k.a.
MasterPiece in progress

© 2017 Analog Devices


15

Using the Schematic Editor in LTspice

© 2017 Analog Devices


16

How to Wire up a Simple RC Circuit


 The completed exercise:

© 2017 Analog Devices


17

How to Wire up a Simple RC Circuit (cont.)


 Step 1: Open up a blank schematic screen
 Select “File” Menu and “New Schematic”

© 2017 Analog Devices


18

How to Wire up a Simple RC Circuit (cont.)


 Step 2: Add the passives and grounds
 Using the toolbar, select Resistor, Capacitor and Ground.
Place these symbols on the schematic as shown below. Use
Ctrl+R to rotate before placement.

Select and
place res, cap
& GND
Tip: Ctrl+R to
rotate before
placement

© 2017 Analog Devices


19

How to Wire up a Simple RC Circuit (cont.)


 Step 3: Add the voltage source
 Select “Edit” Menu and “Component”. From the component
window, start typing “voltage” in the dialog box, and click “OK”

2. Type
“Voltage”

3. Click
“OK”

1. Edit menu,
select
“Component”

© 2017 Analog Devices


20

Toolbar and Keyboard Shortcuts


Place Circuit Element [F2]
Zoom In Place Diode [D]
Pan Place Inductor [L]
Zoom Out Place Capacitor [C]
Autoscale Place Resistor [R]
Label Node [F4]
Place Ground [G]
Draw Wire [F3]

Move [F7]
Drag [F8]
Undo [F9]
Delete [Del] Redo [Shift+F9]
Duplicate [Ctrl+C] Rotate [Ctrl+R]
Paste b/t Schematics [Ctrl+V] Mirror [Ctrl+E]
Find [Ctrl+F] Place Comment/text [T]
Place SPICE directive [S]
© 2017 Analog Devices
21

How to Wire up a Simple RC Circuit (cont.)


 Step 4: Wire up the circuit
 Using the toolbar, select Wire

1. Select
“Wire”

© 2017 Analog Devices


22

How to Wire up a Simple RC Circuit (cont.)


 Step 4: Wire up the circuit (cont.)

Left-Click ground “Pull” wire through the resistor “Pull” wire down through the
capacitor
“Pull” wire up through the source Left-Click here to anchor
Left-Click here to anchor &
Left-Click here to anchor finish

Hint: Press the ESC key at any time to clean up the schematic

© 2017 Analog Devices


23

How to Wire up a Simple RC Circuit (cont.)


 Step 5: Add net labels
 Using the toolbar, select Label Net. Label the input/output nodes as shown below

1. Select
“Label Net”

2. Enter net
name

3. Place on
wire
© 2017 Analog Devices
24

How to Wire up a Simple RC Circuit (cont.)


 Step 6a: Component values
 Right-Click on each component symbol to change its value as shown below

Right-click on
symbol

Or Right-click
on value

© 2017 Analog Devices


25

Using Labels to Specify Units for Component Attributes

 K = k = kilo = 103  M = m = milli = 10-3


 MEG = meg = 106  U = u = micro = 10-6
 G = g = giga = 109  N = n = nano = 10-9
 T = t = tera = 1012  P = p = pico = 10-12
 F = f = femto = 10-15

Hints
 Use MEG (or meg) to specify 106, not M
 Enter 1 for 1 Farad, not 1F

© 2017 Analog Devices 25


26

Editing Components
 Right-Click on the component to edit attributes

 You can also edit the visible attribute and label by pointing at the text
with the mouse and then right-clicking
 Mouse cursor will turn into a text caret

© 2017 Analog Devices


27

Component Database
 Resistors, capacitors, inductors, diodes, Bipolar transistors,
MOSFET transistors, JFET transistors, Independent voltage
and current sources
 You can access a database of known devices

© 2017 Analog Devices


28

How to Wire up a Simple RC Circuit (cont.)


 Step 6b: Source parameters
 Right-Click on the voltage source and enter the parameters shown below under
the “Advanced” tab.

Click
“Advanced”

Right-click
source

© 2017 Analog Devices


29

How to Wire up a Simple RC Circuit (cont.)


 Step 6b: Source parameters
 Right-Click on the voltage source and enter the parameters shown below under
the “Advanced” tab.

© 2017 Analog Devices


30

Running and Probing a Circuit in


LTspice

© 2017 Analog Devices


31

Running a Circuit Simulation


 Access the LT8640 circuit
 Click File ---> Open, and navigate to the LTspice Lab folder
on your desktop. Look for the file titled “LT8640DCLoad.asc”
 Or click “c” symbol on the right LT8640DCLoad.asc

 Hotlink Nomenclature:

Class exercise
Solution to exercise
Circuits to explore at your leisure

© 2017 Analog Devices


32

Viewing Voltage Waveforms


 Plot the voltage on any wire by Left-Clicking it
 Tip: All Demo Circuits have INs and OUTs clearly labeled to help you
quickly select them

Click here
for output
waveform

LT8640DCLoad.asc
© 2017 Analog Devices
33

Viewing Current Waveforms


 Plot the current through any component by Left-Clicking on
the body of the component
 Current flowing into a node is defined as being positive

Click here for


inductor
current
waveform

© 2017 Analog Devices


34

Zooming In and Out on a Waveform


 In the waveform window, use the mouse to zoom in and out.
Click and drag a box about the region you wish to see drawn
larger
 Using the toolbar, click on “Zoom full extents”, to zoom back
out

© 2017 Analog Devices


35

Measuring V, I and Time in the Waveform


(Measurement Using Cursors)
1. Right-Click on the waveform name in the waveform window
2. For “Attached Cursor”, select “1st & 2nd”
3. Position cursors to make desired measurements
1. 2. 3.

Result

© 2017 Analog Devices


36

Measuring V, I and Time in the Waveform


(Measurement Using Zoom Window)
1. Drag a box about the region you wish to measure
 Left-Click, drag, and hold
2. View the lower left corner of the window for the status bar. The dx
and dy measurement data is displayed here.
3. Use Undo from the File menu or press “F9”

© 2017 Analog Devices


37

Viewing Differential Voltage Waveforms


 Left-Click on one node and drag the mouse to another node
 Red voltage probe at the first node
 Black probe on the second

© 2017 Analog Devices 37


38

Viewing Differential Voltage Waveforms


 To create a measurement reference node, Right-Click on the
desired node and select “Mark Reference”
 A black voltage probe is anchored to the selected node
 All measurements in the circuit are now referenced to the
node with the black probe
 Hit the ESC key to remove the reference mark

© 2017 Analog Devices


39

Viewing Wire Current Waveforms


 Plot the current through any wire by Alt-Left-Clicking on the
wire
 An ammeter will appear to indicate that the wire current will be
displayed

© 2017 Analog Devices


40

Average & RMS Calculations


 Average & RMS Current, Voltage, or Power Dissipation
 Calculated only for the visible area of the plot window
 Click on inductor L1 to display the inductor current waveform
 Ctrl-Left-Click the I(L1) trace label in the waveform view

Example:
Measure average
and RMS current
for inductor in
LT8640 circuit.
Zoom in as shown
for this waveform.

© 2017 Analog Devices


41

Instantaneous & Average Power Dissipation


 Instantaneous Power Dissipation
 Alt-Left-Click on the symbol of the
LT8640
 Waveform is displayed in units of Watts

 Average Power Dissipation


 Click, hold, and drag in the waveform
window to display waveform at steady
state
 Ctrl-Left-Click on the Power
Dissipation Trace Label in the
waveform view
 Waveform summary window will appear
which shows power dissipation in the IC

Example:
Measure the power dissipation
in the LT8640 IC

© 2017 Analog Devices


42

Deleting Waveforms
 Method #1: Right-Click on a trace label to be deleted
 Select “Delete this Trace”
 Deletes only the selected trace

© 2017 Analog Devices


43

Deleting Waveforms
 Method #2a: Right-Click on the plot background and select “Delete
Traces”
 Method #2b: If the plot window is active hotkey F5 is equivalent
 Cursor turns into scissors
 Left-Click on one or more trace labels to delete. ESC(ape) to quit

© 2017 Analog Devices


44

Deleting Waveforms
 Method #3: Plot the same waveform twice in succession
 Deletes all but that waveform

Click,
click

© 2017 Analog Devices


45

Current Sources
 The simulation shows the output momentarily going to -1.2V
but this can’t happen in the real world – what’s going on?

© 2017 Analog Devices


46

Current Sources (cont.)


 Ideal current sources source current even with zero or
negative differential across them
 This results in the output capacitor initially charging to a
negative value

Ideal current source charging cap to a negative voltage

Output current of the LT8640 begins ramping up

© 2017 Analog Devices


47

Current Sources (cont.)


 Active load
 Modifies the ideal current source’s behavior such that current is
zero for zero or negative voltage differentials
 Roughly emulates the behavior of an integrated circuit load

© 2017 Analog Devices


48

Current Sources (cont.)


 Active load (cont.)

Ideal current source charging cap to a negative voltage


Current is zero until voltage differential becomes positive
Output current of the LT8640 begins ramping up

© 2017 Analog Devices


49

Net Labeling

© 2017 Analog Devices


50

Advantages of Labeling
 Replaces arcane SPICE machine node names with easy to understand
and remember human names
 Allows LTspice circuit nodes to match those on your production
schematic, i.e. “TP15”

Without With

© 2017 Analog Devices


51

Labeling - Trick
 Highlight net from waveform viewer
 Alt-Left-Click on the label in the waveform viewer (i.e. V(n006)) and it will now
highlight that particular net on the schematic

Alt-Left-
Click

Net
Highlighted

© 2017 Analog Devices


52

Generating a BOM and Efficiency


Report

© 2017 Analog Devices


53

BOM
 Under View select Bill of Material
 Displayed on Diagram
 Paste to Clipboard

© 2017 Analog Devices


54

Steps to Computing Efficiency


Note: Efficiency will only be calculated in the steady state condition
1. Right-Click the .tran statement on the schematic to bring up the
Edit Simulation Command dialog box
2. Check the box “Stop simulating if steady state is detected” …

1. Simulate menu, 2. Check


select “Edit Box
simulation Cmd”
© 2017 Analog Devices
55

Steps to Computing Efficiency


3. Load must be a current source labeled Iload* or resistor labeled Rload**

The Good The Bad

This will be treated


just like any other
resistor – efficiency
will read ZERO

*If there is more than one current source


**If there is more than one resistor

4. Run the simulation …

© 2017 Analog Devices


56

Steps to Computing Efficiency


5. Upon completion select the View dropdown menu, Efficiency
Report, then Show on Schematic
6. Efficiency report will be pasted under the schematic

© 2017 Analog Devices


57

SMPS Efficiency Tips


 LTspice will not always be able to determine steady state, but this
is rare!
 Workaround: Alt-Left-Click & Calculator
 Probe the various nodes and verify the circuit is stabilized
 If not edit the .tran statement and increase the Stop Time
parameter. Re-run simulation
 For multiple output and/or multiple input supplies, efficiency must
be determined partially by hand from the efficiency report
 Alternatively use behavioral models
 Right-Clicking any component will report power dissipation if
steady state has been detected or Mark Start/End has been used
 If circuit has stabilized for a long time and LTspice still hasn’t
detected the steady-state
 Use Mark Start/End (Simulate -> Efficiency Calculation)
 Only steady-state data is displayed before Mark End
© 2017 Analog Devices
58

Simulating a Transient Response

© 2017 Analog Devices


59

Current Load and Pulse Function


 You can simulate a load with a Resistor or Current load
 In particular the Pulse function in a current load is helpful in
transient response analysis
 Steps a current load from one value to another value

© 2017 Analog Devices


60

Edit the Current Load to a Pulse Function


 Edit the .tran directive to disable steady state detection
 Right-Click on the current load
 Select “Pulse”
 Modify the attributes (see next slide). Click “OK”

© 2017 Analog Devices


61

(*)

(*) Forces current to be zero when voltage is zero

© 2017 Analog Devices


62

Run the Simulation for Transient Response


 Run the simulation
 Click on the OUT
node to display
Vout
 Click on the output
current load to
display Iout
 Notice the
presence of the
pulse load

LT8640PulseLoadSolution.asc

© 2017 Analog Devices


63

AC Analysis

© 2017 Analog Devices


64

AC Analysis Overview

 Performs small signal AC analysis linearized about the DC


operating point
 Useful for analysis of filters, networks, stability analysis, and
noise considerations

© 2017 Analog Devices


65

Simulating AC Analysis – RC Filter


 Single pole filter using RC network
 Syntax: .ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
 Example: RC network and .ac dec 100 .01 1MEG

-3dB point:
1/(2*pi*R*C) = 159Hz

AC amplitude must be
set to 1 for accurate
results

Right-click on .tran
command and select
“AC Analysis”

© 2017 Analog Devices


66

Simulating AC Analysis – RC Result

RCFilterACAnalysis.asc
© 2017 Analog Devices
67

Simulating AC Analysis – Active Filter


 Single pole active filter using an opamp

© 2017 Analog Devices ActiveFilterACSweep.asc


68

More Information and Support

© 2017 Analog Devices


69

Reminder to Periodically Sync Release


 It is important to sync your release of LTspice once a
month to get the latest updates
 Software updates and bug fixes
 Models
 Sample circuits and examples

© 2017 Analog Devices


70

Reminder to Periodically Sync Release (Windows)


 Vista, Win7, and Win8 users (any UAC-enabled OS)
 You must “Run as administrator” scad.exe or its shortcut
even if you are logged in as an administrator

© 2017 Analog Devices


71

Reminder to Periodically Sync Release (Mac)

1. Open 2. Under
“Control Panel” “Operation”

3. “Sync
Release”
for Mac
© 2017 Analog Devices
72

Built-in Help System

© 2017 Analog Devices 72


73

Appendices

© 2017 Analog Devices


74

Other Resources
 LTspice forum: Use simulation circuits posted on LTspice
Yahoo! User’s Group
Go to http://groups.yahoo.com/neo/groups/Ltspice/info
Also contains many very helpful discussion threads

 Educational Files: Check out LTspice capabilities using the


education examples
 Available on C:\ … \LTspiceIV\examples\Educational

 LTspice videos: Video tutorials by Linear’s technical staff


 http://video.linear.com/all--ltspice

 LTwiki: Undocumented features …


 http://ltwiki.org/

 Wurth LTspice Book


© 2017 Analog Devices
75

Other Resources – Yahoo LTspice Forum

http://groups.yahoo.com/neo/groups/Ltspice/info

Join the group


here.
As of April 2015,
there are over
53,329 members!

© 2017 Analog Devices


76

Other Resources – Educational Files


\Example\Educational subdirectory

Design examples
demonstrating LTspice
capabilities

© 2017 Analog Devices


77

Other Resources – LTspice Videos

A continuously
growing
collection of LTC
videos for you to
discover.

Click, Relax & Enjoy !


Alcoholic beverages and
chips not included … But
highly recommended by
LTC sales teams !

© 2017 Analog Devices


78

Other Resources - LTwiki


LTwiki

© 2017 Analog Devices


79

Other Resources – LTspice Book

© 2017 Analog Devices


80

Appendix - Steps to Calculate Power Supply


Efficiency
 Efficiency will only be calculated in the steady state condition
 Right-Click the .tran statement on the schematic to bring up the
Edit Simulation Command dialog box
 Check the box “Stop simulating if steady state is detected”
 Load must be a current source or resistor labeled Rload
 Run the simulation
 Upon completion select the View dropdown menu, then Efficiency
Report, then Show on Schematic
 Efficiency report will be pasted under the schematic

© 2017 Analog Devices


81

Appendix – Summary of Special Mouse and Keyboard


Commands
 Schematic-Based Special Commands
 Alt-Left-Click on a wire
 This will display the waveform for the current flowing in the wire
 Alt-Left-Click on a component
 This will display the instantaneous power dissipation in the component
 Ctrl-Right-Click on a component
 Allows you to edit embedded component attributes
 Waveform-Based Special Commands
 Ctrl-Left-Click on a waveform title
 Displays the average and RMS values for the waveform
 Left-Click on node and drag to another node
 Displays differential voltage
 Alt-Left-Click on the label in the waveform viewer (i.e. V(n006))
 Particular net on the schematic is highlighted

© 2017 Analog Devices


82

Appendix – Summary of Additional Features

 Pause a simulation
 “Simulate” pull down menu ---> Pause
 There is no toolbar button for this function
 Zoom in/out using the schematic editor:
 Just use the wheel on your mouse
 Pan around a schematic
 Left-Click the mouse and hold, then drag
 Tilt wheel to move right and left

© 2017 Analog Devices


83

Thank you for attending, and happy


simulating!

Homework: Once you return to the


office, go back over the training materials
within a week!

© 2017 Analog Devices

You might also like