Error when plotting results from a DC current sweep (solved)

I would like to do a DC simulation of a current controlled device so I have started with a simple test bench with a current source and a resistor. I am getting an message “Error: vector v-sweep not found!” when trying to plot results from a DC simulation where I am sweeping the DC current through a current source. Since I am sweeping the current I guess it should be an i-sweep. Is there a way to tell the simulator/plotting tool to look for an i-sweep?

Here is my netlist:
.title KiCad schematic
R1 Ur 0 100
I1 Ur 0 5m
.save @r1[i]
.save V(Ur)
.dc I1 0 10m 10u
.end

Here is the simulator output:
Circuit: KiCad schematic
Background thread stopped with timeout = 0
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Reference value : 0.00000e+00
No. of Data Rows : 1001
Error: vector v-sweep not found!

This is a missing feature (or bug?) in Eeschema. I have reported this already on the bug tracker (see https://gitlab.com/kicad/code/kicad/-/issues/2370). It has not yet been implemented in the recent 5.99 nightly.

Thanks for the heads up. The bug was reported a year ago, is there a way to increase the importance of the bug report?

Give a thumb up. -----

Best workaround I can think of is to sweep a voltage source which drives a G-source (voltage controlled current source) that has a gain of 1. I made an example for you, which is attached. Ideally, you’d want to make your own symbol for this. But, I don’t know how to do that…so I used a QPNP symbol which has the required amount of 4 pins and then reshuffled them around to what was needed. See Section 4.2.1 of the ngspice manual for more info about the G-source and how to match the pin ordering.

current_sweep.zip (2.6 KB)

It works great. Thank you for showing me this workaround!

1 Like