pingspice.lib.current.CurrentLimiter(Subcircuit)
class documentation
Part of pingspice.lib.current
(View In Hierarchy)
Limits the absolute value of current flow between b and b to Imax with a small series resistance and reverse current from a behavioral current source:
+-------+ a >---+--->| shunt |>----------- 1 -- Rs ---+--------> b | +-------+ | | | | | x | | +-------+ | | | H:Lpf |>-- 2 -- R --+-- C --+ | | +-------+ | | | ^ 3 0 V | | | | x | | +--------+ | +---------------------<| B:Irev |<----+ +--------+
This is a bidirectional limiter; it develops voltage drop to counteract current flow approaching the limit regardless of what direction the current is flowing. Viewing the subcircuit from the outside, it appears that the series resistance Rs increases drastically as the current approaches the limit.
The series resistance Rs is calculated based on Imax and Vmin. Lower values of Vmin result in a lower Rs and a sharper cutoff at the current limit. The "knee" voltage transitioning from linear to current-limited behavior is approximately equal to Vmin.
When ts is set, the CCVS with RC LPF on its output is included for SCA. Without it (at least as observed in unidirectional mode), the behavioral source sometimes oscillates in an effort to limit current that is very close to zero.
Instance Variable | Imax | The current limit in Amperes. |
Instance Variable | Vmin | The minimum voltage that the limiter is expected to drop at the current limit. Default: 0.5 V. |
Instance Variable | n | The exponent used in the saturation equation. A higher exponent means sharper, more drastic limiting. Default: 2.0 |
Instance Variable | uni | Set True to use a unidirectional current limiter, which is
more reliable given Ngspice's habit of messing up operating point with
B-sources. When set, current is only limited if it flows from 'a' to 'b'. (type: bool) |
Instance Variable | reverse | Set True to use unidirectional current limiting with current
flowing from 'b' to 'a'. Sets uni. (type: bool) |
Method | setup | Subcircuit definition. |
Inherited from NodeStuff (via Subcircuit):
Instance Variable | shunts | A dict of current sensing V elements with the pairs of nodes they connect. |
Class Variable | debug | A Bag that gets set
True for all instances to log info about each setup
call. |
Class Method | autoName | Undocumented |
Method | setupResults | Undocumented |
Method | fill | Undocumented |
Method | nodeCheck | Call with the circuit building tool f and a sequence of
nodes provided to this Include or
Subcircuit . |
Method | rawNetlist | Get lines of a raw netlist from a search hierarchy of possible sources. |
Method | shunt | Call to insert a current-measuring shunt and add an entry to my Elements
baton's dict of shunts. |
Method | raw | See Elements.raw . |
Method | iNode | See Elements.iNode . |
Method | ground | See Elements.ground . |
Method | sca | See Elements.sca . |
Method | sca6 | See Elements.sca6 . |
Class Method | _libDir | Undocumented |
Method | _strippedLines | Undocumented |
Method | _call_setup | Calls my setup
method (almost always your override of that method, actually) and processes
any return value. |
Inherited from NodeStuff (via Subcircuit):
Instance Variable | shunts | A dict of current sensing V elements with the pairs of nodes they connect. |
Class Variable | debug | A Bag that gets set
True for all instances to log info about each setup
call. |
Class Method | autoName | Undocumented |
Method | setupResults | Undocumented |
Method | fill | Undocumented |
Method | nodeCheck | Call with the circuit building tool f and a sequence of
nodes provided to this Include or
Subcircuit . |
Method | rawNetlist | Get lines of a raw netlist from a search hierarchy of possible sources. |
Method | shunt | Call to insert a current-measuring shunt and add an entry to my Elements
baton's dict of shunts. |
Method | raw | See Elements.raw . |
Method | iNode | See Elements.iNode . |
Method | ground | See Elements.ground . |
Method | sca | See Elements.sca . |
Method | sca6 | See Elements.sca6 . |
Class Method | _libDir | Undocumented |
Method | _strippedLines | Undocumented |
Method | _call_setup | Calls my setup
method (almost always your override of that method, actually) and processes
any return value. |
True
to use a unidirectional current limiter, which is
more reliable given Ngspice's habit of messing up operating point with
B-sources. When set, current is only limited if it flows from 'a' to 'b'. (type: bool)
True
to use unidirectional current limiting with current
flowing from 'b' to 'a'. Sets uni. (type: bool)
Subcircuit definition.
Why use f? Because it's short and a conveniently typed letter on the keyboard.
Override this if your subclass does not reference a param.ParameterFinder
subclass via the Finder class attribute. As with Include.setup
,
your override method can return a dict of attribute names and values to set
in my instance.