←back to thread

It's hard to build an oscillator

(lcamtuf.substack.com)
219 points chmaynard | 1 comments | | HN request time: 0.321s | source
1. summa_tech ◴[] No.46007117[source]
I wanted to give a quick explanation of the odd and off-hand "lightbulb" comment in the article. Why would an oscillator need a lightbulb? Especially since the article does not get into the weeds of building oscillators that would actually care about this.

A somewhat difficult part of making (moderate-frequency) analog oscillators is getting a clean sinewave without harmonics. It sounds like the easiest thing in the world: a delay, a low-pass filter, a linear amplifier that compensates for the loss in the delay and filter, and boom, sinewave. You can even put the low-pass filter and the delay in a single phase shifter circuit.

The difficulty is hidden in the "compensates for the loss" language. If you amplify too little, your oscillation will decay. If you amplify too much, you will inevitably saturate the amplifier, introducing lots of harmonics (like a squarewave output in the article). So you need some way to stabilize your gain at exactly the right level.

A lightbulb is an interesting device: it is a very linear resistor at short timescales, but nonlinear at long timescales. As the filament heats up, resistance rises. The thermal constant can be fairly substantial, certainly more than kHz or MHz oscillator frequencies. So you can exploit this sweet and clean nonlinearity to produce an oscillator that self-stabilizes!

Design your circuit so that the amplifier gain is controlled by lightbulb's resistance (which is quite easy: you use the lightbulb as one of the gain-setting resistors). And boom, pretty much a perfect sinewave.