Monday, May 18, 2015

Inverting Voltage Amplifier and OP Amp Relaxation Oscillator

Inverting Voltage Amplifier

In this lab we wired the inverting voltage amplifier with a capacitor in parallel with the feedback resistor. The measured values for the capacitor and resistors are shown in the diagram. Our goal is to calculate the theoretical gain and change in phase angles when we apply a 2 V sinusoidal input and vary the frequency from 100 Hz, to 1 kHz, to 5 kHz.

The theoretical value for gain is calculated as 1/sqrt(ω^2*C^2*R^2+1), where ω is the angular frequency, C is the capacitance and R is the resistance. It's important to note that the input and feedback resistors are the same value in this experiment. The theoretical phase angle is calculated as ϴ = arctan(ωCR). We calculate all of these values prior to taking experimental data. These values are then compared directly with the experimental values with a percent error for accuracy analysis. They can be seen on the last picture of this lab.

Here we see our circuit wired up on the breadboard with oscilloscope probes that will measure the input voltage signal and the output voltage signal. We now apply a 2 V sine wave at the three frequencies mentioned and obtained the following graphs.

The experimental phase shift is calculated as the change in time between a set of current-voltage peaks divided by the period. This is then multiplied by 360 to change to degrees. Phase shift = ϴ =(Δt/T)*360 or more simply, ϴ = Δt*f*360, where f is the frequency. Two pictures were taken at each frequency to capture the current and voltage peak times (necessary to find Δt). The experimental gain is given by the ratio of the output voltage to the input voltage, G = V0/Vi. This is easily taken from the measurements window on the oscilloscope and is the blue curve amplitude divided by the orange curve amplitude or (C2/C1).


 2 V Sinusoid @ 100 Hz




 2 V Sinusoid @ 1 kHz


 2 V Sinusoid @ 5 kHz


Here we see a direct comparison between our theoretical and experimental gain and phase shift angles. The percent errors (PE%) are also shown on the table. We see that the percent error is acceptable for the most part. As a relatively quick experiment, we are pleased with our results.

Phasors: Passive RL Circuit Response

Phasors: Passive RL Circuit Response

In this lab, we wire the series RL circuit seen in the picture above. The circuit is treated as a system where a voltage is input and the resulting current is output. The system amplifies a sinusoidal input by a gain of I/V where the output is another sinusoidal wave with a phase shift of different amplitude. The experiment calls for a 47 Ω resistor in series with a 1 mH inductor. The cutoff frequency is calculated as ωc = R/L = 47 Ω/1 mH = 47000 rad/s. The linear frequency can be easily calculated by dividing by 2ᴨ, f = ωc/2ᴨ = 7.48 kHz. We repeat the calculation for 10ωc and ωc/10 and obtain 74.80 kHz and 748.03 Hz, respectively.
Now the theoretical gain is calculated by dividing the magnitude of the current and voltage phasors, G = |I/V| = |1/(R+jωL)| = 1/sqrt(R^2+ω^2*L^2). This is done for the three angular frequencies ωc, 10ωc, and ωc/10.
Finally, the phase shift is calculated as φ = -arctan(ωL/L). This is also done for all three frequencies. We obtain the following data.


We now test the circuit experimentally using a resistor R = 47.3 Ω (measured) and an inductor L = 0.998 mH. The input voltage is observed along with the oscilloscope along with the calculated current and inductor voltage. The current channel is calculated as i(t) = [vi(t) - vl (t)]/ R. The orange curve (C1) is the input voltage, the blue curve (C2) is the inductor voltage, and the black curve (M1) is the calculated current. We measure current to voltage, peak to peak to find the phase angle by measuring the change in time divided by the period then converting to degrees, φ = (Δt/T)*360°. The gain is then calculated by dividing the current amplitude by the input voltage amplitude, G = I/V.


1 V input @ 7.48 kHz


1 V input @ 74.8 kHz


 1 V input @ 748 Hz


The experimental data is now compared to the calculated theoretical data. The percent error for gain and phase shift of the experiment is very acceptable. This means the experiment was accurate.

Monday, May 11, 2015

Impedance

Impendance

In this lab, we find the impedance of three circuit elements, a resistor, inductor, and capacitor. The circuits are wired according to the diagrams drawn above. The impedance for the three circuit elements can be simply calculated with the use of formulas. The impedance of a resistor is just Z = R, so the impedance is really just the resistance of the resistor. For a capacitor, the impedance can be calculated as Z = 1/(jωC) , where j is the imaginary component, ω is the angular velocity of the input, and C is the capacitance of the capacitor. The impedance of an inductor is Z = jωL, where L is the inductance of the inductor. The phase angles for a resistor, capacitor, and inductor are 0°, -90°, and 90°, respectively.
To find the impedance of these circuit elements experimentally, we can divide the element's voltage phasor by its current phasor so that the impedance is Z = V/I. The voltage across the circuit element of interest can be measured directly with the oscilloscope on WaveForms. However, the current must be measured indirectly but measuring the voltage drop across the first resistor VR, and dividing by 47 Ω (46.9 Ω measured). Since the elements are in series, the current through this resistor must be equal to the current through the other circuit element.
For this experiment, we will apply a 2 V sinusoidal wave and measure the first resistor voltage VR, the calculated current I (which is VR/47), and the voltage across the circuit element V. For each circuit, the voltage input will be varied from 1 kHz, 5 kHz and 10 kHz. Finally a comparison with the theoretical values is done to see how accurate the experiment was.

*  Note: For the graphs, it is important to distinguish the colors of the curves. The voltage across the 47 Ω resistor is the orange curve, the current is the red curve, and the voltage drop across the element of interest is the blue curve. The 47 Ω resistor voltage drop curve is not discussed since we are more interested in the current through it, although it will still be seen in the graphs.


Resistor Circuit
Here we have our first circuit consisting of a 47 Ω (46.9 Ω measured, used throughout the experiment) and a 100 Ω (100.3 Ω measured).

1 kHz

5 kHz

10 kHz

Here we apply a 2 V @ 1 kHz sinusoidal input. The first thing noticed is that the current (red) and 150 Ω resistor voltage drop (blue) are in phase (have 0° phase shift). The measured (denoted by the "m" sub) current, voltage, and impedance phasors match our theoretical values (denoted by the "th" sub) with great accuracy.


RL Circuit

1 kHz

5 kHz

10 kHz
Qualitatively speaking, in the three graphs we see that the current lags the voltage by 90° as expected. Also, the voltage across the inductor increases as the frequency increases.

The theoretical values for impedance, current, and voltage need to be calculated for three frequencies. Doing the algebra with complex numbers becomes very tedious. It is easier to use create FreeMat program to do the calculations. The program above calculates the impedance, current, and inductor voltage in the complex domain and their phasors (second row of each matrix). The program is then modified to calculate the impedance, current, and capacitor current in the next section. Above we see the program (function) Zl is used to calculate these values for a 2 V source, 1e-3 H inductor, 10 kHz frequency, and 46.9 Ω resistor.

Here we have the data organized for the three frequencies. The percent errors for impedance, current and voltage are very high. Reflecting back on the experiment, we never accounted for the resistance of the inductor. The extra resistance in the circuit will be enough for the accuracy to be compromised in the experiment.

RC Circuit

1 kHz

5 kHz

10 kHz
The three graphs show that qualitatively, we see that the current leads the capacitor voltage by 90°, which was expected. Also, as the frequency increases, the capacitor voltage decreases.

Here we see the data for our RC circuit. The % error for impedance, current, and voltage are much better than in the RL circuit. The accuracy of the RC experiment is acceptable.

Very High Frequency
Just to see what happens, we increased the frequency to 1 MHz and found that the capacitor voltage and the current had no phase angle between them. This happens because the capacitor acts like a short at high frequencies. When we look at the formula for capacitor impedance Zc = 1/(jωC), we can see that as the frequency increases, the impedance goes to zero. Similarly, for an inductor, an inductor acts like an open circuit at high frequencies since the impedance is Z = jωL.

Monday, May 4, 2015

RLC Circuit Response

RLC Circuit Response

In this lab lab we wire the RLC circuit shown in the top left diagram (however the 49.4 Ω and 1 Ω resistors are actually supposed to be switched). We analyze the circuit step theoretically as it would look when 2 V are applied for a long enough time and then taken away using a step voltage. The two diagrams representing the two states are shown next to the original diagram. Next, the characteristic second order differential equation is shown, in terms of the neper frequency and undamped natural frequecny, ɑ and ω0, respectively. The values for these variables are then calculated below and plugged back in to the differential equation. Next we calculate the natural frequencies s1 and s2 and the damping ratio ζ.

Here we see our circuit wired up with the yellow and black wires providing step voltage and ground. The orange wires measure the voltage input on the oscilloscope, while the blue wires measure the resistor output voltage. We now apply a 2 V step voltage and obtain the following graphs on the oscilloscope.

Here we see the input voltage (orange) and the output voltage (blue). We can see that the output voltage has a quick oscillation behavior that is dampened and dies out until the next step.

This graph shows a close up view of the previous graph. Here we have a better view of the oscillations. We can see that the voltage steps down from 40 mV and overshoots to about -14 V which is 35 % and had a rise time of 265 μs. This graph almost looks like it is barely underdamped and almost critically damped. The oscillations seem to die out quickly but not enough to be critically damped. The damping ratio is almost 1 which agrees with this hypothesis.
However, this lab has been troublesome to analyze because our initial diagrams may have not been completely correct. We assumed that when the voltage is zero, the voltage source acts like an open circuit (seen in the top right diagram of the first picture), which would then mean that the resistor R1 could be ignored and the remaining circuit could be treated like a series RLC circuit. This is not true however, because when the voltage is 0 V, the source actually acts like a wire. Therefore the R1 resistor must be taken into account. This means that the circuit is not a series RLC circuit. If we examine the circuit closer, we can see that it is not a parallel circuit either. For these reasons, we may not be able to calculate the theoretical values by the traditional 'plug-and-chug-the-values' into a formula method. Therefore, we only make qualitative observations in this laboratory rather than quantitative ones. A deeper analysis is required to find the theoretical values needed to compare to our experimental values.

Series RLC Circuit Step Response

Series RLC Circuit Step Response


The series RLC circuit is governed by the second order differential equation below, which is derived from Kirchoff's Voltage Law. Previous to our experiment, we find the damping ratio, natural frequency, damped natural frequency, and DC gain of the circuit. It is useful to note our measured values are R = 1.4 Ω, RL = 1.7 Ω (resistance of inductor), L = 0.999 mH, and C = 0.437 µF.
The damping ratio is ζ = ɑ/ω0, where the neper frequency ɑ = R/2L and the undamped natural frequency ω0 = 1/sqrt(LC). 

Underdamped Series RLC Circuit Step Response
From our measured values, we get the damping ratio to be ζ = 0.0324, which means that the circuit is underdamped since ɑ<ω0. The natural frequencies are calculated above and we get s1,2 = -1551.6 + j48.8E3. The damped natural frequency is calculated at ωd = 47.8E3.

Here we see our circuit, wired according to the diagram using the component values mentioned earlier.The blue wires are used for measuring the capacitor voltage, while the red wires measure the input voltage. The wire colors correspond to the graph colors on the oscilloscope as we'll see next.



Now we run a 2 V step input at 1 Hz and obtain the graph using the oscilloscope feature on WaveForms. We see the typical ringing of a underdamped series RLC circuit. When the input voltage steps down from 2 V to 0 V, the capacitor voltage overshoots by Mp = 1.56/2 = 78%. That is the capacitor steps down the same 2 V as the input, but then overshoots by 78% that amount. The time it takes the capacitor voltage to do this is the rise time tr = (29+30) = 59 µs. 


The period of the oscillations is said to be T = 2ᴨ/ωd = 131.35 µs. If we examine the times when the first two peaks happen, we get that T = 149 µs - 29 µs = 120 µs which has an error of 1%.


Critically Damped RLC Circuit Step Response
If we want to create a critically damped RLC circuit, we must make changes to our components so that ω0 = ɑ. Since the capacitor and inductor are to not be changed, we focus on the resistor, keeping in mind the resistance of the inductor. Finding the critical value for resistor R is shown below.
The value of resistor R needs to be 94.2 Ω in order for the circuit to be critically dampened. However, this is not a readily available value for a resistor. We could use a potentiometer to get a value very close to this. In our case however, we will just use a 100 Ω resistor (97.8 Ω measured) and expect there to be some kind of uncertainty. 

We see our circuit once again with the resistor swapped for the new 100 Ω one.



We now wire the circuit with our new resistor and obtain the graph above. The expected maximum is supposed to occur at 1/ɑ = (2*0.999E-3)/97.8 = 939.8 µs. However, when we look at the graph, we can only see as far as 350 µs. The scaling was adjusted a few times to 'zoom out' of the view, but as we zoom out, the characteristic curvature of the graph is lost.