An Introduction to LTSpice

simulation

#1

LTSpice is a free circuit simulator from the manufacturer Analog Devices that uses a mixture of Spice commands and circuit diagrams with a sizable library of passive and active components. The software also allows sub-circuits and Hierarchical circuits of any size, even from third-party sources to add components that are not currently available in the library. There is already a lot of support for the program and it always helps to have more if questions are answered vaguely online. Personally, I have been using this software to help me understand more complicated circuit concepts that are introduced in electronics classes. Also, this tool is useful for testing out ideas that often use high current which requires plenty of safety factors when testing. This first post about this software will be basic installation and user interface information.

Installation

Click here for the download page
These posts will talk about the Windows version as it is a little more user-friendly, there is a Macintosh version, but I found that version very difficult to use when I tried it. The installation is a typical executable installation process, follow the recommended Windows default installation process. When this is finished, there will be a new folder located at C:\Program\Files\LTC\LTspiceXVII\ where the default program is. I would recommend making a desktop shortcut by right-clicking the program named XVIIx64 (this might be different based on the operating system). Rename the program to something easier once the shortcut is on the Desktop. This is a type of program that needs to stay inside the installation folder for it to function properly because of how the libraries and other important running files work.

Basic User Interface

When the program is opened, the main interface will be seen:


The software uses an embedded window for the circuit space, drawings for new parts, and the embedded “oscilloscope”. The windows can be cascaded/rearranged and the program can run several circuits (limits window space) at once. There will be no schematic loaded from starting the program, so a new one has to be made by clicking the icon under File to start a new circuit draft or using the File drop-down menu. The main tools used in this program are listed under File, View, Tools, and Help. One can hover over the toolbars to see what function they provide. The ones I use the most are Zoom full extents, Run, Auto-range, and the basic components such as wire, ground, label net, capacitors, inductors, diodes, and other components (the one that looks like an AND gate). There is a list of shortcuts that can be used for moving around the parts, copying, pasting, deleting, mirroring, rotating listed in the control panel:

  1. Click the hammer for the control panel.
    CtrlPanel
  2. Click the tab that says Drafting Options.
    draftopts
  3. Click the Hot Keys[*] button for all the shortcuts, these can be edited too.
    HotKeys
    Before I cover the last section for this first post, there is one other suggestion. Make a local folder on the Desktop or wherever to save schematics, symbols, sub-circuits, and plots. This makes it easier to save circuits in one place and then be able to reference the same folder for sub-circuits or Hierarchical circuits instead of trying to set up different folders and becoming confused later on. Linking this folder to the directories LTSpice searches will make other topics easier by having one master folder. The first step is to simply make a folder in the desired location, I will use the Desktop as my example. The destination address has to be known for this to make this work, my path to the folder I am using will be "C:\Users\kaleb_kohlhase\Desktop\test\ ". All the parts must be written down or copied in the address, including the working directory letter (mine is C:) After the path is copied or in a separate window, click the control panel button (hammer) again and click the Sym & Lib. Search Paths tab:

     1. Search paths tab:
         SymLibTab
      2. Paste or type in the path for Symbol Search Path and LIbrary Search Path
         TypeinPath
Each new path is separated by a return or semicolon, disregard my LTCustom path. After that, click Ok at the bottom of this prompt. These should be conserved between sessions according to the note at the bottom; if sub-circuits break in the future: this is likely the source if library paths are de-referenced.

Basic Circuit Simulation Example

The final section of this first post will be a basic RLC circuit with one DC voltage source and how to use the proper tools for getting started on analysis. For this example, there will be a resistor and inductor in series, one capacitor in parallel, and one further resistor in parallel to that capacitor.


