RC oscillator

Linear electronic oscillator circuits, which generate a sinusoidal output signal, are composed of an amplifier and a frequency selective element, a filter. A linear oscillator circuit which uses an RC network, a combination of resistors and capacitors, for its frequency selective part is called an RC oscillator.

Description
RC oscillators are a type of feedback oscillator; they consist of an amplifying device, a transistor, vacuum tube, or op-amp, with some of its output energy fed back into its input through a network of resistors and capacitors, an RC network, to achieve positive feedback, causing it to generate an oscillating sinusoidal voltage. They are used to produce lower frequencies, mostly audio frequencies, in such applications as audio signal generators and electronic musical instruments. At radio frequencies, another type of feedback oscillator, the LC oscillator is used, but at frequencies below 100 kHz the size of the inductors and capacitors needed for the LC oscillator become cumbersome, and RC oscillators are used instead. Their lack of bulky inductors also makes them easier to integrate into microelectronic devices. Since the oscillator's frequency is determined by the value of resistors and capacitors, which vary with temperature, RC oscillators do not have as good frequency stability as crystal oscillators.

The frequency of oscillation is determined by the Barkhausen criterion, which says that the circuit will only oscillate at frequencies for which the phase shift around the feedback loop is equal to 360° (2π radians) or a multiple of 360°, and the loop gain (the amplification around the feedback loop) is equal to one. The purpose of the feedback RC network is to provide the correct phase shift at the desired oscillating frequency so the loop has 360° phase shift, so the sine wave, after passing through the loop will be in phase with the sine wave at the beginning and reinforce it,  resulting in positive feedback. The amplifier provides gain to compensate for the energy lost as the signal passes through the feedback network, to create sustained oscillations. As long as the gain of the amplifier is high enough that the total gain around the loop is unity or higher, the circuit will generally oscillate.

In RC oscillator circuits which use a single inverting amplifying device, such as a transistor, tube, or an op amp with the feedback applied to the inverting input, the amplifier provides 180° of the phase shift, so the RC network must provide the other 180°. Since each capacitor can provide a maximum of 90° of phase shift, RC oscillators require at least two frequency-determining capacitors in the circuit (two poles), and most have three or more, with a comparable number of resistors.

This makes tuning the circuit to different frequencies more difficult than in other types such as the LC oscillator, in which the frequency is determined by a single LC circuit so only one element must be varied. Although the frequency can be varied over a small range by adjusting a single circuit element, to tune an RC oscillator over a wide range two or more resistors or capacitors must be varied in unison, requiring them to be ganged together mechanically on the same shaft. The oscillation frequency is proportional to the inverse of the capacitance or resistance, whereas in an LC oscillator the frequency is proportional to inverse square root of the capacitance or inductance. So a much wider frequency range can be covered by a given variable capacitor in an RC oscillator. For example, a variable capacitor that could be varied over a 9:1 capacitance range will give an RC oscillator a 9:1 frequency range, but in an LC oscillator it will give only a 3:1 range.

Some examples of common RC oscillator circuits are listed below:



Phase-shift oscillator
In the phase-shift oscillator the feedback network is three identical cascaded RC sections. In the simplest design the capacitors and resistors in each section have the same value $$\scriptstyle R\;=\;R1\;=\;R2\;=\;R3$$ and $$\scriptstyle C\;=\;C1\;=\;C2\;=\;C3$$. Then at the oscillation frequency each RC section contributes 60° phase shift for a total of 180°. The oscillation frequency is
 * $$f = \frac{1}{2\pi RC\sqrt{6}}$$

The feedback network has an attenuation of 1/29, so the op-amp must have a gain of 29 to give a loop gain of one for the circuit to oscillate
 * $$R_\mathrm{fb} = 29\cdot R$$



