1
\$\begingroup\$

I'm new to MOSFETs and LTspice, but I have an N-MOSFET working as I would expect with resistive loads, I’ve had step like input on the gate too and all seems good, but whenever I put a capacitor in series, since the idea is I want to be able to charge the cap, I get realy wierd values everywhere, like every value changes, sometimes on my sims I get -ve current too and constant drain too sometimes. Am I missing something or can you not charge capacitors using MOSFETs (if so how would I from a signal trigger?)

LTSpice sim

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Are you checking the UIC in the .TRAN card? \$\endgroup\$ Sep 28 at 23:21
  • \$\begingroup\$ R1 and C1 are in series, so their currents should be identical. Are you sure the oscillogram is for the same circuit as your schematic? \$\endgroup\$ Sep 28 at 23:29

3 Answers 3

4
\$\begingroup\$

If you look at the scale of your current graph, you'll see that the currents being predicted are less than one fempto-amp (\$\mathrm{fA}\$). That's \$10^{-15}\$ of an amp. The reason that you're getting counter-intuitive visual results is because the simulation isn't accurate for currents that small unless you force it to be -- and if you did force it, with perfect components, you'd just get a capacitor current of zero.

What's happening here is that LTSpice (and most other SPICE variants, if I'm not mistaken) will find the DC operating point of your circuit before it launches the transient simulation.

This means that at the start of the transient simulation the circuit will be at equilibrium. By definition, this means there won't be anything to drive any change in the capacitor voltage, and, hence, no capacitor current.

To see your capacitor charging up, you need to either:

  • tell LTSpice to start with an initial capacitor voltage of zero,
  • tell LTSpice to start with the power supplies at zero,
  • drive your FET gate with a separate power supply that turns on after some delay (a "pulse" supply in SPICE parlance).
\$\endgroup\$
1
  • \$\begingroup\$ Thankyou! I set the resistor conditions to be the suply initially, so why would the “ capacitor current be zero”? As mentioned in your comment if the cap was perfect, or are you referring to when in dc after settling? \$\endgroup\$ Sep 29 at 7:18
3
\$\begingroup\$

Notice that you are getting femtoamps of current change which means the simulator isn't set up properly for what you want to see. You have a few options as shown below.

  1. Use the UIC directive in the transient statement as Periblepsis mentions as shown in the left example. You can either type in the UIC directive or check a box in the transient dialog. When Spice first starts up, the initial DC operating points are calculated which negates what you wanted to see. The UIC directive disables the initial DC operating points. Normally, UIC isn't used.

  2. You can set an initial condition with the .ic card as shown in the middle example. Here, you would set node b to 20V (same voltage as the voltage source. This overrides the initial DC operating point at the specified node.

  3. Do a simple equivalent by driving the RC circuit with a pulse generator as shown in the right example. enter image description here

\$\endgroup\$
2
  • 2
    \$\begingroup\$ It’s better to use startup instead of uic. See here: electronics.stackexchange.com/a/652838/254890 \$\endgroup\$
    – Ste Kulov
    Sep 29 at 2:48
  • \$\begingroup\$ Thankyou, i did that, for some reason i had to set the initial resistor value to the supply even with startup. Do you know why? \$\endgroup\$ Sep 29 at 7:19
0
\$\begingroup\$

Bread boarding this would have shown it works just fine... Electronics simulation is something I have never really trusted much. There is always something that needs changed in the settings to make it function the way you expect and I have never cared for that. I am really not why Google had to promote this question, I would even go as far to argue that this isnt electronics engineering. Get some parts and a bread board? Can the title be changed to make it obvious we are using a simulation tool?

\$\endgroup\$
4
  • \$\begingroup\$ It is part of EE. But you're right about the title, it is lack that aspect. \$\endgroup\$
    – MiNiMe
    Sep 30 at 8:08
  • \$\begingroup\$ My bad, was in the middle of the night as my temper with the software was running low. The question is still true to my understanding as at the time I didn’t know if this was actually an electronics issue or the softwares issue \$\endgroup\$ Sep 30 at 20:38
  • \$\begingroup\$ If you can't either get the circuit behavior from analysis or by simulation and then see it act as expected in real life then you're not really applying the available science. Since engineering is applied science, I'd argue that accurately predicting a circuit's behavior from simulation or analysis (and knowing what you can't accurately predict) is central to electrical engineering. \$\endgroup\$
    – TimWescott
    Oct 2 at 15:57
  • \$\begingroup\$ @TimWescott i was confused of the behaviour hence my post originally, but i would always be open to havig any of my knowlage be told to be wrong and learn. \$\endgroup\$ Oct 3 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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