2
\$\begingroup\$

I am trying to learn about RC circuits. As I understand it, the indicated point in the basic RC circuit below should produce a current and voltage curve like this. However, when I attempt to simulate the circuit in the embedded CircuitLab and (other online simulators also) I get nothing. I also tried in Digikey's Partsim and got the same results. So it must be something I'm doing wrong...

I chose Time Domain simulation with the following parameters: enter image description here (I assume the Time Constant for this circuit is about 1 second, so 2 sec should generate a nice curve...)

I'm measuring V and I at the point indicated.

Here's what I get. Notice the scale shows 9.000V top and bottom, and current 0.000A top and bottom.

enter image description here

It makes no sense! Please tell me where I went wrong! Thank you!

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ How did you define your source in the simulator? \$\endgroup\$ – Big6 Aug 29 '16 at 21:29
  • \$\begingroup\$ Source is a voltage source, as you see in the drawing, set to 9V DC. \$\endgroup\$ – Ryan Griggs Aug 29 '16 at 21:30
  • \$\begingroup\$ Skip Initial -> Yes \$\endgroup\$ – brhans Aug 29 '16 at 21:34
  • \$\begingroup\$ You have to make sure your input is a step, i.e, start from zero up to 9V. If you make it 9V (9V at time zero), then your simulation leaves out the transient part. \$\endgroup\$ – Big6 Aug 29 '16 at 21:36
1
\$\begingroup\$

The default initial conditions for time domain simulations is almost always the "steady-state" condition assuming all sources were at their \$t=0\$ state since \$t=-\infty\$.

There are a few different fixes for this:

  1. Switch to a time dependent source (like what Jim did with a square wave source)
  2. Disable the "initial condition" solve step, which usually initializes all nodal voltages/branch currents to 0 (when applicable).

  1. Manually specify the initial conditions. Unfortunately, CircuitLab doesn't appear to allow you to do this (other than disabling the "skip initial" step). However, for SPICE-like simulators you can add an .ic command to manually specify the value to use. For example, here I've set the initial conditions V(out)=4V in LTSPICE.

enter image description here

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Enabling the "Skip Initial" by setting to Yes solved the issue for me. Thank you for this clarification. Now back to learning about RC circuits! \$\endgroup\$ – Ryan Griggs Aug 30 '16 at 2:46
2
\$\begingroup\$

Before starting the transient simulation, the simulator performs a DC analysis which concludes that the capacitor is fully charged so once the transient analysis starts, since your source doesn't change, the output doesn't move either.

The small movement you see in your first simulation waveform are probably due to a small numerical computation error difference between the DC and transient solvers. Once the transient solver "sees" an error it tries to correct for it in the subsequent time steps. Try zooming out your axes on the voltage and current to see how much those waveforms are actually moving by. My bet is that they are pegged at 9V and 0A respectively.

\$\endgroup\$
1
\$\begingroup\$

Try running it with a square wave input with a 4 second period, running it for 4 seconds total to see the entire period.

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

\$\endgroup\$
  • \$\begingroup\$ OK so that gave me this: snag.gy/F43JmN.jpg which makes more sense. The question is why doesn't it work with a 9VDC input? Does it assume everything is already at the working voltage? Why can't it show capacitor charge-up time for a DC source? \$\endgroup\$ – Ryan Griggs Aug 29 '16 at 21:28
  • \$\begingroup\$ I'm not positive, but my understanding is that when you apply a DC source, the solver assumes it has been that voltage since time t = - ∞ which would mean the capacitor has already been charged. Which makes your output even more confusing. \$\endgroup\$ – Jim Aug 29 '16 at 21:36
  • \$\begingroup\$ Yup, that's the reason. Simulators almost always have a "skip initial operating point solution" option. But normally, they go and find that \$t\rightarrow\infty\$ solution first and apply it as the starting condition. That works really well, often. But for something like this, no. Also, you can use ".ic" to set the initial conditions on parts. So something like '.ic V(C1)=0" might be something do, along with skipping that operating point calc. \$\endgroup\$ – jonk Aug 29 '16 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.