 In lecture 34 we are going to discuss regenerative comparator one with regenerative positive feedback and non-synosoidal oscillators. Let us see what we had done so far in the last class we discussed negative feedback amplifiers I mean we had discussed in the previous set of lectures starting with negative feedback amplifiers, negative feedback systems, filters, oscillators and all these topics can be considered best as solution of second order differential equation or they form what are called as second order filters particularly second order low pass filters most of these systems right second order filters. So that is common to all these topics that is solution of second order differential equation. The case of feedback amplifiers and negative feedback systems the transient response can be optimized for Q equal to 1 that we had time and again pointed out whether it is design of a ahh sort of differentiator or design of a second order control system PID control system PID indicates that it has proportional integral differential that means proportional is just A naught integral is 1 over S differential is S. So a combination of all these three means a second order differential equation. So once again for transient response optimization Q equal to 1 is the optimum just with 1 peak. So we see that even in negative feedback systems design has to be based on what is important. So if it is the transient response then 1 peak is what is tolerated if it is ahh steady state response then we had seen that frequency response of the system should be maximally flat better worth for Q equal to 1 over root 2. So if these are filters that are to be designed then based on the order of the filter we resort to peaking progressively at higher frequencies with higher Q's thereby making maximally flat. So Q's will be different at ahh frequency is close to the pass band H okay higher Q higher is the frequency. So that kind of second order system is what we had considered for building filters. Oscillators on the other hand are ahh systems with Q equal to second order systems with Q equal to infinity. So these oscillators are the ones that we have designed ahh the same concept in terms of loop gain okay. So for stability frequency stability of all these second order systems the loop gain ahh has to be ahh less than 1 when the phase shift comes close to ahh 0 that is the basis. So if it becomes a third order system then this possibility exists where the loop gain is not it ahh sort of less than 1 when the phase shift is ahh coming close to 0. So that is resulting in ahh frequency compensation in order to make the ahh loop gain become less than 1 when the phase shift comes close to ahh 0. So this is again a common procedure in all these things. Today we are going to consider a different ahh block altogether which is comparator. What is the difference between comparator and op amp? This it is very clear when we discuss the various ahh building blocks active building elements in our introduction. So the op amp has infinite gain that means its characteristic is on along the Y axis okay. This is V naught and V I if it is voltage op amp it could be current op amp where it is I naught versus I I. So that means actually you have the characteristics which is a vertical line coinciding with the Y axis without any limit on the output voltage swing that is an ideal op amp. And an offset can cause this to occur slightly away from 0 okay this side or that side that is the non-ideality. Again there may be therefore in practical situations a limitation on the maximum output voltage can deliver which is normally in these cases okay is close to the supply voltage or rail to rail swing op amps which are readily available particular with most output stages. So these go almost all the way up to the supply voltage on either side. However in the case of an ideal comparator this is the characteristic that is followed. It is having infinite gain and there is a upper limit this is corresponding to may be digital one the lower limit may be equivalent to the digital zero. So it is compatible with the digital circuits that is why it is an element that is used in mixed more circuits output is digital input is analog okay. So this is the characteristic of an ideal comparator. Again the main component of interest here is that input offset can make the characteristic shift on to this side or that side there is some uncertainty. So this gain also may be not infinity it may be finite so there may be a slope okay which is equal to a naught finite gain. This may be frequency dependent okay in the case of up amp and it may be non-linear. So all these are going to cause uncertainty in the output output gain daffoby not very certain within this region there may be an offset that is also an uncertainty. There may be this region of operation which is an uncertainty as far as the digital output is concerned. In the digital output output should be either high or low there is no question of it remaining depending upon the input at any intermediate point. So this is an undesirable region as far as comparator is concerned as far as up amp is concerned this is the region where it should operate. This is active region for the up amp okay the comparator only from this to that or that to this going through the active region okay in the point of transition. So this is the main difference between the comparator and up amp. So up amp ICs are designed differently compared to the comparator ICs comparator does not bother about this region whereas up amp we have to bother about this region the linearity in this region and the frequency dependence in this region all these are of concern whereas in the case of comparator it could be non-linearity also is tolerated as long as it can transit from low to high or high to low very fast that is the rise time and the fall time are important. The up amp when it works in this region okay the rate of rise at the output is called the slew rate there is no question of slew rate limitation coming into picture in the case of comparator it is always the rise time and fall time that is of great concern to us. So again when with product is of is not a parameter of interest at all in the up amp I am in the comparator but it is of important use in the up amp that we have already seen in the influence of gain banded product on the performance of the up amp. So up amp in this region ideally is replaced by what is called a nullator and norator combination whereas comparator has no such macro model okay as far as we are concerned okay it is having a model of this that when the input is on this side output is minus or low and input is here output is high okay. So at the point when the input okay is zero it is transiting from low to high or high to low okay this is a voltage comparator so if now the input to the comparator is VI here and V reference here effective input differential input is VI minus V reference. So the point of transition now get shifted to V reference the V reference is zero it is a zero crossing detector otherwise it is actually used as a comparator to indicate when the input crosses V reference. Here it is a current comparator again IR and II are the inputs okay when II is equal to IR the transition takes place from low to high or high to low. So that is a current comparator a typical comparator okay is LM 311 costing about .2 dollars this we had already mentioned earlier supply voltage is 3.5 to 30 rise time 115 nanoseconds that is the important parameter unlike the gain bandwidth product which is important parameter in the op amp common mode input voltage because it is used in let us say flash converter or something like that it should work over different reference voltages which become the common mode voltages okay in the case of flash converter input offset voltage 7.5 millivolts pretty high input offset current 70 nano amperes input bias current 300 nano amperes bias current also is important because these currents flow through the resistors that are connected and cause an offset voltage to arise. So these are the non idealities offset voltage and finite gain okay this slope these are the non idealities this is about 7.5 millivolts in 311. So this offset combined with uncertain region VU – VL by A0 that is this region where if it has finite gain this region is VU – VL by A0. So that is what is indicated as input referred offset is an important parameter okay input referred offset input offset plus other region of uncertainty VU – VL by A0 is called input referred offset. So the forward gain as to be made large enough so that it is this error is okay much less than the original offset voltage this is the error. Now because of this error okay when we apply let us say VI equal to waveform that is transiting okay around V reference let us see what happens let us say VI is a sine wave. So when it is crossing 0 the output should not concing 0 let us say this is V reference this is VI. So at this point okay the transition occurs so when VI is below V reference output is going to be negative okay and then it is going to change over to positive as VA crosses V reference. However in this region okay if the gain is not very high then it will be acting as an amplifier with V not equal to VI – V reference into A. So this portion okay the rate of change of voltage at the output is dependent upon rate of change of voltage of VI. So that actually may for example force for example if there is noise existing at this point okay then what happens is the transition from this to this will keep on occurring okay because of the noise okay up and down. So the this is called chattering of the switch that if this is actually getting a switch the switch will be going from off to on on to off okay and that particular thing can be avoided by designing what is called noise immune comparator which is a regenerative positive feedback switch trigger okay. So we have this this is normally given as switch trigger regenerative positive feedback situation like this. So here in the case of negative feedback this is plus and this minus we have seen that gain becomes independent of the active device parameter okay it is insensitive to a variation frequency of temperature or time whereas in the case of positive feedback if the beta is amount of feedback voltage is same as before R1 by R1 plus R2 is feedback voltage here. So we have beta V naught minus VI into A equal to V naught. V naught VI earlier was A by 1 plus A beta in the case of negative feedback here it is minus A just change A to minus A it is 1 minus A beta that is for positive feedback as long as A beta is less than 1 it still acts as an amplifier but with the gain greater than A. So if originally the slope was just without any feedback this is the slope this is A minus A without feedback that means beta equal to 0 then when beta is increased with A beta still less than 1 the gain of the whole system is more than the open loop gain. So this gain corresponds to okay minus A divided by 1 minus A beta for example let us say A beta is 0.9 so this becomes minus A divided by 1 minus 0.9 this is equal to minus 10 times A so when A is exactly equal to 1 over beta the gain is infinity that means using a pretty low gain amplifier let us say A DC gain is 100 and beta of 1 over 100 one can achieve a comparator okay with infinite gain that means near ideal comparator characteristic can be got but that is of no use practically because A is severely dependent it is an active device parameter severely dependent upon temperature time and the manufacturing circuit tolerances etc. So it keeps fluctuating that means it can either become just A beta less than 1 or it can even become A beta greater than 1. So we are now discussing the situation of A beta okay much greater than 1 under this situation of positive feedback that is called regenerative positive feedback it is an important concept let us see what happens unlike the negative feedback non-inverting amplifier designed as VCVS okay with gain equal to A by 1 plus A beta of gain equal to 1 plus R2 over R1 with A beta much greater than 1 this positive feedback circuit gives V not by VI equal to minus A by 1 minus A beta and if A beta lies between 0 and 1 this is highly sensitive amplifier it is gain is highly sensitive okay we just saw that when we made A beta equal to 1 okay it goes to infinity when A beta is let us say 0.9 it goes to minus 10A. So A beta equal to 1 it goes to infinity and A beta equal to 0.9 only 10% variation is making it go to minus 10A. So when A beta is 0.1 okay you have this as only changing to A by 0.9 so it varies widely as A beta changes okay and therefore this is very rarely used in amplifier design amplifier design uses only negative feedback okay with A beta magnitude always much greater than 1 okay this is used mostly only in comparator designs IC designs where you can boost up the gain by a factor of 2 or 4 by using this sort of A beta less than 1 technique. However A beta greater than much greater than 1 is what is used as regenerative positive feedback. So this is what we have just now mentioned okay that is called Smith trigger this is one of the most important digital circuits used to convert analog to digital or clean up distorted digital signal distorted means due to transmission line capacity effect RC effect and noise the digital signal gets restarted in order to remove the effect of noise okay this circuit is used. So this is one of the most useful circuits okay in digital systems. For A beta much greater than 1 it develops what is called hysteresis this hysteresis is an integral part of okay class D power amplifiers switched mode power supplies and A to D converters function generators stable multivibrators and timers these are the variety of applications of hysteresis okay in these systems feedback systems this itself is a regenerative feedback system that means actually output is digital input is analog. So what is this hysteresis when VI is very large negative let us say much much greater than that in magnitude okay VS it is negative then output is going to positive saturation there is no doubt about it. This has gone to plus VS and this will be beta times V naught which is beta times VS. So VI is coming close to beta VS it is coming towards the active region of the amplifier. The moment it gets into the active region there is regenerative feedback setting in because A into beta what is fed back okay is much greater than 1. So if there is a noise here it simply gets amplified by A and attenuated by beta if A beta is less than 1 greater than 1 the noise gets added to the original noise in the same phase that means if there is 1 millivolts noise this will be A beta times 1 millivolts okay A beta being much greater than 1 it will be 10 millivolts or something that is simultaneously existing here along with the original 1 millivolts. So 1 millivolts becomes 10 millivolts becomes 100 millivolts so all these get added up and ultimately the output goes to the positive saturation. If it is minus 1 millivolts starting okay the output of this will go to the negative saturation. So if originally it is plus VS okay the the this fed back voltage is beta VS transition takes place at VI is equal to beta VS from plus to minus on its own okay that is the regenerative feedback action that original noise gets amplified and comes and gets added to the original noise in the same phase and therefore it is a cumulative fact occurring at this point making the output go to the positive saturation if it is minus it goes to the negative saturation okay. So this is regenerative positive feedback action if A beta is less than 1 the original noise okay whatever is added is also in the same phase but it is of lower magnitude because A beta is less than 1 next one will be A beta squared times that okay and A beta cube times that so this keeps on becoming cumulative since A beta is less than 1 X plus X squared plus X cube okay it is a converging series so output will be finite for an input that is the action that we have explained here the gain is above the open loop gain of A however it is still acting as a very sensitive amplifier no regenerative positive feedback action exists there for it to exist A beta should be greater than 1. Now this state of transition if it is minus VS plus VS means plus beta VS if it is minus VS it is going to minus beta VS that is the voltage at which input when it becomes equal to minus beta VS regenerative feedback action and changes the output state from minus VS to plus VS on its own on its own means it is the rate at which output changes depends only on its output character state it has nothing to do with the input rate of change okay in an amplifier on the other hand output rate of change is always dependent upon input rate of change times the gain. So this is the hysteresis so when the input is large negative output is plus VS and change occurs when the input comes close to beta VS output goes from plus to minus then now when the input is reduced the change of state is no longer occurring at the same point but it is occurring at minus beta VS this is what is called hysteresis this hysteresis is important in all on off control systems this is also necessary in class D power amplifiers switched mode power supplies A to D converters function generators and stable multivibrators and timers large number of industrial applications are attributed to this. Now let us consider R1 equal to R2 equal to 1K this is the simulated circuit plus VS is 10 volts minus VS is 10 again 10 volts and VI if it is starting with large negative output is at plus VS you can see that then change of state occurs at half times VS so this is close to 10 volts this is minus 10 so this is going to be 5 volts plus or minus. So when it is plus 10 volts this is plus 5 volts so actually the TL082 is used about 2 volts reduction occurs in the output chain both from positive and negative so you can see that it is very nearly 4 volts at which this transition this is nearly 8 volts okay and this is very nearly occurring at 4 volts as indicated in the simulation. So again at minus 4 volts it is changing back so this is the amount of hysteresis it can be controlled by R1 plus R2 that is the beta factor this is plus minus beta VS is the region of hysteresis. Now when this VI is triangular waveform let us see what happens it could be assigned wave also again you can see the transition occurring at 4 volts when the input is changing from positive to negative it is changing at 4 volts okay after words from negative to positive it is changing at minus 4 volts. So we have the square wave appearing when a triangular wave is applied to the input the change of state is occurring at minus 4 plus 4 and minus 4 when the voltage is increasing it is at plus 4 when the voltage is decreasing it is at minus 4 that is the fact of hysteresis. So any periodic waveform appearing okay the like sine wave triangular wave etc saw tooth etc will cause A2 change as square wave or rectangular wave. Now this is what we have explained about regenerative action output is equal to V noise into one plus A beta plus A beta squared A beta being greater than one okay it is an infinite series which diverges that means output goes to either plus VS or minus VS ultimately okay this is the effect which is equivalent to minus A divided by one minus A beta okay. So that is the effect of noise on the regenerative comparator. Now the advantage of this comparator is that it can never remain at any point as output in a stable manner if it is other than plus VS and minus VS okay. So it is highly suitable for as an output stage okay linking the analog to the digital world where the digital world is not able to recognize anything other than high or low. So a switch is always preceded by a hysteresis causing circuit like smith trigger in order to make sure that the active device transistor for example is never acting in the active region it is always acting either as on or as off okay. So in order to operate a switch the driver for the switch has to be a circuit with hysteresis like the smith trigger. Comparator is called as limiter by communication engineers as zero cross in detector by power electronics engineers if one end of the input is connected to the ground. Now we connect the V reference to the other end where we have the ground point. So then what happens this point at which transition occurs now gets shifted to earlier it was beta times VS because output was either plus VS or minus VS. VS is the supply voltage. So now it is at this point the voltage is less minus VS beta VS plus the contribution due to V reference which was earlier connected to ground. So V reference into 1 minus beta which results in the entire hysteresis getting shifted to V reference into 1 minus beta from 0. Zero to V reference into 1 minus beta and accordingly the point of transition also gets shifted by the same amount beta VS plus V reference into 1 minus beta here 1 minus beta V reference minus beta VS here. So the hysteresis can be shifted to any convenient point okay by using this V reference and such a system as the hysteresis shifted by VR into 1 minus beta and the amount of hysteresis remains the same as before which is twice beta VS on either side of this right beta VS on this side and beta VS on this side it is twice beta VS. So the triangular waveform that is applied to it at the input will have the output change from square waveform to a rectangular waveform like this. This is the region of VR into 1 minus beta. So when the input goes above that this goes to negative when the input is less than that in this region it goes to positive. So this is a rectangular waveform if you say that duty cycle this is the period for using it for some operation let us say tau when it is at minus VS and this is the period when the whole thing is off the action is off then tau by T is called the duty cycle when it is low the switch is on when it is high the switch is off let us say duty cycle then is called tau by T and we can vary the duty cycle by varying this V reference okay and we can get the relationship between tau by T and VR into 1 minus beta if you look at the two triangles here similar triangles this is one triangle this is the other triangle. So this height divided by this height is equal to this base divided by this what is it let us say VP minus VR into 1 minus beta is the height of the smaller triangle and the height of the bigger triangle is VP that is equal to this width is tau divided by this width which is T by 2. So this is a linear relationship between duty cycle and VR. So this is going to give us tau by T equal to half into 1 minus VR into 1 minus beta by VP. So it is directly proportional to the VR that we are applying. So this is what is called as duty cycle generator duty cycle generator or pulse width modulator is an important unit in today's electronic system design and one must understand how to design the simple system. So it requires only one smith trigger and an input which is a triangular waveform at a clock frequency let us say F equal to 1 over T. So this is the clock let us say. So we have derived this just now duty cycle is equal to half into 1 minus VR into 1 minus beta by VP and that can be varied as you vary this the pulse width is modulated. This is one thing that operators operates most of the switches power switches which can actually act as class D amplifier class D amplifier for example as VR as some DC okay plus VP sin omega MT. This is the modulating frequency audio may be in audio class D amplifier this is how pulse width modulation occurs and that modulator is applied to the switch okay which connects to supply or connects it to ground okay so that it with great efficiency converts the power into higher level okay. So you now put a low pass filter at the output of this switch then this can be converted back to audio without any difficulty and therefore this is one of the most efficient power amplifiers today. Again in DC to DC converter the duty cycle actually converts one DC into another DC okay and therefore of different value. So this is one way by using low pass filters which are L's and C's you can efficiently convert okay one DC to another DC without much loss in the circuit that uses the switches and low pass filters which are going to use L's and C's loss less. So and analog multiplication also is done by using pulse width modulation and pulse amplitude modulation now let us see what happens by using a switch here so which connects to let us say signal so it connects to signal or connects it to let us say minus VX okay periodically that means it connects to signal VX for tau and for T minus tau it connects to minus VX then we can get VX and then minus VX VX for tau and minus VX for T minus tau then the average is tau into VX if you put a low pass filter after this so what happens tau times VX minus T minus tau times VX is the average divided by T is the average which is nothing but 2 tau by T okay minus 1 okay into VX as the average. So we have already shown that this 2 tau minus T into VX is equal to right it can be made proportional to VR by okay VP into minus VR by VP into 1 minus beta times VX so you can see that VR by VP into 1 minus beta minus this is nothing but 2 tau by T minus 1 so you see that this results in what is called a multiplier VX multiplied by this can be another voltage which is VY so this is going to be equal to minus VY by VR which is that of the multiplier this is a very accurate multiplier which uses not the device properties like we had done before log or anti log okay or squaring it uses simple switches okay and averaging circuit which is efficient LC averaging circuit is efficient okay so using such a thing accurate multiplication can be obtained so we are now showing that effect of multiplication V reference is 10 volts beta is equal to half and we have this hysteresis that is obtained with this kind of structure so this hysteresis is occurring earlier it was occurring around 0 now because of V reference being 10 volts half times V reference that is 5 volts is the point at which it is occurring and it is restricted to first quadrant and now it is a single supply operation comparators are most often used in single supply so one supply is connected to ground and only positive supply is having 20 volts now beta is still half so the entire hysteresis takes place around half of V reference which is 10 volts and the amount of hysteresis is the same as before okay 4 volts on this side and 4 volts on the other side that is 10-4 10 plus 4 so this is an easy way of single supply operation of the smith trigger and DC to DC conversion and class D power amplifier use this effect of pulse width modulation. You can see a triangular waveform now applied okay with a certain V reference okay as resulted in this V reference equal to 10 volts the entire thing has shifted okay hysteresis and therefore this becomes a duty cycle here that duty cycle is less than 50% if this is the period of duty this is the period of no duty now you will see that the period of duty has been increased to about 75% earlier it was only 25% now period of no duty is gone to gone to 25% so we have V reference change to minus 10 instead of plus 10 so the transition occurs at minus 5 okay as the center okay minus 5 plus 4 volts minus 5 minus 4 volts now frequency shift keying this is an important operation in our modems then this is a modulating technique so you can actually apply a sort of square wave okay that is as input okay V reference so one can now see that it is changing from plus to minus at about 100 hertz so that is the square wave modulating this sir structure okay and you can see the frequency is changing here this is low frequency this is high frequency right this is again low frequency this is high frequency so then modulating frequency modulation instead of square wave one applies a sine wave this may be the audio let us see this too small for audio but it can be any frequency so in this case for demo we have taken 100 hertz so smoothly it is changing its frequency gradually okay from low to high highest and again back to low FM generator this is inverting Schmitt trigger now this was having inverting characteristic as far as the transition is concerned so one had this going from positive to negative when the voltage is increasing and negative to positive when the voltage is occurring so this is called the inverting Schmitt trigger with the symbol being just this with this inversion and hysteresis inside is this Schmitt trigger symbol now if you change the input this is the input and this is the reference this is the input VI and this is the reference VR then we obtain this circuit which again changes state at the same point what is that point we have to now consider the voltage here which is VI into R2 two voltages are connected one is VI and this is plus minus VS so plus minus VS into R1 by R1 plus R2 that is the voltage at this point when that becomes equal to VR change of state occurs okay if VR is 0 for example okay then one can know that VI when it is equal to minus plus VS into R1 by R2 change of state occurs so that is an important thing that when VI becomes equal to minus VS into R1 by R2 R plus VS into R1 by R2 change of state occurs if the limiting voltage is VS the condition required for change of state occur is R1 by R2 should be less than 1 for the change of state to occur in this case please remember this so this is what we have written there so VI into 1 minus beta plus V naught into beta is the voltage there that is when it is equal to VR change of state occurs or VI is equal to minus plus VS into beta by 1 minus beta plus VR into 1 minus 1 by 1 by 1 minus beta is the point where it occurs VR is 0 okay then the change of state is plus R1 by R2 into VS and minus R1 by R2 into VS when the voltage is large positive output is positive and then it changes state at okay minus VS by R1 VS into R1 by R2 okay so you can see that this has to become 0 when this is at plus VS this has to go to minus in order to make this go to 0 so it is occurring at minus VS into R1 by R2 and when it is minus it has to go to positive in order to make the voltage go to 0 at the input of the op amp so or the comparator that is the inverting smith trigger characteristics simulated can see it this is the point of R1 by R2 okay we have purposely chosen this R2 as say R1 by R2 is half so R1 is 1K R2 is 2K that is the R1 is 1K R2 is equal to 2K so we have got that point of transition so again just illustrating this simulation a triangular waveform applied VCU a square waveform like before but it is inverted okay this is non inverting so positive positive negative negative so in conclusion we have seen an important application of the comparator regenerative comparator the difference is that this is a component which is used in on off controllers class D power amplifiers switched mode power supplies in order to make sure that the active device is always used in mode which is switch okay it never comes to the active region okay and remains there permanently dissipating huge amount of power as a switch it has either voltage across it equal to 0 or current through it equal to 0 so that the power dissipated ideally in a switch is 0 so that is why for efficient circuit management a switch is the one that is used and class D power amplifiers are efficient power amplifiers and DC to DC converters are efficient circuits efficiency is to be made as high as possible close to the ideal efficiency of 100% in the next class we will see how this basic unit regenerative comparator can be used for signal generators which are non sinusoidal thank you very much.