4

I know that capacitor slows the rise of voltage, but why is this not happening in the LTspice simulation?

I got the input voltage at the output instantly.

enter image description here

enter image description here

JRE
  • 67,678
  • 8
  • 104
  • 179
NBK SOFT
  • 95
  • 5

1 Answers1

15

Go to your simulation setting and check the "Start external DC supply voltages at 0V".

As noted in the comments below, there are several ways to solve this. Initial point solution and detect steady state are both methods to speed up a simulation at the cost of dynamic behavior at startup. I personally don't like options like these and "cheat" with a spice directive like ".ic V(Vcc)=0" if it's charged externally or use a voltage source which does its own ramp.

Be aware of the shenanigans going on behind the scene in LTspice and find a method you are comfortable with.

enter image description here

winny
  • 13,064
  • 6
  • 46
  • 63
  • 4
    @NBKSOFT To clarify further: the reason this occurs is because LTspice starts the simulation by finding the DC operating point, and the DC operating point of your circuit occurs when the voltage across the capacitor is equal to the source voltage (i.e. the capacitor is fully charged). Starting the external supplies at 0V fixes your simulation because the initial DC operating point then occurs when the voltage across the capacitor is 0V. – Polynomial Sep 21 '22 at 12:17
  • 4
    @Polynomial In other words, this is not a bug, but intended behaviour, even if a bit non-obvious. – Hearth Sep 21 '22 at 12:32
  • 3
    Or in other other words LTspice is letting your circuit "warm up" before doing the real simulation. – user253751 Sep 21 '22 at 12:36
  • 3
    Don't forget that the `startup` flag will add a fixed 10 us ramp to the supply. OP's is 1 ms so it should be fine (100x less) but, if the time constant is close to that value, `uic` will be a better choice, which adds an instantaneous step. Or use a `PWL()` source, no flags. – a concerned citizen Sep 21 '22 at 13:35
  • 1
    @aconcernedcitizen Is it always 10µs no matter what the other `.tran` or `.options` parameters are? I'm asking cuz I seem to always get 20µs no matter what and can't figure out why yours is different. – Ste Kulov Sep 22 '22 at 04:44
  • @SteKulov Oops, you're right, it's 20 us (always). My neuron double crossed me. – a concerned citizen Sep 22 '22 at 07:46
  • @aconcernedcitizen Anyone knows where _20_ us comes from. 10 us would be equally arbitrary but at least a nice round number. – winny Sep 22 '22 at 13:56
  • @winny Ah, man. No idea where to even start to guess. If I ever bump into Mike in the future I'll be sure to ask him, even though he might get annoyed at the question. Haha. – Ste Kulov Sep 23 '22 at 04:37