MJL3281A and MJL1302A SPICE Models
Introduction: Article Contents Reflect Some Deprecated Techniques
This article was originally written in 2006 when I just started out making SPICE models. While the contents do represent the actual procedure used for parameter extraction of the downloadable models, new developments have caused some of the information provided in the article to be somewhat dated. There are two reasons for this. The first is the normal process of trying out different tools and techniques for the job, discovering the weakness of the existing tools, and trying out new ones. The second stems from the use of Massobrio and Antognetti as a reference for determining the capabilities of the models used by existing simulators. This excellent book provides lots of detailed information about the Gummel-Poon model equations, but since it was published in 1998, simulator vendors have added extensions to the models, allowing them to better represent real-world devices. This page describes some of those extensions as well as other recent developments.
In addition, ON Semiconductor have since created new models for these devices. The data presented here are from the models that were current around October 2006. So if you use the current models to try to duplicate the manufacturer's data I've presented here, your data might not match what's presented in the article.
New Techniques And Tools Not Covered By The Article
Improved Automation of the Process
Some of the parameter extraction procedures described in the article require too much human effort. These procedures require the user to adjust parameters, then run a simulation and observe the results. If they are not close enough, parameters are adjusted again, another simulation is run, and so on. This can be very time consuming and tedious. It's better to write code that implements the same equations used internally by SPICE, then use some kind of optimization algorithm to automatically adjust parameters to minimize an aggregate measure of the error between simulated and measured data (the objective function). Real-world constraints must of course be applied to the optimization process to prevent nonsensical parameter values. Automation has been improved to some extent, first by using Visual Basic for Applications within Excel, then by using Matlab. Further development is still needed.
Better Mathematical Software for the Parameter Fitting
The method described in the article used Excel to fit simulated data of β vs. I_{C}. The use of Excel was prompted by problems experienced with early attempts at using the Minerr() function of MathCad for this purpose. After the article was written, it was discovered that the problem with the MathCad Minerr() function was fixed in a more recent version of MathCad.
The method of using Excel in the article was also rather primitive in the sense that only formulas appropriate for inclusion into a spreadsheet cell were used. Later modeling exercises not described in the article used Visual Basic for Applications (VBA) to implement some of the Gummel-Poon equations that were too complex for computation in spreadsheet cells. This resulted in improved automation of the process, but two problems still remained.
- The first problem was the tendency of the Excel solver to converge on local minima of the objective function (the function to be minimized, represented by the RMS value of the differences in percent between measured and simulated β at each value of I_{C}). The symptom was widely varying solutions for the SPICE parameters depending on the first guesses for their values. The objective function for this problem apparently has a very large number of local minima, making the behavior of the optimization algorithm crucial for success.
- The second problem was the need to have one iterative procedure inside another. The main optimization process (the nonlinear curve fitting) is iterative by nature, but within that process is another iterative method requiring V_{BE} to be computed for each I_{C} and for each change the solver makes to the SPICE parameter estimates. Since root-finding in Excel requires the use of the Excel solver, and the solver can only be invoked through the Excel user interface, this makes a nested root-finding procedure impractical without writing some general-purpose root-finder oneself using Visual Basic for Applications (VBA). Given the misbehavior of the solver with local minima, this didn't seem worthwhile.
One way of solving the problem of nested iterative procedures is by using MathCad. A technique originated by Teodoro Marinucci allowed the iterative method required to compute V_{BE} from I_{C} to be used within the objective function, which was then minimized using the MathCad Minerr() function. This greatly improved the automation of the process, but unfortunately Minerr() uses the Levenberg-Marquardt algorithm for minimization. That algorithm, though more well-behaved than the Excel solver, nonetheless has problems with local minima. So MathCad was not a complete solution, and more investigation was needed regarding the behavior of other optimization algorithms.
One approach that resulted in much improved parameter fitting was to use Mathematica with its various global optimization algorithms. It was observed that greatly improved matching of simulated and measured β vs. I_{C} could be achieved, especially in the low-current region. Unfortunately, Mathematica is very quirky, and when things go wrong it's a bit of a guessing game as to how to fix the problem and have it stay fixed. My own impression of the program is that its foundation in symbolic computing gets in the way of numerical computing. I could find no way in general of getting it to revert to a purely numerical approach at all levels of the computation. The result was strange error messages concerning failed symbolic computations from deep within its algorithms. The explanation in the manual of why this occurs didn't make much sense and the recommended solution did not always work. Further, its heavy dependence on the symbolic computation approach causes it to be rather slow. I didn't want to deal with such problems, so I abandoned its use.
At present, it appears the most promising software for SPICE parameter fitting is Matlab. Global optimization algorithms are available for it, it's designed from the ground up for efficient numerical computing, and it has a robust development environment and debugging tools. Furthermore, symbolic computation is still possible with the optional Symbolic Math Toolbox. Some current modeling efforts of mine now use Matlab. Details are provided below.
Better Modeling of β vs. I_{C} At High I_{C}
The article states that the SPICE IKF parameter specifies the value of I_{C} above which the log slope of I_{C} vs. V_{BE} becomes smaller, but that the slope itself in the high-current region is fixed. While this is true for the standard Gummel-Poon model, PSPICE added a new parameter called NK which allows for this log slope to be specified. LTspice supports NK as well, though it's not documented. Recent experimentation with NK shows it to be extremely useful, even mandatory, for getting a good match of simulated and measured β at large I_{C} values. The models developed in the article required sacrificing accuracy of simulated β in the high-current region to get the best possible accuracy at more typical currents. This compromise is no longer necessary when NK is used.
Quasi-Saturation Support with Enhanced Gummel-Poon Model
Modern SPICE simulators such as PSPICE and LTspice support the Kull model for quasi-saturation. This is done as an enhancement to the Gummel-Poon model and does not require more advanced models such as VBIC or Mextram. See Figure 1 of the article for an example of quasi-saturation behavior as it pertains to the DC characteristic curves of the MJL1302A.
One interesting question raised by the use of quasi-saturation modeling is whether the VTF parameter should be scrapped when the Kull model is used. VTF models the reduction in f_{T} at low values of V_{CE}. But quasi-saturation (not taken into account in the standard Gummel-Poon model) has the same effect of reducing f_{T} at low V_{CE}. Since quasi-saturation modeling is physical and VTF is a non-physical curve-fitting parameter, this suggests that when the Kull model is used, VTF may may no longer be needed to model the f_{T} reduction at low V_{CE}. More investigation of this possibility is needed.
Modeling the Variation of Base Resistance with Base Current
Bob Cordell's audio power amplifier design book describes a useful technique for computing the parameters RBM and IRB, which model the varying base resistance with base current. This technique will surely help in getting a better match of simulated and measured V_{BE} vs. I_{C} than was obtained with the models available here.
Engauge Digitizer Software for Capturing Data Sheet Graph Data
The very useful Engauge Digitizer freeware allows the user to take a graphics file such as a .png or .gif that captures a graph from a device data sheet, obtain the numerical data at a large number of points and save it to a text file. This eliminates the pain of manually reading values from data sheet graphs while providing more data than is practical with a manual approach.
Latest Developments
Usage of Matlab and Differential Evolution Optimization for Parameter Fitting
Some preliminary software has been written in Matlab for fitting the simulated collector-base capacitance C_{CB} to the data sheet capacitance data, and for fitting the model's base-emitter capacitance C_{BE} such that data sheet values of f_{T} vs. I_{C} match simulated values. The former problem is easy for even simple optimization code, but the latter requires simultaneous adjustment of TF, FC, CJE, VJE, MJE, ITF and possibly VTF to match simulated and measured data. These routines make use of a package contributed to the Matlab Central web site by Markus Buehren, which implements the Differential Evolution algorithm for optimization. This outstanding contribution has shown itself to be the most effective solution I've yet encountered for obtaining SPICE parameters when the objective function governing the optimization contains many local minima. In the process of fitting the f_{T} data, some errors in Massobrio and Antognetti were uncovered.
Errors in Massobrio and Antognetti Regarding the Modeling of f_{T} vs. I_{C}
Equation (17) of the article, taken straight from Massobrio and Antognetti, was originally used in the Matlab code to compute the diffusion capacitance component of C_{BE} for the determination of f_{T}. An optimization was performed using those equations to set C_{BE} such that the computed f_{T} vs. I_{C} matched the datasheet. Then, upon entering these optimized parameters into the model and simulating f_{T} directly in SPICE, the results of the Matlab f_{T} computation at high I_{C} values differed from the SPICE results by a factor of 5 in one particularly bad case. Various sources of documentation I found differed on how the diffusion capacitance component of C_{BE} should be computed. After trying these formulas with no success, I finally downloaded the Berkeley SPICE source code (version 3f5) and verified that Equation (17) is indeed in error. I implemented an algorithm in Matlab identical to the one used in SPICE3, and that fixed the problem. The correct algorithm for computing the diffusion capacitance component of C_{BE} can be found in the file bjtload.c in the SPICE source code.
Modeling the Abrupt Reduction of f_{T} at High Values of I_{C}
Equation (13) of the article introduces a parameter called FC, whose purpose is to eliminate the singularity in the depletion capacitance component of C_{BE} vs. V_{BE} when V_{BE} equals VJE. For an abrupt reduction of f_{T} to occur, there must be an abrupt increase in C_{BE} as V_{BE} increases. This can be made to happen by setting the FC parameter very close to one, such that there is almost a singularity in C_{BE} vs. V_{BE} when I_{C} is in the region where f_{T} drops off abruptly. So if FC is made adjustable in the optimization, this abrupt reduction of f_{T} at high currents can be modeled quite accurately. This technique is now being successfully used in the new Matlab code.
References
[1] Kull, Nagel, Lee, Lloyd, Prendergast and Dirks, "A Unified Circuit Model for Bipolar Transistors Including Quasi-Saturation Effects," IEEE Trans. Electron Devices, vol. ED-32, pp. 1103-1113, 1985