Settings simulation plot

Hi,
I use the night build of KiCAD 6 on Linux Mint 19.1.

I would need to set up directives in eeschmea what signals will be rendered and ideally perform some mathematical operations over them.

For example, I need to render a transmission that is in two blocks. I use these directives:

.ac dec 200 1 1Meg
.control
run
plot db(v(out)) - db(v(in))
.endc

Then I will generate net spice:
Eeschema -> File -> Export -> Netlist

Then I run ngspice:
$ ngspice my_netlist.cir
and get the following result.

gnspice

Would a similar result be achieved with the built-in Spice Simulator? So that you don’t need to generate a build, but just run a simulation in Eeschema?

Thank you for answer.

I fear that it will not be possible right now because the current eeschema plot interface is very limited.

The most you probably may get (still using external ngspice) is described in http://ngspice.sourceforge.net/ngspice-eeschema.html#external

Yes, I came up with this when writing my question.
Thanks for the reply.

When doing this, the issue is I have to insert 0V V source to plot the current. I see KiCad try to add save statement to avoid doing this. But it is not a easy solution for doing with directive. Do you have other trick for this? So automatically save internal data of basic model like resistors, caps, inductors…?

Use
.options savecurrents
in your circuit or add
option savecurrents
to .spiceinit
(see ngspice manual chapt. 15.1.1)

1 Like

I wish 5.x may have a faster hotkey to activate external ngspice or other simulator. This is the wish because I only have a limited knowledge from 4.1 version, and some 5.x versions. I think I have attempt to request from bug tracking, but seem like I’m not put it in the right way. And so they was mostly dismissed with comments.

[ADDED]
in 4.1x I have to do Alt+T, N, Ctrl+Tab (Three times), Alt+R.
But some case, after using hotkey for switching tools. The Alt key stop working like one of the report I did in the bug tracking for 5.x versions.

[ADDED2]
Also, since 5.x change directive way, and attempt to parse them - It for my use case, make it difficulty for:

  1. Comment or uncomment directives - required to add “*” on every line in directive for 5.x vs. 4.1 only a first line in the directive. I use many directives for simulate difference type/situation.
  2. Switching between 4.1 and 5.x for check features or make sure new version is mature enough for my team require change directive remove/add “+pspice” on every simulation project and directives!

You may try the ngspice .if … .endif statements (manual chapt. 2.12) to exclude a sequence of lines in your netlist.

Well, I am on ngspice, not KiCad. Your KiCad requests indeed should be placed with the KiCad bug tracker to reach the KiCad devs.

Thank :slight_smile: . I had done all of that. Just to hope some one have a second though about all of the dismissed request by put this in here. I have to spend some searching time to figure out which were those report links later.

This maybe better. But the LTSpiceXX ignored this. I’m not sure if this PSPICE “standard” have .if.