introduction to ltspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/ltspiceintro.pdf ·...

39
6.101 Spring 2018 Lecture 4 Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner (6.101 TA 2014), Engineer, Linear Technology

Upload: others

Post on 29-Aug-2019

113 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

6.101Spring2018 Lecture4

IntroductiontoLTspiceAcknowledgment:LTspicematerialbasedinpartbyDevonRosner(6.101TA2014),Engineer,LinearTechnology

Page 2: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

SPICE •  Simulation Program with Integrated

Circuit Emphasis •  Developed in 1973 by Laurence Nagel at

UC Berkeley’s Electronics Research Laboratory

•  Dependent on user defined device models

6.101Spring2018 Lecture4 2

Page 3: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Netlists

6.101Spring2018 Lecture4

Components

Commands

3

Page 4: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

LTspice •  Developed in 1998 by Mike Engelhardt at Linear

Technology Corporation •  GUI, simulator, and schematic -> netlist for SPICE •  FREE and comes with tons of models

6.101Spring2018 Lecture4

You do this Ltspice makes this

4

Page 5: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Getting Started

6.101Spring2018 Lecture4

THAT’S IT!

These buttons are where you will live

5

Page 6: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Component to Menu Item Matchup

6.101Spring2018 Lecture4 6

Page 7: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

NetLabels

6.101Spring2018 Lecture4

By labeling nets you can avoid a giant mess of wires. Always use these for at least your power supplies. When you start making large circuits, your power supplies will provide energy all over your schematic.

7

Page 8: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Adding Other Components

6.101Spring2018 Lecture4

Devices besides basic resistors, capacitors, and inductors are found from this button

8

Page 9: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Op-Amps

6.101Spring2018 Lecture4

There are no “ideal” op-amps in reality. BUT, there are in LTspice.

PAY CLOSE ATTENTION TO THE TEXT You must literally include .lib opamp.sub in your netlist or schematic as a SPICE directive.

9

Page 10: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Op-AmpsThough listed as “ideal” there are still 2 parameters you can tweak.

6.101Spring2018 Lecture4 10

Open Loop Gain: As this number approaches infinity, the Op Amp becomes more “ideal”. Look at some Op Amp data sheets to see some real open loop gains.

Gain Bandwidth: As this number approaches infinity, the Op Amp becomes more “ideal”. To check if this is high enough, multiply your desired Closed Loop Gain by your highest desired output frequency.

Page 11: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Op-AmpsTo more accurately model a real Op Amp not available in LTspice, UniversalOpamp2 has many tweakable parameters.

6.101Spring2018 Lecture4 11

Open loop gain, gain bandwidth, slew rate, current limit, rail-rail voltage, input voltage offset, phase margin, Rin, etc.

Page 12: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Editing Components

6.101Spring2018 Lecture4

Just right click the component

12

Page 13: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Editing Components

6.101Spring2018 Lecture4

This is the basic voltage source menu. Use this for DC sources such as power supplies or bias voltages.

But what about this?

13

Page 14: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Editing Components

6.101Spring2018 Lecture4

Voltage sources can produce many test signals. PWL can be used to construct any signal.

14

Page 15: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Selecting Device Model

6.101Spring2018 Lecture4

There are no “ideal” BJT’s, MOSFET’s, etc. You can select a model (provided by LTspice), download models, or create your own.

15

Page 16: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Simulation: Transient Transient simulation gives Voltage and/or Current vs.time.

6.101Spring2018 Lecture4

These are transient parameters for a voltage source

16

Page 17: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Simulation: Transient

6.101Spring2018 Lecture4

This is all you really need

17

Page 18: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Random Tangent: Parameters

6.101Spring2018 Lecture4

This is a parameter

You MUST define all of your parameters. The “list” command allows you to choose multiple values (simulation simulates each value separately).

18

Page 19: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

What Should My Circuit Do? •  The very first step to any simulation is to know how

your circuit should behave. Simulation is a verification tool NOT A CIRCUIT SOLVER.

•  So how should this circuit behave?

6.101Spring2018 Lecture4 19

Page 20: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Here’s Where You Write the Solution

6.101Spring2018 Lecture4 20

Page 21: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Here’s Where You Write the Solution

6.101Spring2018 Lecture4

vx vo

i1

i2

i3

A DOUBLE POLE!!

21

Page 22: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Expected Behavior •  Double pole is at: •  We expect frequencies up to this point to be

large, but frequencies above to quickly drop off due to the -40 dB/decade characteristic of the double pole

6.101Spring2018 Lecture4 22

Page 23: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Transient Simulation

6.101Spring2018 Lecture4

Hover over the desired voltage node to be probed and click when you see this symbol

**This is the current probe

23

Page 24: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Transient Simulation

6.101Spring2018 Lecture4

1 kHz 10 kHz 100 kHz 1 MHz

24

Page 25: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

AC Simulation

6.101Spring2018 Lecture4

This is the AC parameter. Just set the amplitude to 1

AC simulation gives Voltage and/or Current vs.frequency.

25

Page 26: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

AC Simulation

6.101Spring2018 Lecture4 26

Page 27: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Extra Fun: Math in LTspice

6.101Spring2018 Lecture4

Remember:

27

Page 28: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Transient Simulation

6.101Spring2018 Lecture4

It’s the same as before!

28

Page 29: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Even More Fun

6.101Spring2018 Lecture4 29

*Note: You can try out some math functions in the simulator window, too! (ex: V(Vo)/V(Vi)).

Page 30: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

AC Simulation

6.101Spring2018 Lecture4 30

Page 31: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

TemperatureasaVariable

•  PTATcurrentsource

6.101Spring2018 Lecture4 31

Page 32: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

TemperatureasaVariable

6.101Spring2018 Lecture4 32

Page 33: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

IncludingExternalModels

6.101Spring2018 Lecture4 33

•  PFETmodel•  Includes

parameterstodescribeMOSdevicephysics

Page 34: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Making Things Pretty

6.101Spring2018 Lecture4 34

Page 35: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Making Things Pretty

6.101Spring2018 Lecture4 35

Page 36: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Making Things PrettyBob Reay of Linear Technology has provided a nifty tool on his website to give LTspice circuits an even better makeover: http://reaylabs.com/tools/SchematicViewer/SchematicViewer.html

6.101Spring2018 Lecture4 36

Before:

Page 37: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Making Things PrettyBob Reay of Linear Technology has provided a nifty tool on his website to give LTspice circuits an even better makeover: http://reaylabs.com/tools/SchematicViewer/SchematicViewer.html

6.101Spring2018 Lecture4 37

After:

Page 38: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

LTspice Secrets Many aspects and functions of LTspice are not documented. You can learn lots of interesting undocumented capabilities of LTspice from: http://ltwiki.org/?title=Undocumented_LTspice Of particular interest should be B-sources. These allow you to make devices such as non-linear resistors whose value is determined from a function of voltage, current, if statements, constants, etc. Though you cannot build these, they may be useful to model a part not available in LTspice, or to model a special function in your circuit you have not designed yet.

6.101Spring2018 Lecture4 38

Page 39: Introduction to LTspice - web.mit.eduweb.mit.edu/6.101/www/s2018/handouts/LTSpiceIntro.pdf · Introduction to LTspice Acknowledgment: LTspice material based in part by Devon Rosner

Questions??

6.101Spring2018 Lecture4 39