Tuesday, April 26, 2016

4/26/16 Day 19: First Order Op Amp Circuits (Integrators and Differentiators)

In class today we first quickly reviewed the basic concepts of capacitors and inductors, such as storing energy and preventing sudden changes in voltages (for capacitors) or current (for inductors). We then learned about placing RC and op amp circuits together, termed first order op amp circuits. We learned about two very common RC op amp circuits, termed the integrator and differentiator. The integrator consists of a capacitor connected from the output to the input (a feedback). Using differential equations it was found that the output voltage in an integrator depends on the integral of the input voltage with respect to time; the gain of this circuit was found to be the negative of the reciprocal of the time constant of an RC circuit (tau = RC). We then analyzed a practical integrator and the output voltage depending on the signals applied to the input terminal.

After, we learned about differentiators, which are RC op amp circuits that have a capacitor connected to the input. These circuits differentiate the input signals to determine the output voltage. The gain in these circuits are negative of the time constant for an RC circuit (tau = RC).

Next, we reviewed switching functions from mathematics because they are very useful in engineering when analyzing RC and RL circuits and when trying to cause these circuits to operate by switching. Switching functions are functions that have a discontinuity or have a discontinuous derivative; they very well model the opening or closing of a switch in these first order circuits. We learned about the three most common switch functions, termed the unit step, the unit impulse, and the unit ramp. A unit step is zero for all values of t less than zero and one for all values of t greater than zero. The unit step is discontinuous at t = 0 (undefined). The unit step can also be shifted horizontally depending on at what time is considered "zero" (i.e. the frame of reference per se). We then did a lab titled "Inverting Differentiator" after learning about the unit step function.

After the lab, we went back to switching functions. Another one we learned is the unit impulse function, which is 0 at every value of t except zero. At t equals zero, it is undefined. This function is also known as the delta function. It has an area of 1, and the area can be modified simply by  multiplying the delta function to a scalar. For example, 10 times delta has an area of 10. The delta function can also be horizontally shifted like any other function. In addition the delta function, when multiplied to another function, provides only the value of the instantaneous point at t equals zero or t naught if shifted horizontally.

Lastly, another useful switching function is the unit ramp function, which is obtained by integrating the unit step function. The unit ramp function is zero for t less than zero and is a function of time for t greater than 0. Originally, it is a linear graph of slope 1 and y intercept of 0 at t greater than 0. Like any other function, the unit ramp function can also be horizontally shifted. After learning about these two switch functions, a problem involving voltage sources acting as switch functions in a circuit was solved.

We then applied the unit step function in an RC circuit, where the unit step was provided by an external source like a voltage source. The voltage as a function of time was determined for such a circuit using KCL and separable differential equations. It was found that v = Vs+(Vo-Vs)e^(-t/RC) for t greater than zero, and simply Vo for t less than zero (since the unit step is zero before t equal zero). Using i = C dv/dt the current is Vs/R*e^(-t/RC). The forced response of a step response of an RC circuit is Vs, and the natural response is the rest ((Vo-Vs)e^(-t/RC)). The total response can also be written in the same way, where Vs = V (infinity) and Vo = V(0). An example involving this idea was then performed.

Finally, the step response of an RL circuit was analyzed. It is very similar to the step response of an RC circuit, with the exception that now the voltage function in an RC circuit is the current function in an RL circuit. For an RL circuit, i(t) = Is+(Io-Is)e^(-Lt/R). The voltage is then given by v = L*di/dt. A problem using this idea was then solved. We then went over delay circuits slightly, which are RC circuits and a lamp in parallel to the resistor.

LECTURE:



Above is the derivation for the output voltage of an integrator as a function of the input voltage. As can be seen, the circuit is not called an integrator for no plausible reason; this circuit integrates the input voltage with a gain of -1/RC, or -1/tau, where tau is the time constant of an RC circuit.


In this problem, a square wave, triangular wave, and sinusoidal wave signals were inputted to a practical integrator (which is an ideal integrator but a large resistor in parallel with the capacitor). The resistor parallel to the capacitor is used to dissipate energy, or the result would be the op amp saturating. As seen in the sinusoidal input wave, the output would be a cosine wave with amplitude 1/RC times the original amplitude. Looking at the square wave input signal, the output wave signal is a triangular wave that should actually begin towards the negative amplitude (our signs were switched by accident on the y axis). Again, the amplitude is still the original times 1/RC. Lastly, looking at the triangular input wave, the resulting output wave would be a sawtooth-like wave that consists of half- parabolas arcing up and down. Again, the wave would go towards the negative amplitude first due to the negative gain, which is not shown in our graph due to switching the signs on the y axis. The amplitude is still the same A/RC. All of these output wave graphs were determined by integrating the input functions and multiplying by the gain for an integrator (-1/RC).


The above picture is a schematic of the circuit implemented in the previous analysis. The gain of this RC op amp circuit was found to be -10.


In this problem, the voltage of the capacitor as a function of time using switch functions was provided, and the objective was to find the current across the capacitor. Using the fundamental law for capacitors (i = c dv/dt), the current was obtained. The derivative of the unit step was found to be delta and the derivative of the unit ramp was found to be the unit step. The graphs of voltage and current were then drawn using the voltage and current functions.


In the above derivation, the current across the capacitor in an RC circuit with a step response was derived.


In this example, the voltage across the capacitor as a function of time in this step response RC circuit was determined by finding the voltage at infinity, at zero, and the time constant. The voltage function was then written using those determined values. The current was then obtained using the current law for a capacitor.


This problem involves the step response of an RL circuit. It was solved similarly to the previous problem, with the exception of the current being found first and the voltage later. The current at infinity, at zero, and the time constant were obtained to write the current equation. The voltage was then obtained using the voltage law for an inductor.
LAB:

Inverting Differentiator:

Purpose:

The purpose of this experiment was to experimentally analyze a differentiator circuit to compare with the expected behavior in order to determine the validity of the relationship derived between the output and input voltages for a differentiator. 

Prelab:


The output voltage as a function of the input voltage for the differentiator was determined in the pre-lab, where the gain was dependent on the resistor and capacitor. Using this relationship the output voltage as a result of an actual applied input wave function was determined, where the input voltage was a sinusoidal function of amplitude A and frequency w/(2pi). 

In addition, in order to obtain a gain of 1, the appropriate resistor to use in the differentiator was determined.

Apparatus:


The apparatus of this experiment consisted of an OP27 op amp, a 1 uF capacitor, an analog discovery, a resistor, a breadboard, a laptop with Waveforms, wires, alligator clips and a DMM. 

Procedure:


To begin, the inverting differentiator circuit was actually built; its schematic is found in the pre-lab. It was decided to use a 1 kOhm resistor to reduce the gain so that the op amp does not saturate during the experiment. The +5 V and -5 V inputs from the analog were used in the op amp at its +V and - V ends, respectively. A Wavegen input wire was then used as the input voltage to this circuit. The non-inverting input was simply attached to ground. The oscilloscope was then used to measure input and output voltages; the input voltage was measured using channel 2 and the output voltage was measured using channel 1. The output voltage is seen across the resistor, so the channel inputs were placed across the resistor. For channel 2, only one input was used and it was connected adjacent to the wavegen input, since if two inputs were used the oscilloscope would measure no voltage due to being no potential difference across the inputs. The actual resistance value of the 1kOhm resistor was measured using a DMM and was found.

Then, using the Waveforms application, sinusoidal functions of varying frequencies were inputted to the op amp. All the sinusoidal functions had an amplitude of 100 mV and an offset of zero. The first sinusoidal wave had a frequency of 1 kHz. The oscilloscope was then used to measure the output voltage, and prior to this the expected amplitude of the output voltage was calculated (the reasoning is seen in the pre-lab). The phase shift was also determined to be pi/2, since the derivative of sine is cosine, and they are shifted apart by 90 degrees. The oscilloscope window of this sinusoidal wave is shown below:


The same was performed for a sinusoidal wave input with frequency of 2 kHz. Again, the expected amplitude was also calculated prior.


Lastly, the same procedure was performed for a sinusoidal input wave of 500 Hz. The window is shown below.


For all of these screenshots of the oscilloscope window, the blue wave us the input voltage and the yellow wave is the output voltage.

Data:

The expected voltage amplitude, the measured voltage amplitude (determined from the oscilloscope window) and the percent difference between the two was tabulated for each sinusoidal wave of varying frequency, and is shown below:



This table also includes the measured resistance of the 1 kOhm resistor used as well as the input and output voltage functions determined by using the law for a differentiator op amp circuit.

Data Analysis / Conclusion:

As can be seen in the table, the expected values and the measured values for each sinusoidal wave of varying frequency were very similar, which proves the validity of the relationship between the input and output voltages for a differentiator. The small percent difference between each is mostly just due to the uncertainty in reading of the amplitude from the oscilloscope windows. Any other small errors are just due to unaccounted resistance or the sensitivity of the op amp to the input signals.

Looking at the shapes of the input and output signal functions, the input is a sine function of amplitude 1 V. The output signal is also a sinusoidal wave, but it is actually a cosine wave, determined by the pi/2 phase shift from the input signal. The pi/2 phase shift is seen because when one signal is at a peak of a trough, the other signal is at zero, and vice versa. It is expected that the output signal would be a cosine wave from the law of a differentiator; the output is related to the derivative of the input. 

Saturday, April 16, 2016

