Ok, so I have used 3 of 4 nand gates in a quad nand already and I would like to make a basic oscillator with the last one without using another chip, and using as few capacitors and resistors as possible. It seems to me that it's no good to have just a 1-capacitor 1-resistor low-pass filter - the usual circuit for when you have not just an inverter, but a schmitt trigger inverter. The reason it's no good is that when the input is considered by the inverter to be low and its output is high, when the capacitor voltage gets charged high enough to make the output low, it is already SO close to the threshold back on the way down (since it's not schmitt trigger) that it will just immediately switch back, in a period of time which is so short that it has little to do with the values of the resistor and capacitor or worse still, find a stable point right in the middle of the transition.
HOWEVER, it seems to me, that if (see picture attached at the bottom) you have TWO resistors and TWO capacitors, that what can happen is that even when the output swings from high to low and C1 starts to discharge, the voltage on C1 will still be high enough to continue to charge C2 for a while - and THEN the voltage on C1 falls below the threshold level, and THEN the voltage on C2 would have to be discharged away by C1's falling voltage back below the threshold, and that would take time, as opposed to an infinitesimal time for the voltage on the one capacitor to go back and forth between an infinitesimal above and below the threshold voltage.
I'm having a bit of trouble with the math, and I'm getting weird real world results using an actual chip. For simplicity so that I'm dealing with 1's and 0's and not 5's and 0's, I am pretending that it gets a 1 volt supply and that the inverter's (it's 4000 series CMOS -specifically a 4011) transition is 0.5 volt. I get the voltage on C2 is k*e^-(Q1*t)+(0.5-k)*e^-(Q2*t) where Q1=(R1*C1+(R1+R2)*C2+sqrt((R1*C1-R2*C2)^2+2*R1*C2*(R1*C1+R2*C2)+R1^2*C2^2))/(2*R1*R2*C1*C2) and that Q2=(R1*C1+(R1+R2)*C2-sqrt((R1*C1-R2*C2)^2+2*R1*C2*(R1*C1+R2*C2)+R1^2*C2^2))/(2*R1*R2*C1*C2). So far unremarkable, just an obnoxious 2nd order but non-oscillatory (a positive quantity under the square root) linear ordinary differential equation having two characteristic exponentials. Note that the coefficients on the exponentials are k and 0.5-k: this is because the starting voltage is 0.5, since I'm assuming that's the transition voltage given a supply of 1 volt.
And then I try to possibly find the value of k that results on the road to find the value of t at which the voltage falls back to 0.5 volt, which would then begin the symmetric opposite phase where the inverter's output is 1 and the capacitor C2's voltage is less than 0.5 and it has to charge back up to 0.5 volt to switch states again. After some tedious math I get these 2 things:
e^-(Q1*t)=Q2/(k*(Q2-Q1))-1
e^-(Q2*t)=Q1/((k-.5)*(Q2-Q1))-1
which leads to these 2 things:
k=(Q2/(Q2-Q1))/(1+e^-(Q1*t))
k=(Q1/(Q2-Q1))/(1+e^-(Q2*t))+0.5
Since I don't REALLY care what k is, I REALLY want to know what t is, I then subtract the 2 equations and it simplifies down to:
Q2*(1-e^-(Q1*t))*(1+e^-(Q2*t))=Q1*(1+e^-(Q1*t))*(1-e^-(Q2*t))
Messing around with my TI85's solver, it's really, really not finding any solutions for t>0 no matter what values of R1, R2, C1 and C2 I try. It just starts to converge to t=0 and then it (using C1=C2=R1=R2=1 for my test example) seems to decide it has found a solution at around t=5*10^-5, but that's not really good because what really happened was that it just decided something that was close to 0 was close enough to 0 to decide it found a solution. I have pondered that last equation above and I can't seem to actually prove mathematically that it doesn't have any solutions for t>0, and of course both sides of the equation are equal to 0 when t=0 because e^0=1 and you have 1-e^0 on each side. Which has me worried that perhaps having the second capacitor and resistor doesn't really change anything, that it's got the same problem as a single resistor and capacitor in a non-schmitt triggered inverter, it's merely the case that it's not so obvious that such would be the case. But it's sufficiently non-obvious that I can't really be definitive about it, since again, I can't mathematically prove it has no solutions. Can anyone else here prove it has no solutions for t>0? Or if it has solutions, can anyone say the conditions on C1, C2, R1, R2 when it has solutions?
So I tried it with a real CD4011. And at FIRST I got very nice results. I used R1=R2=1 megohm and C1=C2=0.02 microfarad, and my frequency counter said "300 Hz", powering it straight from a 9 volt battery. I replaced C1 and C2 with 4.7 nF capacitors, and the frequency became 1200 Hz. Perfect. Quadruple the frequency when you quarter the capacitors.... and THEN I tried it using a 5 volt regulator. And it went crazy. The frequency counter just went overload, with either capacitors. I tried other capacitors. The frequency counter only goes up to 20 kHz, but even so, that's a pretty big deviation from 300 Hz! I shouldn't expect it to be so strongly dependent on the supply voltage! And if anything, I'd expect the frequency to go DOWN if I give it 5 volts because the data sheets say that the switching time is longer when the supply voltage is lower. But no, it switches super-fast when I power it with 5 volts. I didn't try it with any in between voltages either, just 5 volts and 9.
Does anyone have an explanation for this? The circuit I want to use it in uses 5 volts (figures it would be bad for 5 and good for 9 and not the other way around), and has anyone any information or thoughts on this particular circuit and situation?
HOWEVER, it seems to me, that if (see picture attached at the bottom) you have TWO resistors and TWO capacitors, that what can happen is that even when the output swings from high to low and C1 starts to discharge, the voltage on C1 will still be high enough to continue to charge C2 for a while - and THEN the voltage on C1 falls below the threshold level, and THEN the voltage on C2 would have to be discharged away by C1's falling voltage back below the threshold, and that would take time, as opposed to an infinitesimal time for the voltage on the one capacitor to go back and forth between an infinitesimal above and below the threshold voltage.
I'm having a bit of trouble with the math, and I'm getting weird real world results using an actual chip. For simplicity so that I'm dealing with 1's and 0's and not 5's and 0's, I am pretending that it gets a 1 volt supply and that the inverter's (it's 4000 series CMOS -specifically a 4011) transition is 0.5 volt. I get the voltage on C2 is k*e^-(Q1*t)+(0.5-k)*e^-(Q2*t) where Q1=(R1*C1+(R1+R2)*C2+sqrt((R1*C1-R2*C2)^2+2*R1*C2*(R1*C1+R2*C2)+R1^2*C2^2))/(2*R1*R2*C1*C2) and that Q2=(R1*C1+(R1+R2)*C2-sqrt((R1*C1-R2*C2)^2+2*R1*C2*(R1*C1+R2*C2)+R1^2*C2^2))/(2*R1*R2*C1*C2). So far unremarkable, just an obnoxious 2nd order but non-oscillatory (a positive quantity under the square root) linear ordinary differential equation having two characteristic exponentials. Note that the coefficients on the exponentials are k and 0.5-k: this is because the starting voltage is 0.5, since I'm assuming that's the transition voltage given a supply of 1 volt.
And then I try to possibly find the value of k that results on the road to find the value of t at which the voltage falls back to 0.5 volt, which would then begin the symmetric opposite phase where the inverter's output is 1 and the capacitor C2's voltage is less than 0.5 and it has to charge back up to 0.5 volt to switch states again. After some tedious math I get these 2 things:
e^-(Q1*t)=Q2/(k*(Q2-Q1))-1
e^-(Q2*t)=Q1/((k-.5)*(Q2-Q1))-1
which leads to these 2 things:
k=(Q2/(Q2-Q1))/(1+e^-(Q1*t))
k=(Q1/(Q2-Q1))/(1+e^-(Q2*t))+0.5
Since I don't REALLY care what k is, I REALLY want to know what t is, I then subtract the 2 equations and it simplifies down to:
Q2*(1-e^-(Q1*t))*(1+e^-(Q2*t))=Q1*(1+e^-(Q1*t))*(1-e^-(Q2*t))
Messing around with my TI85's solver, it's really, really not finding any solutions for t>0 no matter what values of R1, R2, C1 and C2 I try. It just starts to converge to t=0 and then it (using C1=C2=R1=R2=1 for my test example) seems to decide it has found a solution at around t=5*10^-5, but that's not really good because what really happened was that it just decided something that was close to 0 was close enough to 0 to decide it found a solution. I have pondered that last equation above and I can't seem to actually prove mathematically that it doesn't have any solutions for t>0, and of course both sides of the equation are equal to 0 when t=0 because e^0=1 and you have 1-e^0 on each side. Which has me worried that perhaps having the second capacitor and resistor doesn't really change anything, that it's got the same problem as a single resistor and capacitor in a non-schmitt triggered inverter, it's merely the case that it's not so obvious that such would be the case. But it's sufficiently non-obvious that I can't really be definitive about it, since again, I can't mathematically prove it has no solutions. Can anyone else here prove it has no solutions for t>0? Or if it has solutions, can anyone say the conditions on C1, C2, R1, R2 when it has solutions?
So I tried it with a real CD4011. And at FIRST I got very nice results. I used R1=R2=1 megohm and C1=C2=0.02 microfarad, and my frequency counter said "300 Hz", powering it straight from a 9 volt battery. I replaced C1 and C2 with 4.7 nF capacitors, and the frequency became 1200 Hz. Perfect. Quadruple the frequency when you quarter the capacitors.... and THEN I tried it using a 5 volt regulator. And it went crazy. The frequency counter just went overload, with either capacitors. I tried other capacitors. The frequency counter only goes up to 20 kHz, but even so, that's a pretty big deviation from 300 Hz! I shouldn't expect it to be so strongly dependent on the supply voltage! And if anything, I'd expect the frequency to go DOWN if I give it 5 volts because the data sheets say that the switching time is longer when the supply voltage is lower. But no, it switches super-fast when I power it with 5 volts. I didn't try it with any in between voltages either, just 5 volts and 9.
Does anyone have an explanation for this? The circuit I want to use it in uses 5 volts (figures it would be bad for 5 and good for 9 and not the other way around), and has anyone any information or thoughts on this particular circuit and situation?
Attachments
-
4 KB Views: 45
Last edited: