How to use PSPICE - CPP



PSpice Transient Simulation & Plotting Your Results

Transient simulation with a Sinusoid

Start with the schematic shown below

Markers can be used to automatically plot simulation results after a simulation has run

Place Markers using the place marker icon (top toolbar) at Vin and Vo (as shown below).

[pic]

Simulating

Create a new simulation profile: Top toolbar: PSpice->New simulation Profile

Enter a Name in the New Simulation Pop-up menu

Click on to close the window

In the Simulation Settings Window (shown)

Select Time Domain/Transient Analysis

Set the simulation run time (2m)

Set the minimum step size

Click to close the window and apply settings

To run the simulation: select the run simulation icon (top toolbar)

[pic]

Your Results will be Plotted in the Resulting Simulation Window

(Vo is hard to see because it is so small)

Adding a New Plot Window

From the Top toolbar of the SCHEMATIC-sim window select: Plot→Add Plot to Window

Select the V(Vo) icon at the bottom of the window

Hit ^x to copy

Click on the top plot

Hit ^v to paste

[pic]

Adding Additional Traces

After running a simulation you can display additional traces or functions performed on traces. We will plot (Vo-Vn) (the voltage across the capacitor)

Adding Traces

From the Top toolbar of the SCHEMATIC-sim window select: Trace→Add Trace

Enter the Expression V(Vo)-V(Vn) as shown below

Click on to close the window

[pic]

Using Cursors

It is possible to determine precise current and voltage values after running a simulation using interactive cursors. There are two cursors: Y1 and Y2. Y1 is controlled with the left mouse button and Y2 with the right

Add cursors: Top toolbar select: Trace→Cursor→Display

Controlling Y1 (left mouse) cursor

Click on the little square of the V(Vo) trace icon with your left mouse (for this example V(Vo)). This will affiliate the Y1 (left mouse cursor) with the trace V(Vo).

[pic]

Click on the actual V(Vo) trace with your left mouse. You will see a crosshair at the location (see below)

Keeping your left mouse button depressed drag the crosshair to a different location

At the bottom of the screen (X,Y) information for the Y1 cursor is displayed. Also find information for Y2 and Y1 minus Y2. (see below)

[pic]

|The Y2 (right mouse) cursor data can be displayed by repeating steps (16)-(18) that were used for the Y1 cursor (left mouse) substituting the right |

|mouse |

Transient Simulation with a Digital Pulse

Return to your schematic window

Change the capacitor value to 1uF

Select the Vsin part and delete it using the key

There are two parts that can commonly be used for digital simulation: Vpwl and Vpulse (also Ipwl and Ipulse for currents). Here we will use Vpwl.

|PWL (PieceWise Linear) format |

| |

|PWL describes a waveform that is linear in pieces (piecewise linear). It consists of successive pairs of points (Ti, Vi) as shown below. |

| |

| |

| |

| |

| |

Add and edit a Vpwl part:

Add a Vpwl part from the Library source (Bindkey p) to replace the Vsin part that was just deleted

Double Click on the Vpwl part

In the resulting window scroll to the right to expose part properties T1, T2,… and V1, V2 (see below)

[pic]

Enter the following part properties.

| |Ti |Vi |

|(T1, V1) |0 |0 |

|(T2, V2) |.5m |0 |

|(T3, V3) |.501m |1 |

|(T4, V4) |1m |1 |

|(T5, V5) |1.001m |0 |

Click on

Click on the close window x (top right) to close the window

Plotting Currents

On your schematic add a current marker plotting the current through the resistor

Select the Add Current marker icon

Place the marker on the pin of the resistor (the very edge of the part)

[pic]

Rerun the simulation (top toolbar run simulation icon) (See step (6) of this tutorial)

Working with Equations and Parameter Sweep

One can declare variables and create equations based on these variables. We will run three simulations using three different capacitor values.

Declaring a variable

Declaring a variable:

Place the part Param from the Library Special on the schematic

Double click on the PARAMETER part

Select New Column (or New Row)

In the Add New Column window enter a name for your variable (here we are using val)

In the Add New Column window enter a default value for your parameter (here we are using 1)

In the Add New Column click to apply

In the Add New Column click on the X (top right corner) to close the window

Click again in the first window

Click on the X (top right corner) to close the window

[pic]

Creating an Equation

Curley brackets are used to denote equations. Edit the Capacitor value to be: {val*1u}.

Performing a Parametric Nested Sweep

Performing a Parametric Nested Sweep

In the schematic window edit the simulation profile: Top toolbar→PSpice→Edit Simulation Profile

Additionally select: Parametric Sweep

Select: Global parameter

Indicate the parameter to be swept: val

And the range for val

Click on to close the window

[pic]

Rerun the simulation (top toolbar run simulation icon) (See step (6) of this tutorial)

In the resulting window select to plot all results

-----------------------

Click here and hit ^v to paste

Select, hit ^x to cut

marker

Place Voltage Marker icon

(also find place current and differential voltage marker icons)

Run simulation icon

Sets initial condition on capacitor

Add Current marker

(T1, V1) (T2, V2) (T5, V5)

(T3, V3) (T4, V4)

Data for Y1 and Y2 cursors

Crosshair for Y1 cursor

Little square

Functions that can be perfomed

Voltages and currents that can be plotted

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download