0% found this document useful (0 votes)
721 views7 pages

Bubba Oscillator

1) The Bubba oscillator is a simple, low-cost circuit that can generate sine waves of arbitrary frequencies using only op amps, resistors, and capacitors. 2) It works by using four op amp RC networks in series, with each op amp providing 45 degrees of phase shift, to generate a total 180 degree phase shift and stable sine wave output. 3) The key advantage of the Bubba oscillator is its ability to generate sine waves for testing purposes without requiring a more expensive function generator, making it suitable for hobbyists and students on a budget.

Uploaded by

UmairRashid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
721 views7 pages

Bubba Oscillator

1) The Bubba oscillator is a simple, low-cost circuit that can generate sine waves of arbitrary frequencies using only op amps, resistors, and capacitors. 2) It works by using four op amp RC networks in series, with each op amp providing 45 degrees of phase shift, to generate a total 180 degree phase shift and stable sine wave output. 3) The key advantage of the Bubba oscillator is its ability to generate sine waves for testing purposes without requiring a more expensive function generator, making it suitable for hobbyists and students on a budget.

Uploaded by

UmairRashid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Low-Cost Alternative to a Function Generator: The Bubba Oscillator

by Phillip Johnston oscillator circuits is its low total harmonic distortion


4 March 2012 (THD). In general, THD is a measure of how much
content a circuit adds at the harmonics of the
Introduction fundamental frequency. This is especially important in
When testing the functionality of a circuit or system, it audio circuits, where lower harmonic distortion allows
is often necessary to utilize an input waveform with for a more accurate reproduction of the signal, though
specific frequency and voltage characteristics in order any application requiring a high fidelity signal should
to characterize the response. In lab environments, a seek to minimize THD.
function generator is used for this type of testing, and is
able to generate various waveforms at a range of input Finally, while crystals and resonators are cheap, easy to
voltages and input frequencies. acquire, and provide more precision, setting up a circuit
to utilize these devices is often much more complicated
However, if you are a hobbyist or student, access to a than simply assembling an oscillator circuit, especially
function generator may not be possible or convenient. when methods to divide a clock to the desired
Additionally, the cost of most function generators can frequency are considered. The Bubba oscillator
be prohibitive to those operating on a budget. provides the greatest time-savings for arbitrary sine
However, simple, low-cost, quick-to-assemble oscillator wave generation needs without using a function
circuits can be used instead of function generators for generator.
most tests, and can be assembled with components
commonly found on hand, such as op amps, resistors, Table 1 shows a list and quantity of parts necessary to
and capacitors. design a Bubba oscillator circuit.

Table 1. Parts required for Bubba Oscillator Construction


One such oscillator is the Bubba oscillator. By using the
Bubba oscillator, a sine and cosine wave can be Part Quantity
generated at a specified frequency by simply using four 1.4M Resistor 1
op amp RC circuits in series. This circuit also has the 350K Resistor 1
benefit of providing low harmonic distortion, reducing 10K Resistors (Voltage divider) 2
the effect of harmonic presence on the signal. Calculated Resistance 4
Selected Capacitance 4
Using these effects, a sine wave signal can be feasibly Op Amp 4
generated at any desired frequency by selecting the
appropriate components.
First, the desired frequency for the oscillator must be
decided upon. Using this frequency, it is common
The "Bubba” Oscillator practice to fix the capacitor value, leaving only one
variable to work with. Typically, values of 1nF, 0.01µF,
The “Bubba” oscillator is a phase-shift oscillator that
or 0.1µF are selected for this purpose. Once the
utilizes four op amp RC networks in series. Each op amp
provides 45° phase shift, for a total of 180° phase shift capacitance has been selected, the resistor value can be
through the entire circuit. The circuit is able to provide calculated using Equation 1 below.
a stable sine wave at the specified frequency, and, if Equation 1. Formulae relating the oscillator frequency with resistor
desired, the corresponding cosine wave. and capacitor values.

While the ability to generate a sine waveform at any


frequency is an appealing feature of the Bubba
oscillator, the primary advantage of using it over other
P. Johnston, 2012 P a g e | 1 of 7
As a caveat, be aware that each op amp has a particular noise generated by these components is used to start
frequency response. It is up to you to ensure that the the oscillation.
frequency you have selected is compatible with the op
amp in use. Frequency response information can Since each of the op amps shifts the output by 45°, it is
possible to capture both a sine wave and a cosine wave
commonly be found in the op amp's datasheet.
from this oscillator circuit. By selecting the outputs at
The Bubba oscillator is able to run on both unipolar the nodes shown above in Figure 1, two stable outputs
(e.g., 5V) and bipolar (e.g., +15V, -15V) supplies. While are found with 90° phase shift between them.
higher voltage and a slightly better THD will typically be Additionally, there will be a small voltage difference
seen with a bipolar power supply, a unipolar design is between the two waveforms (in the range of a few
detailed in this application note, with the thought that hundred millivolts).
hobbyists and those on a budget may not have the
capability of providing bipolar voltages. However, if a Furthermore, any two nodes with two op amps in
bipolar implementation is desired, simply replace 5V between them may be utilized to provide sine and
with the desired positive supply voltage and connect cosine waves. The selected nodes above are chosen for
the negative power supply terminals of the op amp to signal integrity.
the negative supply voltage.

Once the components have been selected and the Example Implementation
power design topology decided upon, the circuit should In order to test the low pass filter of an in-house design,
be assembled as shown in Figure 1. The 'R' values used a Bubba oscillator was assembled to provide an input
in the circuit represent the calculated resistance, and test signal. As our design under test is characterized by
the 'C' values are the selected capacitance. a 10 kHz cutoff frequency, an 11.9 kHz was selected in
order to place it well into the stop band of the circuit.
Figure 1. Schematic of the Bubba Oscillator. R corresponse to the
calculated resistance, and C corresponds to the selected By fixing the capacitor value at 10 nF, the resistor value
capacitance.
is calculated to be 1337 ohms. These components yield
an expected frequency of 11.904 kHz. Using these
calculated values, a circuit was assembled in LTSpice to
verify the design via simulation, shown in Figure 2.

Figure 2. Bubba oscillator circuit used to generate an 11.9kHz sine


wave output.

The resistors for the first inverting op-amp are selected


to have a gain of four. Getting as close to this value as
possible is desirable; gain slightly above four will cause
the circuit to oscillate at a different frequency than
desired, and gain less than four will not be high enough
to sustain oscillation. While 1.4MΩ and 350KΩ were
The 5V and VDD/2 nets were attached to the circuit as
chosen, other values may be substituted. However,
shown below in Figure 3.
ensure that the resistor values used are large, as the

P. Johnston, 2012 P a g e | 2 of 7
Figure 3. Circuit showing the attachment of 5V and VDD/2. VDD/2 Figure 5. Oscilloscope capture showing the sine (Ch. 1) and cosine
is attained by using a voltage divider. (Ch 2.) output of the Bubba Oscillator circuit.

Using a voltage divider with equal valued resistors will


provide the VDD/2 input to the circuit. Choose
components in the 1KΩ-10KΩ range to reduce current
flow through the voltage divider.

Using transient analysis, shown in Figure 4 below, the


oscillator was shown to output the waveforms with the
The frequency output of the prototype circuit was
desired 90° phase shift.
measured to be about 10.45kHz. This is much lower
Figure 4. Plot showing the sine and cosine outputs of the Bubba than the desired 11.9kHz, due to the rounding of
oscillator. The two waveforms are 90 degrees out of phase, as is resistances and the use of 20% tolerance capacitors and
expected by picking outputs with two op amps in between.
5% tolerance resistors. A more accurate frequency may
be achieved with higher precision components, through
the use of multiple resistors in series, or through the
addition of potentiometers in series, which can be used
to match the specified values more closely.

After verifying the frequency of our design, the phase


shift between the two waveforms was measured to
ensure they meet the design specification, shown in
Figure 6.
Two things should be noticed about the above plot: Figure 6. Oscilloscope capture showing the phase shift between the
both waveforms have a DC offset of 2.5V, which is sine and cosine outputs. Note that the phase shift is close to 90°.

VDD/2. Also, the peak-to-peak value of the cosine wave


is smaller than the peak-to-peak value of the sine wave.
This is expected, and both the DC offset and peak-to-
peak voltages can be altered by using additional filtering
on the output lines.

After simulating the circuit and verifying that the design


meets our specifications, a prototype was built on a
breadboard to analyze the THD and behavior of the
circuit under real world conditions.

While not exactly 90°, the measured 87.16° phase shift


produces only 3.16% error, which is quite acceptable
P. Johnston, 2012 P a g e | 3 of 7
under real world conditions, and close enough to not be Figure 8. Fast Fourier Transform of the sine output. Note three
distinct peaks on the FFT waveform; these correspond to the
noticeable in many situations. fundamental frequency and the first and second harmonics.

Total Harmonic Distortion


In order to analyze the Total Harmonic Distortion (THD)
of the circuit, a Fast Fourier Transform (FFT) must be
performed on each signal. Figure 7 shows the
frequency spectrum of the simulation waveform after
performing an FFT.

Figure 7. Fast Fourier Transform for the oscillator circuit. Note the
single peak around 11.9kHz. Additionally, note that there are no
peaks beyond the fundamental frequency.

Using voltage measurements made for each of the


harmonics present, the THD of the sine output was
measured to be 3.7% (4.07% when a bipolar supply was
used).

Figure 9 shows the FFT of the cosine waveform, as


measured on the oscilloscope.

Figure 9. Fast Fourier Transform of the cosine output. Note two


distinct peaks on the FFT waveform.

Once the FFT is performed, the THD can be calculated


using Equation 2.

Equation 2. Method of calculating THD using RMS voltages

As the simulation uses ideal op amps, and as there is


only one peak at 11.9kHz, the THD for the simulated
circuit is zero. However, in the real world, there will be Using voltage measurements made for each of the
a small amount of distortion present, as the harmonics present on the cosine FFT, the THD of the
components used are not ideal. cosine output was calculated to be 2.57% (1.9% using a
bipolar supply).
Figure 8 shows the FFT of the sine waveform, as
measured on the oscilloscope. Note that there are two Overall, each output will provide you a sine or cosine
harmonics present in addition to the fundamental waveform with very little distortion 9less than 5% THD).
frequency in this waveform.

P. Johnston, 2012 P a g e | 4 of 7
Additional Uses Figure 10. Example Circuit with INITIAL_COND net attached along
the left side.
The Bubba oscillator can be applied in many ways, other
than as a simple replacement for a function generator.

The Bubba oscillator is most useful in prototyping,


where arbitrary frequencies can be generated at will,
allowing a wide range of applications and designs to be
tested and hammered out before more low-power or
more accurate alternatives are selected to provide the
final clocking scheme.

Examples of such additional uses are carrier wave


generation for AM circuits, as a low-frequency clock for
microcontrollers (such as 32kHz, commonly used in The initial condition net is attached to a current source,
many microcontroller applications), and, due to its low as shown in Figure 11.
harmonic distortion, especially in testing and
Figure 11. Example of the initial current pulse to start the oscillation
implementation of audio applications, such as in a circuit when performing SPICE transient analysis.
guitar effects pedal. Furthermore, it can be used to
generate an AC source using a DC source.

Note that when power is a concern, or when only one


voltage supply is available, it is best to utilize the
unipolar design. However, when a lower THD and
higher output voltage is required, the bipolar design
should be considered. This current source is set up to inject a pulse of 20 mA
for 0.4 milliseconds at the start of the simulation by
using the PWL directive for the current source. This
Tips current injection is more than enough to get the
simulation started; even briefer amounts of time would
Simulating Oscillation Circuits with SPICE
work. Equation 3 shows what the PWL specified by the
When simulating oscillator circuits in SPICE, it is often
simulation. The values alternate between times
necessary to inject an initial condition into the
(0.0001, 0.0005) and the current output at those times
simulation. In the real world, oscillator circuits utilize
(0.02, 0).
the noise inherent to the circuit elements to get the
initial oscillations started. However, SPICE does not Equation 3. PWL definition in SPICE, in order to produce the startup
account for this noise in transient simulations, and current required to simulate the oscillator circuit. The result is to
produce 20 mA of current injection for 0.4ms, starting 0.1ms after
some models may not provide accurate noise the simulation begins.
information. As a result, transient simulations of
oscillator circuits will often output a steady DC voltage. PWL(.0001 .02 .0005 0)
In order to work around this situation, it is common to Additional methods also exist, such as creating an initial
inject an initial condition or to use a pulse to make the condition for a capacitor. Various SPICE tutorials should
circuit oscillate. [[Figure whatever]] shows the circuit detail how to do such a thing, if that route is desired
used in the provided example, along with an initial over a current injection pulse.
condition net (INITIAL_COND) attached to the circuit.

P. Johnston, 2012 P a g e | 5 of 7
The result of this injection can be seen in Figure 12 use the 99th count. Finally, the third line makes the
below, which demonstrates the startup of the oscillator. frequency calculation using the two collected data
points.
Figure 12. Plot showing the use of the initial current injection pulse.
This pulse is used to provide sufficient means to start the oscillation.
Malformed Waveforms
If the waveform appears to have the general
characteristics of a sine wave, but appears to be
distorted or have unequal rise and fall times, check the
wiring of resistors and capacitors. Additionally, make
sure that the input of the non-inverting terminal of op
amp U1 is connected to the correct voltage, VDD/2.

Figure 13. Example malformed waveform. This circuit had the


incorrect voltage attached to the non-inverting input of op amp U1
Note that oscillation does not occur while the current when assembling the bipolar circuit for testing.
injection is taking place, but begins after the injection
ends at 0.5ms. Some amplitude variance occurs before
the circuit settles at its normal operational levels.

Measuring Frequency with SPICE


We can verify the frequency of the waveform by two
means: SPICE measurement directives and the Fast
Fourier Transform (FFT). The FFT method shown in the
Total Harmonic Distortion section above is good for
quick visual analysis, but to get the precise frequency,
SPICE can be used to take period measurements and
calculate a frequency. The .MEAS directive can be used
to record data points and to make calculations; results
are often displayed in the SPICE output log after the
If the frequency that you observe does not match what
simulation is run.
the design should provide, check the tolerance on the
Equation 4 shows how to use the SPICE directive to parts you are using. As typical prototyping labs and
calculate frequency. hobbyist stocks will utilize 5% resistors and 20%
capacitors, there is a large possibility that the design
Equation 4. Example using the SPICE .MEAS directive to calculate frequency will not be met perfectly by utilizing parts
the frequency of the output voltage.
with such high variance. Measuring values with an RCL
.MEAS TRAN t2 V(Vout_Sine) WHEN meter to cherry pick components is a possibility, as well
V(Vout_Sine) = 2.8 rise = 100
as utilizing potentiometers in series with resistors to
.MEAS TRAN t1 V(Vout_Sine) WHEN
V(Vout_Sine) = 2.8 rise = 99 adjust the value until the precise frequency can be
achieved. However, if a high amount of precision is
.MEAS TRAN freq1 PARAM 1/(t2-t1)
needed, a true function generator should be used
The first line of the directive tells SPICE to take the time instead of a Bubba oscillator.
measurement when the sine voltage is above 2.8V. The
rise=100 portion says to use the 100th count of this
Summary
condition; the 100th count is used to allow the
While function generators may be inaccessible or
waveform time to settle into the normal operating
outside of the budget of many hobbyists or students,
conditions. The second line does likewise, and says to
there are still methods available to generate the signals
P. Johnston, 2012 P a g e | 6 of 7
needed for testing or for use in various designs. The
Bubba oscillator grants the ability to create a sine or
cosine wave using components that many students and
hobbyists already have on hand, and, if not, that can be
acquired for a couple of dollars. Using the appropriate
components, it is possibly to generate signals at any
desired frequency.

The Bubba oscillator also has the flexibility of being able


to operate while using both unipolar and bipolar power
supplies.

Aside from use as a "function generator," the Bubba


oscillator can also be used for clocking, generating an
AC source, from a DC source, and for utilization in high-
fidelity audio circuits. This versatile and easily designed
circuit can serve many prototyping needs.

Additional Readings
For more information on the Bubba oscillator, and for
examples of other phase shift oscillators, refer to the
following sources:

1. Doucet, et al., "DC/AC Pure Sine Wave Inverter,"


NECAMSID. Available: Worcester Polytechnic Institute,
http://www.wpi.edu/Pubs/E-project/Available/E-
project-042507-092653/unrestricted/MQP_D_1_2.pdf

2. Mancini, Ron, "Design of op amp sine wave


oscillators," Analog Applications Journal, August 2000,
pp. 33-37. Available: Texas Instruments,
http://www.ti.com/sc/docs/apps/msp/journal/aug2000
/aug_07.pdf

P. Johnston, 2012 P a g e | 7 of 7

You might also like