eeschema ngspice noise simulation is buggy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
Unknown
|
Bug Description
eeschema ngspice
simulation .noise with error
take example C:\Program Files\KiCad\
copy to user writable place
start eeschema
load sallen_key.sch
edit text window (mark as comment) -> *.ac dec 10 1 1Meg
Tools --> Simulator --> Settings --> Noise
Measured node /lowpass
Reference node <empty>
Noise source V1
Decade
Number of points 10
Start frequency 1
Stop freuency 10k
ok
run/Stop Simulation
simulation runs, but emits only error messages:
Error: no such vector 3
Error: no such vector 6
Error: no such vector 2
Error: no such vector 1
Error: no such vector 4
Error: no such vector 5
Reason is that after command 'bg_run' has finished, commands
print v(3)
print v(6)
...
are sent to ngspice.
The netlist
Spice Simulator --> Simulation --> Show Spice Netlist ... does not
contain node names 1 to 6 (see below), so ngspice reports errors.
Spice Simulator --> Add Signals
does not show the noise vectors, but only the op vectors
The netlist itself is buggy:
The line
.noise v(3) V1 dec 10 1 10k
does contain an non-existing node. It should read
.noise v(/lowpass) V1 dec 10 1 10k
The noise-relevant inputs and outputs are not saved and thus are not available for printing or plotting
It would probably be ok to add a
.save all
to the list of saves.
For this noise simulation ngspice generates two 'plots'.
plot noise1 contains
frequency : frequency, real, 41 long, grid = xlog [default scale]
inoise_spectrum : voltage-density, real, 41 long
onoise_spectrum : voltage-density, real, 41 long
These should be made available in the graphics, not the op vectors
plot noise2 contains the integral noise values
inoise_total : voltage, real, 1 long
onoise_total : voltage, real, 1 long
These should be printed.
The netlist generated during noise simulation:
.title KiCad schematic
.include "D:\Spice_
V1 Net-_R1-Pad2_ GND AC 1
XU1 Net-_C2-Pad1_ /lowpass VDD VSS /lowpass AD8051
V2 VDD GND DC 10
V3 GND VSS DC 10
R2 Net-_C2-Pad1_ Net-_C1-Pad2_ 1k
R1 Net-_C1-Pad2_ Net-_R1-Pad2_ 1k
C1 /lowpass Net-_C1-Pad2_ 100n
C2 Net-_C2-Pad1_ GND 100n
.save @v1[i]
.save @v2[i]
.save @v3[i]
.save @r2[i]
.save @r1[i]
.save @c1[i]
.save @c2[i]
.save V(/lowpass)
.save V(GND)
.save V(Net-_C1-Pad2_)
.save V(Net-_C2-Pad1_)
.save V(Net-_R1-Pad2_)
.save V(VDD)
.save V(VSS)
.noise v(3) V1 dec 10 1 10k
.end
tags: | added: eeschema ngspice |
Changed in kicad: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
milestone: | none → 5.1.1 |
Changed in kicad: | |
milestone: | 5.1.1 → 5.1.2 |
Changed in kicad: | |
assignee: | nobody → Jon Evans (craftyjon) |
Changed in kicad: | |
milestone: | 5.1.2 → 5.1.3 |
Changed in kicad: | |
assignee: | Jon Evans (craftyjon) → nobody |
Changed in kicad: | |
importance: | Wishlist → Unknown |
status: | Expired → New |
Changed in kicad: | |
status: | New → Fix Released |
Application: eeschema compatible with 2.8)
Version: (5.1.0)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013
Build settings: WX_GRAPHICS_ CONTEXT= OFF WX_OVERLAY= OFF SCRIPTING= ON SCRIPTING_ MODULES= ON SCRIPTING_ PYTHON3= OFF SCRIPTING_ WXPYTHON= ON SCRIPTING_ WXPYTHON_ PHOENIX= OFF SCRIPTING_ ACTION_ MENU=ON GITHUB_ PLUGIN= ON USE_OCE= ON USE_OCC= OFF
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON