Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lab 1 RC Circuits

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

EE 233 Circuit Theory

Lab 1: RC Circuits
Table of Contents
1 Introduction ........................................................................................................................................... 1
2 Precautions ............................................................................................................................................ 1
3 Prelab Exercises .................................................................................................................................... 2
3.1 The RC Response to a DC Input ................................................................................................... 2
3.1.1 Charging RC Circuit ............................................................................................................. 2
3.1.2 Discharging RC Circuit ......................................................................................................... 3
3.1.3 Square Wave Input ................................................................................................................ 3
3.1.4 Multiple-stage RC Circuits ................................................................................................... 3
3.2 The RC Response to a Sinusoidal Input........................................................................................ 4
3.2.1 Time-domain RC Response .................................................................................................. 4
3.2.2 Frequency-domain RC Response .......................................................................................... 5
4 Experimental Procedure and Data Analysis.......................................................................................... 6
4.1 The RC Response to a DC Input ................................................................................................... 6
4.1.1 Square Wave Input Analysis ................................................................................................. 6
4.1.2 Time Constant Measurement ................................................................................................ 7
4.2 The RC Response to a Sinusoidal Input........................................................................................ 7
5 Reference Material ................................................................................................................................ 9
5.1 RC Step Response and Timing Parameters ................................................................................... 9
5.2 Elmore Delay Estimation ............................................................................................................ 10
5.3 Frequency Response of a Circuit System.................................................................................... 10
5.4 Parameter Extraction via Linear Least-Squares-Fit Technique .................................................. 11

Table of Figures
Figure 3.1.1: Single-stage RC circuit. ........................................................................................................... 2
Figure 3.1.2: Two-stage RC circuit............................................................................................................... 4
Figure 3.1.3: Three-stage RC circuit............................................................................................................. 4
Figure 3.2.1: An RC circuit with the output over the resistor. ...................................................................... 5
Figure 4.1.1: RC circuit for lab experiment. ................................................................................................. 6
Figure 5.1.1: Timing parameters of signal waveforms. ................................................................................ 9
Figure 5.2.1: N-stage RC circuit delay estimation. ..................................................................................... 10
1 Introduction
This lab is designed to teach students methods for characterizing circuit systems, and more specifically, an
RC circuit system. This lab will also familiarize students with the test bench instruments used in this class
by having them use the equipment to analyze some fundamental response trends of step and sinusoidal
input functions for an RC circuit.
A circuit system can be pictured as a box with inputs and outputs, and the characteristics of this system can
be represented by its input and output signals, e.g. voltage and current. A signal contains three parameters:
magnitude, frequency, and phase. Any change of these parameters in the input signal will affect the output
signal.
The RC circuit has many interesting characteristics while staying one of the most basic circuit systems.
This lab is going to allow students to observe these characteristics and teach them how to analyze the output
signals with changes in input magnitude or frequency.
This lab is split into a prelab exercise and hardware implementation. Submit one prelab report and one lab
report per group, with the members’ names are clearly written on the front page. There is no template for
the prelab report, and the lab report template is available on Canvas. These reports must be in pdf format.
There are multiple apps, including CamScanner, for Apple and Android phones that turn photos into pdf’s.

2 Precautions
None of the devices used in this set of experiments are particularly static sensitive; nevertheless, you should
pay close attention to the circuit connections and the polarity of the power supplies, function generator, and
oscilloscope inputs.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 1 of 11


3 Prelab Exercises
3.1 The RC Response to a DC Input
3.1.1 Charging RC Circuit
The differential equation for 𝑣out (𝑡) is the most fundamental equation describing the RC circuit, and it can
be solved if the input signal 𝑣in (𝑡) and an initial condition are given.

Prelab #1:
Derive the differential equation for 𝑣out (𝑡) in Figure 3.1.1, in terms of 𝑣in (𝑡), 𝑅, and 𝐶.

Figure 3.1.1: Single-stage RC circuit.

