AdvEE Lab - Electronic Devices Uwe Pagel March 13, 2018

Circuit Design LTSpice Introduction to LTSpice Usage of LTSpice

Uwe Pagel March 13, 2018

Department of EECS Jacobs University Bremen

Instructors - Dr. Mathias Bode and - Uwe Pagel

e-mail - [email protected] tel.: +49 421 200-3139 - [email protected] tel.: +49 421 200 3114

Website - http://www.faculty.jacobs-university.de/upagel AdvEE Lab - Electronic Devices Uwe Pagel Outline March 13, 2018

Circuit Design

LTSpice

Usage of LTSpice

1 Circuit Design

2 LTSpice

3 Usage of LTSpice AdvEE Lab - Electronic Devices Uwe Pagel Circuit Design March 13, 2018 Design flow

Circuit Design Design Flow Why Simulation? Simulators The normal design flow is: LTSpice • Usage of LTSpice Develop a circuit (on paper) • Check the design • Improve the design • Iterate through check/ improve • Build/ use the developed circuit

Checking a design means building a circuit, determine and improving the properties. This might be a time consuming process so in the early 1970s people at Berkeley started to develop a simulation program called ’SPICE’ Simulation Program with Integrated Circuit Emphasis . AdvEE Lab - Electronic Devices Uwe Pagel Circuit Design March 13, 2018 Why Simulation?

Circuit Design Design Flow Why Simulation? Simulators LTSpice Why should we use a simulation software? Usage of LTSpice • The simulator allows a designer to evaluate a (maybe huge) circuit without building it. • It makes it simple to check variations of a design • It is possible to vary tolerances of components and the environment (temperature) • It saves time and money

After simulating a design the developer knows what to expect when building the circuit. Simulation alone is not sufficient to check the function of a circuit!!. The final hardware setup may add additional effects! AdvEE Lab - Electronic Devices Uwe Pagel Circuit Design March 13, 2018 Simulators

Circuit Design Design Flow Why Simulation? Simulators

LTSpice

Usage of LTSpice There are different specialized simulators available:

• for Analog circuits • for pure digital circuits • for mixed analog and digital circuits Of course digital circuits consist of analog elements. So in general it is possible to use an ’analog’ simulator. For optimization reasons these programs work different than the analog simulators. AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 From SPICE to LTSPice

Circuit Design

LTSpice From SPICE to LTSPice What is available - what will we use in lab: How LTSpice works Usage of LTSpice • As already mentioned in the beginning the development of SPICE started in the early 1970s at Berkeley. The last public domain version was SPICE3 in the mid 1980s. • Based on the last Spice version commercial simulators were developed. These simulators cover design or integrated circuit design. • Commercial simulators are in the range of several kEUR. Free trial versions are highly limited. In the lab we use one of the rare free (highly used) simulators developed and released from Linear Technology ’LTSpice’. • This simulator is not limited in function. It is based on the old Spice and fully compatible. Of course you should use their components and libraries but it is no problem to use models and libraries from other sources. AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design

LTSpice From SPICE to LTSPice How LTSpice works How LTSpice works Usage of LTSpice • Spice works the same way how one would do it on paper! • It will do a nodal analysis of the circuit, generate the equations and solve the resulting matrixes. • Non-linear elements like or will be replaced by a simplified equivalent circuit before doing the nodal analysis. Example : p-model AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design Circuit Elements LTSpice From SPICE to LTSPice How LTSpice works Special functions - Axx - n1 n2 n3 n4 n5 n6 n7 n8

Usage of LTSpice + [extra parameters] Arbitrary behavioral source - Bxx - n+ n- - Cxx - n+ n- + [ic=] [Rser=] + [Lser=] [Rpar=] + [Cpar=] [m=] - Dxx A K [area] Voltage dependent voltage - Exx - n+ n- nc+ nc- Current dependent current - Fxx - n+ n- Voltage dependent current - Gxx - n+ n- nc+ nc- Current dependent voltage - Hxx - n+ n- Independent current source - Ixx - n+ n- JFET transistor - Jxx - D G S [area] [off] + [IC=] [temp=] Mutual inductance - Kxx - L1 L2 L3... Inductance - Lxx - n+ n- [ic=] + [Rser=] [Rpar=] + [Cpar=] [m=] AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design

LTSpice Circuit Elements From SPICE to LTSPice How LTSpice works MOSFET transistor - Mxx - D G S B [L=]

