[sci.electronics] Lots more about R-C sinusoidal oscillators

max@trinity.uucp (Max Hauser) (01/29/88)

You'd better skip over this article if you are not interested in
sinusoidal oscillators or other waveform generators. I've 
cross-posted to rec.audio because some of the examples are actually
from audio test generators.

In response to a request in sci.electronics for simple RC sinusoidal
oscillators, wtm@neoucom.UUCP (Bill Mayhew) very kindly suggests:

> Summary: try a twin T oscillator
> 
> My ancient copy of the ARRL handbook has simple little circuit for
> a twin T single transistor circuit.  It is quite stable.  It
> requires one transistor, 4 resistors and 4 capacitors.  ...

  [Followed by neat on-line schematic]

> ....  Definitely a circuit for Old Farts.  I never really did like
> the light bulb in a Wien bridge.  --Bill

Well, Bill posted a helpful reply, which is more than I did, but
now this talk about RC sinusoidal oscillators among old farts has 
got me going, as I used to work with a lot of circuits for waveform
generation and shaping, and came up with a few of my own. You will
not find them in the Radio Amateur's Handbook, as far as I know.

I have to point out first that any objection to a "light bulb" in a 
Wien-bridge oscillator applies to a twin-tee too, in spades. The 
essential part of a Wien bridge is just a network with two R's 
and two C's (a series R and C from input to output of the network;
a parallel R and C from output to ground), just as the essential 
twin-tee is a network with three R's and three C's. In both cases,
adding sufficient linear gain around the network makes an oscillator,
but a mechanism is needed to regulate the gain if the sinusoid is to
have low distortion, not to mention predictable amplitude.

You can build either oscillator with an explicit automatic-gain-control
(AGC) element (a light bulb as an average-power-sensitive-resistance
is an old and cheap, but by no means the only, form); or you can build
either oscillator with "no" AGC, as in Bill's example, in which case you
are relying on the implicit nonlinearity of the gain element (transistor,
say; rec.audio readers can certainly use tubes [valves] if they prefer
the sound) to regulate loop gain. This is narrowband AGC or "self-limiting
oscillation": as the oscillation tends to grow in amplitude, the gain
element begins to distort, and the gain seen by the component at the
oscillator's fundamental frequency begins to drop (as more and more of
the gain element's output takes the form of distortion, i.e. components
at frequencies other than the fundamental). This gain drops to the point
required to sustain a steady oscillation amplitude. The RC network
as an incidental benefit usually provides some filtering action so that
if the circuit's output is taken at the proper point, distortion 
components there will be small.

The advantage of a light bulb or other long-time-constant gain control
(often a linear variable-gain circuit is used nowadays) is that it can 
leave the oscillation signal path extremely linear and thus yield a
lower-distortion sinusoid, all other things being equal.

If you really want to know "all about" simple sinusoidal oscillators
(amplitude limiting, distortion, frequency stability, etc.), I recommend
Clarke and Hess, _Communications Circuits: Analysis and Design_ 
(Addison-Wesley 1971), the veritable bible of oscillator-mixer-receiver
designers. In any event, though, simple RC sinusoidal oscillators
always entail SOME type of loop-gain control, even if it consists of
a person hired to adjust a knob ("manual" gain control: MGC?).


