Engineering 44

Engineering 44

Sunday, May 17, 2015

Inverting Voltage Amplifier / Op Amp Relaxation Oscillator Labs

Inverting Voltage Amplifier Lab

Overview:
In this lab, we measured the gain and phase responses of an inverting voltage amplifier circuit, and compared the measurements with expected values.

Design:
We designed the following circuit to conduct the lab:
^^^^ C is the capacitor on top ^^^^

The resistors 'R' were both set to 10K ohms
The capacitor 'C' was set to .1 microFarads
The op amp used was an OP27

Based on the fact that the input voltage and the output voltage are complex exponentials, we can 

Calculate the circuit's input/output relationship using the equation:

Vout/Vin =   1/(1+j*omega*R*C)

Calculate the circuit's amplitude gain using the equation:

| Vout/Vin | =   -1/sqrt(1+(j*omega*R*C)^2)

and finally calculate the phase shift relationship between input and output using the equation:

angle(Vout) - angle(Vin) = 180 - arctan(1/(omega*R*C))

Construction and Execution:
We began by measuring the resistance and capacitance of the elements. A few sample pictures are shown below:

^^^^ (Left) Measured resistance of left resistor and (Right) measured resistance of top resistor ^^^^

Measured values of elements:
R left: 9.85 Ohms
R top: 9.94 Ohms
C: .099 microFarads

Naturally, the slight differences in measured values from ideal values would propagate to a huge level of uncertainty, so we had to do all of our calculations twice. Once before measuring the values, and once after measuring the values, to recieve more accurate predictions.

We calculated gain and phase shift values at three different frequencies: 100 Hz, 1 KHZ, and 5 KHZ. The table of calculated values are below, with the 'updated' (and more accurate) values being on the right:

We then constructed the circuit, and subjected it to a sinusoidal input voltage of varying frequency (as mentioned above) and amplitude of 2V. Below is a snapshot of it:

Results:
Beginning with 100 Hz, these are our results:



Measured gain: 1.48/2 = .74
Expected gain: .847
% difference in gain: 12.6 % (yikes)

Measured phase shift: 31.50 degrees
Expected phase shift: 32.01 degrees
% difference in phase shift: 1.60 % (sweet)


Now, 1 KHz:



Measured gain: 0.32/2 = .16
Expected gain: .16
% difference in gain: 0 % (holy crap)

Measured phase shift: 82.03 degrees
Expected phase shift: 80.82 degrees
% difference in phase shift: 1.50 % (sweet)

Now 5 KHz:



Measured gain: .08/2 = .04
Expected gain: .032
% difference in gain: 25 % (yikes)

Measured phase shift: 87.76 degrees
Expected phase shift: 88.15 degrees
% difference in phase shift: .45 % (sweet)

Analysis:
Overall, the values were all pretty much perfect other than the gains. A possible source of error though, is that we didn't record the exact values, so the analysis was based on simply eyeballing the graph. We wont make that mistake again. Obviously, the method is accurate though.






Op Amp Relaxation Oscillator Lab

Overview:
In this lab, we designed an Op Amp Relaxation Oscillator having a frequency of 921 Hz.

Design:
We designed the following circuit to execute the objective:

**** Ignore the wires going up to the top left of the schematic and out to the right of the schematic. Also, ignore the inverted poles for the +/- 5 V supplies. ****

R was 10K ohms
R1 was 1K ohms
Ca was 1 microFarad
R2 was our controlling variable, creating the oscillation frequency of choice (in our case 921 Hz)

Using the equations:
T = 2RC ln {(1+beta)/(1-beta)}
-and-
beta = R1/(R1+R2)

We were able to calculate the necessary value for R2.
R2 = 35,413 Ohms.

Below are our calculations:

Construction and Execution:

With the calculations completed, we tested our circuit virtually in EveryCircuit:
^^^^ SMASHING SUCCESS!!! ^^^^


We then constructed the circuit as seen below. *Note* R2 was a rather unique resistance, and we had very limited selection of resistors, so we threw several in series to achieve the desired result (Net resistance equaled 35K ohms)


Results:
After supplying power to the voltage rails, these were our results:


^^^^ Voltage across the capacitor ^^^^

^^^^ Voltage out of the Op Amp ^^^^