4/14/16 Day 16: Inductors in Series and Parallel, Source free 1st Order Circuits, Passive RC Circuit Natural Response and Passive RL Circuit Natural Response

In class we first learned about how to find equivalent inductance when there are multiple inductors in series and in parallel. In series, the equivalent inductance is found by summing the individual inductances. In parallel, the equivalent inductance is the reciprocal of the sum of the reciprocal individual inductances. As seen, inductances are treated like resistors when summing them.

We then reviewed 1st order circuits, which are composed of source-free RL and RC circuits. A source free RC circuit consists only of resistors and a capacitor after the DC source is suddenly disconnected. In an RC circuit, the voltage across the capacitor is v=Voe^(-t/RC) and the current through the capacitor is i=(Vo/R)e^(-t/RC), where R is the Thevenin equivalent of the resistance in the circuit. The time constant in an RC circuit is tau = RC. We also found that it took about five time constants to almost completely discharge the capacitor in an RC circuit. Lastly, we did a problem on finding voltage and current in an RC circuit.

We then did a lab involving an RC circuit, titled Passive RC Circuit Natural Response. We looked at the voltage across and current through the capacitor when the DC source was disconnected.

After the lab we then learned about the second type of first order circuit, or an RL circuit. A source free RL circuit consists of resistors and an inductor. In an RL circuit, the current through the inductor is i(t)=Ioe^(-Rt/L) and the voltage across a resistor is simple the current times its resistance, or v(t) = IoRoe^(-Rt/L). Again, R in the equations is the Thevenin equivalent of the resistors in the source free RL circuit. For an RL circuit, the time constant is tau = L/R, in seconds. We also determined that it also took about five time constants to almost completely discharge the inductor in an RL circuit. We then did a simple example of an RL circuit.

Lastly, we did the lab titled  Passive RL Circuit Natural Response, which was similar to the previous lab but involved an inductor instead of a capacitor.

LECTURE:


In this problem, the equivalent inductance in the circuit was determined. Knowing that series inductors are summed and parallel inductors are reciprocally summed by the reciprocal, the equivalent inductance was found to be 15 H.


In this example, the first order DEQ of a source free RC circuit was solved using the separable integration method. The result was the voltage across the capacitor, which depends on the initial voltage, its capacitance and the Thevenin equivalent of the resistance at the ends of the capacitor. The time constant for an RC circuit is tau = RC.


In the above derivation, it was found that it would take about five time constants in a first order circuit to nearly discharge completely the capacitor or the inductor.


In this derivation, the power across the capacitor in an RC circuit was found, which is just the product of the voltage across it and the current running through the capacitor. At time equal to zero, the power across a capacitor looks very similar to the power across a resistor (Vo^2/R).


The objective of the above problem was to find the current and voltage across the capacitor in this RC circuit. It was already known that the initial voltage of the capacitor is 10 V, so all we needed to do was to simply find the time constant which is the 10 ohms times the capacitance (0.2 F), or 2 seconds. Then, the current was found by dividing the voltage by the equivalent resistance, or just simply 10 ohms.


The current through an inductor in an RL circuit was determined in the above integration of the first order DEQ. The result is the current through the inductor, which is an exponential function and depends on the initial current, the Thevenin resistance and the inductance of the inductor. The time constant for an RL circuit is tau = L/R.


In this example, the current across the inductor and the voltage of the resistor were determined in this simple RL circuit. The initial current in the circuit was provided, so all we needed to determine was the time constant, or L/R. The time constant was found to be 0.5 s, and then was used to find the current through the inductor and the voltage across the resistor, which is just the current times its resistance.


In this example, the current through the inductor was determined as a function of time in the RL circuit. First the initial current as a result of the 40 V source was determined, which was found to be 8 V. Then, using current divider the current through the inductor at t = 0 was determined to be 6 A. From there the time constant was determined in this circuit. Prior, the equivalent resistance seen by the inductor (16 ohm, 12 ohm and 4 ohm resistors) was determined to be 8 ohms. Then the time constant tau = L/R was determined and found to be 1/4 s. Lastly, using the initial current and the time constant, the equation for current was written to be 6e^-4t.


LAB:

Passive RC Circuit Natural Response:

Purpose:

The objective of this experiment was to examine the response of a simple RC circuit to a sudden removal of a DC voltage source and to an applied alternating square voltage signal. It was expected that the response method used affects the measurement of the circuit.

Prelab:


In the prelab, the expected time constant for the RC circuit when the applied square voltage signal was zero was determined. This was done by finding the Thevenin resistance then mutiplying it by the capacitance of the capacitor. The time constant was found to be about 15 ms.


The voltage of the capacitor was also determined used voltage divider. It was found to be 3.44 V for both cases, when the 5 V DC source and the square wave was added to the RC circuit.