Three standard, competing RC sinusoidal oscillator configurations,
each based on an RC network added to a gain stage, are the twin-tee
network (which needs three Rs and three Cs, and realizes
a transmission gain of zero, ideally, at a phase shift of 180
degrees); the three-section phase-shift networks (which also need
three Rs and three Cs; the common CRCRCR three-zero form exhibits
a phase shift of 180 degrees at a transmission gain of about 1/29, if
memory serves); and the Wien-bridge network, needing two Rs and two Cs
to show a gain of 1/3 at a phase shift of zero. Many other RC networks
can exhibit the essential property of frequency-dependent phase shift
that passes either zero or 180 degrees at a well-defined useful 
frequency (though if you can devise such a network with fewer than two
capacitors, I'd like to hear from you ...).

Second-order considerations, however, are different for the three
common networks I've mentioned; and they favor the Wien bridge
heavily, in my opinion. First, it needs only four timing components
to set frequency, while the others need six (and the twin-tee has
ratios in it as well). Second, and this is more subtle but no less
practically important, the Wien bridge is the most straightforward
and "designable." The target gain value to turn it into an oscillator
is +3, which is both easy to achieve and easy to set. This value can
be scaled up or down by ratioing the arms of the Wien network. The
phase-shift network is similar in this regard except that it has more
loss and therefore requires more gain to make it oscillate.

The twin-tee, horror of horrors, when you sit down and analyze it,
theoretically requires "infinite" amplifier gain to oscillate, since
the basic network realizes an infinitely deep transmission notch as
the phase shift passes 180 degrees. No finite gain value will permit
it to oscillate.  The twin-tee oscillator works in practice because
the network exhibits a less-than-infinite notch due to component
mismatches, or it oscillates detuned from the nominal center frequency
where it matches the magnitude and phase shift of its companion gain
stage. Besides the annoyance of a circuit that works more poorly as
the components become ideal, it too needs a large (and highly
component-sensitive) gain, as well as six critical RC elements.

(The "ideally non-oscillating" phase-shift oscillator was a witty
topic among bored iconoclast circuit theorists a few years ago.)

Several years ago I had occasion to look into this subject in depth,
needing cheap sinusoidal audio test-signal generators, and this
led to an oscillator circuit that exploited the internal schematic of
CMOS NAND gates in a way that their designers surely did not intend.

You can take a CMOS gate chip; bias properly to operate the transistors
in a linear mode, in which case a 4-input NAND gate becomes a simple
op amp with four inverting inputs; embed Wien-type RC networks, one to
each input, in a summing-junction topology; add a couple of diodes to
a second gate for a controlled soft nonlinearity; and presto, you have
a near-minimum-component RC sinusoidal oscillator that will operate at
up to four different preset frequencies according to which gate input
you enable. This works up to about 40 kHz (M. Hauser, "Programmable
sinewave oscillator uses only one CMOS IC," _Electronic Design_ 
vol. 22 no. 24 p. 200, 22 November 1974; note that a "pi" is missing
from the denominator of the frequency expression). I also put a similar
one in Popular Electronics for another purpose at about the same time
(that was in the Good Old Days, after Poptronics had merged with 
Electronics World, but when it was still about electronics).

If you want continuously variable frequency, these RC networks all
lose because they require tandem adjustment of multiple component
values. Tom Fredrickson and co. at National Semi were pushing, 
several years ago in the NSC Linear Application notes, a better
approach to easily-tuned RC sinusoidal oscillators based on 
comparators in feedback with 180-degree phase-shift networks; if
you change the network via a single resistor, it changes the 
180-degree frequency and also the gain, but the gain no longer 
matters, since the comparator detects zero-crossings and depends on
the phase-shift circuitry to clean up its output waveform.

There is always the tack, taken by Intersil in the horrible 8038 
and more successfully later by Exar in the 2200 series oscillator
chips, of a (integrator-and-hysteresis) triangle-wave oscillator 
followed by a nonlinear network to shape the triangles into sinusoids.
These methods yield easy frequency tuning, but are much more
complicated in design than simple fixed sinusoidal RC oscillators.

Square waves, of course, are easy to generate by various means, and
they can be both extremely stable and also frequency-selectable, via
crystals, counters, etc.  Unfortunately squarewave frequency sources
are awkward starting points for other waveforms over any sort of 
frequency range, unless you use a high-frequency clock, generate the
waveform numerically, and run it through a DAC (shudder); or lock a 
controllable oscillator of desired waveform to the squarewave source;
or employ a variable-frequency filter.

Another approach that I used, to convert audio-frequency square waves
directly into triangle waves, with constant amplitude over a wide 
frequency range, uses a capacitor and current switch to generate
triangle waves whose slope is set by an external current. In turn 
this current comes from another subcircuit that measures the period 
of the incoming square wave, obtains its reciprocal directly (thus an 
analog current proportional to input frequency) in a little Gilbertoid
"translinear" circuit, and uses that to correct the ramp rate for 
the changes in input frequency so that the triangle amplitude stays
constant over different squarewave frequencies. My instrumentation 
application needed only square and triangle waves, but in principle
sinusoids are again available by post-distorting the triangles.

An early version of that circuit appeared in _Electronic Design_
("Square-to-triangle-wave converter provides constant amplitude, 
rapid response," vol. 25 no. 24 pp. 160-162, 22 November 1977),
including further references to triangle-sine converter circuits.

I don't think that I can render that or the CMOS circuit on-line
as Bill did, but they should be available in technical and college
libraries if any circuit hackers are interested. Should you be unable
to find them, I do have some copies that I'm happy to part with ("as
a service to the net") at least until they are used up. Send a
self-addressed stamped envelope to Max Hauser, P. O. Box 7051, 
Berkeley, CA 94707, USA (no e-mail requests, please). Specify which
circuit you want, if not both.

Light bulbs, indeed.


Max Hauser, circuit hacker 
max@eros.berkeley.edu / ...{!decvax}!ucbvax!eros!max

"This ... demonstrates the soapbox phenomenon. Given any slim excuse,
99.624 percent of all persons will sound off. Given no excuse at all,
99.608 percent of them will do so."         -- Mary-Claire van Leunen

noise@eneevax.UUCP (Johnson Noise) (01/30/88)

In article <418@pasteur.Berkeley.Edu> max@eros.UUCP (Max Hauser) writes:
>
>The twin-tee, horror of horrors, when you sit down and analyze it,
>theoretically requires "infinite" amplifier gain to oscillate, since
>the basic network realizes an infinitely deep transmission notch as
>the phase shift passes 180 degrees. No finite gain value will permit
>it to oscillate.  The twin-tee oscillator works in practice because
>the network exhibits a less-than-infinite notch due to component
>mismatches, or it oscillates detuned from the nominal center frequency
>where it matches the magnitude and phase shift of its companion gain
>stage. Besides the annoyance of a circuit that works more poorly as
>the components become ideal, it too needs a large (and highly
>component-sensitive) gain, as well as six critical RC elements.
>

	You seem to suggest that the T network exhibits infinite Q
requiring infinite gain in order to sustain stable oscillations.  This
is of course theoretically true, but not realistic. All passive tuned
circuits exhibit finite Q due to resistances in inductors or leakages
in capacitors etc.  This does affect the resonant frequency slightly,
but not to any significant degree in medium to high Q circuits (> 10).

Also, an infinite Q tuned circuit will sustain stable oscillations, but
cannot deliver any power to an external load. (This would obviously
make the Q finite and cause the oscillations to die off.)

With this in mind one could design a stable oscillator by simply increasing
the Q to infinity with the use of an active component.  This can be acc-
omplished with either positive feedback or negative resistance (one could
argue that they are effectively the same).  If one was to apply sufficient
negative resistance to cancel all positive resistance (and then some) stable
oscillation would result.  This circuit could also deliver power.

How do you simulate negative resistance? Easy.  Positive feedback is one way.
There are other ways which exploit the 6 dB/octave roll off of an amplifier
(op-amp etc.) which can be considered complex (1/jw; w=gain bandwidth prod).
One can also take advantage of the high frequency beta of bipolar transistors,
which is also complex (this circuit is analyzed in "Microelectronics" by
Milman & Taub).  If you think about it, there are several simple (single
transistor) negative resistance generators in a variety of configurations.
The theory is simple and straightforward.

>
>Several years ago I had occasion to look into this subject in depth,
>needing cheap sinusoidal audio test-signal generators, and this
>led to an oscillator circuit that exploited the internal schematic of
>CMOS NAND gates in a way that their designers surely did not intend.
>

	CMOS inverters also roll off at 6 dB/octave and can be used to
generate negative resistance, simulate inductance etc.  I have measured 
the gain bandwidth product of 74C04's to be about 30 MHz, this compares
well with a National Semiconductor application note on the use CMOS gates
as linear amps. I didn't dare try it with TTL!

>
>There is always the tack, taken by Intersil in the horrible 8038 
>and more successfully later by Exar in the 2200 series oscillator
>chips, of a (integrator-and-hysteresis) triangle-wave oscillator 
>followed by a nonlinear network to shape the triangles into sinusoids.
>These methods yield easy frequency tuning, but are much more
>complicated in design than simple fixed sinusoidal RC oscillators.
>

	They also suffer at high frequencies (read limited to < 1 MHz)
because of the triangle to sine shaping that they all employ.  One could
use good low capacitance diodes and do a much better job (like Wavetek).

>
>Another approach that I used, to convert audio-frequency square waves
>directly into triangle waves, with constant amplitude over a wide 
>frequency range, uses a capacitor and current switch to generate
>triangle waves whose slope is set by an external current. In turn 
>this current comes from another subcircuit that measures the period 
>of the incoming square wave, obtains its reciprocal directly (thus an 
>analog current proportional to input frequency) in a little Gilbertoid
>"translinear" circuit, and uses that to correct the ramp rate for 
>the changes in input frequency so that the triangle amplitude stays
>constant over different squarewave frequencies. My instrumentation 
>application needed only square and triangle waves, but in principle
>sinusoids are again available by post-distorting the triangles.

	I like it.

>
>"This ... demonstrates the soapbox phenomenon. Given any slim excuse,
>99.624 percent of all persons will sound off. Given no excuse at all,
>99.608 percent of them will do so."         -- Mary-Claire van Leunen

	This too.

john@anasaz.UUCP (John Moore) (02/04/88)

In article <1198@eneevax.UUCP> noise@eneevax.umd.edu.UUCP (Johnson Noise) writes:
>In article <418@pasteur.Berkeley.Edu> max@eros.UUCP (Max Hauser) writes:
>>
>>The twin-tee, horror of horrors, when you sit down and analyze it,
>>theoretically requires "infinite" amplifier gain to oscillate, since
>	You seem to suggest that the T network exhibits infinite Q
>requiring infinite gain in order to sustain stable oscillations.  This
>is of course theoretically true, but not realistic. All passive tuned
>circuits exhibit finite Q due to resistances in inductors or leakages
Not true in this case!
	The twin-T is not a resonant circuit. "Q" in this case is not
the point - stop-band attenuation is. The twin-T
is a bridging device, and the stop-band attenuation is only limitted
by how well matched the component values are. In effect, the
twin-T consists of two equal-gain phase shift networks with opposite
phase shift, which results in cancellation of the signal
at the frequency where the phase shifts are just right. At that point,
the only signal passing (assuming values are tweaked right), is
that passed by leakage outside of the twin-T. I have used twin-Tee's to
achieve attenuation well in excess of 80dB at 60Hz.
-- 
John Moore (NJ7E)   hao!noao!mcdsun!nud!anasaz!john
(602) 870-3330 (day or evening)
The opinions expressed here are obviously not mine, so they must be
someone else's.