Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

PSPICE models for simulation programs. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

Computers are rapidly becoming cheaper, the speed of their calculations is growing. Excellent programs have appeared that allow radio amateurs to simulate and observe on the monitor screen processes in real devices, direct work with which would require very expensive measuring instruments. This is especially important for beginners, who, as a rule, have only a multimeter and, less often, a simple oscilloscope.

The most popular programs among radio amateurs are MicroCap 5, Electronic Workbench, PSpice (PSpice is included in the Design Center, DesignLab, OrCad-9 packages). They can always be found on laserdiscs offered by radio markets. What is missing on these disks is models of domestic and imported radio-electronic components for such programs. And this is a considerable wealth, especially if the models are prepared by professionals and verified.

Historically, the PSpice program was the first to appear - the development of the MicroSim Corporation in the early 70s. Since then, it has been intensively developed and, due to the simplicity of the input language and the reliability of the algorithms used, has become a kind of standard for such systems. Therefore, other programs use the PSpice input language. PSpice-model components or contain the core of this program. In fact, many of them are convenient shells that allow you to write a task in the natural language for radio amateurs - the language of electrical circuits. This is very convenient, since the "native" input language of the PSpice program is a text file in ASCII codes, which requires a lot of manual work, which is very laborious and often accompanied by errors.

However, there is an area where the PSpice input language is indispensable. Good high-speed component models for these programs are written in the PSpice language. In developed countries, manufacturers of integrated circuits must develop and publish PSpice models of their devices, otherwise they will not be used. There are no such traditions in Russia yet. Therefore, the existing libraries of PSpice models will certainly not satisfy radio amateurs, and the creation of their own component models can become a possible direction for amateur radio creativity. Let us show by simple examples that this is quite simple.

In order for everything to be clear further, let's deal with the terminology of PSpice.

  • Electrical diagram - a conditional graphic representation of electronic components and electrical connections between them on some kind of paper carrier.
  • A node is an electrically common connection point for the terminals of circuit components.
  • Component - a circuit unit used in the description of electronic circuits. as a rule, corresponding to the device actually produced by the industry. A component consists of its name, graphic image and model, complete with parameters.
  • A model is a mathematical description of a component that describes its operation with an accuracy acceptable for practical purposes.
  • Built-in model - a model, the description of which is defined in the body of the PSpice program.
  • Macromodel - consists of a set of topologically related components with built-in models. Within a macro model, other macro models can be used.
  • Standard macromodel - a macromodel for which a regular program is provided that is capable of automatically generating a macromodel of a component according to passport parameters. So, for example, operational amplifiers and comparators in PSpice have standard macro models.
  • Define model - set the parameters corresponding to a particular component.
  • Parameters are numerical constants that adjust the ideal model to the properties of a real device.
  • A prototype is an already existing model that is used as a source of parameters for a newly created component. Prototypes are convenient to use when creating a related group of components with a difference in only individual parameters.
  • An ideal component is a component that uses a model with default parameters.
  • Library - one or more files that contain models and macro models of components.
  • Simulation task - a text file in ASCII codes containing commands in the input language of the PSpice program.

It is clear that in order to create a component based on a built-in model or a standard macro model, you need to define their parameters. For this, there are special programs that, according to the passport parameters for a specific component, allow you to generate its model. The work is very routine, requiring detailed reference data on the components. In the published reference books on radioelements, as a rule, there is no complete information. Then you have to carry out some independent measurements or consult with manufacturers of radioelements. This process is described in detail in [1-3]. Unfortunately, in DEMO versions, such programs work with limitations, allowing you to create only diode models.

But there is a way out. There are a huge number of such models in the libraries attached to the distribution, and it is not difficult to find an analogue for domestic elements by assigning a new name to it and editing it accordingly. You can work with libraries, edit and copy models using any text editor.

In addition, for radio amateurs who speak programming languages, such as BASIC, it will not be a big problem to write their own program for calculating the parameters of PSpice models according to passport parameters. Relationships between passport characteristics and model parameters can be found in [1-3]. The author plans to create such a utility, adapted for domestic directories. It is quite reasonable to set the task of writing generator programs for such PSpice macromodels, the creation of which is not provided for in regular programs.

Another interesting task for radio amateurs would be the creation of an automated measuring attachment to a computer that would generate the parameters of PSpice models or macromodels from control samples, and even with the possibility of statistical processing. Radio amateurs have experience in creating measuring attachments that can be connected to a PC.

Resistors, capacitors, inductors, diodes, transistors, magnetic circuits, communication lines, voltage and current sources, a basic set of digital elements and some idealized elements have built-in models.

But what if there is no ready-made model of any component. Then you need to be able to develop your own macromodels. And here the possibilities of PSpice are truly endless. The first building blocks of macro models are built-in models. Due to the limitations of the journal article, we will only talk about those. which will be used in the examples.

