Laboratory 5: RC Circuits and Filtering

Similar documents
Laboratory 7: Active Filters

DAQ 2: Introduction to Data Acquisition: Analog I/O

Class #16: Experiment Matlab and Data Analysis

George Mason University Signals and Systems I Spring 2016

Integrators, differentiators, and simple filters

Open Loop Frequency Response

Experiment 2: Transients and Oscillations in RLC Circuits

Boise State University Department of Electrical and Computer Engineering ECE 212L Circuit Analysis and Design Lab

, answer the next six questions.

EE 233 Circuit Theory Lab 3: First-Order Filters

BME 3512 Bioelectronics Laboratory Two - Passive Filters

EECS 216 Winter 2008 Lab 2: FM Detector Part I: Intro & Pre-lab Assignment

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

4 Experiment 4: DC Motor Voltage to Speed Transfer Function Estimation by Step Response and Frequency Response (Part 2)

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

Experiment 1.A. Working with Lab Equipment. ECEN 2270 Electronics Design Laboratory 1

DC and AC Circuits. Objective. Theory. 1. Direct Current (DC) R-C Circuit

EE 233 Circuit Theory Lab 2: Amplifiers

EE 462G Laboratory #1 Measuring Capacitance

AC CURRENTS, VOLTAGES, FILTERS, and RESONANCE

ωc ωc sin(wt 90o ) (for a capacitance) (4)

Experiment Guide: RC/RLC Filters and LabVIEW

Rotary Motion Servo Plant: SRV02. Rotary Experiment #03: Speed Control. SRV02 Speed Control using QuaRC. Student Manual

Step Response of RC Circuits

EECS40 RLC Lab guide

FREQUENCY RESPONSE AND PASSIVE FILTERS LABORATORY

SECTION 7: FREQUENCY DOMAIN ANALYSIS. MAE 3401 Modeling and Simulation

Lab 8 - INTRODUCTION TO AC CURRENTS AND VOLTAGES

Operational Amplifiers 2 Active Filters ReadMeFirst

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

MTE 360 Automatic Control Systems University of Waterloo, Department of Mechanical & Mechatronics Engineering

EXPERIMENT 4: RC, RL and RD CIRCUITs

Lab 6: Building a Function Generator

EE2210 Laboratory Project 1 Fall 2013 Function Generator and Oscilloscope

EE 210 Lab Exercise #5: OP-AMPS I

CHAPTER 9. Sinusoidal Steady-State Analysis

ECE 2006 University of Minnesota Duluth Lab 11. AC Circuits

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

EECS 216 Winter 2008 Lab 2: FM Detector Part II: In-Lab & Post-Lab Assignment

sin(wt) y(t) Exciter Vibrating armature ENME599 1

Experiment 2: Electronic Enhancement of S/N and Boxcar Filtering

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

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

Lab 1: Simulating Control Systems with Simulink and MATLAB

EE 422G - Signals and Systems Laboratory

Experiment 5.A. Basic Wireless Control. ECEN 2270 Electronics Design Laboratory 1

Experiment 8 Frequency Response

Precalculations Individual Portion Introductory Lab: Basic Operation of Common Laboratory Instruments

BME 3512 Bioelectronics Laboratory Six - Active Filters

EK307 Passive Filters and Steady State Frequency Response

Xcircuit and Spice. February 26, 2007

UC Berkeley, EECS Department

ECEN 325 Lab 5: Operational Amplifiers Part III

I. Introduction to Simple Circuits of Resistors

Time-Varying Signals

Experiment 18: Driven RLC Circuit

Experiment #3: Experimenting with Resistor Circuits

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

CHAPTER 6 INTRODUCTION TO SYSTEM IDENTIFICATION

RC Circuit Activity. Retrieve a power cord and a voltage sensor from the wire rack hanging on the wall in the lab room.

Lab 2: Introduction to Real Time Workshop

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics 8.02 Spring Experiment 11: Driven RLC Circuit

Lab 6: MOSFET AMPLIFIER

Lab 7 PSpice: Time Domain Analysis

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics 8.02 Spring 2005 Experiment 10: LR and Undriven LRC Circuits

Proportional-Integral Controller Performance

Each individual is to report on the design, simulations, construction, and testing according to the reporting guidelines attached.

LRC Circuit PHYS 296 Your name Lab section

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

Experiment VI: The LRC Circuit and Resonance

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

ECEN Network Analysis Section 3. Laboratory Manual

Lab 3: AC Low pass filters (version 1.3)

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

Filter Design, Active Filters & Review. EGR 220, Chapter 14.7, December 14, 2017

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

Knowledge Integration Module 2 Fall 2016

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

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

LABORATORY 3 v1 CIRCUIT ELEMENTS

Fourier Signal Analysis

Real Analog - Circuits 1 Chapter 11: Lab Projects

Laboratory 9. Required Components: Objectives. Optional Components: Operational Amplifier Circuits (modified from lab text by Alciatore)

PHYSICS 330 LAB Operational Amplifier Frequency Response

STUDY OF RC AND RL CIRCUITS Venue: Microelectronics Laboratory in E2 L2

Experiment 7: Undriven & Driven RLC Circuits

Series and Parallel Resonance

Midterm 1. Total. Name of Student on Your Left: Name of Student on Your Right: EE 20N: Structure and Interpretation of Signals and Systems

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

POLYTECHNIC UNIVERSITY Electrical Engineering Department. EE SOPHOMORE LABORATORY Experiment 5 RC Circuits Frequency Response

Experiment Number 2. Revised: Summer 2013 PLECS RC, RL, and RLC Simulations

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

BME/ISE 3511 Laboratory One - Laboratory Equipment for Measurement. Introduction to biomedical electronic laboratory instrumentation and measurements.

LABORATORY 7 v2 BOOST CONVERTER

Laboratory Project 4: Frequency Response and Filters

Laboratory Project 1a: Power-Indicator LED's

EK307 Active Filters and Steady State Frequency Response

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

AC Circuits INTRODUCTION DISCUSSION OF PRINCIPLES. Resistance in an AC Circuit

Simple Oscillators. OBJECTIVES To observe some general properties of oscillatory systems. To demonstrate the use of an RLC circuit as a filter.

Transcription:

5.1 Introduction Laboratory 5: ircuits and Filtering For this lab, you will be comparing the experimental behavior of a filter with analytical behavior modeled in MATLAB using Bode plots. During the lab period, you are going to build a circuit to analyze a first-order filter consisting of a resistor and a capacitor in series. You will then take eight sets of voltage readings for the output of the filter - each will be driven by a single frequency sinusoid, but the frequency will change. You will then compare their magnitude and phase ratios to those obtained by a transfer function. When finished with this lab, you will be able to perform experimental and theoretical analysis of basic filters. 5.2 In-Lab Assignment There are six main parts of this assignment that must be completed in the lab: (1) Logging into a DAQ machine and starting MATLAB (2) Starting a browser, then downloading and modifying the pre-written DAQ software (3) Building the circuit and wiring the measurements (4) Measuring responses to eight sine waves at different frequencies (5) Graphically comparing your results to analytical results from Maple (6) Transferring the data files to each member in the group (7) leaning up Once these parts are done, there will be several parts that may be completed outside of lab, including comparing the experimental results with the theory covered in class. Those sections will be done in groups of two (three if your lab group had to have three people). 5.2.1 Logging In For this week you will only need one person in your group to log in to the DAQ computer (identified by the gray cable coming out of the back and connected to the B-68LP card), as you will be using this machine for taking data from the circuit. Whoever is sitting at the DAQ machine can log in using their own credentials. You should then start MATLAB 2015b on the P. After MATLAB has finished starting, make sure the working directory is empty. 5.2.2 Downloading Files Once that is done, start the Firefox browser (if possible; Explorer if not) and point it to: http :// classes. pratt. duke. edu / FILES / EG224 / DAQS / filter There will be two files for you to download - right-click on the name of each and save the files (either Save Link As... or Save Target As...) to the :\Users\NetID\Documents\MATLAB directory where NetID is the NetID of the person who logged in. Lab 5 1

