What happens in simulation depends on the model. A purely logic model will just oscillate at a frequency determined by propagation delays.
An analogue amplifier model, as you might use with the CD4007, takes ages to start as only noise triggers the simulation and takes a large number of cycles to build up. Then you usually find that the model does not include the input protection diodes and gives the wrong result.
The CMOS inverter as an amplifier trick used to also be common in CD players to amplify the photo diode outputs.
I’m very grateful for the help. Based on what I’ve learned here and the information I’ve gathered, I’ve managed to come up with a partial solution. However, I’m having trouble with the simulation. When I try to run it, nothing really happens, and I’m not sure if it’s due to the surrounding circuitry not being properly connected. Is there a way to isolate the ring oscillator and simulate just that?
Did you attach a model to the symbols?
Search the manual for PWR_FLAG.
Right. And while I would think that the CD4049 ought to work, it looks to me like that is intended to drive TTL or DTL. (Gosh I was an engineering intern in 1971 and started out with 7400 series TTL illogic. I have never seen a DTL gate.)
Anyway…what happens if you use a CD4069 model?
CD4069 is a hex inverter. If you have a hex,
the CD4069 will invert it for you.
It’s a bit confusing. I’ve used Multisim to simulate circuits before, and it’s more straightforward since you don’t have to import SPICE models manually. I believe I’ve resolved the ERC issues, but the simulation still won’t run, and I’m struggling to understand what the problem is.
I’ll repeat my question: did you find a model for the CD4049 (you’ll need to search the web) and did you attach it to the symbol?
And now this has absolutely nothing to do with Kicad, in fact apart for a tenuous link to ‘simulation’ it never has. I think that the category ‘Projects’ needs to be defined more clearly as I for one don’t mind answering post like this if I choose to and are able. The current situation is confused and the resident Pussycat of leisure pointed it out ages ago.
I disagree. The questions are mostly to the point, but not all answers are, eg, infantile references to hex bolts and circuit suggestions. But they didn’t come from the OP.
I found the SPICE model for the CD4049. The issue was actually related to the oscilloscope I was using to analyze the oscillator’s transients. Apparently, it doesn’t work properly in KiCad because the software recognized it as a component rather than an instrument. Now, my main challenge is setting up a SPICE directive, but I’m running into issues with the simulation crashing. I’m also not sure if my SPICE netlist is correct.
Error from simulation - No. of Data Rows : 0
Operating point simulation skipped by ‘uic’,
now using transient initial conditions.
No. of Data Rows : 0
doAnalyses: TRAN: Timestep too small; time = 1e-21, timestep = 1.25e-22: trouble with xu5.xu1:d1-instance d.xu5.xu1.da2
run simulation(s) aborted
Spice netlist -
save all
.probe alli
.probe p(V1)
.probe p(XU5)
.ic V(Out)=0.5V
.tran 0.1n 100u uic
.options reltol=0.01 gmin=1e-12 abstol=1e-9 vntol=1e-6
.plot V(Out) V(A)
.OPTIONS numdgt=7
.save all
.tran 1n 100u 0 1u
V1 Net-U5G-VCC GND DC 15
XU5 Net-U5G-VCC Net-U5-Pad2 /Out Net-U5-Pad4 CD4049UB
.end
First, try with this schematic. It has 0 ERC errors and has everything you need for simulation:
Note the simulation ground and the X at the output of U1F.
You may have a look at Simulation examples for KiCad/Eeschema/ngspice - #4 by holger (scrolling down a bit, made with KiCad 6).
Sorry for the late follow-up, but would anyone be able to help simulate this? I’ve tried numerous approaches, but I still can’t get anything close to a square wave. Might be that i dont have the correct Spice model,
CD4049UB.libsig (813 Bytes)
CD4049UB.cir (8.8 KB)
CD4049UB.lib (8.8 KB)
You can try these (i didnt check them)
cd4049ub.sub (567 Bytes)
cmos.lib (209.2 KB)
DIGITAL.LIB (17.0 KB)
I tried all three of them, but I’m not getting anything reasonable. I’m not sure if the issue is on my end.
Quick question — do I need to assign pins for the model? And if so, how do I know which is which?
For example, the model says:
Sim. Pins: 1=1, 1=2, 2=4, 3=3 — which doesn’t really make sense to me.
When I go to assign pins in the simulator, I get something like:
Symbol Pin 1 (Vcc) – Model Pin (1–4)
Symbol Pin 8 (Vss) – Model Pin (1–4)
It’s possible that the ring needs a resistor to ground or plus to get oscillation started.
Yes, you need to. Please have a look at Ng syntax dual diode.
Please zip your project (including all models used) and post it here.
Ring-Oscillator-update for KiCad 9 at Simulation examples for KiCad8/KiCad9/Eeschema/ngspice - #4 by holger