MAE 2055: Mechetronics I Mechanical and Aerospace Engineering Lab Exercise #6 Name Partner 1 Partner 2 Partner 3 Objectives – Derive and plot the frequency response – magnitude and phase vs. frequency – of an RC filter circuit. Build the circuit in the lab, and measure it’s response to sinusoidal signals of various frequencies, comparing the measured magnitude and phase of the output signal to what was predicted by your analysis. Pre-lab – complete prior to coming to lab You are familiar with resistive voltage divider circuits, such as the one shown here. For this circuit, the output voltage is 𝑣𝑜 = 𝑣𝑠 𝑅2 𝑅1 + 𝑅2 If the input is a sinusoidal signal, 𝑣𝑠 (𝑡) = 𝐴𝑠 cos(𝜔𝑡), then the output will be a sinusoidal signal as well: 𝑣𝑜 (𝑡) = 𝐴𝑠 𝑅2 cos(𝜔𝑡) 𝑅1 + 𝑅2 The amplitude of the output signal has been scaled by the resistive divider ratio, and the phase of the input and output signals are equal; that is, there is no phase shift from the input to the output. We can define a ratio of the output signal to the input signal, which we will refer to as the circuit transfer function 𝐻≡ 𝑜𝑢𝑡𝑝𝑢𝑡 𝑣𝑜 = 𝑣𝑠 𝑖𝑛𝑝𝑢𝑡 For this resistive circuit, H is a real number that describes how the amplitude of the input signal is scaled to the amplitude of the output signal: 𝐻 = 𝑅2 . 𝑅1 +𝑅2 The voltage divider concept can be extended to accommodate circuits with arbitrary impedances – not only resistive impedances. That is, R1 and R2 in the circuit above can be replaced with Z1 and Z2, which, in general, can each have resistive (real) and reactive (imaginary) components. Because Z1 and Z2 may be at least partially reactive, they will, in general, be functions of Z1(ω) vs vo frequency, and we can refer to them as Z1(ω) and Z2(ω). The resulting transfer function will therefore be a function of vs frequency as well: Z2(ω) 𝐻(𝜔) = 𝑍2 (𝜔) 𝑍1 (𝜔) + 𝑍2 (𝜔) MAE2055 Mechetronics I Lab Exercise #6 Now, the transfer function, H(ω), will, in general, be a complex value that varies as a function of frequency. Since it is a complex value it may have both a real and an imaginary part, and can be represented in polar form by its magnitude and phase. The transfer function magnitude at a particular frequency, ω, is the ratio of the output to input amplitudes for a sinusoid of frequency ω. The transfer function phase at a particular frequency, ω, is the phase shift from the input to the output when the input is a sinusoidal signal of frequency ω. For example, let’s say the transfer function of a particular circuit, when evaluated at a frequency of 1MHz, ω=2π∙1x106, is 𝐻(2𝜋 ∙ 106 ) = 0.5∠ − 45° That is, the complex transfer function value at 1MHz has a magnitude of 0.5 and a phase angle of -45°. This tells us that when the input is a 1MHz sinusoidal signal, the ratio of the output amplitude to the input amplitude is 0.5, and there is a -45°, or –𝜋/4 radian, phase shift from the input to the output. So, if the input is 𝑣𝑖 (𝑡) = 1𝑉 ∙ 𝑐𝑜𝑠(2𝜋 ∙ 106 𝑡) then the output will be 𝜋 𝑣𝑜 (𝑡) = 500𝑚𝑉 ∙ 𝑐𝑜𝑠 �2𝜋 ∙ 106 𝑡 − � 4 A circuit whose transfer function varies as a function of frequency may be referred to as a filter, because of its ability to remove or filter out unwanted signals. Imagine, for example, a circuit whose transfer function magnitude is unity at low frequencies, but then decreases toward zero at high frequencies. For a 1V sinusoidal input, the output of that circuit would be a 1V sinusoid at low frequencies, but would decrease toward zero at high frequencies. Such a circuit is referred to as a low-pass filter because it allows low frequency signals to pass through to the output, but filters out high frequency signals. For this lab, you will be analyzing, and then building and measuring, the RC filter circuit shown below. This circuit has two impedances. One is purely resistive, and therefore purely real-valued, 𝑍1 (𝜔) = 𝑅 = 1𝐾Ω. This resistive impedance obviously does not vary as a function of frequency. The other impedance is purely reactive, and therefore purely imaginary, 𝑍2 (𝜔) = R vo 1 KΩ vs C 100 nF 1 . 𝑗𝜔𝐶 This capacitive impedance does vary with frequency, so the overall, complex-valued, transfer function of the circuit will vary in both magnitude and phase as a function of frequency. -2- MAE2055 Mechetronics I Lab Exercise #6 1) Derive the transfer function, H(ω), for the RC circuit shown above. Remember, this transfer function will be a complex-valued function of frequency, whose magnitude describes the ratio of output to input amplitudes, and whose phase describes the phase shift of the output signal relative to the input signal. 2) Using MATLAB, plot the magnitude, |H(ω)|, and phase, ∠H(ω), of the transfer function vs. frequency over a range of 1 Hz to 1 MHz (100 Hz to 106 Hz). Plot |H(ω)| with log scales on both axes. Plot ∠H(ω) with a log frequency scale and a linear vertical scale. The units of the vertical scale should be degrees. Arrange both plots in separate subplots, with magnitude on top and phase angle on the bottom. The frequency axis should have units of Hz. Turn the grid on for each plot (MATLAB command is ‘grid on’). As always, be sure to include axis labels and titles. What you have plotted is referred to as the frequency response of the circuit. A frequency response can be used to characterize any type of dynamic system – not just electrical circuits, but mechanical systems as well. Print out your plots and bring them to the lab. In the lab you’ll be building the RC circuit, applying input sinusoids of various frequencies, and measuring the amplitude and phase shift of the output signal. You’ll record these measured values directly on the plots you have generated analytically to compare the measured and expected values. 3) Calculate the magnitude and phase of the circuit’s transfer function, H(ω), at three frequencies: 𝜔 = 0, 𝜔 = 1 , 𝑅𝐶 and as 𝜔 → ∞. Fill in these values in the table below. What is the frequency, fc, when ω = 𝜔 𝑓𝑐 = 2𝜋𝑐 = 1 2𝜋𝑅𝐶 = 1 ? 𝑅𝐶 -3- MAE2055 Mechetronics I Lab Exercise #6 This frequency is known as the corner frequency (hence the designation as ωc or fc) or the break frequency. Look at the value of |H(ωc)|, the transfer function magnitude at the corner frequency, on your plot, and see if you can understand the significance of this frequency. Frequency |H(ω)| f→0 1 ∠H(ω) f = 2𝜋𝑅𝐶 f→∞ Read through the remainder of this document before coming to the lab. ------------------------------------------ End of the pre-lab ------------------------------------------ Have your instructor initial here to verify completion of the pre-lab. -4- MAE2055 Mechetronics I Lab Exercise #6 ---------------------------------- To be completed in the lab ---------------------------------- R vo 1 KΩ vs C 100 nF 4) Build the RC filter circuit on your breadboard • • • Connect the function generator to your circuit and set it to output a sinusoid with amplitude of 1V. Probe the source voltage, 𝑣𝑠 (𝑡), with the oscilloscope channel 1. Probe the output voltage, 𝑣𝑜 (𝑡), with the oscilloscope channel 2. 5) While triggering on 𝑣𝑠 (𝑡) and viewing both signals on screen, sweep the frequency of the input signal from very low frequency (e.g., 10 Hz) to higher frequency (e.g., 1 MHz). Observe the behavior of the output signal, 𝑣𝑜 (𝑡). Describe what happens to the amplitude of 𝑣𝑜 (𝑡) as the input frequency increases from low frequency to higher frequency. Describe what happens to the phase shift between the input and the output signals as you sweep the frequency from low to high. Does this behavior agree with what your frequency response plots predict? -5- MAE2055 Mechetronics I Lab Exercise #6 6) You will now use the scope’s automated measurements to measure the magnitude, |H(ω)|, and phase, ∠H(ω), of the circuit’s transfer function at five different frequencies. That is, you should measure the ratio of the amplitudes of the output and input signals, as well as the phase difference between those two signals. To measure the phase shift between the input and the output, you can use the scope’s automated measurements to measure the time delay between the two signals. Time delay can be converted to phase using the following formula. 𝜙 = −𝑡𝑑 ∙ 𝑓 ∙ 360° where 𝜙 is the phase angle in degrees, 𝑡𝑑 is the time delay between the two signals, and 𝑓 is the frequency of the signals in Hz. Take one measurement at the corner frequency, 𝑓𝑐 = 𝜔 2𝜋 = 1 , 2𝜋𝑅𝐶 two measurements at 𝑓 < 𝑓𝑐 , and two measurements at 𝑓 > 𝑓𝑐 . Fill the values into the following table and mark the magnitude and phase values directly on your MATLAB plots. Frequency Amplitude of 𝒗𝒔 Amplitude of 𝒗𝒐 |H(ω)| 𝒕𝒅 ∠H(ω) 𝑓𝑐 = The measured values should agree reasonably well with the predicted values. If they don’t, try to figure out the reason for the discrepancy. 7) Play around with different types of input signals (e.g., square wave, triangle wave) of various frequencies. See if you can understand why the output behaves the way it does for different types of signals. -6-