Sunteți pe pagina 1din 10

Lab #1 PSpice Tutorial

by M.P. Morgensen, May 2011 revised by S. Johnson, May 2013

1.0 Introduction
The PSpice tutorial is provided so that you can perform simulations required in future labs. It can be completed at any time before the lab due date. The simulation tutorial should be first attempted before or during your scheduled lab time so that your TA can provide assistance. The document explains the information that must be included in your lab report. With this document, you will learn how to use a CAD tool capable of simulating the electrical behavior of circuits, knowledge that will be essential for future laboratories. An engineers ability to perform circuit simulation is indispensable in the analysis of real-life designs that contain numerous active devices (diodes, transistors, etc). The CAD software used in this class is Cadence PCB/OrCAD that makes use of the PSpice circuit simulator. The purpose of the following exercises is to become familiar with four types of simulations: bias point, DC, AC, and transient. Each type is useful for simulations performed later in the semester during analysis of more complex circuits. Bias point simulations involve non-time-varying voltage/current sources. Node voltages and terminal currents are computed for a fixed, steady-state DC current or voltage. A DC simulation is similar to a bias point simulation. However, variables such as source voltage levels, source current levels, resistor values, and capacitor values can be swept to plot the DC value of node voltages or terminal currents. An AC simulation analyzes the circuit characteristics in the frequency domain: quantities are plotted as a function of frequency. A transient simulation considers time-varying signals in the time domain: quantities are plotted as a function of time. For the simulation to give any useful information, the duration of the transient simulation must be carefully chosen depending on the input signals frequency/period.

The following steps provide guidance in the creation and simulation of a simple voltage-divider circuit that will demonstrate all four simulation types. Steps italicized and in red indicate what must be included in the Lab #1 report to verify that this tutorial was completed.

2.0 Initial steps and circuit creation 1. Start PSPICE by clicking [Start], [Programs], [Cadence], [Release 16.6], [Design Entry CIS]. Select Allegro PCB Design Entry CIS L and click OK through any prompts that appear. 2. In Design Entry CIS click [File], [New], [Project]. The New Project window should appear. Give the new project a name (an appropriate one would be named 302lab1) and activate the radio button next to Analog or Mixed A/D. At the bottom, choose an appropriate location where all project files will be stored. 3. Another window should appear after pressing OK in the new project window. Enable the radio button next to Create a blank project and press OK.

4. Next, a schematic window appears where circuits are constructed before simulation. To place an electrical component either select [Place], [Part] from the menu, type (P), or press the icon. Afterwards, the Place Part window should appear on the right. If there arent any libraries visible, press the Add Library button (to the left of the red X). The path to the libraries is: Cadence/SPB_16.6/tools/capture/library/pspice/ Once in the libraries folder, all libraries can be imported by pressing (CTRL + A). The only three libraries needed to complete Lab #1 are analog, special, and source (select multiple files by holding down the CTRL key). Future labs will require diodes and MOSFETs, which are located in the eval and breakout libraries, respectively.

5. Create the following circuit with elements from the Place Part window (double-click to bring the part to the schematic and press Esc when you are finished adding a part ). Double-click on the part to enter the values shown in the circuit. If desired, all of the parts in every library can be viewed by highlighting all of the libraries (press (CTRL+A) in the libraries window). To find a part quickly, you can type the first letter when in the Part List window. a. Resistors (parts name: R) are from the ANALOG library. Note: for R2, include the curly brackets when typing in its value {Rvar}, as shown in the circuit. b. The PARAMETERS: element (parts name: PARAM) is from the SPECIAL library. c. Voltage source (parts name: VDC) is from the SOURCE library. d. Add a ground by [Place], [Ground] or use the icon. Select 0/CAPSYM. e. Rotate parts by highlighting the part and pressing R (or by right-clicking and selecting Rotate). f. Components are wired together by pressing W or by [Place], [Wire]. g. Label the output node out put by pressing N or [Place], [Net Alias] and then clicking on the wire between R1 and R2. 6. The curly brackets entered for the value of R2 indicate its value, {Rvar}, is a variable named Rvar, which must be declared inside the PARAMETERS part. a. In the schematic, highlight and right-click on PARAM and select [Edit Properties] (alternatively, double-click on PARAM). b. This opens up a new tab labeled Schematic. Within this window, select New Property. c. Enter the name as Rvar with default value of 2k and press [OK].

