4/20/2022 Getting Started with LTspice® MARIO GONZALEZ CHARLIE EL-KHOURY IN PARTNERSHIP WITH ARROW ©2022 Analog Devices, Inc. All rights reserved. LTspice Free – Fast – Unlimited 1 1 One Analog Guru’s Opinion on SPICE in 1996 “I hurled this computer to its doom from atop National’s 3-story parking garage. As the dust settled, I knew that computer would never lie to me again!” 2 This was in 1996. But simulators have evolved immensely. (Even Bob Pease mellowed out about this in later years.) ©2022 Analog Devices, Inc. All rights reserved. 2 1 4/20/2022 LTspice – What’s the Point? https://www.youtube.com/watch?v=x6TrbD7-IwU (play to 2:30) ► Value of a simulator ► Is it a good sanity check? No ► Is it how you verify a design? No ► The point in simulation is so you understand your circuit better ► Intuition is the most important part of engineering ©2022 Analog Devices, Inc. All rights reserved. 3 3 Goal of LTspice – Develop Circuit Intuition Through Simulation ► Simulation techniques are an essential part of an electronic circuit design Non-bench discovery ► Provides insight into the operation of a designed circuit prior to its being prototyped Design optimization Boundary conditions Device tolerances Verification of requirements “What if” scenarios that would be difficult or impossible to undertake on a real circuit The key to simulation is the speed with which you can understand your circuit, its correctness, and its limitations before going into the lab to prototype and test SPICE = Simulation Program with Integrated Circuit Emphasis 4 ©2022 Analog Devices, Inc. All rights reserved. 4 2 4/20/2022 Design Verification is Done in the Laboratory - Prototype & Bench Test ► Verify proper and reliable operation in the actual application Simulation is typical performance (production scatter and temperature behavior is never modeled) Printed circuit board layout may significantly affect circuit performance or reliability compared to simulation results There is a point of limiting return on simulation, get into the lab to prototype and bench test sooner rather than later Laboratory Nirvana Theory 5 Simulation ©2022 Analog Devices, Inc. All rights reserved. 5 Agenda ► Benefits of LTspice ► Examples ► Using the schematic editor ► Running ► Basic and reference designs libraries and probing a schematic measurements and calculations ► Simulating a transient response ► Homework ► Resources 6 and support ©2022 Analog Devices, Inc. All rights reserved. ©2021 6 3 4/20/2022 What is LTspice? ► ADI’s analog electronic circuit simulator Free No cost simulation platform designed for our customers and the engineering community *Not* licensed for use by semiconductor manufacturers Unlimited Draft and simulate circuits of unlimited size and content Unlimited hierarchy are supported Even though LTspice is freeware, it outperforms many pay-for options Fast Optimized macro-models for many ADI devices For example, switch mode power supplies simulate rapidly ©2022 Analog Devices, Inc. All rights reserved. 7 7 How Do I Get LTspice? ► Go to www.analog.com/LTspice ► Site also contains useful links to: Demo Circuits (reference designs) Documentation Handout of shortcut keys Video Tutorials Technical Articles 8 LTspice is a standalone application that runs on your computer ©2022 Analog Devices, Inc. All rights reserved. 8 4 4/20/2022 How Do I Get Started Using LTspice? ► Use one of the 1000’s of Demo Circuits available at analog.com Reviewed by product application engineers ► Use a test fixture Provides a good starting point ► Create 9 your own using the schematic editor ©2022 Analog Devices, Inc. All rights reserved. 9 Demo Circuits Are Available on Product and Eval Board Pages ► Click on “Tools & Simulations” to find reference LTspice circuit(s) Demo Circuit Available Models 10 ©2022 Analog Devices, Inc. All rights reserved. 10 5 4/20/2022 Archive: Complete Collection of Demo Circuits ► Link available on www.analog.com/LTspice ©2022 Analog Devices, Inc. All rights reserved. 11 11 How Do I Get Started Using LTspice? ► Use one of the 1000’s of Demo Circuits available at analog.com Reviewed by product application engineers ► Use a test fixture Provides a good starting point ► Create 12 your own using the schematic editor ©2022 Analog Devices, Inc. All rights reserved. 12 6 4/20/2022 Test Fixtures ► These ► Good are “test jig circuits” used to validate macro-models initial starting point for your schematic Simplified schematics (front page of the datasheet) Components may be “ideal” or encapsulated to simplify simulation and schematic May highlight fault events Users may need to modify based on requirements 13 ©2022 Analog Devices, Inc. All rights reserved. 13 Opening a Test Fixture ► Complete collection is available at ..\examples\jigs Edit menu, select “Component” 14 Search for macromodel Click Here ©2022 Analog Devices, Inc. All rights reserved. 14 7 4/20/2022 How Do I Get Started Using LTspice? ► Use one of the 1000’s of Demo Circuits available at analog.com Reviewed by product application engineers ► Use a test fixture Provides a good starting point ► Create 15 your own using the schematic editor ©2022 Analog Devices, Inc. All rights reserved. 15 Start With a New Schematic ► To open a new schematic in LTspice, select File > New Schematic Empty schematic 16 ©2022 Analog Devices, Inc. All rights reserved. 16 8 4/20/2022 Drafting Using the Schematic Editor EXAMPLE: SINGLE POLE FILTER USING RC NETWORK 17 LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 17 Opening a New Schematic (Ctrl-N) 18 ©2022 Analog Devices, Inc. All rights reserved. 18 9 4/20/2022 Adding Passives and Grounds Ctrl+R to rotate before placement Use R, C, and G keys to place resistors, capacitors & ground symbols Ctrl+E (echo) to mirror before placement 19 To exit a symbol, select Esc or right click ©2022 Analog Devices, Inc. All rights reserved. 19 Adding a Voltage Source and Component Library Use the ‘V’ keyboard shortcut or the following Type “Voltage” Click “OK” Edit menu, select “Component” 20 ©2022 Analog Devices, Inc. All rights reserved. 20 10 4/20/2022 Wire Up the Circuit F3 or select “Wire” button 21 ©2022 Analog Devices, Inc. All rights reserved. 21 Wire Up the Circuit ► Wire up the circuit Left-Click ground “Pull” wire up through the source Left-Click here to anchor “Pull” wire through the resistor Left-Click here to anchor “Pull” wire down through the capacitor Left-Click here to anchor & finish Press the ESC key or right click to stop 22 ©2022 Analog Devices, Inc. All rights reserved. 22 11 4/20/2022 Add Net Labels F4 or select “Label Net” Enter net name Place on wire 23 Specify the name so an arbitrary one isn't generated for the node ©2022 Analog Devices, Inc. All rights reserved. 23 Component Values Right-click on symbol Or Right-click on value 24 ©2022 Analog Devices, Inc. All rights reserved. 24 12 4/20/2022 Units for Component Parameters ►M = m = milli = 10-3 ►K ►U = u = micro = 10-6 ► MEG ►N = n = nano = 10-9 ►P = p = pico = 10-12 ►F = f = femto = 10-15 = k = kilo = 103 = meg = 106 ►G = g = giga = 109 ►T = t = tera = 1012 Hints Use MEG (or meg) to specify 106, not M Enter 1 for 1 Farad, not 1F 25 ©2022 Analog Devices, Inc. All rights reserved. 25 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 (cursor will change to a text icon) and right-clicking 26 ©2022 Analog Devices, Inc. All rights reserved. 26 13 4/20/2022 Component Database ► Available for resistors, capacitors, inductors, diodes, bipolar transistors, MOSFET transistors, and JFET transistors 27 ©2022 Analog Devices, Inc. All rights reserved. 27 Voltage Source Parameters Click “Advanced” Right-click source 28 ©2022 Analog Devices, Inc. All rights reserved. 28 14 4/20/2022 Voltage Source PULSE Parameters Translates to PULSE(0 5 0 1u 1u 10m 20m 3) on schematic 29 ©2022 Analog Devices, Inc. All rights reserved. 29 Zooming In and Out, Pan, & Autoscale Zoom to Rectangle or Ctrl+Z Pan or Click Hold Autoscale or Space Zoom Back or Ctrl+B Zoom In or Out -> Scroll Wheel 30 ©2022 Analog Devices, Inc. All rights reserved. 30 15 4/20/2022 Drag & Move Move or F7 Draw box or Click on Component or Wire 31 F8 or Drag (keep element wired) Reposition and Click to Place ©2022 Analog Devices, Inc. All rights reserved. 31 Edit Simulation Command – Transient Analysis Select “Edit simulation Cmd” in Simulate menu Enter in 60m Click to place on schematic Click OK ► Performs the DC analysis to establish a DC operating point, then increments the time step and calculates the voltage and current values of the respective nodes ► Useful for start up, stability, and transient analysis 32 ©2022 Analog Devices, Inc. All rights reserved. 32 16 4/20/2022 Completed Schematic 33 ©2022 Analog Devices, Inc. All rights reserved. 33 Summary of Shortcuts (Toolbar is Available in Windows Version) Zoom In [scroll wheel] Pan [click hold] Zoom Out [scroll wheel] Autoscale [space] Delete [Del or F5] Duplicate [Ctrl+C] Paste b/t Schematics [Ctrl+V] Find [Ctrl+F] 34 Place Circuit Element [F2] Place Diode [D] Place Inductor [L] Place Capacitor [C] Place Resistor [R] Label Node [F4] Place Ground [G] Draw Wire [F3] Toolbar is handy but keyboard shortcuts are more efficient Move [F7] Drag [F8] Undo [F9] Redo [Shift+F9] Rotate [Ctrl+R] Mirror [Ctrl+E] Place Comment/text [T] Place SPICE directive [S] ©2022 Analog Devices, Inc. All rights reserved. 34 17 4/20/2022 Running and Probing a Schematic EXAMPLE: SINGLE POLE FILTER USING RC NETWORK 35 LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 35 Running the RC Circuit Simulation ► With the schematic window active, click on the RUN button on the toolbar Run 36 ©2022 Analog Devices, Inc. All rights reserved. RCFilterTimeDomain.asc 36 18 4/20/2022 Probe Voltages ► Plot the voltage on any wire by a simple point and click Click here for output waveform 37 ©2022 Analog Devices, Inc. All rights reserved. RCFilterTimeDomain.asc 37 Measurement Cursor ► In the waveform window, left+click the mouse on the waveform name Click to display measurement cursor. Click and drag cursor position. To add a second measurement cursor, left+click again on the waveform name RCFilterTimeDomain.asc 38 ©2022 Analog Devices, Inc. All rights reserved. 38 19 4/20/2022 Probe Current ► Plot the current through any component by clicking on the body of the component Click here for resistor current waveform 39 ©2022 Analog Devices, Inc. All rights reserved. RCFilterTimeDomain.asc 39 Adding Plot Pane ► Select ► Drag 40 “Add Plot Pane” under the Plot Settings pull-down menu and drop a waveform name into the new plot pane ©2022 Analog Devices, Inc. All rights reserved. RCFilterTimeDomain.asc 40 20 4/20/2022 Alternate: Right Click on Waveform Viewer to Add Plot Pane 41 ©2022 Analog Devices, Inc. All rights reserved. 41 AC Analysis EXAMPLE: SINGLE POLE FILTER USING RC NETWORK 42 LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 42 21 4/20/2022 Edit Simulation Command - AC Analysis ► Performs small signal AC analysis linearized about the DC operating point ► Useful for analysis of filters, networks, stability analysis, and noise considerations 43 ©2022 Analog Devices, Inc. All rights reserved. 43 Simulating AC Analysis Set voltage source to AC amplitude of 1 (sets magnitude to 0dB) Right-click on .tran command and select “AC Analysis” 44 ©2022 Analog Devices, Inc. All rights reserved. 44 22 4/20/2022 Run & Probe Output Click here for Bode plot Click here to Measure -3db point 45 ©2022 Analog Devices, Inc. All rights reserved. 45 Measure the -3db Point -3dB point: 1/(2*pi*R*C) = 159Hz 46 ©2022 Analog Devices, Inc. All rights reserved. 46 23 4/20/2022 Running a Simulation and Analyzing Circuit Performance EXAMPLE: DC/DC CONVERTER DEMO CIRCUIT 47 LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 47 Running a DC/DC Converter Simulation 48 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 48 24 4/20/2022 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 49 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 49 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. You can also use the search function ( ) Alt-LeftClick Net Highlighted 50 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 50 25 4/20/2022 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 LTC3412A_DC_Load.asc ©2022 Analog Devices, Inc. All rights reserved. 51 51 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 LTC3412A_DC_Load.asc 52 ©2022 Analog Devices, Inc. All rights reserved. 52 26 4/20/2022 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 53 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 53 Deleting Waveforms ► Method #1: Right-Click on a trace label to be deleted Select “Delete this Trace” Deletes only the selected trace LTC3412A_DC_Load.asc 54 ©2022 Analog Devices, Inc. All rights reserved. 54 27 4/20/2022 Deleting Waveforms ► Method #2: 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 to quit 55 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 55 Deleting Waveforms ► Method #3: Plot the same waveform twice in succession Deletes all but that waveform Click, click 56 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 56 28 4/20/2022 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 Zoom Full Extents LTC3412A_DC_Load.asc 57 ©2022 Analog Devices, Inc. All rights reserved. 57 Measuring V, I and Time in the Waveform (Measurement Using Cursors) ► Right-Click ► For on the waveform name in the waveform window “Attached Cursor”, select “1st & 2nd” ► Position cursors to make desired measurements 1. 2. 3. Result LTC3412A_DC_Load.asc 58 ©2022 Analog Devices, Inc. All rights reserved. 58 29 4/20/2022 Measuring V, I and Time in the Waveform (Measurement Using Zoom Window) ► Drag a box about the region you wish to measure Left-Click, drag, and hold ► View the lower left corner of the window for the status bar. The dx and dy measurement data is displayed here. ► Use Undo from the File menu or press “F9” 59 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 59 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 LTC3412A_DC_Load.asc 60 ©2022 Analog Devices, Inc. All rights reserved. 60 30 4/20/2022 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 LTC3412A circuit. Zoom in as shown for this waveform. 61 ©2022 Analog Devices, Inc. All rights reserved. LTC3412A_DC_Load.asc 61 Instantaneous & Average Power Dissipation ► Instantaneous Power Dissipation Alt+Left-Click on the symbol of the LTC3412A 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 LTC3412A IC 62 LTC3412A_DC_Load.asc ©2022 Analog Devices, Inc. All rights reserved. 62 31 4/20/2022 Simulating a Transient Response Demonstration LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 63 63 Current Load and Pulse Function ► You can simulate a load with a Resistor or Current (active) load ► In particular, the Pulse function with a current load is helpful for transient response analysis Steps a current load from one load value to another load value LTC3412APulseLoadSolution.asc 64 ©2022 Analog Devices, Inc. All rights reserved. 64 32 4/20/2022 Edit the Current Load to a Pulse Function ► Edit the .tran directive in the LTC3412A simulation to disable steady state detection ► Right-Click on the current load Select “Pulse” Modify the attributes (see below). Click “OK” * 65 Forces current to be zero when voltage is zero ©2022 Analog Devices, Inc. All rights reserved. 65 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 ► Use the application of the pulse load / transient response to verify stability and modify the compensation components, as necessary. LTC3412APulseLoadSolution.asc 66 ©2022 Analog Devices, Inc. All rights reserved. 66 33 4/20/2022 Homework LTspice Free – Fast – Unlimited 67 ©2022 Analog Devices, Inc. All rights reserved. 67 Homework ► Design and draft a circuit to measure the common mode rejection ratio (CMRR) of the LTC1150 in LTspice LTC1150 is a ±15V Zero-Drift Operational Amplifier with Internal Capacitors ► Measure and calculate the CMRR in dB using: 1. Nominal “ideal” resistor values 2. Randomly vary individual resistor values by 1% tolerance ► Explain ► Email why there is a difference in CMRR measurement your schematic file, results and questions in the next 2 days Mario.Gonzalez@arrow.com Charly.El-khoury@analog.com 68 ©2022 Analog Devices, Inc. All rights reserved. 68 34 4/20/2022 Resources and Support LTspice Free – Fast – Unlimited 69 ©2022 Analog Devices, Inc. All rights reserved. 69 LTspice Help File (F1) and Independent LTwiki.org 70 ©2022 Analog Devices, Inc. All rights reserved. 70 35 4/20/2022 EngineerZone LTspice Forum and Independent User Group groups.io/g/LTspice https://ez.analog.com/ Great for LTspice or ADI Model Support (ideal for beginners) Great community of analog engineers (*not* ideal for beginners) 71 ©2022 Analog Devices, Inc. All rights reserved. 71 Shortcut Keys Flyer, Getting Started Guide, Tutorials & Technical Articles www.analog.com/LTspice 72 ©2022 Analog Devices, Inc. All rights reserved. 72 36 4/20/2022 LTspice Examples and Demo Circuits www.analog.com/LTspice ©2022 Analog Devices, Inc. All rights reserved. 73 73 LTspice Technical Support on Software Bugs and ADI Models ► LTspice@analog.com Please provide the following details and attach your LTspice schematic file (.asc), project file (.plt), and any non-standard model and symbol files (.asy, .lib, .txt, etc.) Full Name: Organization: Phone Number: Application: Primary ADI Part(s): Detailed Description: If you have an issue with a third-party model, please contact that vendor for support! 74 ©2022 Analog Devices, Inc. All rights reserved. 74 37 4/20/2022 Happy Simulations! MARIO.GONZALEZ@ARROW.COM CHARLY.EL-KHOURY@ANALOG.COM LTspice Free – Fast – Unlimited ©2022 Analog Devices, Inc. All rights reserved. 75 38