-
SPICE Model Creation from User
Data
Summary
This application note provides detailed
information on creating and automatically linking
a SPICE
simulation model to a schematic
component, based on data entered into Altium
Designer's SPICE
Model Wizard.
In order to simulate a
circuit design using Altium Designer's Mixed-
Signal Circuit Simulator, all
components in the circuit need to be
simulation-ready
–
that is,
they each need to have a linked
simulation model.
The
type
of
model
and
how
it
is
obtained
will
largely
depend
on
the
component
and,
to
some
extent, on the personal preference of
the designer. Many device manufacturer's supply
simulation
models corresponding to the
devices they
manufacture. Typically,
it's as simple as downloading
the
required model file (SPICE, PSpice?) and hooking
it up to the schematic component.
Some
of
the
more
basic
analog
device
models
in
SPICE
require
no
distinct
model
file
–
only
specification of simple
parameter values when defining the model link
(e.g. Resistor, Capacitor).
Attaching
these
types
of
models
to
a
component
is
straigthforward
and
simply
a
process
of
select-and-enter
(select
the
model
type
and
enter
the
parameter
values
directly
in
an
associated
dialog).
Some models may
need to be written from scratch
–
for example using the
hierarchical sub-circuit
syntax
to
create
the
required
sub-circuit
model
file
(*.ckt).
Others
–
if
the
device
is
digital
in
nature
–
will require the device to
be modeled using the proprietary
Digital SimCode? language,
the
definition of which is linked to through an
intermediary model file.
Certain analog
device models built-in
to SPICE provide
for an associated model file (*.mdl)
in
which to parameterically define
advanced behavioral characteristics (e.g.
Semiconductor Resistor,
Diode,
BJT).
Creation
of
this
model
file
by
hand
and
then
linking
it
manually
to
the
required
schematic
component
can
be
quite
laborious.
Not
anymore
–
enter
Altium
Designer's
SPICE
Model
Wizard.
Using
the
Wizard
the
characetristics
of
such
a
device
can
be
defined
based
on
user-
acquired data. The parameters
–
entered either directly or
extracted from supplied data
–
are
automatically written to a model file
and that file linked to the nominated schematic
component.
For
more
information
on
linking
a
model
file,
refer
to
the
Linking
a
Simulation
Model
to
a
Schematic
Component
application note.
For detailed information on defining a
digital simulation model, refer to the
Creating and Linking
a
Digital SimCode Model
application note.
The SPICE Model Wizard
The SPICE Model Wizard provides a
convenient, semi-automated solution to creating
and linking
a SPICE simulation model
for a range of analog devices
–
devices that are built-in
to SPICE, and
that require a linked
model file (*.mdl). The behavioral characteristics
of the model are defined
based
on
information
you
supply
to
the
Wizard.
The
extent
of
this
information
depends
on
the
device
type you wish to create a model for
–
ranging from the simple
entry of model parameters,
to the entry
of device data obtained from a manufacturer's data
sheet or by measurements gained
from
the physical device itself.
The
following sections discuss the use of the Wizard
–
from access to
verification.
Accessing the Wizard
The way in which you access the Wizard
depends chiefly on how you want to add the
required
SPICE model. A model can be
added:
?
To a
newly created component (created by the Wizard) in
a schematic library document
?
To an existing
component in a schematic library document
?
To a placed
component on a schematic document.
Access in the Schematic Library Editor
If you are unsure of the device you
wish to model, access the Wizard by choosing Tools
?
XSpice
Model
Wizard
from
the
main
menus.
By
accessing
the Wizard
in
this
way,
you
will
be
able
to
choose:
?
Which
particular device you wish to model, from the list
of supported device types (see
Supported Device Types).
?
Whether to add
the subsequently-generated SPICE model to an
existing component in the
library
document
or
to
a
new
component
that
is
created
by
the
Wizard
and
added
to
that
document.
The SPICE Model Wizard is essentially a
collection of wizards - one per device model
supported.
This is made especially
evident when accessing the Wizard from the Sim
Model dialog.
?
If
you wish to add the model
to an existing component, and have launched the
Wizard
using
the
main
menu
command,
ensure
that
that
component
is
the
active
component
in
the
library.
You
can
also
access
the
Wizard
while
setting
up
a
simulation
model
link
for
an
existing
component.
From
the
Sim
Model
dialog,
simply
ensure
that
the
chosen
entry
in
the
Model
Sub-
Kind
field
is
one
of
the
device
types
supported
by
the
Wizard
(see
Supported
Device
Types), then click on
the Create button
–
to the
right of the Model Name field (Figure 2).
Figure 2. Access the Wizard
directly from the Sim Model dialog.
The
Sim
Model
dialog
itself
can
be
accessed
from
a
schematic
library
document
in
one
of
the
following ways:
?
From
the
Library
Component
Properties
dialog
(
Tools
?
Component
Properties
),
by
adding
a
simulation
model
in
the
Models
region
of
the
dialog.
(Applies
to
the
active
component only).
If you are
editing an existing linked simulation model, using
the Wizard will replace the existing
model with the newly created one.
?
From the SCH
Library panel, by adding a simulation model in the
Models section of the
panel. (Applies
to the active component only).
?
From the
Schematic Library Editor's main design window, by
adding a simulation model
in the Models
region of the window. (Applies to the active
component only).
?
From
the
Model
Manager
dialog
(
Tools
?
Model
Manager
),
by
adding
a
simulation
model in the
Models region of the dialog. (Applies to the
selected component(s)).
Access in the
Schematic Editor
Using the Wizard will
replace any existing model with the newly created
one.
The Wizard can also be accessed
when defining the simulation model link for a
placed component
on a schematic sheet.
Again, access is made from the Sim Model dialog by
clicking the Create
button
–
provided of course that
the model type is one of those for which a
dedicated Wizard is
available.
Figure 3. Accessing the
Wizard for a placed schematic
component.
Supported Device
Types
The Wizard can be used to create
SPICE models for the following analog device
types:
?
?
?
?
?
?
?
?
Diode
Semiconductor Capacitor
Semiconductor Resistor
Current-Controlled Switch
V
oltage-Controlled Switch
Bipolar Junction Transistor (BJT)
Lossy Transmission Line
Uniform Distributed RC Transmission
Line
Naming the Model
When
using the Wizard to add a model to a new library
component, the name specified for the
model will be used to name the
component also.
One of the most
important steps as you follow the pages of the
Wizard, is to provide a name for
the
model
you are creating.
In
fact,
you will not be able to proceed
to the parameter definition
stage of
the Wizard until you have entered a name.
After
creation,
this
name
will
appear
in
the
Model
Name
field
of
the
Sim
Model
dialog.
The
model file itself is also created using
this name ().
Figure 4. Define a
meaningful name for the model.
When naming the model, you
also have the option to enter a short description
for it. This could be
the function of
the model (e.g. Semiconductor Resistor), or a more
specific reference to a value or
configuration (e.g. NPN BJT).
Characteristics to be Modeled
After
giving
the
model
a
name,
you
will
proceed
to
one
or
more
pages
dealing
with
the
characteristics to be modeled. The
model types supported by the Wizard can be
categorized into
the following two
groups:
?
Those
models requiring direct entry of values for
various model parameters. For further
information, see the section Device
Models Created by Direct Parameter Entry.
A parameter specified in the model file
for a device will override its default value
(inherent to the
SPICE engine).
?
Those models
requiring the entry of data from which to extract
the parameters that define
the chosen
device characteristics. The data entered is
obtained either by direct measurement
results from the physical device, or
from a manufacturer's data sheet. For further
information,
see the section Device
Models Created by Parameter Extraction from Data.
Only
parameters
definable
within
a
model
file
are
considered
by
the
Wizard.
Any
parameters that are definable at the
component level for a device should be addressed
using
the Parameters tab of the Sim
Model dialog, once the Wizard has finished
creating the model
file.
Generating the Model
After
entry of the required data/parameters, the Wizard
will display the generated model (Figure
5). This is the content that will be
saved to the MDL file.
Figure 5. Previewing the generated
model file content.
Editing
of the model can be carried out directly on this
page, giving you the utmost control over
model specification.
Once
you
are
satisfied
with
the
model
definition,
simply
click
Next
to
pass
to
the
end
of
the
Wizard. Clicking Finish will allow you
to save the model. Use the Save SPICE Model File
dialog
to determine where the resulting
MDL file should be saved. By default, the file
will be saved to
the same directory as
the schematic library document. You can also
change the name of the file at
this
stage, should you wish.
If you have
requested the model be attached to a new
component, that component will be created
and added to the library document.
Although the model is linked
automatically to the component
–
new or existing
–
you should make
a habit of verifying the mapping of
schematic component pins to pins of the model.
Simply access
the
Sim
Model
dialog
for
the
attached
model,
click
on
the
Port
Map
tab,
and
check
the
pin
mapping
–
making any changes if
required.
Figure 6. Verify
the component-to-model mapping.
Define
any
additional
parameters
available
for
the
model
–
on
the
Parameters
tab
of
the
Sim
Model dialog
–
as required.
Device
Models
Created
by
Direct
Parameter
Entry
For the following device models the
Wizard does not extract parameter information from
entered
data. Rather, the models are
created based on direct entry of values for their
associated parameters.
When entering
parameter values, there are a couple of things to
bear in mind:
?
If a value for a parameter is not
specified, there will be no entry for it in the
model file
that
is
created.
In
this
case,
the
default
value
stored
internally
in
SPICE
will
be
used.
Put
another
way, if a value for a parameter is specified in a
model file, then the model file value
overrides that parameter's default
value.
?
If the
default entry for a parameter in the Wizard is '-'
and a value for that parameter is not
specifically entered, a default value
of zero will be used (internal to SPICE) for
calculations.
Semiconductor Capacitor
The following parameters are definable
for this device model, using the Wizard. Entering
a value
will cause that parameter to be
written to the generated MDL file.
CJ
CJSW
DEFW
Junction bottom capacitance (in
F/meters2).
Junction
sidewall capacitance (in F/meters).
Default device width (in meters).
(Default = 1e-6). This value will be overriden by
a
value entered for Width
on the Parameters tab of the Sim Model dialog.
NARRO
Narrowing
due to side etching (in meters). (Default = 0).
W
For
more
information
on
this
model
type,
refer
to
the
SPICE3f5
modelsGeneralCapacitor
(Semiconductor) section of the
Simulation Models and Analyses
Reference
.
Semiconductor
Resistor
The following parameters are
definable for this device model, using the Wizard.
Entering a value
will cause that
parameter to be written to the generated MDL file.
TC1
First order
temperature coefficient (in Ohms/?C)
.
(Default = 0)
TC2
Second order temperature coefficient
(in Ohms/?C2). (Default = 0)
RSH
Sheet
resistance (in Ohms).
Default width (in
meters). (Default = 1e-6). This value will be
overriden by a value
DEFW
entered for Width on the Parameters tab
of the Sim Model dialog.
NARRO
Narrowing
due to side etching (in meters). (Default = 0).
W
Parameter
measurement
temperature
(in
?C).
If
no
value
is
specified,
the
default
TNOM
value assigned to TNOM on the SPICE
Options page of the Analyses Setup dialog
will be used (Default = 27).
For
more
information
on
this
model
type,
refer
to
the
SPICE3f5
modelsGeneralResistor
(Semiconductor) section of the
Simulation Models and Analyses
Reference
.
Current-
Controlled Switch
The following
parameters are definable for this device model,
using the Wizard. Entering a value
will
cause that parameter to be written to the
generated MDL file.
IT
Threshold current (in Amps). (Default =
0).
IH
Hysteresis current (in Amps). (Default
= 0).
RON
ON
resistance (in Ohms). (Default = 1).
OFF resistance (in Ohms). Default =
1/GMIN. GMIN is an advanced SPICE parameter,
ROF
specified on the SPICE
Options page of the Analyses Setup dialog. It sets
the minimum
F
conductance
(maximum
resistance)
of
any
device
in
the
circuit.
Its
default
value
is
1.0e-12 mhos, giving a default value
for ROFF of 1000G Ohms.
For
more
information
on
this
model
type,
refer
to
the
SPICE3f5
modelsSwitchesCurrent
Controlled Switch section of the
Simulation Models and Analyses
Reference
.
Voltage-
Controlled Switch
The following
parameters are definable for this device model,
using the Wizard. Entering a value
will
cause that parameter to be written to the
generated MDL file.
VT
Threshold voltage (in
V
olts). (Default = 0).
VH
Hysteresis voltage (in
V
olts). (Default = 0).
RON
ON resistance (in Ohms).
(Default = 1).
OFF
resistance
(in
Ohms).
By
default
this
is
set
to
1/GMIN.
GMIN
is
an
advanced
SPICE
parameter
setting,
specified
on
the
SPICE
Options
page
of
the Analyses
Setup
ROF
dialog.
It
sets
the
minimum
conductance
(maximum
resistance)
of
any
device
in
the
F
circuit.
its
default
value
is
1.0e-12
mhos,
therby
giving
a
default
value
for
ROFF
of
1000G
Ohms.
For
more
information
on
this
model
type,
refer
to
the
SPICE3f5
modelsSwitchesV
oltage
Controlled Switch section of the
Simulation Models and Analyses
Reference
.
Lossy
Transmission Line
The following
parameters are definable for this device model,
using the Wizard. Entering a value
(or
setting a flag) will cause that parameter to be
written to the generated MDL file.
R
Resistance per unit length
(in Ohms/unit). (Default = 0).
L
Inductance per unit length
(in Henrys/unit). (Default = 0).
G
Conductance per unit length
(in mhos/unit). (Default = 0).
C
Capacitance per unit length
(in Farads/unit). (Default = 0).
LEN
Length of transmission
line.
REL
Breakpoint control (in arbitrary
units). (Default = 1).
ABS
Breakpoint control (in arbitrary
units). (Default = 1).
NOSTEPLIMI
A flag that, when
set, will remove the restriction of limiting time-
steps to less
T
than the line delay. (Default = not
set).
A flag that, when set, prevents
limiting of the time-step, based on convolution
NOCONTROL
error
criteria. (Default = not set).
A
flag
that,
when
set,
will
use
linear
interpolation
instead
of
the
LININTERP
defaultquadratic
interpolation,
for
calculation
of
delayed
signals.
(Default
=
not
set).
A
flag
that,
when
set,
uses
a
metric
for
determining
whether
quadratic
MIXEDINTER
interpolation is applicable and, if it
isn't, uses linear interpolation. (Default =
P
not set).
A
specific quantity used to control the compaction
of past history values used
COMPACTRE
for
convolution.
By
default,
this
quantity
uses
the
value
specified
for
the
L
relative simulation error
tolerance parameter (RELTOL), which is defined on
the SPICE Options page of the Analyses
Setup dialog.
A specific quantity used
to control the compaction of past history values
used
COMPACTAB
for
convolution.
By
default,
this
quantity
uses
the
value
specified
for
the
S
absolute current error
tolerance parameter (ABSTOL), which is defined on
the
SPICE Options page of the Analyses
Setup dialog.
A flag that, when set,
turns on the use of the Newton-Raphson iteration
method
to
determine
an
appropriate
time-step
in
the
time-step
control
routines.
TRUNCNR
(Default
=
not
set,
whereby
a
trial
and
error
method
is
used
–
cutting
the
previous time-step in half each time).
TRUNCDONT
CUT
A
flag
that,
when
set,
removes
the
default
cutting
of
the
time-step
to
limit
errors in the actual calculation of
impulse-response related quantities. (Default
= not set).
For
the resultant model to simulate, at least two of
the R, L, G, C parameters must be given a
value and also a value must be entered
for the LEN parameter. You will not be able to
proceed
further in the Wizard until
these conditions are met.
For more
information on this model type, refer to the
SPICE3f5 modelsTransmission LinesLossy
Transmission Line section of the
Simulation Models and Analyses
Reference
.
Uniform
Distributed RC Transmission Line
The
following parameters are definable for this device
model, using the Wizard. Entering a value
will cause that parameter to be written
to the generated MDL file.
K
Propagation constant.
(Default = 2).
FMAX
Maximum frequency of interest (in
Hertz). (Default = 1.0G).
RPERL
Redsistance per unit length
(in Ohms/meter). (Default = 1000).
CPERL
Capacitance per unit length (in
Farads/meter). (Default = 1.0e-15).
ISPERL
Saturation current per unit length (in
Amps/meter). (Default = 0).
RSPERL
Diode resistance per unit
length (in Ohms/meter). (Default = 0).
For
more
information
on
this
model
type,
refer
to
the
SPICE3f5
modelsTransmission
LinesUniform
Distributed
RC
(lossy)
Transmission
Line
section
of
the
Simulation
Models
and
Analyses
Reference
.
Device
Models
Created
by
Parameter
Extraction from
Data
For Diode and BJT devices, the
Wizard extracts parameter information from data
you enter. The
specific
parameters
extracted
for
inclusion
in
the
model
file
will
depend
on
the
particular
characteristics of the diode or BJT you
have chosen to model.
The method of
data entry varies between characteristics. In some
cases, you will be required to
enter
direct data values, in others the entry of plot
data. In any case all data will be sourced from
direct device measurements, a
manufacturer's data sheet, or a combination of the
two.
For plot-based data, entering more
data points will provide the Wizard with a truer
'picture' of the
source data, which in
turn leads to the greater accuracy of extracted
parameter values.
When you are required
to enter plot data, simply enter a series of data
points obtained from the
graphical
source data, into the grid provided by the Wizard
(Figure 7). If you have the data stored
in comma separated value (*.csv)
format, you can import the data using the
available Import Data
button. The
Wizard will take the data you enter and use it to
extract the required model parameters.
The results of the extraction are
presented on a subsequent page of the Wizard
–
in terms of the
extracted
parameter
values
themselves,
and
a
comparison
plot
of
the
data
entered
and
values
calculated
using
the
extracted
parameters.
Figure
7
illustrates
an
example
of
such
a
display
of
parameter results.
Figure 7.
Enter source data for the Wizard to be able to
extract the required model parameters.
You can edit the extracted
parameter values to further refine the accuracy of
the diode model. The
graphical
comparison will be updated to reflect the changes.
Diode
The following sections
detail each of the characteristics that you can
choose to model for a diode
device.
Each
section
discusses
the
parameters
extracted
and
the
source
data
required
by
the
Wizard to facilitate
their extraction.
For more information
on this model type, refer to the SPICE3f5
modelsGeneralDiode section of
the
Simulation Models and Analyses
Reference
.
Forward-bias
current flow
The following parameters
are used to describe the DC current-voltage
characteristics of the diode
in the
forward-bias region:
IS
Saturation current ( in Amps).
N
Emission
coefficient.
RS
Ohmic resistance (in Ohms).
To extract these parameters, a graph of
the forward diode current (IF)
versus
the forward diode
voltage (VF) is
required. This graph can be obtained either from a
manufacturer's data sheet or by
measurements performed on a physical
device.
Figure 8 shows an example of
such a graph, obtained from a data sheet, and also
an example test
circuit, from which
direct measurements could be taken to obtain the
required source data.
Figure 8. Example graph and circuit for
diode I-V characteristics in the forward-bias
region.
Data is entered into
the Wizard as a series of data points obtained
from the source graph.
Reverse-bias
junction capacitance
The following
parameters are used to describe the capacitance of
the diode when operating in the
reverse-bias region:
CJO
Zero-bias junction
capacitance (in Farads).
M
Grading coefficient.
VJ
Junction potential (in
V
olts).
To
extract
these
parameters,
a
graph
of
the
reverse-biased
capacitance
(Cd)
versus
the
reverse
diode voltage (VR)
is required. This graph can be obtained either
from a manufacturer's data sheet
or by
measurements performed on a physical device.
Figure 9 shows an example of such a
graph, obtained from a data sheet, and also an
example test
circuit, from which direct
measurements could be taken to obtain
the required source data. The
latter
can be used if a capacitance meter is not
available.
Figure 9.
Example graph and circuit for diode capacitance in
the reverse-bias region.
Data is entered into the Wizard as a
series of data points obtained from the source
graph.
-
-
-
-
-
-
-
-
-
上一篇:【小学四年级的英语诗歌】小学生英语诗歌朗诵
下一篇:CactiEZ安装配置教程