Electronics > PCB/EDA/CAD

Possibility of creating Spice Model from Measurements?


Is it possible to create a (NG)Spice Model from Measurements? I am pretty sure that it will work with simple parts like a resistor, a diode or a transistor, but where I am not so sure is with more complicated parts like an OPV or other IC’s.

The model Creation question

If one looks at the Parameters for the NGSpice model for a diode(https://ngspice.sourceforge.io/docs/ngspice-manual.pdf page: 131) one can think of measurement setups for practically all of them, even things like temperature are doable.

But an OPV is a much more complicated structure, even though I know that there are Parameters that every OPV has, I would not know how I would create a Model/Subcircute out of measurements out of it.

This only gets more complicated if one asks if it would be possible to create a circuit for practically every IC, especially if it is a combination of Digital and Analog.

Also how many parts would one need to measure to get some what representable data out of it, because there is a variance in every manufacturing process.

The “legal” question

Why I am asking this is kind of idiotic but I thought that if one creates his spice models from measurements no company can claim copyright to it and one can create a 100% open source spice library. This partly comes from the fact that KiCAD supports NG Spice but its Symbol library does not come with spice models and one needs to add them themselves.(https://www.kicad.org/discover/spice/ bottom)

Other things that could be done with this data
If one already has this data of the measurement of some dozens or even hundreds of a part one could create a “Datasheet” out of it to protocol what the spice model is in a more human readable form.


SPICE is just a numerical integration engine.  Anything you can describe in differential equations, you can run in SPICE.  Which, since diff eq are Turing complete, and physically fundamental besides, that's anything.

The basic limitation is you only have as many equations or states as there are nodes in the model, and they're scalar only; it's not a field solver, nor is it a general complex/analytic equation solver.

For example, you can't construct the EM field model of a PCB, but you can use a field simulator to extract an equivalent LC model that's good up to some accuracy and frequency limit, and use that in SPICE.

Of course, as the node count goes up, simulation performance drops.  It's also tuned for sparse matrices (which is effective for most practical circuits), and a highly coupled circuit might run slower as well.

You can have faster performance if you can describe your device in terms of built-in primitives, like diodes and transistors.  This is effective when you're modeling such a component in the first place, but not so effective when you need to get more precise.  Say if you want to model the drift step recovery behavior of a diode: SPICE's recovery model is quite basic for starters, and note that recovery is a diffusive transport phenomenon, i.e. a continuum field not a discretized system, so such a phenomenon can only be approximated in SPICE.  If you want to go off-label (say, modeling wide bandgap diodes, or do something weird (say, something with a non one-to-one doping profile), you're going to have a harder time.  Maybe you can still construct an approximation using an array of such devices, or maybe it's better to fall back on the basic equations.

While SPICE uses voltage and current as intrinsic units, you can simply use the same values to represent whatever you want.  A typical example is using voltage to represent temperature, for thermal modeling.  The power dissipated by a transistor can be linked to a thermal model of its package and heatsink, for example.  In particular, any single connection (node) can represent any pair of variables used to link a system: voltage and current are intended, but you might construct a hydraulic equivalent model with pressure and velocity, etc.

That's basically the overview of what to use it on.  As for your particular question -- well, I hope you weren't simply expecting a "yes", because of course SPICE models are made from measurements.  As for how, you've given no hint about what you want to do, so I can't offer any particular tips there.

Legally, yes, a model bears no relation to the device it's supposed to represent, and retains whatever copyright its owner asserts.  You can decap, micrograph and model an IC, transistor by transistor, if you like; such reverse engineering (RE) is protected by law.  What's not protected is exfiltrating proprietary information from the source; which is where RE can run into problems, and why corporations have to set things up very carefully (isolating the people doing the work, from any information the company might have that could "taint" their process; a "clean room" approach).

The most dangerous thing I suppose, would be the models the manufacturer uses internally -- which will contain proprietary process information (very precise models of devices a particular fab can produce), as well as trade secrets (the exact circuit being manufactured).  You aren't likely to stumble upon such a model, at least not without layer(s) of encryption (such models are indeed commonly available, especially since LTSpice added crypto), or multiple layers of NDAs and perhaps service contracts in place.



--- Quote from: T3sl4co1l on May 20, 2023, 09:27:53 am ---Tim

--- End quote ---
Thank you Tim, I am now know more about spice than before.
This was les of an "I want to do this" and more of an "is that even posible and would that maybe solve licensing Issues?"
If I understood you correctly, one would need to create differential equations, with the measurments. Would this be done with things like Linear and Polynomial regression ore are there specialized methodes for this?

Not really, at least not of enough simplicity you'd want to use it.  Study the system, determine how many state variables / degrees of freedom it has, apply stimulus to push it into as many corners of the state space as possible, and determine relations between them.



[0] Message Index

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod