phase waveforms at once, where we
can see the 60 degree phase shifts.
To get it to work, I had to raise the
voltage gain slightly (my R5 is now
233K). If you build one, add a 50K
preset trimmer in series with R5.
Mine oscillated at 2.928 kHz against
a theoretical 2.768 kHz. The errors
are probably due to random component selection and the construction
method, and the scope traces for the
'middle stages' are a bit distorted.
In summary, the phase shift
oscillator produces nice sine waves
where the frequency is set by the
time constant of the RC sections.
The output amplitude is regulated by
the non-linear gain of the amplifiers
which occurs with all amplifiers when
the signal drives their output near to
either ground or the supply.
Many analog oscillator circuits
use a variable gain element (FETs
are popular) to regulate the gain and
maintain a low distortion sine wave
output. Traces are: Phase 1, Phase2,
and Output; Y = 500 mV/div, X =
50 μs/div.
The LTspice and other files for
this session are zipped together and
available for download from the Nuts
& Volts website www.nutsvolts.com).
Digital Oscillators
Digital circuits require the
"marking of time" with a pulse rather
than low distortion sine waves;
simple oscillators constructed from
analog circuits can produce pulses
compatible with digital gates.
For two interesting analog
oscillator circuits that produce pulses,
■ FIGURE 5. Phase shift
oscillator breadboard.
check out the examples bundled with
the LTspice download. Astable.asc is a
two transistor astable oscillator, and
LM555.asc is a nice transistor level
Macromodel of the popular 555
timer IC. Both are included in the
download for this session, and I
encourage you to have some fun
with them in LTspice!
Using Digital Logic
Gates as Oscillators
One other interesting approach
is to make digital logic components
operate in the analog realm. Just a few
components make an oscillator and these
can include a crystal for high accuracy
and stable frequency control.
It's easy to get a basic CMOS
inverter logic gate to act as an
amplifier by placing a high value
resistor of several megohms from
output to input. This biases the gate
as an inverting amplifier, but usually
causes the gate to oscillate due to
stray capacitance and the inherent
delay through the gate. Adding
additional capacitors and a second
gate as a buffer makes this circuit
both practical and very handy.
This is a good place to jump
back into LTspice, which includes
Macromodels for simple logic gates
in the download bundle.
Bad Macromodels
My first attempts didn't work at
all, and to make a long story short, the
LTC supplied digital-gate Macromodels
are defective for this task. Luckily,
better models are readily available
■ FIGURE 6. Phase shift oscillator
breadboard frequency.
■ FIGURE 4. Phase shift
oscillator simulation.
and these are included in the download for this article. If you haven't
added Macromodels to your LTspice
library yet, refer back to the sidebar,
“Adding New Macromodels to
LTspice”, in last month's installment.
Testing Logic Gates
A good way to see if a logic gate
Macromodel is "only digital" (and
therefore not useful for oscillators)
is to drive it with a ramp waveform
(as shown in Figure 8) and the downloaded file NV_SPICE_32.asc. Digital
circuits usually don't like slow rise
pulses applied to the inputs with
the exception of the Schmitt-Trigger
types which have better defined
upper and lower logic level
thresholds than ordinary gates, and
internal positive feedback to speed
up the output's edges.
In LTspice, we can deliberately
■ FIGURE 7. Phase shift oscillator
breadboard waveform traces are:
Phase 1, Phase2, and Output;
Y = 500 mV/div, X = 50 US/div.
February 2009 61