100nF

RC oscillator calculator: Wien bridge and phase-shift oscillators

The oscillation frequency of an op-amp Wien-bridge, phase-shift or four-section bubba oscillator from its resistors and capacitors, the gain its RC network asks for and the loop gain your RF and RG give, the op-amp bandwidth and slew rate that frequency needs, and the parts for a target frequency rounded to an E-series. The equations are TI's SLOA060; the defaults are its Wien bridge, 1.59 kHz from 10 kΩ and 10 nF, and the page's tests hold the calculation to the values SLOA060, AN-31 and AN-20 print.

−+R_F 20.0 kΩR_G10.0 kΩV_OUTR110.0 kΩC110.0 nFR210.0 kΩC210.0 nFdBfeedback network gain |β|0−20−40−60phase ∠β90°0°−90°16 Hz160 Hz1.6 kHz16 kHz160 kHz|β| = 1/3, −9.54 dB0° at f0 = 1.59 kHz
Fig 1 — Wien bridge: R1 = R2 = 10.0 kΩ, C1 = C2 = 10.0 nF, R_F 20.0 kΩ, R_G 10.0 kΩ. Below, the feedback network alone, SLOA060 Eq 12: its phase reaches 0° at f0 = 1.59 kHz, where |β| = 1/3, −9.54 dB, so the amplifier needs a gain of 3.00. It has 3.00, a loop gain of 1.000, exactly 1.
Oscillation frequency f0
1.592 kHz
Feedback network at f0: |β| · phase
1/3 (−9.54 dB) · 0°
Gain needed, A = 1/|β| · RF/RG for it
3 · 2
Gain of the stage, 1 + RF/RG
3
Loop gain A·|β|
1.000 (+0.00 %)
GBW needed for a Wien bridge, 43 × f0 (SLOA060 p. 7)
68.4 kHz
GBW needed for f0 a decade below GBW/A (SLOA060 Fig 3, derived)
47.7 kHz
Slew rate needed, 2π·Vp·f0 at 2.5 V peak
25.0 mV/µs

The loop gain is within 2 % of 1. SLOA060 built its Wien bridge on that edge: with RF = 2RG it oscillated, clipping at both rails with 2.8 % distortion, and "oscillations ceased when RF was decreased by a mere 0.8%" (p. 11). A lamp, a JFET AGC or diodes in the feedback hold the gain at 3 with far less distortion (pp. 12–14).

How this is calculated

Standard: TI SLOA060, Sine-Wave Oscillator (Mancini, Palmer, 2001), §3–8 (Eq 6, 10–17; pp. 4–18); TI SNLA140D, AN-31 Amplifier Circuit Collection (Figures 2-1, 2-2, 2-7; pp. 15, 18); TI SNOA621C, AN-20 (Figure 26, p. 19); TI SBOA092, Handbook of Operational Amplifier Applications (p. 83)

Aβ=1∠−180∘ (negative feedback),Aβ=1∠0∘ (positive feedback)A\beta = 1\angle{-180^\circ}\ \text{(negative feedback)}, \qquad A\beta = 1\angle{0^\circ}\ \text{(positive feedback)}
The Barkhausen criterion, SLOA060 p. 4: the system "goes unstable when the denominator in equation 5 becomes zero, i.e., when 1 + Aβ = 0". A is the amplifier gain, β the fraction of the output the network feeds back.
V+VTEST=11+R1R2+C2C1+j(ω0ω1−ω2ω0),ω1=1R1C2, ω2=1R2C1\frac{V_+}{V_{TEST}} = \frac{1}{1 + \frac{R_1}{R_2} + \frac{C_2}{C_1} + j\left(\frac{\omega_0}{\omega_1} - \frac{\omega_2}{\omega_0}\right)}, \qquad \omega_1 = \frac{1}{R_1 C_2},\ \omega_2 = \frac{1}{R_2 C_1}
SLOA060 Eq 12 (p. 11): the Wien network, R1 and C1 in series from the output, R2 and C2 in parallel to ground. The calculator evaluates it at every frequency for the figure.
f0=12πR1R2C1C2,A=1+R1R2+C2C1=1+RFRGf_0 = \frac{1}{2\pi\sqrt{R_1 R_2 C_1 C_2}}, \qquad A = 1 + \frac{R_1}{R_2} + \frac{C_2}{C_1} = 1 + \frac{R_F}{R_G}
Eq 12 with its imaginary term zero (ω0² = ω1ω2) and its real part inverted: derived here for unequal arms. With equal parts it is SLOA060's f0 = 1/(2πRC) (p. 11) and Eq 13's β = 1/3, "requiring A = 3. RF must be set to twice the value of RG". SBOA092 p. 83 gives the same fO = 1/(2πRC).
Aβ=A(1RCs+1)3,ω0=tan⁡60∘RC=1.732RC,∣β∣=(12)3,A=RFRG=8A\beta = A\left(\frac{1}{RCs + 1}\right)^3, \qquad \omega_0 = \frac{\tan 60^\circ}{RC} = \frac{1.732}{RC}, \qquad |\beta| = \left(\tfrac{1}{2}\right)^3, \quad A = \frac{R_F}{R_G} = 8
SLOA060 Eq 14 (p. 15), three RC sections taken as independent, "−60°" each; AN-31 writes the same f = tan(60°)/(2πRC). With 10 kΩ and 10 nF it is 2.76 kHz, SLOA060's "2.76 kHz". Exact only when buffers stop the sections loading each other (p. 16); tan 60° = 1.732.
Aβ=A(1RCs+1)4,ω0=1RC,∣β∣=12 4=14,ϕ=tan⁡−1(1)=45∘A\beta = A\left(\frac{1}{RCs + 1}\right)^4, \qquad \omega_0 = \frac{1}{RC}, \qquad |\beta| = \frac{1}{\sqrt{2}^{\,4}} = \frac{1}{4}, \quad \phi = \tan^{-1}(1) = 45^\circ
SLOA060 Eq 15–17 (p. 17), the four-section bubba oscillator: "The gain, A, must equal 4" (p. 18). Eq 16 prints the section as 1/(j + 4); the value it evaluates, 1/√2⁴, is that of 1/(1 + j).
GBW>43 ωOSC (Wien),f0≤0.1 GBWA,SR>2πVPf0GBW > 43\,\omega_{OSC}\ \text{(Wien)}, \qquad f_0 \le 0.1\,\frac{GBW}{A}, \qquad SR > 2\pi V_P f_0
SLOA060 p. 7: the op amp needs "a gain bandwidth at least one decade above the oscillation frequency", read from Figure 3 as f0 at most a tenth of the closed-loop corner GBW/A, and "The Wien bridge requires a gain bandwidth greater than 43 ωOSC" (both sides angular, so GBW in Hz above 43 f0). p. 8: "The slew rate must be greater than 2πVPf0".

Assumptions

What sets the frequency of an RC oscillator

An oscillator is an amplifier that has been made unstable on purpose, at one frequency. TI's application report SLOA060, Sine-Wave Oscillator, by Ron Mancini and Richard Palmer, starts from the feedback equation VOUT/VIN = A/(1 + Aβ), where A is the amplifier's gain and β the fraction of the output fed back. The system "goes unstable when the denominator in equation 5 becomes zero, i.e., when 1 + Aβ = 0, or Aβ = –1. The key to designing an oscillator is ensuring that Aβ = –1. This is called the Barkhausen criterion" (p. 4). Two conditions are packed into it: the loop gain has magnitude 1, and the loop's phase shift is exactly right, "Aβ = 1∠ –180° for a negative feedback system" and "Aβ = 1∠ 0°" for a positive one.

The phase condition sets the frequency, because only one frequency has the right phase. "Phase shift determines the oscillation frequency because the circuit oscillates at whatever frequency accumulates a 180° phase shift" (p. 5). The magnitude condition sets the gain: whatever the RC network loses at that frequency, the amplifier has to put back. That is the whole of the calculator. For each topology it finds the frequency where the network's phase is right, reads the network's loss there, and compares the gain your RF and RG give with the gain that loss asks for. The figure plots the network alone, gain and phase, so you can see both conditions being met at one point.

The frequency-selective part is made of resistors and capacitors rather than an inductor for a practical reason SLOA060 states directly: "LC and LR oscillators are not considered here because low frequency inductors are expensive, heavy, bulky, and highly nonideal" (p. 5). An RC section contributes at most 90°, so "at least two poles must be used". SLOA060 also says why op-amp RC oscillators stay at low frequencies: "Op-amp oscillators are restricted to the lower end of the frequency spectrum because op amps do not have the required bandwidth to achieve low phase shift at high frequencies" (p. 3). For higher frequencies see the LC resonance calculator and the crystal load capacitor calculator.

Wien bridge oscillator: f0 = 1/(2πRC) and a gain of 3

The Wien bridge feeds the output back to the non-inverting input through two RC arms: R1 in series with C1 from the output, and R2 in parallel with C2 from the input to ground. SLOA060 breaks the loop, applies a test voltage and derives the network's transfer function, its Eq 12 (p. 11): 1/(1 + R1/R2 + C2/C1 + j(ω/ω1 − ω2/ω)), with ω1 = 1/R1C2 and ω2 = 1/R2C1. With equal parts the imaginary term vanishes at ω = 1/RC, the real part is 3, and "This results in an overall feedback factor of β = 1/3". So: "The gain, A, of the negative feedback portion of the circuit must then be set such that |Aβ| = 1, requiring A = 3. RF must be set to twice the value of RG to satisfy this condition." TI's handbook SBOA092 gives the same fO = 1/(2πRC) for its lamp-stabilised Wien bridge, over "100 to 6000 Hz" (p. 83).

Unequal arms are allowed. SLOA060 goes on to say that each capacitor "must each contribute 90° of phase shift toward the 180° required for oscillation at ω0. This requires that C1 = C2 and R1 = R2", but Eq 12 itself only needs its imaginary term to be zero, which happens at ω0 = √(ω1ω2), f0 = 1/(2π√(R1R2C1C2)), whatever the ratios. The feedback factor there is 1/(1 + R1/R2 + C2/C1), so the gain needed rises as the arms move apart. The calculator takes all four parts and uses that general form; it is derived here from Eq 12, not printed in the report. The equal-part case is where the gain is lowest, which is the practical reason SLOA060 insists on it. Enter R2 and C2 equal to R1 and C1 for the textbook result.

Phase-shift oscillator: three RC sections, tan 60° and a gain of 8

The phase-shift oscillator puts an inverting amplifier, which supplies 180° of its own, in front of a ladder of RC sections that supplies the other 180°. SLOA060 writes the loop for three sections as its Eq 14, Aβ = A(1/(RCs + 1))³, and states the assumption it rests on: "The usual assumption is that the phase shift sections are independent of each other, allowing equation 14 to be written. The loop phase shift is –180° when the phase shift of each section is –60°. This occurs when ω = 2πf = 1.732/RC (tan 60° = 1.732…). The magnitude of β at this point is (1/2)³, so the gain, A, must be 8 for the system gain of unity" (p. 15). AN-31 prints the same frequency as tan(60°)/(2πRC) beside both of its versions (p. 15).

Whether that assumption holds is the difference between the calculator's two phase-shift topologies. On one op amp, each section drives the next directly and they load each other; SLOA060 built it and reported the gap (p. 15): "The oscillation frequency with the component values shown in Figure 14 is 3.76 kHz rather than the calculated oscillation frequency of 2.76 kHz. Also, the gain required to start oscillation is 27 rather than the calculated gain of 8. These discrepancies are partially due to component variations, however, the biggest factor is the incorrect assumption that the RC sections do not load each other." With op-amp buffers between sections, "the buffered phase-shift oscillator performs more nearly at the calculated frequency and gain" (p. 16). Neither SLOA060 nor AN-31 gives a formula for the loaded ladder, so this calculator does not offer one: on the one-op-amp setting it shows Eq 14's figure and says that the bench will differ, by SLOA060's measurement +36 % in frequency.

AN-31 handles the difference in its gain rather than its frequency. Its single-amplifier circuit asks for R2/R1 "≫ 8" and uses 150; its buffered one asks for "8 ≤ R2/R1 ≤ 10" and uses 9.09 (p. 15).

The bubba oscillator: four sections of 45°

With four buffered sections each supplies 45°, the loop phase condition is met at ω = 1/RC, and the loss is smaller. SLOA060 Eq 15–17 (p. 17): Aβ = A(1/(RCs + 1))⁴, |β| = 1/√2⁴ = 1/4 and φ = tan⁻¹(1) = 45°, so "The gain, A, must equal 4 for oscillation to occur" (p. 18). The report calls it "the most stable RC oscillator configuration", because four sections give the steepest phase slope dφ/dω at the oscillation frequency (p. 6), and a quad op amp gives quadrature outputs from alternate sections for free. Eq 16 is printed with the section as 1/(j + 4); the value it evaluates, 1/√2⁴, is that of 1/(1 + j), which is what the calculator uses.

RC oscillator frequency table

f0 for round values of R and C: the Wien bridge (and the bubba oscillator, which shares 1/(2πRC)) and the three-section phase-shift oscillator, which is tan 60° = 1.732 times higher for the same parts. The one-op-amp ladder is the Eq 14 figure, which SLOA060 found low.

RCWien, bubba: 1/(2πRC)Phase shift: tan 60°/(2πRC)
1.0 kΩ1.0 nF159 kHz276 kHz
1.0 kΩ10 nF15.9 kHz27.6 kHz
1.0 kΩ100 nF1.59 kHz2.76 kHz
1.0 kΩ1.0 µF159 Hz276 Hz
10 kΩ1.0 nF15.9 kHz27.6 kHz
10 kΩ10 nF1.59 kHz2.76 kHz
10 kΩ100 nF159 Hz276 Hz
10 kΩ1.0 µF15.9 Hz27.6 Hz
100 kΩ1.0 nF1.59 kHz2.76 kHz
100 kΩ10 nF159 Hz276 Hz
100 kΩ100 nF15.9 Hz27.6 Hz
100 kΩ1.0 µF1.59 Hz2.76 Hz

Frequency scales as 1/RC, so a decade in either part is a decade in f0. Very large resistors and very small capacitors are where the model gives out first: see below.

Worked example: SLOA060's Wien bridge oscillator

SLOA060's Figure 8 is the calculator's default: R = 10 kΩ, C = 10 nF, RF = 20 kΩ, RG = 10 kΩ, a TLV2471 on +5 V, "with component values selected to provide an oscillation frequency of ω0 = 2πf0, where f0 = 1/(2πRC) = 1.59 kHz" (p. 11).

f0        1/(2π × 10 kΩ × 10 nF)                 = 1.592 kHz
network   β at f0, Eq 13                         = 1/3 (−9.54 dB)
gain      1 + RF/RG = 1 + 20 kΩ/10 kΩ            = 3.000
loop      Aβ = 3 × 1/3                           = 1.000
RF +1 %   1 + 20.2/10, × 1/3                     = 1.0067
RF −0.8 % 1 + 19.84/10, × 1/3                    = 0.9947
GBW       43 × f0 (p. 7)                         = 68.4 kHz
slew      2π × 2.5 V × f0 (p. 8)                 = 25.0 mV/µs

The report measured "1.57 kHz, caused by varying component values", −1.4 % from the calculation. The loop gain of exactly 1 is the interesting part. With RF = 2RG the circuit did oscillate, but with its output clipped at both rails and 2.8 % distortion. Then "The feedback resistor was then adjusted ±1%. … The distortion grew as the saturation increased with increasing RF, and oscillations ceased when RF was decreased by a mere 0.8%." The calculator reproduces the boundary: RF at +1 % gives a loop gain of 1.0067, at −0.8 % 0.9947, below 1. A bare Wien bridge has no gain margin to spare, which is why SLOA060's next three circuits are all ways of holding the gain at 3: a lamp for RG (less than 0.1 % distortion, p. 12), and a JFET automatic gain control, "less than 0.2%" (p. 13). In the AGC circuit, Figure 12, the report gives the JFET-off minimum as "2.87 (1+RF/RG1)"; with its RF of 18.2 kΩ and RG1 of 10 kΩ that expression is 2.82.

The bandwidth rows are comfortable here: 68.4 kHz is the 43 × f0 SLOA060 asks of a Wien bridge's op amp, and the TLV247x has 2.8 MHz. The slew rate needed for a 2.5 V peak is 25.0 mV/µs, which is nothing; the slew rate calculator does the same sum for any amplitude.

AN-31's Wien bridge with AGC (Figure 2-7, p. 18) uses 2 kΩ and 10 nF, f = 1/(2πC1R5) = 7.96 kHz, and a "Set Gain = 3.1". The gain its resistors give is (R3 + R4)/R3 = 3.13 with R3 = 4.7 kΩ to the JFET and R4 = 10 kΩ from the output; the note prints the expression as "(R3 + R4)/R4", which would be 1.47. The 3.1 is the R3 form.

Worked example: SLOA060's phase-shift and bubba oscillators

SLOA060 builds all three ladder circuits with the same 10 kΩ and 10 nF and the same 1.5 MΩ RF, changing only RG. Select each topology in the calculator and the defaults are that figure's parts.

