Lecture 2 Analog circuits Seeing the light.. I t
IR light V1 9V +V IR detection Noise sources: Electrical (60Hz, 120Hz, 180Hz.) Other electrical IR from lights IR from cameras (autofocus) Visible light Q1 OP805 Vout RL Vout ~ mv What we want: 0 5 V DC signal representing the IR amplitude. t
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Analog circuits filtering and detection IR DC Amplify Filter detect block Can put these together into a single circuit But today we ll keep them separate for clarity. Peak detect
DEMO TIME IR DC Amplify Filter detect block Peak detect
Debugging Circuits Learn to systematically check your circuits: Power rails: Check that 15V is really 15V; if not, localize the component that is shorting the power rail. Check power at each chip. Physical check: Check pinouts, missing/loose wires, etc. Isolate stages where possible Check output of stage 1 if ok plug into stage 2 and see if stage 1 output is degraded. If ok, check output of stage 2 etc Keep wiring TIDY!
Lab 2 Tips Capacitors electrolytic capacitors have polarity, may explode if inserted backwards or have negative charge. Do not use if voltage can go negative! (e.g. some filters) Buffer amplifiers (aka unity gain amplifiers) used to to separate different stages which may interfere with one another + - (marked with stripe) Gain make sure that gain does not saturate the signal, this will generate unwanted noise after filtering. Sharp corners have highfrequency noise Saturation looks like DC signal!
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Analog circuits discrete devices: BJT Application: light detection Phototransistor: Acts like BJT except charge carriers generated by incident light add to the base current. V1 9V +V I c Q1 OP805 Vout In other words, I c Incident light RL
IR detection Build a circuit that: Uses an OP805 and a resistor to detect variations in light with a voltmeter. Determine whether increasing or decreasing the load resistance makes it more sensitive Note: OP805 will see some room light use your hand to block it, and use the voltmeter to detect the change in signal.
+ Selecting R L. Vout = I c * R L
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Analog circuits DC block (aka high-pass filter) Capacitors: Block DC Pass high frequencies
DC block (high-pass filter) Imaging adding a DC block to your photodetector circuit: Which circuit is better? Why? 1) C1 470 nf 2) C1 470 nf
DC Block / high-pass filter Build the following circuit: What does R2 do? Why can t you use an electrolytic capacitor in C1?
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Analog circuits filtering and detection What is the result of the following: Z 2 /Z 1 = 3 Z 1 + - V out Z 2 V out = 1) 3) 2) 4)
Analog circuits: Op-amps Eg: Inverting amplifier. + Vin Z 1 V- - Vout V - = 0 I 1 = V in/ Z 1 I 1 Z 2 V out = 0 Z 2 I 1 Eg 1: Z 2 = 100kW Z 1 = 10kW Eg 2: Z 2 = 100kW V out = - 10 V in Z 1 = 1 W V out = - 100,000 V in!! V out = - (Z 2 /Z 1 ) V in 10x gain is a reasonable value Not likely.
Analog circuits: Real Op-amps + Vout Vin Z 1 V- - I 1 Z 2 Eg 2: Z 2 = 100kW Z 1 = 1 W V out = - 100,000 V in!! Several problems: I 1 = 1A for V in = 1 V!! (excessive load for upstream circuitry) Gain Bandwidth product ~ 3 MHz. This would limit the bandwidth of the amplifier from DC up to 30 Hz (i.e. not a very responsive system!).
Analog circuits: Real Op-amps Things to consider: Input impedance Gain Bandwidth product Bias Currents Voltage limitations Output current limitations Vin Inverting Op-Amp Amplifier Z 1 I 1 + Vout V- - Z 2 Since V - is a virtual ground, input impedance seen by V in is Z 1
Analog circuits: Real Op-amps Things to consider: Input impedance Gain Bandwidth product Bias Currents Voltage limitations Output current limitations Vin Buffer Amplifier aka unity gain amplifier V- + - Vout Since Op-amp inputs source or sink very little current (depends on type), input impedance in this case is very high. This is a commonly used buffer to separate your low impedance circuit from a sensitive source that you need to measure without drawing current.
Analog circuits: Real Op-amps Things to consider: Input impedance Vin Z 1 V- + - Vout Gain Bandwidth product Bias Currents I 1 Open loop gain (K) Z 2 Voltage limitations log K Output current limitations Slew-rate is a similar limit: it is a limit on the rate of change of output voltage 20 100 khz Frequency log w Gain-Bandwidth limit (Hz) = Gain * Max. Frequency = CONSTANT
TL082: Gain*Bandwidth = 3 MHz This means that at a gain of 100, Bandwidth is 30 khz.
Analog circuits: Real Op-amps Things to consider: Input impedance Gain Bandwidth product Bias Currents + Vout Voltage limitations Vin Z 1 V- - Output current limitations I 1 Op-amp terminals can act as small current sources. These Bias Currents can become large error or offset voltages if the resistors in the circuit are large. Eg: 20 na bias current * 10 Mohms = 200 mv! Z 2
Things to consider: Analog circuits: Real Op-amps Input impedance Gain Bandwidth product Bias Currents Voltage limitations V+ V- + - +Vcc -Vcc Vout Output current limitations Op-amp input voltages (V +, V - ) must be at least a few volts away from the power rails (+Vcc, -Vcc). Applying input voltages equal or near the power rails will cause the Opamp to behave unexpectedly. Rail-to-rail Op-amps are an expensive solution to this limitation.
Analog circuits: Real Op-amps Things to consider: Input impedance Gain Bandwidth product V+ V- + - +Vcc -Vcc Vout Bias Currents Voltage limitations Output current / voltage limitations Op-amp output terminals can only provide a few ma of current. Motors, lamps and similar high current devices cannot typically be driven by a normal OP-amp. High power Op-amps exist that can provide much higher current levels. Output voltage range is also limited within a few volts of the power rails.
Summary: Analog circuits: Real Op-amps Keep resistors in 1K to 500K range unless you really know what you re doing. Don t ask a single amplifier to provide huge gains (>30?) Don t drive motors, lamps, or other heavy loads with a normal op-amp (power op-amps exist for this, or use a transistor) Keep input voltages away from the op-amp voltage rails (unless using rail-to-rail opamps)
Build a circuit that: Inverting Op-amp Wire a TL082 as an inverting amplifier with 3.3 gain Use the potentiometer as input and the voltmeter to measure the output Use both 9V batteries What happens when the output or input gets close to the battery voltage? -9 to 9V adjustable Signal (set near zero) Test output with voltmeter
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Analog circuits: Filters To understand filters you should first understand the difference between the TIME DOMAIN and FREQUENCY DOMAIN
Which is the correct match between the following time-domain (left) signals and their Fourier Transforms (right)? a) i) 1) a-i, b-iv, c-ii, d-iii t f 2) a-ii, b-iv, c-iii, d-i b) ii) 3) a-iii, b-iv, c-i, d-ii c) iii) 4) a-iv, b-ii, c-iii, d-i d) iv)
Analog circuits: Filters Demo: Frequency generator and Spectrum analyzer Frequency Generator signal ground Spectrum Analyzer
Analog circuits: Filters Transfer Function = Vout/Vin = H(w) So: V out (w) = H(w)*V in (w) This is all in terms of w since, in general, impedances are functions of w. Z capacitor = 1/j w C Z inductor Z resistor = j w L = R Similar to voltage divider: except w dependent. Frequency Generator V in Z 1 V out Z 2 Spectrum Analyzer ground
V out (w) = [V in (w)/(z 1 +Z 2 )]*Z 2 So: H(w) = Z 2 /(Z 1 +Z 2 ) Analog circuits: Filters H( w) Z 1 Z 2 Z 2 For resistors, this is similar to the expression for the voltage divider: R 2 /(R 1 +R 2 ) Frequency Generator V in Z 1 V out Z 2 Spectrum Analyzer ground
Analog circuits: Filters Now plug in a resistor and a capacitor: Z 2 = 1/j w C Z 1 = R H ( w) 1/ jwc R 1/ jwc 1 1 jwrc Z 1 Frequency Generator Vin R1 33 k 100 k Vout C1 50 nf 100 nf Spectrum Analyzer Z 2
Analog circuits: Filters H( w) 1 1 jwrc For low frequencies (small w), H = 1 For high frequencies (large w), H = 0 This is a LOW PASS FILTER Tip you should always think about limits when thinking about filter behaviour At w = 1/RC, H begins to decrease in amplitude. Z 1 Frequency Generator Vin R1 33 100 k Vout C1 50 nf 100 nf Spectrum Analyzer Z 2 f 0 = 1/(2pRC) = 30 Hz
Analog circuits: Filters Vin C1 Vout R1 How does this circuit affect the following waveform: 1) 3) 2) 4)
Active Band Pass Filter Analog circuits: Active Filters R1 C1 Z 1 Combines a high and a low pass filter to create a pass band. R2 C2 U1 TL082 H = - (Z 1 /Z 2 ) Z 2 Expand this in the frequency domain to get H( w) (1 jwr1c 2 jwr C )(1 2 2 jwr C 1 1 ) We can analyze this analytically, but a graphing tool is more useful to see how this filter operates. We will use Bode Plots.
Analog circuits: Transfer Functions Bode plots: a graphical representation of frequency response on logarithmic axes. Vertical axis: 20log 10 (H) (20 is used instead of 10 so the result will represent power ~ V 2) -3 db = ½ as much power as 0 db V out is 1/ 2 of V in at -3dB Horizontal axis: log 10 (f) Log of frequency is used to ensure linear plots from 1/f or 1/f n functions Pole: 1/(1+j w / w 0 ) -20 db/decade in amplitude after w 0, -90 phase Zero: (1+j w / w 0 ) +20 db/decade in amplitude after w 0, +90 phase
Analog circuits: Transfer Functions Bode plots: a graphical representation of frequency response on logarithmic axes. Zero at w =0 H( w) (1 jwr1c 2 jwr C )(1 2 2 jwr C 1 1 ) Pole at w =1/(R 2 C 2 ) Pole at w =1/(R 1 C 1 ) Pole: 1/(1+j w / w 0 ) -20 db/decade in amplitude after w 0, -90 phase Zero: (1+j w / w 0 ) +20 db/decade in amplitude after w 0, +90 phase
Bode Plot: Analog circuits: Simple Pole 1 H ( w) 1 jwrc -3dB, 1/RC -20db/decade - 45 deg, 1/RC -90 deg
Analog circuits: Simple Zero Bode Plot: H( w) 1 jwrc +3dB, 1/RC +20db/decade +45 deg, 1/RC +90 deg
Analog circuits: Active Filters 20log( H ) 20log(R 1 /R 2 ) db (1) (2) Idealized Bode Plot: For detection, we only care about magnitude. For control systems, we would also care about phase. (1) (1) (2) (3) 20db/decade 0 db (2) 1/(R 2 C 2 ) 1/(R 1 C 1 ) Pole at w =1/(R 2 C 2 ) H( w) (1 jwr1c 2 jwr C )(1 2 2 w Zero at w =0 (1) jwr C 1 1 ) (3) Pole at w =1/(R 1 C 1 )
Analog circuits filtering and detection Band Pass IR DC Amplify Filter detect block R1 R1 R1 C1 C1 C1 High pass R2 C2 U1 TL082 R2 C2 U1 TL082 R2 C2 U1 TL082 Use multiple stages to get steeper filter roll-offs H tot (w) = H 1 (w) * H 2 (w) *H 3 (w) Remember 20dB/dec for each POLE
More advanced filters: Biquad Higher performance filter, but much harder to debug (cannot separate and examine the stages individually). 49
Analog circuits filtering and detection IR DC Amplify Filter detect block Peak detect
Peak Tracking Circuit (aka envelope detection) DIODE rectifier circuit Blue is the input, Red is the output. RC time constant sets the amount of ripple. RC is small, lots of ripple. RC is long, will be slow in responding to changes in amplitude. These are ideal outputs. In reality, the diode has a 0.7V forward drop. All outputs (red) should actually be drawn 0.7V lower. How to correct for this? Image from Concepts in Engineering
Peak Tracking Circuit SUPER-DIODE rectifier circuit This circuit acts like a perfect diode, without the 0.7V deadband prior to turn-on. What is a good value for R1C1 time constant for ENPH 253?