analog-behavioral-modeling-using-pspice
analog-behavioral-modeling-using-pspice
Ian M. Wilson
MicroSim Corporation
20 Fairbanks
Irvine, CA 92718
usage:
yi(t) = A sincut + @ ~ ~ ( t ) l
y,(t) = B sincut + @,(t)l , Table 1. Comparison of Modeling Approaches.
The symbol 9 represents convolution, and f(t) is the impulse run times measured on a Sun 4/110.
response of the filter.
983
Future Challenges Manaeine Convereence and Time-SteD COntrol.
Modeling State Behavior Behavioral models are not restricted to well-behaved devices
like the tunnel diode. Devices with abrupt behavior can be readily
Many real devices exhibit two or more stable states. modeled using the TABLE forms and the logarithmic and
Transitions between these states occur under well-defined exponential functions. Convergence control to ensure that the
circumstances. For example, consider a spark gap. This has two simulator. takes small enough steps may be necessary in these
persistent states. An arc may be present, in which case the device is models. For TABLE devices this can be implemented by setting the
in its ON (low resistance) state. Or there may be no arc, in which internal non-convergence indicator if an attempt is made to skip
case the device is in its OFF state. A combination of applied voltage from a section of the TABLE device to another section that is not
and dV/dt causes the device to transition from its OFF to its ON an immediate neighbor.
state, via a transitory "arc forming" phase. If the arc current falls
below a holding value, the device turns OFF, via an "arc For other forms the proposed output at a given time step
extinguishing" phase. could be compared with the previous output and absolute and/or
relative delta criteria applied. If the test failed, the time step would
The question arises, how to model this kind of device with be reduced. The criteria could be specified per device, with global
SPICE-based simulators. Macromodels are difficult to construct. default values.
Representing the state variable requires some component with
memory. Possibilities include hysteresis blocks and digital primitives Controlling the time step may be necessary not only for
(if a mixed-mode simulator is available). Neither of these offers an convergence, but also from sampling considerations. Interpolation
easy or elegant solution. schemes are used for graphical display of the simulation results. The
time step must be constrained so that voltage/current changes are
Let us consider how procedural and non-procedural within the scope of the interpolator.
Behavioral Modeling approaches might look. The procedural
approach would assign device state to some variable local to a It is not possible to deduce the frequency domain behavior
device instance (eg. STATE). of devices specified by arbitrary expressions. There is a risk of
aliasing occuring if the initial and subsequent choices of timestep
Code such as the following might then express the state produce "reasonable" (but subsampled) values of a periodic function.
transition from state 0 (OFF) to state 1 (ARC-FORMING): For example, suppose there is a IMHz source in the circuit and the
if(STATE == 0 PL f(V, Vdot) > WON) C
initial time step is chosen as lops. If each subsequent time step is
Tsrc = time; --raenkr when also IOpS, the apparent value of the source will be 0.
STATE = 1; --m State
> In practice, this kind of subsampling will be readily noticed.
It can be avoided by manually setting the step ceiling.
and to represent the device's I/V characteristic:
if(STATE == 1) C Summary
Iwt = V i n / (RON + (ROFF-RON).
(1 - (time ~ Tarc)/Ta()) Analog Behavioral Modeling has two immediate, highly
)
practical, uses:
An attractive nonprocedural alternative would be to define a
state machine for the device. Each state is associated with a It can be used to extend the capability of an existing
functional form giving the device's behavior in that state. A set of simulator to model new devices and sources, without modifying the
conditions allow the state transitions to be specified. Here are simulator's source code.
fragments of what such a device representation might look like:
It can also be used to design systems at an abstract level,
Eesa 5 0 STATE ( 4 ) ensuring that the concepts are correct, before proceeding with the
+ Cv(in) / (RON + (ROFF-RON). (l-(timr- TEYTRY)/TON))) detailed circuit-level design.
+ 0.1: Cf(V,Vdot) > VTON)
The second line gives the State 1 behavior of the device. The SPICE'S syntax is non-procedural. This approach has proven
third line gives a transition (0->I) and a condition to be met for to be convenient and powerful. Presenting Analog Behavioral
this transition to occur. Modeling as functional or state-machine forms fits in naturally with
existing SPICE usage and is to be preferred over procedural,
Note that although the substance of the two descriptions is programmatic, extensions.
the same, the nonprocedural form hides most of the housekeeping
operations (such as assigning a new value to the state variable). This Acknowledeements
is clearly a desirable state of affairs.
The author would like to thank his colleagues at MicroSim
for their helpful suggestions and creative ideas.
References
984