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.

Sunday, May 17, 2015

Day 14 Passive RC Circuit Natural Response

Chapter 7 of our textbook discusses the natural response of an RC circuit as a capacitor charges and discharges. In order to observe this, we built a circuit in which we can switch the voltage from on to off and use a trigger in our Analog Discovery oscilloscope to capture the plot of the discharge/charge.

Our pre-Lab below shows two different step function scenarios. The first is a circuit in which the voltage source is disconnected. The second shows the voltage source being turned off by switching. We compare the two different effects of each scenario.

The first time constant we solve for below is for scenario A where the source is simply removed. This creates a circuit where all we have is R2 and C because no current will flow through resistor R1 since it is now an open circuit.



The next time constant we solve for is when the voltage source is switched from one wire to the next. This leaves resistor R1 as a passive element in the circuit, rather than an open circuit. The effects on time constant Tau are shown below.



It is evident that scenario A will discharge faster because the load resistance will absorb more of the energy stored than it will in scenario B where we have two resistors in parallel for a lesser resistance.
Now that we calculated the theoretical values of Tau we are ready to move on.

Below is the build of the circuit:


Placing 3 capacitors in parallel allowed us to have an equivalent capacitance of roughly 22 uF. Switching the voltage from on to off results in the discharge of the equivalent capacitance.

Below is the oscilloscope readings and a plot of the data, including the voltage value after one time constant tau.


I extracted the critical data from our Diligent Oscilloscope and plotted it using Matlab, placing the red asterisk at our measured value of Voltage after one time constant.


The Time constant from our measurement was roughly .020 seconds. Our theoretical value for tau was calculated to be .015 seconds. Our measurements were off by 33.3%. This can be directly a cause of experimental errors, inconsistencies in our resistor and capacitor values, and also in the measurement of tau.

I do not have any pictures or data from the switching of the second scenario. However, below is a plot of the step response of introducing a voltage source to the same capacitor in the circuit.



While our data and circuit elements were not ideal, the goal of the project was satisfied: to observe and understand the natural response of an RC circuit.

Saturday, May 16, 2015

Day 13 Capacitor Voltage-Current Relations

The purpose of today's lab is to measure the relationship between capacitor voltage and capacitor current. The voltage applied will be three different types of time-varying signals: sine wave, triangle wave, and square wave voltages will be applied. Because our analog discoveries do not measure current we will use a math function to calculate the current.

From our studies we know that


Ic = C dv/dt

Below is a sketch of our pre-lab activity. Given a sinusoid and triangle wave input voltage, draw the resulting current. Current in a capacitor is proportional to the derivative of the voltage and our sketches reflect that below.



Lab :

The components we used in this lab were simply a 1uF capacitor and a 100 Ohm resistor connected in series. Using the oscilloscope function of the Analog Discovery we measure the output voltage of the resistor and the capacitor. By adding a Math Channel of (VR/100(ohms)) we can also see the plot of the current. It mirrors what we predicted.




Applying a 1kHz sine wave to the circuit results in a capacitor current that is proportional to its derivative. Vout for the capacitor is the plot of C2 above, and the current is the plot of M1. As expected, we see a plot of a sine and cosine wave.

Below is a 2kHz plot of the same:


Below is our successful circuit.


We were able to successfully measure, observe, and apply current- voltage relationship through a capacitor.