Overview
Vmodel2 is a tool which extracts Berkeley SPICE model parameters from
a 20point description of one or more of the device characteristic curves.
It uses a combination of this information and some device data sheet parameters
to fit the equations describing the performance of the device to the curves
entered by the user. The variables to the equations are the SPICE model
parameters, which are adjusted for the best fit.
AccuracyThe equations used internally by Vmodel2 are exactly the same ones used by the SPICE simulator when evaluating the voltage/current characteristics of semiconductor primitives. Thus, it is guaranteed (provided convergence is achieved) that simulating the semiconductor using the extracted parameters will recreate the same curves. This statement is subject to qualification. All parameter extraction routines rely on a reasonable guess as to the values of the parameters being extracted. The guesses are then incremented or decremented in such a way as to minimise the error between the curve as seen, and the curve as recalculated using the new parameter value. Thus, it is possible for two sources of error to influence the results. Firstly, not all parameters cause the same percentage change in the curve shape for a given percentage change in the parameter. Therefore, some parameters can be varied quite wildly without affecting the result, while others cause drastic changes with a very small change. In the former case, it may mean "close enough is good enough", where the final solution falls within the measurable error limits. In the latter, it may result in a failure to converge, if the initial guess is not accurate enough. Secondly, it occasionally happens that two parameters are being simultaneously fitted which have opposing effects on the curve. For example, if the equation y = (a / b) * cis being fitted for 'a' and 'b', then any pair of values giving the correct ratio will be deemed to be correct. Fortunately, few SPICE model parameters appear in the characteristic equations in this form. Where it does occur, the software solves for the ratio, not the individual parameters. Although this underlines the importance of a reasonably accurate guess for the starting values of parameters to be extracted, a safety net has been included to help with cases where no obvious starting values can be found. CONVERGENCEAll semiconductor characteristic curves are defined by an equation which needs to vary two or more parameters to fit the curve. Each parameter numerical entry box has associated with it a pushbutton, which determines whether that parameter is used in the fitting process. Thus, if the value of a particular parameter is known (perhaps from measurement), then it may be left constant, while the remaining parameters are fitted. Additionally, if the results of fitting all parameters give values which are obviously wrong, then the fitting may be performed one by one, until reasonable results are obtained. It is extremely unlikely that misconvergence will occur if the input data and the parameter starting values are of reasonable accuracy. If the algorithm fails to converge, it is usually due to the fact that the curve as entered does not conform to the equations used by SPICE. This in itself is not a problem, unless too many slopes are reversed, in such a way that a change of sign within the equation cannot compensate for this.
InvocationVmodel2 is invoked by typing:
Vmodel2The default size for the frame is smaller than that used for Vspice3 or GEX, so that Vspice3 can be left running simultaneously, to examine the results of the fit. There are two means of data entry. One relates to the Pushbutton menu, and one to the Data Entry Menu.
Pushbutton MenuThe number of pushbuttons varies with the device type, and data is entered by selecting a button and, when it has depressed, typing the data on the prompt bar, where it will be echoed. When the carriagereturn is pressed, the pushbutton will reset, and the entered data will be entered on it. Note that for all functions, numeric data entry is completely freeform, and follows the same rules as SPICE. This means that "1m", "0.001" and "1E3" all mean the same. Some pushbuttons have a toggle function so that selecting, for example, the polarity of a transistor, requires no typing on the part of the user. Each press of the button causes the entry to switch from "NPN" to "PNP" and back again.
Data Entry MenuThis appears whenever a "FIT" function is selected from the Pushbutton Menu. Its function is to permit entry of XY data point values from semiconductor characteristic curves, and to permit entry of starting guesses for parameters to be extracted. The graphical frame is divided into an upper and lower area, both containing numeric entry boxes. The upper four boxes are identified by the names of the parameters being extracted. Each box has an associated pushbutton which determines whether the parameter is fixed, or is to be calculated. Before the curvefitting is started, the user must enter a guess for the value of each parameter, and select the pushbuttons of those to be fitted. The lower part of the frame contains pairs of numeric entry boxes labelled from X0 to X19, and from Y0 to Y19. These boxes are for userentered characteristic curve data, derived from a data sheet or from measurements. In practise, there is default data for every characteristic curve stored in the software and, on selection, all boxes contain this data. The purpose of this is to provide a means of familiarisation. Note, however, that not all the data came from the same device so that, for example, the output characteristic data for the BJT is that of a BC108, whereas the hFE/IC data is that of a 2N2222. In the case of terminal capacitances, where is no voltage/capacitance curve available, the entry of a single value and its measurement voltage will cause the zerobias value to be calculated according to the Meyer equation, with the default exponent of 0.33. STARTING THE ITERATIONAlong the lower bar of the frame, are two pushbuttons. The one marked "COMPUTE" starts the iteration process. During iteration, the current "best fit" values for the parameters being fitted are displayed in the uppermost four numeric entry boxes. Clearing The DataAlong the lower bar of the frame, are two pushbuttons. The one marked "CLEAR" clears all XY data, both from the numeric entry boxes, and from the internal data structures. This is to save having to backspace over the existing data before entering new numbers. The default starting values are not cleared, in case the user needs a prompt for a typical starting value.
OutputIn order to examine the quality of each fit, an ASCII file called "fit.asc", in Berkeley format, is generated after each "FIT" operation, and contains two curves. One is the original data, as entered by the user, and the other is the prediction of the shape of the curve using the final values of the model parameters generated by the fitting process. When the user is satisfied with the fit of the curve, and the final values of all the parameters, "WRITE" should be selected from the menubar, which will cause the SPICE .MODEL card to be written to the local file "models". Main Menu Bar
Exits gracefully.
Appends a .MODEL card into the local file "models". If the file does not exist, it is created. The .MODEL card is that of the currently active device, i.e: that which was last selected from the menu bar. The purpose of this function is to permit the reading in of semiconductor characteristic curves from a file, instead of entering the data manually. First, an appropriate FIT function must have been selected, such that the data entry boxes are displayed. The function prompts for a file name, which must be the name of a Berkeley format ASCII file (as used for all Vspice3 utilities), to be entered on the prompt bar. The ASCII file is read and the numerical data from the first two columns is entered as X and Y axis data, respectively, into the data structures. Since Vmodel2 only needs 20 data points, only the first 20 are loaded into the internal data structures. Displays the diode menu. At the present moment, no diode characteristics can be fitted, despite appearances to the contrary. Displays the Bipolar Junction Transistor menu. This must conform to Berkeley SPICE rules. It must not begin with a digit, and must be no more than 8 characters long. The polarity toggles with each selection, from one to the other. This parameter is used to calculate the reverse transit time (tR). It is usually only quoted for switching transistors, and if unavailable, a value of 1.5 / (fT * 2PI) is uaually adequate. This selects the device Energy Gap. The display toggles with each selection, from one to the next. This value is used to estimate RC and RE, in conjunction with the saturation current (below). If an output characteristic is available, then the value should be taken at a point high up the VC/IC curve, before the nonlinearity begins. This value is used to estimate RC and RE, in conjunction with the saturation voltage (above). If an output characteristic is available, then the value should be taken at a point high up the VC/IC curve, before the nonlinearity begins. From the VBE/IC curve, the device saturation current is estimated, according to the following relationship: IS = IC / (exp(Vbe/Vt)  1) Its value is used for all the FIT functions. However, it is noncritical, and a pair of Vbe : IC values giving IS = 1E16 is a good default. From the VBE/IC curve, the device saturation current is estimated, according to the following relationship: IS = IC / (exp(Vbe/Vt)  1) Its value is used for all the FIT functions. However, it is noncritical, and a pair of Vbe : IC values giving IS = 1E16 is a good default. The Meyer voltage/capacitance equation is fitted to the usersupplied data, of Cib vs VBE, to calculate the emitter capacitance at zero bias, (CJE). Both the exponent (MJE) and the diode voltage (VJE) are calculated to achieve the best fit to the data. The Meyer voltage/capacitance equation is fitted to the usersupplied data, of Cob vs VCB, to calculate the emitter capacitance at zero bias, (CJC). Both the exponent (MJC) and the diode voltage (VJC) are calculated to achieve the best fit to the data. Four parameters may be either simultaneously, or individually fitted to the usersupplied data of hFE vs IC: a) IKF High current beta rolloff current The starting value for this may be obtained from either the curve of hFE/IC, where it is the current where hFE falls to 0.74 of its peak value, or by taking 0.74 of the current at which the maximum value for hFE is quoted by the manufacturer. b) BF Maximum current gain This is not equal to hFE, but is a theoretical maximum which would have occurred without low or high current roloff. A good starting value for iteration is 1.5 times the peak hFE value. c) ISE Emitterbase diode saturation current This parameter, in conjunction with NE, determines the low current rolloff point, according to the relationship: IL = IS . (ISE.BF / IS) ^ (NE/(NE1))The value of IL is very critically dependent on both NE and ISE. d) NF/NE Ratio of emission coefficients of CB/BE diodes If NF has not been previously fitted, its value is taken as unity (which is very close to the truth, in most cases). For small and medium devices, the hFE/IC characteristics are measured at a collectoremitter voltage of around 10 volts. This parameter is always specified, and should be entered here. The data entered here should be from the graph of transition frequency vs collector current, AFTER THE PEAK. From this data, we calculate the forward transit time, tF. The parameter tF only affects fT at high frequencies, while at low frequencies, the falloff of transition frequency is caused by the collector timeconstant. This is the reason that only the HF end of the curve should be entered. The parameters fitted by this function are TF XTF ITF VTF, which determine the variation of the BJT's transition frequency with collector voltage and current. Note that it is preferable to have fitted for IKF before attempting to run this function, since ITF and IKF are related. The value of voltage used for the fT measurements must be entered, as it is related to VTF. Three parameters may be either simultaneously, or individually fitted to the usersupplied data of VCE vs IC. In practise, it has been found that it is better to first fit for VAF and NF and, when these are found, to fix them and fit for ISC. It is best not to use a linear X increment when describing the output characteristic. The points of inflection should be sampled quite closely, while the horizontal part of the characteristic is adequately described by, perhaps, three points. The fitting function attempts to extract four parameters which, between them, describe the entire curve. However, the fastchanging parts of the characteristic are more critical to achieve an overall bestfit than the steady parts.
The value of this parameter may be determined from the slope of the output characteristic. It is numerically equal to the intercept on the voltage axis found by extrapolating the tangent to the horizontal part of the curve beyond zero. Although negative, its value is treated as positive by SPICE, and should be entered as such. The default starting value is unity, but values of between 20 and 200 are more usual.
This parameter should be fitted after NF and VAF have been determined.
The default value of NF is unity, and represents the case where the VC/IC characteristic at low current rises fairly linearly. A value of NF greater than unity will cause the rise to be delayed by a certain voltage. It is essential to have the correct value for the base current at which the above curve was measured. The default is 400uA, which represents a midrange value for the transistor in question.
This must conform to Berkeley SPICE rules. It must not begin with a digit, and must be no more than 8 characters long. The polarity toggles with each selection, from one to the other. This parameter is used to estimate starting values for fitting parameters used internally. The value is noncritical. This parameter is used to estimate starting values for fitting parameters used internally. The value is noncritical. This value is used to estimate RD and RS, in conjunction with the "on" current (below). If an output characteristic is available, then the value should be taken at a point high up the VD/ID curve, before the nonlinearity begins. This value is used to estimate RD and RS, in conjunction with the "on" voltage (above). If an output characteristic is available, then the value should be taken at a point high up the VD/ID curve, before the nonlinearity begins. The entered value is transferred unchanged to the .MODEL card The entered value is transferred unchanged to the .MODEL card The Meyer voltage/capacitance equation is fitted to the usersupplied data, of Ciss vs VGS, to calculate the gatesource capacitance at zero bias, (CGS). The diode voltage (PB) is calculated to achieve the best fit to the data, but the exponent is fixed internally by SPICE at 0.5, so this cannot be varied. Note that the relationship used to determine the internal capacitances is: CGS = Ciss  Crss CGD = Crss So, for meaningful results, both sets of data should be entered before either is fitted. The Meyer voltage/capacitance equation is fitted to the usersupplied data, of Crss vs VGS, to calculate the gatedrain capacitance at zero bias, (CGD). The diode voltage (PB) is calculated to achieve the best fit to the data, but the exponent is fixed internally by SPICE at 0.5, so this cannot be varied. Note that the relationship used to determine the internal capacitances is: CGS = Ciss  Crss CGD = Crss So, for meaningful results, both sets of data should be entered before either is fitted. Some data sheets only provide a transfer function, and no output characteristic. This fitting function uses the same equations as that fitting the output characteristic to derive the same parameters. The value of VDS used when measuring the transfer function should be entered here. It is best not to use a linear X increment when describing the output characteristic. The points of inflection should be sampled quite closely, while the horizontal part of the characteristic is adequately described by, perhaps, three points. The fitting function attempts to extract four parameters which, between them, describe the entire curve. However, the fastchanging parts of the characteristic are more critical to achieve an overall bestfit than the steady parts. The value of VGS used when measuring the output characteristic should be entered here.
This must conform to Berkeley SPICE rules. It must not begin with a digit, and must be no more than 8 characters long. The polarity toggles with each selection, from one to the other. This parameter is used to estimate starting values for fitting parameters used internally. The value is noncritical. This parameter is used to estimate starting values for fitting parameters used internally. The value is noncritical. This value is used to estimate RD and RS, in conjunction with the "on" current (below). If an output characteristic is available, then the value should be taken at a point high up the VD/ID curve, before the nonlinearity begins. This value is used to estimate RD and RS, in conjunction with the "on" voltage (above). If an output characteristic is available, then the value should be taken at a point high up the VD/ID curve, before the nonlinearity begins. SPICE uses a fixed capacitance for both junction capacitances, so no fitting is performed. However, it frequently happens that a data sheet will quote the junction capacitance at a given value of voltage. This is used, in conjunction with the value, in Meyer's Equation, to back calculate the value at zero bias. Since the calculations are performed simultaneously, only one value of voltage will be used for both. SPICE uses a fixed capacitance for both junction capacitances, so no fitting is performed. However, it frequently happens that a data sheet will quote the junction capacitance at a given value of voltage. This is used, in conjunction with the value, in Meyer's Equation, to back calculate the value at zero bias. Since the calculations are performed simultaneously, only one value of voltage will be used for both. SPICE uses a fixed capacitance for both junction capacitances, so no fitting is performed. However, it frequently happens that a data sheet will quote the junction capacitance at a given value of voltage. This is used, in conjunction with the value, in Meyer's Equation, to back calculate the value at zero bias. Since the calculations are performed simultaneously, only one value of voltage will be used for both. The measurement voltage used for Coss, Ciss and Crss should be entered here. Note that the following relationships are used to determine the device's actual capacitances: cgd = crss cgs = ciss  crss cds = coss  crss So, for meaningful results, there should be a value entered for all three parameters. Some data sheets only provide a transfer function, and no output characteristic. This fitting function uses the same equations as that fitting the output characteristic to derive the same parameters. It is essential that the correct value be entered here, so that the fit of the output characteristic gives the correct parameters. It is best not to use a linear X increment when describing the output characteristic. The points of inflection should be sampled quite closely, while the horizontal part of the characteristic is adequately described by, perhaps, three points. The fitting function attempts to extract four parameters which, between them, describe the entire curve. However, the fastchanging parts of the characteristic are more critical to achieve an overall bestfit than the steady parts. It is essential that the correct value be entered here, so that the fit of the output characteristic gives the correct parameters.
BUGS and OMISSIONS
Note:
The source code for this application is available for an extortionate fee...