The same was done for when the constant voltage source was completely removed from the circuit. Doing so the time constant was different, and it was found to be 48.4 ms. In this circuit the Thevenin resistance is only the 2.2 kOhm resistor. The 1 kOhm resistor is on an open circuit branch and therefore is not seen by the capacitor.

Apparatus:


The equipment used in this experiment consisted of a 22 uF capacitor,  1 kOhm and 2.2 kOhm resistors, an analog discovery, a breadboard, a laptop with Waveforms, wires, a DMM and alligator clips.

Procedure:


First of all, the circuit seen in the schematic in the prelab above was constructed, as seen in the picture above. The oscilloscope window was then used to measure the capacitor voltage, and a constant DC of 5 V was applied to the system first. Then, the 5 V source was disconnected and reconnected a few times, and the graph of the voltage across the capacitor was determined. A trigger was used in order to keep the graph in the oscilloscope obtained by removing the DC source. This action is shown in the photo below:


Data:

 The graph of the voltage across the capacitor as a result of the disconnection of the 5 V DC source is shown below:


The same was then performed with a square wave voltage. The oscilloscope window is shown below:



Data Analysis/Conclusion:

Looking at the graph of the disconnection of the DC source, the voltage of the capacitor is about 3.45 V, which is very close to our calculated 3.44 V (a 0.291% difference). In addition, the time constant was found to be 240 / 5 = 48 ms, which is also very close the calculated value of 48.4 ms. (0.826 % difference). Looking at the slope of the voltage change, the voltage does not instantaneously change, which is correlating to a capacitor's behavior.

Looking at the graph of the 5 V to 0 V square wave signal, the voltage of the capacitor is about 3.48 V, which is very close to our calculated 3.44 V (a 1.16% difference). In addition, the time constant was found to be 100 / 5 = 20 milliseconds, which is also fairly close the calculated value of 15 ms. (25 % difference). Taking into account all of the assumptions and error in measurements and readings, the values are actually very close. In addition, looking at the slope of the voltage change, the voltage does not instantaneously change, which is correlating to a capacitor's behavior.

Passive RL Circuit Natural Response:

Purpose:

The objective of this experiment was to examine the response of a simple RL circuit to a sudden removal of a DC voltage source and to an applied alternating square voltage signal. It was expected that the response method used affects the measurement of the circuit.

Prelab:


In the prelab, the expected time constant for the RL circuit when the applied square voltage signal was zero was determined. This was done by finding the Thevenin resistance then dividing the inductance of the inductor by it. The time constant was found to be about 1.45 ns.

The same was done for when the constant voltage source was completely removed from the circuit. Doing so the time constant was different, and it was found to be 0.0213 us. In this circuit the Thevenin resistance is only the 47 Ohm resistor. The 100 Ohm resistor is on an open circuit branch and therefore is not seen by the inductor.

Apparatus:

The equipment used in this experiment consisted of a 1 uH inductor,  1 kOhm , 2.2 kOhm, 47 ohm and 100 ohm resistors, an analog discovery, a breadboard, a laptop with Waveforms, wires, a DMM and alligator clips.

Procedure:


First of all, the resistances of the resistors used in this circuit were determined and recorded, as seen in the prelab. Then, the circuit seen in the schematic in the prelab above was constructed, as seen in the picture above. The oscilloscope window was then used to measure the voltages across the two resistors, and a math channel was used to calculate the current across the inductor. First, a constant DC of 5 V was applied to the system first. Then, the 5 V source was disconnected and reconnected a few times, and the graph of the voltage across the capacitor was determined. A trigger was used in order to keep the graph in the oscilloscope obtained by removing the DC source. The circuit with the 1k ohm and 2.2k ohm resistors was then used with the 0 V to 5 V square wave signal to measure the voltages and current.

Data:

 The graph of the voltage across the capacitor as a result of the disconnection of the 5 V DC source is shown below:


The same was then performed with a square wave voltage. The oscilloscope window is shown below:


Data Analysis/Conclusion:

Looking at the graph of the disconnection of the DC source, the initial current across the inductor is 3.8 mA, which correlates with our prediction, since in DC an inductor acts as a short circuit. The reason there is minute current is due to the resistance and leakage current unaccounted for in the inductor . In addition, the time constant was found to be almost instantaneous, which is also very close the calculated value of 0.0213 us. There is no way to read the graph because it is so sudden. Looking at the slope of the current change, the current does not instantaneously change, which is correlating to a inductor's behavior.

Looking at the graph of the 5 V to 0 V square wave signal, the initial current in the inductor is very small, which correlates with our prediction since it acts as a short circuit in dc. Again the reason there is some minute current is due to leakage resistance in the inductor. In addition, the time constant was found to be too small to be measured, which agrees wit our calculated value of 1.45 ns. Taking into account all of the assumptions and error in measurements and readings, the values are actually very close. In addition, looking at the slope of the current change, the current does not instantaneously change, which is correlating to a inductor's behavior.

