Current limiter

The Current Limiter models the behavior of an operational amplifier or comparator device at a high level of abstraction. All of its pins act as inputs; three of the four also act as outputs. The model takes as input a voltage value from the "in" connector. It then applies an offset and a gain, and derives from it an equivalent internal voltage (veq), which it limits to fall between pos_pwr and neg_pwr. If veq is greater than the output voltage seen on the "out" connector, a sourcing current will flow from the output pin. Conversely, if the voltage is less than vout, a sinking current will flow into the output pin.

Depending on the polarity of the current flow, either a sourcing or a sinking resistance value (r_outsource, r_out_sink) is applied to govern the vout/i_out relationship. The chosen resistance will continue to control the output current until it reaches a maximum value specified by either i_limit_source or i_limit_sink. The latter mimics the current limiting behavior of many operational amplifier output stages.

During all operation, the output current is reflected either in the pos_pwr connector current or the neg_pwr current, depending on the polarity of i_out. Thus, realistic power consumption as seen in the supply rails is included in the model.

The user-specified smoothing parameters relate to model operation as follows: v_pwr_range controls the voltage below vpos_pwr and above vneg_pwr inputs beyond which veq [= gain * (vin + voffset)] is smoothed; i_source_range specifies the current below i_limit_source at which smoothing begins, as well as specifying the current increment above i_out=0.0 at which i_pos_pwr begins to transition to zero; i_sink_range serves the same purpose with respect to i_limit_sink and i_neg_pwr that i_source range serves for i_limit_source & i_pos_pwr; r_out_domain specifies the incremental value above and below (veq-vout)=0.0 at which r_out will be set to r_out_source and r_out_sink, respectively. For values of (veq- vout) less than r_out_domain and greater than -r_out_domain, r_out is interpolated smoothly between r_out_source & r_out_sink.

Port Table

Description Direction Default Type Allowed Types Vector Vector Bounds Null Allowed
input  IN v v,vd,i,id,vnam NO   NO
positive power supply INOUT g g,gd NO   YES
negative power supply INOUT g g,gd NO   YES
output INOUT g g,gd NO   NO

Parameter Table

Name Description Data Type Default Value Limits Vector Vector Bounds Null Allowed
in_offset input offset Real 0.0   NO   YES
gain gain Real 1.0   NO   YES
r_out_source sourcing resistance Real 1.0 1.0e-9 / 1.0e9 NO   YES
r_out_sink sinking resistance Real 1.0 1.0e-9 / 1.0e9 NO   YES
i_limit_source current sourcing limit Real 10.0e-3 1.0e-12 / - NO   YES
i_limit_sink current sinking limit Real 10.0e-3 1.0e-12 / - NO   YES
v_pwr_range upper & lower power supply smoothing range Real 1.0e-6 1.0e-15 / - NO   YES
i_source_range sourcing current smoothing range Real 1.0e-9 1.0e-15 / - NO   YES
i_sink_range sinking current smoothing range Real 1.0e-9 1.0e-15 / - NO   YES
r_out_domain output resistance smoothing domain Real 1.0e-9 1.0e-15 / - NO   YES

Example

al0 3 10 20 4 amp3
  
.model amp3 ilimit(in_offset=0.0 gain=16.0 r_out_source=i.0 r_out_sink=l.0 i_limit_source=le-3 i_limit_sink=10e-3
+                  v_pwr_range=0.2 i_source_range=le-6 i_sink_range=le-6 r_out_domain=le-6)

See also

XSPICE Devices
XSPICE Code Models