Messing around with simple Theremin circuits, the variable oscillator would get "stuck" in sync with the reference oscillator, and not move until disturbed significantly (like "snap to grid" in a GUI). This happened even when I used separate ICs with decoupling caps on their power rails. I've seen the same thing with a stereo FM modulator, too, the two oscillators' frequencies would get stuck on each other when they were supposed to move around independently. In these cases, they are both square wave relaxation oscillators.

What couples oscillators together? What specific mechanisms cause them to change state sooner or later than they otherwise would, and how can it be prevented?


4 Answers 4


Relaxation oscillators are prone to such behavior because

  1. When they are very near the threshold, it only takes a very slight disturbance to push them over 'sooner' than they should go
  2. When a relaxation oscillator hits its threshold, it's apt to generate a disturbance on the power supply.

Three ways of avoiding this problem are to use a resonant oscillator design, do a better job of isolating the oscillators and their power supplies, or use a slightly modified relaxation oscillator which subtracts a fixed amount of charge from its storage cap each time it trips, rather than discharging the cap to a fixed level, so that even if it trips "early" on one cycle, it will compensate by taking longer to trip on the next cycle. Note that the latter approach won't entirely avoid phase jitter when oscillators' phases pass near each other, but it will greatly reduce the "locking" effect.


I don't have a practical design handy, but consider the following main circuit with a constant current source, two caps (for discussion, assume they're equal), two NPN transistors with base resistors (for discussion, assume trivial base-emitter current is required to turn them on), and some control circuitry:

  1. The cathodes of C1 and C2, and the emitter of Q2, are grounded.
  2. The anode of C1 is connected to a positive constant-current source and the collector of Q1, and also feeds into the control circuitry.
  3. The anode of C2 is connected to the emitter of Q1 and the collector of Q2. The emitter of Q2 is connected to ground.
  4. The bases of Q1 and Q2 are connected via resistors to separate outputs from the control logic.

Behavior should be as follows:

  1. Reset the circuit by turning on both Q1 and Q2, so both caps start out discharged.
  2. During the first part of each cycle, Q1 should be off; Q2 may start out on, but should switch off sometime before the next step; C1 will charge through the constant current source, while C2 will sit at zero.
  3. Once C1 reaches a certain threshold, which should be at least twice the voltage level output by the control logic, Q1 should switch on. This will transfer an amount of charge from C1 to C2 equal to the emitter voltage on Q1 (i.e. the voltage from the control circuitry, minus 0.7 volts), times the capacitance. If C1 and C2 are equal, this will drop the voltage on C1 an amount equal to that emitter voltage.
  4. Sometime after C2 has reached its equilibrium voltage, but before C1 reaches the threshold again, Q1 should switch off and Q2 switch on.
  5. Repeat the cycle, switching Q2 off sometime after C2 has been discharged.
  6. If turning on Q1 for awhile doesn't push C1's voltage below the threshold, then the circuit should be reset (by turning on Q2 while Q1 is still on). Unless the transistors take too long to charge or discharge C2, or the control circuit forces overly-slow timings on them, this should never happen.

Note that in this circuit, it won't matter how long Q1 and Q2 are switched on each cycle provided they're switched on long enough for C2 to reach its equilibrium state. The only path for charge to flow into C1 is the constant current source, and the only way for current to flow out is by filling up C2. The only path for current to flow into C2 is from C1 (assume transistor BE current is trivial), so each time C2 is charged and discharged it will take a fixed amount of energy from C1. The net effect is that the overall average oscillation rate will be the number of amps into C1, divided by the number of coulombs dumped each cycle in C2, independent of the threshold voltage for C1 or the durations that Q1 and Q2 are switched on.

Try this circuit.

The upper-left op amp and one capacitor form a charge accumulator. The other cap and mosfets form a charge dumper which will dump a fixed amount of charge each time the mosfets are cycled with non-overlapping signal. The bottom center is a control circuit which will generate discharge cycles if there's too much charge on the cap. I have outputs showing the generated pulses, generated pulse/2, and generated pulse/16, along with 100Hz and divided-down reference waves for comparison.

Note that you may adjust the threshold voltage for the comparator; this will vary the phase of the output, and with the slider values I've provided may delay it by up to 16 cycles. Note, however, that when the slider is returned to the right (+2 volts) the wave will return to being essentially in phase with the original, and will count at up to 1/4 of the 673Hz (value chosen arbitrarily, but must be at least 4x count rate) signal until it has "caught" up.

The oscillation frequency is determined solely by the charge current, the anode voltage of that cap which is held by the left op amp, and the size of the dumping cap. You may find it interesting to play around with the size of the accumulating cap; it will affect phase, but not frequency. The simulated oscillator speed isn't quite precise, but it's pretty close. The notable thing is that one can move the threshold slider around to try to jinx the oscillator, but it will not only get back to being in the correct phase relationship with where it should have been but the count/16 output will show the correct phase as well.

  • \$\begingroup\$ Do you have an example circuit for the modified oscillator? \$\endgroup\$
    – endolith
    Aug 9, 2011 at 21:48
  • \$\begingroup\$ @endolith: See edit. Is there any handy way to post schematics? \$\endgroup\$
    – supercat
    Aug 11, 2011 at 15:43
  • \$\begingroup\$ Just making an image and uploading it. electronics.stackexchange.com/questions/1024/… \$\endgroup\$
    – endolith
    Aug 11, 2011 at 16:00
  • 1
    \$\begingroup\$ @endolith: Most relaxation oscillators are far more susceptible to coupling and interference than than resonant oscillators, because there is a small portion of their cycle where they have extremely high feedback gain. In a harmonic oscillator, if a brief state disturbance in one direction is followed very soon thereafter by an equal and opposite disturbance, the second disturbance will very nearly cancel the first. With a relaxation oscillator, it's possible for the first disturbance to occur when the gain is high, and for the equal and opposite one to occur when it's low. \$\endgroup\$
    – supercat
    Aug 11, 2011 at 19:50
  • 1
    \$\begingroup\$ @endolith: Posted. \$\endgroup\$
    – supercat
    Aug 12, 2011 at 18:47

Answer: Coupling

Fundamental answer: They are never in true sync, but in chaotic attraction

Strictly speaking the synchronicity of coupled oscillators is never ideal. The weaker the coupling, the longer it takes for phases to drift to a common point. The interesting aspect of coupling, is that even ideal model of 2 weakly coupled oscillators will never produce clean sequence of phase disagreements. The sequence will be chaotic as if there were noises in system, even if modeling exluded any original noise sources.

Coupled ideal oscillators are subclass of mathematical objects, named attractors (google for strange attractors).

Example of chaotic object derived from deterministic base, on finite machine with fixed resolution(on real computer): Self adjusting iterative algorithm, solving some equation with non-zero error. When error value is fed back to algorithm, every next iteration gives smaller error. At some point error will be very small, but still non-zero and will suddenly start increasing. The error will not oscillate harmonically, but will behave chaotically.


Congratulations, you seem to have a flair for implementing phase locked loops, albeit unintentionally :-).

What do you mean by "snapping in a GUI?". ( Normal mentating fails to dislodge meaning :-) )

Without a little more hardware detail this can only be an informed guess. It's easy enough to produce a "it may work like this" explanation. Whether the following is correct is TBD BUT it seems more likely than any obvious alternative.

Minor variations in voltage and current will be caused in a system by high low transitions or even by sinusoidal levels. In a perfect system these are localised to the iC or functional block concerned. In the real world small variations will appear on power supply rails and in other common circuitry - perhaps shared earth tracks etc.

An oscillator is driven to its next state by a changing analog value, with the rate of change accelerated or decelerated by supply voltage level. The degree to which eg an op amp is immune to variations in power supply is part of its formal specification, and nothing is perfect.

If an oscillator speeds up even very slightly when the companion oscillator is high and slows down when it is low then it will "dither" around its mean frequency and not attain lock. But, if it eg speeds up when levels match as (may well be the case) and slows down when they don't match then it will be driven in one direction until it syncs.

A test of this would be to measure that rate of movement towards locking and to then see if it is affected by substantial improvements in decoupling.

Millenium Bridge: A similar effect is known in mechanical systems. The tendency of bridges to be excited by eg soldiers marching in step is well known and troops are generally commended to walk randomly when crossing such structures. However, a long known but largely forgotten phenomenon exists where an oscillating structure will actually drive walkers into step with its resonance so that they then in turn excite its resonant mode and may destroy it./ This occurred on the London Millenium Bridge foot bridge. Pedestrians walking on the bridge as it swayed found that the swaying movement forced them to alter their gait slightly and soon people crossing the bridge began to walk in step and to excite resonance modes in the structure. It became clear that the integrity of the bridge was threatened by this action and it was closed to the public within weeks of opening and remained closed for a substantial period (2 years I recall) while special damping systems were fitted.

  • \$\begingroup\$ Snapping in a GUI means having graphical elements move to predefined grid references - think schematic capture software with gridlines on the screen, where wires and parts 'snap' to the grid \$\endgroup\$ Jul 28, 2011 at 18:27
  • \$\begingroup\$ Snapping in a GUI, like when you are in a drawing program and have "snap to grid" enabled. You get one thing close to another and they snap together, and then it's hard to pull them apart. \$\endgroup\$
    – endolith
    Jul 28, 2011 at 18:44
  • \$\begingroup\$ Don't feel bad. I couldn't catch the reference either...and I had a schematic capture program up on the other monitor while viewing the question. \$\endgroup\$
    – Joel B
    Jul 28, 2011 at 20:46
  • \$\begingroup\$ Aye. I parsed the sentence as it being something he did to perturb the oscillator. Snap to grid I know but seemed irrelevant. \$\endgroup\$
    – Russell McMahon
    Jul 28, 2011 at 22:17

Here is a cool video that demonstrates this effect quite well, but with metronomes rather than electronics.

When put into simple terms, there are lots of things that will cause an oscillator to speed up or slow down: Power supply variations/noise, temperature, mechanical vibration, EMI/RF stuff, etc.

Usually these things will only have very small effects and/or only change the frequency for one or two clock cycles. But it is possible for lots of little changes to build up over time to have a noticeable effect-- especially when the source of the effect is close in frequency to the "victim oscillator".

Now, an oscillator running on it's own will cause noise on the power supply. This noise can cause other oscillators near it to speed up or slow down. When two or more oscillators are near each other they will tend to effect each other in ways that cause them to synchronize. One osc will speed up and the other will slow down until they are locked together-- like the metronomes.

  • \$\begingroup\$ Yes, coupled oscillators, but which ways are they affecting each other? What form is the coupling? \$\endgroup\$
    – endolith
    Jul 28, 2011 at 19:07
  • \$\begingroup\$ @endolith As said in my answer: They could be coupling through power rail noise, mechanical vibration (unlikely), EMI/RF noise, and maybe something I haven't heard of yet. You didn't give enough information to isolate it further, but I'd put my money on the power supply first, then some sort of EMI/RF thing. \$\endgroup\$
    – user3624
    Jul 28, 2011 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.