Office Hours (very tentative): Tuesday, 8:30AM–10:30AM (alternatively, you can e-mail me for an appointment)Syllabus: PDFTo make sure I get your e-mail, begin the subject with ECE209: or at least put 209 somewhere in the subject. An automatic filter will make sure your mail gets to me ASAP (rather than being marked as spam).
Week Date Topic 1 Sep 30 Lab 0: Course Overview 2 Oct 7 Lab 1: Introduction to the Digital Oscilloscope and Function Generator (pre-lab due) 3 Oct 14 Lab 2: Meters, Measurements, and Errors (quiz) 4 Oct 21 Lab 3: Introduction to Operational Amplifiers and Step and Frequency Response of First-Order Circuits (quiz) 5 Oct 28 Lab 4: Frequency Response of First-Order Active Circuits (quiz) 6 Nov 4 Lab 5: Properties of Second-Order Circuits (pre-lab due) 7 Nov 11 Veterans Day Observed — No class. 8 Nov 18 Lab 6: Nonlinear Circiuts: Diode and Transistor Switch (quiz) 9 Nov 25 Lab 7: Digital-to-Analog (D/A) Application (quiz) 10 Dec 2 Final Exam (in class)
Contents |
SOURCE CODE: I use LaTeX to generate the documents that I use for this class. I also export a public slice of my source control (i.e., docs but no tests) to the web so that you can view the source directly. Check out http://hg.tedpavlic.com/ece209/ to see the source "code" for the lab resources.
LICENSING AND REUSE: Unless otherwise expressly stated (e.g., on examination materials), all original material of whatever nature created by Theodore P. Pavlic and included in this website and any related pages, including its archives, is protected by copyright and licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License ("CCPL"). Use of this website is expressly conditioned upon the user's acceptance of the terms and provisions of the CCPL. Use of this site and any of the materials thereon constitutes acceptance of the CCPL by the user. Students enrolled in ECE 209 may reuse or modify portions of the materials without attributing the content to its original author so long as it is being used to generate a submission to the original author (e.g., the use of a schematic on a lab report to be submitted to T. Pavlic); otherwise, this web page URL, the URL of the source document, or the author's name can be cited as the source of the work.
% Store the frequency data in f vector. f = [1 2 10 20 30 40 50 60 70 80 90 100]*1000; % Store the measured RMS output data in rms vector. rms = [1.998 1.99 1.789 1.414 1.109 0.894 0.743 0.633 0.549 0.485 0.434 0.392]; % Convert RMS output data to gain by dividing by input RMS (2 Vrms). gain = rms/2; % Convert gain to deciBels (0 dB is unity gain). gaindB = 20*log10( gain ); % Plot the deciBel data on a semilog plot (makes hyperbolic 1/f asymptotes look linear). semilogx( f, gaindB, '.-' ); % Add a grid. grid on; % Add axis labels (with units!) and title. xlabel( 'Frequency (Hz)' ); ylabel( 'Gain (dB)' ); title( 'Gain magnitude for HP 972A DVM' ); % Use the figure's "File" menu to save the figure in a desirable % file format (e.g., EPS or PNG) for inclusion in your report.
% Store the frequency data in f vector. f = [1 2 10 20 30 40 50 60 70 80 90 100]*100; % Store the measured peak-to-peak input data. vipp = [2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0]; % Store the measured peak-to-peak output data. vopp = [1.996 1.984 1.694 1.245 0.937 0.739 0.607 0.513 0.443 0.390 0.349 0.314]; % Store the measured vertical intersection data. deltaY = [0.125 0.247 0.901 0.975 0.828 0.687 0.578 0.496 0.432 0.383 0.343 0.310]; % Calculate gain vector in dB (./ is element-by-element division). gaindB = 20*log10( vopp./vipp ); % Calculate phase shift for LPF (in degrees). phase = -asin(deltaY./vopp)*180/pi; % % Alternatively, calculate phase shift for HPF (in degrees). % phase = asin(deltaY./vopp)*180/pi; % For theoretical curves, generate more frequency points. ftheory = linspace( min(f), max(f), 1000 ); % Generate s for each frequency. s = j*2*pi*ftheory; % For transfer function, store R and C values (change as necessary!). R = 10000; C = 0.01e-6; % Evaluate LPF transfer function at each ftheory. H = 1./(s*R*C + 1); % % Alternatively, evaluate HPF transfer function (uncomment). % H = s*R*C./(s*R*C + 1); % Theoretical gain. gaintheorydB = 20*log10( abs(H) ); % Theoretical phase (in degrees). phasetheory = angle(H)*180/pi; % Put magnitude plot in top row of 2 row by 1 column figure. subplot(2,1,1); % Plot the deciBel gain data on a semilog plot. semilogx( f, gaindB, '.-', ftheory, gaintheorydB, '--' ); % Add a grid. grid on; % Add axis labels (with units!) and title. xlabel( 'Frequency (Hz)' ); ylabel( 'Gain (dB)' ); title( 'Gain magnitude' ); % Put phase plot in bottom row of 2 row by 1 column figure. subplot(2,1,2); % Plot the phase data on a semilog plot. semilogx( f, phase, '.-', ftheory, phasetheory, '--' ); % Add a grid. grid on; % Add axis labels (with units!) and title. xlabel( 'Frequency (Hz)' ); ylabel( 'Phase shift (degrees)' ); title( 'Phase shift' ); % Use the figure's "File" menu to save the figure in a desirable % file format (e.g., EPS or PNG) for inclusion in your report.
Likewise, the expressions needed to evaluate the HPF phase and HPF transfer function are% Calculate phase shift for LPF (in degrees). phase = -180 - asin(deltaY./vopp)*180/pi; % For theoretical curves, generate more frequency points. ftheory = linspace( min(f), max(f), 1000 ); % Generate s for each frequency. s = j*2*pi*ftheory; % For transfer function, store R and C values (change as necessary!). R1 = 33000; R2 = 100000; C = 200e-12; % Evaluate LPF transfer function at each ftheory. H = -(R2/R1)./(s*R2*C + 1); % Theoretical gain. gaintheorydB = 20*log10( abs(H) ); % Theoretical phase (in degrees) --- subtract 360 for delay semantics. phasetheory = angle(H)*180/pi - 360;
% Calculate phase shift for HPF (in degrees). phase = -180 + asin(deltaY./vopp)*180/pi; % For theoretical curves, generate more frequency points. ftheory = linspace( min(f), max(f), 1000 ); % Generate s for each frequency. s = j*2*pi*ftheory; % For transfer function, store R and C values (change as necessary!). R1 = 33000; R2 = 100000; C = 200e-12; % Evaluate HPF transfer function at each ftheory. H = -R2*C*s./(s*R1*C + 1); % Theoretical gain. gaintheorydB = 20*log10( abs(H) ); % Theoretical phase (in degrees). phasetheory = angle(H)*180/pi;
% Define transfer function parameters
R = 1e3;
L = 0.5;
C = 0.01e-6;
% Define Laplace-domain variable s (as transfer function object)
s = tf('s');
% Define transfer function
H = ( 1/(L*C) )/( s^2 + (R/L)*s + 1/(L*C) );
% % Alternatively, could use:
% H = tf( [ 1/(L*C) ], [ 1 (R/L) 1/(L*C) ] );
% Generate step response in first figure
figure(1);
step( H );
grid on;
% Generate Bode plot in second figure
figure(2);
bode( H );
grid on;
The following example is identical to the
previous one, but it overlays three responses on top of each
other with different line styles.
% Define three cases
R1 = 1e3; L1 = 0.5; C1 = 0.01e-6;
R2 = 10e3; L2 = 0.5; C2 = 0.02e-6;
R3 = 20e3; L3 = 0.5; C3 = 0.03e-6;
% Define Laplace-domain variable s (as transfer function object)
s = tf('s');
% Define three transfer functions
H1 = ( 1/(L1*C1) )/( s^2 + (R1/L1)*s + 1/(L1*C1) );
H2 = ( 1/(L2*C2) )/( s^2 + (R2/L2)*s + 1/(L2*C2) );
H3 = ( 1/(L3*C3) )/( s^2 + (R3/L3)*s + 1/(L3*C3) );
% Overlay three step responses in first figure
figure(1);
step( H1, 'b-', H2, 'g--', H3, 'm-.' );
grid on;
legend( 'H_1', 'H_2', 'H_3' );
% Overlay three Bode plots in second figure
figure(2);
bode( H1, 'b-', H2, 'g--', H3, 'm-.' );
grid on;
legend( 'H_1', 'H_2', 'H_3' );
Over the quarter, I will collect tips from our daily lab experience and post them here. I start the list with tips collected during my experience teaching ECE 327.
The oscilloscope's "max" and "min" measurements find the most extreme data points available in the sampled data. A sampled square wave that quickly oscillates from 1 V to -1 V might have "ringing" overshoot transient that make its maximum and minimum values closer to 2 V and -2 V. In contrast, the "top" and "base" measurements look for the most statistically prevalent values. They are a "filtered" version of the maximum and minimum that gives the "steady-state" values. So for the same triangle wave, the "top" and "base" will be 1 V and -1 V, as expected.
If you don't see a difference between "base" and "min" (or "top" and "max"), it's probably because your sampled waveform has very little overshoot and so the two measurements agree.
Note that a poorly calibrated 10:1 probe can cause ringing even when no ringing exists in the actual signal. If you are seeing a lot of ringing for all signals you try, then your probe may need some adjustment. See the tip below about ringing on 10:1 probes.
What kind of probe are you using? Is it a 10:1 probe? Is it a 1:1 probe? Whatever type of probe it is, your oscilloscope channel's probe setting must be set to agree with it.
Press the channel button (either 1 or 2) and look for a "Probe" soft key at the bottom-right of the screen. It will let you set it to 1, 10, or 100. Set it for the type of probe you have.
Remember that 10:1 probes have 9 times the impedance of the oscilloscope at all frequencies. As a consequence, they act like a 1/10 voltage divider at all frequencies. Their benefit is that they draw less current from the circuit and they treat all frequencies the same way. In contrast, a 1:1 probe draws 10 times the current from the circuit and creates a voltage divider which filters out high frequencies.
Make sure your function generator is calibrated for high output impedance load. Look for a HIGH Z [1, 2] mode in the output settings (also called output termination). After changing this setting, go back to your waveform settings and enter the correct amplitude.
- Recall from your electromagnetics classes (e.g., ECE 311/312) that transmission lines must be terminated to prevent reflections. Conventional terminating loads are 50 ohms, which means that a function generator on one of these lines must drive a 50 ohm load. So, the function generator designers have embedded a 50 ohm load as the output impedance of the scope and purposely deliver twice the desired amplitude. When connected to a 50 ohm load, the resulting voltage divider provides the right amplitude because it has a gain of 0.5.
- In our class, load impedances (e.g., inputs to amplifiers) are much higher, and so the resulting voltage divider with the 50 ohm output impedance has near unity gain. Telling the function generator about our "HIGH Z" load prevents it from doubling the output.
- NOTE: When you change to "HIGH Z" mode, the function generator will change your output setting to twice its original amplitude. You will need to readjust it.
- Keep in mind that there is always a voltage divider at the output of the function generator, and so it is always best to use your digital multimeter (DMM) or your oscilloscope to tweak the function generator's output.
Use a 10x (or x10 or 10:1) probe to increase the high-frequency impedance seen by the device under test (DUT).
- The capacitance of a standard 1x (or 1:1) probe creates a low-pass filter. A 10x probe adds series capacitance and resistance to compensate for this effect.
- The extra resistance of the probe is almost exactly 9x the input resistance of the scope, and so the signal on the scope is scaled by a tenth. Use the scope's probe settings to automatically scale it to fix this.
The probe may need to be compensated. Please do not attempt this task yourself on the lab probes. However, recognize how it is done and file it away in your long-term memory for the next time you see ringing on a scope.
Your breadboard came with screw terminals for a reason. Banana plug connectors can plug into the terminals. Thus, setup your power rails by running wires from the three or four banana terminals on your board. When you're ready, plug your power supply into the banana connectors directly. It's much more convenient.
Unfortunately, many students throw away their banana connectors rather than attaching them. In the future, assemble your breadboards completely; they work better that way.
On the other hand, die-hard high-frequency analog prototypers will abandon breadboard use entirely for setting up "dead-bug" circuits on a bare copper ground plane. This practice, which places chips upside down making them look like dead bugs, can improve performance but is less flexible (it can require glue in some cases, and will definitely require solder). In our lab, using big enough bypass capacitors (see "Power supply noise" tip above) is the closest we'll get to low noise prototyping.
Every real operational amplifier (OA) has a small current imbalance between its inputs that manifests itself like a small DC source connected to one of the inputs. It is this additional signal that is causing your output to do strange things.
There are several ways to go about balancing operational amplifier input currents. For example, most OA's have "balance" pins that can be used to null the offset with a potentiometer. Before you build your circuit but after you wire power to your operational amplifier, you tie the outer legs of the potentiometer to the two balance pins, and tie the wiper to the negative rail. Short the inputs of the OA together, and adjust the pot wiper until zero appears on the output (when the operational amplifier is powered on, of course). When balance pins are not available, a very similar procedure can be used to add or subtract a small offset to the inputs of the OA.
Even after calibrating the OA input offset, you may still see output offsets (especially if you adjusted the operational amplifier when it was removed from the rest of the circuit). Even when currents into the OA are equal, if the equivalent resistance to ground differs, those equal currents will generate unequal input voltages. So try tricks to make the resistances looking out of the inputs look similar. For example, instead of shorting your non-inverting input to ground, tie it to ground with a resistor. Adjust the resistor size until your offset goes away.
Keep in mind that OA offset varies with temperature and can drift with time. One of the reasons why electronics are "burned in" at the factory is to reduce the rate of drift (here, I have voltage references in mind). Therefore, nulling offset is a much more complicated problem in a product that has a lifetime longer than one class time.
Use a bypass capacitor across your power rails and possibly near your circuit elements.
- Choosing the size and type of each of these can be complicated.
- A good rule of thumb is to put pretty large capacitors (e.g., multiple microFarads) at the central power rails and slightly smaller (e.g., 0.001–0.1 microfarads) on the power pins at each component.
Stray parasitic capacitance is everywhere. In fact, the pins of an IC and the air between them form a capacitor of at least a few picoFarad. If you can, try to choose circuit elements that dominate over or compensate for these strays.
If setting an RC, choose a low R to give you a high C; however, realize that the low R may result in a higher power draw from your circuit.
Potentiometers are often used as two-terminal devices in this laboratory as variable resistors. Instead, try using all three terminals. A potentiometer is nothing more than a voltage divider, and the screw moves the output of the voltage divider (the middle pin) from the high voltage to the low voltage. If you need to tune a voltage divider, just use a potentiometer instead!
Keep in mind that you should probably choose a potentiometer with a size that only draws a few milliamps at most from your circuit. Even though you probably only care about the resistance ratios, you should care about the current draw (and power dissipation) as well. If not for any other reason, it will keep you from getting blisters when you touch your circuit.
Make sure that you didn't swap your collector and emitter (i.e., make sure you don't have your transistor plugged in backwards).
Take a look at the "Arrangement of n-Doped and p-Doped Regions" in Figure 1.2 of the lab text. As you can see, the only difference between the emitter and the collector are the "size." The base-emitter diode is "small" and the base-collector diode is "large." As a consequence, a transistor "works" when emitter and collector are reversed, but the current gain will be very low (e.g., the collector current might be equal to the base current). Our models of a transistor assume that the current gain is relatively infinite, and so they will poorly predict how a circuit will work in the other case.
Because of the "size" of the base-emitter diode, it is easy to reach the reverse breakdown voltage of the base-emitter diode if it is connected improperly. So, hooking a transistor up "backwards" can either damage the transistor or simply produce a poorly performing circuit.
Great reference for advanced students. Classic electronics reference. Highly respected. The [analog] electronics bible.
Standard microelectronics text. More focus on younger undergraduate student audience. Lots of details, but very little breadth. Poor reference for advanced students. In fact, so many details are given that the text can be a poor reference for novices as well.
This website presents lengthy discussions of circuits for beginners. The discussions are interesting and include helpful animations that treat electric potential like fluid flowing into and out of resistors. There are also sections that are meant to be displayed on a whiteboard, and so those pages read like lectures.
There are too many good pages to list here, so I give the site as a reference for those who wish to gain deeper understanding of analog electronics. You might want to start looking at the master index of circuits ("circuit stories").
This web page is a treasure trove of useful circuit information.