LM311-oscillator, help needed

B

bos

Guest
I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

What I know is that R2/R3 is a voltage divider. R4 is some sort of
feedback (no idea what it does) and since it's connected to the
voltage divider it confuses me even more. No clue what R5 does. For R2-
R5, I don't know where to start solving or what I'm looking for.

Furthermore, I know R1/C1 is a lowpass-filter, and I know the cut off-
frequency for this kind of filter is f = 1 / sqrt(RC * 2pi). Solving f
gives 1.53Hz, but this value is of no use to me since I don't know
what it tells me. I'm guessing that any signal below 1.53Hz goes into
the negative input of the opamp. But this is just a weak guess and it
doesn't tell me much.

Other than this, I'm completely lost. My goal for this circuit is to
manually calculate the frequency at the opamp-output (pin 7), I only
manage to identify the LP-filter and the voltage divider (which
probably isn't a voltage divider because of R4).

Can anyone help me out? Where do I start in circuits like these? Is
there any particular order you have to calculate / solve things?
 
On Wed, 18 Mar 2009 07:20:11 -0700 (PDT), bos
<rikard.bosnjakovic@gmail.com> wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

What I know is that R2/R3 is a voltage divider. R4 is some sort of
feedback (no idea what it does) and since it's connected to the
voltage divider it confuses me even more. No clue what R5 does. For R2-
R5, I don't know where to start solving or what I'm looking for.

Furthermore, I know R1/C1 is a lowpass-filter, and I know the cut off-
frequency for this kind of filter is f = 1 / sqrt(RC * 2pi). Solving f
gives 1.53Hz, but this value is of no use to me since I don't know
what it tells me. I'm guessing that any signal below 1.53Hz goes into
the negative input of the opamp. But this is just a weak guess and it
doesn't tell me much.

Other than this, I'm completely lost. My goal for this circuit is to
manually calculate the frequency at the opamp-output (pin 7), I only
manage to identify the LP-filter and the voltage divider (which
probably isn't a voltage divider because of R4).

Can anyone help me out? Where do I start in circuits like these? Is
there any particular order you have to calculate / solve things?
Well, to take a swag at this ...

R4 is for feedback, as you surmise. Comparitors use positive feedback to
achieve a solid transition. For example (without looking at how it
happens, yet) say that the (-) pin has crept up in voltage until it is
just slightly greater than the (+) pin. This causes the comparitor
output to swing towards ground and the positive feedback through R4
reaches over to the (+) pin and pulls it a down as well. So, even if the
(-) had done nothing else, it now has an extra margin as compared to the
(+) pin.

Assuming the comparitor is fully "on," you've got a voltage divider
consisting of (R3 || R4) over R2 (neglecting the smaller R5), so the (+)
pin will be at about 3 1/3 V. If it's fully "off," then it's now a
divider with R3 over (R2 || R4) or about 1 2/3 V.

C1 charges through R1 + R5 and discharges through R1. If we neglect R5
again, we'll have C1 charging from 1 2/3 V towards 5 V and discharging
from 3 1/3 V towards 0 V, in each case a travel of halfway. With an RC
time constant of about 100 msec, the "half life" is found by multiplying
by ln(2), so we get about 70 msec per half cycle, 140 msec per cycle, or
about 7 Hz.

--
Rich Webb Norfolk, VA
 
On Wed, 18 Mar 2009 07:20:11 -0700 (PDT), bos
<rikard.bosnjakovic@gmail.com> wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

What I know is that R2/R3 is a voltage divider. R4 is some sort of
feedback (no idea what it does) and since it's connected to the
voltage divider it confuses me even more. No clue what R5 does. For R2-
R5, I don't know where to start solving or what I'm looking for.

Furthermore, I know R1/C1 is a lowpass-filter, and I know the cut off-
frequency for this kind of filter is f = 1 / sqrt(RC * 2pi). Solving f
gives 1.53Hz, but this value is of no use to me since I don't know
what it tells me. I'm guessing that any signal below 1.53Hz goes into
the negative input of the opamp. But this is just a weak guess and it
doesn't tell me much.

Other than this, I'm completely lost. My goal for this circuit is to
manually calculate the frequency at the opamp-output (pin 7), I only
manage to identify the LP-filter and the voltage divider (which
probably isn't a voltage divider because of R4).

Can anyone help me out? Where do I start in circuits like these? Is
there any particular order you have to calculate / solve things?

---
Let's look at different parts of the circuit. First, the supply: (View
in Courier)



+5V
|
|8
|+\
| >
|-/
|4
|
GND

That means to connect 5V to pin 8 and 0V (GND) to pin 4.

Now the output:

+5V------------+-----+
| |R5
|8 [1k]
|+\ 7 |
| >---+
|-/
|4
|
GND>-----------+

Since a comparator acts like a switch, pin 7 will either short the
bottom end of R5 to ground or let it go to +5V.

Now the inputs:


+5V------------+-----+
| |R5
2 |8 [1k]
Vin+>---------|+\ 7 |
3| >---+
Vin->---------|-/
|4
|
GND>-----------+


What happens here is that if the voltage on pin 2 goes more positive
than the voltage on pin 3, then the output will go open-collector and
pin 7 will rise to 5V.

Now the reference divider:

E1
+5V------+--------+-----+
|R3 | |
[100k] | |R5
| 2 |8 [1k]
E2 +-------|+\ 7 |
| 3| >---+
| |-/
[100k] |4
|R2 |
| |
GND>-----+--------+

This voltage divider sets the voltage on pin 2 to be:


E1 * R2 5V * 100e5R
E2 = --------- = ----------------- = 2.5V
E1 + R2 100e5R + 100e5R


So now if the voltage on pin 3 goes below 2.5V the voltage on pin 7 will
go to 5V, and if the voltage on pin 3 goes above 2.5V the voltage on pin
7 will go to 0V.

So now let's see what's going on with pin 3:



+5V------+-----------+---------+
|R3 | |
[100k] | |R5
| 2 |8 [1k]
+----------|+\ 7 |
| 3| >-------+
| +--|-/ U1 |
[100k] | |4 |
|R2 +---|--[47k]--+
| | | R1
| [2ľ2] |
| |C1 |
GND>-----+-------+---+

OK, let's say we start by assuming C1 is discharged and turning on the
power.

When that happens, U1-2 will go to 2.5V and, since U1-3 will be at 0V
U1-7 will go high and allow C1 to start charging through R5 and R1.

C1 will charge up until it gets a tiny bit more positive than 2.5V (the
voltage on U1-2) and then U1-7 will go low, discharging C1 through R1
until the voltage on U1-3 goes a tiny bit below the voltage on U1-2.
When that happens, U1-7 will go high again and the cycle will repeat
endlessly. Voila! Oscillator.

So, what about R4?


+5V------+-----------+-------------+
| | |
|R3 +---|------+ |
[100k] | | |R4 |R5
| | 2 |8 [100k] [1k]
+-------+--|+\ 7 | |
| 3| >----+------+-->OUT
| +--|-/ U1 |
[100k] | |4 |
|R2 +---|----[47k]----+
| | | R1
| [2ľ2] |
| |C1 |
GND>-----+-------+---+

What it does is provide hysteresis on the non-inverting input of the
comparator.

Assuming that the comparator input is high, the circuit connected to
U1-2 will look like this:

+5V
|
E1--+-------+
| |
| [1k]R5
|R3 |
[100k] [100k]R4
| |
E2--+-------+---U1-2
|
|R2
[100k]
|
GND

R4 and R5 are in series so they look like 101k ohms and that's in
parallel with R3, so they all resolve down to a single resistance like
this:


R3 * (R5 + R4)
Rt = --------------- = 49800 ohms
R3 + R4 + R5

so our circuit looks like this:


E1---+--+5V
|
|R3
[49800R]
|
E2---+------U1-2
|
|R2
[100k]
|
GND

and the voltage at U1-2 will be:


E1 * R2
E2 = --------- = 3.34
R3 + R2


However, with comparator output low, the circuit will look like this:

+5V
|
E1--+
|
|
|R3
[100k]
|
E2--+-------+---U1-2
| |
|R2 |R4
[100k] [100k]
| |
GND GND

Now R2 and R4 are in parallel, making that total resistance 50k and the
voltage at U1-2, 1.67V

Looking the entire circuit once again,

+5V------+-----------+-------------+
| | |
|R3 +---|------+ |
[100k] | | |R4 |R5
| | 2 |8 [100k] [1k]
+-------+--|+\ 7 | |
| 3| >----+------+-->OUT
| +--|-/ U1 |
[100k] | |4 |
|R2 +---|----[47k]----+
| | | R1
| [2ľ2] |
| |C1 |
GND>-----+-------+---+

and starting from scratch, we've just turned the power supply ON and C1
is discharged.

U1-7 will go high because U1-3 is at 0V, but now instead of 2.5V being
on U1-2, there'll be 3.34V there, which means that the cap will have to
charge to 3.34V before the comparator switches.

When it does, and U1-7 goes low, the voltage on U1-2 will go to 1.67V so
the cap will have to discharge to 1.67V before the cycle can begin anew.

So now, instead of just a tiny voltage swing around 2.5V causing the
comparator to switch, it has to swing through 1.67V making it much more
stable and much less susceptible to switching noise.

I'll get to the frequency part in a while...

Any questions so far?

JF
 
On Wed, 18 Mar 2009 07:20:11 -0700 (PDT), bos
<rikard.bosnjakovic@gmail.com> wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

What I know is that R2/R3 is a voltage divider. R4 is some sort of
feedback (no idea what it does) and since it's connected to the
voltage divider it confuses me even more. No clue what R5 does. For R2-
R5, I don't know where to start solving or what I'm looking for.
The LM311 is a comparator, not an op-amp. Like most comparators, it
has an open collector output - it can only pull the output towards
ground. R5 is a pull-up resistor to pull the output high when the
comparator isn't pulling it low.

With the output high, R3 and R4 are effectively in parallel, making
the upper resistance in the voltage divider about 50K, so the + input
to the comparator will be about 2/3 of +5V, or 3.35V.

The output, pin 7 will be near +5V, so current through R1 will charge
C1. When the voltage on C1 reaches 3.35V, the comparator will switch,
taking the output to near ground. R4 is now effectively in parallel
with R2, so the + input of the comparator will be about 1.65 volts.

C1 now discharges though R1, until the voltage across C1 reaches 1.65
volts, at which time the comparator will switch off, so pin 7 goes
high, and the process repeats.

Furthermore, I know R1/C1 is a lowpass-filter, and I know the cut off-
frequency for this kind of filter is f = 1 / sqrt(RC * 2pi). Solving f
gives 1.53Hz, but this value is of no use to me since I don't know
what it tells me. I'm guessing that any signal below 1.53Hz goes into
the negative input of the opamp. But this is just a weak guess and it
doesn't tell me much.
The output of this circuit will be a square wave, with the frequency
determined by the charge/discharge time constant of C1 and R1. I
don't think you'd consider C1/R1 as a low pass filter in this
application.


--
Peter Bennett, VE7CEI
peterbb4 (at) interchange.ubc.ca
GPS and NMEA info: http://vancouver-webpages.com/peter
Vancouver Power Squadron: http://vancouver.powersquadron.ca
 
On Wed, 18 Mar 2009 12:16:02 -0500, John Fields wrote:
On Wed, 18 Mar 2009 07:20:11 -0700 (PDT), bos

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.
---
Let's look at different parts of the circuit. First, the supply: (View
in Courier)
....
I'll get to the frequency part in a while...

Any questions so far?
What he said. :)

