ENEE207 Electric Circuits Lab Manual

Similar documents
Engineering 3821 Fall Pspice TUTORIAL 1. Prepared by: J. Tobin (Class of 2005) B. Jeyasurya E. Gill

EXPERIMENT NUMBER 10 TRANSIENT ANALYSIS USING PSPICE

ECE 201 LAB 6 INTRODUCTION TO SPICE/PSPICE

Introduction to PSpice

EE 210 Lab Exercise #3 Introduction to PSPICE

Since transmission lines can be modeled using PSpice, you can do your analysis by downloading the student version of this excellent program.

14:332:223 Principles of Electrical Engineering I Instructions for using PSPICE Tools Sharanya Chandrasekar February 1, 2006

EE 2274 RC and Op Amp Circuit Completed Prior to Coming to Lab. Prelab Part I: RC Circuit

Background Theory and Simulation Practice

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

A Brief Handout for Introduction to

ELEG 205 Analog Circuits Laboratory Manual Fall 2016

EK307 Active Filters and Steady State Frequency Response

Department of Electrical & Computer Engineering Technology. EET 3086C Circuit Analysis Laboratory Experiments. Masood Ejaz

ECE4902 Lab 5 Simulation. Simulation. Export data for use in other software tools (e.g. MATLAB or excel) to compare measured data with simulation

Lab Reference Manual. ECEN 326 Electronic Circuits. Texas A&M University Department of Electrical and Computer Engineering

An Introductory Guide to Circuit Simulation using NI Multisim 12

ENGR-4300 Fall 2006 Project 3 Project 3 Build a 555-Timer

LABORATORY 3: Transient circuits, RC, RL step responses, 2 nd Order Circuits

LABORATORY 2: Bridge circuits, Superposition, Thevenin Circuits, and Amplifier Circuits

FACULTY OF ENGINEERING LAB SHEET

LABORATORY 4. Palomar College ENGR210 Spring 2017 ASSIGNED: 3/21/17

ECE3204 D2015 Lab 1. See suggested breadboard configuration on following page!

ECE ECE285. Electric Circuit Analysis I. Spring Nathalia Peixoto. Rev.2.0: Rev Electric Circuits I

Introduction to NI Multisim & Ultiboard Software version 14.1

ELEG 205 Analog Circuits Laboratory Manual Fall 2017

Introduction to SPICE. Simulator of Electronic devices

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

Lab 6: Building a Function Generator

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

Chapter 12: Electronic Circuit Simulation and Layout Software

PSPICE T UTORIAL P ART I: INTRODUCTION AND DC ANALYSIS. for the Orcad PSpice Release 9.2 Lite Edition

Problem 1: Voltage Limiting 1.1. Simulate the following simple resistor-diode circuit (shown on the left in Figure 1):

Simulating Circuits James Lamberti 5/4/2014

Lab 4: Analysis of the Stereo Amplifier

1. Hand Calculations (in a manner suitable for submission) For the circuit in Fig. 1 with f = 7.2 khz and a source vin () t 1.

Fig. 1-1 show the main window of Orcad Capture. Every project you work on will start from Orcad Capture. Fig. 1-1 Orcad Capture Main window.

ECE 2274 Pre-Lab for Experiment # 4 Diode Basics and a Rectifier Completed Prior to Coming to Lab

Lab 3: RC Circuits. Construct circuit 2 in EveryCircuit. Set values for the capacitor and resistor to match those in figure 2 and set the frequency to

Cir cuit s 212 Lab. Lab #7 Filter Design. Introductions:

EE320L Electronics I. Laboratory. Laboratory Exercise #2. Basic Op-Amp Circuits. Angsuman Roy. Department of Electrical and Computer Engineering

Introduction to OrCAD. Simulation Program With Integrated Circuits Emphasis.

LTSpice Basic Tutorial

EE 210 Lab Exercise #5: OP-AMPS I

Class #8: Experiment Diodes Part I

ECE 2274 Diode Basics and a Rectifier Completed Prior to Coming to Lab

EXPERIMENT 9 Problem Solving: First-order Transient Circuits

ECE 220 Laboratory 3 Thevenin Equivalent Circuits, Constant Current Source, and Inverting Amplifier

Combinational logic: Breadboard adders

Real Analog - Circuits 1 Chapter 11: Lab Projects

EE 2274 DIODE OR GATE & CLIPPING CIRCUIT

PSPICE SIMULATIONS WITH THE RESONANT INVERTER POWER ELECTRONICS COLORADO STATE UNIVERSITY. Created by Colorado State University student

Project 3 Build a 555-Timer

Revised: Summer 2010

Electronics I LAB. Lab 1: Lab 1 : Introduction to PsPise

SAMPLE: EXPERIMENT 2 Series RLC Circuit / Bode Plot

Introduction to LT Spice IV with Examples

LT Spice Getting Started Very Quickly. First Get the Latest Software!

EECS 312: Digital Integrated Circuits Lab Project 1 Introduction to Schematic Capture and Analog Circuit Simulation

FACULTY OF ENGINEERING LAB SHEET

Dev Bhoomi Institute Of Technology Department of Electronics and Communication Engineering PRACTICAL INSTRUCTION SHEET REV. NO. : REV.

University of Michigan EECS 311: Electronic Circuits Fall 2008 LAB 2 ACTIVE FILTERS

Lab #2 First Order RC Circuits Week of 27 January 2015

Lab 3: Very Brief Introduction to Micro-Cap SPICE

Laboratory #2 PSpice Analyses

OrCAD PSpice - Tutorial. TA: 黃玉龍

ECEN Network Analysis Section 3. Laboratory Manual

Lab 7 PSpice: Time Domain Analysis

EE2210 Laboratory Project 1 Fall 2013 Function Generator and Oscilloscope

Laboratory 4: Amplification, Impedance, and Frequency Response

EXPERIMENT NUMBER 8 Introduction to Active Filters

Welcome to your second Electronics Laboratory Session. In this session you will learn about how to use resistors, capacitors and inductors to make

RC Filters and Basic Timer Functionality

Time-Varying Signals

Department of Electrical Engineering ELEG 2101L Lab Manual

ECE 2201 PRELAB 6 BJT COMMON EMITTER (CE) AMPLIFIER

STATION NUMBER: LAB SECTION: Filters. LAB 6: Filters ELECTRICAL ENGINEERING 43/100 INTRODUCTION TO MICROELECTRONIC CIRCUITS

The analysis of the linear voltage regulators

LAB EXERCISE 3 FET Amplifier Design and Linear Analysis

LAB I. INTRODUCTION TO LAB EQUIPMENT

Digital Applications of the Operational Amplifier

ECE 3155 Experiment I AC Circuits and Bode Plots Rev. lpt jan 2013

Week 1: Preparing for PSpice Simulations

EK307 Passive Filters and Steady State Frequency Response

EE320L Electronics I. Laboratory. Laboratory Exercise #3. Operational Amplifier Application Circuits. Angsuman Roy

EE 105 MICROELECTRONIC DEVICES & CIRCUITS FALL 2018 C. Nguyen. Laboratory 2: Characterization of the 741 Op Amp Preliminary Exercises

Lab 2: Diode Characteristics and Diode Circuits

Mechatronics. Analog and Digital Electronics: Studio Exercises 1 & 2

MEMORIAL UNIVERSITY OF NEWFOUNDLAND. Faculty of Engineering and Applied Science. Laboratory Manual for. Eng Circuit Analysis (2011)

Experiment Guide: RC/RLC Filters and LabVIEW

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

Integrators, differentiators, and simple filters

Experiment #6: Biasing an NPN BJT Introduction to CE, CC, and CB Amplifiers

EE 233 Circuit Theory Lab 3: First-Order Filters

Lab 6: MOSFET AMPLIFIER

Class #9: Experiment Diodes Part II: LEDs

Experiment 1 Signals, Instrumentation, Basic Circuits and Capture/PSpice

Experiment Number 2. Revised: Fall 2018 PLECS RC, RL, and RLC Simulations

Using LTSPICE to Analyze Circuits

EE-3010 Lab # 5 Simulation of Operational Amplifier Circuits

Transcription:

ENEE207 Electric Circuits Lab Manual Department of Engineering, Physical & Computer Sciences Montgomery College Version 3 Copyright Lan Xiang (Do not distribute without permission) 1

TABLE OF CONTENTS LAB EXPERIMENT #1: INTRODUCTION TO PSPICE SIMULATION... 3 LAB EXPERIMENT #2: A SIMPLE AC CIRCUIT... 4 LAB EXPERIMENT #3: CLOCK PULSE GENERATOR... 5 LAB EXPERIMENT #4: OP-AMP CIRCUITS... 6 LAB EXPERIMENT #5: THEVENIN AND NORTON EQUIVALENT CIRCUITS... 8 LAB EXPERIMENT #6: COMPLEX CIRCUIT NODAL ANALYSIS... 9 LAB EXPERIMENT #7: TRANSFER FUNCTIONS... 10 LAB EXPERIMENT #8: PASSIVE FILTER DESIGN... 11 LAB EXPERIMENT #9: ACTIVE FILTER DESIGN... 12 LAB EXPERIMENT #10: TRANSIENT CIRCUITS... 13 Appendix 1: Creating Circuits using PSPICE with OrCAD... 14 Appendix 2: Build the Circuit on the Breadboard... 25 Appendix 3: AC Circuits and Transient Analysis... 27 Appendix 4: Clock Pulse Generator... 33 Appendix 5: DC Sweep in PSpice... 36 Appendix 6: AC Sweep in PSpice... 39 Electric Circuits Lab Checkoff Sheets... 46 2

LAB EXPERIMENT #1: INTRODUCTION TO PSPICE SIMULATION Objective: To introduce the student to the PSPICE simulation program, and use it to create a simple DC circuit, perform simple bias point analysis. Students get to know how to build the circuits on the breadboard and do basic measurements. Pre-Lab Preparation: 1. Perform a manual solution of the two-loop DC circuit shown below, and obtain all the node voltages (V1, V2, and V3) and the branch currents. 12Vdc V1 V1 R1 2.7k V2 R3 2k R2 3k V3 R4 10k 0 Figure 1: A simple DC circuit Experiments: 1. Follow Appendix 1: Creating Circuits using PSPICE with OrCAD to create a schematic design of a simple DC circuit. Obtain the following printouts: A printout of your circuit with nodes labeled. A printout of the edited title blocks showing your information. 2. Follow Appendix 1 to perform the Bias Point Analysis of the DC circuit. Print out the simulation results showing node voltages and branch currents. Summarize all the results in a table. Also, obtain a printout of the output file of the simulation. 3. Build the DC circuit (see Appendix 2: Build the Circuit on the Breadboard) on your breadboard. Using DMM, measure three node voltages V1, V2, and V3, and three branch currents IR1, IR2, IR3. Post-lab analysis: 1. Generate a lab report following the "General Lab Report Guideline". Mention any difficulties experienced and any unexpected results obtained during the lab. 2. Calculate percentage error between your manual calculation and simulation results and between your manual calculation and actual measurements (Table format is recommended). Comment on your results and each % error. 3. Based on your measurement results from DMM, calculate power of each component. Verify that the power provided is equal to total power absorbed. 3

LAB EXPERIMENT #2: A SIMPLE AC CIRCUIT Objective: To introduce the students to the basic AC circuit analysis using PSPICE simulation. Students get to know how to use digital oscilloscope to measure the performance of a simple AC circuit. Pre-Lab Preparation: 1. Perform a manual solution of the RC circuit shown in Figure 1 of Appendix 3: AC Circuits and Transient Analysis, and obtain the peak magnitudes and the phase angles of the Vout and the current I. Experiments: 1. Follow the Appendix 1 to create a simple RC circuit and perform the Transient Analysis of the circuit. Obtain the following printouts: A printout of the AC circuit The PSpice simulation results showing voltages and currents 2. Based on the simulation results, find The peak amplitude of Vout indicated in Figure 1 of Appendix 3 The time difference Δt and phase difference ΔΦ between Vin and Vout. What is the phase of Vout assuming the phase of Vin is 0 o? Does Vout lead or lag the input voltage Vin? The peak amplitude of the current I The time difference Δt and phase difference ΔΦ between Vin and I. What is the phase of the current I assuming the phase of Vin is 0 o? Does the current I lead or lag the input voltage Vin? 3. Build a breadboard of the series AC circuit in the handout. Apply a sine wave of frequency 1.0 khz and amplitude 1.0 VPEAK to the circuit using the function generator. Using the Digital Oscilloscope, measure The peak amplitude and the phase of the voltage across the capacitor The peak current amplitude and current phase angle. (Hint: display and measure the voltage across the resisitor. The voltage across the resistor has the same phase as the current.) Post-lab analysis: Generate a lab report following the General Lab Report Guideline. Comment on any problems encountered or unexpected results obtained above. Compare all the circuit measurements with your manual calculations and simulation results, and indicate percent error for each (i.e., (Measured - Calculated) / Calculated x 100% = % error) in a table. Comment on % ERROR, indicating your analysis of the reasons for the deviations. Provide printouts of the required circuit performance results. 4