Wednesday, April 13, 2016

Day 15 4/12/16: Capacitors and Inductors

In lecture we started by looking at a "Ragebridge" motor controller. It consists of many FETs that are connected together using an "H" interface. When a battery is attached to it, the connector releases a large spark. This spark was found to be a result of the capacitor being charged. When it is uncharged at first, a large current runs through the circuit to charge the capacitor due to no resistance by previous charges on the current. As the capacitor charges further the current then drops due to repulsion of like charges. The amount of charge a capacitor can hold is proportional to the voltage across it, with a constant called capacitance that is unique to each resistor. Because a capacitor is two sheets separated by a distance in between, with usually a dielectric between the sheets, the capacitance is dependent on the area of the sheets and the distance between. A sheet with a larger area can hold more charge, which therefore increases the capacitance. On the other hand, a larger distance between the two sheets causes the attractive forces of the charges on each plate to be weaker, resulting in the charges being less easily packed, lowering the capacitance. Lastly, the capacitance is proportional to the permittivity of the dielectric, or how good it is at storing electrical energy in an electric field.

We then learned about different types of capacitors, such as electrolytic, ceramic, silver-mica, polyester film and super conductors. We then got more into the math of capacitors in a DC circuit. We learned that the current across a capacitor is equal to the product of its capacitance and the time rate of change of the voltage (dv/dt). By integrating current with respect to time we can then find voltage. Lastly, the energy of the capacitor is found by integrating power (voltage times current) with respect to time, which provides us that the energy is equivalent to half of the product of the capacitance and the squared voltage.

We then looked at more qualitative properties of a capacitor. For example, in DC a capacitor acts as an open circuit (i.e. it prevents current from running through the branch it is attached to. If a battery is connected to the capacitor, though, it will charge. In addition, the voltage of the capacitor cannot instantaneously be altered because it would require an infinite current, which is not possible. This is due to the nature of the capacitor to resist changes in voltage. Lastly, we learned that an ideal capacitor doesn't dissipate energy, but an ideal one does because it has a resistor connected in parallel. We then did a problem involving finding the energy of capacitors in a circuit.

After, we did a lab titled "Capacitor Voltage-Current Relations", where we looked at the behavior of the voltage of a capacitor in ac in relation with the current through the circuit. Both of these were controlled using time-varying signals. A sinusoidal wave and a triangular wave signals were used. We then did a problem about equivalent capacitance.

Next, we learned about inductors, which are coils of wire that store energy in a magnetic field. The voltage is found by multiplying inductance and the derivative of current. Inductance is like capacitance; it is the opposition to change in current. This leads to the fact that inductors cannot have an immediate change in current. Back to inductance, it depends on the square of the number of coils, permeability of the core, the inverse of the length of the wire, and cross-sectional area. The current in the inductor is 1/L times integral of vdt, and the energy is 1/2 times L times squared current. In dc, the inductor acts like a wire, so the voltage across it is zero.  In addition, an ideal inductor does not leake energy, but a real one does because it has some resistance in series.

LECTURE:



In the above picture we derived the energy of a capacitor using the power across a capacitor, which is the product of voltage and current.  Knowing that the energy is the integral of power with respect to time it was found to be half of the product of capacitance and the square of voltage.


In this problem we determined the voltage of a capacitor over time using the graph of current over time. Knowing that voltage is the inverse of capacitance times the integral of current with respect to time, the voltage graph was found. The slopes of the current graph were used to find the voltage graph. As can be seen in the graph, the voltage of a capacitor cannot be instantaneously altered because a capacitor resists changes in voltage.


In this problem the maximum amount of energy stored in each capacitor was solved for. This was done by first finding the voltages across each capacitor. Knowing that at dc the capacitor prevents any current flow through its branch, the circuit was redrawn. Then, by knowing that parallel components have equivalent voltage, the voltages across the 2 kOhm and 4 kOhm resistors were found using KVL to determine the voltages across the capacitors. Then, knowing that the energy of a capacitor is equivalent to half the product of voltage squared and capacitance, the energy of each capacitor was determined.


In this problem the equivalent capacitance was found. The equivalent capacitance of parallel capacitors is obtained by obtaining the sum of the individual capacitance values. On the other hand, the equivalent capacitance of series capacitors is obtained by finding the reciprocal of the sum of the inverse capacitance of each individual capacitor.

LAB:

Capacitor Voltage-Current Relations:

Purpose:

The purpose of this experiment is to look at the relationship between the voltage across a capacitor and the current running through it in an ac circuit. This lab was performed by applying sinusoidal and triangular wave voltage signals to a capacitor and resistor in series. The resulting voltage across the capacitor was then measured using an oscilloscope and the current across the circuit was determined using the voltage across the resistor and Ohm's Law (i = v / R). Because the resistor and capacitor are in series, the current through the resistor is the same as the current through the capacitor.

Prelab:



In the prelab, we determined the graphs of current running through the capacitor over time using the voltage graphs over time. Knowing the current in a capacitor is equivalent to the product of the capacitance and the derivative of voltage with respect to time, the current graphs with their corresponding amplitudes and frequencies were determined. For the sinusoidal voltage wave, the
corresponding current wave is a simple phase shift of pi over 4, along with a change in the amplitude. The new amplitude would include the product of the original amplitude (A), the capacitance (C), and  the angular speed, or just 2 pi divided by the period (T).

For the triangular wave, on the other hand, it is a different graph for current as a function of time. The current of a triangular wave voltage signal can be found by looking at the slope of the wave and multiplying that by the capacitance. The slope is positive or negative 4A/T, simply based on rise and run of the graph.

Apparatus:



The apparatus of this experiment consisted of an analog discovery, a 1 uF electrolytic capacitor, a 100 ohm resistor, a laptop with Waveforms, a breadboard, wires, a DMM and an alligator clip. All of these electrical components were used to produce a circuit with the resistor in series to the capacitor. The Wavegen voltage source (yellow wire) was attached to the open end of the resistor. Channel 1 was connected across the resistor and channel 2 was connected across the capacitor.

Procedure:


The circuit described in the apparatus section was constructed, as shown in the picture above. Channel 1 was used with the oscilloscope software to measure the voltage across the resistor as a function of time. Channel 2 was used to measure the voltage across the capacitor as a function of time. Wavegen 1 (W1) was used to apply the voltage time-varying signals to the circuit. Lastly, a math channel (M1) was created to use the voltage across the resistor to find the current running through the capacitor, using Ohm's Law.

Once the preparation was complete, a sinusoidal function of 1 kHz and an amplitude of 2 V centered at 0 was applied using W1. The oscilloscope was then used to measure the voltages and currents. The graph of the voltage across the capacitor and the current when this sinusoidal signal was applied is shown below:


The voltage across the capacitor is the blue graph and the red graph is the current in the circuit.

The same was done with a sinusoidal wave of 2 kHz frequency and a 2 V amplitude centered at 0 V. The graph is shown below:


The blue graph is still the voltage across the capacitor and the red graph is the current in the circuit. Again, the same was done with a triangular wave that has a frequency of 100 Hz and an amplitude of 4 V with an offset of 0 V. This graph is shown below:


Again, the blue graph is still the voltage across the capacitor and the red graph is the current in the circuit.

Data:


Above is a picture of the data obtained in this experiment. The true value of the resistor was found to be 98.7 ohms. In addition, when the sinusoidal wave with a 1 kHz frequency was applied to the circuit, the amplitude of the voltage across the capacitor was 1.75 V and the maximum current was 10 mA. Looking at the sinusoidal voltage wave with a 2 kHz frequency, the amplitude of the voltage across the capacitor is 1.25 V and the max current in the circuit is 15 mA. Lastly, for the triangular wave, the amplitude of the voltage across the capacitor is 4 V and the max current in the circuit is 1.5 mA. 

Data Analysis/Conclusion:

Looking at the graph of the sinusoidal wave with a 1 kHz frequency, both the voltage and the current are sinusoidal, which makes sense based on our prelab since the derivative of a sinusoidal function is a sinusoidal function. In addition, the phase angle of the capacitor is a difference of pi over 4 compared to the current, which makes sense since a cosine function leads/lags the sine function by pi over 4. Calculating the expected amplitude of the current graph based on the value for voltage and the relationship seen in the prelab (2*pi*f*C*A), a value of 11.0 was obtained. Our experimental value is reasonably close to the expected ( -9.96%), and the difference must be due to incorrect reading of the graph because the intervals were large. In addition, it is also due to resistance not accounted for in the capacitor and wires.

Looking at the graph of the sinusoidal wave with a 2 kHz frequency, as seen in the 1 kHz graph, the voltage and current graphs are also sinusoidal which makes sense for the same reason as above. In addition, the capacitor voltage leads/lags the current by pi over 4, which also makes sense due to the relationship between sine and cosine. The expected value of the maximum current for this circuit was found to be 15.7 mA, which is close to the obtained value of 15 mA (a percent difference of -4.51%). The difference is a result of unaccounted resistance and error in reading.

Looking at the graph of the triangular wave, the obtained graph for the current in the circuit has the same shape/form as the expected in the prelab, since the derivative of a constant slope is simply a constant. However, the graph does have a small slope and not a zero slope as expected, and this is due to reasons not explored yet. In addition, the expected value of max current was found to be 1.6 mA (4*A*C*f). Our experimental value is also close to the expected (-6.25% difference). Again, the difference is due to unaccounted resistance and errors in measurements. 

Saturday, April 9, 2016

4/8/16 Day 14: Cascaded Op Amp Circuits, Temperature Measurement System Design, Wheatstone Bridge Circuits, Digital-Analog Converters and Instrumental Amplifiers

We first learned about cascaded op amps, which is a circuit consisting of two or more op amps so that the output of one op amp is the input of another. The overall gain of such a connection is just the product of all the gains of each individual op amp. The total output voltage can also be found by isolating each op amp, analyzing and solving it, then putting all of the circuit back together with your already known values. We then did an example and a problem on cascaded op amps.

Next, we performed the lab titled "Temperature Measurement System Design", which is explained in more detail below under the "LAB" section.

After, we learned about digital-analog converters, which convert digital signals to analog forms. An example of such is the analog discovery kit we use in each lab. A digital analog converter at its core is simply a summing amplifier. Digital analog converters (DAC) can only have applied voltages of 0 V or 1 V. The amount of applied voltages and resistors in parallel is the number of bits. For example, a 4-bit DAC has 4 applied voltages and resistors in parallel. A DAC also has a most significant bit and a least significant bit. A most significant bit has the least resistance and a least significant bit has the most resistance.

Lastly, we learned about instrumentation amplifiers, which are cascaded op amp circuits at heart. It typically consists of three op amps, two being non-inverting and the third being a difference amplifier. When all of the resistors are made equal except for the gain-setting resistor Rg that connects the two non-inverting op amps, the gain of the instrumental amplifier is 1 + 2R/Rg. Instrumental amplifiers are really useful because they cancel out any offset voltages and any common-mode signals (i.e. noise).

LECTURE:



In this example, we simply determined the type of op amp in the cascaded op amp circuit. The op amps in boxes A and B were inverting and the one in box C was summing. The outputs of op amp A and op amp B were the input for op amp C. From there, the outputs of the op amps can be found and the total output of the cascade is the output of op amp C.


In this cascaded op amp circuit, the objective was to find the current io in the feedback resistor for the op amp to the right. To do so, the type of op amps used was determined. It was found that both op amps are non inverting. Then the output voltage of the op amp to the right was determined using the non-inverting op amp formula in order to find voltage at point a, which was found to be 1/10 V. Then, the same was done for the op amp to the right, and the voltage at point B was found, which was 7/20 V. Then, using nodal analysis the current io was found to be 1/40 mA.



In this problem, the output voltages for the DAC were determined at certain applied voltages in the three-bit DAC. In addition, the applied voltages were found for specific output voltages. When the applied voltages were [V1V2V3] = [010], the output voltage was found to be 0.5 V using nodal analysis. In addition, when [V1V2V3] = [110], the output voltage was 1.5 V. On the other hand, when the output voltage is 1.25 V, the applied voltages were found to be [V1V2V3] = [101] using nodal analysis. Lastly, when output voltage is 1.75 V, the applied voltages are [V1V2V3] = [111].

LAB:

Temperature Measurement System Design:

Purpose:

The objective of this experiment was to design a temperature measurement system that consists of a thermistor, a Wheatstone bridge and a difference amplifier connected together. The difference amplifier amplified the voltage difference between the two resistors on each branch in the Wheatstone bridge circuit. The thermistor was part of the Wheatstone bridge. In addition, the requirements of this design were as follows: The output voltage is 0 +/- 20 mV at room temperature, and as the thermistor is heated close to body temperature the output voltage should change by at least 2 V. Lastly, a temperature higher than room temperature should result in a positive output voltage, and a temperature below room temperature should result in a negative output voltage. The voltage will be an indicator of the temperature.

Prelab:



In the prelab, we designed the circuit consisting of the Wheatstone bridge and difference amplifier using an OP27. The Wheatstone bridge consists of four resistors total, a pair in series and both pairs parallel to each other, as shown above. The Wheatstone bridge we constructed contained a 5.6 kOhm resistor, a 12 kOhm resistor, the thermistor, and a potentiometer. The Wheatstone bridge used the change in resistance of the thermistor to convert the change to a change in voltage. On the other hand, the potentiometer was used to balance the Wheatstone bridge, meaning that to cause the voltages at point a and point b to be equal,resulting in an output of 0 V for the difference amplifier.

Using voltage dividers, the relationship between the voltage difference across points a and b and the applied power supply was derived, as shown below:


 Because our resistors R1 and R2 weren't equal, the equation differs slightly from the general. In this case, our R1 is the 5.6k ohm resistor, our R2 is the 12k ohm resistor, Rp is the potentiometer and Rt is the thermistor. It was found that the voltage across points a and b is dependent on only the change in resistance of the potentiometer and thermistor, assuming that the voltage source stays constant.

As can be seen, in order to obtain zero voltage across a and b, the potentiometer or a variable resistor will be needed. In order for the voltage Vab to be zero, the voltage across the potentiometer must be equal to the voltage across R1. To obtain this, the ratio between the resistances of R1 and R2 must be equal to the ratio of the resistances between Rp and Rt. Changing the resistance of the potentiometer until this ratio is achieved results in balancing of the Wheatstone bridge.

Apparatus:



The apparatus for this experiment consisted of a thermistor, an OP27 op amp, Logger Pro with a temperature probe, and the usual equipment, such as resistors, wires, the analog discovery, a DMM, a breadboard, alligator clips, a laptop with Waveforms and a marker and a board. The temperature probe with Logger Pro was used to measure the change in temperature of the thermistor.


Procedure:

Thermistor Characterization:

First, the resistance of the thermistor at room temperature 22.3 degrees Celsius) was measured using an ohmmeter (11.21 kOhms). The thermistor was then grasped tightly between two fingers to heat it up to the desired body temperature. However, it was only heated to 31 degrees Celsius, and the resistance dropped to 6.65 kOhms. 