Cheers!
Rich
 
On Mar 18, 6:16 pm, John Fields <jfie...@austininstruments.com> wrote:

[...]
Any questions so far?
This was a very in-depth, but still easy enough for me to understand,
explanation. I was able to follow you every step without having to
look like a big question mark. Thank you.

There's only one thing that stalled me a bit:

Assuming that the comparator input is high, the circuit connected to
U1-2 will look like this:

+5V
|
E1--+-------+
| |
| [1k]R5
|R3 |
[100k] [100k]R4
| |
E2--+-------+---U1-2
|
|R2
[100k]
|
GND
If the comparator input is high (i.e. high output?), shouldn't the
voltage between R5 and R4 - where the output pin is connected - be 5V,
rendering R5 useless? But I guess the output won't be perfectly at 5V
- even if it's rail-to-rail - so perhaps it won't affect the R3//
(R4+R5) voltage divider.

I mean, an ideal comparator would have 5V output, but since I'm going
to use the circuit in the real world later on it will probably never
reach that high.
 
On Wed, 18 Mar 2009 11:24:50 -0700 (PDT), bos
<rikard.bosnjakovic@gmail.com> wrote:

On Mar 18, 6:16 pm, John Fields <jfie...@austininstruments.com> wrote:

[...]
Any questions so far?

This was a very in-depth, but still easy enough for me to understand,
explanation. I was able to follow you every step without having to
look like a big question mark. Thank you.

There's only one thing that stalled me a bit:

Assuming that the comparator input is high, the circuit connected to
U1-2 will look like this:

+5V
|
E1--+-------+
| |
| [1k]R5
|R3 |
[100k] [100k]R4
| |
E2--+-------+---U1-2
|
|R2
[100k]
|
GND

If the comparator input is high (i.e. high output?), shouldn't the
voltage between R5 and R4 - where the output pin is connected - be 5V,
rendering R5 useless? But I guess the output won't be perfectly at 5V
- even if it's rail-to-rail - so perhaps it won't affect the R3//
(R4+R5) voltage divider.

I mean, an ideal comparator would have 5V output, but since I'm going
to use the circuit in the real world later on it will probably never
reach that high.
---
While some comparators do have totem-pole outputs which can source
current, most are open collector or open drain devices.

The LM311 is bipolar and has an open-collector NPN for its output, like
this:

+5V
|
E1--+-------+
| |
| [1k]R5
| |
| +-------->>-U1-7--C
|R3 | B
[100k] [100k]R4 E
| | |
E2--+-------+--->>-U1-2 |
| |
|R2 |
[100k] |
| |
GND GND

