Download the manual in PDF now -

Objective:

            By the end of this lecture, students will be able to perform a DC Sweep and Transient analysis using PSpice.  Time permitting, students will also learn how to create a SPICE file to perform the analysis.

Sec. 2.1 Preparing the schematic

  1. Follow a procedure similar to lecture 1 to create a new project.
  2. Draw the circuit as shown in fig. 2-1. (All the steps are similar to those illustrated in lecture 1)

Fig. 2-1 – Circuit used for DC Sweep

Sec. 2.2 How to setup DC Sweep analysis

  1. Click on PSpice/New Simulation Profile
    1. Type in DC Sweep for the Name field
    2. Select none in the Inherit From field
  2. In the Simulation Setting dialog box select the following (refer to fig. 2-2)
    1. In the Analysis Type field, select DC Sweep
    2. In the Name field, type in v1 or the name of the source that is to be sweep
    3. Select Voltage Source since we are sweeping the voltage source
    4. Select linear for the Sweep type
    5. Type in 0V for the Start Value, 10V for the End Value, and 0.1V for the Increment
  3. Click OK

Fig. 2-2 – Simulation Setting dialog box

Sec. 2.3 Working in the Probe window (Proving resistors are linear element)

            We will determine if R2 is a linear element.  From our study of basic circuits, we are told that voltage varies linearly with current.  The equation to predict the voltage through the resistor is V=RI.  Using the Probe facility, we will show this graphically by plotting the i-v curve of R2.

  1. Run the simulation by clicking PSpice/Run.
  2. In the Probe window, click on Trace/Add Trace to access the Add Trace window (refer to fig. 2-3).

Fig. 2-3 – Add Traces dialog box.
  1. In the Trace Expression field, type in –I(R2).
  2. Click OK
  3. Alternately, we can also add the trace in the Capture window.
    1. In the Capture window, click on PSpice/Markers/Current Marker.
    2. In the schematic, place the marker on the pin of R2 (refer to fig. 2-4).
    3. Go to the Probe window and a trace should automatically appear

Fig. 2-4 – How to place the current marker
  1. Your graph should look like fig. 2-5.

Fig. 2-5 – The plot to showing DC Sweep

Sec. 2.4 Determining the maximum power transfer

To generate a graph of power versus R2, we will be sweeping R2 through a range of values.  To do this we will be setting up a global parametric sweep.

  1. Go to the schematic and change the value of R2 from 9k to {rval} (refer to fig. 2-6).

Fig. 2-6 – Modified schematic for parametric sweep
  1. Click on Place/Part to access the Get New Part dialog box
  2. In the Get New Part dialog box, do the following
    1. In the Libraries area, select SPECIAL
    2. In the Part area, type in PARAM or scroll down until you see PARAM
    3. Click OK
  3. Double click the PARAM part to display the Parts Spreadsheet.
  4. Click New to access the Add New Property dialog box (refer to fig. 2-7).

Fig. 2-7 – Add New Property dialog box
  1. Type in Rval
  2. Click OK
  3. This will create a new property for the PARAM part (refer to fig. 2-8).

Fig. 2-8 – Parts spreadsheet
  1. In the cell below the Rval column, type in 1k
  2. With the cell still selected, click on Display to access the Display Properties dialog box.
  3. In the Display Format dialog box, select Name and Value (refer to fig. 2-9).

Fig. 2-9 – Display Properties dialog box
  1. Click OK
  2. Click Apply
  3. Close Parts window.
  4. Click on PSpice/New Simulation Profile, to access New Simulation Profile dialog box.
    1. In the Name field, type in Parametric
    2. In the Inherit From field, select None
    3. Click CREATE
  5. In the Simulation Settings dialog box, do the following (refer to Fig. 2-10).

    Fig. 2-10 – Simulation Settings for parametric sweep.
    1. In the Analysis Type field, select DC Sweep.
    2. In the Options filed, leave the default setting.
    3. In the Sweep Variable area, select Global Parameter.
    4. In the Parameter Name area, type in Rval
    5. Select Linear Type in the Sweep type area.
    6. Type in 100 for the Start Value, 9k for the End Value, and 10 for the increment
    7. Click OK
  6. Click on PSpice/Run
  7. In the Probe window, click on Trace/Add Traces
    1. In the Trace Expression field, type in -V(R2:2)* I(R2)
    2. Click OK
  8. Your graph should be similar to fig 2-11.

Fig. 2-11 – Maximum power transfer curve

Sec. 2.5 Using the cursor tool

  1. Click on Trace/Cursor/Display, this will active the cursor.  A crosshair should appear on the graph.
  2. Click and drag the crosshair until you reach the peak of the graph.
  3. Look at the Probe Cursor box to determine the values (refer to fig. 2-12).
    1. From the box, the value for the x-axis is 1k
    2. From the box, the value for the y-axis is 25mW

Fig. 2-12 – Probe cursor box

Sec. 2.6 Simple RC circuit

            The RC circuit shown in fig 2-13 is the first circuit most of us are exposed to when we are introduced to a first order system.  Using PSpice, we will see how the capacitor charges and discharges when the voltage source is a pulse wave.