Wheatstone bridge design and balance:

First of all, the resistances of each resistor used in the Wheatstone bridge was measured using an ohmmeter. These values are found in the data section below. Then, the actual Wheatstone bridge was built as seen below:


A closer look of the circuit is seen below, when the bridge is balanced. In it consists of the two resistors, the potentiometer, and the thermistor, as shown in the prelab design. 


A voltage source of 1 V was applied to the Wheatstone bridge. It was found that the Wheatstone bridge is balanced when the potentiometer has a resistance of about 5.34 kOhms. Looking at the ratio between the potentiometer and the thermistor at room temp versus the ratio between R1 and R2, they are nearly equal, resulting in the near balancing of the circuit at about 6.3 mV more or less. 

Next, the thermistor was heated to about 31 degrees Celsius, which was measured by Logger Pro and the temperature probe. This is shown below in the graph obtained of temperature over time:


At 31 degrees Celsius, the output voltage of the Wheatstone bridge was found to be 0.064 V. Below is a video showing the Wheatstone bridge in action:

 


Difference Amplifier:


First, the actual resistance values of the resistors used in the difference amplifier circuit were measured using an ohmmeter. The difference amplifier circuit, connected to the Wheatstone bridge, was built using the design made in the prelab. The total circuit is shown above. +5 V and -5 V were supplied to the OP27, and the same 1 V was added to the Wheatstone bridge. The inputs of the difference amplifier were placed at points a and b. When the Wheatstone bridge was balanced, the output voltage of the difference amplifier was 0.01 V.  When the thermistor was gain heated to 31 degrees Celsius by firmly grasping it between two fingers, the output voltage increased to 2.05 V. All of this data is found below in the data section.

