| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

LTspice

Page history last edited by Rhishikesh Limaye 14 years, 5 months ago

LTspice is a free implementation of SPICE by Linear Technology. They claim it to be a fast SPICE simulator, especially good for switching mode power supplies (SMPS). These power supplies have a high-frequency square-wave trigger, but have slow overall responses. Thus naive simulation techniques take much longer time, or suffer from inaccuracies, or restrictions. LTspice is supposed to be fast for simulating such circuits. Simulation speed doesn't matter so much for the circuits of EE40. What matters is the simplicity of use (and of course, the zero cost). This document is a short guide on using LTspice, and it is based on the version 4.04f released in October 2009.

 

As you'll notice immediately after creating a new schematic, LTspice allows you to draw your circuits by placing components and connecting them using wires. Under the hood, it creates a textual SPICE netlist for your schematic, simulates it using its internal SPICE simulator, and presents the results.

 

Components

 

R, L, C are obvious to use. LTspice does recognize the SPICE-way of specifying values. The components other than simple R, L, C can be added using the Component button, which opens up a hierarchical component selection box. The following table shows the way to a few standard components.

 

Component
LTspice name Notes
Voltage source voltage The edit dialog for a voltage source shows just the DC value and series resistance by default, but the advanced button turns it into a full-featured signal generator with various waveforms such as pulse, sinusoid, exponential, piece-wise linear, etc.
Current source current Similar to the voltage source, this can also configured to be constant, or some waveform.
555 Misc/NE555  
IRF510 nmos After adding the nmos, right-click and press "Pick New MOSFET", and select IRF510 from a big list.
Diode diode By default, it is 1N914, which works well for basic uses. To choose another part number: right-click, press "Pick New Diode", and select from the list.
LMC6482 Opamps/LT1884 This is a substitute for LMC6482.
Voltage controlled switch sw

This produces an error/warning saying "can't find definition of model SW; Press OK to continue with the default model". And simulation does produce good result with the default model, which seems to be: SW RON = 1 ROFF = 1MEG VT = 0 VH = 0. You can specify a different model by adding a .MODEL directive. LTspice supports both SW and VSWITCH kind of models. See SPICE page, and LTspice help for more information. And see example design: vswitch.asc.

Comparator Comparators/LT1017  
SR flip-flop Digital/srflop There are no Vcc, Gnd pins for this flip-flop. By default the output switches between 0V, 1V. Seems like there is no way to make it swing to 5V.

 

Edit a component: right-click on its symbol. Dialog box that you get is typically customized to the component. For example, you can specify parasitic resistances and capacitances of an inductor or a capacitor. Ctrl + right-click gives a generic dialog for editing the SPICE parameters directly.

 

Edit a component name: right-click on the name instead of the component symbol.

 

 

Connections

 

Labeled net can be used for Vcc. But don't forget to add an actual constant voltage source between Vcc and Gnd.

 

A circuit must have a ground. That's because SPICE basically does modified nodal analysis.

 

Drawing wires: there is no smart layout or anything. If you want to avoid mess, you've to place your components and layout the wires appropriately.

 

Note: "move" moves an object by tearing it off from all its connections. Use "drag" if you want the wires to stick. The layout will probably be messed up still, as the wires aren't laid out automatically. So, again, place your components first, and then lay the wires, if you want a clean schematic.

 

Simulation

 

Press the Run button to start SPICE simulation. First time, it opens up a dialog box to construct a suitable simulation command. All the parameters are nothing more than the traditional SPICE simulation parameters, and it's good that LTspice shows the actual SPICE command line (e.g. ".tran 5" for doing transient analysis for 5 seconds). The simulation command is also printed on the schematic. To get back this dialog later, use "edit simulation cmd".

 

If simulation succeeds without any catastrophic errors, a waveform window pops up in case of transient simulation. It is initially blank, but if you hover over the wires you see a red probe cursor, which allows you to sense the voltage at that node. Hovering over resistors, capacitors and over pins of more complex components gives you the ammeter cursor, so that you can plot the current flowing through the resistor, capacitor or into the pin. To plot voltage difference between two nodes, left-click on the first node when you see the red cursor, and then drag the mouse to the other node, where the probe will turn black, then release the mouse. You can also pick traces, or form expressions to plot using View -> Visible Traces.

 

Important: sometimes simulation may produce warnings (e.g. about unconnected pins, or default values for parameters such as rise time) that can cause the simulation to produce incorrect/unexpected results. LTspice doesn't notify you about all of such warnings. You have to look at View -> SPICE Error Log to see them, if you suspect incorrect results. On the same note, View -> SPICE Netlist shows you the actual text of the SPICE netlist corresponding to your schematic.

 

Keyboard shortcuts

 

The default keyboard shortcuts are listed in the table below, and they can be customized by going to Tools -> Control Panel -> Drafting Options -> Hot Keys.

 

Operation
Shortcut
Resistor R
Capacitor C
Inductor L
Diode D
Ground G
Component F2
Draw wire F3
Label net F4
Delete F5
Duplicate F6
Move F7
Drag F8
Undo F9
Rotate

Ctrl+R

Mirror Ctrl+E

 

Note: Rotate and Mirror are usually grayed-out in the Edit menu, but are enabled when a component is selected using Move. Or they are active just before placing a component.

 

Comments (0)

You don't have permission to comment on this page.