Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Lesson: Applications of Operational Amplifier Lesson Developer: Dr. Arun Vir Singh College/ Department: Shivaji College, University of Delhi Institute of Lifelong Learning, Delhi University Page 1 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Table of Contents Chapter: Applications of Operational Amplifier: Nonlinear Circuits: Lesson IIDifferentiator and Zero-Crossing Detector 1.1 Introduction 1.1.1Basic Differentiator 1.1.2 Frequency Response Of Ideal Op-Amp 1.1.3 Limitations 1.2 Practical Differentiator 1.2.1 Frequency Response Of Practical Op-Amp 1.2.2 Output for Various Input Waveform 1.23 Applications of Differentiator 1.3 Zero- Crossing Detector 1.3.1 Inverting Zero-Crossing Detector 1.3.2 Noninverting Zero-Crossing Detector Summary Exercise Glossary References Institute of Lifelong Learning, Delhi University Page 2 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector 1.1 Introduction Op-amp can be used not only for linear circuits like voltage amplifiers, adder, subtractor amplifier, and current sources but also for nonlinear circuits such as integrator (discussed in lesson-I), differentiator, wave shapers, and comparators. Output of nonlinear circuits is different from input signal. In this lesson we shall discuss differentiator and zero-crossing detector. Differentiation is the counterpart to integration. Differentiator performs the mathematical operation of differentiation. This operation is used to (i) extract edges from square waves, (ii) convert sine waves into cosine waves and (iii) triangular waves into square waves. In these applications op-amp is used with negative feedback. But in other applications, such as comparators, Schmitt Trigger, voltage level detectors and zero-crossing detector op-amp is used in an open-loop configuration. 1.1.1Basic Differentiator A basic differentiator is constructed by interchanging the resistor and the capacitor of an integrator, or it may also be obtained if the input resistor R1 is replaced by a capacitor C1 in a basic inverting amplifier. Figure 1 shows the differentiator amplifier. We know that a capacitor does not allow a dc current to pass through it, so time varying sources (sine, cosine, triangular etc.) is applied to inverting ‘-‘ (pin-2) terminal . Noninverting terminal ‘+’ (pin-3) is grounded. Fig.1 Basic differentiator Developed by:ILLL Institute of Lifelong Learning, Delhi University Page 3 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector By applying Kirchhoff’s current law (KCL) at node N. [1.1] Since IB is very very small. So the current flowing through the input capacitor the current flowing through the feedback resistor . So is equal to [1.2] The current through the capacitor is related to voltage by the relation [1.3] is the voltage across the capacitor, given by Substituting for [1.4] in Eq.[1.3] [1.5] Current through the feedback resistor [1.6] Substituting Eqs.[1.6] and [1.5] in Eq. [1.2] In the case of ideal op-amp gain ( above equation is infinite, so can be substituted in the [1.7] Thus output voltage is product the negative instantaneous rate of change of the input voltage or the derivative of the input wave form with . The product is called the time constant of the differentiator. The negative sign indicates that there is a phase shift of 180o between input and output wave forms. This differentiator circuit only has current flowing in the input when there is change in V in. When there is no change in the input voltage, no current will flow and the output voltage V o will be zero. The basic differentiator circuit only produces an output whenever there is a change in the input signal. Faster the input voltage changes, larger the magnitude of output Institute of Lifelong Learning, Delhi University Page 4 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector voltage. This is useful in control circuits where rapid response to a change in the control variable is necessary. 1.1.2 Frequency Response of Ideal Op-Amp Applying Laplace Transformation to Eq. [1.7] ,we can write Expression of frequency response can be obtained by replacing Hence the gain (A) of the differentiator is, To get the frequency response obtain the magnitude of the gain which is [1.8] So at very low frequency such as dc. (f=0) the gain is zero. As frequency increases, gain also increases. The expression for the gain can be written as [1.9] where , a constant quantity . Institute of Lifelong Learning, Delhi University Page 5 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig. 2 Frequency response of basic differentiator :Developed by :ILLL Developed by: ILLL When , in Eq.[1.9], dB is given by or 20 log A=0 dB. Hence the frequency at which gain is 0 [1.10] It is evident from Eq.[1.8] ,that with the increase in frequency gain increases. The frequency response of an ideal differentiator is shown in figure 2.It can be seen from the response curve that for, , the ration . Hence at , the gain becomes 0dB and for frequencies 20dB/ decade. is negative. While gain increases at the rate of 1.1.3 Limitations Gain Instability Gain of the differentiator increases with the increase in frequency, see Eq.[1.8]. This makes the circuit unstable and break into oscillations. There is possibility that op-amp may go into the saturation. Noise Magnifier With the increase in frequency input impedance of capacitor ( ) decreases. So the circuit becomes very sensitive to high-frequency noise. After amplification, the noise signals completely override the differentiated output signal as illustrated in figure 3. Institute of Lifelong Learning, Delhi University Page 6 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig:3 Noise override the differentiated output. Source: http://www.e-bookspdf.org/download/differentiator-amplifier.html So shape of the output signal will not be what we have expected. i.e. spikes are produced at output. Hence the differentiator suffers from the limitations on its stability and noise problem at high frequencies. Therefore, it is usually avoided in practice. However, solutions are available to reduce the limitations without losing the desired wave form. 1.2 Practical Differentiator The basic differentiator is not generally usable in its present form [see Fig. 1], because of its limitations [See.sec 1.1.3].Hence it is necessary to modify the circuit. Figure 4 shows a practical differentiator circuit that overcomes the limitations of the ideal circuit. There are two modifications to the circuit (basic differentiator, Fig.1), both of which results in the formation of frequency filters. In this figure resistor (i) R1 is connected in series with capacitor C1 [1st modification] The effect of this resistor is to act as an attenuator for the high frequency components, and (ii) a capacitor Cf is connected in parallel with feed-back resistor Rf (2nd modification). At low frequencies capacitor behaves like an open circuit and acts as a short circuit at high frequencies, so Cf doesn’t impact the Institute of Lifelong Learning, Delhi University Page 7 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig.4 Practical differentiator: Developed by :ILLL operation of the circuit at low frequencies, It acts as a short in parallel with Rf in the feedback path for the high frequency components of the input signal. 1.2.1. The Frequency Response Of Practical Differentiator The frequency response of practical differentiator is illustrated in figure 5. It can be seen that in frequency range f to fb ,the gain increases at the rate of 20dB/decade. However, a decrease in gain is observed at the rate of 20dB/decade after fb. This 40dB/decade change is caused by the combination of R1C1 and RfCf. fb is known as gain limiting frequency and is given by [1.11] where Thus the effects of high-frequency input noise and offsets reduces significantly by the combination of and . Generally, the value of and in turn and values should be selected such that Institute of Lifelong Learning, Delhi University Page 8 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig.5.Frequency response curve of practical differentiator. Developed by:ILLL where For proper differentiation of input signal, the time period T of the input signal is larger than or equal to RfC1. That is, To use the practical differentiator, the highest frequency expected to be differentiated must fall into this part of the circuit response. As "a rule of thumb" for designing a practical differentiator, set fc to be 10 times the highest frequency encountered. Value addition: Did you know? Gain limiting frequency derivation: Body Text: Gain of practical integrator shown in Fig.4 is . Institute of Lifelong Learning, Delhi University (i) Page 9 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector where (ii) (iii) Substituting eq.(ii) and (iii) in eq. (i) If , then (iv) The frequency (f=fb) at which the frequency response of practical differentiator starts decreasing 20dB/decade (Fig.5) can be determined by equating the denominator of equation (iv) to zero. Therefore , where and f=fa can be negative. Therefore Since Suggested Reading: Op-amp and linear Integrated Circuits: Ramakant A. Gayakwad,3rd Edition. 1.2.2 Output Waveforms (i) Positive Ramp For simplicity of understanding, assume that the product =unity. Let the input wave form is of positive ramp of magnitude of A unit is shown in figure 6a. Mathematically it can be expressed as Institute of Lifelong Learning, Delhi University Page 10 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig.6 .(a) If Step input signal (b) Spike output wave form =1, then from eqn.[1.7] [1.12] This is because A is constant. Actually the step input takes finite time to rise from zero to A. Due to this finite time, the differentiator output is not zero and is shown in figure (6b). It is a negative going spike output. (ii) Square Wave The square wave input signal is made of two step inputs (i) a positive step between time period 0 to T/2 and (ii) a negative step for time period T/2 to T and is shown in figure (7a). Mathematically it can be expressed as Institute of Lifelong Learning, Delhi University Page 11 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig: (7a) Square wave input (7b) output spike: Developed by :ILLL As discussed earlier the output for the positive step input is negative spike so for the period 0 to T/2 output is negative going spike and for the period T/2 to T output is positive going spike .Output wave form is shown in figure (7b) and in animation 1. Animation 1 Animation 1: Differentiated waveform of square wave. Developed by:ILLL Institute of Lifelong Learning, Delhi University Page 12 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector (iii) Sine Wave Differentiated waveform of sine wave is shown in animation 2. Animation 2: Differentiated waveform of sine wave. Developed by:ILLL (iv) Triangular Wave Differentiated waveform of triangular wave is square wave and is shown in animation 3. Animation 3: Differentiated output of triangular wave. Developed by:ILLL Institute of Lifelong Learning, Delhi University Page 13 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector 1.2.3 Applications of Practical Op-amp 1. In the wave shaping circuits. 2. As a rate of change of detector in F M demodulator. 3. In analog computers and PID controllers. 1.3 Zero-Crossing Detector A comparator, as the name implies, compares the amplitude of one voltage (signal voltage) with another fixed voltage (reference voltage). Reference voltage may be positive or negative or zero. In case of a zero reference voltage comparator is used as a zero-crossing detector or zero-crossing comparator. Depending upon to which terminals, the input is applied; the zero-crossing detectors are classified as, (i) Noninverting and (ii) Inverting zero-crossing detector. 1.3.1 Basic Principle Op-amp as a comparator is shown in figure 8. Fig:8. Op-amp as a comparator Comparator output is given by expression. [1.13 ] where Ao is open loop gain, V1 is voltage at noninverting (+) terminal and at (-) is inverting terminal of op-amp. Institute of Lifelong Learning, Delhi University V2 is voltage Page 14 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector If any one of the terminal is grounded or at zero potential, then comparator shown in Fig.[8] is called zero-crossing detector/ comparator. Output ) may be saturated at a level of + or . Value Addition: Did you know? Characteristics of comparators Body Text: Output voltage of comparators is given by the expression In this application, these two voltages, V1 (applied at + terminal, pin-3) and V2 (applied at – terminal, pin-2) are compared and output ) may be + or , depending upon which input is the larger. Ao is open loop voltage gain. Noninverting Comparator: For this configuration, time-varying signal ( ) is applied at noninverting ‘+’ (pin-3), terminal and a fixed voltage or reference voltage ( ) is applied to inverting ‘- ‘(pin-2), terminal. For positive voltage it is called noninverting comparator with positive reference voltage and if the reference voltage is negative then it is called noninverting comparator with negative reference voltage. In this case V1=Vin and V2= Vref. Hence output voltage is given by . Inverting Comparator: For this configuration, time-varying signal ( ) is applied at noninverting ‘-’ (pin-2), terminal and a fixed voltage or reference voltage ( ) is applied to inverting ‘+‘(pin-3) terminal. If reference voltage is positive then it is called inverting comparator with positive reference voltage and for negative reference voltage it is called inverting comparator with negative reference voltage. In this case V2=Vin and V1= Vref. Hence output voltage is given by The characteristics of these comparators are summarized in the table. Comparator configuration Non-inverting Output ( ) for Ref. Voltage Vref positive Vin < Vref -Vsat Vin > Vref + Vsat Institute of Lifelong Learning, Delhi University Page 15 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Non-inverting Negative + Vsat -Vsat Inverting Inverting positive negative + Vsat -Vsat -Vsat + Vsat Suggested Reading Op-amp and linear Integrated Circuits: Ramakant A. Gayakwad,3rd Edition. Electronic Devices by Thomas L. Floyd,6th Edition 1.3.2 Inverting Zero-Crossing Detector Fig. 9 Zero crossing detector Developed by :ILLL The op-amp in figure 9 operates as a zero-crossing detector in which reference voltage is applied to noninverting ‘+’ (pin-3) terminal and sinusoidal input voltage ( ) is applied at inverting ‘-’ (pin-2) terminal of op-amp. The input voltage ( is compared with a reference voltage of 0V . In figure and . Substituting for and in Eq. [1.13], Output of zero-crossing detector is [1.14] For ideal op-amp Ao is very high, so output gets saturated at Institute of Lifelong Learning, Delhi University . Page 16 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector If is positive, output will be saturated at .i.e .The output wave forms along input signal and reference and for negative voltage are shown in figure 10 . Fig:10. The output wave forms along input signal and reference voltage for inverting zero-crossing detector. Source: Developed by ILLL In the regions ‘a to b’ and ‘c to d’, input signal passes through zero to positive direction, the output is driven into –Vsat. Conversely when input signal passes through zero to negative direction (b to c), the output switches to +Vsat. Output wave is rectangular and inverted.ie. out of phase with respect to input. This circuit is also called sine to square wave generator. 1.3.1 Noninverting Zero-Crossing Detector Noninverting zero-crossing detector is illustrated in figure 11. A triangular wave instead of sinusoidal input voltage ( ) is applied to noninverting ‘+’ (pin-3) terminal and reference voltage is applied to inverting ‘-’ (pin-2) terminal of op-amp. From figure and Output voltage is obtained by substituting for V1 and V2 in Eq.[1.13]. Institute of Lifelong Learning, Delhi University Page 17 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig.11- Noninverting zero-Crossing Detector Developed by: ILLL Hence [1.15] For ideal op-amp Ao is very high, so output will be saturated and is equal to .If is positive and for negative . Plot of output wave form, input signal and reference voltage as a function of time is shown in animation 4 Animation 4:. Plot of output wave form, input signal and reference voltage as a function of time for noninverting zero-crossing detector.. Institute of Lifelong Learning, Delhi University Page 18 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Developed by ILLL In the regions ‘ a to b’ and ‘c to d’, input signal passes through zero to negative direction, the output is driven into -Vsat. Conversely i.e when input signal passes through zero to positive direction ( b to c,d to e ), the output switches to +Vsat. So a triangular wave is also converted into square wave. Output wave is in phase with input wave. Value Addition: Did you know? Effect of noise on zero-crossing detector Body Text : In many practical situations, noise (unwanted voltage fluctuations) appears on the input line. This noise voltage becomes superimposed on the input voltage, as shown in figure a, below for the case of a square wave superimposed over triangular wave. Figure a: Noise voltage superimposed over triangular wave Source: Self /Developed by: ILLL In order to understand the effects of noise voltage, a low-frequency triangular voltage is applied to the noninverting pin of zero-level detector, as shown in Fig.[9]. The input signal voltage is drawn both with and without noise in figure b. Institute of Lifelong Learning, Delhi University Page 19 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Fig:C: Effect of noise on zero-crossing Developed by :ILLL In the figure C the resulting output are shown. It can be seen in the time interval a to c the behavior is as expected as shown (noninverting zero-crossing detector) in fig.10. But when Vin approaches Vref very slowly or actually hovers close to V ref, =0 V,( at point d, e, f,g,h and i), Vo can either follow all the noise voltage oscillations or burst into high frequency oscillation or we can say that the fluctuations due to noise may cause the total input to vary above and below reference voltage (0 voltage ) several times, thus producing an erratic output voltage. Suggested Reading: Electronic Devices by Thomas L. Floyd,6th Edition. SUMMARY : After analyzing this section ,you should be able to Analyze the operation of differentiator. Sketch the output wave forms of a differentiator Understand the limitations of basic differentiator. Modify the basic differentiator. Explain the frequency response of differentiator. Discuss the operation of a zero-level detector. Institute of Lifelong Learning, Delhi University Page 20 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Discuss how input noise affects zero-crossing detector. Name the several types of comparator circuits. 1.In a differentiator, the feedback element is a (a) resistor (b) capacitor (c) zener diode (d) voltage divider 2.When a triangular waveform is applied to the input of a differentiator, the output is (a) a dc level (b) an inverted triangular waveform (c) a square waveform (d) the first harmonic of the triangular waveform 3. The output of a differentiator is proportional to (a) the RC time constant (b) the rate at which the input is changing (c) the amplitude of the input (d) answers (a) and (b) 4.. Basic differentiator fails to work at (a) low frequency b) high frequency c) medium frequency 5. In a zero-level detector, the output changes state when the input (a) is positive (b) is negative (c) crosses zero change (d) has a zero rate of EXERCISES Question Number Type of question 1 Multiple choice questions Correct answers (1). A (2). C (3). D (4). B (5).C Question Number Type of question 2 Fill in the blanks 1. In a practical differentiator, a resistor is connected in ----------with the capacitor. Institute of Lifelong Learning, Delhi University Page 21 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector 2. Differentiation of a ramp input produces a --------- output with an amplitude proportional to the ------. 3.Differentiator is ------ filter. 4. In the case of practical differentiator the gain increases at ----- from frequency f to ----. 5. . The output of a comparator has ------- states Correct answers (1) series (2) step., slope (3) high pass (4) 20dB/decade, fb or Gain limiting frequency. (5) two Question Number Type of question 3 Subjective questions 1. How is the output of a differentiator related to the input? 2. Explain the working of practical differentiator. 3.Draw the output wave forms of differentiator circuit when the input is i) Cosine wave, ii) Step input and iii) square wave. 4. What are the limitations of basic differentiator? 5. Discuss the frequency response of basic differentiator. 6. What do you mean by bandwidth of a differentiator? 7. What is importance of resistor in differentiator? 8. What is the effect of noise differentiator circuit? 9. What are the applications of differentiating circuit? 10 What is difference between practical differentiator and ideal differentiator? 11.Sketch a zero-crossing detector and describe its theory of operation Question Number Type of question 4 Unsolved problem 1. For the basic differentiator circuit shown in figure 1(sec-1.1.1). (C1=100μf and Rf=10 Institute of Lifelong Learning, Delhi University Page 22 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector kΩ) Determine (i) expression for output voltage and (ii) the output voltage for the given input shown below. 0.2V 0.1sec 2. For a basic differentiator, the input is a sine wave with peak to peak amplitude of 4V at 50Hz. Sketch the output wave form. 3. For a basic differentiator circuit, [c1=0.001 μf ,Rf=2 kΩ ], input is a triangular wave shown below [ t2=2μsec]. Determine the output and sketch its waveform in relation to the input. 4. An op-amp has the following specification (i) open-loop gain of 60,000. (ii) dc supply voltages ± 15V, (iii) maximum saturated output levels are ± 12V and Vref= 0V. If a differential voltage of 0.1 mV rms is applied between the inputs, what is the peak-topeak value of the output? 5. Draw the output voltage waveform for the circuit in shown below with respect to the input. Show voltage levels. . Solutions 1.Ans : (i) Answers. voltage is zero. (ii) -2V , For t > 0.1sec,the input is constant so that output Sol:. (Ans) (ii)Input signal is straight (increasing) between 0 to 0.1 sec. . (Ans) For t > 0.1sec,the input is constant so that output voltage is zero. (Ans) Institute of Lifelong Learning, Delhi University Page 23 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector 2 Ans : (Ans) Sol: f=50 Hz, T=0.02 sec, Hence (Ans) 3.Ans: (i) (ii) Ans. Square wave,of amplitude to 2V Institute of Lifelong Learning, Delhi University Page 24 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector Sol Given: , , . (i) Positive going ramp is from 0 sec to t 1 sec i.e ( 1sec) Rate of change = (i) Negative going ramp is from t1 sec to t2 sec i.e ( 1sec) Rate of change is negative = Ans. Square wave,of amplitude to 2V 4. Ans: (Ans) This is less than the maximum output swing voltage ±12V. So output will not be saturated. (Ans) , using relation , (Ans) This is less than the maximum output swing voltage ±12V. So output will not be Institute of Lifelong Learning, Delhi University Page 25 Applications of Operational Amplifier: Non Linear Circuits: Lesson-II Differentiator and Zero-Crossing Detector saturated. 5.Ans. Saturated Output . . GLOSSARY Differentiator: A circuit that produces an output which approximates the instantaneous rate of change of the input functions. Comparator: A comparator compares the amplitude of one voltage (signal voltage) with another fixed voltage (reference voltage). Node: A point where two or more circuit elements meet. Inverting amplifier: A amplifier in which amplified output voltage is inverted with respect to input voltage . Noninverting amplifier: A amplifier in which the input signal is applied to the noninverting terminal. Frequency response: Graphical representation of variation of gain with frequency of input signal. Gain: The ration of output and input voltage/ current. Critical frequency: The frequency at which the response of an amplifier is 3 dB less than at midrange. Bode plot: A graph of the gain in dB versus frequency used to illustrate the response of an amplifier. Noise: Unwanted voltage fluctuations in the signal. References/ Bibliography/ Further Reading Op-Amps and linear Integrated Circuits :Ramakant A. Gayakwad,3rd Edition. Electronic Principles :A.P. Malvino ,6th Edition. Electronics Devices and Circuit Theory by Robert.L Boylestad and L. Nashelsky.,2nd Edition. Electronic Devices by Thomas L. Floyd,6th Edition. Institute of Lifelong Learning, Delhi University Page 26