Twin-T oscillator
Another common design is the "Twin-T" oscillator as it uses two "T" RC circuits operated in parallel. One circuit is an R-C-R "T" which acts as a low-pass filter. The second circuit is a C-R-C "T" which operates as a high-pass filter. Together, these circuits form a bridge which is tuned at the desired frequency of oscillation. The signal in the C-R-C branch of the Twin-T filter is advanced, in the R-C-R - delayed, so they may cancel one another for frequency $$f=\frac{1}{2\pi RC}$$ if $$x=2$$; if it is connected as a negative feedback to an amplifier, and x>2, the amplifier becomes an oscillator. (Note: $$x = C2/C1 = R1/R2$$.)

Quadrature oscillator
The quadrature oscillator uses two cascaded op-amp integrators in a feedback loop, one with the signal applied to the inverting input or two integrators and an invertor. The advantage of this circuit is that the sinusoidal outputs of the two op-amps are 90° out of phase (in quadrature). This is useful in some communication circuits.

It is possible to stabilize a quadrature oscillator by squaring the sine and cosine outputs, adding them together, (Pythagorean trigonometric identity) subtracting a constant, and applying the difference to a multiplier that adjusts the loop gain around an inverter. Such circuits have a near-instant amplitude response to the constant input and extremely low distortion.

Low distortion oscillators
The Barkhausen criterion mentioned above does not determine the amplitude of oscillation. An oscillator circuit with only linear components is unstable with respect to amplitude. As long as the loop gain is exactly one, the amplitude of the sine wave would be constant, but the slightest increase in gain, due to a drift in the value of components will cause the amplitude to increase exponentially without limit. Similarly, the slightest decrease will cause the sine wave to die out exponentially to zero. Therefore, all practical oscillators must have a nonlinear component in the feedback loop, to reduce the gain as the amplitude increases, leading to stable operation at the amplitude where the loop gain is unity.

In most ordinary oscillators, the nonlinearity is simply the saturation (clipping) of the amplifier as the amplitude of the sine wave approaches the power supply rails. The oscillator is designed to have a small-signal loop gain greater than one. The higher gain allows an oscillator to start by exponentially amplifying some ever-present noise.

As the peaks of the sine wave approach the supply rails, the saturation of the amplifier device flattens (clips) the peaks, reducing the gain. For example, the oscillator might have a loop gain of 3 for small signals, but that loop gain instaneously drops to zero when the output reaches one of the power supply rails. The net effect is the oscillator amplitude will stabilize when average gain over a cycle is one. If the average loop gain is greater than one, the output amplitude increases until the nonlinearity reduces the average gain to one; if the average loop gain is less than one, then the output amplitude decreases until the average gain is one. The nonlinearity that reduces the gain may also be more subtle than running into a power supply rail.

The result of this gain averaging is some harmonic distortion in the output signal. If the small-signal gain is just a little bit more than one, then only a small amount of gain compression is needed, so there won't be much harmonic distortion. If the small-signal gain is much more than one, then significant distortion will be present. However the oscillator must have gain significantly above one to start reliably.

So in oscillators that must produce a very low-distortion sine wave, a system that keeps the gain roughly constant during the entire cycle is used. A common design uses an incandescent lamp or a thermistor in the feedback circuit. These oscillators exploit the resistance of a tungsten filament of the lamp increases in proportion to its temperature (a thermistor works in a similar fashion). The lamp both measures the output amplitude and controls the oscillator gain at the same time. The oscillator's signal level heats the filament. If the level is too high, then the filament temperature gradually increases, the resistance increases, and the loop gain falls (thus decreasing the oscillator's output level). If the level is too low, the lamp cools down and increases the gain. The 1939 HP200A oscillator uses this technique. Modern variations may use explicit level detectors and gain-controlled amplifiers.



Wien bridge oscillator
One of the most common gain-stabilized circuits is the Wien bridge oscillator. In this circuit, two RC circuits are used, one with the RC components in series and one with the RC components in parallel. The Wien Bridge is often used in audio signal generators because it can be easily tuned using a two-section variable capacitor or a two section variable potentiometer (which is more easily obtained than a variable capacitor suitable for generation at low frequencies). The archetypical HP200A audio oscillator is a Wien Bridge oscillator.