Below is a video of the entire circuit (difference amplifier and thermistor) in action:




Data:

In the picture below, the data obtained in the entire lab is contained, such as measured resistances, the resistance change of the thermistor at room and body temperatures, the reisstance of the potentimeter when the Wheatstone bridge is balanced and output voltages at room and body temperatures.


Data Analysis:

Looking at the Wheatstone bridge, the voltage across points a and b was zero when the ratio between the potentiometer (5.34 kOhms) and thermistor (11.21 kOhms) was nearly identical to the ratio between the first resistor (5.61 kOhms) and the second resistor (11.95 kOhms). 

In addition, analyzing the difference amplifier, the ratio between the feedback resistor and the resistor seen by Va was the same as the ratio between the resistor going to ground and the resistor seen by Vb, as must be in a difference amplifier's design. In addition, looking at the theoretical gain and actual gain of the difference amplifier, they are not equal. The theoretical gain is the ratio between the feedback resistor and the resistor seen by voltage at point a (39.2) is not equal to the experimental gain, which can be found by dividing the output voltage of the difference amplifier by the voltage across points a and b. The experimental gain is calculated to be 32.0. This is due to the difference amplifier having offset voltages and generally noise. This is just a result of the design of the op amp and the quality of its build.

Conclusion:

Overall, the experiment was a success. The starting output voltages at room temperature were in the range of 0 +/- 20 mV. In addition, the output voltage of the difference amplifier increased by a minimum of 2 V over the temperature range between room and body temperatures. Lastly, when the temperature was increased, the output voltage was positive, and when it decreased, the output voltage was negative, which followed the design requirements. The only problem faced was that the experimental gain was not equivalent to the theoretical gain, which again is just due to the quality of the build of the op amp and any offset voltages or noise experienced by it.