←back to thread

It's hard to build an oscillator

(lcamtuf.substack.com)
222 points chmaynard | 3 comments | | HN request time: 0.826s | source
Show context
dvh ◴[] No.46002763[source]
It's super easy to build LC oscillator.

I made a program that generate random topology and uses spice simulation to find if it oscillate. The goal was to find some novel LC oscillators. It worked, it found many different oscillators. I let it ran for a while and soon I found out that the simplest possible LC oscillator has 1 inductor, 2 capacitors, 1 resistor and 1 transistor. I found many different variations of it, I called this class of oscillators "LCCRT oscillator" and it also always had 2 internal nodes so that's not very large search space (40000 combinations) so I generated all possible combinations and I found out there are exactly 12 distinct LCCRT topologies.

Basically any time cap connects to a rail it can be placed to other rail as well, and any time one rail connects via resistor, the resistor can also be moved to other rail. This creates 12 possible combinations. I tested them in real life and they are stable, even used one in metal detector.

Of course it found many different topologies. Some times they were unique, other times they could be simplified into already found oscillator. It can also use multiple transistors not just one. You can find entire project on github, it is a ngspicejs script: https://github.com/dvhx/lc-oscillator-finder

replies(5): >>46002880 #>>46003041 #>>46003127 #>>46005017 #>>46006182 #
seg_lolr ◴[] No.46003127[source]
"Novel". Those are all Collpits LC oscillator variants, circa 1918. All LC oscillator topologies were thoroughly investigated more than a century ago, hundreds of books have been written about them. A little more humility please
replies(1): >>46003910 #
1. ofalkaed ◴[] No.46003910[source]
Passive circuits have been novel for a long time now, or at least very very quaint. It is hard to put much stock in a coil when it is banal to walk around with 100 billion transistors in your pocket.

One of my favorite books is Tremaine's Passive Audio Network Design, seems appropriate right now. Passive circuit design is great fun and a lost art.

replies(1): >>46005387 #
2. goopypoop ◴[] No.46005387[source]
"novel" means new, not rare
replies(1): >>46009308 #
3. ofalkaed ◴[] No.46009308[source]
Novel is considerably more complex than just new and even new is more nuanced; your new car could be as old as the Colpitts oscillator. Novel carries with it the unfamiliar and how that unfamiliarity alters our perception of what was once familiar. When you drive about in your new Model T everything is different, you are sitting considerably higher than you do in your old 240Z that you have driven since 1973 and its vertical windshield gives a far more limited view, its lack of power steering makes you aware of how sharp those curves in the road are and everyone notices you when you drive by. Then you take you old Datsun on a milk run and now it is more familiar than it was, you are aware of how intimately you respond to it and it responds to you but also of how its power steering removes some of the intimacy of driving and people stop talking to you about what you are driving because you have been driving that car since 1973 and everyone knows you as the person who has driven the same car since 1973, they ask you how your day is instead of complimenting your antique car. But the novelty eventually wears off and the old Model T becomes as familiar as your 240z.

Most in electronics never learn to drive without power steering, they view passive circuits as simple little things that need active components between them so they don't interact with each other in maddening ways but those interactions are not maddening once you understand them and learn to exploit them.

I don't think anyone used novel to mean rare.