# Designing a relaxation oscillator using TL074

I've been trying to design a relaxation oscillator using a TL074 op-amp:

simulate this circuit – Schematic created using CircuitLab

For an ideal op-amp this should produce a square wave with frequency

$$f = \frac{1}{2\ln(3)100\cdot 10^{-12}\cdot 200000} \approx 22.7kHz$$

When I run this on LTspice using TI's spice model I get a square wave with a 20.5kHz frequency.

My question is, how do I approach picking the correct capacitor/resistor values when taking into account the real world characteristics of TL074 such that the circuit achieves a 22kHz frequency?

• How accurate are your resistor and capacitor values, by the way? Commented Nov 8, 2016 at 22:41
• I don't know if LTspice has a correct model of the TL074. If it doesn't, look at the maximum voltage swing that the chip can produce. Commented Nov 8, 2016 at 22:44
• I guess the lower frequency is caused by non-symmetry of the output voltage. This problem can be avoided by connecting R2 to ground via some large cap (gut feeling: 10μF) Commented Nov 8, 2016 at 22:44
• @MichaelKarcher This is interesting. What is the reason behind the asymmetry of the output voltage and how does the capacitor help in balancing it? Commented Nov 9, 2016 at 23:55
• The TL074 datasheet shows a symmetric buffer stage, but the precising amplifier stage is asymmetric. This can cause the max positive output voltage to be different in magnitude from the max negative output voltage. The timing formula you gave is only exact if R2 is connected to the avg output voltage. A capacitor would slowly charge to that average voltage. But I vastly overestimated the effect of the potential asymmetry, see my comments on the answer. Commented Nov 10, 2016 at 8:00

• @Neil_UK of course a TL074 at +/-6V is able to get below 0V. That's why I said the example is exaggregated. The effect that one half of the cycle is slowed down and thr other half is sped up, with the slow-down being greater in magnitude than the speed up already happens at lower asymmetries, like +4.5/-4.0 V. The positive cycle from -2 to +2.25 at 4.5 V takes $ln(2.889)RC, the negative cycle takes ln(3.125)RC. The effect is in fact an increase of the period, but I overestimated the effect: These values just cause a$0.1%\\$ slow-down. Commented Nov 9, 2016 at 5:27