LAB EXPERIMENT #3: CLOCK PULSE GENERATOR Objective: To design, simulate, construct, and test a clock pulse generate circuit. Pre-Lab Preparation: 1. Read Appendix 4: Clock Pulse Generator and design a clock circuit with tl= µs and th = µs, using a 555 timer chip. Create circuit schematic. Experiments: 1. Use PSPICE to do a transient analysis simulation on the timer circuit to simulate the clock operation. You must display pins 2,3,7 of the 555 timer on the PROBE screen. Measure the tl and th in the simulation to verify that your design is correct. Obtain all the printouts including clearly annotated measurements. 2. Construct the 555-timer circuit, debug and test using digital oscilloscope to probe pins 2,3,7 to verify the operation and to compare with the simulation results. Measure the negative and positive pulse width of the output clock signal (pin 3). Obtain a printout of all three signals with clear annotations. Post-lab analysis: Generate a lab report following the General Lab Report Guideline. Table format is recommended to present all the data in each section. Compare all your simulation results and circuit measurements with your manual calculations using error % in the analysis. 1. Comment on the results of both simulation and the circuit performance measurements, and provide your analysis of the reasons for any deviations from anticipated results. 2. Include all printouts indicated above, and annotate each clearly. 3. Comment on the waveforms obtained on pin 2, 3, 7 of the 555 timer. 5

LAB EXPERIMENT #4: OP-AMP CIRCUITS Objective: To design, build and test a number of simple op-amp circuits which implement the basic operations. Pre-Lab Preparation: 1. Review Op-Amp circuits in Chapter 5 2. Read Appendix 5: DC Sweep in PSPICE 3. Design the following circuits and draw the circuit diagrams. Assume the design operating frequency (X) specified is X = KHz. 1) An inverting amplifier op-amp circuit with a gain = 2) A non-inverting amplifier op-amp circuit with a gain = 3) A differentiator circuit with a "gain" = 4) An integrator circuit with a "gain" = PSpice Simulations: For all the simulations, we use ua741 operational amplifier. The voltage supplies are +/- 12VDC. 1. Simulate circuit #1 using DC sweep. Drive the op-amp with a VSIN source with a 1V input and frequency (X), and sweep the input voltage from 0.5V to 6.0V in 0.5 volt increments (DC Sweep). Plot the gain (Vout/Vin) as a function of input voltage. Record the "gain" in table at those input voltage points. 2. Simulate circuit #2 using a VSIN source with a 1V input and frequency (X), and obtain a printout of the input and output waveforms. 3. Simulate circuit #3 using a VSIN source with a 1V input and frequency (X), and obtain a printout of the input and output waveforms. 4. Simulate circuit #4 using a VSIN source with a 1V input and frequency (X), and obtain a printout of the input and output waveforms. Experiments: 1. Build the inverting op-amp circuit (#1) and test as follows using a Sine Wave Generator: a) Set the input voltage to 1V and the frequency to (X) and obtain a printout of the input and the output. b) At frequency (X), vary the input voltage from 0.5V to 6V in 0.5V increments and record in table the gain (Vout/Vin). No printout is required. Compare the gain with your simulated values. 2. Build the non-inverting amplifier op-amp circuit (#2) and test as follows: a) Use a Sine Wave input signal with a 1V input and frequency (X), and obtain a printout of the input and output. b) Use a Square Wave input rather than a Sine Wave input, and test as in 2(a) above. 6

