Overview¶
Introduction¶
These experiments will continue using a FeelTech FY3200S signal generator and a Tektronix TBS 1072B-EDU digital oscilloscope to measure the waveforms connected to resistor, incductor, and capacitor circuits.
Part 1 of this lab is to measure and compare to a theoretical model the gain and phase of multistage RC circuits as shown in Figure 1.
Figure 1:A multistage RC circuit.
Part 2 of this lab is to measure and compare to a theoretical model the gain, phase, and resonance of RLC circuits like the one shown in Figure 2.
Figure 2:A RLC oscillator circuit.
Experiment¶
Part 1 - Theory of Multistage RC Circuits¶
We saw in the RC lab that the impedance of an RC circuit is
In this lab we will use two different resistor/capacitor values for each stage, and we want the cross-over frequency () to be the same for each stage to keep our analysis simple. We also want the first stage to define the current. To do this we choose or . Since , we will need to choose capacitors accordingly. More details are in the Measurements section.
In general, each loop’s current can be written
For simplicity, let’s assume we can separate each stage for analysis. See Figure 3. This shows that the voltage across is the input voltage to the second stage.
Figure 3:A separated multistage RC circuit.
According to Ohm’s Law, the voltage across the resistor is
Similarly, for R2
We are interested in how the output relates to the input of the circuit. We can define a ratio of the output voltage to the input voltage.
This is a complex function, and in the real world we can only measure real values. Therefore, we need to calculate the gain of the circuit by calculating the magnitude of this complex function.
When calculating the magnitude of a complex function, we complex square it and take the square root. First, the two terms need to be written in the form
Then, the magnitude is
After some algebra, you should find
The phase for this circuit can be expressed as
Part 1 - Measurements¶
As observed in Part 3 - Signal Integrity, the function generators work well from 1 Hz to 10 MHz. Choose the cross-over frequency such that it will be in the middle of this range on a log-scale. That is, choose components such that
and
Set up your circuit and measure the gain and phase as a function of frequency
import matplotlib.pyplot as plt
import numpy as np
# theoretical data
omega = np.linspace(0,100000, 100001)
R1 = 1000
R2 = 10000
C1 = 1e-7 #100 nF
C2 = 1e-8 #1nF
print(1/R1/C1, 1/R2/C2)
gain_theory = omega*R1*C1/np.sqrt(1+(omega*R1*C1)**2) * omega*R2*C2/np.sqrt(1+(omega*R2*C2)**2)
phase_theory = np.atan(1/(omega*R1*C1)) + np.atan(1/(omega*R2*C2))
# experimental data
omega_exp = np.array([])
gain_exp = np.array([])
phase_exp = np.array([])
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
ax1.semilogx(omega, gain_theory, '-k', label='Theoretical Gain')
ax1.semilogx(omega_exp, gain_exp, 'ob', label='Experimental Gain')
ax1.set_ylabel('Theoretical Gain')
ax1.legend()
ax2.semilogx(omega, phase_theory, '-k', label='Theoretical Phase')
ax2.semilogx(omega_exp, phase_exp, 'ob', label='Experimental Phase')
ax2.set_ylabel(r'Phase, $\phi$ (rad)')
ax2.legend()
plt.xlabel(r'log($\omega$)')
plt.show()
Part 2 - Theory of RLC Circuits¶
Inductors are a circuit component you likely have not encountered. It is essentially a coil of wire with a magnetic core to enhance its strength. See .
Figure 4:The makeup of an inductor includes a wire coil wrapped around a core material. (a) A solenoidal type inductor. (b) A toroidal type inductor.
A voltage applied across an inductor creates a magnetic field along the inductor. The strength of the field or magnetic flux is related to the voltage, cross-sectional area, length, and number of turns.
We define inductance, , as
Where Φ is the magnetic flux and is the current through the coil. The relationship for an inductor that is similar to Ohm’s Law comes from Faraday’s Law of Induction
This equation says that changes in current through an inductor cause a counter emf (). It should be immediately obvious that the voltage and current will be phase-shifted for an AC signal in an inductor circuit. The impedance of an inductor can be found similarly to what we did with capacitors. Assume we have a sinusoidal current.
Thus, the inductor equivalent of Ohm’s Law gives a maximum impedance of
In this lab, we will look at an RLC circuit that acts like an electronic damped oscillator. To analyze this circuit Figure 2, we consider Kirchoff’s voltage law
To put this in terms of a common variable () we differentiate with respect to time to obtain
This is a second order differential equation that applies to any driven harmonic oscillator, where the left hand side is the driving “force” and the right hand side is the dissipative (), accelerative (), and restoring () “force” terms. I use quotes because this is not a force equation, but there is an analogous force equation for a spring mass system. We can guess a solution of the form
where ϕ is a phase that may be caused by differences in voltage and current like we saw with capacitors. Plugging this solution into the differential equation and doing some algebra, we obtain
The time dependent functions are orthogonal to one another, i.e., the integral of their product over all space is zero. This means the only way for the above equation to be true is if the coefficients are equal to zero. We will assume .
From the first equation, we obtain the phase
, , and are fixed from the components used. The frequency will always be greater than 1. As ω increases, the dominant term changes as shown in Figure 5. This cross-over point changes the phase from negative to positive, i.e., a lead to a lag in the current.
Figure 5:A log-plot of the two terms on the right hand side of the RLC phase equation with .
Figure 6:A semilog plot of the phase vs. log(ω). The crossing point of the argument creates a plateau in the phase as the phase goes from current leading the input voltage to the current lagging the input voltage.
From the second equation, we obtain the amplitude of the current.
Consider the impedance triangle shown in Figure 7.
Figure 7:Impedance triangle for RLC circuit.
Based on the triangle we can rewrite the current using the magnitude of the impedance.
The denominator happens to be the magnitude of the complex impedance
and therefore, the current is simply voltage divided by impedance, very similar to Ohm’s Law for a series circuit. A graph of the current vs. log() is shown in Figure 8.
Figure 8:Plot of the current flowing through the RLC circuit as a function of input frequency. Parameters are defined in and V. A broad resonance is observed from about rad/s.
All driven oscillators will display resonance when driven at the resonant frequency. The resonant frequency for an RLC circuit is
The resistor dissipates energy in the circuit making the circuit a damped oscillator. The damping coefficient is
A final parameter describing an oscillator is its quality factor. The quality factor is ratio of energy stored to energy dissipated over one cycle of the AC input. The higher the quality factor the sharper the resonance. For an RLC series circuit, the quality factor is described as
As an example, the quality factor for Figure 8 is
Figure 9 shows how changing the resistor by a factor of 100 affects the quality factor.
Figure 9:Plot of the current flowing through the RLC circuit as a function of input frequency Parameters are defined in and V. The resistance is changed for comparison of quality factor from 1000 Ω to 10 Ω.
A graphical way to think about the quality factor is the frequency of the resonance divided by the width of the resonance.
An example of estimating this from a graph would be to observe that the center resonance of the circuit is at . The width of the resonance, which is calculated at . Therefore, . See Figure 10 where the width is shown by a horizontal arrow at the appropriate height on the graph.
Figure 10:Plot of the current flowing through the RLC circuit as a function of input frequency Parameters are defined in Figure 5 and . The width of the resonance is shown as a horizontal black arrow.
Part 2 - Measurements¶
Set up the circuit shown in Figure 2. Use values of , , and such that the resonant frequency is . You will be using a inductor because that’s what we have. Using a signal generator with a 10 Volt peak-to-peak sine wave and oscilloscope measure the phase and current as a function of frequency. You will need to split the input signal so that you can connect a BNC to BNC for phase measurements. Note: You will measure current on the oscilloscope as .
Put a smaller resistor of approximately 10 Ω. Change the input to a square wave and see if you can find the damped oscillations on the oscilloscope. It is interesting that a square wave which is a +/- DC signal would create a sinusoidal response. That is the resonant oscillator in action. Damped oscillations look like the signal in Figure 11.
Figure 11:A plot of the damped oscillating output signal.
#code for exercise 5