Hello, I try to simulate under Kicad V8.0.6 a Cockcroft-Walton Generator. To not start from scratch I try to use a circuit with CD40106 (already answered in this forum) and I get an error when interconnecting pins to this device for Spice simulation. Here spice result :
Ok thank @janharm I download the spice model from TI website, I use (or want to use) 40106 not 4049, not understand “gnd 0” ?!!? sorry.
Following your suggestion, I duplicate the first cell like this :
Nice the simulation works, I would expect that the generator should generate a high voltage. Note the inverters connect the output to 9V (when high) or 0V (when low) so the voltage vout will not rise above 9 Volts. In this sense the simulation is correct.
Thanks @RobK you’re right, in my mind it’s based on CW but it is close too a charge-pump, I don’t know how to name it?
The simulation fail probably due CD40106 simulation file not including good AC performance (which I don’t know how to add it). A classic CW uses an sinusoidal AC source, here the first door is used as an oscillator, others are used to “phase shift” the signal (Each cell invert previous) these out-of-phase signals are then used to control the different sections of diodes and capacitors. It is not the “classic” topology where only one AC signal fuels the entire waterfall. In other words, it is an implementation of load pump that uses serial inverters to provide clock signals (with phase alternation) to each “floor” of diodes/capacitors, rather than a single AC source as in the traditional CW. It is a clever method for generating load pump tensions without the need for multiple transformers or complex external clock sources. Probably we need to use a better diode model and Capacitor too? No idea …
Excellent! I discover this circuit thanks to you! I’ll try to simulate this on Kicad (that use ngpice) to observe the same signal reaching 50V at the end! thanks to you
Thank you @paulvdh for the link. It seems that Ngspice is more limited than LTspice at least for this type of representation. Even with simplified models of inverter and diodes it seems that the resolution with Ngspice confronts concerns of convergence and singular matrix. @RobK On your diagram I see a 10nS TD and a VHIGH = 9V Can you give the models you use for the inverter and the diodes? Perhaps they will work with Ngspice?
Here my new schematic :
Using the TI model for the inverter may have the disadvantage that according to the data sheet the output current may be less than 2.5 mA. You have to charge several capacitors, a multiple of 47nF, which would take a lot of time.
Creating an inverter like E_RAW_IDEAL RAW_IDEAL VSS VALUE = {IF(V(IN) > V(VDD)/2, V(VSS), V(VDD))}
is not a good idea in my view. An inverter is always also an amplifier. The inverter above has an infinite amplification at input vdd/2, in other words the derivative which is used during matrix solving is infinite: an invitation for disaster.
Creating a time constant at the output has the same problem as discussed above: the output current is limited. So better add it at the input, which does not draw any current. You may then add a small output resistance of your choice.
My suggestion is:
.SUBCKT INVERTER_atan IN OUT VDD VSS
* R*C = 1u
Rin in in_int 1Meg
Cin in_int vss 1p
Rout out_int out 10
Binv out_int vss V = v(vdd, vss) * (0.5 + atan(-100* (v(in_int) - v(vdd,vss)/2)) / pi)
.ENDS
A diode for transient simulation, even the most simple one, should have junction a capacitance, e.g. cjo=20p.
I have not done your circuit, but a five stage ring oscillator (5 inverters in series with the final output fed back to the first input) using my inverter, which nicely oscillates during transient simulation, no extra options set.
When setting up the simulation (New analysis tab), it is wise to uncheck current and power measurement if not needed, sometimes another source of non-convergence.
“using my inverter, which nicely oscillates during transient simulation, no extra options set.”
Can you provide file?
I try this and unable to simulate with I get error like :
I still do not understand pinning of the diodes I made a subckt to swap connection. I use the vpulse as supply and the 0 as gnd for spice. Hope it helps oscillator.zip (81.3 KB)
Wahoo I am very impressed! Bravo @janharm for this job I just added .tran 500nS 5ms and offsets on Vodd and Veven to reseize traces. Nice job thank you for this beautiful simulation!