LTSPICE - How to specify capacitor initial condition

Discussion in 'General Electronics Chat' started by eblc1388, Feb 13, 2010.

  1. eblc1388

    Thread Starter Senior Member

    Nov 28, 2008
    1,542
    102
    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.

    [​IMG]
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  3. eblc1388

    Thread Starter Senior Member

    Nov 28, 2008
    1,542
    102
    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"
     
  4. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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: Feb 13, 2010
  6. eblc1388

    Thread Starter Senior Member

    Nov 28, 2008
    1,542
    102
    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
     
  7. farhill

    New Member

    Jun 14, 2009
    2
    0
    Neither can work in LTspice IV...It prompts Unknow Syntax.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
Loading...