how to use pspicebolson/courses/howtopspice/ece_220... · web viewrun pspice icon icon toggle...

9
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 Creating a Variable 1) Double click on the 2.5K 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 Q1 Q 2N 2222 R1 {res *1K } V1 A C = TR A N = D C = V2 A C = TR A N = D C = 5V Vin 0 Vcc 0 Vcc 0 Vo PARAM ETERS:

Upload: others

Post on 20-Jan-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

How to use PSPICE

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

Creating a Variable

1) Double click on the 2.5K 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 to close the window and place the part

Q1

Q2N2222

R1

{res*1K}

V1

AC =

TRAN =

DC =

V2

AC =

TRAN =

DC = 5V

Vin

0

Vcc

0

Vcc

0

Vo

PARAMETERS:

Q1

Q2N2222

R1

{res*1K}

V1

AC =

TRAN =

DC =

V2

AC =

TRAN =

DC = 5V

Vin

0

Vcc

0

Vcc

0

Vo

PARAMETERS:

4) On the schematic double click on the word PARAMETERS. You will see the window below.

5) Click on New Column (or New Row or New Property) - It is different for different versions6) If prompted answer yes7) 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 collector current. Note current probes must be placed on the pins of devices (the very edge – look for the red/blue transition)

Running a DC sweep with a Nested Parametric sweep

11) To simulate from the top toolbar select Pspice->New Simulation Profile12) Enter a name

13) Click on create to close the window

14) In the Simulation Settings menu (shown below) tab to analysis (it should be the default)

15) select DC sweep analysis16) Specify that you wish to sweep a voltage source

17) Specify the voltage source that you wish to sweep (V1) – this one is connected to the input of the amplifier18) Specify the Start and stop voltages as well as the voltage increment

19) Note: Spice understands m to be 10-3

20) Select Parametric Sweep (you will see the window on the next page)21) Select Global Parameter22) Specify the parameter you wish to sweep (res)

23) Specify the range for res (start: 1, stop: 5, Increment 2)24) Click on to close the window

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

The simulation will run

Note if your simulation fails check for errors: from top toolbar: Window->Session Log26) Click on to plot all three parametric sweeps27) 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)

(the background has been changed to white: Tools->Options->Color Settings)

Deleting Traces

28) Click on the V(Vo) icon (the text) at the bottom left of the simulation window (as shown below)

29) click to delete it

30) Also delete the current trace

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 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

35) At the bottom of the window you may have to resize the cursor window to display data

There are two cursors Y1 and Y2. Y1 is controlled with the left mouse and Y2 with the right.

36) Affiliate cursor Y1 with the left trace of V(Vo)by clicking on its trace icon (small shape – blue square) with the LEFT mouse button (see below)

37) Affiliate cursor A2 with the left trace of V(Vo) by clicking on its trace icon (small shape – blue square) with the RIGHT mouse button (see below)

38) Click on the actual V(Vo) trace with the RIGHT mouse button to define the position of the Y2 cursor. Crosshairs will be shown. X and Y values for this trace at the position of the cross hairs are displayed in the small Cursor window previously uncovered. The crosshairs can be moved by dragging the mouse with the right button.

Note:

· The position of the Y1 cursor is similarly controlled with the left mouse button

· The difference between the Y1 and Y2 cursors is shown in the Probe Cursor menu as well.

· Cursors Y1 and Y2 can be used for the same trace or different ones

· Cursors Y1 and Y2 can be repositioned by dragging the mouse while depressing the left or right mouse buttons respectively

Close window

Voltage probe

Current probe

Run Pspice icon

icon

Toggle cursor on

Icon – small shape

Slide to resize window and display cursor data

ICON

crosshair