Thursday, April 5, 2012

Silly pointless stuff... (Mr Jiggles 2)

So yesterday Mr Jiggles became a little oscillator - but rather than a balanced sine wave we had a light distortion where the upper half was a bit wider and the lower half was a bit narrower.

I usually like to check the ground potential relative to the output if there is a problem, but this one is fine - maybe it could use a cap across the the supply but nothing to explain the distortion.

This is the signal on the supply voltage (no problems here either - inductors are great).

Making coffee I realized what the problems was (and it's a simple one).  This is the same oscillator with a tiny addition - the yellow curve is still the same output as before but now we have a blue curve that looks like a very happy sine wave (although shifted in phase 90 degrees).
The problem leading to the distortion turned out to be a silly mistake on my part - I sampled of a cap that had one end floating (which of course made it incapable of transferring energy in a balanced way).  A simple resistor to ground is all it takes from the floating cap terminal.  The phase shift above is from an additional resistor cap chain (more about that later).

Just for kicks let's look at the power coming into the collector at the same time as the oscillator state.  Lots to learn from this one... The first thing that jumps out is that our output is a balanced cyclic form but the voltage looks like two different curves.   If you haven't guessed, the reason is the led (remember there is a minimum voltage before it conducts and until we hit that voltage on the emitter not a lot gets to flow) - caps cover the transition interval.  We could just leave out the led and only have a resistor to limit the current but since we can't always have things linear in real life I'm leaving it in - for character.

Just for kicks let's dump the oscillator directly through a diode... notice the similar curve (not exactly the same because the difference in cap sizes.

Other fun things to do are to tap from the collector or the emitter, to put resistor dividers in line to change the output voltage range, to bias the base to change the operating point of the transistor... lots of things.. endless things...
But for now since we are pushing our signal through other objects, let's try to put it through other crystals.  If we use the same frequency the signal goes through nicely, but if a different frequency (4.078 MHz in this case) we get nothing at all... crystals make great filters.

What happens if we drive two oscillators at each other...
Now let's make Mr Jiggles a friend (perhaps with the different crystal) and then put them together.

If we pass the mixed signals (yellow) through another crystal (that matches one of the parent signals - in this case the blue line) the third crystal does a great job at pulling out the right signal (again crystals make great filters).

And for the last thing today let's change our second oscillator to the same frequency.  We get some loose coupling (breadboards are not ideal for this stuff - probably you should always just stick with simulations and finished pcbs - nothing to gain from imperfect circuits - always follow schematics exactly) but there's still lots of jitter.

We can plot this a different way and see the differences more clearly.

And what it looks like when we tightly couple the oscillators (between the capacitor dividers across each crystal).

Anyway, every once in a while I like to just play around a bit and get a feel for how things actually work and see the changes in reality... touch a few wires to see which is sensitive to noise and how that propagates... troubleshoot the unexpected behaviors... see what happens when the loads match and when they don't... it's silly and pointless, but fun.