f0        tan 60° / (2π × 10 kΩ × 10 nF)         = 2.757 kHz
network   |β| = (1/2)³                           = 1/8 (−18.06 dB)
one amp   RF/RG = 1.5 MΩ / 55.2 kΩ               = 27.17
buffered  RF/RG = 1.5 MΩ / 180 kΩ                = 8.33
bubba     f0 = 1/(2π × 10 kΩ × 10 nF)            = 1.592 kHz
          RF/RG = 1.5 MΩ / 360 kΩ                = 4.17

Worked example: AN-20's Wien bridge with unequal arms

AN-20, An Applications Guide for Op Amps, draws an amplitude-stabilised Wien bridge (Figure 26, p. 19) whose arms are nothing like equal: 300 kΩ and 0.068 µF in series, 10 kΩ and 2.2 µF in parallel, with the output labelled "16.5 VPP, 10 Hz". The note gives no equation. Entered as R1 = 300 kΩ, C1 = 68 nF, R2 = 10 kΩ, C2 = 2200 nF, Eq 12's general form gives 7.51 Hz, the frequency of an equal-arm bridge of54.8 kΩ and 387 nF, and a feedback factor of 1/63.4: the amplifier needs a gain of 63.4 rather than 3. AN-20's FET, biased by a peak detector on the output, sets that gain. The calculated frequency+33 % short of the labelled 10 Hz, a gap AN-20 does not discuss. The example is worth having for the gain alone: lopsided arms cost a factor of 21 in the gain the amplifier has to supply.

Designing an RC oscillator for a frequency

Switch the calculator to "Parts for a frequency" and it solves f0= k/(2πRC) for R or C, with k = 1 for the Wien bridge and bubba and tan 60° for three sections, rounds the result to an E-series, and gives the frequency the rounded part produces. It then sets RF from your RG for the required gain and rounds it up, never down, so the loop gain cannot fall below 1. For a 1 kHz tone on SLOA060's 10 nF:

Rounding RF up is a choice, not a rule from the sources. A Wien bridge with RF exactly 2RG sits on the edge SLOA060 measured, and a few per cent over is the price of starting reliably without amplitude control. For a closer pair the E-series calculator finds series and parallel combinations.

Where the RC oscillator model stops being valid

The op amp is not ideal. SLOA060's circuit equations "are valid when the op-amp open-loop gain is large and the oscillation frequency is less than 0.1 ω3dB" (p. 9). Its section 6 explains why: the op amp's own phase shift "affects the performance of the oscillator circuit by lowering the oscillation frequency, and the reduction in ACLcan make Aβ < 1 and the oscillator then ceases to oscillate" (p. 7). Hence "the op amp should be chosen with a gain bandwidth at least one decade above the oscillation frequency", and for the Wien bridge, "a gain bandwidth greater than 43 ωOSC to maintain the gain and frequency within 10% of the ideal values". The report's Figure 4 shows the effect on distortion with three op amps of 0.4, 2.8 and 10 MHz in the same Wien bridge (p. 8). The calculator reads Figure 3 as f0 at most a tenth of the closed-loop corner GBW/A, which matters most for the one-op-amp phase shifter: at a gain of 27.2 and 2.76 kHzthat is 749 kHz of GBW.

Slew rate. "The slew rate must be greater than 2πVPf0, where VP is the peak output voltage and f0 is the oscillation frequency; otherwise, distortion of the output signal results" (p. 8).

Large resistors. "Care must be taken when using large feedback resistors because they interact with the input capacitance of the op amp to create poles with negative feedback, and both poles and zeros with positive feedback. Large resistor values can move these poles and zeros into the neighborhood of the oscillation frequency and affect the phase shift" (p. 8). The buffered phase shifter's 1.5 MΩ RF is SLOA060's own example of it.

Loading. Eq 14 and Eq 15 assume the sections do not load each other and that RG does not load the last one. The one-op-amp ladder breaks the first; any ladder whose RG is not much larger than R bends the second, and the calculator flags an RG under ten times R.

Amplitude. The linear model says nothing about the output level. With loop gain above 1 the amplitude grows until something limits it, and in a bare circuit that is the op amp's output hitting the rails. SLOA060 p. 6: "When the gain is too low, oscillations cease under worst case conditions, and when the gain is too high, the output wave form looks more like a square wave than a sine wave." Low distortion needs a gain that is held, not merely set: a lamp, a JFET AGC, or diodes, as in SLOA060 §8.1, AN-20 Figure 26 and AN-31 Figure 2-7.

Common RC oscillator mistakes

Further reading