Fig. 2-13 – Simple RC circuit
  1. Create a new project.
  2. Get and place the parts.
    1. The value for R1 is 1kW.
    2. The value for C1 is 1mF
    3. The pulse wave is call VPULSE and is located in the SOURCE library.
    4. To change the value of the pulse, double click on it to access the property datasheet.
    5. In the datasheet, enter the following values
      1. TD = 0  (Time Delay)
      2. TF = 0.01ms  (Fall Time)
      3. TR = 0.01ms  (Rise Time)
      4. PW = 5ms  (Pulse Width)
      5. PER = 10ms  (Period)
      6. V1 = 0V (Voltage Minimum)
      7. V2 = 5V (Voltage Maximum)
      8. Reference = Vs (Name of the Voltage Source)
        This setting will create a pulse with an amplitude of 5V and a frequency of 100 Hz.
  3. Create a new Simulation Profile
  4. Select Transient Analysis for the analysis type.
    1. Type in 30ms for the Run to Time
    2. Type in 1ms for the Maximum Step Size
      1. The step size tells PSpice to output the results at a 1ms interval
    3. Click OK
  5. Run the simulation
  6. In the Probe Window, add traces to show the pulse wave and the voltage drop across the capacitor.
    1. To show the pulse wave, add the trace expression V(Vs:+).
    2. To show the voltage drop across the capacitor, add the trace expression V(c1:2)

Sec 2.7 Interpreting the results for the RC circuit

            From the probe result, we can see that the capacitors charges during the positive cycle of the pulse and discharges during the zero portion of the pulse.  The capacitor doesn’t fully discharges because of the time constant is longer than the pulse period.

Fig. 2-14 – Transient response of a RC circuit

Sec. 2.8 Getting values to export to other applications

            PSpice does a very good job at plotting waveforms and helping us interpret results.  But with every application, there are limitation to what it can do.  Using the RC circuit as an example, let say there are some additional analysis that you wish to perform but PSpice does not have the capability to do it.  Then the best way to do this is to a combination of the .PRINT and output file options. 

  1. Using the same circuit of the RC circuit, fig.2.13, add a .PRINT parts to the circuit, refer to fig. 2-15.

    Fig. 2-15 – RC circuit with PRINT1 part
    1. The .PRINT part is located in the Special library and is call PRINT1
  2. Click on PSpice/Edit Simulation Settings.
  3. In the Simulation Settings dialog box, click on Output File Options.  The Transient Output File Options should appear, refer to fig. 2-16.
  4. In the Print values in the output file every field, type in 1ms.  This would tell PSpice to print the output every 1ms.
  5. Click OK.
  6. Click OK.
  7. Run the simualation.

Fig. 2-16 – Output file options dialog box

Sec. 2.8 Getting the results

            Once the simulation is run, you would still have the same graph as the first time the simulation was run.  To view the output, go to the Probe window and click on View/Output file.  Scroll down until you see the results.  To see the complete output file, refer to Appendix IV.  The result can now be imported to other application to perform additional analysis.




**** 03/06/00 00:15:01 ********* PSpice 9.0 (Nov 1998) ******** ID# 0 ********

** circuit file for profile: fig13 

****     CIRCUIT DESCRIPTION

******************************************************************************

** WARNING: DO NOT EDIT OR DELETE THIS FILE

*Libraries: 

* Local Libraries :

* From [PSPICE NETLIST] section of pspice.ini file:

.lib "nom.lib" 

*Analysis directives: 

.TRAN 1m 30m 0 1m 

.PROBE 

*Netlist File: 

.INC "fig12-SCHEMATIC1.net" 

*Alias File: 

**** INCLUDING fig12-SCHEMATIC1.net ****

* source FIG12

C_C1         0 N00034  5u  

R_R1         N00027 N00034  1k

V_Vs         N00027 0

+PULSE 0 5 0 0.01m 0.01m 5m 10m

.PRINT         TRAN V([N00034])

**** RESUMING fig12-schematic1-fig13.sim.cir ****

.INC "fig12-SCHEMATIC1.als"

**** INCLUDING fig12-SCHEMATIC1.als ****

.ALIASES

C_C1            C1(1=0 2=N00034 )

R_R1            R1(1=N00027 2=N00034 )

V_Vs            Vs(+=N00027 -=0 )

.ENDALIASES

**** RESUMING fig12-schematic1-fig13.sim.cir ****

.END

**** 03/06/00 00:15:01 ********* PSpice 9.0 (Nov 1998) ******** ID# 0 ********

** circuit file for profile: fig13 

****     INITIAL TRANSIENT SOLUTION       TEMPERATURE =   27.000 DEG C

******************************************************************************

NODE      VOLTAGE     NODE      VOLTAGE

(N00027)  0.0000    (N00034)    0.0000 

VOLTAGE SOURCE CURRENTS

NAME         CURRENT

V_Vs         0.000E+00

TOTAL POWER DISSIPATION   0.00E+00  WATTS

**** 03/06/00 00:15:01 ********* PSpice 9.0 (Nov 1998) ******** ID# 0 ********

** circuit file for profile: fig13 

****     TRANSIENT ANALYSIS               TEMPERATURE =   27.000 DEG C

******************************************************************************



TIME        V(N00034)

0.000E+00   0.000E+00

1.000E-03   8.961E-01

2.000E-03   1.636E+00

3.000E-03   2.247E+00

4.000E-03   2.748E+00

5.000E-03   3.163E+00

6.000E-03   2.607E+00

7.000E-03   2.138E+00

8.000E-03   1.750E+00

9.000E-03   1.432E+00

1.000E-02   1.166E+00

1.100E-02   1.851E+00

1.200E-02   2.417E+00

1.300E-02   2.887E+00

1.400E-02   3.271E+00

1.500E-02   3.591E+00

1.600E-02   2.958E+00

1.700E-02   2.426E+00

1.800E-02   1.985E+00

1.900E-02   1.624E+00

2.000E-02   1.323E+00

2.100E-02   1.980E+00

2.200E-02   2.523E+00

2.300E-02   2.973E+00

2.400E-02   3.342E+00

2.500E-02   3.649E+00

2.600E-02   3.005E+00

2.700E-02   2.465E+00

2.800E-02   2.017E+00

2.900E-02   1.650E+00

3.000E-02   1.345E+00

JOB CONCLUDED

TOTAL JOB TIME             .07