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. 

No comments:

Post a Comment