Introduction to Ltspice Usage of Ltspice
Total Page:16
File Type:pdf, Size:1020Kb
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 printed circuit board 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 diodes or transistors will be replaced by a simplified equivalent circuit before doing the nodal analysis. Example : Transistor 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 + <model> [extra parameters] Arbitrary behavioral source - Bxx - n+ n- <V=... or I=...> Capacitor - Cxx - n+ n- <capacitance> + [ic=<val.>] [Rser=<val.>] + [Lser=<val.>] [Rpar=<val.>] + [Cpar=<val.>] [m=<val.>] Diode - Dxx A K <model> [area] Voltage dependent voltage - Exx - n+ n- nc+ nc- <gain> Current dependent current - Fxx - n+ n- <Vnam> <gain> Voltage dependent current - Gxx - n+ n- nc+ nc- <transcond.> Current dependent voltage - Hxx - n+ n- <Vnam> <transres.> Independent current source - Ixx - n+ n- <current> JFET transistor - Jxx - D G S <model> [area] [off] + [IC=<Vds,Vgs>] [temp=<T>] Mutual inductance - Kxx - L1 L2 L3... <coeff.> Inductance - Lxx - n+ n- <inductance>[ic=<val.>] + [Rser=<val.>] [Rpar=<val.>] + [Cpar=<val.>] [m=<val.>] 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 <model> [L=<len>] Usage of LTSpice + [W=<width>] [AD=<area>] + [AS=<area>] [PD=<perim>] + [PS=<perim>] [NRD=<value>] + [NRS=<value>] [off] + [IC=<Vds, Vgs, Vbs> + [temp=<T>] Lossy transmission line - Oxx - L+ L- R+ R- <model> Bipolar transistor - Qxx - C B E [S] <model> [area] + [off] [IC=Vbe,Vce][temp=<T>] Resistor - Rxx - n1 n2 <value> Voltage controlled switch - Sxx - n1 n2 nc+ nc- <model> [on,off] Lossless transmission line - Txx - L+ L- R+ R- ZO=<value> TD=<value> Uniform RC-line - Uxx - n1 n2 ncommon <model> L=<len> + [N=<lumps>] Independent voltage source - Vxx - n+ n- <voltage> Current controlled switch - Wxx - n1 n2 <Vnam> <model> [on,off] Subcircuit - Xxx - n1 n2 n3... <subckt name> MESFET transistor - Zxx - D G S model [area] [off] [IC=<Vds,Vgs>] 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 <srcnam> <Vstart> <Vstop> <Vincr> + [<srcnam2> <Vstart2> <Vstop2> <Vincr2>] ) • Transient analysis .TRAN <Tstep> <Tstop> [Tstart [dTmax]] [modifiers] • AC analysis .ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq> • 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 circuit diagram. 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.