There are several ways on how to sweep current in LTSpice. You can do it through DC sweep command tab, using the step command or through the list command in the spice directive. For first timer in LTSpice, click this beginner’s tutorial. In this tutorial I assume that you have already basic knowledge on LTSpice so I jump directly to the topic.
How to Sweep Current in LTSpice using a DC Sweep
The first method I will discuss on how to sweep current in LTSpice is by using the DC sweep command. Let us use below circuit to demonstrate this very well. Below circuit is a comparator. When the level of V+ will decrease below the level of V- the comparator output will be zero. This circuit actually is a good over current or short circuit protection. We are going to find out at what value of Iload that Vout becomes zero and we need to sweep the level of Iload.
1. Draw the circuit above. After doing so, setup the current sweep command. Go to Simulate then Edit Simulation Cmd. Just follow the settings below for this demonstration. Click OK then drop the command line in the schematic.
In this simulation setting, the parameter IIoad is sweep from 0A to 10A with an increment of 1A. The type of sweep is linear.
2. Run the simulation. To run, click the Run icon in the icon bar
Alternatively, go to Simulate toolbar in the icon bar section and click Run.
Based from the result below, Vout will completely touch zero when the level of the load current is 5A.
Instead of setting the current sweep in the Edit Simulation Cmd window, you can go to the spice directive directly and use below format.
To show the spice directive window, just press letter “T” in the keyboard and then tick Spice directive in the window that will show.
How to Sweep Current in LTSpice using a Step Command
The second approach on how to sweep current in LTSpice is by using a step command. The step command can be done through spice directive. Its format is illustrated below.
As mentioned, this method is can be done in the spice directive. Press letter “T” in the keyboard to bring in the spice directive window. In the first method on how to sweep current in LTSpice, after the command is landed in the schematic the simulation is ready to run. However in this approach another simulation command from the “Edit Simulation Cmd” is needed. In the example below we will use transient command.
On below circuit we are going to sweep the value of Iload from 0 to 10A with 1A increment. Together with this is a transient setup with a stop time of 30 microseconds and set voltages from zero volt.
One more thing to take note in this method is that you need to enclose in curly braces the parameter to sweep. In the example circuit below it is Iload.
1. Setup the sweep in the Spice directive. Click OK and drop the command line in the schematic.
2. Setup the transient command from the Edit Simulation Cmd window. Click OK then drop the command line in the schematic.
3. Run the simulation by clicking the run icon in the toolbar.
Below graph shows the response of the positive input of the opamp U1. As you can see there are 10 runs correspond for 0A to 10A.
To edit the sweep command, right click on the command so that spice directive will show.
How to Sweep Current in LTSpice using a List Command
Another method on how to sweep current in LTSpice is through a list command. A list command is also can be done in the spice directive. On below circuit we are going to vary the value of Iload to 0, 1, 5 and 10A. Follow the command below. The same with above method, this needs another simulation command from the “Edit Simulation Cmd” window to run.
1. Setup the sweep in the Spice directive. Click OK and drop the command line in the schematic.
2. Setup the transient command from the Edit Simulation Cmd window. Click OK then drop the command line in the schematic.
3. Run the simulation by clicking the run icon in the toolbar.
Simulation Result
To edit the sweep command, right click on the command so that spice directive will show.
All the three methods on how to sweep current in LTSpice has its advantages. Better to familiarize all them. Anyway, it is not that difficult to memorize. You may be interested on how to sweep voltage, resistance and temperature in LTSpice as well.