5.2.3 Building the ircuit and Wiring the Measurements The circuit for this week will simply be a voltage source in parallel with a series combination of a resistor and a capacitor. Each group will have a different combination, so make sure to write down the nominal resistor and capacitor values you have as well as which envelope it came from. Make sure they match the label on the envelope and the table on the Pundit page, too. The circuit diagram is as follows: v v S v and you will be measuring the source voltage v s (t), the resistor voltage v (t), and the capacitor voltage v (t). The network listing and a more detailed circuit drawing including the specific lines and pins to use are in Section 5.7 on page Lab 5 6. Use the small white breadboard to build the circuit. 5.2.4 Measuring esponses to Eight Sine Waves at Different Frequencies Assuming you are primarily interested in knowing the voltage across the capacitor, the differential equation that models the circuit can be found using Kirchhoff s Voltage Law, and is: dv dt + v = v s For this lab, you are going to focus on obtaining data points to create your own experimental Bode magnitude and phase plots for this filter. To do this, you will be running a program called FreqFunction. The FreqFunction program will use the loop s controlling variable k to determine which of eight different angular frequencies to use for the input voltage sinusoid. The program will wait for you to hit return, then take data for either 5.5 periods of that sinusoid or five time constants of the circuit, whichever is longer. The latter is to make sure all the transients have gone away and that you see the A steady state response. You will notice at higher frequencies that the program takes more than 5.5 periods of data and you should also notice an overall exponential offset that goes away over time. After each run is taken, you should qualitatively determine if the waveforms on the screen match what you think should be happening with your particular values. You will do this two different ways. Verification Using Lab 4 After you have taken data at the highest frequency (300 rad/s), you should use your Maple program from Lab 4 to see if your results match. This would be a good job for a partner not at the DAQ machine. Log into the P, then use MobaXterm to log into an OIT machine. Bring up the Maple worksheet for Lab 4 and then save it with a new name. You will simply need to change the forcing function (most likely in a variable called NewSourceVals) and the duration (in your plot command). The forcing function in the first run will be sin(300 t). You can hard-code the duration based on the duration of your MATLAB graph. Once you have the Maple sheet working for ω = 300 rad/s and it looks like your MATLAB graph for the same set of circumstances, have a TA come by to verify that the graphs match and are correct. Your group cannot get credit for this lab without getting checked in for this verification step. After the first run is done, you should keep modifying the Maple worksheet by changing the frequency and the plot duration, the re-running the worksheet to make sure your Maple results closely match your MATLAB data. You will not be turning in anything from Maple, but again, your group cannot get credit for this lab without getting checked in for this verification step. Verification Using Transfer Function The transfer function between the input voltage and the capacitor voltage, for example, is: H(jω) = V 1 (jω) V s (jω) = jω 1 jω + = 1 jω + 1 = 1 1 + j ω 1/ = 1 jω + 1 Lab 5 2