As such, it can only sink current and the source must come from
somewhere else; in your circuit, the 5V supply through R5.

What happens is that when the + input is more positive than the - input,
the output transistor is turned off so with no current through it, the
bottom of the pullup and the comparator's output rise to the supply.

When the - input goes more positive than the + input, however, the
output transistor turns on and the voltage at the bottom of the pullup
goes to ground. Not all the way, because there's the transistor's
Vce(sat) in the way, but pretty close.

If you go here:

http://www.national.com/ds/LM/LM111.pdf

and then go to the upper left hand corner of page 9 you'll see a plot of
Vce(sat) VS current for various currents.

JF
 
Very nicely done! You should teach this stuff - you'd be really good at it.

Bob
 
On Wed, 18 Mar 2009 07:20:11 -0700, bos wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.
I have appended an LTSpice[1] schematic to this message. You can use this
to simulate the circuit and observe the voltage and current waveforms.

[1] http://www.linear.com/designtools/software/#Spice

The schematic uses a different comparator (LTSpice is bundled with
models for Linear's own components), but in a circuit like this, all
comparators are essentially equal.

Version 4
SHEET 1 880 680
WIRE -192 -48 -352 -48
WIRE 128 -48 -192 -48
WIRE 336 -48 128 -48
WIRE -192 -16 -192 -48
WIRE 336 -16 336 -48
WIRE -192 128 -192 64
WIRE -16 128 -192 128
WIRE 336 128 336 64
WIRE 336 128 64 128
WIRE -352 192 -352 -48
WIRE 128 192 128 -48
WIRE 96 208 -48 208
WIRE 336 224 336 128
WIRE 336 224 160 224
WIRE 480 224 336 224
WIRE -192 240 -192 128
WIRE 96 240 -192 240
WIRE -48 352 -48 208
WIRE 0 352 -48 352
WIRE 336 352 336 224
WIRE 336 352 80 352
WIRE -192 400 -192 240
WIRE -48 416 -48 352
WIRE -352 560 -352 272
WIRE -192 560 -192 480
WIRE -192 560 -352 560
WIRE -48 560 -48 480
WIRE -48 560 -192 560
WIRE 128 560 128 256
WIRE 128 560 -48 560
WIRE 128 624 128 560
FLAG 128 624 0
FLAG 480 224 Out
IOPIN 480 224 Out
SYMBOL res -208 -32 R0
SYMATTR InstName R3
SYMATTR Value 100K
SYMBOL res -208 384 R0
SYMATTR InstName R2
SYMATTR Value 100K
SYMBOL res -32 144 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R4
SYMATTR Value 100K
SYMBOL res 320 -32 R0
SYMATTR InstName R5
SYMATTR Value 1K
SYMBOL res -16 368 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R1
SYMATTR Value 47K
SYMBOL cap -64 416 R0
SYMATTR InstName C1
SYMATTR Value 2.2ÂľF
SYMBOL voltage -352 176 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 5V 10ms)
SYMBOL Comparators\\LTC1841 128 224 R0
SYMATTR InstName U1
TEXT -210 648 Left 0 !.tran 1s
 
On Wed, 18 Mar 2009 17:06:54 -0400, Bob Engelhardt
<bobengelhardt@comcast.net> wrote:

Very nicely done! You should teach this stuff - you'd be really good at it.
---
That's very kind; thank you. :)

JF
 
"Nobody" <nobody@nowhere.com> schreef in bericht
news:pan.2009.03.18.21.16.48.31000@nowhere.com...
On Wed, 18 Mar 2009 07:20:11 -0700, bos wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

I have appended an LTSpice[1] schematic to this message. You can use this
to simulate the circuit and observe the voltage and current waveforms.

[1] http://www.linear.com/designtools/software/#Spice

The schematic uses a different comparator (LTSpice is bundled with
models for Linear's own components), but in a circuit like this, all
comparators are essentially equal.

Version 4
SHEET 1 880 680
WIRE -192 -48 -352 -48
WIRE 128 -48 -192 -48
WIRE 336 -48 128 -48
WIRE -192 -16 -192 -48
WIRE 336 -16 336 -48
WIRE -192 128 -192 64
WIRE -16 128 -192 128
WIRE 336 128 336 64
WIRE 336 128 64 128
WIRE -352 192 -352 -48
WIRE 128 192 128 -48
WIRE 96 208 -48 208
WIRE 336 224 336 128
WIRE 336 224 160 224
WIRE 480 224 336 224
WIRE -192 240 -192 128
WIRE 96 240 -192 240
WIRE -48 352 -48 208
WIRE 0 352 -48 352
WIRE 336 352 336 224
WIRE 336 352 80 352
WIRE -192 400 -192 240
WIRE -48 416 -48 352
WIRE -352 560 -352 272
WIRE -192 560 -192 480
WIRE -192 560 -352 560
WIRE -48 560 -48 480
WIRE -48 560 -192 560
WIRE 128 560 128 256
WIRE 128 560 -48 560
WIRE 128 624 128 560
FLAG 128 624 0
FLAG 480 224 Out
IOPIN 480 224 Out
SYMBOL res -208 -32 R0
SYMATTR InstName R3
SYMATTR Value 100K
SYMBOL res -208 384 R0
SYMATTR InstName R2
SYMATTR Value 100K
SYMBOL res -32 144 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R4
SYMATTR Value 100K
SYMBOL res 320 -32 R0
SYMATTR InstName R5
SYMATTR Value 1K
SYMBOL res -16 368 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R1
SYMATTR Value 47K
SYMBOL cap -64 416 R0
SYMATTR InstName C1
SYMATTR Value 2.2ÂľF
SYMBOL voltage -352 176 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 5V 10ms)
SYMBOL Comparators\\LTC1841 128 224 R0
SYMATTR InstName U1
TEXT -210 648 Left 0 !.tran 1s
Beware. The capacitor has a strange value so the simulation does not work...
At least not with me.

petrus bitbyter
 
On Wed, 18 Mar 2009 23:26:09 +0100, "petrus bitbyter"
<pieterkraltlaatditweg@enditookhccnet.nl> wrote:

"Nobody" <nobody@nowhere.com> schreef in bericht
news:pan.2009.03.18.21.16.48.31000@nowhere.com...
On Wed, 18 Mar 2009 07:20:11 -0700, bos wrote:

I'm having an LM311-oscillator (found on google) that I'm going to use
in my own circuit later on. But before doing this I need to learn how
it works. Been looking at the schematic for two days now trying to
figure things out but fail miserabely, so I'm asking for a hand here.

Here's the schematic:

http://bos.hack.org/hacks/electronics/311.png

I'm not skilled at analog electronics, but I really want to learn
what's happening here.

I have appended an LTSpice[1] schematic to this message. You can use this
to simulate the circuit and observe the voltage and current waveforms.

[1] http://www.linear.com/designtools/software/#Spice

The schematic uses a different comparator (LTSpice is bundled with
models for Linear's own components), but in a circuit like this, all
comparators are essentially equal.

Version 4
SHEET 1 880 680
WIRE -192 -48 -352 -48
WIRE 128 -48 -192 -48
WIRE 336 -48 128 -48
WIRE -192 -16 -192 -48
WIRE 336 -16 336 -48
WIRE -192 128 -192 64
WIRE -16 128 -192 128
WIRE 336 128 336 64
WIRE 336 128 64 128
WIRE -352 192 -352 -48
WIRE 128 192 128 -48
WIRE 96 208 -48 208
WIRE 336 224 336 128
WIRE 336 224 160 224
WIRE 480 224 336 224
WIRE -192 240 -192 128
WIRE 96 240 -192 240
WIRE -48 352 -48 208
WIRE 0 352 -48 352
WIRE 336 352 336 224
WIRE 336 352 80 352
WIRE -192 400 -192 240
WIRE -48 416 -48 352
WIRE -352 560 -352 272
WIRE -192 560 -192 480
WIRE -192 560 -352 560
WIRE -48 560 -48 480
WIRE -48 560 -192 560
WIRE 128 560 128 256
WIRE 128 560 -48 560
WIRE 128 624 128 560
FLAG 128 624 0
FLAG 480 224 Out
IOPIN 480 224 Out
SYMBOL res -208 -32 R0
SYMATTR InstName R3
SYMATTR Value 100K
SYMBOL res -208 384 R0
SYMATTR InstName R2
SYMATTR Value 100K
SYMBOL res -32 144 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R4
SYMATTR Value 100K
SYMBOL res 320 -32 R0
SYMATTR InstName R5
SYMATTR Value 1K
SYMBOL res -16 368 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R1
SYMATTR Value 47K
SYMBOL cap -64 416 R0
SYMATTR InstName C1
SYMATTR Value 2.2ÂľF
SYMBOL voltage -352 176 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 5V 10ms)
SYMBOL Comparators\\LTC1841 128 224 R0
SYMATTR InstName U1
TEXT -210 648 Left 0 !.tran 1s


Beware. The capacitor has a strange value so the simulation does not work...
At least not with me.
---
2.2ľF is a standard value and works fine here.

Besides, even if it was, say, 2.647ľF, why would LTspice balk at that?


JF
 
On Wed, 18 Mar 2009 17:37:26 -0500, John Fields wrote:

On Wed, 18 Mar 2009 23:26:09 +0100, "petrus bitbyter"
pieterkraltlaatditweg@enditookhccnet.nl> wrote:

I have appended an LTSpice[1] schematic to this message. You can use
this to simulate the circuit and observe the voltage and current
waveforms.

SYMBOL cap -64 416 R0
SYMATTR InstName C1
SYMATTR Value 2.2µF

Beware. The capacitor has a strange value so the simulation does not
work... At least not with me.

---
2.2ÂľF is a standard value and works fine here.

Besides, even if it was, say, 2.647ÂľF, why would LTspice balk at that?
I think he's having encoding problems. My post was in UTF-8, but LTSpice
will probably want ISO-8859-1. If the process of transferring the data
from the message to the .asc file doesn't perform the conversion, the "mu"
will get corrupted.
 
"Nobody" <nobody@nowhere.com> schreef in bericht
news:pan.2009.03.19.04.39.10.218000@nowhere.com...
On Wed, 18 Mar 2009 17:37:26 -0500, John Fields wrote:

On Wed, 18 Mar 2009 23:26:09 +0100, "petrus bitbyter"
pieterkraltlaatditweg@enditookhccnet.nl> wrote:

I have appended an LTSpice[1] schematic to this message. You can use
this to simulate the circuit and observe the voltage and current
waveforms.

SYMBOL cap -64 416 R0
SYMATTR InstName C1
SYMATTR Value 2.2µF

Beware. The capacitor has a strange value so the simulation does not
work... At least not with me.

---
2.2ÂľF is a standard value and works fine here.

Besides, even if it was, say, 2.647ÂľF, why would LTspice balk at that?

I think he's having encoding problems. My post was in UTF-8, but LTSpice
will probably want ISO-8859-1. If the process of transferring the data
from the message to the .asc file doesn't perform the conversion, the "mu"
will get corrupted.
You're right. That strange value is caused by the conversion of the "mu". So
it's not the value but the unit that made Spice fail. Once corrected the
simulation runs well.

petrus bitbyter
 
On Wed, 18 Mar 2009 12:16:02 -0500, John Fields
<jfields@austininstruments.com> wrote:


I'll get to the frequency part in a while...
---
OK, here's the frequency part:

If you have a discharged capacitor to which you suddenly connect a
voltage through a resistor, like this:

FROM TO

..E1>--O E1>--O
.. |S1 \ S1
.. | <--O--+ \<-O--+
.. | |
.. [R] [R]
.. | |
.. +--E2 +--E2
.. | |
.. [C] [C]
.. | |
.. GND [GND]




then charge will flow into the capacitor limited only by the resistance
and inductance of the circuit and the difference in voltage between E1
and E2.

As charge flows into the capacitor its voltage will rise, with the
result that, as time goes by, the difference in voltage between E1 and
E2 will grow smaller and smaller and the rate of change of voltage WRT
time will decrease.

In order to find out how long it will take to charge to a certain
voltage we can write:



t = k RC

E1
Where K = ln ---------
E1 - E2


and: t is the charge time, in seconds,
E1 is the DC supply voltage,
E2 is the desired voltage for the cap to charge to in time 't',
R is the resistance of 'R' in ohms, and
C is the capacitance of 'C' in farads

Getting our schematic and annotating it:

..
..+5V------+-----------+-------------+
.. \ | | |
.. E1 |R3 +---|------+ |
.. [100k] | | |R4 |R5
.. | | 2 |8 [100k] [1k]
.. E2--+-------+--|+\ 7 | |
.. | 3| >----+------+-->OUT
.. | +--|-/ U1 |
.. [100k] | |4 |
.. |R2 +---|----[47k]----+
.. | | | R1
.. | [2ľ2] |
.. | |C1 |
..GND>-----+-------+---+


We have:

5V
k = ln ------------ = ln 3.01 = 1.1
5V - 3.34V


t = kRC = 1.1 * 4.7e4kR * 2.2e-6F = 0.114s

and a diagram of the voltage across C1 VS time might look something like
this:

U1-3
/
5V-----------------------o------
o
o
3.34V--------o------------------
o |
o |
1.67V---o----|------------------
o |
o |
0V---o-------|------------------
| |
0s 0.113s


However, since the output of U1 goes low when U2-3 goes above 3.34V, C1
will start discharging as soon as that happens, with the result being
that, after first charging from 0V to 3.34V it will thereafter discharge
to 1.67V and oscillate between 1.67V and 3.34V forever:


5V---------------------------
U1-3
/
3.34V--------o--------o------
o o o o
o o o o o
1.67V---o--------o--------o--
o
o
0V---o-----------------------
|
0s


Now, as the cap starts to discharge toward 0V, the voltage across the
cap will be 3.34V, so the time it takes to discharge to 1.67V will be:


3.34V
t = kRC = ln ---------------- RC = 0.693 * 4.7e4kR * 2.2e-6F
3.34V - 1.67V

= 0.072s

When it starts to charge again the voltage difference between it and the
5V supply will be 3.34V, so it will take the same amount of time to
charge to 3.34V from 1.67V as it does to discharge to 1.67V from 3.34V.

Finally, since U1's ON time and OFF time will both 0.072 seconds, then
the period of oscillation will be twice that, 0.144s, and the frequency
will be the reciprocal of the period, 6.94Hz.

JF
 

Welcome to EDABoard.com

Sponsor

Back
Top