Usage of LTSpice + [W=] [AD=] + [AS=] [PD=] + [PS=] [NRD=] + [NRS=] [off] + [IC= + [temp=] Lossy transmission line - Oxx - L+ L- R+ R- Bipolar transistor - Qxx - C B E [S] [area] + [off] [IC=Vbe,Vce][temp=] - Rxx - n1 n2 Voltage controlled switch - Sxx - n1 n2 nc+ nc- [on,off] Lossless transmission line - Txx - L+ L- R+ R- ZO= TD= Uniform RC-line - Uxx - n1 n2 ncommon L= + [N=] Independent voltage source - Vxx - n+ n- Current controlled switch - Wxx - n1 n2 [on,off] Subcircuit - Xxx - n1 n2 n3... MESFET transistor - Zxx - D G S model [area] [off] [IC=] AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design

LTSpice From SPICE to LTSPice How LTSpice works

Usage of LTSpice Circuit Elements Circuit elements ... • are the generic components of a Spice simulation. • describe the outline and the behavior of an element. • are in almost all cases already some kind of model because there is no element which is ’pure’. • might be custom designed using ’Special Function’ and ’Subcircuit’. All basic elements are predefined with basic models and meaningful parameters. So it is possible to simulate a circuit in any case. A ’real’ simulation needs adjusted models usually provided by the manufacturer of an element. AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design Net List LTSpice From SPICE to LTSPice How LTSpice works • The net list is the main control of a Spice simulation. Usage of LTSpice • It is created either with a text editor or it is ’compiled’ from a schematic. • The net list includes the circuit with all connections and elements, models, sub circuits, and simulation (dot) commands. Example: AdvEE Lab - Electronic Devices Uwe Pagel LTSpice March 13, 2018 How LTSpice works

Circuit Design

LTSpice From SPICE to LTSPice How LTSpice works Usage of LTSpice Simulation Modes:

• DC bias point details (.op) • DC analysis (.DC + [ ] ) • Transient analysis .TRAN [Tstart [dTmax]] [modifiers] • AC analysis .ac • Temperature analysis • Monte Carlo analysis (Analysis use random parameters) AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Circuit input

Circuit Design

LTSpice

Usage of LTSpice Circuit input Circuit input Simulation Output • The archaic way ... Notations and Hints Use a sketch of the circuit, mark all nodes, and write the net list Install LTSpice using a text editor. Add all needed libraries, definitions, and measurement and simulation commands. Store it as a "*.cir" file. Run the simulation! In pre GUI times the only way. Nowadays still reasonable when creating model definitions or special functions. That’s why it is necessary to at least understand the contents of a netlist!!!! • The usual way today (and in LTSpice) ... Draw the circuit using a schematic editor. Select all needed libraries, definitions, and measurement and simulation commands either from a menu or add it in textual form to the sketch. Save and run the simulation! AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Simulation

Circuit Design

LTSpice

Usage of LTSpice Circuit input Simulation Output Simulation Notations and Hints Install LTSpice • There is not much to say... simply start the simulation by pushing the button!!! • In case of problems like missing values, definitions, or connections a window will pop up and will give you a more or less reasonable hint. You will find the text also in the "*.log" file. • If the run was successful only in case of a .op simulation a window will pop up. in all other cases the (empty) diagram window will show up. Additional information is written into the "*.log" file. In case of a .op run also the values are shown there. AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Output

Circuit Design LTSpice Output Usage of LTSpice Circuit input • In prehistoric times ... Simulation The output is a may be several 1000 lines long list with the Output Notations and Hints requested numbers in several rows! Your problem to make a Install LTSpice diagram out of it... Nowadays textual output is only used for special single measurement, e.g. the calculated frequency parameters of a filter, or the DC operation points from an .op analysis. These parameters will show up in the "*.log" file after the simulation run. • The usual way today (and in LTSpice)... After the simulation a diagram screen will show up. Like with a probe on the bread board you point with the cursor to the nodes in the . The time response will be shown in the diagram!! In case of the .op analysis the cursor makes the potential and/or current at that point visible. If needed the value list is still available. This may be used to transfer the values to e.g. MatLab for further analysis. AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Notations and Hints

Circuit Design

LTSpice

Usage of LTSpice Notations and Hints Circuit input Simulation • LTSpice is –NOT Case sensitive!!–. E.g. the engineering multiplier "milli" Output can be expressed as "m" or "M". Notations and Hints Install LTSpice • After the component identifier e.g. Q for a BJT the name may have any length and must be unique for every component. • When writing a net list or drawing a schematic...

You -MUST- define a node. There must be a node ’0’ in the "*.cir" file or the ’GND’ symbols has to be placed in the schematic. The ground node is the reference for the simulation!! • For the simulation in general... Keep in mind that it is some kind of ’ideal’!! The components might be close to reality but the real hardware may contain some extra elements like line resistance, parasitic inductance and capacitance. The output values are measured with ideal instruments. AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Notations and Hints

Circuit Design

LTSpice Notations and Hints Usage of LTSpice Circuit input • Numbers can be expressed in scientific notation; e.g., 1e3, in normal Simulation format 1000; but can also use engineering multipliers like m, k. So 1000.0 Output Notations and Hints may be written as 1K. Below is a table of understood multipliers: Install LTSpice Suffix Multiplier T, t 1012 G, g 109 Meg, meg 106 k. K 103 Mil, mil 25.4 ∗ 10−6 m, M 10−3 u(or µ) 1−6 n, N 10−9 p, P 10−12 f, F 10−15 !!Be careful... "m" or "M" is the same, means "milli". "M" is not "Mega". Use "Meg" instead!! AdvEE Lab - Electronic Devices Uwe Pagel Usage of LTSpice March 13, 2018 Install LTSpice

Circuit Design

LTSpice Install LTSpice Usage of LTSpice Circuit input Simulation Download LTspice from Output Notations and Hints http://www.linear.com/designtools/software/. Install LTSpice The program is named ’LTspice’. It is available as Windows and OSx version! There is no special version. It should work using "". Install LTspice with the suggested options. Although the simulator includes a lot of elements in it’s libraries some components for the course are missing. Download the following files from the course web site: • AdvEE_Components.zip An analog library with all necessary components. • DigLibs.zip A digital circuit library. Instructions how to install the libraries are included in the .zip files! Installation of the software is the prelab this time. The first session in lab is a tutorial on using the simulator!