d. Close the [Edit Properties] Schematic tab created in step 6a.

3.0 Bias point simulation 1. To setup the simulation of the drawn circuit, navigate to [PSpice], [New Simulation Profile]. Name the simulation 302lab1 and press [Create].

2. The Simulation Settings window should now appear. Set the analysis type to a Bias Point simulation. Press [OK].

3. Save the project and navigate to [PSpice], [Run] or press the icon. The PSpice simulator will launch in a separate window. A new window will appear; ensure there are no errors.

4. Return to the schematic and enable the display of node voltages and terminal currents by navigating to [PSpice], [Bias Points] or press the annotated with DC quantities. Include this result in your lab report. (print screen, paste to Paint, crop, etc.) and icons. Your schematic should now be

4.0 DC Sweep 1. You will now re-simulate the previous circuit. Navigate to [PSpice], [Edit Simulation Profile]. Change the analysis type to DC Sweep with the options given below and press [OK].

a. Useful information for future labs: i. The only way a resistor can be swept is by setting its value to a global parameter in the PARAMETERS: part. ii. If one wished to sweep a DC voltage or current source then the PARAMETERS: part is not needed. Simply change the Sweep Variable radio button to Voltage source with the name of the source to sweep.

2. Run the simulation. The PSpice simulator will launch in a separate window but when finished will contain a blank graph.

3. Plot the voltage at the output node by going to [Trace], [Add Trace]. The left side is filled with voltages and currents corresponding to nodes/terminals. Click once on V(output) which is the voltage at the node labeled earlier as output. Include this plot in your lab report. To copy the graph, choose [Window], [Copy to Clipboard]. 4. NOTE: a cursor can be added to the plot by navigating to [Trace], [Cursor], [Display] or by pressing the icon. Two cursors are available: left click and hold; right click and hold. The values at the location of the cursors will be given in a table at the bottom right.

5.0 AC Sweep 1. The previous circuit will be modified and subjected to an AC source. Add a capacitor (parts name: C) and AC voltage source (parts name: VAC) to the schematic. Label the input node.

2. Edit the simulation profile. Change the analysis type to AC Sweep and enter the options given below. Check the Parametric Sweep option.

3. The AC Sweep is enhanced by the addition of a Parametric Sweep. The primary sweep defined in the General Settings is run once for every value of the variable defined in the Parametric Sweep. Set the options given below that will sweep the frequency for three different values of Rvar.

Here, a Value list was chosen although in many cases a Linear sweep is more useful. Press [OK]. 4. Run the simulation. The simulation window will open and give a prompt indicating three curves are available. Press [OK].

5. Plot the voltage gain in decibels by adding a Trace. Here, the gain is defined as the absolute value of the output voltage divided by the input voltage. This can be achieved by selecting the mathematical functions in the right hand column under Functions or Macros as well as the voltages in the left hand column under Simulation Output Variables. For the circuit under consideration the maximum value of gain is 0dB, which corresponds to a unity gain. Include this plot in your lab report. Label each curve with its corresponding Rvar value. 9

6.0 Transient analysis 1. Modify the previous circuit by deleting the AC source and replace it with a sinusoidal voltage source (parts name: VSIN). Note: Leave the AC= option blank in VSIN source (or AC=<AC>).

2. Edit the simulation profile. Change the analysis type. a. The Run to time option must be carefully chosen with regards to the FREQ setting of the sinusoidal source. Here, 40s was chosen so that multiple periods could be observed. b. The Start saving data after option was set to 10s to stabilize the output. c. Maximum step size to 0.1s avoids jagged features on any plots generated. d. The parametric sweep settings should be the same as for the previous AC analysis. 3. Simulate the circuit and plot the voltage at the node labeled output. Include this plot in your lab report. Label each curve with its corresponding Rvar value.

10

S-ar putea să vă placă și