Document Sample
220_PSPICE_DC_nested_sweep Powered By Docstoc
					                 ECE 220: PSpice DC Sweep with a Nested Parameter Sweep
Before you start you should have the schematic below using the parts indicated in the table below

          Vcc                                 Vcc

           V2                                     R1
DC = 5V                                           1k
AC =
TRAN =                                              Vo

          0                              Q1
                 DC =                         Q2N2222
                 AC =
                 TRAN =

Part                           Library                           Description
Vsrc                           Source                            Voltage source
R                              Analog                            Resistor
Q2N2222                        Bipolar                           Transistor

                                                       Creating a Variable
1) Double click on the 1K value of the resistor and change it to the equation {res*1K} (curly brackets are
   needed) – res is a variable.
2) Hit bindkey p and add the part param from the library special. This part is used to define variables
3) Click on <OK> to close the window and place the part

          Vcc                                 Vcc             PARAMETERS:

           V2                                     R1
DC = 5V                                           {res*1K}
AC =
TRAN =                                              Vo

          0                              Q1
                 DC =                         Q2N2222
                 AC =
                 TRAN =
4) On the schematic double click on the word PARAMETERS. You will see the window below.
5) Click on New Column
6) If prompted answer yes

                                                                                             Close window

7) In the Add New Column window type the variable name and give it a default value (as shown below)
8) Click OK to close the Add New Column window

9) Close the Property Editor Window (top right)
Now you are ready to simulate
Placing Probes
To automatically plot results when a simulation is complete place voltage probes to plot voltages or
current probes for currents.
10) Place a voltage probe at the output of the amplifier as shown below and a current probe to plot the current
    Ic. Note current probes must be placed on the pins of devices (the very edge)

                                                             Current probe

                                                             Voltage probe

                        Running a DC sweep with a Nested Parametric sweep
11) To simulate from the top toolbar select Pspice->New Simulation Profile
12) Enter a name
13) Click on create to close the window
14)   In the Simulation Settings menu (shown below) select a DC sweep analysis type
15)   Specify that you wish to sweep a voltage source
16)   Specify the voltage source that you wish to sweep (V1)
17)   Specify the Start and stop voltages as well as the voltage increment
18)   Note: Spice understands m to be 10-3
19)   Select Parametric Sweep (you will see the window on the next page)
20)   Select Global Parameter
21)   Specify the parameter you wish to sweep (res)
22)   Specify the range for res (start: 1, stop: 4, Increment 2)
23)   Click on <OK> to close the window

24) To simulate click on the run Pspice icon at the top of the schematic

                                                     Run Pspice
25) The simulation will run
    Note if your simulation fails check for errors: from top toolbar: Window->Session Log
26) Click on <OK> to plot all three parametric sweeps
27) If your simulation runs successfully the voltages will be plotted as shown below (the current is so small in
    comparison to the voltage it will appear to be zero) (see below)
Deleting Traces

28) Click on the V(Vo) icon (the text) at the bottom left of the simulation window (as shown below)
29) click <delete> to delete it
30) Also delete the current trace

       V(Vo) ICON
Adding Traces and Plotting expressions
    We will add back the traces for V(Vo) to show another way of plotting traces
31) In the top toolbar of the Allegro Simulation Simulator window select: Trace->Add Trace

You will see the Add Traces pop-up menu shown below. On the left circuit voltages and currents are listed, on
the right available functions
32) Select V(Vo) (you could also form an expression)
33) Select <OK> to close the window and plot the expressions

Using Cursors
Cursors can be used to determine precise simulation values.
34) To activate the cursors click on the toggle cursor on icon at the top of the Simulation window

                      Toggle cursor on

There are two cursors A1 and A2. A1 is controlled with the left mouse and A2 with the right.
35) Affiliate cursor A1 with the left trace of V(Vo)by clicking on its trace icon with the LEFT mouse button (see
36) Affiliate cursor A2 with the left trace of V(Vo) by clicking on its trace icon with the RIGHT mouse button (see
37) Click on the actual V(Vo) trace with the RIGHT mouse button to define the position of the A2 cursor.
    Crosshairs will be shown. X and Y values for this trace at the position of the cross hairs are displayed in the
    small Probe Cursor window. The crosshairs can be moved by dragging the mouse with the right button.
             o The position of the A1 cursor is similarly controlled with the left mouse button
             o The difference between the A1 and A2 cursors is shown in the Probe Cursor menu as well.
             o Cursors A1 and A2 can be used for the same trace or different ones




Shared By: