# Designing 64.5kHz Hartley Oscillator

I am taking an analogue electronics course and have been given an assignment to create a 64.5kHz Hartley oscillator using any 5V rail-to-rail operational amplifier. I am trying to design the circuit in simulation first before I build.

I will be using this circuit:

simulate this circuit – Schematic created using CircuitLab

The design equations we have been given for the Hartley oscillator are:

$\omega_0 = \frac{1}{\sqrt{C_3(L1+L2)}}$

$K(\omega_0) = -\frac{L1}{L2}$

$A = \frac{L2}{L1} = \frac{R2}{R1}$

I began by choosing $L_1 = L_2 = 10\mu H$ and then solving for $C_3$ with $\omega_0 = 129000 \pi$ to obtain $C_3 = 3.04\times10^-7 F$

then $A = \frac{10\mu F}{10\mu F} = \frac{100k\Omega}{100k\Omega}$

I've simulated in LTSpice using the circuit below giving it a quick pulse to get the oscillation going:

The results:

From this I observe that the oscillation frequency is very close (64.3kHz) but the response dies out very quickly and does not sustain. My understanding of oscillators is that I want the negative feedback to be equal to positive feedback to fulfill Barkhausens criteria in which the magnitude of the total feedback should be 1 and the phase shift 0? I am obviously missing something important. Any advice on getting this circuit to have a sustained oscillation would be greatly appreciated.

edit:

Based on the suggestions below I added an extra resistor between the output and resonant circuit and adjusted my gain. Re-simulating gave these results in LTSpice. I've added three screenshots below from the simulation. The first is over 10ms, the second I have zoomed in when the oscillation stabilizes and the third is a frequency domain plot showing an impulse at 64.5kHz:

• Set your gain higher. This means you need different inductor values. Maybe 10 or 100 for the gain. Also why do you use a such short pulses on the positive terminal? Increase the on time so it is like a step function. – user110971 May 12 '18 at 14:05
• Gain is marginal, won't sustain oscillation. Add a 20k or 50k pot between the opamp output and R2 to increase the gain. Your theoretical gain of 1 doesn't account for losses in the LC network. – AlmostDone May 12 '18 at 14:10
• As already pointed out, set the gain of the op-amp via R1/R2 to more than 1. Typically R1/R2 would be a 3:1 ratio. Your tuned cct is ok, but should really be a center tapped inductor and not two separate inductors. – Jack Creasey May 12 '18 at 15:00
• Your choice of L1=L2 seems arbitrary. An improvement might be L2 >> L1 so that the low output impedance of the op-amp is more closely matched to the resonator. You also might attempt to estimate two small-value resistors in series with L1 & L2, to model their finite Q. – glen_geek May 12 '18 at 15:37

As with the colpitts oscillator an extra resistor is needed. This colpitts oscillator correctly has a 200 ohm resistor (R3) in series with the op-amp output. But it can be a few ohms to a kohm mainly: -

If that resistor is not present the very low output impedance of the op-amp will prevent enough phase shift occuring to cause predictable sustained oscillation. With a Hartley you have the same issue: -

If you don't have that resistor it may oscillate but at the wrong frequency and only because of the delay through the op-amp is akin to adding phase shift. Here's the proof that for a BJT common collector colpitts oscillator you need "R" to get the right phase shift and this is exactly the same for a Hartley oscillator: -

One final note - the Hartley oscillator DOES NOT need to have a coupled inductor despite what other have said.

And that "extra" resistor is also needed in Pierce crytal oscillators for precisely the same reason: -

The resistor I'm talking about is R1 above - it adds extra phase shift that takes the overall phase shift past the 180 degrees point therefore there will always be a frequency where precisely 180 degrees is formed and this is the frequency that the oscillator will run at.

This question and my answer show how the phase shift may not be quite enough without the series resistor feeding capacitor C1 and the crystal.

• Thank you for such a detailed response. Adding the extra resistor and tweaking my gain solved the problem. I'm getting a really great output in simulation now. – Blargian May 13 '18 at 9:51
• @Blargian you might still get distortion issues though - nothing in the basic theoretical op-amp hartley (or colpitts) defines the sinewave amplitude so what happens in practice is that the sine output either clips against the rails or looks a tad triangular due to slew rate limitations providing the non-linearity needed to stabilize amplitude. – Andy aka May 13 '18 at 11:21
• I think you should explicitly say that the output impedance is loading C1 without a feedback resistor. Took me a minute or so to get it. – user110971 May 13 '18 at 15:56
• @Andy aka, I've edited my original post to show the results that I'm now getting in simulation. The signal does look triangular and reaches +- 4V so I assume that the output is clipping against the rails. Are there some changes I could make to get the output more sinusoidal? – Blargian May 13 '18 at 16:07
• If it’s triangular then your opamp slew rate limit is the dominant cause. – Andy aka May 13 '18 at 17:54

You need to design the oscillator so that the loop gain is a little above 1 for small signals, so that oscillations will build up, and then somehow becomes unity at your desired amplitude.

There are three main ways of doing this with op-amps, from the crude to the ideal.

The crude. Let the amplifier saturate. While its output is sat on the rail, the gain is zero, so over one cycle, the gain will average out to less. The amplifier will spend the right amount of time saturated to average the gain to one. This will distort the output. Maybe not by much however, especially if the fixed gain is not too much above 1.

A problem with this method is that some amplifiers do funny things when saturated, and may take a long time to come out of saturation, so the results won't neccessarily be pretty.

A better version of this is to use back-to-back diodes across part of R2 to reduce the gain as they conduct. Perhaps a gain of 1.1 when they're off, and a gain of 0.9 when conducting. The amplitude will quickly settle on a level that averages the loop gain to 1. As nothing ever saturates, there's far less waveform distortion. As you design the two gain values closer together, the distortion decreases, but you have to be more accurate in setting them, to make sure you have one each side of unity.

The lowest distortion route is to use a gain control in the loop, perhaps a FET biassed into resistor mode driven by a level detector. A simpler technique is to use a thermally sensitive resistor in the feedback circuit, that changes the gain as its dissipation, so operating level, varies. A simple tungsten filament light bulb was often used for this purpose, though they need a fair bit of power, a bead thermistor is easier to drive. Distortion is very low at high frequency, but increases as the period of the signal becomes a significant fraction of the thermal time constant.

• Long time ago for me, (my first Hartley Osc used a vacuum tube!), but I recall something about using a small incandescent lamp as part of the feedback / gain configuration, so that is inherent negative coefficient of resistance would result in a stable undistorted sine wave output. Do you think that's still a viable approach, or is that too "old hat"? – Randy May 12 '18 at 17:52
• @Randy it's an excellent approach, you can get a 10:1 resistance variation with a filament lamp. The only thing 'old hat' about it is you can't get SMD filament lamps. The trick is to find a really low power (so it doesn't need much) high voltage low resistance (so reasonable impedance) lamp. It's probably better to use a thermistor, higher impedance, lower power, readily available, but they don't seem to come in surface mount either. – Neil_UK May 12 '18 at 17:59
• I wouldn't be surprised if there were! Looks like they've just about gotten a dual triode tube down to a near SMD device! LOL!! synthtopia.com/content/2015/01/29/… – Randy May 12 '18 at 21:24

At 67KHz, the opamp has very low output impedance, and does not allow the tank circuit to ring; instead the opamp sucks energy out of the tank.

Add some large resistor from OpAmp output to the tank.

I only looked at the schematic, but L1 isn't doing anything useful. It's directly on the output of the opamp, which ideally has 0 impedance. Of course it doesn't, so the effect is unpredictable to that extent.

Get rid of L1. It's not doing what you think.

• That would make it not a Hartley oscillator. I suspect the error is not modelling the coupling between the two inductors; the Hartleys I've seen are either driven from a fairly high impedance (anode) or a low impedance drive (as here) feeds the tap on a tapped inductor(autotransformer) – Brian Drummond May 12 '18 at 14:16
• You can't get rid of L1 .....but L1/L2 should be a center tapped inductor to make this a Hartley Osc. – Jack Creasey May 12 '18 at 15:24
• L1 is not only not doing anything useful it could also cause significant DC current to flow from the output of the opamp. As others have said the defining characteristic of a Hartley oscillator is a tapped inductor - this doesn't have that. – Kevin White May 12 '18 at 17:36
• @Brian: Take another look. L1 is directly on the output of the opamp to ground. If the opamp were ideal, its output impedance would be 0, and the inductor would have absolutely no effect on the voltage. L1 only does something in this circuit by accident to the extent that the opamp is not ideal. Such characteristics are poorly specified, and can vary considerably from part to part. L1 can also put excessive curent requirements on the opamp output, as Kevin points out. Maybe there was a resistor intended to be there somewhere, but L1 as it is now just doesn't make sense. – Olin Lathrop May 12 '18 at 21:54
• Guys a Hartley doesn't need to have a tapped inductor just as a colpitts doesn't need capacitors sharing the same dielectric. – Andy aka May 13 '18 at 11:25