LTSPICE - How to specify capacitor initial condition

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
How do I specify the initial charge voltage of C4 like that of C3?

Right clicks on C3 & C4 both popup the same menu with options like capacitance values and Rser(ESR).

On C3, the change I made to Rser is seen on the schematic but on C4 the Rser value I entered don't even show up on the schematic. Also there isn't any option to specify the initial charge condition.

 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Does the simulation actually run with IC=4.5 specified on C3? :confused:

I set a node voltage in an .ic directive rather than trying to specify it in a component...
You have the high side of C3 labeled as Vo, so:

.ic V(Vo)=4.5

C4 has no connection on the high side, so I really don't know if it has a node number/label assigned. However, you could force a known node label as you've done with C3, and use an .ic directive.
 

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
Hi Sgt,

Yes, the simulation runs without issues with IC=4.5. The original schematic has IC=0 but I changed it to 4.5 to see what happens.

I'm not actually doing any simulation with C4 added. I just placed an additional capacitor C4 onto the schematic and see if I can duplicate what's already there(C3).

If you are interested, the following is the link to that schematic in Yahoo's LTSpice Group:

"Files>Examples>SMPS>MC34063_buck_converter"
 

MikeML

Joined Oct 2, 2009
5,444
As the Sarge said, the normal practice is to set initial conditions using the .IC directive, not on a per component instance basis using the "attribute editor". You can add attributes to any component, but they are not visible unless you make them so.
 

SgtWookie

Joined Jul 17, 2007
22,230
Ahh, OK!

I'd downloaded MC34063_buck.asc a month or so ago; forgotten I'd done that.

Hold down CTRL while you right-click on C3. You'll see IC=0 (actually, now IC=4.5) on SpiceLine2. Notice that the "X" is present in the VIS column on the right so that it's visible.

By default, that field isn't visible; you have to click in the VIS column to place or clear the X.
 
Last edited:

Thread Starter

eblc1388

Joined Nov 28, 2008
1,542
Hold down CTRL while you right-click on C3. You'll see IC=0 on SpiceLine2. Notice that the "X" is present on the right so that it's visible.

By default, that field isn't visible; you have to click in the VIS column to place or clear the X.
That's it. 100% Spot on Sgt.

I usually use the .ic directive method as Sgt and MikeML have suggested but just wonder how it is done in the original schematic.

Thanks all
 

SgtWookie

Joined Jul 17, 2007
22,230
I beg to differ with you - I am using LTSpice IV, and it works just fine as shown in the attached simulation.

As you can see on the right, I entered "IC=3" for the SpiceLine2 box; and the simulation started with V(Vo)=3v as shown on the plot.
 

Attachments

Top