Electronic – Colpitts Osc. in ngspice: type of analysis and “singular matrix”

kicadoscillatorspice

I'm new to simulating circuits in spice (in this case, in the ngspice implementation in KiCad's nightly builds) and trying to build a simple Colpitts oscillator:

Colpitts in KiCad

I'd simply like to "power" the thing using V1 and get a plot over time of the voltage at Vout — seems like this should be pretty simple, but I can't seem to get it to work.

First of all, what type of analysis should I use? I had assumed an AC analysis but maybe I'm wrong. I've been using 1,000,000 points between 750Hz and 1250Hz (the given cap and inductor values should produce a frequency of 1MHz.) Trying to probe Vout, the simulator tells me "Error: vector frequency not found!"

Second, no matter the analysis I run I get a message, "Warning: singular matrix: check nodes net-_c2-pad2_ and net-_c2-pad2_". As far as I can tell C2 is connected correctly and it certainly isn't connected to itself. I suspect this is some quirk of how spice reports errors but searching the web has got me nowhere.

Can someone provide a hint?

Best Answer

If you'd like to take your comments and add them as a solution I'd be happy to accept that as the answer.

Run a transient analysis but make sure you run it for long enough time to allow the oscillator to properly start. As for the error message try putting a 1 Mohm resistor across C2 so that the simulator doesn’t get into a muddle trying to resolve DC conditions.

Related Topic