3. Build the differentiator op-amp circuit (#3) and test as follows: a) Use a Sine Wave input signal with a 1V amplitude and frequency (X), and obtain a printout of the input and output. b) Repeat 3(a) above using a Triangle Wave input signal rather than a Sine Wave signal. 4. Build the integrator op-amp circuit (#4) and test as follows: a) Use a Sine Wave input signal with a 1V amplitude and frequency (X), and obtain a printout of the input and output. b) Repeat 4(a) above using a Square Wave input signal rather than a Sine Wave signal. Post-lab analysis: 1. Generate a lab report following the General Lab Report Guideline. 2. Include all your PSPICE simulation results and circuit performance results. Verify and explain that your PSPICE simulation results and circuit performance results are consistent with your design. If not, explain why. 3. Find the percentage error calculations for the gain if applicable. 4. Comment on any problems encountered or unexpected results. 7

LAB EXPERIMENT #5: THEVENIN AND NORTON EQUIVALENT CIRCUITS Objective: To obtain the Thevenin and Norton equivalent circuits of the circuit provided, simulate those circuits and compare their performance to the original circuit, build the Thevenin equivalent circuit, and compare its performance to the original circuit performance. Pre-Lab Preparation: 1. Review Thevenin's and Norton's theorems. 2. For the circuit given in Figure 1, first remove the load resistor RL and find and draw the Thevenin s and Norton s equivalent circuits. Figure 1: The original circuit with load RL Component Values: R1 = Ω, R2 = Ω, R3 = Ω, R4 = Ω, R5 = Ω, VDC = V Experiments: 1. Simulate the original circuit and obtain the load voltages Vo and current Io for each of the load resistors RL = 1kΩ, 3kΩ, and 10kΩ. 2. Simulate the Thevenin equivalent circuit and the Norton equivalent circuit for each of the three load resistors specified, and obtain the load voltage and current for each case. 3. Build the original circuit and measure the load voltage and current for each load resistor using DMM. 4. Build the Thevenin equivalent circuit and measure the load voltages and current for each load resistor using DMM. Post-lab analysis: 1. Generate a lab report following the General Lab Report Guideline. 2. In your Analysis Section, a) Compare the simulation results of load voltages and currents among three circuits. b) Compare the measured load voltages and currents between the original circuit and the Thevenin equivalent circuit. 3. Use simulation to find the Thevenin s equivalent (VTh, RTh) and the Norton s equivalent (IN). Show simulation circuits and results. Compare your results with your manual calculations obtained in your prelab. 8

LAB EXPERIMENT #6: COMPLEX CIRCUIT NODAL ANALYSIS Objective: To perform complex AC steady state analysis using nodal analysis, then to simulate the circuit and obtain phasors of the node voltages and branch currents, followed by building the circuit and measuring the same node voltages and branch currents. The results obtained from the three methods are then to be compared using percent error methods and the results analyzed for inconsistencies. Pre-Lab Preparation 1. Read Appendix 6: AC Sweep in PSPICE (6.1 and 6.2). 2. Perform the nodal analysis on the circuit in Figure 1 and obtain the values for the nodal voltage V and the branch currents I1, I2, and I3 indicated in the circuit. given V1 = V. Figure 1: Nodal Analysis Circuit Experiments: 1. Simulate the operation of the circuit for the frequency specified using AC Sweep. Obtain the amplitude and phase of the nodal voltage and the branch currents indicated in the circuit. 2. Construct the circuit specified and verify that the branch currents are as predicted. Set up the digital oscilloscope to display the voltage and current equivalents in the specified branches. Obtain the printouts with measures of the voltage and current equivalents (both amplitude and phase) with clear annotations. Post-lab analysis: 1. Generate a lab report following the General Lab Report Guideline. 2. Include your manual computations (both amplitude and phase), your PSPICE simulation results and your digital oscilloscope measurements in a TABLE format. Compare three sets of data and comment on results. 9

LAB EXPERIMENT #7: TRANSFER FUNCTIONS Objective: To obtain the transfer function of a complex circuit, and study the frequency response of the circuit. Pre-Lab Preparation 1. Read Appendix 6: AC Sweep in PSPICE (6.3). 2. Derive the transfer function H(ω) = Vout/Vin for the following circuit. Sketch the magnitude and phase plot of the transfer function in terms of frequency. You can sketch it by hand or use Matlab. Figure 1: Frequency Response Circuit Component Values: R1 = Ω, R2 = Ω, C1 = F Experiments: 1. Apply a 1V VAC source to the input Vin. Perform a logarithmic AC Sweep for frequency between 1Hz and 10kHz with 100 points. Obtain the magnitude and phase plot of the transfer function Vout/Vin. Compare your plots with your pre-lab sketches. Record the magnitude of the gain at multiple frequencies on a logarithmic scale (10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000) in a table. 2. Construct the circuit specified and apply a sine wave input signal with 1V amplitude. Vary the input frequency from 10Hz to 10kHz. Observe the change in the output voltage. Record the magnitude of the gain at multiple frequencies on a logarithmic scale (10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000) in a table. Obtain the printout of input and output waveforms at 100Hz, 1KHz and 10KHz showing magnitude measurements of the gain. Post-lab analysis: 1. Generate a lab report following the General Lab Report Guideline. 2. Using the data recorded from your simulation and measurement, draw both the magnitude plot of the gain from simulation and the gain from measured data in terms of the logarithm scaled frequency using Excel or Matlab in one graph. Compare two performances. 3. Compare your measured data at multiple frequencies with your simuation results and comment on % errors. 10

LAB EXPERIMENT #8: PASSIVE FILTER DESIGN Objective: To design, simulate, build and verify performance of selected first order and second order passive filters. Pre-Lab Preparation: 1. Design the filters specified in Figure 1: Filter Specifications. For each circuit, identify and explain what type of the filter it is. Figure 1: Filter Specifications Filter 1: Breakpoint frequency f = Hz Filter 2: Breakpoint frequency f = Hz Filter 3: Breakpoint frequencies f1 = Hz, f2 = Hz Experiment: 1. Simulate, and print-out the magnitude and phase performance of each of the filters designed, using a range of frequencies of 10 Hz to 100 khz as the performance range of interest. Discuss what type of the filter it is. Find the magnitude of the gain at the breakpoint frequency(ies) of each filter and verify your results with the theory. Obtain printouts of both the magnitude and phase plots of each filter. No data needs to be recorded. 2. Build and test each of the filters to verify performance. Vary the input frequency from 10Hz to 100kHz. Observe the change in the output voltage. Record the magnitude of the gain at multiple frequencies on a logarithmic scale (10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000) in a table form. Obtain the printout of input and output waveforms at the breakpoint frequency(ies) showing magnitude measurements. Verify your results with the theory. Post-Lab Analysis: 1. Generate a laboratory report using the General Lab Report Guideline. 2. Comment on the filter performances from your simulation results. 3. Draw the magnitude plot of your measured data using Excel or Matlab. Comment on your filter performances. 4. Compare the gains at the breakpoint frequencies from simulation plots and from circuit measurements. Comment on any deviations. 11

LAB EXPERIMENT #9: ACTIVE FILTER DESIGN Objective: To design, simulate, build and verify performance of an active filter. Measure the frequency response (magnitude and gain), and bandwidth of the filter. Pre-Lab Preparation: 1. Design an active first order low-pass filter (LPF) with the breakpoint frequency f = khz and passband gain =. 2. Design an active first order high-pass filter (HPF) with the breakpoint frequency f = khz and passband gain =. Experiment: 1. Simulate, and print-out the magnitude and phase performance of the LPF and HPF designed, using a range of frequencies of 10Hz to 100kHz as the performance range of interest. Verify the breakpoint frequency of each filter. 2. Cascade two filters together and obtain the magnitude plot. Identify the type of the filter. What is the passband gain for the cascaded filter? Verify the breakpoint frequency(ies) of the filter. Post-Lab Analysis: 1. Generate a laboratory report using the General Lab Report Guideline. 2. Compare the breakpoint frequencies from simulation plots with the given specifications. Comment on the filter performance. 3. Discuss the results from cascaded filters. If the LPF and HPF switched the breakpoint frequncies, how would the result change and why. 12

LAB EXPERIMENT #10: TRANSIENT CIRCUITS Objective: To obtain a transient analsysis of an RC circuit. Determine the time constant of an RC circuit through simulation. Pre-Lab Preparation: Figure 1: Transient Circuit Component Values: R1 = Ω, C1 = F, V1 = V 1. Assume the initial voltage of the capacitor is 0, the switch is closed at t = 0. Find time constant τ and transient response of the voltage across C1: VC1(t) for t > 0. How long will it take to approximately fully charge the capacitor? 2. Assume the initial voltage of the capacitor is 10V, find VC1(t) for t > 0 again. Experiment: 1. Simulate the given RC circuit and show VR1, and Vc1 waveforms. Note that VR1 = V2 V3. Make sure your runtime is 5τ in order for the circuit to reach the steady state and check the box that says Skip the initial transient bias point calculation. A closing switch (Sw_tClose in eval library) can be used in the circuit. The initial voltage of capacitor by default is 0V. Comment on your waveforms. Find the time constant τ based on your simulation results and explain. 2. Simulate the given RC circuit again with the initial capacitor voltage set to 10V. Display VR1 and VC1. Find the time constant τ and explain. To set the initial capacitor, follow the following steps: Make sure capacitor is connected in your circuit with correct polarity. Pin 1 is + and Pin 2 is -. Double click the capacitor symbol (not the name and value), the property editor window will show up. Set column IC (stands for Initial Condition) value to 10V. Close the editor window to go back to your schematic. Post-Lab Analysis: Include all your simulation circuit diagrams and printouts in your report. Compare your time constants obtained from simulations with your calculated value. 13

1. INTRODUCTION Appendix 1: Creating Circuits using PSPICE with OrCAD We will use OrCAD Capture CIS for creating a schematic design. We will work on a simple circuit example to be familiar with performing basic design tasks such as placing parts, adding wires, changing attributes, and getting your design ready for simulation. Also, we will use PSpice to simulate our circuit example. PSpice is a simulator integrated with OrCAD Capture and can be used to simulate both analog and digital circuits. 2. CREATING A BASIC SCHEMATIC 2.1 Getting Started 1) Click start All Programs Cadence OrCAD Capture CIS. Then choose OrCAD Capture with CIS option in a popup window. 2) Click File New Project Type in a name for the project and select Analog or Mixed A/D. You will also be prompted to enter the location you would like to create the file. Click OK to create the new project. Important! -- If you leave the default on (Schematic), Pspice option will not be loaded on and you won't be able to perfom any Pspice simulation. 3) Select Create a blank project and click OK. This will open the schematic editor. Next you are ready to build the circuit. 14

