Thursday, June 11, 2015

Day 22 Signals with Multiple Frequency Components

The objective of today's lab was to introduce ourselves to AC analysis of sinusoidal inputs with varying frequencies. 
We introduced a new type of function for circuits with varying frequencies, known as a transfer function. The transfer function, or network function, is a useful analytical tool for finding the frequency response of a circuit. The impedance of each element is the same, but instead of jω, we write s. The transfer function is a frequency-dependent ratio of a phasor output to a phasor input and has the general form:
H(ω) = Y(ω)/X(ω)

Since the input and output can either be voltage or current at any place in the circuit, the following transfer functions are possible:

Because of its complex nature, H(ω) has a magnitude and a phase φ.

Transfer functions can be simplified in terms of some root s. Values of s that make the transfer function equal to zero are known as zeros. The values of s that make the transfer function undefined are known as poles.

Pre-Lab:
For our pre-lab today, we were asked to find the transfer function for voltage gain given specific quantities of our resistors and capacitor. Below are our pre-lab calculations down the right-side of the white board. The transfer function is boxed in green along with the zeros and poles.


Below is the constructed circuit. I took the picture before we ran the experiment and realized that we did not have the circuit entirely closed, but the adjustment was made when we began collecting data.


The circuit below acts as a voltage divider. We have some voltage getting dropped across the first resistor, and the rest being delivered to the capacitor and resistor in parallel. The calculations for the voltage divider are what we calculated in the pre-lab. At this point we began the lab.

We first developed a custom equation for the Waveform Generator:

This input voltage produced the waveform below, and the concurring output voltage measured at the resistor in parallel.


As we can see in the top waveform, the voltage output takes the shape of a sinusoid, while in fact being its own. There is a slight harmonic shape to it.
The transfer function found in pre-lab represents the gain of the output voltage which we observed using the oscilloscope function.


The orange signal is our input voltage; the blue signal is our output. We observe a varying gain.

Next we performed, for the first time, a sweep of applied voltage. As time increases, frequency increases. The sweeping input gives us a very keen understanding of the theoretical and real-world behavior of our circuit.


Below are the recorded outputs.


Again, we observe an alternating gain. Mathematically, we know that at the lowest frequency, the gain of our circuit will be 1/2 because the capacitor will act as an open circuit and voltage will be evenly divided across the equivalent resistors. We can see that in the beginning of each sweep: the blue signal is about half the size of our input signal. As the frequency increases, however, we can see that the blue gain of the circuit approaches 0. 

Friday, May 22, 2015

Day 20 Inverting Op Amp (with AC)

Today's lab also focused on the steady-state response of electrical circuits to sinusoidal inputs. In this lab, we were able to finally calculate and demonstrate that while input and output signals have the same frequency, they have different amplitudes and phase angles.
In this lab, we will measure the gain and phase responses of an inverting voltage amplifier circuit and compare these measurements with expectations based on concept and based on analysis.

Our main concentration in this lab was on the input-output relation governing an inverting voltage amplifier. This relationship is the following,
given the inverting circuit below:
Our pre-lab required that we derive the relationship between Vout and Vin. We did so below using nodal analysis at +Vin, the negative input terminal of the op amp, and at +Vout. 
Below are our calculations of the gain and phase shift of the circuit outputs at varying frequencies.


Circuit construction is pictured below containing two 10 kOhm resistors, a 0.1uF capacitor, and the traditional OP 27 op amp we've continually used throughout the semester. 


Next we applied input voltages at three different frequencies:
100 Hz, 1 kHz, and 5 kHz respectively.
Below are the images from the oscilloscope window.




From the data obtained through our oscilloscope's readings, we found the measured values which are listed below. Our readings were ideal for real-world predicaments.


Below are the calculation errors.
Clearly there was an error in our interpretation of our data for our gain values. The phase shift calculations were nearly ideal, yet we had such discrepancies in our gain. I believe this is a direct result of poor data collecting.

This lab has so far been the most practical in terms of showing us theory measured in the real world. Steady-state responses have been significantly clarified.





Day 19 Phasors: Passive RL Circuit

The objective of this lab was to focus on the steady-state response of electrical circuits to sinusoidal inputs. In this system, the input and output signals have the same frequency, but the two signals have different amplitudes and phase angles (which will be shown later). Below is our pre-lab of initial calculations of our gain for the circuit's output across the inductor.


Below is the circuit construction. We have a 1uH inductor in series with a 1.5 ohm resistor.

Below is a captured image of our RL circuit steady-state response. Steady state occurs when a sinusoidal wave is passed through the circuit, otherwise known as Vss or Iss. Below we see, as expected, that the output voltage of the Inductor leads our output voltage of the resistor by a phase shift Φ. As stated in the pre-lab, the output and input signals have the same input frequency, but varying amplitudes and phase shifts.


Day 18 Impedance

Today's lab concentrated on finding the observable impedance of three circuit elements, a resistor, inductor, and capacitor. Impedance is a circuit element's resistance to AC voltage, similar to the resistance of an element in DC. Impedance is much more efficient to work with because it there is no discrimination against the type of element: unlike the behavior of a capacitor or inductor to DC voltage.

The circuits were wired according to the diagrams shown below. The impedance for the three circuit element can be easily calculated with the use of known impedance 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.
Below is the pre lab for our experiment.


We connect a constant resistor R = 47 ohms in each of the circuits. We used the Oscilloscope from our analog discovery to represent the voltage across the resistor so that we can compare it to each of the changing circuit elements: the resistor, the inductor, and the capacitor.

Below is the resistor in series with a resistor circuit. For some reason, I did not take my own pictures of each of my circuits, so all photo credit to Clark on the circuit pictures.

I did, however, successfully measure and observe the different outputs of each of the circuits. Below is the output voltage across our second resistor at three different frequencies.

Those frequencies being:
1kHz, 5kHz, and 10kHz


As expected, we see two sinusoidal waveforms both in phase with each other. Reason being, the impedance of a resistor is in phase with the impedance of another resistor, both at phase angles 0°. The third function, M1, is a math function that shows the current that flows through the circuit. 
At a higher frequency, we still observe that the waves are still in phase, as shown in the screenshots above and below. 
This shows that the impedance of a resistor maintains a relatively constant characteristic regardless of frequency.
The next lab analyzed is the RL circuit displayed above.
We will follow the same procedures for the RL circuit and the RC circuit below.

In this circuit we see Channel C1, the output across the inductor, to be +90° out of phase with our resistor, precisely what we predicted in our pre-lab. As shown in the following screenshots, the frequency is negligible when considering the phase relationship between the inductor and the resistor.


The readings in the front window of the screen shot shows that the inductor still leads the resistor by 90°, as predicted.

Finally, the RC circuit will be analyzed below.

Below are the measured outputs across the capacitor:

Here we see the capacitor output, measured by Channel C2, lagging the resistor by -90°, once again stated in the pre-lab as expected. 

 AC impedance seems to be a lot less convoluted (once we review our complex numbers) than DC. It is a lot more simple being able to simplify different circuits down into equivalent impedances. While AC has been a pain in the past, this experience with it should flow with a little less impedance. Get it?

Day 17 RLC Circuit Response

This lab emphasized the modeling and testing of a second order circuit containing two resistors, a capacitor, and an inductor. The step response of the given circuit is analyzed and tested.
For our pre-lab, we were instructed to write the differential equation relating Vin and Vout, as well as estimate the damping ratio and natural frequency of the circuit. Below are those calculations:


Our constructed circuit is shown below. Two resistors, a capacitor, and an inductor. We use our oscilloscope to measure the voltage output across our second resistor.

As we can see from the measured signals, our circuit behaved as expected.
The objective of our lab was again achieved. We learned how to analyze circuits containing a resistor, capacitor and an inductor in parallel. Today we observed one of three responses: the over damped circuit. 

Day 16 Series RLC Circuit Step Response

The objective of this lab is to emphasize modeling and testing of a series RLC second order circuit.
This lab was more challenging than pervious labs because it is our introduction into second-order circuits.
Instead of solving a natural response, homogenous second-order differential equation, we have to account for the forced response of our source Vin.
The general equation for the step response of a second-order differential equation is below:
Depending on the values of our circuit components, we will have one of the following general solutions: over damped (a > w), critically damped (a = w), or underdamped ( a < w).
Below are our pre-lab calculations for the underdamped step response. 


For extra practice the natural response values are calculated below, and verify that we have two imaginary roots, confirming that it is an underdamped circuit.


Construction of our series RLC Circuit is below:


As usual, we will measure the voltage across the 0.47 uF capacitor using our oscilloscope from the Analog Discovery.


Here we observe the expected plot of an underdamped circuit. We see a dampening of the signal occurring as the observable sinusoidal Vout dampens until it settles back around the input voltage of 2V.
After extracting the Data measured by Channel C1, I found that Vmax of the output voltage measured at
Vmax = 4.136594903 V
The overshoot of the Vout occurs at the highest peak of the signal, Vmax. Overshoot for this circuit was roughly 2.1V.

Part II of this lab was a design problem: to redesign the circuit without changing the natural frequency or the gain. In order to do this we can follow the calculations below.

Today's lab was much more challenging than labs in the past. It was unfamiliar territory for those who haven't had plenty of experience with second-order circuits or differential equations. Overall, the behavior of an underdamped circuit was able to be observed.



Day 15 Inverting DIfferentiator

The objective of this lab was to examine the forced response of a circuit which performs a differentiation, where the output voltage is the derivative with respect to time of the input voltage.

Given the circuit below:
By using KCL and setting current through the resistor equal to the negative current through the capacitor, we derive the input/output relationship to be:
Current through a capacitor is the derivative of voltage multiplied by the capacitance value. Because the input voltage is supplied to the negative terminal of the op amp, we have an inverting function.
For our lab, the input voltage is a sinusoid in the form of 
Vin(t) = Acos(wt)

Below is the final derivation of our output voltage as well as the calculations of the output voltage from different frequencies of our input voltage.
Below is the final construction of the inverting differentiator circuit:

Using the oscilloscope function of the analog discovery, we measured the following output voltages from frequencies of:
f = 1kHz, 2kHz, and 500Hz respectively.




After a closer look at the capacitor used, it turns out that instead of being C = 470nF, it was in fact C = 4.7uF. All pre-lab measurements were done using the 470nF capacitance value. In order to get more accurate theoretical and measured values, the calculations were redone. As instructed, here is a table comparing the measured outputs to the true theoretical outputs:

Once again, the objective of this lab was to observe and understand the characteristics of an inverting differentiator OP Amp. Throwing a capacitor into the mix with our use of OP amps seemed very convoluted and intimidating at first. Once we consider the nature of current and voltage through and across an OP amp, the task of utilizing an inverting differentiator op amp seems a lot less daunting. Again, we see one of the many ways that OP amps can be connected in a circuit, and the usefulness of it.