Voltage doubler ebook Spice

Thread Starter

keithostertag

Joined Oct 4, 2012
55
I'm working through the tutorial on this page:

http://www.allaboutcircuits.com/vol_3/chpt_3/8.html

Near the top of the page, the first Spice example and graph. I've duplicated that netlist, but used a real diode model. Here is my netlist (ngspice notation):

Rich (BB code):
 1 :
     2 : .global gnd
     4 : .model 1n4007 d(is=76.9p rs=42.0m bv=1.00k ibv=5.00u cjo=26.5p m=0.333 n=1.45 tt=4.32u)
     6 : c1 2 0 1000p
     7 : d1 1 2 1n4007
     8 : c2 4 1 1000p
     9 : d2 0 1 1n4007
    10 : v1 4 0 sin(0 5 1k)
    12 : .end
using tran 0.01m 10m (just a little longer than the given example). Got the same graphs, no problem.

My question concerns the current through node 1. I plotted that and zoomed in to find that it is a triangle wave, 10uA peak, at about 50KHz.

Hmm. I'm thinking maybe the current is leakage from the diodes? But I can't explain the shape or frequency. Can someone tell me where that current is coming from and why that shape and frequency?

I'm new to Spice, so maybe I did something wrong?

Thanks,
Keith Ostertag
 

Attachments

Brownout

Joined Jan 10, 2012
2,390
Could be interaction between C1, C2, and junction capacitance of the diodes ( I'm sure that's being modeled ) At steady state, the output diode could be forward biased, switching on briefly as while C2 discharges into C1. The switching could be a result of interaction of the two diode's capaticances. Just guessing here.
 

Thread Starter

keithostertag

Joined Oct 4, 2012
55
Thanks Brownout.

I guess I should have done this before... more graphs/details.

Full graph of v1#branch using the generic diode model as in the tutorial:

http://www.strucktower.com/capturegeneric2.png

Full graph of v1#branch using the 1N4007 model:

http://www.strucktower.com/capturevd2.png

I am giving links instead of attaching as they are a little larger than allowed.

The current in node 1 in the generic model gradually diminishes in amplitude and frequency.

The current in the 1n4007 model is the triangle wave at 50KHz (before zooming in).

Can someone shed some light on what's going on with these?

Thanks,
Keith Ostertag
 

Ron H

Joined Apr 14, 2005
7,063
Thanks Brownout.

I guess I should have done this before... more graphs/details.

Full graph of v1#branch using the generic diode model as in the tutorial:

http://www.strucktower.com/capturegeneric2.png

Full graph of v1#branch using the 1N4007 model:

http://www.strucktower.com/capturevd2.png

I am giving links instead of attaching as they are a little larger than allowed.

The current in node 1 in the generic model gradually diminishes in amplitude and frequency.

The current in the 1n4007 model is the triangle wave at 50KHz (before zooming in).

Can someone shed some light on what's going on with these?

Thanks,
Keith Ostertag
I ran the same sim, and, as I expected found nothing like the triangle you posted.
Current flows in branches. Voltage appears on nodes.
I don't get any voltage or current that looks like that, even without the 50kHz triangle.
Post your .asc file, so we can see the details of your simulation.
 

Thread Starter

keithostertag

Joined Oct 4, 2012
55
Hi Ron-

I think I have figured out what I did wrong.

As I zoomed in on the graph, I wasn't giving it enough steps to get an accurate curve. So the triangle shape is from not having enough points to plot.

I was plotting the curve for 10ms with a .01ms step as in the tutorial, but then zooming in to only a tiny section with the same step. Instead, I need to set much smaller steps for such a small section of the plot.

Not sure what asc files are. My netlist was posted. Here it is again:

Rich (BB code):
 1 : 
     2 : .global gnd
     4 : .model 1n4007 d(is=76.9p rs=42.0m bv=1.00k ibv=5.00u cjo=26.5p m=0.333 n=1.45 tt=4.32u)
     6 : c1 2 0 1000p
     7 : d1 1 2 1n4007
     8 : c2 4 1 1000p
     9 : d2 0 1 1n4007
    10 : v1 4 0 sin(0 5 1k)
    12 : .end
That is the same as in the tutorial but with a 1n4007 model instead of a generic model for the diodes.

I then run interactively:
Rich (BB code):
tran 0.01m 10m
which is the same step as in the tutorial but with extended time (10ms rather than 5ms).

I then run interactively:
Rich (BB code):
plot v1#branch
This gives the plot referred to above, at http://www.strucktower.com/capturevd2.png

Then I zoom in to just the last partial ms of the graph. That produced the triangle shapes due to not having enough points to plot. That is the equivalent of only about 50 points plotted. You can duplicate that and see the triangle effect if you do:

Rich (BB code):
tran .1m 10m 9m
then plot the current through node 1, however you call it.

If I instead do:

Rich (BB code):
tran .01u 10m 9m
which calculates 10,000 points, I get a pretty smooth curve instead of a line of triangles:rolleyes:.

I'm using ngspice, so the syntax is different than what you are using, but had nothing to do with that.

Thanks for responding,

Keith Ostertag
 
Top