Measured Values:
T = 1.09 ms
Therefore the measured frequency is 917.4 Hz
desired frequency is 921 Hz

% error: .39%

Analysis:
Things went great; I feel like a million bucks. With a percent error of a marginal .39%, the method of creating relaxed oscillators via Op Amps is flawless.

Phasors: Passive RL Circuit Response Lab

Phasors: Passive RL Circuit Response Lab

Overview: 
In this lab, we measured the gain and phase responses of a passive RL circuit, and compared the measurements with expected values.

Design:
We designed the following circuit to execute the measurements:
R was set to 1.1 ohms
^^^^^ L was set to 1 microHenry ^^^^

Based on the fact that the input voltage and current are complex exponentials, we can 

Calculate the circuit's input/output relationship (the amplitude gain) using the equation:

I/V = Amplitude gain =  1/(R+j*omega*L)

Calculate the phase shift relationship between input and output using the equation:

phi-omega = -arctan((omega*L)/R)

And finally, calculate the cutoff frequency of the circuit using the equation: 

omega cutoff = R/L

We wanted to analyze the circuit at three different frequencies: cutoff frequency,  cutoff frequency/10, and cutoff frequency*10

Below are our calculations for the expected phase shifts and amplitude gains:



Calculated values:

Cutoff Frequency = 1.1*10^6 Hz

Phase Shift:
Cutoff Frequency = -45 degrees
Cutoff Frequency/10 = -5.71 degrees
Cutoff Frequency *10 = -84.29 degrees

Amplitude Gain:
Cutoff Frequency = 0.6482
Cutoff Frequency/10 = 0.9046
Cutoff Frequency*10 = 0.0905

These gains make sense, as a higher frequency will cause a much larger impedance response from the inductor, while a lower frequency will cause the inductor to act more like a short.

Construction and Execution:

 ^^^^ The resistor was measured to be approximately 1.35 Ohms ^^^^

This much of a variation unfortunately called for all new calculations of phase shifts and amplitude gains:
 ^^^^ Recalculated values, accommodating for the change in resistance ^^^^

Updated calculated values:

Cutoff Frequency = 1.1*10^6 Hz

Phase Shift:
Cutoff Frequency = -39.17 degrees
Cutoff Frequency/10 = -4.66 degrees
Cutoff Frequency *10 = -83.00 degrees

Amplitude Gain:
Cutoff Frequency = 0.5742
Cutoff Frequency/10 = 0.7383
Cutoff Frequency*10 = 0.0902

We then constructed the circuit as illustrated previously in the schematic:


Results:
Using a 1 volt amplitude sinusoidal signal, these were our results:

The screenshot above shows the oscilloscope output of our circuit. 

Analysis:
Unfortunately, due to limitations of our equipment, we were only able to record data at 15 KHz. This is 1/11.7 of our cutoff frequency, so the data is quite skewed. That being said, the oscilloscope graph is quite true to out expectations at that frequency. As you can see, the voltage across the inductor (blue) is TINY in comparison to the voltage across the resistor (notice the differences in scale). Overall, the general behavior of an inductor has been shown: 
An inductor in a circuit that is oscillating at below its cutoff frequency will only marginally affect the circuit, as its impedance will be minuscule in comparison to the impedance of the other resistance.
An inductor in a circuit that is oscillating at its cutoff frequency will significantly affect the circuit, as its impedance will be at least equal to that of the other resistance.
And an inductor in a circuit that is oscillating at above its cutoff frequency will drastically affect the circuit, as its impedance will be massive in comparison to the other resistance.

Saturday, May 16, 2015

Impedance Lab

Impedance Lab

Overview:
In this lab we measured impedances of resistors, capacitors, and inductors. We then compared them to their expected values.

Design:
We designed three circuits to experimentally measure the impedance of the elements:
^^^^ (Left) The circuit to measure the impedance of a resistor and (Right) the circuit to measure the impedance of an inductor ^^^^
^^^^ The circuit to measure the impedance of a capacitor ^^^^

The resistors impedance was simply equal to its resistance, while the impedance of the inductor was equal to j*omega*L, and the capacitor's impedance was equal to 1/(j*omega*C). By using these equations, it became clear that the current for the capacitor would lead the voltage by 90 degrees, and the current for the inductor would follow the voltage by 90 degrees. Obviously the current through the resistor is in phase with the voltage. 

