Sei sulla pagina 1di 43

LTSpice: Basics

The purpose of this presentation is to get you familiar with the basics of LTSpice. Advanced functions and features will follow in subsequent presentations.

Steps to creating and running a schematic in LTSpice


Install the program Set up the program options Draw the schematic Adding the parts Connecting the parts Assigning part values Setup the simulation Run the simulation View the results

The webpage for downloading LTSpice is at http://www.linear.com/company/software.jsp

Follow the link and install the program

Open the program to begin.

The first step is to start a new schematic. Existing circuits can be opened as well.

Once youve started a new schematic, consider saving it (Save As) ASAP!

Once you have LTSpice installed, there are a few options you can set, if you like, such as color preferences for the backgrounds for schematics and waveform plots.

Many people prefer a white background for the schematics and waveform plots. Color preferences can be set by the user.

You can set view options such as showing the grid

Remembering the shortcut keys for various functions can be helpful.

There are two ways to add components. The first is too add components using the toolbar and the second is to use the drop down menu (Edit)
Ground

Ground

Selecting Components will show a menu of symbols for available components.


Some of the important Components are: voltage=voltage source Current=current source e & e2=voltage controlled voltage sources g & g2=voltage controlled current sources Most of the others are selfexplanatory.

Note the Top Directory where the symbols are located. This is where LTSpice symbols are located.

You can also keep your own symbols and schematics or libraries associated with those symbols in the same directory as your schematic.

User created symbol for an ideal op-amp and the schematic associated with the symbol.

Lets build an op-amp based inverting amplifier


The steps to drawing a schematic are: Draw the schematic Adding the parts Connecting the parts Assigning part values
These steps assume that you have created a project directory and downloaded the symbol and schematic for an ideal op-amp and placed it in your project directory. If you havent down this, you can use an op-amp provided by LTSpice.

First, save your schematic as inverting amplifier

Note that a schematic for the ideal_opamp has been placed in the project directory.

Now, add the parts.

Move

Some useful functions that can be used to place and align components are Rotate, Mirror, and Move. Delete, undo, and redo, can also be handy.

Text can be moved by selecting the move command and then left-clicking on the text to select it.
Visable component names can be changed by right-clicking on the name text.

Now lets connect the parts. Parts can be connected using the Draw Wire command

Here is the result of connected the components. Note that when 3 or more wires are connected, a square indicates a good connection has been made.

By right clicking on a wire or node, you can name that node. This can be very handy.
Lets name the output node out. Nodes that are not named by the user are assigned names by LTSpice. These names are in the form of N001, N002, etc. If you place the cursor over a node, the node name will be depicted in the bottom left corner of the window. Your schematic should be wired by now.

Drag can also be a useful command.


Drag will let you move single or groups of parts will still maintaining the wire connections.

Select the drag command and select the voltage source and R1 to test this command.

Now, well assign component values


There are three ways to assign component values. The first is to right click on the visible value in the window. You may also use this for special placement (justification and vertical) of the displayed values.

The second way to assign component values is to right-click on the component.

The window on the right appears after selecting Advanced in the Voltage Source -VS window. Set the AC Amplitude to 1V. By default, all values not specified with be set to zero.

The third way to change component values is to control-right click on the component.
This method allows you To change attributes (properties) of the component. With this window, you can choose not to display the value. Each of the three methods of changing component values have advantages and/or special uses.

You can also add text to the schematic. This is very useful for documentation.
Add the text: Inverting Amplifier to your schematic.

Schematic after assigning component values


Next, we set the simulation up.

There are two ways to set up an analysis. The 1st is with a SPICE Analysis command and the 2nd is with a SPICE Directive Command
Well use the SPICE Analysis This will open the following window.

Note the different simulation possibilities: 1) Transient 2) AC Analysis 3) DC Sweep 4) Noise 5) DC Transfer and DC op pnt.

Select AC Analysis to determine the circuits response vs. frequency.


The Type of Sweep is decade. This is the best sweep when analyzing over a wide frequency range. Set the simulation up as shown in the window. Generally, the number of points per decade should be set high enough to capture all info and provide a smooth curve, but not so large as to require a long simulation. Note the syntax at the bottom of the window. LTSpice will place this text in the schematic.

The Schematic with AC simulation specified.


To use the SPICE directive option, you must type in the entire command. This requires knowledge of the syntax used for commands. LTSpice commands that are not in the drop down menus can be specified with this option. Commands always start with a period.

Select View Spice Netlist to view the netlist.


The netlist contains text information on the components, their values and attributes, how they are connected, simulation info and other commands. This netlist is somewhat portable between simulations. Often, with minor modifications this netlist can be edited and saved in a text file that can be run by other circuit simulations software such as PSpice, WinSpice, and HSpice. In fact, when we run LTSpice, it generates this netlist and the netlist is the input to the simulation engine.

Now, run the circuit.

Notice that a plot window has opened.


There are two ways to plot voltages and currents. The first way is to select the schematic and place the cursor over the desired node (or wire). A probe symbol will appear. Clicking on the node or wire will plot that voltage in the plot window. The axis on the left is magnitude, and on the right, phase.

To plot current, place the cursor over the device close to the terminal where the desired current is to be plotted.
A meter and arrow pointing in the direction of positive current flow will be displayed. Careful: For two terminal components, LTSpice takes the first node listed in the netlist as the positive node and the second as the negative node. Positive current is defined with passive device conventions, flowing into the positive node and out of the negative node. Sometimes, the designation can seem arbitrary. Delete I(R1) and plot V(out) again.

Vertical axis settings can be changed by left-clicking on the vertical axis. Let change the magnitude axis to linear and set the Top and Bottom to 15 and 0 with 1V ticks.
Lets also choose to Dont plot the phase for the vertical phase axis. Note the phase is -180 degrees signifying that this is an inverting amp

Other plot features be set by right clicking on the plot or by selecting Plot Settings

You can also add traces by selecting Add trace in the Plot Settings menu.

This can be handy for plotting expressions. Since our input is 1V, V(out) is the gain of the circuit. However we could have plotted V(out)/V(n002)

Remove V(out) and plot V(out)/V(n002) and reset the vertical axis settings. Enlarge the plot to full screen.
The numbers in the right hand corner of the of the window depict the cursor position. This is very handy for a quick read on plot values. Note: Plot the node voltage at the source. Your node may not be V(n002)!

Lets plot a couple more voltages.

Remove V(out)/V(n002) and plot V(out) and the voltage at the inverting terminal V(n001) for mine.

The last function well look at is the cursor feature


Right click on the name V(out) to show attached a cursor. Lets attach two cursors.

After attaching two cursors to V(out), you can move the cursors along the trace and get a precise readout of the points.
You can also label a particular point.

To cut and paste the plot into a document (Word, for example) select Tools-Copy bitmap to Clipboard.

Likewise, to cut and paste the schematic into a document (Word, for example) select Tools-Copy bitmap to Clipboard.

This presentation shows the basics of LTSpice. Advanced features and functions will be forthcoming.

Potrebbero piacerti anche