I'm having some trouble with R.G. Keene's Quick N Dirty Test Oscillator

Started by phaeton, September 29, 2005, 09:30:47 PM

Previous topic - Next topic

phaeton

This one here:



It doesn't seem to want to work for me, and I feel like a total retard because it is a simple circuit.   :icon_redface:

Right now it is breadboarded (good thing I did this first).  I am powering it with a Wall Wart and I am getting 9.56V at the power rails.  I had to substitute a couple of resistor values (i.e. 33K because I had no way to make 22K), but when I went through and measured them, I found that pretty much all of them are well within 10%, most within 5%.  I've double checked the transistor pinout (Fairchild says i'm right).  All the caps are mylar caps and they are all as specified, and the transistors are 2N3904s.  Yet I have no sinewave output.  Here's what volts I am measuring:

Top Transistor:
E- 0.0V
B- 0.0V
C- 9.54V

Bottom Transistor:
E- 0.0V
B- 0.0V
C- 9.54V

In fact, anything on the outside of those two 0.01uf caps I get 0.0V, with the exception of the two collectors.  Red flag!

I consulted #electronics on freenode.net, and most concurred that the collector of the bottom transistor should be connected to the base of the top transistor at the junction right under the 4.7K resistor (the one on the right)- there is no dot there but there should be one, they say.  The above values are with that NOT connected.

So I connected them:

Top Transistor:
E- .884V
B- 1.25V
C- 9.54V

Bottom Transistor:
E- .048V
B- .652V
C- 9.54V

Looks better, but still no output.  What I'm using to measure with is a 1/2 of a small set of powered PC Speakers- 1W or something.  I'm pretty sure the speakers work, as I play my guitar through them periodically, (don't ask).

Any suggestions?  And am I misreading that junction as "not connected"?

Thanks for any and all...

(edited the title to make more sense)
Stark Raving Mad Scientist

mjarus

Where do you see a 22k resistor?  The bottom resistor is 22ohms not 22kohms.  That may be the problem...

R.G.

There are several conventions about drawing schematics and which wires connect when they cross. I've had to use several of them, so sometimes I get them mixed up. However, there is at least one convention that makes that schematic connect there correctly as drawn...  ;)

Yes, all four wires connect under the 4.7K collector resistor of the bottom transistor. One of the conventions would have a dot there.

However, your voltages don't make sense if you connected them. The base of the top transistor is supposed to be wired to the collector of the bottom transistor, so presumably they should be at the same voltage; but your voltage measurements don't show that. Also, you show the collector of the bottom transistor at the power supply voltage. That can't be possible if the transistor's base emitter is forward biased (and the voltages show that it is) and the 4.7K is really 4.7K. I think there's either a wiring error or possibly your breadboard connections are flaky.

Here's how the thing works. If you remove the base of the top transistor from the collector of the bottom transistor, the bottom transistor makes a twin - T filter, which is set up with so much gain that it oscillates. The collector is pulled up by the 4.7K load resistor, the base is biased from the collector by the two 27K resistors in the twin T in series, and the 22 ohm resistor in the emitter lowers the gain just slightly and somewhat stabilizes the operating point. You can short out the 22 ohm resistor and it will start more quickly, but will have a distorted output. That may be OK for some applications. The top transistor is purely an emitter follower to keep whatever you connect to the collector from loading down the collector, reducing the gain, and letting the oscillator stop for too low a gain.

All RC oscillators have a delicate dance between enough gain to keep oscillating, but not so much that they distort. Most commercial ones with specifications on distortion to uphold have some kind of gain changing device to trim the gain back to ... just... right... . That's where the "dirty" part of the title comes in. I tried to set it up so that it would always have enough gain to start, even if it had a bit of distortion. If your bottom (oscillator) transistor is a bit low in gain, it might not, hence my comments about shorting the 22 ohm resistor.

However, your voltages do not show it biased correctly. Even not oscillating, the collector of the oscillator transistor should be down about 2-3V, some where in the middle and not up at the power supply.

Dink with it and find what's keeping the oscillator transistor from pulling down on the 4.7K resistor, then yell back at us.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

mjarus

Wow, I really like RG's posts... I was actually trying to pen and paper the circuit to figure this one out myself!  I do have one question though.  Can you explain how the 4.7k pullup works?  I have used pull ups in digital circuits, but I assume the two 0.1 caps are somehow blocking the DC and this is meant for the AC feedback? 

Also, what current/voltage should there be @ the collector of the first 3904?  It says that the output of the entire circuit (before the dividers) is 1V, so is it 1V (i.e. is Q2 unity gain?)?  At first I assumed that is was 1ma/4.7v... which was derived from (9.0-0.6)/2 rounded to 4.7k.

Trying to apply some stuff from the last lesson you gave me.

BTW, if the bottom resistor is 33k and not 22 like stated in the top of the post, I assume this is the problem.

mjarus.

bioroids

The bottom resistors are 22 ohm and 100 ohm, not 22k and 100k (and also not 33k either). In most cases if the letter is ommited it means ohms, then k for kilohms, etc. I've made this mistake :)

Luck

Miguel
Eramos tan pobres!

R.G.

QuoteCan you explain how the 4.7k pullup works?  I have used pull ups in digital circuits, but I assume the two 0.1 caps are somehow blocking the DC and this is meant for the AC feedback?
Actually, "pull up" was probably the wrong word to use, although that's what it does. The 4.7K resistor from the collector of the oscillator transistor to the power supply is the load resistor, and it's what converts the variation in current through the transistor into a voltage variation on the output. It also provides the DC voltage and current from the power supply to let the rest of the circuit run, which is what I was focusing on.  Yes, the two 0.01 caps are part of the AC feedback, and block DC. The do not take part in the biasing. One way to figure out biasing is to simply remove all the capacitors from the schematic, just erase them. They do not pass DC, and so they cannot have any part in biasing.

QuoteAlso, what current/voltage should there be @ the collector of the first 3904?
If there's no oscillation going on, it's low - about 1.5Vdc. When it oscillates you will see varying readings depending on how your meter reads the oscillation.

QuoteIt says that the output of the entire circuit (before the dividers) is 1V, so is it 1V (i.e. is Q2 unity gain?)?  At first I assumed that is was 1ma/4.7v... which was derived from (9.0-0.6)/2 rounded to 4.7k.
It's about 1Vrms. The way RC oscillators work is that they have something which produces ain inverting gain, and a feedback network that causes the phase of the signal fed back to the input to be changed by 180 degrees at some frequency - not all frequencies. The gain must be sufficient to make up for the losses in the passive RC network feeding signal back. So at one specific frequency where the phase change is 180 degrees in the feedback network, the output signal provides its own input signal, and the gain provided through the gain block is more than enough to make up for any losses. Any noise anywhere in the the thing produces an output signal that drives the input that drives the output... and it oscillates at that frequency.

In fact, if the overall gain through the gain block times the losses through the feedback network (this is what the controls guys call loop gain) is more than one, the oscillations grow, because the fed-back input is bigger than is needed to sustain itself, and makes a bigger output. The oscillations grow in size until something limits them outside the loop. The limitation is an effective reduction in gain, and that keeps the oscillation size down to whatever it is at the limitation. In this case, the bias point of the oscillator transistor is about 1.5V. The collector simply can't swing any lower than 0V, so when the downward swinging signal hits close to 0, the output waveform is limited. The signal is therefore limited to about maybe 1.4V peak per side, and that's about 1.0Vrms, which is where I got the output size.

If I had biased it up in the middle of the power supply, the oscillations would have grown until it had about 4.? volts peak before it bumped into a power supply limit. Or I could have used a clipping diode on the output, and that would have limited the size of the oscillation to a peak voltage of one diode drop.

This is how all commercial RC oscillators are stabilized. They do it fancier, by having something read the peak or rms value of the output and adjust the loop gain down to just  enough. This minimizes distortion. Most people don't remember this these days, but Hewlett Packard was started from Bill Hewlett's master's thesis on using an incandescent light bulb as a limiter for an RC oscillator. The HP 200 oscillator was a workhorse in the EE biz for decades. I have one in my garage.

If the gain is just below the loop gain of 1, the oscillations start on any disturbance, but die out. How fast they die out depends on how much below 1 the gain is. This is the basis of all those electronic bongos. If you took my q&d circuit, raised the 22 ohm resistor until it didn't oscillate any more, then touched the junction of the two 0.01 caps with your finger, you'd get an electronic "bop!" that sounds much like a bongo.

If you ran an external signal into it, the gain would be much higher at the near-oscillation frequency than off of it. You'd have a bandpass filter. This is the basis of all RC bandpass filters. They're oscillators with not quite enough gain.

But I digress... the signal at the collector is about 1Vrms, and the second transistor just buffers it. The second transistor's gain is a tiny fraction less than unity. Now that I think about it, there's a bug in the circuit. Can you think what it is?


It's the bias on the second transistor. It's base-emitter eats some of the DC level from the collector of the first transistor, and the output on the emitter can't be as big as the signal on the collector. It runs into ground first. There's a quick fix - move the base of the second transistor up by a diode drop by inserting a diode in series with the 4.7K collector resistor on the first transistor, then hooking the second transistor base up to the junction of the diode and 4.7K. That moves the base of the output transistor up one diode and prevents it from limiting.

QuoteBTW, if the bottom resistor is 33k and not 22 like stated in the top of the post, I assume this is the problem.
No, actually, it's not. Making that 33K moves the collector up to about 8V, all right, but not 9.54.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

phaeton

Oh my gosh you guys- I owe you all an apology.  I seem to have contracted whatever sort of roving death hack that my roommate's kid brought home from school.  Last night i was feeling very bad, and was very feverish.  Aside from a vague memory of sitting in front of the computer dripping in sweat, I don't even recall posting this.  No surprise that it is fraught with error and doesn't make much sense.  Since I am at work I'm normalized by some ibuprofen, and have more of a level head than last night (sort of).

First, some clarifications:

Where do you see a 22k resistor?  The bottom resistor is 22ohms not 22kohms.  That may be the problem...

Where I say "22K resistor" I actually meant "27K resistor".  This would be the pair of them on the left half.  The 22ohm resistor on the bottom is a 22ohm resistor on my circuit.  And then I said:

What I'm using to measure with is a 1/2 of a small set of powered PC Speakers- 1W or something.

I'm actually measuring with a DVOM.  I'm using the powered speakers to listen for oscillation at the ends of the various 'outputs' on the outside of the capacitors.

---ok----

R.G. Says:
There are several conventions about drawing schematics and which wires connect when they cross. I've had to use several of them, so sometimes I get them mixed up.

Indeed there are- but right wrong or otherwise i suppose it is my fault for misinterpreting or misreading the schematic.  After all, you are one of the long-bearded wise elders seated atop the misty mountain, and I am but the humble neophyte votary.

And then he says again:
However, your voltages don't make sense if you connected them.

Agreed- none of that makes sense at all.  When I got up this morning, but after peeling the goop from my eyes  I noticed my sacrificial printout of the circuit with all kinds of fuzzy marks sitting on my desk.  I didn't look at it closely, unfortunately.  Whether I measured incorrectly and wrote the wrong numbers down, or measured correctly and wrote the wrong numbers down, or measured correctly, wrote down the right numbers but posted the wrong ones I don't know.  I'll have to try this again, and for last night I plead encephalitis or something.  I don't *think* my breadboard is being flaky, but I'll look into that too.

Here's how the thing works.

Thanks for the explanation!  A couple of days ago I was trying to figure it out.  This clears up a bunch.  And as far as the "dirty" part- a little bit of distortion would be fine, of course.  The whole point of it (for my usage) would be so that I can test out some of these effects I've put together.  As horrible as it sounds, my bedroom is currently so small that to drag a guitar out from under my bed requires some major shuffling around of objects- It's about a 10 minute ordeal.  Pulling an amp out of the closet is about 5.  With a guitar strapped on, there is one place I can stand in my room, can't sit down anywhere.  I get home from work about 6:30, roommate's kid goes to bed at 8.  As a result, I have a couple of effects I've built that I have no idea if they work or not.  They look nice though.  I intend on putting this oscillator on one end of a perfboard (signal out) along with a small LM386 amp on the other end of the perfboard (effect in, speaker out) for testing.  I have a pair of cheapie 6"x9" speakers mounted in a Sterilite tub (don't laugh) that in series make 8ohms.  In theory it should work for now.

Hopefully soon I'll have a "more luxurious" home situation with more room to move around in.  It's been ages since I've even just *played*.  Anyways, off my ramble...

I'll have to look at this again Monday- perhaps I'll either feel better or die of meningitis by then.  In the meantime, I'll apologize to everyone again, particularly R.G., for my retarded post. 
Stark Raving Mad Scientist

vanhansen

Retarded or not, I just learned a hell of a lot from R.G. about this circuit and biasing transistors, which I'm still not quite getting but understanding it more.  This is great info that he shared.  Now I just need to read his GEO article a hundred more times.  :icon_mrgreen: Joe Davisson's Electonic Math Helper is an awesome learning tool.  I use it while reading R.G.'s article to put the numbers in a better perspective.

Take some medicine, get some rest.  :icon_smile:
Erik

R.G.

Hey, no apology needed.  We've all been there.

You *did* see the wink by my ...um... explanation of the schemo, right?

Let know what happens.

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

aron

The circuit works and I built it myself. I even remembered making a mistake as well, but I forget what it was now. I'm sure I could find it in my archives!

vanhansen

What's the preference to switching between the 3 different sine waves, 3 different jacks or a switch?  In need to make one of these.

Edit:  Will 2N2222A Transistors work in place of the 2N3904's?  I'm sure some rebiasing would be in order.
Erik