Construction and Execution:



^^^^ (Left) Resistance of the 47 Ohm resistor and (Right) the 100 ohm resistor ^^^^



^^^^ Measured capacitance of the the capacitor ^^^^

R47: 48.7 Ohms
R100: 100.0 Ohms
C.1 microF: .093 microF
L: 1 microH

We then constructed the first circuit with the two resistors, and measured the voltages across each element and each of the three frequencies. We also added a mathematic channel (red) which illustrated the current.
^^^^ The dual resistor circuit, as viewed from the side ^^^^



 ^^^^ Output for circuit with input frequency of 5 KHz ^^^^

The voltage across the 100 ohm resistor is in blue, and has an amplitude of 1.35 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 0.54 V.
The current is in red, and has an amplitude of 14.6 mA.
The voltage for the resistor is in phase with the current.

These values are consistent with our expectations to +/- 4.9 %

 ^^^^ Output for circuit with input frequency of 10 KHz ^^^^

The voltage across the 100 ohm resistor is in blue, and has an amplitude of 1.35 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 0.54 V.
The current is in red, and has an amplitude of 14.6 mA.
The voltage for the resistor is in phase with the current.

These values are consistent with our expectations to +/- 4.9 %

 ^^^^ Output for circuit with input frequency of 1 KHz ^^^^

The voltage across the 100 ohm resistor is in blue, and has an amplitude of 1.35 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 0.54 V.
The current is in red, and has an amplitude of 14.6 mA.
The voltage for the resistor is in phase with the current.

These values are consistent with our expectations to +/- 4.9 %

We then went on to testing the inductor:
  ^^^^ Output for circuit with input frequency of 1 KHz ^^^^

The voltage across the inductor is in blue, and has an amplitude of .269 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.90 V.
The current is in red, and has an amplitude of 39.1 mA.
The voltage for the inductor leads the current by 90 degrees.

The inductors impedance was measured as 53.7 ohms with a voltage gain of .169 Volts.


  ^^^^ Output for circuit with input frequency of 1 KHz ^^^^

The voltage across the inductor is in blue, and has an amplitude of 1.07 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.50 V.
The current is in red, and has an amplitude of 34.2 mA.
The voltage for the inductor leads the current by 90 degrees.

The inductors impedance was measured as 78.5 ohms with a voltage gain of .57 Volts.



  ^^^^ Output for circuit with input frequency of 1 KHz ^^^^

The voltage across the inductor is in blue, and has an amplitude of 1.56 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.18 V.
The current is in red, and has an amplitude of 24.4 mA.
The voltage for the inductor leads the current by 90 degrees.

The inductors impedance was measured as 109.1 ohms with a voltage gain of .74 Volts.

Finally, we went on to testing the capacitor:
   ^^^^ Output for circuit with input frequency of 1 KHz ^^^^

The voltage across the capacitor is in blue, and has an amplitude of 1.61 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.05 V.
The current is in red, and has an amplitude of 19.5 mA.
The voltage for the capacitor follows the current by 90 degrees.

The capacitors impedance was measured as 119.3 ohms with a voltage gain of .66 Volts.

 ^^^^ Output for circuit with input frequency of 5 KHz ^^^^

The voltage across the capacitor is in blue, and has an amplitude of .58 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.75 V.
The current is in red, and has an amplitude of 34.2 mA.
The voltage for the capacitor follows the current by 90 degrees.

The capacitors impedance was measured as 61.3 ohms with a voltage gain of .33 Volts.

^^^^ Output for circuit with input frequency of 10 KHz ^^^^

The voltage across the capacitor is in blue, and has an amplitude of .34 V.
The voltage across the 47 ohm resistor is yellow, and has an amplitude of 1.82 V.
The current is in red, and has an amplitude of 39.1 mA.
The voltage for the capacitor follows the current by 90 degrees.

The capacitors impedance was measured as 55.8 ohms with a voltage gain of .16 Volts.

Analysis:
All of the measurements came out to being incredibly close to our theoretical values. This shows that the calculation of impedances as imaginary parts of the voltage and current is a valid method of calculation. Additionally, it defends the theory of phasors (which is essentially the same thing).





Oscilloscope Lab

Oscilloscope Lab

Overview: 
Today in class, we were shown how oscilloscope work. 