To begin with, a little about the features of programs in the PSpice language.

  • The first line of the program is a comment.
  • Symbols "*" (asterisk) and ";" (semicolon) denote lines with comments or comments in program lines.
  • The symbol (plus) is a line break, used for long statements.
  • Symbol "." (dot) - the beginning of the line-directive that controls the modeling process.

The remaining lines refer to the description of the topology and components.

Comments play a supporting role. Directives control the course of the computational process, access to models and macromodels, and output of simulation results. Topology description lines formally define the electrical circuit of the device, indicating the connection nodes of the component pins and their models.

PSPICE MODELS AND GRAPHICS

In order to use the created Pspice model in programs that have a developed graphical shell, for example, MicroCap 5 or DesignLab, it is necessary, using the service capabilities of these packages, to include it in the existing PSpice libraries and create an appropriate graphic symbol, preferably according to GOST. Further work with the new component will be no different from the existing ones.

CREATING ANALOG COMPONENTS WITH A BUILT-IN MODEL

The parameters of analog components with an embedded model are indicated in two ways: directly about a sentence that describes the location of the component in the circuit; using the .MODEL directive, which describes built-in component models.

The general form of the model description:

.MODEL <component name> 1AKO:<prototype model name>] <model type name> ([<model parameters>=<value> [<parameter value random spread specification>]1 [T_MEA-SURED=<value>] [[ T_AB8=<value>] or [T_REL_GLOBAC=<value>] or [T_REL_LOCL=<value>]])

where: <component name> is the name of a specific device, for example: RM. KD503. KT315A;

[ACO:<prototype model name>] - definition of a model using an existing prototype (this reduces the size of the library). In the description, only the different parameters should be indicated;

<model type name> - standard name of the built-in ideal model (Table 1);

[<model parameters>=<value> [<parameter value random spread specification>]] - in parentheses indicate the list of component model parameter values. If this list is missing or incomplete, the missing model parameter values ​​are assigned by default. Each parameter can take on random values ​​relative to its nominal value, but this is only used in statistical analysis.

PSPICE Models for Simulation Programs

The parameters of many models depend on temperature. There are two ways to set the temperature of passive components and semiconductor devices. First, the .MODEL directive specifies the temperature at which the T_MEASURED=<value> parameters included in it are measured. This value overrides the TNOM temperature set by the .OPTIONS directive (default 27°C). Second, you can set the physical temperature of each device, overriding the global temperature set by the .TEMP, .STEP TEMP, or .DC TEMP directives. This can be done with one of the following three parameters: T ABS - absolute temperature (default 27°C); T_REL_GLOBAL is the difference between absolute and global temperatures (default is 0), so T_ABS = global temperature + T_REL_GLOBAL, T_REL_LOCL is relative temperature, DUT absolute temperature equals prototype absolute temperature plus T_REL_LOCL parameter value

All model parameters are indicated in SI units. To shorten the record, special prefixes are used (Table 2). It is allowed to add alphabetic characters to them to improve the clarity of designations, for example, 3, ZkOhm, 100pF, 10uF, 144MEG, WmV.

PSPICE Models for Simulation Programs

The form of describing the inclusion of a component in a circuit:

<first character + continue > list of nodes> [<model name>] <options>

A component description is any string that does not start with the character "." (dot).

The name of the component consists of the standard first character (Table 3), which defines the type of the component, and an arbitrary continuation of no more than 130 characters.

PSPICE Models for Simulation Programs

The numbers of component connection nodes in the diagram are listed in a specific order established for each component. Model Name - The model name of the component whose type is defined by the first character.

Next, the parameters of the component model can be specified.

RESISTOR

The form of the description of the inclusion of a resistor in the circuit:

R<name> <node(+)> <node(-)> [<model name>] <resistance value>

Model description form:

.MODEL <model name> RES(<model parameters>)

The list of parameters of the resistor model is given in Table. four.

PSPICE Models for Simulation Programs

Examples: RL30 56 1.3K; 1,3 kΩ RL resistor connected to nodes 30 and 56.

R2 12 25 2.4K TC=0.005, -0.0003; 2 kΩ resistor R2.4 connected to nodes 12 and 25 and having temperature coefficients TC1 = 0.005 °C-1 TC2 = -0.0003 °C-2. R3 3 13RM 12K

.MODEL RM.RES (R = 1.2 DEV = 10% TC1 = 0.015 TC2 = -0.003): 3 kΩ resistor R12 connected between nodes 3 and 13. °С-1 ТС0,015 = 1 °С-2; R is the coefficient of proportionality between the resistance value used in the simulation and the specified nominal value.

Models of a capacitor and an inductor look similar.

CAPACITOR

The form of the description of the inclusion of a capacitor in the circuit:

C<name> <node(+)> <node(-)> (<model name>) capacity value>

Model description form:

.MODEL <model name> CAP (<model parameters>)

The list of parameters of the capacitor model is given in Table. 5.

PSPICE Models for Simulation Programs

Examples: C1 1 4 10i; capacitor C1 with a capacity of 10 uF is connected between nodes 1 and 4.

C24 30 56 100pp. capacitor C24 with a capacity of 100 pF is connected between nodes 30 and 56.

INDUCTOR

The form of the description of the inclusion of the coil in the circuit:

L <node(+)> <node(-)> (<model name>] Inductance value>

Model description form:

.MODEL <model name> IND (<model parameters>)

The list of parameters of the inductor model is given in Table. 6.

PSPICE Models for Simulation Programs

Example: L2 30 56 100u; coil L2 with an inductance of 100 μH is connected between nodes 30 and 56.

DIODE

The form of the description of the inclusion of the diode in the circuit:

D<name> <node(+)> <node(-)> [<model name>]

Model description form:

.MODEL <module name> D [<model parameters>)

The list of parameters of the diode model is given in Table. 7.

PSPICE Models for Simulation Programs

Examples of models of domestic diodes:

.MODEL KD503A D (IS=7.92E-13 + RS=2.3 CJO=1.45p M=0.27 + TT=2.19E-9 VJ=0.71 BV=30 + IBV=1E-11 EG= 1.11 FC=0.5 XTI=3 + N=1.JJ)

.MODEL KD522A D (IS=2.27E-13 + RS=1.17 CJO=2.42p M=0.25 + TT=2.38n VJ=0.68 BV=50 IBV=1E-11 + EG= 1.11 FC=0.5 XTI=3 N= 1)

.MODEL KD220A D (IS=1.12E-11 + N=1.25 RS=7.1E-2 CJO=164.5p + TT=1.23E-9 M=0.33 VJ=0.65 BV=400 + IBV=1E-11 EG=1.11 FC=0.5XTI=3)

.MODEL KD212A D (IS=1.26E-10 + N=1.16 RS=0.11 CJO= 140.7p M=0.26 + TT-J.27E-8 VJ=0.73 BV=200 + IBV= 1E-10 EG-1.JJ FC=0.5 XT1=3)

.MODEL KS133A D (fS=89E-15 + N=1.16 RS=25 CJO=72p TT=57n + M=0.47 VJ=0.8 FC=0.5 BV=3.3 IBV=5u + EG=1.11 XTI=3).MODEL D814A D (IS=.392E- J2 + N=1.19 RS=1.25 CJO=41.15p + TT=49.11n M-0.41 VJ=0.73 FC=0.5 + BV=8 IBV=0.5u EG=1.11 XTI=3)

.MODEL D814G D (IS=.1067E-12 + N=1.12 RS=3.4 CJO=28.08p + TT=68.87n M=0.43 VJ=0.75 FC=0.5 + BV^11 IBV= 1 and EG= 1.11 XTI=3 )

BIPOLAR TRANSISTOR

The form of the description of the inclusion of a bipolar transistor in the circuit:

0<name> <collector node> <base node> <emitter node> [<model name>)

Model description form:

.MODEL <model name> NPN [<model parameters>); npn structure bipolar transistor

.MODEL <model name> PNP [<model parameters>'; pnp structure bipolar transistor

The list of parameters of the bipolar transistor model is given in Table. eight.

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

FIELD TRANSISTOR WITH CONTROL PN JUNCTION

The form of the description of the inclusion of a field effect transistor 8 diagram:

o"<name> <drain node> <gate node> <source node> (<model name>]

Model description form:

.MODEL <model name> NJF [<model parameters>], n-channel FET

.MODEL <model name> PJF [<model parameters>]; p-channel field effect transistor

The list of parameters of the field effect transistor model is given in Table. 9.

PSPICE Models for Simulation Programs

Examples of transistor models:

.model IDEAL NPN; ideal transistor.

.model KT3102A NPN (ls=5.258f Xti=3 + Eg=1.11 Vaf=86 Bf=185 Ne=7.428 + lse=28.21n lkf=.4922 Xtb=1.5 Var=25 + Br=2.713 Nc=2 lsc=21.2 p lkr=.25 Rb=52 + Rc=1.65 Cjc=9.92lp Vjc=.65 Mjc=.33 + Fc=.5 Cje=11.3p Vje=.69 Mje=33 + Tr=57.7ln Tf=611.5p ltf =.52 Vtf=80 + Xtf=2)

.model KT3102B NPN (ls=3.628f Xti=3 h Eg= 1.11 Vaf=72 Bf=303.3 Ne=l3.47 + lse=43.35n lkf=96.35m Xtb=1.5 Var=30 + Br=2.201 Nc=2 lsc =5.5p lkr=.1 Rb=37 + Rc=1.12 Cjc=11.02p Vjc=.65 Mjc=.33 + Fc"-.5 Cje=13.31p Vje=.69 Mje=.33 + Tr=41.67n Tf =493.4p W=.12 Vtf-50 + Xrf=2)

.model KT3107A PNP (ls=5.2f Xti=3 + Eg= 1.11 Vaf=86 Bf= 140 Ne=7.4 lse=28n + lkf=.49 Xtb= 1.5 Var=25 Br=2.7 Nc=2 + lsc=21 p lkr=.25 Rb=50 Rc= 1.65 Cjc= 10p + Vjc=.65 Mjc=.33 Fc-.5 Cje=11.3p Vje=.7 + Mje=.33 Ti=58n Tf=62p ltf=52 Vtf= 80 + xtf=2)

.model KT312A NPN (ls=21f Xti=3 + Eg=1.11 Vaf=126.2 Bf-06.76 Ne=1.328 + lse=189f Ikf=.l64 Nk=.5 Xtb=1.5 Br=1 + Nc" 1.385 lsc=66.74p lkr=1.812 + Rc=0.897 Rb=300 Cjc=8p Mjc=.29 + Vjc=.692 Fc=.5 Cje=2653p Mje=.333 + Vje=.75 Tr= 10n Tf-1.743n Itf = 1)

.model 2T630A NPN (ls=17.03f Xti=3 + Eg=1.11 Vaf=l23 Bf=472.7 Ne= 1.368 + Ise=l63.3f lkf=.4095 Xtb=1.5 var=75 + Br=4.804 Nc=2 lsc= 1.35p 1kr=.21 + Rb=14.2 Rc=0.65 Cjc=2L24p Vjc=.69 + Mjc=.33 Fc=.5 Cje=34.4p Vje=.69 + Mje=.33 Tr=50.12p Tf=1.795n ltf=.65 + Vtf=60 Xtf=1.1)

INDEPENDENT VOLTAGE AND CURRENT SOURCES

Source Description Form:

\/<name> <node{+)> <node(-)> [^C]<value> [AC<amplitude>[phase)] [<signal>(<parameters>)]

1<name> <node(+)> <node(-)> [(0C]<sign> [AC<amplitude> [phase]] [<signal>(<parameters>)]

The positive direction of the current is considered the direction from the node (+) through the source to the node (-). You can specify values ​​for sources for calculations for direct current and DC transients (default - O), for AC frequency analysis (amplitude by default - 0; phase is indicated in degrees, by default - 0). For a transient <signal>> can take on the following values: EXP - exponential source signal, PULSE - pulse source, PWL - polynomial source. SFFM - frequency modulated source, SIN - sinusoidal source signal.

Examples: V2 3 0 DC 12; voltage source 12 V. connected between nodes 3 and 0.

VSIN 2 O SIN(0 0.2V 1MEG); 0.2 V sinusoidal voltage source with a frequency of 1 MHz with a constant component of 0 V.

11 (4 11) DC 2mA; 2 mA current source connected between nodes 4 and 11.

ISIN 2 0 SIN(0 0.2m 1000); source of sinusoidal current 0.2 mA with a frequency of 1000 Hz with a constant component of 0 mA.

DEPENDENT VOLTAGE AND CURRENT SOURCES

Dependent sources are widely used in the construction of macromodels. Their use allows simple means to simulate any relationship between voltage and current. In addition, with their help it is very easy to organize the transfer of information from one functional block to another. PSpice has built-in models of dependent sources:

E - voltage source controlled by voltage (INUN);

F - current source controlled by current (ITUT);

G - voltage controlled current source (ITUN);

H - current controlled voltage source (INUT).

Form of description of dependent sources:

First character<name> <node(+)> <node(-)> <transfer function>

The first character of the name must match the source type. The positive direction of the current is considered the direction from the node (+) through the source to the node (-). Next, the transfer function is indicated, which can be described in different ways:

power polynomial: POLY (<expression>):

formula: VALUE=(<expression>):

table: TABLE (<expression>):

Laplace transform: LAPLACE (<expression>):

frequency table: FREQ (<expression>);

Chebyshev polynomial: CHEBYSHEV (<expression>).

Examples: E1 (12 1) (9 10) 100: Voltage controlled voltage between nodes 9 and 10. Connected between nodes 12 and 1 with a gain of 100.

EV 23 56 VALUE={3VSQRT(V(3.2)+ +4*SIN(I(V1)}): source connected between nodes 23 and 56, with functional dependence on voltage between nodes 3 and 2 and source current VI.

EN 23 45 POLY(2) (3.0) (4,6) 0.0 13.6 0.2 0.005: non-linear voltage source connected between nodes 23 and 45. dependent on the voltage between nodes 3 and 0 V{3.0) and nodes 4 and 6 V( 4.6). The dependence is described by the polynomial EN=0 + 13.6V3,0 + 0.2V1,6 + 0.005V3,02.

EP 2 0 TABLE (V(8))=(0.0) (1.3.3) (2.6.8): source connected between nodes 2 and 0, depending on the voltage at node 8. measured relative to common. Further, after the equal sign, the rows of the table are listed with the pair of values ​​(input, output). Intermediate values ​​are interpolated linearly.

EL 8 0 LAPLACE {V( 10)}={exp(-0.0rS)/ (1+0.rS)}; assignment of the transfer function according to Laplace.

G1 (12 1) (9 10) 0.1; voltage controlled V(9.10) current source with a transfer coefficient of 0.1.

Here it is appropriate to give examples of the designation of variables in PSpice programs: V (9) - voltage at node 9. measured relative to the common wire.

V(9.10) - voltage between nodes 9 and 10.

V(R12) - voltage drop across resistor R12v

VB(Q1) - voltage at the base of transistor Q1.

VBE(Q1) - base-emitter voltage of transistor Q1 l(D1) - current of diode D1.

1С(02) - collector current of transistor Q2.

STUDYING COMPONENT MODELS

Component models can be explored with simulation programs. Using the graphical shell, it is very easy to create a virtual laboratory for testing the static and dynamic characteristics of existing and created elements. This will make it possible to establish the degree of correspondence of their properties to the reference parameters of real components, to select analogues among models of foreign components, or to study in detail an unknown model. However, in the examples given, the capabilities of PSpice itself are used.

Let's use the .OS directive (multivariant calculation of the DC mode) of the PSpice language and build a family of output characteristics of an npn bipolar transistor connected according to a common emitter circuit (Fig. 1).

PSPICE Models for Simulation Programs

The output characteristic is the dependence of the transistor collector current on the voltage on its collector.

For various values ​​of the base current, we obtain a family of output characteristics. The calculation was carried out for the KT315A transistor (Fig. 2) and an ideal transistor with default parameters (Fig. 3).

PSPICE Models for Simulation Programs PSPICE Models for Simulation Programs

The task for modeling in text form looks very simple (Table 10).

PSPICE Models for Simulation Programs

To calculate the CVC of an ideal transistor, in the program you need to remove the asterisk at the beginning of the line (* Q1 120 IDEAL) and add it to the line (Q1 1 2 0 KT315A). It is better to write comments in the text of the program in English, or at least in Latin letters, since simulation programs usually do not support Cyrillic. In the article, comments are given in Russian for clarity.

The CVC of the D814A zener diode is similarly constructed - the dependence of voltage on current (Fig. 4, 5, Table 11).

PSPICE Models for Simulation Programs PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

Now let's use the capabilities of the directives .DC and .TEMP (temperature variation) and build a family of transfer characteristics of the KP303D field-effect transistor connected according to a common source circuit (Fig. 6, Table 12).

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

The transfer characteristic of a field-effect transistor is the dependence of the drain current on the voltage between the gate and the source. For different temperatures, it is possible to build a family of characteristics (Fig. 7), since the model takes into account the temperature dependence of the transistor parameters.

PSPICE Models for Simulation Programs

As an example of assessing the dynamic properties of models, we construct a family of frequency characteristics of the KT315A transistor at four values ​​of the collector current. The measurement scheme is shown in fig. 8.

PSPICE Models for Simulation Programs

To do this, we use the capabilities of the directives .AC (calculation of frequency response) and .STEP (multivariate analysis), compose a task for modeling (Table 13), calculate IB(Q1) and lC(Q1).

PSPICE Models for Simulation Programs

After performing the simulation, we compare the obtained results (Fig. 9) with the parameters from the handbook [4].

PSPICE Models for Simulation Programs

To do this, we will proceed as follows. The graphical postprocessor of simulation programs allows performing mathematical operations on graphs. This will allow us to plot the ratio of collector current IC(Q1) to base current IB(Q 1). As a result, we obtain the frequency response of the current transfer coefficient module of the transistor at various collector currents. Using the cursor measurement mode, we will determine the module of the current transfer coefficient at a frequency of 100 MHz. For all options, the numbers are indicated on the graphs. Having compared them with the reference book, we will see that the proposed model of the KT315A transistor, taking into account the spread, is close to reality. (According to the reference book: lh21eI = 2,5 at Ik = 1 mA, Uk = 10 V). The dependence of the frequency properties of the transistor on the collector current is also consistent with the theory and with the data given in the reference books.

In conclusion of this section, it should be said that built-in models, despite the huge number of parameters taken into account, quickly compromise themselves. Simulated semiconductor devices easily pass huge currents and withstand huge voltages.

It is enough to expand the limits of voltage and current change in the examples considered here (see Fig. 1, b) and it will become clear that the built-in transistor model does not take into account the phenomenon of breakdown of p-n junctions.

Models of resistors, capacitors, inductors and transistors also do not take into account parasitic capacitances, inductances and resistances, and this is very important when simulating the operation of a device at high frequencies.

Roughly the same can be said about other built-in models. All of them have a limited scope and, as a rule, do not take into account anything.

Hence the conclusion follows - we need more advanced models, free from these shortcomings. In extreme cases, to avoid, for example, a breakdown of transistors, it is necessary to turn on diodes with an inertialess model in parallel with the transistor junctions and an appropriate choice of the BV parameter. Parasitic effects can be taken into account by "wrapping" the built-in models with capacitors, coils and resistors.

Built-in models are a kind of building blocks that allow you to explore any modeling options. That is what they are perfect for.

Using the methods that will be discussed below, you can create efficient and perfect models of elementary components.

CREATING AND APPLICATION OF MACROMODELS

If you've ever studied programming languages, you probably know what a subroutine is. This is a specially designed program, which is repeatedly called by the main program module. In practice, this means a macro model.

Macro model description form: .SUBCKT <macromodel name> <list + external nodes>

+ [PARAMS:<<parameter name> = + <value>>] + [TEXT:<<text parameter name> + =<text>>]

<strings describing macro model schema> .ENDS

The .SUBCKT directive is the macro model header. It defines the beginning of the macromodel, its name and nodes for connecting to the external schema.

Macromodel schema description lines - a list of operators in an arbitrary order that describe the topology and composition of the macromodel.

The .ENDS directive defines the end of the macromodel body.

The PARAMS keyword defines the list of parameters passed from the description of the main circuit to the description of the macromodel.

The TEXT keyword defines a text variable passed from the main chain description to the macro model description.

Form of macro model inclusion description in the scheme: X<name> <connection nodes> [<name + macromodel>]

+ [PARAMS:<<parameter name> = + <value>)

+ (TEXT:<<text + parameter name>=<text>]

This statement determines that the macromodel described by the .SUBCKT statement is connected to the specified nodes in the schema. The number and order of nodes must match the number and order of nodes in the corresponding .SUBCKT directive.

The keywords PARAMS and TEXT allow you to set the values ​​of the parameters defined as arguments in the macro model description and use these expressions inside the macro model.

EXAMPLE OF CREATING A SIMPLE MACRO MODEL

The given example demonstrates the solution of the problem in the forehead. Radio amateurs often use digital logic to perform analog functions such as amplifying or generating signals. For detailed modeling of such devices, it makes sense to build an exact macromodel of the logic element. Consider the logical element 2I-NOT of the K155LAZ microcircuit.

When creating a macro model, you need to do the following work:

  • draw an electrical circuit of the macromodel of this element (Fig. 10):
  • assign reference designations to all elements of the circuit;
  • number all nodes (the common wire is always assigned the number 0):
  • using the operators for including elements in the circuit, describe all the components:
  • formalize the macromodel by describing it with the .SUBCKT and .ENDS directives;
  • save the macro model text in a separate file or add it to an existing library file with *.lib extension.

PSPICE Models for Simulation Programs

As a result, we get a text file (Table 14).

PSPICE Models for Simulation Programs

With this approach to creating a macro model, it is necessary:

  • the presence of a very accurate circuit of the element (or microcircuit);
  • the presence of reference parameters of the components that make up the IS.

It should be noted that there are always problems with reference parameters, especially for integral components. As for the exact description of microcircuits, it is generally rarely published, mostly you will find the simplest ones, and even then - with errors. Unfortunately, until recently, this rarely worries anyone.

However, oddly enough at first glance, the approach described above when creating a macromodel does not yet provide any guarantees for building a well-functioning model.

HOW TO CREATE A SIMPLIFIED FAST MACRO MODEL?

It is far from always that the solution of this problem in the forehead is the true way to create a good macromodel. Models built in this "method" will require a lot of computing resources and will have low speed, i.e., the calculation of the circuit will be very slow. Let's remember how many transistors on a chip modern microcircuits can have! Therefore, it is very important to be able to build simplified macromodels by replacing individual microcircuit subsystems with equivalent nodes. At the same time, the quality of the model may even improve, especially if a microcircuit of a high degree of integration is modeled.

Let's create our own simplified PSpice macromodel of the K521CAZ comparator.

Here, too, there may be extreme cases. You can, for example, implement a comparator function using a dependent source. In this case, the model will turn out to be simple and relatively fast, but it will not reflect the physics of the real device. Therefore, it is necessary to look for a compromise solution between the accuracy of the model and its speed.

Consider what the K521SAZ comparator is. It implements the function of comparing two analog signals. If the difference between the signals at the inputs is positive, the output of the comparator will be high, if negative - low. The comparison of signals is performed by a differential amplifier at the input. The output stage is implemented on an open collector and emitter transistor. This information is already enough to synthesize the simplest, but quite working model of this microcircuit (Fig. 11).

PSPICE Models for Simulation Programs

In order to fully simulate the input and output properties of the comparator, transistors are installed at the input and output. However, the differential amplifier is greatly simplified. The emitters of the differential pair use an ideal current source, in fact, it is implemented on several transistors. The interface to the output stage is made by means of a voltage controlled current source. In a real microcircuit, several transistors are also used.

Thus, when constructing this compromise model, the multitransistor nodes are replaced by simplified and idealized ones, but with the preservation of the external properties of the device. PSpice has a perfect set of tools to express any properties of real devices with sufficient accuracy for practical purposes even in more complex cases.

Let us assign positional designations to all elements of the circuit, number the nodes and describe the comparator macromodel in the PSpice input language (Table 15).

PSPICE Models for Simulation Programs

Now let's check how the resulting macromodel performs the functions of a comparator. To do this, draw a test circuit (Fig. 12).

PSPICE Models for Simulation Programs

Then we will compose a task for modeling (Table 16) and calculate the transfer characteristic of this model (Fig. 13)

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

The transfer characteristic of the comparator is the dependence of the output voltage on the voltage difference at the inputs. It can be seen from the calculated characteristic that despite the simplicity of the model, the comparator turned out to be quite efficient.

In this example, for the first time we used the macromodel of the component, describing its connection in the circuit with the line X1 (0 1 2 0 4 3) K521CAZ. Note that element names in the macro model are local and can be ignored when naming components in the external chain.

It is time to simulate some electronic assembly made on the K521SAZ comparator. for example, a precision amplitude detector (Fig. 14, Table 17).

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

The simulation results are shown in fig. 15 and 16.

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

We will call the comparator macromodel from the library file C:\USERLlB\kompar.lib.

To specify the libraries in which the models are stored, the .LIB directive is used, which must be described in the modeling task. Then it is no longer necessary to include a description of the macromodel in the text. Operator form: .LIB [<library filename^].

Keep in mind that, in general, other macromodels can be included in a macromodel. Therefore, by discarding the control directives and placing the description of the peak detector between SUBCKT and .ENDS, we get a new macromodel that contains a nested macromodel. In this way, you can very compactly compose the most complex models, if you first prepare the necessary typical nodes and store them in a separate library file.

CREATION OF MODELS THAT CONSIDER TECHNOLOGICAL DISTRIBUTION AND THE EFFECT OF TEMPERATURE ON THE CHARACTERISTICS OF COMPONENTS

The parameters of all elements have a spread and. in addition, they also depend on temperature. The life of radio amateurs would become boring without these problems, since it would be impossible to create an inoperable design from serviceable parts, guided by the correct scheme. Nature has given us such an opportunity. Simulation programs allow you to identify devices whose performance depends on temperature and on the spread of component parameters. To do this, statistical analysis is carried out by the Monte Carlo method and multivariate analysis. However, you need to have the appropriate component models.

In the built-in PSpice-models to take into account the spread and the effect of temperature, there are: "Specification of a random spread of the parameter value", "Linear temperature coefficient", "Quadratic temperature coefficient". "Exponential Temperature Coefficient". In addition, you can control the temperature of individual components using the T_MEASURED parameters. T ABS. T_REL_GLOBAL. T_REL_LOCL, which is sometimes useful.

In multivariate analysis, not only temperature can become a variable, but also almost any model parameter that can change due to any physical impact of the external environment or degradation of component parameters over time.

Obviously, if macromodels are built on the basis of such models, then they will also have a random spread and temperature dependence.

In fact, in the case of building macromodels, such a straightforward approach is completely unsuitable. As mentioned above, when building macromodels, simplifications and assumptions are fundamentally used. As a result, the scheme of the macromodel rarely corresponds to the original one. In addition, it is simply impossible for a radio amateur to trace the true thermal connections between the elements integrated in the microcircuit. Therefore, the macromodel is built from stable components, and then elements with a spread and temperature dependence are introduced in a targeted manner. But they do it this way. to display the most significant statistical and thermal properties of the simulated device. This approach is suitable for taking into account the influence of other physical influences, although it is not the only one. So. with ionizing radiation, which affects almost all parameters of the components, it is more convenient to have several copies of libraries for different doses. Then, using the .LIB directive, the entire component libraries are replaced in accordance with the received dose. The results can then be combined on a single graph.

As an example of creating and using models with a spread of parameters and temperature dependence, we will simulate a filter (Fig. 17, Table 18) used in radiotelephony, which operates in difficult climatic conditions. The temperature range is from -40 to +80 "C. In the models of all components, the parameters of technological spread and temperature instability of the main parameters are set.

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

Using the .AC, .TEMP and .MC directives, we calculate the frequency response of the filter and its variations with temperature changes and a spread in the parameters of the elements.

It is immediately clear (Fig. 18) that the characteristics of the filter strongly depend on temperature, and such a phone will work poorly. The conclusion is obvious - it is necessary to choose more stable and accurate elements for this filter in order to get a workable device.

PSPICE Models for Simulation Programs

EXAMPLE OF PROFESSIONAL MODEL BUILDING

Here are the macromodels of operational amplifiers standard for PSpice with bipolar (K140UD7, Fig. 19, Table 19) and field-effect (K140UD8, Fig. 20, Table 20) transistors at the input.

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

PSPICE Models for Simulation Programs

Note that all transistors are excluded in them, except for the input ones. This favorably affects the performance of macromodels. However, they very accurately take into account many effects that occur in a real device.

Pay attention to the massive use of dependent and independent sources. This is the main tool for the competent construction of good macromodels of complex microcircuits.

The input differential stage models the presence of a mixing current and the dependence of the slew rate of the output voltage on the input differential voltage. The Cee capacitor (Css) allows you to display the asymmetry of the output pulse of the op-amp in a non-inverting connection. Capacitor C1 and the capacitance of transistor junctions imitate the bipolar nature of the frequency response of the op-amp. Controlled current sources ga, gcm and resistors r2, rо2 simulate differential and common-mode voltage amplification. With the help of capacitor C2, connected at the user's choice, it is possible to simulate the internal or external correction of the op-amp. The non-linearity of the output stage of the op-amp is modeled by the elements din. dip. ro1 (they limit the maximum output current) and dc, de, vc, ve (they limit the output voltage swing). Resistor rp simulates the consumption of direct current by the microcircuit. Diode dp protective.

However, experience shows that languid models are not always required, because the price for this is reduced performance. It makes sense to develop a library of simplified macromodels for yourself, so as not to waste time waiting for results when you just need to "run in" the idea.

In addition, we should not forget that it is always possible to create a model that is more perfect than the standard or professional one. In our particular case, the given macromodels of the op-amp do not model all the properties of real devices and they can be improved. This applies to temperature, statistical, noise characteristics and, above all, to the input resistance. The input capacitance of the amplifier is zero because no capacitances are specified in the transistor model. Another drawback is the lack of a description of breakdown (opening of protective diodes or reversible breakdown of emitter junctions) at large closing input signals, and the list goes on.

On the basis of all that has been said, we formulate a general formal approach to the construction of macromodels of analog components.

The simplest structure of the macromodel can be represented as consisting of three blocks connected in series: the first one describes the input characteristics, the second describes the transfer characteristics (linear and non-linear distortions), the third describes the output characteristics. The transfer of information from block to block is carried out using dependent sources of current or voltage. The number of blocks, their type. distribution of functions, the number of parallel paths may be different if required by the task.

Having created a typical set of models of such blocks, it is permissible to put the creation of macromodels literally on stream.

Thus, the creation of a good model requires extensive reference material, intuition, knowledge of the physics of semiconductors and electronic devices, electrical engineering, radio engineering, microcircuit engineering, circuitry, mathematics, and programming. The task is just for radio amateurs with their indefatigable creative energy.

Literature

  1. Razevig V.D. End-to-end design system DesignLab 8.0. - M.: Solon. 1999.
  2. Razevig V.D. System of circuit modeling MicroCap 5. - M.: Solon. 1997.
  3. Arkhangelsky A. Ya. PSpice and Design Center. Part 1 Circuit modeling. Element models. Macro modeling. - M.: MEPhI. 1996.
  4. Semiconductors: transistors. Handbook Ed. N. N. Goryunova. - M. Energoatomizdat. 1985.

Author: O. Petrakov, Moscow

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

LD39100 - Series 1A LDO Regulators from STMicroelectronics 21.09.2018

The LD39100 is a powerful new LDO regulator with output current up to 1A in a small 6x3mm DFN3 package. A feature of the regulator is a good balance in all main parameters: own consumption, input-output voltage drop, output noise level, etc.

The microcircuit is produced with automotive qualification AEQ-100, which indicates the high reliability of this solution. The LD39100 can be used in a wide range of applications. At the same time, the regulator is quite attractive in terms of cost.

Technical specifications:

input voltage range: 1,5...5,5 V;
output voltage 0,8...4,5 V (for "Adjustable" version);
high output current - 1000 mA;
availability of Power Good output;
input-output voltage (saturation) 200 mV (at a current of 1000 mA);
quiescent current at idle 20 μA;
low level of output noise - only 30 microvolts;
high value of the PSRR parameter - 70 dB at 10 kHz;
DFN6 case with heat sink base;
operating temperature range -40...125°С.

Other interesting news:

▪ material absorbing carbon dioxide

▪ Self-destroying smartphone

▪ Do athletes need warm-ups?

▪ DeLorean will be produced again

▪ How England became an island

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Household electrical appliances. Selection of articles

▪ article Time is money. Popular expression

▪ article What is marijuana? Detailed answer

▪ Guayava article. Legends, cultivation, methods of application

▪ article Phase indicator. Encyclopedia of radio electronics and electrical engineering

▪ article Glasses in cylinders. Focus secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024