ECE 2A Lab #6 Lab 6 First-Order RC/RL Circuits Overview This lab will explore the transient response of simple RC and RL circuits to understand the role of the time constant. In the process we will introduce the based concepts of differentiator, integrator, and frequency filtering circuits. We will then combine the RC time constant material with an earlier comparator circuit from Lab #4 to create a simple timer. Table of Contents Background Information Capacitors Inductors References Pre-lab Preparation Before Coming to the Lab Required Equipment Parts List In-Lab Procedure 6.1 RC Circuits RC Time Constant The Circuit as an Integrator The RC Circuit as a Low-Pass Filter An RC Differentiator Circuit 6.2 RL Circuits RL time constant An RL differentiator/High-Pass Filter 6.3 A Simple RC Timing Circuit 2 2 3 4 5 5 5 5 5 5 5 6 6 7 7 7 7 8 1 © Bob York 2 First-Order RC/RL Circuits Background Information Capacitors Capacitors are made from a layer of insulating material sandwiched between two conducting sheets. The total capacitance generally scales with the materials and geometry according to C r A (6.1) d where r is an intrinsic property of the insulator called the “dielectric constant”, d is the thickness of the insulator, and A is the net surface area of the conducting sheets. Large capacitors therefore require a large sheet area and thin insulators with the maximum possible dielectric constant. Capacitors are usually classified according to the type of insulating material that is used. “Film” capacitors use a thin film of material such as polypropylene, polystyrene, Teflon, Mylar, etc. These films are then stacked together with metal electrodes (either a separate foil or a thin layer of metal coating on the film). “Ceramic” capacitors use a high dielectricconstant material, generally barium titanate or some related ceramic material, which is mixed in a thin paste between metal electrodes and then hardened together (“fired”) in a hightemperature furnace. “Electrolytic” capacitors use a thin oxide layer on one of the electrodes (usually aluminum oxide on aluminum) as the insulator, with a liquid electrolyte used to insure an intimate contact between the second electrode and the oxide. Figure 6-1 illustrates some of the common capacitor types. Film Capacitors Ceramic Electrolytics • Low loss, low leakage • Larger than ceramics, but tighter tolerance and better performance for a given price • Small size, High voltage • Tolerance, temp. dependence, leakage, etc. vary strongly with material; cost tradeoff • Very high capacitance density • ±20% tolerance • Large size, poor loss and leakage characteristics Figure 6-1 – Comparison of commonly-available through-hole capacitor types. It is difficult to control the capacitance values precisely during the manufacturing process, so capacitors are specified for a certain “tolerance”. The statistics are essentially the same as we discussed for resistors, and the same system of values applies for capacitors: E6 for ±20%, E12 for ±10%, etc. Electrolytic capacitors usually have a poor tolerance, typically ±20%, but ceramic and film capacitors can be obtained with tighter tolerances. There are two very important practical issues with capacitors that you need to be aware of. One is the voltage rating: This is the maximum voltage that the capacitor can withstand for some period of time. If this voltage is exceeded the insulating material will fail and a large current could flow, destroying the device. The second issue is polarity: some capacitors, notably electrolytics and tantalum capacitors, are not reversible; they must be inserted in such a way that any DC voltage will appear across its terminals in a specified polarity. So care © Bob York 3 Background Information must be taken when inserting them in a circuit—a polar capacitor mounted in the wrong way will self destruct. In the case of electrolytics, this happens because one voltage polarity promotes a chemical oxidation-reduction process between the electrolyte and the insulating oxide Value and voltage rating printed on package that slowly destroys the insulator. Electrolytics have been known to erupt rather dramatically Long-lead is “positive” when biased improperly. For this reason, polar capacitors usually have some marking on the package to indicate the correct insertion; Figure 6-2 illustrates the markings for a typical “-” sign on package indicates “negative” lead electrolytic capacitor. In a circuit schematic polar capacitors are usually indicated by a “+” sign on Figure 6-2 – Symbol for a polar capacitor one terminal as shown. and associated markings for electrolytics. There are several other non-idealities that affect the behavior of capacitors in circuits. Unfortunately too many to discuss here in any great detail! They suffer from leakage currents, vary with temperature and humidity, and may have some problems at high frequencies. These issues will not be critical in ECE 2, but they are important factors for engineers to understand and deal with in commercial designs. In ECE 2 we will generally use inexpensive ceramic capacitors for small-values (<1μF) and electrolytics for the larger values (>1μF). The actual capacitance value is marked in a variety of different ways. For electrolytics the value is usually stamped clearly as shown in Figure 6-2. For ceramics and film Third “multiplier” digit capacitors a three-digit code is more commonly used, illustrated in Figure 6-3. 10 104 pF 105 pF This code gives the value in picofarads ( 1pF 1012 F ). Beware that this is not 100nF First two the only capacitor code in use! Sometimes “value” digits 0.1 F there is a 4-digit number which represents the actual value in pF (i.e. no multiplier), and other times a decimal value is shown (like “.033”) which is the capacitance in Figure 6-3 – Three-digit code used for most of the μF! Sometimes (but not always) there is a ceramic capacitors in ECE 2. letter following the code that indicates the tolerance, and sometimes (but not always) the voltage rating is shown. To further complicate things, many modern devices are so tiny and the lettering so small and faint that it is often hard to see the markings unless you have especially good eyesight (a magnifying glass is a good investment for this line of work!). If the markings are confusing or ambiguous, out advice is to go MEASURE the capacitance. In the ECE 2 lab there is an “LCR” meter that will measure a wide range of capacitor and inductor values. Inductors Inductors are usually made by coiling wire around some cylindrical or toroidal (doughnutshaped) form. This winding form is often (but not always) a solid magnetic material such as iron or iron-oxide (“ferrite”) called the “core”. The total inductance usually varies with the material and geometry according to L r N 2 A (6.2) 4 First-Order RC/RL Circuits where r is an intrinsic property of the core material called the “magnetic constant”, N is the number of turns of the wire, A is the average area of each turn, and is the overall length of the winding. Large inductors therefore require a lot of turns, a large turn area, and a core with a large r . In some respects inductors are very uncomplicated devices—after all, what could be simpler than a coil of wire? But some complexity is hiding in the physics of the core material which ultimately plays a significant role in the I-V characteristics of the device. Most magnetic core materials lead to nonlinear behavior at certain current levels, and also can limit the maximum operating frequency of the devices. But there are two even more basic problems with inductors: 1) they are HUGE in comparison to other circuit components, and 2) they do not lend themselves easily to mass production and hence do not benefit from the same economies of scale that other passive components enjoy. Because they are so big and expensive they are used sparingly in modern microelectronics, mostly found today in applications such as power-electronics (e.g. switch-mode power supplies, AC-to-DC and DCto-DC converters), high-frequency chokes, high-power filters, and certain radio circuits. Solenoidal Inductors Toroidal Inductors • Inexpensive, low-profile • Limited range of inductance values • Poor confinement of magnetic fields • Wide range of inductance and power handling • Good confinement of fields • Larger and more expensive than solenoidal inductors Figure 6-4 – Comparison of common inductors. We remarked earlier that capacitors have an inconsistent marking system. Inductors are even worse—most have no markings at all! In addition there is no consistent set of values like the decade-based systems used with resistors and capacitors (E6, E12, E24, etc.); the availability of certain values seems to be driven by demand and are very application-specific. So the only good recourse for an experimentalist is to measure the inductance directly with an LCR meter. But note: because the properties of the core material depend strongly on the amount of current in the windings, most inductors are designed to have a certain inductance at some specified DC current level, and it is not uncommon for inductances to vary significantly around this nominal specification at other current levels. References ■ http://en.wikipedia.org/wiki/Types_of_capacitor ■ http://en.wikipedia.org/wiki/Ceramic_capacitor ■ http://en.wikipedia.org/wiki/Electrolytic_capacitor ■ http://en.wikipedia.org/wiki/Inductor © Bob York Pre-lab Preparation 5 Pre-lab Preparation Before Coming to the Lab □ Read through the details of the lab experiment to familiarize yourself with the components and testing sequence. □ One person from each lab group should obtain a parts kit from the ECE Shop. Required Equipment ■ Provided in lab: Bench power supply, Function Generator, Oscilloscope, Decade Box ■ Student equipment: Solderless breadboard, and jumper wire kit Parts List Qty 1 2 1 2 Description 10mH 19DCR power inductor PC mount tactile switch 0.01uF 50V ceramic capacitor, radial lead 100uF 25V electrolytic capacitor, radial lead We will also use the 741 op-amp, LEDs, and selected resistors from earlier labs In-Lab Procedure 6.1 RC Circuits RC Time Constant □ Build the RC circuit shown in Figure 6-5, using the decade box for the resistor, R, and the 0.01 μF capacitor in your kit. Note that the 50 Ω resistor is just shown for reference—it represents the internal resistance of the Input Output function generator. You can verify the (Ch1) (Ch2) 50Ω R capacitor value using the LCR impedance meter in the lab. Adjust the output of the Vg function generator to a 1 kHz square wave, C Vin Vout with an amplitude of 1V (2 volts peak-toFunction 0.01μF peak). Be sure that the DC offset switch Generator on the function generator is off (pushed in) and that the vertical scope inputs are DC coupled (not AC coupled). It will be Figure 6-5 – A simple first-order “RC” circuit. convenient to view the input and output signals simultaneously on the oscilloscope screen, which is accomplished by the connections shown below. Set the vertical positions so that the 0 volt (ground) level is the center of the screen for both channels: □ Starting with R=100 Ω, observe and record the input and output waveforms. They should be similar. Now increase the resistance to 5 kΩ and record the resulting waveforms in your notebook. Physically the series resistance limits the flow of current so the voltage 6 First-Order RC/RL Circuits across the capacitor rises more slowly as the resistance is increased. Expand the time to zoom in on one transition, and use the cursors on the oscilloscope to estimate the time constant, , from the waveform; remember, is time it takes for the voltage change by 1 e1 63% of the total step voltage (final value minus initial value). Compare with the theoretical prediction based on the RC product. Another figure of merit commonly used in such cases is the rise-time, tr , and fall-time, t f , defined as the time it takes for the signal to progress from 10% to 90% of the total step size (final value minus initial value). The rise time can be expressed as tr ln □ 0.9 2.2 RC 0.1 (6.3) Use the cursors again to estimate the risetime/falltime and compare with the prediction of (6.3). For this measurement it may help to adjust the vertical sensitivity so that the waveform fills the screen. The Circuit as an Integrator □ Now increase the resistor to 20 kΩ. The time constant is now longer than the duration of the square pulse so the output waveform does not quite reach the peak value of the input waveform. Increase the resistance again to 100 kΩ and record the resulting waveform in your notebook. You will probably have to adjust the vertical scale since the peak amplitude will continue to shrink. Can you understand what is happening? The output is now approximately a triangular wave, which is essentially integral of the input signal. Verify that the circuit is acting as an integrator by changing the input waveform to triangular and sine waves, making appropriate plots of both in your notebook. The important point here is that there are two time-periods involved: the RC time constant , and the time-period T of the square wave excitation. For T we see the full RC charging transient after every transition, but for T we only see the initial linear part of the charging transient, and hence the circuit functions as an integrator. □ In the above steps we adjusted the value of the resistance to observe the integrator behavior. Alternatively we could keep the resistor fixed and change the frequency instead. At approximately what frequency will the circuit behave as an integrator for a resistor value of 10kΩ? Verify your answer experimentally using a square-wave excitation. The RC Circuit as a Low-Pass Filter Our focus so-far has been on the transient response of the RC circuit due to a step function excitation (the leading and falling edges of the square-wave). But for sinusoidal (AC) excitation the output will also be sinusoidal, so it makes more sense to focus on how the amplitude or phase changes as a function of frequency. Switch the function generator to a sinusoid with a 1V amplitude (2V peak-to-peak) and zero DC offset. Starting with a frequency of 100 Hz, record the output amplitude versus frequency up to 100 kHz, using R=5 kΩ. Since we are covering several decades of frequency it is best to choose the frequencies appropriate to a log scale like this: 100 Hz, 200 Hz, 500 Hz, 1 kHz, 2 kHz, 5 kHz, etc. Take data quickly; this step should not last long. In your lab report you will plot your results on a log scale in frequency. In the context of sinusoidal signals the simple RC circuit of Figure 6-5 is called a “low-pass filter”, because low frequency signals will pass through but high frequency signals get □ © Bob York 7 RL Circuits strongly attenuated. There are many uses for filters in electrical engineering; a simple and familiar example is the cross-over network in an audio speaker system or surround-sound system, which directs low frequency audio to the big “sub-woofers”. An RC Differentiator Circuit By simply switching the placement of the capacitor and resistor as shown in Figure 6-6 the operation of the circuit can be changed significantly. □ C 50Ω Vg 0.01μF Vout Vin Build this circuit, and drive it with a 1 kHz R Function square wave using a 5 kΩ resistor. Sketch Generator the resulting waveforms in your notebook. Can you see that the circuit is now acting as a differentiator? Prove this to yourself by Figure 6-6 – RC (high-pass) circuit. changing the excitation to triangular and sine waves. Then using the square wave signal again, zoom in on one of the transitions by adjusting the time base. Can you identify any characteristic property of the network from the shape of this signal? 6.2 RL Circuits The RL circuit is very similar to the RC circuit in terms of the mathematical form of the response, despite very different physical mechanisms involved. Therefore we will not examine this case quite as thoroughly: RL time constant □ Build the circuit of Figure 6-7 using a 10mH inductor and a 100 Ω resistor. As before, drive the circuit with a 1 kHz square wave and estimate the time constant. Compare with the theoretical prediction. Can you reconcile the data with the theory? Try to identify extra sources of resistance in the circuit. Sketch the waveforms in your notebook and compare with the earlier RC circuits for similarities. L 50Ω 10mH Vg Vin R Vout Function Generator Figure 6-7 – RL (low-pass) circuit. An RL differentiator/High-Pass Filter □ □ Now switch the order of the inductor and resistor to construct the circuit of Figure 6-8, this time using a 1 kΩ resistor, and verify the action of this circuit as you did earlier for the RC differentiator circuit. This circuit also functions as a high-pass filter, because only high frequency signals go through without attenuation. Show that this is true by taking data over frequency for 50Ω R Vg Vin Function Generator L 10mH Figure 6-8 – RL (high-pass) circuit. Vout 8 First-Order RC/RL Circuits a sine-wave excitation as you did earlier in connection with the RC low-pass filter. In your lab report you will make a careful plot of this data.. 6.3 A Simple RC Timing Circuit Time constant circuits arise in a number of different contexts in electrical engineering. One particular application is a simple timer function where the RC charging time is exploited to create a known time-delay. +5V The circuit in Figure 6-9 +5V 510Ω combines a very simple RC R circuit (inside the dashed box) Yellow 10kΩ with the op-amp comparator circuit that we examined in Lab LM741 100μF #4. A simple adjustable voltage divider circuit is used to set the C Switch Vref Red reference voltage for the comparator, Vref . The circuit -5V 510Ω functions as follows: with the switch open the capacitor is +5V charged to +5V, and since this is 1kΩ 10kΩ potentiometer always Vref the output will stay in its high state (near +5V), Figure 6-9 – A simple LED timer circuit. lighting the red LED. When the switch is pressed the capacitor is quickly discharged to 0V and the output goes low, switching on the yellow LED. The capacitor then begins to charge up again through resistor R. The output stays low until the voltage across the capacitor reaches Vref , at which point the red LED is switched back on. So the yellow light is on for a short period of time after the button is pressed, and this time period is set by the RC time-constant and Vref . wiper + □ Start building this circuit by first mounting the 741 op-amp and establishing the proper bias. Refer to the data sheet for the pinout, and use ±5V for the power supplies. □ Next, add the 10k trimpot and 1k resistor, then add the LEDs and 510 Ω bias resistors. The resistors and LEDs are leftover parts from earlier labs. Lastly add the RC timing network and the pushbutton “tactile” switch. Note: this is our first circuit using a large electrolytic capacitor, so be sure you are familiar with the Figure 6-10 – Typical pinout for a tactile pushbutton switch. relevant material from the background section; electrolytics must be inserted in the correct polarity!! The tactile switch we are using is called a “momentary on” switch, meaning that it is normally off until someone presses the button. A typical pinout is shown in Figure 6-10, but you should use your ohmmeter to make a simple continuity test to verify the correct pin connections. □ © Bob York 9 A Simple RC Timing Circuit □ Now turn on the power-supplies and adjust the potentiometer to 5(1 e 1 ) 3.16 V . This sets the threshold voltage such that the time period is exactly one time constant. After the power-supply has been on for a few seconds the red LED should be on, and the yellow LED should be off. □ Now press the button and release it. Use your watch to monitor how long the yellow LED stays lit, and compare this with the theoretical prediction based on RC . □ Can you calculate the Vref that would be needed to keep the yellow LED alight for two time constants? Adjust the potentiometer accordingly and verify your design. Include the details of the calculation in your lab report. □ Now design the timer so that the yellow LED stays lit for 10 seconds. You will need to use a different charging resistor R. Calculate the necessary R and Vref and verify your design experimentally. Include the details of the calculation in your lab report. Congratulations! You have now completed Lab 6 As noted in the previous lab: keep all your leftover electrical components! Amplitude, Volts Notes on the Report In your report, you should (wherever possible) compare the theory and experiment, and discuss why the circuits behave as they do for different combinations of resistance (time constant) and frequency. For example, in the case of the RC circuit with a square-wave excitation the output waveform 10 closely resembles the input waveform when T ; this 1 occurs because the charging or discharging transients are 0.1 completed well before the next pulse transition occurs. Be sure 0.01 to include any necessary mathematics to support you’re 0.001 answers. If you use a result 0.0001 from your textbook, reference 1 10 100 1000 10000 100000 the relevant equation number Frequency, Hz and/or page. Programs like Matlab, Figure 6-11 – Example of a log-log (Bode) plot in Excel. Mathematica, etc. can and should be used wherever possible. For the output voltage-versus frequency plots you should use a log-log scale. Figure 6-11 shows a log-log plot done in Excel (the file for this plot is on the course web site, as well as a brief excel tutorial). The time constant you found in connection with the RL Time Constant section should have differed noticeably from what you would predict based on the resistance shown in the schematic. Be sure to explain a possible source of this difference.