311 SPICE Tutorial
311 SPICE Tutorial
During this tutorial, you will build a linear circuit consisting of a voltage source and two resistors. The purpose of this tutorial is to help you become comfortable with B2 Spice A/D v5, which includes the Circuit Editor (to draw the circuit) and the Virtual Instruments. To complete the tutorial, go through the following steps: Open the B2 Spice Program: Place the Devices Draw the Wires Set the Component properties Set up the Virtual Instruments Test the circuit Simulate the circuit. Save the Circuit
The first and easiest way of doing so is to choose a Voltmeter (Horizontal) from the Common Parts menu and place it above the rightmost resistor. The voltmeter is not an active part of the circuit. Its only purpose is to probe a voltage signal. The second way of designating a node is by using a Marker device, also found in the Common Parts->Markers->Voltage Probe Marker menu. The marker has the advantage of being small and is also used to make virtual connections, designate subcircuit pins, and setting initial voltages and guesses. For this Tutorial, we will be using the Marker / Voltage Probe. Select it from the Common Parts>Markers->Voltage Probe Marker menu and place it
Finish drawing the wires necessary to connect up the circuit so that it looks like the following figure.
R1
2K
N1
R2
3K
V1
1
To clean up the circuit, click on the Selection Arrow cursor in the Toolbar in the upper left corner of the circuit window. With the selection arrow, you can move devices, vertices, and segments. Simply position the selection arrow so that its tip is on top of any device, line segment, or vertex, then depress the mouse button, and drag the item with the mouse button still down. Release the mouse button when the item is where you want it to be. All wires are rubber banded when you move objects around. If you want to delete an object, select it with the selection arrow, and then choose Delete from the Edit menu.
Next, you will set the second resistor's value. Right mouse button click on the rightmost resistor, and choose Edit Simulation Model, then set its resistance to 3K. Finally, double click on the Marker and name it N1 if it is not already named so. An important thing to note is that the node that the Marker is attached to will take the name of the Marker, and if more than one Marker is named the same, both will have a "Virtual" connection, meaning that the nodes will behave as if a wire is connecting them.
R1
2K
N1
R2
3K
V1
1
Select OK.
This completes the circuit entry process. You are now ready to simulate the circuit.
Now, setup the Test by clicking on SETUP button. Next, continue with setting up the test by sliding along the DCSWEEP line and click on the arrow.
Enter Source is V1 from drop down menu; Property is DC and fill in the specifics in the next three lines. Start value = 0v, stop value =5v and increment is 0.1v. This set the source to run at 0v and check the circuit performance. Then increase the voltage to 0.1volts and run a check on circuit performance, then step up the voltage to 0.2v continuing in steps until the voltage is 5v. At each step, the circuit will run a simulation and provide the current and voltage values (I(am1) and V(n1) respectively) as you have requested. Make sure that Graph square is checked. Now, you are ready to simulate, click on the RUN>> button. RESULTS: The screen will change to show the results of the simulation. Note the top half [Log Window] indicates errors in circuit simulation if there is any. The spice messages are important in informing you if everything ran without a problem. You need to take note of these. The bottom half displays a graph of the current i(am1) vs source voltage v1.dc and node voltage v(n1) vs source voltage v1.dc. You can select a plot to highlight any one; Y axis label will change as accordingly. In following graph, current plot (yellow) is highlighted. 8
Note: You can choose plot display option by going to EDIT PLOTS option at left most of screen when your graph tab is selected (Blue). In following figure, only v(n1) is selected.