The Data: 
The following is a video of the lecture:
^^^^ Video taken by Sunny. Thanks sunny! ^^^^
(You can see more of his stuff herehere, and here if you're interested *thumbs up*)

^^^^ Basic diagram of an oscilloscope ^^^^

How it works: 
Basically how it works, is there's an electron 'gun' in the back of the CRT tube, which emits electrons towards a glass lens. As the electron flies towards the lens, charge is placed on deflection plates, changing the direction of the electron. What determines when the charge is placed on the deflection plates is the input signal. This means that you can compare two oscillating signals by placing one on the x-axis, and one on the y-axis. Doing so can create some pretty neat geometric shapes, not to mention compare signals quite precisely.

Series RLC Circuit Step Response Lab

Series RLC Circuit Step Response Lab

Overview: In this lab we modeled and tested series RLC second-order circuits. In the first part of the lab, the step response of a circuit wass analyzed. Then, in the second part the same circuit was modified to be critically damped, and then once again its step response was analyzed.

Design: 

We designed the following circuit to test the step responses:

R was set to 1.1 ohms
L was 1 microHenry
C was 470 nanoFarads

Below are our calculations, predicting the damping ratio, resonance frequency, and damping frequency:

*From the picture above*
Alpha = damping ratio = 4.5 *10^5 Hz
Omega = resonance frequency = 1.543 *10^6 Hz
Omega d = Damping frequency = 1045 Hz
Alpha/Omega = Damping ratio = .292

Construction and Execution: 

The circuit was fed a 2V step function at 100Hz, allowing the circuit to stabilize between each step. 

Results:

 ^^^^ Triggered response of one step ^^^^


^^^^ Close up view of the oscilloscope window ^^^^
^^^^ best fit line applied to voltage peaks of the system ^^^^

The best fit exponential line gives an alpha value of ~12, which is wildly inaccurate, but then so is the fit line, so that is being excluded from our results. That being said the rest of the results are as follows:
Experimental Omega = 1.543*10^6 Hz
Experimental Omega D = 8.70 * 10^3 Hz
Experimental Damping Ratio = .292

Analysis: 
The corrupted experimental alpha value really impacted our ability to do a successful analysis. As you can see, the inaccurate experimental Omega D hints at something having gone incorrectly with our initial or post calculations. However, the graph looks accurate, so perhaps there is an error involving the inductor, which may not have a negligible amount of resistance. That would seriously impact our results, since the amount of resistance being used in a mere .9 ohms. Also there is other system resistance which could be throwing off the accuracy of our calculations.

Inverting Differentiator Lab

Inverting Differentiator Lab

Overview: In this lab we examined the forced response of a circuit which performs differentiation. By applying sinusoidal voltages of varying frequencies, we were able to analyze the output voltage, which was a derivative of the input voltage with respect to time.

Design: We designed the following circuit to execute the experiment:


The resistor was equal to 470 ohms, and the capacitor was 470 nF. 

For 1V sinusoidal input voltages, we used three different settings:
V1: frequency = 1KHz
V2: frequency = 2KHz
V3: frequency = 500Hz

Because the circuit is an inverting differentiator, it was expected to have the following output:


Following that logic, the expected output values were as follows:


Construction and Execution:
We then constructed the circuit just as the schematic above outlined:

R was measured as being 465 ohms
C was measured as being 424 nanoFarads

^^^^ View of the constructed circuit from the side ^^^^

 ^^^^ view of the circuit from above ^^^^

 ^^^^ Up close view of the circuit ^^^^

Results:
The results are as follows:
 ^^^^ Oscilloscope results from V1 ^^^^

Vout = ~1.4 Vin, and is phase shifted


  ^^^^ Oscilloscope results from V2 ^^^^

Vout = ~2.45 Vin, and is phase shifted (notice the change of vertical scale for Vout)


 ^^^^ Oscilloscope results from V3 ^^^^

Vout = ~.65 Vin, and is phase shifted

Analysis: 

As the data suggests, the overall effect was relatively predictable; the only frequency which had any truly inaccurate results was V2, and it wasn't terribly inaccurate. Unfortunately, the source of that additional error is unknown, and further investigation would be necessary to pinpoint it. It may have just been a fluke. Regardless, this experiment still clearly outlines the behavior of forced inverting differentiator circuits.