depending on how you want to represent the various parts of the transfer function. From the perspective of a straightline approximation to the Bode magnitude plot, the corner frequency for the denominator term is ω corner = 1 - at significantly lower frequencies, nearly all the voltage will drop across the capacitor. At exactly this frequency, the magnitude ratio should be 1/ 2 0.7071. As the frequency increases, the peak capacitor voltage should continue to decline relative to the peak input voltage. The program takes data for the highest frequencies first since those runs are faster and you can make sure you are taking good data. 5.2.5 Saving Data The program will automatically store your data in files called Data_FFFF_EE_IDS. mat where FFFF is the angular frequency of the input sinusoid, EE is the envelope number, and IDS is the ID string. The program does not save the plots - you will copy another file into your OIT account both to help you obtain the particular data from the graphs and to create a single figure with the graphs you need. Before continuing, make sure the graphs make sense. The voltages should all be sinusoids, for example. 5.2.6 Transferring Files Once you have taken the data for the eight single frequency forcing functions, you have completed the data acquisition part of this assignment. At this point, each person in the group will need to put all eight data files as well as the data acquisition script (FreqFunction) into their own accounts. Use the SSH Secure File Transfer program to do this for each person. For instructions on how to transfer files, go to the Pundit page on Transferring Files. Each of you will want to create a lab5 directory in your OIT space for the course, then put the files in there. Once the first person has transferred the files over, that person should close the transfer window and let the other members of the group repeat the above process for themselves. 5.2.7 leaning Up Once you are sure that each member of the group has a complete set of valid files, delete all the items from the P s MATLAB directory, then empty the Windows ecycling Bin. For your circuit: make sure you have written down your envelope number and the values of the resistor and capacitor within it, then put the capacitor and resistor back in the numbered envelope and detach all the wires from the breadboard and B-68LP. Have a TA come by to verify that your MATLAB directory and ecycling Bin are empty and that you have the proper parts inventory; then return all the circuit parts to the front of the room. Please be especially careful to make sure the correct capacitor and resistor go in the envelope and that the envelope goes back into its tray. This concludes the portion of the laboratory that must be completed in B209. 5.3 ollaboration Policy for This Assignment Please note - the rest of this work is a collaborative effort but must represent a collaboration. I forgot - what does collaboration mean? You are expected to work together on the programs that need to be written to produce your graphs, to work together on determining the answers to the various questions posed, and to work together on creating the final report. Be sure you know who your partners are and how to contact them, then set up a time early to get together and work on this assignment. Do not wait until the last minute and do not let yourself become the only person doing any work or the person doing no work. egardless of whose account is used to generate results and the report, a complete set of the final files (data, graphs, report, etc.) needs to exist in each person s account. Your group is certainly welcome - in fact, highly encouraged - to start the analysis portion of this assignment in B209. The following instructions are written assuming you are at a P in B209. Note that the lab5 directory should already exist, so the second command in step 3 should produce an error. Lab 5 3

5.4 Getting Started 1. Log into one of the Ps in the lab using your NET ID. 2. Start a browser and point it to http://pundit.pratt.duke.edu/wiki/lab:b209. heck out the Using the Ps to un Unix Programs emotely section for how to get connected and make sure the connection is working. 3. Once connected to a machine, switch into your EG 224 directory and create a lab5 directory inside it: cd EG224 mkdir lab5 4. Switch to your lab5 directory: cd lab5 5. Get the relevant tar file from Dr. G s web space: wget people.duke.edu/ mrg/eg224/lab5files.tar 6. Expand the files from the tar file: tar -kxvf lab5files.tar 5.5 Assignment The analysis portion consists primarily of comparing the theoretical magnitude ratios and phase shifts for the transfer function between the input voltage and the capacitor voltage to those obtained experimentally. 5.5.1 Frequency-Domain omparison For the analysis, you will be looking at the magnitude ratios and phase differences for pure sinusoids at different frequencies. To determine experimental data points for the frequency response of the circuit, you will need to examine the peak voltages of the capacitor and the total relative to one another. Note that the peak value for the source voltage should be 1 V in each case. First, use the applots code that was copied into your OIT account to look at the eight sinusoids. Follow the instructions to save your graph. Make sure that the relationship between the capacitor voltage and the total voltage makes sense as the frequency increases. Next, you will need to determine the magnitude ratios and phase shifts experimentally. To fill out the following data, you will plot the source and capacitor voltage as a function of time, zoom in to where you can see the last complete set of positive peaks for the voltages using the magnifying glass feature in MATLAB, then use the ginput command to pick points off the graph. To help, one of the scripts you copied into your OIT account - called GetPeaks - does much of this work for you. un the program and follow the directions it gives. The program will automatically save the voltage and time data - later, you will use the data to fill out the following table: ω v speak t speak v peak t peak = v peak v speak = 180 π ω(t speak t peak ) 1 2 5 12 25 60 130 300 Note that the frequencies have relatively even logarithmic spacing. The ratio between one value and the one after it is between 0.4 and 0.5. Also - be sure that you are taking point from the same period - the resistor and capacitor peaks should be no more than a quarter-period away from the total peak. Lab 5 4