If you schematic editor window does not open automatically, you can double click the.dsn folder, and then click SCHEMATIC1 PAGE1 to open it manually. 2.2 Build the circuit First let us take a look at the schematic editor window. To build the circuit, we can use the buttons on the toolbars; or select the command from the menu. Some common buttons are illustrated below. Place Part New Simulation Profile Run PSpice Voltage Marker Current Marker Place Wire Autowire two points Place Net Alias Place Power Enable Bias Voltage Display Enable Bias Current Display Place Ground 15

Now we start to build a simple DC circuit as shown in Figure 1. R1 R2 3k 12Vdc V1 2.7k R3 2k R4 10k 0 Figure 1: A simple DC circuit 1) Placing Parts Select the Place Part tool by clicking either the button in the toolbar on the right or by choosing Place from the menu and then Part. Then a window will pop up asking you for the part name. If no library is shown, you need to first add those libraries that contain the parts you need. There are two buttons under Libraries, one is Add Library and the other is Remove Library (see figure on the next page for button location). If you move your cursor over the button, it will show the meaning of each button. Now click Add Library button and you will see a list of library files available as follows. 16

The default library folder is under pspice. If not, you should first go to pspice library. There may be duplicated parts in different library, but we only use parts under pspice library in order to perform Pspice simulation. Now, you can select the following libraries: source.olb, analog.olb, 7400.olb, opamp.olb, and anl_misc.olb, and then click Open to add these libraries. (Note: If you are running the demo version at home, please click demo folder and select source.olb, analog.olb, and eval.olb instead. ) The first part we will place is an independent voltage source. Use cursor to select all the libraries you just added, then type VDC in the place part box and you should see a picture of the source in the graphic box, and then click Place Part or just hit Enter key. Move your cursor and you will see a part is attached to your cursor. Place the part to the desired position by left clicking the mouse. You can click ESC to stop placing the part or right click a part and select End Mode. Then double click on 0VDC to change the value of the DC voltage to 12VDC. Place Part Add Library Remove Library 17

To make your schematic more viewable, you can zoom in on the DC source. You can click on the part on the screen first and then choose View Zoom In. Next we will place some resistors in the circuit. Click on the Place Part button and then type R in the part box. Place the resistor to the circuit. If more than one resistor is required, simply move the mouse (with the resistor symbol still attached) to the next resistor position and left click the mouse to place it. To stop placing parts, press ESC. To rotate a part, click on the part to get it selected and then press r. If you need to delete a part, select the part and press the Delete key. To change the value of the resistance, double click the value and enter the value you want on the dialog box that appear. Make sure there is no space in the value. For example value 3 k will not be recognized. You can also change the name of a part by double clicking the name if nessaray. R1 R2 3k 12Vdc V1 2.7k R3 2k R4 10k Figure 2: DC circuit with all the components 2) Wiring Components We are ready to wire the components together to form a circuit. From the buttons menu on the right side of the screen, click on Place Wire button, crosshairs will replace the mouse pointer. Move the crosshairs and make a connection by clicking the left mouse button. R1 R2 3k 12Vdc V1 2.7k R3 2k R4 10k Figure 3: DC circuit with all the components wired 18

Note in the circuit above that some of the connections have a dot. A dot indicates a connection. It is not necessary to have a dot when a wire joins a pin. Dots are always drawn when wires meet in a T. If two wires cross and do not display a dot, then the wires are not connected. 3) Grounding Your Circuit In order for PSpice to simulate your circuit, you must ground your circuit. To add this ground, you can select the Place Ground button or select Place and then Ground from the menu. When the following Place Ground dialog box appears, select 0/CAPSYM and click OK. Place the ground symbol in the screen and connect it to the circuit using a wire. Now your circuit is done. Save your schematic. 2.3 Labeling Nodes Figure 4: Complete Schematic of the DC circuit It is very useful to label the nodes with names so that you can find them easily. To name a node, select the Place Net Alias tool. Enter a name for the alias and click OK. Then place the alias on the desired node. For example, we can name the node as V1, V2, and V3 as shown below. V1 R1 V2 R2 V3 3k 12Vdc V1 2.7k R3 2k R4 10k 0 Figure 5: Labeling Nodes 19

2.4 Editing the Title Block The title block contains information about you, your course, and the schematic. Here we show how to change the title block for the current schematic. In the bottom right corner of your schematic there is a title block. Scroll the page to see the title block. There are three items that we want change: <Title>, <Doc>, and <Rev Code>. To edit an item, double-click the left mouse button on the item. For example: Title EE207 Lab 1: Introduction to PSpice Size Document Number Rev A Lan Xiang 1 Date: Tuesday, June 05, 2012 Sheet 1 of 1 Figure 6: Editted Title Block Your can print out the entire schematic page by selecting File Print. Or you can just print out the area of the page containing your circuit by selecting File Print Area Set. 3. SIMULATE THE CIRCUIT After a schematic of the circuit is created, you can simulate the circuit by PSpice. PSpice can perform several different types of analyses on the schematic. In this course, we will use the following four types of analyses. Bias Point Analysis (DC Nodal Analysis) The Bias Point Analysis is also called DC Nodal Analysis. It solves for the DC voltage at each node of the circuit. This analysis is for DC node voltages only. If you wish to find AC steady state node voltages, you will need to run the AC Sweep. Time Domain Analysis (Transient Analysis) The Transient Analysis shows the behavior of the circuit over time in graphs. VSIN is used as the sinusoidal voltage source in Transient Analysis. Transient Analysis uses voltage and current sources that are functions of time (sinusoid functions) such as VSIN. AC sources such as VAC and IAC (phasors) are used for the AC Sweep only. DC Sweep The DC Sweep analysis causes a DC sweep to be performed on the circuit that allows you to sweep a source (voltage or current), or other parameters. The bias point of the circuit is calculated for each value of the sweep. AC Sweep The AC Sweep is a frequency response analysis. It can be used for Bode plots, gain and phase plots, and phasor analysis. 20

