西班牙网友的问题集合
#Feature Requests#
Feature Requests
Better user visibility & editing of spice .model & .subckt

Sorry, this is a long post and may be hard to follow.

It is related to:

https://easyeda.com/bbs_view_5.htm

The Problem

It has to be easy for users to:

i) find the part they want

and

ii) for simulation, to be able to view and, if required, to edit the spice .model / .subckt for that part (See note at end);

or

iii) change to a different spice .model / .subckt.

Novices / newbies need to be able to just put down a part with a spice .model / .subckt already assigned so they don't have to worry about it.

EasyEDA is very close to being able to do that already just by the Find Libraries... button.

It is not quite there yet because there are some parts in the libraries that do not have working spice models and of course some parts have no .model / .subckt.

For example, the EasyEDA library contains several versions of the 2N5484 NJFET.

The 2N5484 drops into a schematic and simulates OK.

The 2N5484/PS drops into a schematic but fails to simulate with the error:

Error on line 7 : jq1 vbattery_1 jq1_3 vout 2n5484/ps

Unable to find definition of model 2n5484 - default assumed

unknown parameter (/)

Model issue on line 10 : .model 2n5484/ps njf+ vto=-1.2796e+000+ beta=1.71347e-00 ...

Unknown model type / - ignored

This will be meaningless to most novices.

There seems to be no way in

Find Libraries...

or

Super Menu > Miscellaneous > Edit Symbol

or

Preview Symbol > Edit

then

Super Menu > Miscellaneous > Edit Subckt

to view the .model / .subckt associated to the device.

They can view the netlist and see the .model / .subckt in there:

.MODEL 2N5484/PS NJF+ VTO = -1.2796E+000+ BETA = 1.71347E-003+ LAMBDA = 1.93292E-002+ RD = 4.41873E+000+ RS = 4.41873E+000+ IS = 1.25479E-016+ CGS = 2.25000E-012+ CGD = 2.34000E-012+ PB = 1.14141E+000+ FC = 5.00000E-001

but to a newbie who does not know spice syntax, this will not help them.

In this particular example the problem is because there are two errors in the .model statement.

One is that the name of the model has a / in it. This breaks the syntax.

The second problem is that the model as it is passed to ngspice from EasyEDA is something like this:

.MODEL 2N5484/PS NJF+ VTO = -1.2796E+000+ BETA = 1.71347E-003+ LAMBDA = 1.93292E-002+ RD =

4.41873E+000+ RS = 4.41873E+000+ IS = 1.25479E-016+ CGS = 2.25000E-012+ CGD = 2.34000E-012+

PB = 1.14141E+000+ FC = 5.00000E-001

whereas it is written to wrap over several lines exactly like this (with the / replaced by _):

.MODEL 2N5484_PS NJF

+ VTO = -1.2796E+000

+ BETA = 1.71347E-003

+ LAMBDA = 1.93292E-002

+ RD = 4.41873E+000

+ RS = 4.41873E+000

+ IS = 1.25479E-016

+ CGS = 2.25000E-012

+ CGD = 2.34000E-012

+ PB = 1.14141E+000

+ FC = 5.00000E-001

where the + character is a continuation character and not a mathematical operator.

More experienced users, although they can see the .model / .subckt in the netlist, cannot edit it to correct these mistakes.

Advanced users will want to see the model:

i) to check where it came from

ii) to fix some of the things that may be broken

iii) to edit the syntax to make it work in ngspice instead of PSpice or Hspice and so on

iv) to replace it with a different manufacturer's - or even their own - .model / .subckt

Note that there may be some .model / .subckt that we may not want to show to everyone simply because they could be copied straight into rival software (always a risk with plain text spice .model / .subckt).

For example, EasyEDA appears to have very few opamp and comparator macromodel .subckts.

Even opamp and comparator macromodel .subckts that are available from the vendors are not always good. They may not model how they behave as the power supply comes up, many do not model supply and even output load currents and almost none correctly model what happens if the input or outputs go above / below rails.

Opamp models from some of the other online tools are very basic.

All of these things may be OK for experienced users but the novice expects a model to behave like a real device. This is something that is very clear from the forums in CL.

For opamps and comparators, I have been developing an opamp / comparator macromodel that has all these features. It can be given a set of simple parameters straight out of the device datasheet so we can supply models for almost any opamp or comparator!

It is very much like the UniversalOpamp2 model in LTspice.

However, the subcct for this macromodel could be copied straight into a rival tool, so we may want to keep that hidden from users.

Questions? Just Ask!

#Feature Requests#
Feature Requests
Can't do stepped sweep

**BUG**
Concise problem statement:

Can't find a way to do a swept value of R1.

Trying to implement section 16.13.4.2 .step of ngspice manual:

http://www.ngspice.com/downloads/ngspice-manual.pdf

Note that spice netlist has lost indents for content of

.control .... .end

section. Don't know if that has any effect.

Note also that simulation runs OK as a simple non-swept sim and does not report errors.

.STEP R1 1k 2k 1k statement is commented out but has no effect if set to spice directive.

Steps to reproduce bug:

  1. Run transient simulation

Results: V(boo) only shown at 2.5V.

Expected results: V(boo) should be shown as 2.5V and 1.67V.

Url: https://easyeda.com/file_view_step-test-01_AysKEWevN.htm

Browser:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36

#Bug Reports#
Bug Reports
No More