R.G.

QuoteWhat's the preference to switching between the 3 different sine waves, 3 different jacks or a switch?  In need to make one of these.
No preference. Whatever works for you. In my case, it's whatever I have already in the junk box that I tend to prefer.

QuoteWill 2N2222A Transistors work in place of the 2N3904's?  I'm sure some rebiasing would be in order.
I doubt that you'll even need to rebias. The 2N2222 is a slightly lower gain, but like many modern transistor circuits, this one is fairly immune to transistor variations as long as you have enough voltage, enough current, and enough gain.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

vanhansen

Erik

phaeton

Success!! :D

Somehow ???

I haven't changed anything.  I pulled the circuit out as i had it last week, powered it up, and "SQUEEEEEEEEEEE" I have sweet, singing oscillation.  I did leave the schematic nearby but I'm sure that the house is not infested with intelligent %^&*roaches nor CircuitFaeries.  The dog likes to reprogram the clocks, record late-night shows (Adult Swim, no less) and forge emails in my name as a hoax, but this is was out of her reach and well, she's just a dog.

So I don't know what to say!

Perhaps it's been right all along (I did put it together in a most Logical sequence) and somehow in my delirium/psychosis/encephalitis I was using my DVOM to probe the legs of a dead chicken, and posting the results of that.  Cosmic rays?  Phase of the moon?  Of course, too many people are involved, and I can't just delete my post and deny anything happened........

It actually sounds alright.  I don't really hear any distortion, or at least not enough to worry about.  I just need a simple tone, and this will do just fine.  Any tips on lowering the frequency, however?  It plays roughly an A# ((1760Hz, i believe?)... the lowest one you can hit on your little E string).  Optimally I think i'd like it down closer to the 440 A.  I took a SWAG and upped the values of those two .01uf caps.  Going up to .022uf dropped it a few steps, but anything higher than .033uf doesn't oscillate, even if i stagger them.  A knob-variable pitch would be awesome, but probably isn't feasible without quadrupling components...

Of course you know what I'm going to do with this, right?  I'm going to mount it in a small box on one end of a perfboard, with an LM386 amp on the other end.  (Don't be surprised if my next questions are about filtering out the ripples the oscillator puts on the power rails).  A jack for Oscillator out, a jack for Amplifier In, and a jack for Speaker Out.  On the top will be a screw, terminal or connection that I can use to plug in an audio probe lead (ok to put the capacitor on the opposite end of the cable, right?).  Push button on/off.

Thanks again for everything, and sorry for being such a goob....
Stark Raving Mad Scientist

R.G.

If I could only figure out how circuits self-heal when powered off, I'd try to bottle it and sell it to the military...  ;D

It happens, no biggie.

To change frequency, change all three of the caps, not just two. Make them larger to lower the frequency. In this case, lowering it to 440 from 1760 would entail multiplying by four. To do fine adjustment, tweak the resistor in the two-capacitors leg.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

vanhansen

phaeton, let us know what you find out to get it to A 440.  This is the perfect tool...signal generator, perfect for use alone or with audio probe, and last but not least.......a guitar tuner.  :icon_mrgreen:
Erik

Paul Marossy

I use my quick and dirty audio oscillator all the time.  It was like the first circuit I tried building and it was a failure. I revisited it like a year later and realized that radioshack.com had put resistors in marked little baggies, but they were mixed up so I had the wrong resistors in some of the places. Fixed that and it worked great after that. :icon_cool:

phaeton

If I could only figure out how circuits self-heal when powered off, I'd try to bottle it and sell it to the military...  Grin

Yeah really...  In any event, thanks for all the help and suggestions.  Don't know where you are geographically, but bratwurst and beer are on me if you ever make it to SE WI.

phaeton, let us know what you find out to get it to A 440.  This is the perfect tool...signal generator, perfect for use alone or with audio probe, and last but not least.......a guitar tuner.

Well, *I* am not going to try a *perfect* 440 out of it, just something in the ballpark, but I'll be sure to post the results anyways- as R.G. says it's going to be quadrupling the cap sizes and then fine-tuning with the resistor connected to them.  If you were to build a tuner you'd probably have to put a trimmer in it and 'tune' it to the 440 (or whatever freq you wanted) anyhow.  It would make a nice, simple tuner though- something that could be very very small- mounted in a keychain or old BIC lighter casing.  Press the button on top and it plays the note for 10 seconds.

Of course now I've got all these crazy ideas of making a whole array of these tuned to the chromatic scale with push-button triggers so I can play all kinds of notes simultaneously and....   uh...  heh....
Stark Raving Mad Scientist

vanhansen

Quote from: phaeton on October 05, 2005, 11:03:05 AM
Of course now I've got all these crazy ideas of making a whole array of these tuned to the chromatic scale with push-button triggers so I can play all kinds of notes simultaneously and....   uh...  heh....

...train a seal to press buttons on individually tuned boxes instead of blowing horns.  :icon_mrgreen:
Erik

R.G.

Don't put a whole lot of effort into using this thing as a tuner. It will probably drift too much, a problem common to all RC oscillators. You'd need a crystal oscillator to keep tuning the tuner. Stable RC oscillators can be done, but with on-board temperature ovens to stabilize temperature, temperature compensating components, that kind of thing.

Simpler to use an LC oscillator, like Thomas did in the US Vox amplifiers. LC oscillators are what was used in organs before digital generation. That's better and will do OK over moderate periods of time, like years.

Crystal control is still the most stable oscillator that's easily available (discounting things like krypton lasers).
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.