For the DC circuit we have just created, we will perform the Bias Point Analysis. We will discuss other three analyses later on as we work on other labs. 3.1 Bias Point Analysis Select PSpice New Simulation Profile from the menu (or click the New Simulation Profile button on the top toolbar). Enter a name node for the simulation and click Create. If you can't find PSpice tab from the menu, that means you did not select proper project type in the beginning. You can start a new project and copy and paste the schematic you have created into your new project. Select Bias Point as the analysis type and click OK. To run the simulation, select PSpice Run from the menu or click Run PSpice button on the top toolbar. PSpice will run and and an empty PSpice A/D window will apprear as shown below. 21

You can minimize this PSpice simulation window. We will look at the schematic window first. In the schematic window. The node voltages should be display in your circuit. You can drag the voltage display to a desired position if necessary. You can click on Enable Bias Voltage Display button (big V) on the top toolbar to display or remove the display of the node voltages. Figure 7: Simulation Results with Node Voltages You can also click on the Enable Bias Current Display button (big I) on the top toolbar to display the branch currents. You can drag the display to make the schematic a little clearer. 22

3.2 Examine the Output Figure 8: Simulation Results with Branch Currents Now we go back to the PSpice simulation window we just minimized. For convenience, you can add all the shortcut icons by clicking View Toolbars, and then select all the toolbars you want. You can examine the output file of the simulation by clicking View Simulation Output File. You can see the netlist of the circuit and the simulation results. Below are two excerpts of the simulation output file. 23

Note that the output file is more readable if you label the node as discussed in 2.3. For example, we can clearly see V1, V2, and V3 and their coresponding voltages. V1 = 12 V V2 = 4.6917V V3 = 3.609V The total power provided by source is 0.0325 Watts. 24

1. Introduction to the Breadboard Appendix 2: Build the Circuit on the Breadboard You will use the breadboard to build all your circuits. A breadboard is good for making a quick, temporary form of your circuit. When you design and build a circuit, you want to test it and debug your circuit before you make a permanent version. Your breadboard kit contains two of the following pieces. Figure 1: A typical breadboard The bread board has many strips of metal (copper usually) which run underneath the board. The metal strips are laid out as shown below. Figure 2: A breadboard showing underneath metal strips The long top and bottom row of holes (red and blue bus strips ) are connected on that entire row. They are usually used for power supply connections. On some breadboards the bus strips only runs halfway, you need to bridge the gap if you want to use the entire strip. Double check your breadboard using a DMM before you start. Each vertical line has 5 holes connected together underneath. Each column is one node of your circuit. Connections between different components are formed by putting their legs in a common node. The rest of the circuit is built by placing components and connecting them together with jumper wires. Then when a path is formed by wires and components from the positive supply node to the negative supply node, we can turn on the power and current flows through the path and the circuit comes alive. For chips with many legs (ICs), place them in the middle of the board so that half of the legs are on one side of the middle line and half are on the other side. 25

For example, in Figure 3, R1 and R2 are connected in series; R3 and R4 are connected in parallel; R5 is shorted. R1 R2 R3 R5 R4 2. General Tips Figure 3: Example of a simple connection of resistors Try to use the breadboard to make connections, i.e. avoid the use of extra jumper wire. The more wire you use, the more likely you are to make an error by shorting two wires or incorrectly wiring the circuit. When you use extra jumper wire, keep it as short as possible. The lab kits provide jumper wire of various lengths. Use them all! A mess of long wires are not only electrically undesirable (They act as antennas), but also make it hard to debug your circuit when your circuit doesn t work correctly (It happens all the time!). Keep related components together. Make the circuit on the breadboard look as much as possible like the schematic you re implementing. 26

1. INTRODUCTION Appendix 3: AC Circuits and Transient Analysis In this section, we will work on a simple RC circuit shown in Figure 1 and perform the Transient Analysis on it. VOFF = 0 VAMPL = 1 FREQ = 1K AC = 0 Vin V1 R1 10k Vout C1 0.01uF Figure 1: Simple RC Circuit V1 is a sinusoidal signal with 1V amplitude and 1K frequency. The DC offset is 0V. AC is for AC sweep simulation. For transient analysis, you can set AC to 0. Use the theory you have learned from PH262, you can calculate the values of the voltages and currents in phasors (magnitude and phase). The results are as follows (please work out the details). Vin = 1 0 o V Vout = 0.846-32.14 o V I = 53.2 57.86 o µa Next we will perform the Transient Analysis of the circuit and generate Vin, Vout, and I waveforms. 2. CREATE THE CIRCUIT 1) Create a new project as before. 2) Select and wire all the parts: Sinusoidal Source (VSIN), Resistor (R), Capacitor (C), and Ground 0. Adjust the parameter values of all the parts. Remember do not put any space in the component values! For the source, set VOFF to 0, VAMPL to 1, AC to 0 and FREQ to 1K. So the amplitude of the source is 1V and the frequency is 1KHz. 3) Label nodes Vin and Vout as shown in Figure 1. This is optional but makes your simulation results more readable. 3. TRANSIENT ANALYSIS 1) Configure the simulation by clicking the New Simulation Profile button on the top toolbar. Enter the name Tran and the following dialog box will appear. 0 27

Select Time Domain (Transient) as the analysis type. Set Run to time to 2ms (to view 2 cycles of a 1K Hz signal), and Maximum step size to 10us (optional; set maximum time between calculations, often set at T/50). We check the box Skip the initial transient bias point calculations. This saves simulation time by omitting unnecessary attempts at recalculating the state of the circuit at t = 0. Note that it is important to set a good "Run to time" in the transient analysis. This is the period of the time you would like to view the waveform. It is calculated based on the period of the waveform. Typically we would like to set the "Run to time" to 2 to 5 periods of the sinusoid signals. 2) Placing Voltage Markers Click on the Voltage/Level Marker button and place a marker at the node labeled as Vin and at the node Vout. After PSpice simulation is done, a waveform will be displayed in the PSpice simulation window at the node where voltage marker is placed. 28

Vin R1 Vout VOFF = 0 VAMPL = 1 FREQ = 1K AC = 0 V1 V 10k V C1 0.01uF Figure 2: Placing Voltage Markers 3) Click the Run PSpice button and the PSpice analysis results will appear as shown below. 0 Figure 3: Probe Generated Transient Analysis of RC Circuit You can change the display of the probe window by selecting Plot Axis Setting, and then click on XGRID and YGRID to remove both grids. This will help you later on to see your cursor position more clearly. To include the image in your word document, simply click Window Copy to Clipboard, and then click ok (keep default option) to copy; and then go to your word document to paste. If we don t place any markers in the circuit, the screen will be empty when we run PSpice. You can either go back to your schematic to add markers, or you can add traces in the PSpice A/D simulation window directly by selecting Trace Add Trace. The following dialog box will appear. 29

