So getting voltages and currents is all well and good, but you can do that by hand for most of these basic circuits. With the magic of computers we can calculate those same numbers but do it for a bunch of different values of some parameter, like a particular resistance.
To do this is pretty straightforward, but requires the use of a spice directive. I think you can handle it. I'll use a resistor as an example, but the idea should generalize. Right-click on the resistor, and for its resistance put "{R}" (Without quotes) and click OK. Press 's' to insert a SPICE directive. In the text box type ".step param R 1k 10k .1k". This tells SPICE to step the parameter R from 1k to 10k in steps of .1k. When you click OK, you will be able to place the SPICE directive anywhere on your schematic. The placement of the directive doesn't have any effect on how the simulation runs, so just put it somewhere where you can see it.
When you run the simulation the screen will split and you will see a blank graph on top and your circuit on the bottom. If you click on a node or component you will see its graph show up on the screen, autoscaled. Sometimes the autoscaling gets a little wonky, but never fear and just click on the graph and press CTRL+y. Clicking more nodes or components will plot them on the same graph, and clicking twice will plot that node by itself. To delete a single plot, right click on its name on the top of the graph and click the "Delete this Trace" button.
You can also graph mathematical functions of the voltages and currents in your circuit. For instance, to graph the power through a resistor R2 that connects nodes N001 and N002, click on the graph and press CTRL+a. In the "Expression" textbox, type (V(n001)-V(n002))*I(R2) and press OK. LTspice will even realize to plot the function in Watts!
Lastly, here's a little trick for plotting superpositions of a circuit: build the circuit, then copy and paste it so that you have as many copies as you do sources. Then delete all the sources but one from each circuit so that each copy has a different source. Leave the holes from current sources (open circuit) and connect the holes for voltage sources (short circuit). Then when you run your simulation, you can see the contribution of each source individually. It's a bit of a hack, but it makes it easy to graph them all at the same time.
OK, That should pretty much get you through Lab 1. Coming up next are subcircuits and dependant sources (they're easy!)
Tuesday, October 10, 2006
Subscribe to:
Post Comments (Atom)

2 comments:
I didn't realise I could do parametrics in LTSpice - many thanks!
Gals
You have got to see this. Obama playing on XBox. Funniest video ever. http://bit.ly/bllhx1
Post a Comment