Any values in mind can be substituted for the following parts in the circuit above if desired. LTSpice requires a ground reference in all circuit schematics to function properly.

  1. Place the voltage source, wires, ground, and passive components into the schematic.
    a. The voltage source is in the list of pre-loaded library files located in the Components list among many others.
    PreDesignedParts
    b. After clicking the above symbol, the Library should show:
    UIforPartSelect
    c. There is a search box under “Open this macro model’s test fixture” where a part can be searched for.
    searchFunc
    I usually type “vol” for a basic voltage source (AC, DC, and other options available for the model). Click OK and place one source anywhere on the document (Control + R to rotate component, Control + E to mirror component). After a source is placed, press Esc on the keyboard as the editor thinks multiple components are to be placed. This happens for all basic components and commands such as move or drag, so remember to press escape. I have been frustrated many times when the window starts moving really far from the part because I forgot to press escape. If the schematic is hard to find again, press Zoom To Extents:
    ZoomExtents
    d. Add all the other basic components by clicking the appropriate symbols.
    BasicCompList

    Parts can be connected together by placing the pins on top of each other in the grid to reduce wiring. Move around the parts using either move or drag (drag will create a lengthened wire instead of breaking connections). Wire the schematic using the wire tool which is to the left of the GND symbol. The tool will automatically end without pressing Esc when drawing node to node of each pin. Change the direction of the wire by clicking anywhere on the grid. Escape is only needed if a mistake is made. The undo function is to the right of the drag function (Ctrl + Z is assigned [changeable] to the Zoom command in this program). Nodes (blue solid squares) can be made if clicking the end of a wire directly on a different wire. If clicking past another wire and overlapping an existing wire, no nodes will be created. This is the same as “jumping” over an existing wire in other editors.

    The program doesn’t care how the parts are wired and length of wire doesn’t apply in basic analysis. If there is continuity with no missing connections to the positive and/or negative side of the circuit, it will simulate in most cases. There are some instances where small series resistors may need to be added if the components don’t have parasitic properties.
  2. Edit the values of the components by right-clicking each one, there will be a custom dialogue box based on the type of component.
    VoltEdit
    ResEdit
    IndEdit
    CapEdit
    Most components can be edited (there are a few library items that can’t be edited, but these are rare). The basic components need the basic primary value. The other values are optional for parasitic effects or more accurate models based on real-world equivalents.
  3. Run the simulation based on the type of analysis desired.
    RunSimToolbar
    There is also a second way to chose a simulation by clicking the menu Simulate at the top and clicking run.
    SimMenu
    There are many options for simulation from transient analysis to finding the DC operating point. I tend to use the first three the most. In this example, I wanted to run a basic simulation for 5 seconds and save data as soon as it starts. This only requires one input of Stop time: 5 (everything starts off in base SI units). When “OK” is clicked, the Spice directive will show up on the schematic (if it is in the way, the grab/drag tool can move it). A black graph will appear above the circuit. This is the simulated O-Scope.
    Voltage can be measured in two ways, clicking anywhere but ground reference will give a single node voltage output. The test lead can also be clicked and dragged to measure across several/single components to view voltage drop. The polarity will change based on the direction mouse is dragged. Current can be tested by hovering over a component with a test lead and clicking or holding the Alt key on the keyboard over a section of wire. Resistors will often give a negative current which will be the exact current calculated but reverse. It is recommended to measure current on the wires or components that give the expected current direction. Power is measured by holding the Alt key and clicking a component. Here is the waveform for the voltage across R1 and L1, current on the path for C1, and power consumed by R2:

    Each new value measured will show in a new color (there is a limit and the colors will cycle), but there are unique names for the test points at the top of the graph:

    The scales on the left and right of the graph will begin auto-adjusted to the most recent measurement. The units are also listed in the measurement scale. The scales can also be adjusted to Logarithmic by right-clicking the appropriate list of values. RMS can be calculated by pressing Control + Clicking the unique test point names. There are more advanced settings to do different calculations on the graphs, but that can be covered later. This concludes this post by introducing the basics of the user interface and simulation with some personal tips to make using the program easier.

See Also


#2

See also examples using LTSpice on eewiki found here.