Menu

Soft table limit / Blog: Recent posts

New direction

After some more investigation currently I feel that I should move toward an other direction.

Some reasons:

  • As I see LTSpice already rounds the corners of the TABLE points and the LIMITs. The 1st derivate of them are continuous (I didn't check the 2nd one).
  • LTSpice's dnlim() and uplim() functions align an exponential curve into a linear one. The 1st derivates of them are continuous, but I think the 2nds are not. Just for interest the repo contains a SoftLimit.inc function which aims to provide LTSpice style dnlimit() and uplimit() like limiting on Spice simulators where these functions are not available.
  • The approach to change arbitrary table()s into tanh() functions may help convergence issues but can strongly distort the gain characteristic of the table.
  • It is difficult to implement a good parser for table() definitions, because some spice models (e.g. some opamps and comparators from microchip) uses brackets in a non-standard way.
  • Table()s could be substituted with if() segmented functions which provides rounding around the table points (e.g. with aligned exponential curves or sin functions or with convolution). But there are difficult processing issues, because Table points can be functions too and a good expression normalizer function would be needed to avoid wrong readability and slow simulation.
  • Having nice convergent tables and limiting do not solve the convergence issues with POLY() current and voltage sources.... read more
Posted by Endre 2013-03-13

New commit and .tgzs

The new commit:

  • supports multiple TABLE lines
  • adds the --slopeCheck option, without it the TABLE is always substituted with tanh()
  • usage message is extended

Even with this changes I cannot simulate MCP6561 with LTSpice...

Posted by Endre 2013-03-04

Supporting variable TABLE length.

The new commit supports variable table length. At least 2 points must be present within the table. The table "curve" must have only one inflection point.
Now the --show option shows the table "curve" even if the tanh() fitting was not successful.
.tgzs were updated.

[endre@dudu LTSpice]$ ./softtable.sh --show 'TABLE {V(35,3)} ((-1,-1n)(0,0)(2.00,1n))(2.2,1))'
[ERR 2013.03.02 14:59:07.062 softtable.Main.main(182)] Tables with this slope distribution ([1.0E-9, 5.0E-10, 4.999999]) are not handled!
[endre@dudu LTSpice]$

Posted by Endre 2013-03-02

-i fileName option has been added

Now it is possible to change all the identified TABLE statements within a spice model or library file:

[endre@dudu LTSpice]$ ./softtable.sh -i models/MCP6561.orig.txt > models/MCP6561.txt

Posted by Endre 2013-03-02

New changes

In the 'a * tanh(g * (x - x0)) + y0' output, the x0 was printed with wrong sign, this is corrected.
Now the printed function contains some trivial simplifications. E.g. "-3.0 * tanh(1.0*(x - 0.0)) + 0.0" is printed as "-3.0 * tanh(x)".
A "--spice" option has been added to output a usable spice line:

$ ./softtable.sh --spice "G36 33 0 TABLE {V(35,4)} ((-2.2,-1)((-1.8,-1)(-1.5,0.99)(-1,1))"
G36 33 0 value=(tanh(6.6335*(V(35,4) + 1.6492462)))
$

Posted by Endre 2013-03-01
MongoDB Logo MongoDB