EESCHEMA Spice Model Editor MODEL Field Can Not Select NJF, Other MODELS Can

Hello,

Please let me start by saying KiCAD is AWESOME!

Thanks to all of you who have worked so hard to make KiCAD the fantastic success that it is…

I am hoping this is the correct place to post this question, I am new to the froum.


Problem:

Can not get a single MODEL in a .lib file with a NJF (JFET) to allow selection in EESCHEMA. That is in the EDIT SPICE MODEL window, MODEL field drop down menu.

Many other tested models work fine BJT, DIODE, OPAMP etc.

Non NJF JFET models copied into the same .lib file will populate the MODEL field drop down menu in the EDIT SPICE MODEL and allow selection properly.

There is something specific about the NJF JFET model, my process and or configuration that does not allow the .model NJF to be selected (the field is grayed out).

Maybe the problem is something obvious like white space or a non display character in the cut and paste but I believe I have tested all these options and everything else I can think of…

Why don’t NJF models work while others do?

Any guidance or input will be appreciated.

My Procedure is similar to the procedure linked to in the FAQ Linked Procedure Reference (Below)


MY PROCEDURE:

Create a .lib file with only the .model text in it for the desired JFET.

Be sure of the path and that the file has all the necessary permissions.

save as j201.lib

Complete Path and Name
/home/xx/KICADxx/LIBxx/j201.lib

Text in file for a JFET (NJF) model:
.MODEL J2N5459 NJF (IS=1N VT0=-4 BETA=0.5M

  • LAMBDA=2.40E-3 CGD=5.85PF CGD=3.49PF)

Save as j201.lib

In EESCHEMA schematic

JFET MODEL (J113) > DOUBLE CLICK > EDIT SPICE MODEL > LIBRARY - SELECT FILE > /home/xx/KICADxx/LIBxx/ > Location > j201.lib > OPEN

With the j201.lib library file selected we see the library file path and name correctly displayed

/home/xx/KICADxx/LIBxx/j201.lib

We also see the text displayed properly in the window

.MODEL J2N5459 NJF (IS=1N VT0=-4 BETA=0.5M

  • LAMBDA=2.40E-3 CGD=5.85PF CGD=3.49PF)

The model is listed as J113 which is the correct symbol displayed.

PROBLEM the drop down select triangle for the MODEL field is grayed out and the J2N5459 MODEL can not be selected.


Repeat the above process using the following model text in the file j201.lib to test the procedure.

.MODEL MOSFET NMOS (VTO=-4,Beta=0.000375)

When using the MOSFET model text in the j201.lib with the same process we see that:

The MODEL is listed as J113, the drop down select triangle for this field is available and the MOSFET model can be selected for this field.

This is the expected result.


Why doesn’t this work for the J2N5459 (MJF), while the same process works for the MOSFET and other models tested the same way?

(See list of some of the models tested below).


I didn’t want to bother you with this. I was sure it was simply something like a missing comma or maybe some white space or somethign stupid. After days of testing everything I could think of, it got to the point where I need to ask for your help. I hope it is something simple. Not a bug! At this point I don’t see it. Maybe I have been looking in the same place too long.

Maybe you can help…

If you have read this far, thanks for taking the time, I truly appreciate any guidance you can offer!

What am I missing?


BACKGROUND

KiCAD Version Info
Version: 5.0.2-bee76a0~70~ubuntu18.04.1

Bug Tracker - No bugs found using my search criteria.

LMGTFY - Multiple days of searching trying and retrying…

Basics - White, Space, Capiatlizaton, single line, multi line and many combinations of same repeatedly tried…


=============================================================================================

PARTIAL LIST OF MODELS TESTED THAT FAIL

NJF MODEL LIST ALL FAIL


.MODEL J2N5459 NJF (IS=1N VT0=-4 BETA=0.5M

  • LAMBDA=2.40E-3 CGD=5.85PF CGD=3.49PF)

Models for Selected Devices and Components
LINK
https://www.seas.upenn.edu/~jan/spice/spice.models.html#JFETS


.MODEL J201 NJF(Beta=1.621m Betatce=-500m Rd=1 Rs=1 Lambda=2.236m Vto=-600m Vtotc=-2.5m Is=114.5f Isr=1.091p N=1 Nr=2 Xti=3 Alpha=506.8u Vk=251.7 Cgd=4.667p M=227.1m Pb=500m Fc=500m Cgs=2.992p Kf=0.6042f Af=1)

Standard.jft - LTwiki-Wiki for LTspice
LINK
http://ltwiki.org/index.php?title=Standard.jft


.model J2N3819 NJF(Beta=1.304m Rd=1 Rs=1 Lambda=2.25m Vto=-3

  • Is=33.57f Cgd=1.6p Pb=1 Fc=.5 Cgs=2.414p Kf=9.882E-18 Af=1)

Simulating a FET amplifier
LINK
http://www2.eng.cam.ac.uk/~dmh/ptialcd/spice/simulation.htm


.model MPF102 NJF (Vto=-3.41 Beta=1.04m Lambda=2m Rd=1 Rs=1 Cgs=2.414p
Cgd=1.6p Pb=1 Is=33.57f Kf=11.73E-18 Af=1 Fc=.5)

ngspice / [Ngspice-users] Spice problem/JFET characteristics?
LINK
https://sourceforge.net/p/ngspice/mailman/message/26710497/


.model 2N3819 NJF(Beta=1.304m Betatce=-.5 Rd=1 Rs=1 Lambda=2.25m Vto=-3 Vtotc=-2.5m Is=33.57f Isr=322.4f N=1 Nr=2 Xti=3 Alpha=311.7u Vk=243.6 Cgd=1.6p M=.3622 Pb=1 Fc=.5 Cgs=2.414p Kf=9.882E-18 Af=1 )

ngspice / Discussion / ngspice-devel:usage of spice vendor models wiith .model and .subckt
LINK
https://sourceforge.net/p/ngspice/discussion/127605/thread/ff10dead/


======================================================================================

MODELS THAT WORK USING SAME PROCEDURE


DIODE MODEL

.MODEL 1N4007 D(IS=76.9p RS=42.0m BV=1.00k IBV=5.00u CJO=26.5p M=0.333 N=1.45 TT=4.32u)

Circuit Simulation in GNU/Linux – Lets begin! | Ashwith
LINK


MOSFET MODEL

.MODEL MOSFET NMOS (VTO=-4,Beta=0.000375)

FET Models for Computer Simulations-TINA and TINACloud Resources
LINK


BJT MODEL

.MODEL BC546 NPN (

  • IS=2.39E-14
  • NF=1.008
  • ISE=3.545E-15
  • NE=1.541
  • BF=294.3
  • IKF=0.1357
  • VAF=63.2
  • NR=1.004
  • ISC=6.272E-14
  • NC=1.243
  • BR=7.946
  • IKR=0.1144
  • VAR=25.9
  • RB=1
  • IRB=1E-06
  • RBM=1
  • RE=0.4683
  • RC=0.85
  • XTB=0
  • EG=1.11
  • XTI=3
  • CJE=1.358E-11
  • VJE=0.65
  • MJE=0.3279
  • TF=4.391E-10
  • XTF=120
  • VTF=2.643
  • ITF=0.7495
  • PTF=0
  • CJC=3.728E-12
  • VJC=0.3997
  • MJC=0.2955
  • XCJC=0.6193
  • TR=1E-32
  • CJS=0
  • VJS=0.75
  • MJS=0.333
  • FC=0.9579 )

diyAudio - BC546 spice model
LINK
https://www.diyaudio.com/forums/solid-state/278096-bc546-spice-model-print.html


OP AMP MODEL

AC Linear Macromodel of the 741 operational amplifier
(Ref: Macromodeling with Spice, by J.A. Connelly/P. Choi)

* Subcircuit for 741 opamp
.subckt opamp741 1 2 3
* +in (=1) -in (=2) out (=3)
rin 1 2 2meg
rout 6 3 75
e 4 0 1 2 100k
rbw 4 5 0.5meg
cbw 5 0 31.85nf
eout 6 0 5 0 1
.ends opamp741

Models for Selected Devices and Components
LINK
https://www.seas.upenn.edu/~jan/spice/spice.models.html#JFETS


==============================================================

RESOURCES

Below is the procedure linked to from “(Start Here) Frequently Asked Questions”, complete with images.


How to set spice transistor parameters - Schematic / Simulation (Ngspice) - KiCad.info Forums


With the library file, I proceed to…

“OR edit the symbol and associate the model to the symbol.”

  1. Place the symbols like so (all from pspice.lib):

  2. click “Edit Properties” for Q1 then “Edit Spice Model”

  3. “Click “Select file” and browse to the “library file” you created earlier:”

  4. Select the model from dropdown. (You don’t have to use the same model as the symbol value)

  5. The symbol Q1 properties should now look like this. Note: the spice properties now override the “Value” field. For transistors, “Spice_Primitive” must be “Q”.

How to set spice transistor parameters - Schematic / Simulation (Ngspice) - KiCad.info Forums
LINK


Good observation. Seems like the only .MODEL types supported by Eeschema’s drop-down GUI currently are D, NPN, PNP, NMOS, and PMOS. NJF, PJF, and many others are not supported in the GUI, even though the underlying ngspice engine does. Here is the ngspice list from the manual.

Unfortunately, the only GUI workaround I can think of at the moment is creating your .LIB such that your JFETs are within subcircuit definitions since Eeschema GUI detects .SUBCKT without any issues. Otherwise, you need to punch in the “Spice_xxx” fields manually to pick the .MODEL you want from the .LIB file. Someone else here might know other workarounds too, but these are the best I got at the moment.

1 Like

Upgrade to current release 5.1.2, where selection of JFETs is enabled.

2 Likes

A much better workaround. LOLE. Thanks!

I see VDMOS is also working too in 5.1.2. I should probably go around to all my PCs and make sure they are all updated…

1 Like

SOLVED!

Thanks so much Ste and holger!!!

I read over everything a couple of times over the days that I struggled with this. I must have read right past that GUI Model Type Support Table. More than once…

I was afraid that it was going to be a stupid mistake, like a missing comma or something.

Instead it was two stupid mistakes!

RTFM

and

Use the latest version.

It always comes down to mastery of the basics.

Thank you both for your time. Thanks to your comments I have a plan.

2 Likes