Now suppose the input signal 𝑣in (𝑡) has been zero for a long time, and then is changed to 𝑉𝑜 , a positive
constant, at time 𝑡 = 0. The input signal is then a step function, which means:
0, 𝑡 < 0
𝑣in (𝑡) = 𝑉𝑜 𝑢(𝑡) = {
𝑉𝑜 , 𝑡 ≥ 0
The initial condition for 𝑣out (𝑡) is needed to solve the differential equation. The output voltage should be
zero when 𝑡 < 0, since there is no input until 𝑡 = 0. Thus, the initial condition for 𝑣out (𝑡) is 𝑣out (0) = 0.

Prelab #2:
Derive 𝑣out (𝑡) for 𝑡 ≥ 0 in terms of 𝑉𝑜 , 𝑅, and 𝐶.

Download Lab1_Prelab.m and lab1plot.m from the Canvas webpage, making sure they are in the same
folder on your computer. Suppose 𝑉o = 5V, 𝑅 = 10kΩ, and 𝐶 = 0.01µF.

Prelab #3:
Using the given Matlab scripts, plot 𝑣in (𝑡) and 𝑣out (𝑡) on the same set of axes.

To do this, open Lab1_Prelab.m using Matlab (there is no need to open the other file) and read the
developer comments about how to use the lab1plot function. Run the script, select “Change Folder” if the
warning appears, and the plot for Prelab #3 should appear. You are not expected to know how to use Matlab
in this course, so feel free to ask the TA for assistance if you have difficulty using the script.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 2 of 11


3.1.2 Discharging RC Circuit
You have now analyzed the RC circuit’s step response, and you also have a general idea of what this
response looks like by plotting it with the input voltage. Now suppose the input signal has been 𝑉𝑜 , a positive
constant, for a long time before being changed to zero at 𝑡 = 0, which means

𝑉𝑜 , 𝑡 < 0
𝑣in (𝑡) = 𝑉𝑜 𝑢(−𝑡) = {
0, 𝑡 ≥ 0

Prelab #4:
Find the initial condition for 𝑣𝑜𝑢𝑡 (𝑡), then find 𝑣𝑜𝑢𝑡 (𝑡) for 𝑡 ≥ 0 in terms of 𝑉𝑜 , 𝑅, and 𝐶.

Prelab #5:
Using the given Matlab scripts, plot 𝑣in (𝑡) and 𝑣out (𝑡) on the same set of axes.

3.1.3 Square Wave Input


If the input signal is turned on and off periodically then it becomes a square wave. Suppose the period of
this square wave is 𝑇, and its duty cycle (the ratio of how long the square wave is on vs. how long it’s off)
is 50%. If half of the period, 𝑇/2 ≫ 𝑅𝐶 then the output voltage goes to its limit before the input changes.

Example: 𝑉𝑜𝑢𝑡 (T/2)−𝑉𝑜𝑢𝑡 (0) 𝑉0 exp(−5)


If 𝑇 = 10𝑅𝐶, the ratio = = 0.67% < 1%. So the
𝑉0 𝑉0
change of output voltage is almost equal to the change of the input voltage, and
it means the output voltage is close to its limit.
Refer to Reference 5.1 to answer Prelab #6.

Prelab #6:
Find the time constant, rise time, fall time, and both delay times for the RC circuit in terms of 𝑅 and
𝐶. Then replace 𝑅 and 𝐶 with their numeric values from Section 3.1.1. How long does the period 𝑇
need to be for the output to be within 1% of its final value?

When deriving the expressions, notice that these timing parameters are independent of the input voltage.

Prelab #7:
Suppose the period of the turning switch is 𝑇 = 4ms. Using the given Matlab scripts, plot the input
and output voltages 𝑣in (𝑡) and 𝑣out (𝑡) over two periods.

3.1.4 Multiple-stage RC Circuits


Refer to Reference 5.2 Elmore Delay Estimation to answer Prelab #8.

Prelab #8:
Calculate the delay time for the circuit in Figure 3.1.1, Figure 3.1.2, and Figure 3.1.3 (located on the
next page), in terms of 𝑅 and 𝐶. Assume 𝑅 = 𝑅1 = 𝑅2 = 𝑅3 and 𝐶 = 𝐶1 = 𝐶2 = 𝐶3 .

EE 233 Lab 1: RC Circuits Laboratory Manual Page 3 of 11


Figure 3.1.2: Two-stage RC circuit.

Figure 3.1.3: Three-stage RC circuit.

3.2 The RC Response to a Sinusoidal Input


3.2.1 Time-domain RC Response
While the input square wave changes the magnitude of the signal, exploration of the RC response to an AC
signal can show more interesting characteristics of the RC circuit. Looking back on Figure 3.1.1, the single-
stage RC circuit, suppose we are using a sinusoidal wave as an input signal, 𝑣in (𝑡) = 𝑉𝑜 cos(𝜔𝑡), where
𝜔 is the angular frequency of the signal.

Prelab #9:
Derive the new differential equation for 𝑣out (𝑡) in Figure 3.1.1, in terms of 𝑉𝑜 , 𝜔, 𝑅, and 𝐶.

This differential equation is the fundamental equation describing the RC circuit system. The solution for
the steady-state output voltage is
𝑉𝑜
𝑣out (𝑡) = [cos(𝜔𝑡) + 𝑅𝐶𝜔sin(𝜔𝑡)]
1 + 𝑅2 𝐶 2𝜔 2
This solution shows that 𝑣out (𝑡) is a function of the signal’s frequency 𝑓 and time 𝑡. The relationship
between angular frequency 𝜔 and signal frequency 𝑓 is 𝜔 = 2𝜋𝑓.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 4 of 11


Suppose 𝑉𝑜 = 1V (notice it’s different), 𝑓 = 1kHz, 𝑅 = 10kΩ, and 𝐶 = 0.01µF.

Prelab #10:
Using the given Matlab scripts, plot 𝑣out (𝑡) from 0 to 5ms. Is the output signal a sinusoidal function?
If so, what is the period 𝑇 and the magnitude |𝑣out (𝑡)|?

3.2.2 Frequency-domain RC Response


Now consider the solution for 𝑣out (𝑡) with the signal’s frequency 𝑓 being the independent variable. The
output voltage is a sinusoidal wave with the same frequency as the input voltage, and its magnitude is given
by
𝑉o
|𝑉out (𝑓)| =
√1 + 4𝜋 2 𝑅2 𝐶 2 𝑓 2

Suppose 𝑉𝑜 = 1V, 𝑅 = 10kΩ, and 𝐶 = 0.01µF.

Prelab #11:
Using the given Matlab scripts, plot the magnitude of the output voltage, |𝑉out (𝑓)|, versus frequency.
Comment on the output signal’s characteristics at very low frequencies, e.g. 10Hz, and at very high
frequencies, e.g. 1MHz. Read Reference 5.3 for more information.

Notice that the frequency-domain plot’s x-axis is logarithmic, that is, each division is 10 times greater than
the previous. This frequency-domain plot will become very important in subsequent labs, where you will
use it to design filters for your audio mixer.
Now consider another RC system in Figure 3.2.1,
in which the output voltage is over the resistor,
rather than the capacitor.
The output voltage is now the input signal minus
the voltage over the capacitor, and its magnitude is
given by
2𝜋𝑉o 𝑅𝐶𝑓
|𝑉out (𝑓)| =
√1 + 4𝜋 2 𝑅2 𝐶 2 𝑓 2
Figure 3.2.1: An RC circuit with the output over the resistor.
Suppose 𝑉𝑜 = 1V, 𝑅 = 10kΩ, and 𝐶 = 0.01µF.

Prelab #12:
Using the given Matlab scripts, plot the magnitude of the output voltage, |𝑉out (𝑓)|, versus frequency.
Comment on the output signal’s characteristics at very low frequencies, e.g. 1Hz, and at very high
frequencies, e.g. 1MHz. In what way(s) does this output behave differently than the one over the
capacitor? Explain.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 5 of 11


4 Experimental Procedure and Data Analysis
4.1 The RC Response to a DC Input
4.1.1 Square Wave Input Analysis
Build the circuit in Figure 4.1.1 and set the
function generator to provide a square wave input
as follows:
a) The period 𝑇 ≥ 4ms (to ensure that 𝑇 ≫ 𝑅𝐶).
This value of T guarantees that the output signal
has sufficient time to reach a final value before
the next input transition. Record your value of
T. Figure 4.1.1: RC circuit for lab experiment.
b) The minimum voltage is 0V and maximum
voltage is 5V. Note that you may need to manually set the offset to achieve this waveform. Use the
oscilloscope to display this waveform on Channel 1 to verify that the amplitude is correct. We use these
amplitudes since it they are common in computer systems (false = 0V, true = 5V).
Use Channel 2 of the oscilloscope to display the output voltage over the capacitor. Adjust the time base to
display 3 complete cycles of the signals. Capture the output from the scope display with both the waveforms
and the measured values. Turn this oscilloscope waveform in as part of your lab report.

Analysis #1:
Does the oscilloscope display the same waveform that you plotted in Prelab #7? Explain any
similarities or differences.

Using the oscilloscope’s Cursor menu, record the period T of the input signal, as well as the maximum and
minimum values of the output signal. Then measure the time value of the 10% point of 𝑉out, the time value
of the 90% point of 𝑉out , and the time value of the 50% point of 𝑉out.
Note: Instructions for using the lab equipment are found in Lab Equipment.pdf, on the Canvas webpage.

Analysis #2:
Calculate the rise time, fall time, and delay time of the RC circuit using the values from the
oscilloscope, then compare them with the theoretical values from your Prelab using percent
error. Explain the likely sources of errors leading to any differences.

Percent error is defined as:


|actual value − theoretical value|
PE = × 100%
theoretical value
Now clear all the oscilloscope measurements. Use the measurement capability of the oscilloscope to
measure the rise time of 𝑣out (𝑡), the fall time of 𝑣out (𝑡), and the two delay times 𝑡𝑃𝐻𝐿 and 𝑡𝑃𝐿𝐻 .

EE 233 Lab 1: RC Circuits Laboratory Manual Page 6 of 11


Analysis #3:
Compare the measured data with the theoretical values, as well as the measurements in Analysis #2,
using percent error. Explain the likely sources of errors leading to any differences.

4.1.2 Time Constant Measurement


The time constant 𝜏 = 𝑅𝐶 is one of the most important characteristics of RC circuit, and its value can be
extracted from measured data.
To measure the time constant 𝜏, use the oscilloscope’s Cursor menu to measure the voltage and time values
at 10 points on the 𝑣out waveform during one interval when 𝑣out either rises or falls with time (pick one
interval only). Note that the time values should be referred to time 𝑡 = 0 at the point where the input signal
rises from 0V to 5V or falls from 5V to 0V. Record the 10 measurements.

Analysis #4:
Plot the 10 measurements in Excel, then make the x-axis (time) logarithmic. The experimental time
constant 𝜏 is the inverse of the slope of this now-linear graph. Compare this 𝜏 with theoretical value
𝜏 = 𝑅𝐶 using percent error. Explain the likely sources of errors leading to any differences.

Explanation: Consider the ratio of |𝑣𝑜𝑢𝑡 − 𝑣𝑖𝑛 | and high voltage 𝑉0 . It is


|𝑣𝑜𝑢𝑡 (𝑡) − 𝑣𝑖𝑛 | 𝑡
Ratio(𝑡) = = 𝑒 −𝜏
|𝑉0 |
and it can be calculated by measured data. So the function ln(Ratio(𝑡)) is linear
1
according to time, and the slope is − 𝜏. Read Reference 5.4 for more information.
Now build two-stage and three-stage RC circuits and measure time constant 𝜏two−stage and 𝜏three−stage
using the same methods as the single stage circuit analysis. Record all your measurements.

Analysis #5:
Compare the measured values of the time constant with the theoretical values using percent error.
Are they the same values? Explain the likely sources of errors leading to any differences.

4.2 The RC Response to a Sinusoidal Input


Rebuild the circuit in Figure 4.1.1 and set the function generator to provide a sinusoidal input with:
a) An amplitude of 1V, which means 𝑉pk−pk = 2V

b) A frequency of 1kHz.
Connect Channel 1 to the input voltage and Channel 2 to the voltage over the capacitor as the output.
Display the input and output voltages simultaneously on the oscilloscope in 3 complete cycles. Capture the
output from the scope display with both the waveforms and the measured values. Turn this oscilloscope
waveform in as part of your lab report.
Now measure the RC response to sinusoidal signals with various frequencies. Keep the input amplitude at
1V, but sweep the frequency from the starting input frequency of 10Hz, varying it using a 1-2-5 sequence

EE 233 Lab 1: RC Circuits Laboratory Manual Page 7 of 11


up to 1MHz (i.e. set input frequency to 10Hz, 20Hz, 50Hz, 100Hz, 200Hz … up to 1MHz). Record the
amplitudes of the output signals.

Analysis #6:
Using Microsoft Excel, plot the amplitude of the output voltage in terms of frequency. Make sure the
frequency is plotted on a log scale. Compare it to what was plotted in Prelab #11. Explain the likely
sources of errors leading to any differences.

Once done, switch the locations of the resistor and capacitor and change the output to be the voltage over
the resistor. Set the function generator to provide a sinusoidal wave input with 1V amplitude. As before,
sweep the frequency starting from 10Hz using the 1-2-5 sequence up to 1MHz. Record the amplitudes of
the output signals.

Analysis #7:
Using Microsoft Excel, plot the amplitude of the output voltage in terms of frequency. Make sure the
frequency is plotted on a log scale. Compare it to what was plotted in Prelab #12. Explain the likely
sources of errors leading to any differences.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 8 of 11


5 Reference Material
5.1 RC Step Response and Timing Parameters
The step response of a simple RC circuit, illustrated in Figure 5.1.1, is an exponential signal with time
constant 𝜏 = 𝑅𝐶. Besides this timing parameter, four other timing parameters are important in describing
how fast or how slow an RC circuit responds to a step input. These timing parameters are marked in Figure
5.1.1, as three voltage levels:
a) The 10%-point is the point at which the output voltage is 10% of the maximum output voltage.
b) The 50%-point is the point at which the output voltage is 50% of the maximum output voltage.
c) The 90%-point is the point at which the output voltage is 90% of the maximum output voltage.

Figure 5.1.1: Timing parameters of signal waveforms.

The three timing parameters are defined as follows:


a) Rise time: the time interval between the 10%-point and the 90%-point of the waveform when the signal
makes the transition from low voltage (L) to high voltage (H). Notation: 𝑡𝑟 .
b) Fall time: the time interval between the 90%-point and the 10%-point of the waveform when the signal
makes the transition from high voltage (H) to low voltage (L). Notation: 𝑡𝑓 .

c) Delay time (or propagation delay time): the time interval between the 50%-point of the input signal and
the 50%-point of the output signal when both signals make a transition. There are two delay times depending
on whether the output signal is going from L to H (delay notation 𝑡𝑃𝐿𝐻 ) or from H to L (delay notation
𝑡𝑃𝐻𝐿 ). The subscript P stands for “propagation.”

EE 233 Lab 1: RC Circuits Laboratory Manual Page 9 of 11


Note that the rise time and the fall time are defined using a single waveform (the output waveform), while
the delay time is defined between two waveforms: the input waveform and the corresponding output
waveform.

5.2 Elmore Delay Estimation


Figure 5.2.1 depicts a multi-element configuration. The resistor 𝑅1 in this figure charges all 𝑁 capacitors
downstream of its own position. The Elmore estimated delay 𝜏1 from point 𝑥0 to 𝑥1 is therefore
𝑁

𝜏1 = 𝑅1 ∑ 𝐶𝑚
𝑚=1

Resistor 𝑅2 charges only capacitors numbered 2 through 𝑁, so the estimated delay from point 𝑥1 to 𝑥2 is
𝑁

𝜏2 = 𝑅2 ∑ 𝐶𝑚
𝑚=2

Working down the row, the total delay for the whole circuit is then estimated as:
𝑁 𝑁

𝜏 = ∑ 𝑅𝑛 ∑ 𝐶𝑚
𝑛=1 𝑚=𝑛

Figure 5.2.1: N-stage RC circuit delay estimation.

5.3 Frequency Response of a Circuit System


An analog circuit system has different responses for sine waves with different frequencies. The magnitude
of the output voltage always changes in terms of frequencies if the magnitude of the input sine wave stays
the same. Therefore, the frequency response is the quantitative measure to characterize the system.
Since any input signal can be regarded as the sum of a set of sinusoidal waves, the output signal will have
different responses to input waves with the set of frequencies. If the circuit has high magnitude for low
frequencies, and close to zero magnitude for high frequencies, the high frequencies will be removed by the
circuit in the output signal, and vice versa.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 10 of 11


The frequency response is one of the main characteristics of the system, and you will explore methods of
analyzing the frequency response in the following labs.

5.4 Parameter Extraction via Linear Least-Squares-Fit Technique


The important parameters of 𝑉out (𝑡) are the maximum amplitude and the time constant 𝜏. The maximum
amplitude is easily measured by using the oscilloscope. Measuring the time constant directly and accurately
is more difficult, since the waveform is an exponential function of time. A linear least-squares-fit procedure
can be used in the lab to extract the time constant from measured voltage and time values as follows.
The equation for 𝑉out (𝑡) during the time interval when 𝑉out (𝑡) falls with time, which you can write based
on what you learned in prerequisite courses, can be manipulated to provide a linear function in terms of the
time 𝑡. The slope of this line is then used to extract the time constant 𝜏.
Alternatively, the equation for 𝑉out (𝑡) during the time interval when 𝑉out (𝑡) rises with time can also be
manipulated to provide a linear function in terms of the time 𝑡. The slope of this line is then used to extract
the time constant 𝜏.
In the lab, you will measure a set of data points (𝑡, 𝑉out ). These values, after the appropriate manipulation
as above, can be used to plot a straight line, whose slope is a function of 𝜏. You can use any procedure or a
calculator to plot and extract the slop. The slope value will then be used to calculate the time constant 𝜏.
Make sure you understand this procedure and be ready to use it in the lab. Note that the more points you
measure, the more accurate the extracted value for 𝜏.

EE 233 Lab 1: RC Circuits Laboratory Manual Page 11 of 11

You might also like