Click on V(Vin) and V(Vout) from the list, you will see they are added to the Trace Expression at the bottom. Then click OK. Two traces will be added to the screen. Now you see that the node labeling is very important. You can identify the node voltages you want to display very easily from the list in this way. 4) Using Cursors Once you have the waveforms, you may need to find some values based on the waveforms. For example, what are the amplitude and the phase of the waveform? You can use cursors to get more accurate readings. Click the Toggle Cursor button on the top toolbar to display the cursors and the Probe Cursor window. As we mentioned above, to view your cursors clearly, you can remove all the grids by click Plot Axis Settings and then select proper options in X Grid and Y Grid. There are two cursors if you click left and then right mouse buttons. Cursor 1 is red and is controlled by the left-hand mouse button. Cursor 2 is green and is controlled by the right-hand mouse button. Diff is the difference between two cursors. 30

Legend symbol Figure 4: The Probe Cursor System The Probe cursor window shows the X and Y values of each cursor (as well as the difference). X value is usually the time and Y values are usually voltages or currents. For example, cursor 2 is placed at 533.333 µs and at this time, Vin is - 207.627mv and Vout is 294.354mv. Trace Y1 Y2 Y1-Y2 X Value 337.374u 533.333u -195.959u V(VIN) 852.302m -207.627m 1.0599 V(VOUT) 859.524m 294.354m 565.170m By default, both cursors move on the first waveform. If you want to associate cursor 1 with a waveform, you need to left click on the appropriate color-coded legend symbol (shown in Figure 4) of the signal. On the other hand, if you want to associate cursor 2 with a waveform, you need to right click on the legend symbol of the signal. To fine tune the cursor 1, we use the arrow keys ( and ). To fine tune the cursor 2, we hold down the Shift key and use the arrow keys. To find the amplitude of the waveform, you can move the cursor to the peak manually or you can use the Cursor Peak button to find the next peak value. You can also use Mark Label button to display the coordinate of the cursor at the point of the cursor. The labels can be dragged for better display and can be deleted by Delete key. 5) Plotting Currents To plot a current, you can place a current marker at a component pin as shown in Figure 5. 31

Vin R1 Vout VOFF = 0 VAMPL = 1 FREQ = 1K AC = 0 V1 V 10k I V C1 0.01uF Figure 5: Place a Current Marker If you run the PSpice simulation again, you will see in the PSpice simulation window that there is a only blue line showing a constant current of nearly zero. We know this is not correct! The problem is that the current magnitude is too small (it is 1000 times less than the voltage magnitude), and PSpice always adjusts its curves according to the largest magnitude curve. To solve the problem and display the current waveform properly, we need to create a second Y-axis for current. First delete the current waveform by clicking its legend and then hit delete key. Then we need to follow the following steps to create a second Y-axis and use a marker to redisplay the current on the new Y-axis. In PSpice simulation window, select Plot Add Y Axis Return to the schematic, double click on the existing current marker to activate it. Then you will see all three waveforms displayed as in Figure 6. Note that the first positive peak of the current is obviously smaller than other peaks of the waveform. Why? Which peak value shall we use when we measure the peak amplitude of Vout and the peak current I? 0 Figure 6: Adding Current to a New Y-axis 32

Appendix 4: Clock Pulse Generator 1. IC Timer (a) (b) Figure 1: IC555 Timer Internal Structure IC 555 timer can be used to generate a clock pulse for the digital flip flops. Figure 1 shows the IC package and pins of a 555 chip. Figure 2 shows the internal structure of a 555 timer. IC555 timer consists of two voltage comparators, the flip-flop and the transistor for the discharge. Three resistors are connected with the inside in series and the power supply voltage (Vcc) is divided in 3. 1/3 with power supply voltage is applied to the positive input terminal of the comparator and the voltage of 2/3 is applied to the negative terminal of the comparator. When the threshold input at pin 6 goes above 2/3 Vcc, the upper comparator resets the flip-flop and the output goes low to about 0V. When the trigger input at pin 2 goes below 1/3 Vcc, the lower comparator sets the flip-flop and the output goes high to about 5V. The timer circuit is capable of producing accurate time delays controlled by an external RC circuit. In this experiment the IC timer will be operated in the astable mode to produce clock pulses. 33

2. Clock Circuit Operation Figure 2: Clock Circuit using 555 Timer When power Vs (5V) is first applied to the circuit, the capacitor will be uncharged; therefore, both the trigger and threshold inputs will be near zero volts. The lower comparator sets the control flip-flop causing the output to switch high. That also turns off the transistor. The capacitor begins to charge through R1 and R2. As soon as the charge on the capacitor reaches 2/3 of the supply voltage, the upper comparator will trigger causing the flip-flop to reset and therefore the output will be low. Transistor conducts and causes the capacitor C to discharge through R2. Figure 3: Traces of the Output and Capacitor Voltage (C1) As soon as the voltage across the capacitor C reaches 1/3 of the supply voltage, the lower comparator is triggered. That again causes the flip-flop to set and the output to go high. Transistor cuts off again and the capacitor C begins to charge. That cycle continues to repeat with the capacitor alternately charging and discharging. The resulting output is a periodic clock pulse. The period of the clock pulse is T = tl + th, where tl is the duration of the time that the output remains low and th is the duration of the time that the output remains high. They can be calculated through the following equations: tl= 0.693 R2 C1 th= 0.693 (R1 +R2) C1 34

3. Clock Circuit Simulation Create your clock circuit schematic in OrCAD. Use 555D in the eval library under demo folder. For simulation purpose, you need to connect pin 3 through a resistor with big resistance to the ground. This is because pin 3 of 555D is a digital node. It only shows logic values (high or low). Pin 2 and 7 are analog nodes. They are characterized by voltages and currents. The actual voltage waveform will be displayed at that pin in transient analysis. Important: Make sure the box that says Skip the initial transient bias point calculation is UNCHECKED when you use 555D in the simulation. 35

Appendix 5: DC Sweep in PSpice In many situations during the circuit design process it is necessary to analyze a circuit over a range of DC voltages and currents. DC Sweep in PSpice allows you to sweep specified input sources while tracking output values. The results can be plotted in the Probe window or printed to the output file. Now let us look at the following circuit. If we are only interested in node voltages and branch voltages, we simply perform Bias Point Analysis. Sometimes, we may be interested in how the value of Vout varies as Vin varies. For example if Vin is raised from 0 to 25V, what will be Vout. In this case, we need to perform DC Sweep Analysis. Vin R1 R3 Vout 12Vdc V1 2.7k R2 5k 1Meg R4 10k 0 Figure 1: DC Sweep Circuit The voltage source V1, which is to be swept during the simulation, is set to 12V in the schematic. The value assigned to V1 can actually be arbitrary since PSpice will recognize that this is to be a DC Sweep Analysis and will use the values specified in the Simulation Profile. You can also perform DC Sweep on AC circuits with VAC or VSIN sources. For the DC Sweep, PSpice will treat the sources as the DC sources and studies the DC behavior of the circuit. If there are capacitors and inductors in the circuit, the capacitors are open circuits, and the inductors are short circuits. Click on the New Simulation Profile button and specify a name for your simulation. The simulation setting window appears. Select DC Sweep and Primary Sweep option. A primary sweep means that we are changing only one circuit parameter for this simulation. Set Sweep variable and Sweep type as shown below, then click OK. 36

We are now ready to simulate the circuit. Run PSpice and the Probe window will display an empty plot. Add the trace V(Vout) as shown below. Figure 2: DC Sweep of Vout versus Vin You can also show the gain Vout/Vin versus Vin. To do this, you need to go to Trace Add Traces, first select V(Vout) from the list of Simulation Output Variables, and then select / from the list of Functions (or type in /), and finally select V(Vin) from the list of Simulation Output Variables. As you click on the name to select that variable, you will see that the name is added to the Trace Expression at the bottom. Click OK to see the trace as shown in Figure 2. 37

Figure 2: DC Sweep of Vout/Vin versus Vin 38

Appendix 6: AC Sweep in PSpice 1. Introduction The AC Sweep is used for Bode plots, gain and phasor plots, and phasor analysis. The circuit can be analyzed at a single frequency or at multiple frequencies. In this part, we will illustrate its use at a single frequency for magnitude and phase results (phasors), and at multiple frequencies for Bode plots. It is important to realize the difference between the AC Sweep and the Transient Analysis. The AC Sweep is used to find the magnitude and phase of voltages and currents. The Transient Analysis is used to look at waveforms versus time. The AC Sweep uses the sources VAC and IAC. These sources are functions of magnitude and frequency. Source VSIN is generally used for transient analysis. 2. Magnitude and Phase (Phasors) Text Output First, let us see how to place a VAC source. The default VAC source is shown below: 1Vac 0Vdc V1 If given V1= 10 37 o V, then the magnitude is 10V and the phase is 37 o. Double click V1 symbol, the property editor window shows a spreadsheet of all of the part s properties. Note that there are more properties than appear on the schematic. Right-click the shaded cell in the ACMAG column, then click Display. When the following window pops up, choose the display format Name and Value. Do the same thing for the ACPHASE. In this way, we can see clearly the magnitude and the phase of the source signal displayed in the schematic. Also, right-click on the cell in DC column, choose Display and then select Do Not Display. 39

You can scroll the spreadsheet to the right to see other properties of the part. Close the Property Editor window to return to your schematic. (Be careful not to close the OrCAD Capture window!) In the schematic, double click on ACMAG and ACPHASE to enter the values. Now look at the following AC circuit: Figure 1: AC Circuit Example 1 We will perform AC Sweep on the circuit to obtain the magnitude and phase of node voltages and branch currents with frequency at 100Hz. To do this, we need two parts in a library called Special : VPRINT1 and IPRINT. First, we add library special, and get the part called VPRINT1. Put the part to where you want to obtain the node voltages. In this example, we put VPRINT1 on V1, V2, and V3 node. Then we get the part IPRINT and connect the part in series into the circuit where you want to obtain the branch currents. 40

Figure 2: AC circuit example with AC sweep probes Double-click on each VPRINT1 symbol to edit its properties. In the text box, left click box AC, MAG and PHASE and enter yes. Also in the text box for IPRINT set AC, MAG and PHASE to YES. Configure all the VPRINT1 and IPRINT parts in the circuit. We are now ready to set up the simulation. Create a new simulation profile and select AC Sweep/Noise. Select Linear, and set the Total points to 1, Start and End Frequencies to 100Hz. 41

Run PSpice. Click on the View Output File button in the Probe window. The AC nodal analysis results are printed near the bottom of the output file. The following results are included in the output file: ************************************************************************ FREQ VM(V1) VP(V1) 1.000E+02 1.000E+01 3.700E+01 ************************************************************************ FREQ VM(V2) VP(V2) 1.000E+02 4.655E+00-8.782E+00 ************************************************************************ FREQ VM(V3) VP(V3) 1.000E+02 4.646E+00-1.238E+01 ************************************************************************ FREQ IM(V_PRINT4) IP(V_PRINT4) 1.000E+02 1.507E+00 6.329E+01 ************************************************************************ FREQ IM(V_PRINT5) IP(V_PRINT5) 1.000E+02 4.646E-01-1.238E+01 ************************************************************************ FREQ IM(V_PRINT6) IP(V_PRINT6) 1.000E+02 1.463E+00 8.122E+01 ************************************************************************ The above results show the voltage magnitude (VM) and phase (VP), and current magnitude (IM) and phase (IP). We need to find which voltage or current corresponds to which VPRINT or IPRINT and summerize the answer in a more readable phasor format. So at a frequency of 100 Hz, we find the following voltages and currents: V1 = 10 37 o V V2 = 4.655-8.782 o V V3 = 4.646-12.38 o V IR1 = 1.507 63.29 o A IL1 = 0.4646-12.38 o A IC1 = 1.463 81.22 o A 42

3. Gain and Phase Plot We can also use AC Sweep to plot the gain and the phase as functions of frequencies. This is very useful when we study the frequency response of a circuit. Given the following RC circuit: Vin R1 1k Vout 1Vac 0Vdc V1 C1 1nF Figure 3: AC Circuit Example 2 We configure the simulation by clicking the New Simulation Profile button on the top toolbar. Enter the Name plot and the following dialog box will appear. Select Analysis type: AC Sweep/Noise, AC Sweep Type: Logarithmic and enter the displayed values for Start Frequency, End Frequency, and Points/Decade. Click OK. 0 43

Run PSpice simulation and add trace V(Vout). Figure 4: Maganitue of Vout The trace above shows the magnitude of the voltage at node Vout as a function of frequency. To plot the phase, we will add a new plot and add the trace VP(Vout) to the new plot. You can simply type VP(Vout) in the trace expression box when you click add trace. Figure 4: Maganitue and Phase of Vout To take some measurements on the plot, you can use cursor to show the coordinate of the cursor. Then you can use Mark Label button to display the coordinate at the point of the cursor. Drag the text display to your desired location if needed. A Bode plot is widely used in the industry to represent the frequency response. The magnitude in decibels is plotted against the logarithm of the frequency. To plot a Bode 44

plot that displays the magnitude in decibels, you can select Add Traces and the following dialog box will appear. First you select Bode Plot db separate (1) from the Plot Window Templates on the right side. Then select V(Vout) from the list of nodes on the left side and click OK. The result is shown below: Figure 5: Bode Plot of Example 2 45