Your group should now write a MATLAB script that loads the data saved by GetPeaks. This code should then calculate the magnitude ratio and phase angle based on the value and timing of the peaks you measured. Your phase angle should be reported in degrees - this will become important when you compare your experimental values with the analytical ones. Next, in the same script, you will be creating two figures - one for the magnitude information and one for the phases. In the first figure, create a semilogx plot of 20 log 10 (G) versus the forcing function frequencies - since you only have eight data points, plot them as black circles. Does this graph make any sense given that you are plotting the magnitude ratio of the capacitor voltage as a function of frequency? If not - figure out why not. If the plot seems to make sense so far, however, you may proceed to the next step. MATLAB can determine the magnitude ratio and phase shifts for a transfer function with a command called bode. The bode command takes a transfer function and a frequency range as inputs and produces the magnitudes and phases as outputs. MATLAB generates transfer functions in a variety of ways - one of the easiest being the tf command. The tf command expects two inputs - the coefficients of the numerator and the coefficients of the denominator of a transfer function. In this case, the transfer function would be: so the code to create the transfer function is: = XXX ; = XXX ; s = tf s ); H = 1 / s** + 1) H(jω) = V (jω) V s (jω) = 1 jω + 1 The letter s that is used by tf is the frequency-space representation for a Laplace transform. It serves the same purpose as jω. For the bode command, generate a logarithmically-spaced array of between 1000 frequencies that span the same domain as the experiment and grab the outputs. Give the transfer function and this array as inputs and grab the outputs. For whatever reason, the output from bode is a 1x1xN matrix for a single transfer function taken over N frequencies, so there is a bit of trickery involved generating variables you can plot. Specifically, you have to squeeze the data. That is: Omega = logspace log10 1), log10 3000), 1000); [HMag, HPhase, HOmega ] = bode H, Omega ); HMag = squeeze HMag ); HPhase = squeeze HPhase ); Note: the bode command calculates the phase angle in degrees. Now add a plot of the analytical magnitude ratios to the experimental graph created above - use a black line for this plot. Add a legend, labels, and a title. Finally, use the print command to save this plot. Next, follow a very similar procedure for plotting the experimental and theoretical phases (in degrees) on the same graph. In the lab report, you will include these two graphs as well as the code used to create them. You should also comment on how well or poorly the experimental data matches theory and any reasons you can think of for any discrepancies. Note that you do not need to include the text of the FreqFunction or apsplots codes. 5.6 Summary of Lab eport For the lab report, there will be a graph with all eight sinusoids from the FreqFunction run (made by the apsplots program), two Bode plots (one with the experimental and theoretical magnitudes and one with the experimental and theoretical phases), and a MATLAB script for performing and plotting the frequency-domain analysis. You will replicate the data table with the magnitude ratios and phase differences for the experiment. You will then use all the information at your disposal to answer the questions or respond to the comments in this assignment. There is a L A TEX skeleton for the lab report in the lab5 folder from which you copied files. While you are not explicitly required to use L A TEX, this skeleton will automatically bring in the MATLAB graphs and codes that you need as well as generate a table of contents and a list of figures. Even if you do not use the skeleton, you may want to use it as a point of reference for making sure you turn in all the parts of the lab. Lab 5 5

5.7 ircuit Diagrams and Network Listings Item First Second Note ES Pin F10 Pin F16 Your Value: kω AP Pin I16 Pin Y16 Your Value: µf ED1 Pin H10 Line L22 DA0OUT BLK1 Pin Y1 Line L55 AOGND BLK2 Pin Y5 Line L67 AIGND ED2 Pin I10 Line L33 AH1: vs GN1 Pin Y8 Line L66 AH9: vs ED3 Pin G10 Line L65 AH2: v GN2 Pin G16 Line L31 AH10: v ED4 Pin H16 Line L30 AH3: v GN3 Pin Y10 Line L63 AH11: v Table 5.1: Network Listing for ircuit Measurements AH2 v AH10 AH1 DA0OUT AH3 v S v AH9 AOGND, AIGND AH11 Figure 5.1: ircuit Diagram for ircuit Measurements Lab 5 6