Now let's do something a little more exciting. Start a new schematic, but this time put together a circuit with a battery, resistor and a capacitor. Follow the same schematic creation procedure as your first Simple1 circuit, except that you will type “C” (or menu “Edit” and select “Capacitor”) when you are ready to add a capacitor.
The following table summarizes the things you that you did in the first circuit but maybe not committed to memory yet (except that “C” for capacitor is new):
|File→New Schematic||Start a new schematic|
|F2||Browse for a new component||Note 1||Battery is found in ”[Misc]”|
|G||Prepare to plant a ground||Note 3|
|R||Prepare to plant a resistor||Note 1|
|C||Prepare to plant a capacitor||Note 1|
|Del||Delete component(s)||Note 2|
|Esc||Exit any mode||Returns mouse cursor to cross hairs|
If you can't remember keystrokes, you can also use the icons in the menu bar:
You'll also see the Line Draw (F3), Resistor (R), Capacitor (C) and Ground (G) icons available also (to the left of these icons). But if you use LTspice for any length of time, you'll find that the keystrokes are much easier and faster.
In the last project, you may recall that the mouse wheel lets you zoom in or out of the schematic, depending on the wheel direction.
When the mouse cursor shows the cross hairs, it is also possible to slide the schematic around by clicking and holding the mouse and then moving it (think of it as grabbing the background of the schematic). Often this is more convenient than using the scroll bars.
When setting the values be careful to enter the values as “9V”, “100k” and “47uF” respectively. Don't put any blanks between the number and the units (we'll discuss all that soon).
Now your circuit should look like this:
Don't forget the “ground”. This is not just important- the simulation will not work without it.
Before we can run the simulation, we need to define what we want it to simulate. So click menu “Simulate” and select “Edit Simulation Cmd”. Then:
That last check box is vital to this particular simulation. Normally the simulation tries to compute a “starting solution” - set of steady state voltages etc. But if we allowed that, we would miss out on the capacitor charging up (in this case).
When you're checking out an amplifier for example, you may not care about seeing the voltages rise and reach that steady state. You're more interested in what happens after the circuit has been on for a while. So the default in LTspice is to show your graphing events at the point where the circuit reaches a calculated steady state.
But in the case of our current circuit, if we were to go straight to the steady state, we'd miss the fun of seeing the capacitor charge up. So in this case, you must click on “Skip Initial operating point solution”.
Start the simulation and then click the voltage probe (mouse cursor) on the wire above the capacitor, to read it's voltage. After that click on the capacitor itself to read it's current. You should get a graph like this one:
The yellow trace is labelled “V(n002)”, which is the voltage at node n002 (we'll talk about node names soon too). This of course happens to be the node connected to the top of the capacitor. Consequently the yellow trace shows the capacitor voltage over time. We see that the capacitor starts out with no charge and pretty much becomes charged around 21 seconds.
The blue trace labeled “I(C1)” indicates the current in component C1. The current axis at the right shows a starting current of about 90uA and dropping to near zero, once the capacitor has charged.
Now let's go back and unclick that “Skip Initial operating point solution” simulation option to see what would happen.
There are a couple of ways to edit that simulation command:
Either way, edit that command by unclicking the “Skip Initial operating point solution” option and then click OK.
When you run the simulation now and test the voltage for C1, you will see a flat line:
Notice two things:
So sometimes you must disable this “convenience function” of simulating from the point of steady state.
If you go back now and reclick that checkbox and run the simulation again, you will see the results we had the first time. You might want to at least put it back where it was, in case you come back to this.