Feature
User-friendly model simplifies Spice op-amp simulation
A new macromodel based on data-sheet parameters allows easy model creation for new amplifiers.
By Ray Kendall, Intuitive Research and Technology Corp -- EDN, 1/4/2007
Spice users can run into two types of problems with op-amp models: They need a model that is unavailable in their Spice library, or their library model may produce inaccurate simulation results for their application conditions. This article presents a new op-amp macromodel that makes it easy for any Spice user to create a model for any op amp just by entering parameters from the data sheet. This new macromodel has several advantages over conventional models. It greatly simplifies the creation of new op-amp models, it simplifies the addition of model enhancements and features, and it is more accurate than many other op-amp models.
New op-amp models can be difficult to generate when they aren't in your Spice library or available from an op-amp manufacturer. Many Spice simulators include modeling-utility programs, but they can be difficult to use. Most op-amp models are macromodels that use simplified circuits and functions instead of transistor-for-transistor duplication of the op-amp circuit. Most of the op-amp macromodels in use today are based on a variation of the Boyle model (Reference 1). Boyle-model parameters bear no easily derivable relation to op-amp-data-sheet parameters, making new models more difficult to generate.
Available op-amp models vary widely in their implementation and can have accuracy limitations that produce incorrect simulation results for some application conditions. For example, many op-amp models incorrectly model the power-supply voltage and current, and some can even produce output voltage with no voltage applied to their power pins. Solutions to many of these problems exist (Reference 2, for example), but whether you use an op-amp model from a library or a modeling utility, you can't be sure which electrical characteristics it models accurately without extensive testing. A series of articles explains the need for validating op-amp models and some of the tests you can use for verification (references 3). through 7
Figure 1 shows a complete op-amp macromodel that uses mathematical functions instead of the Boyle-model form. This design models the characteristics that most op-amp data sheets define so that the macromodel uses data-sheet parameters for all its model parameters. This feature allows the user to build a new op-amp model just by entering data-sheet parameters. The modular form of the macromodel also makes it much easier for users to add model enhancements and features. This new macromodel overcomes many of the accuracy limitations found in some op-amp-library models. Extensive testing using PSpice demonstrates good convergence and accuracy for a wide variety of simulation types and circuit conditions. This article later describes the remaining limitations.
Figure 1 shows the PSpice macromodel schematic for a high-input-impedance op amp. This general-purpose macromodel works well for FET-input op amps. Figure 2a and Figure 2b show the macromodel-input stages for NPN- and PNP-transistor-input op amps, respectively. Listing 1 provides corresponding, ready-to-use PSpice-netlist models as subcircuits OPAMPMODH, OPAMPMODN, and OPAMPMODP. You can adapt these macromodels for use with other Spice simulators with analog-behavioral-modeling capability.
The macromodel in Figure 1, implemented in model OPAMPMODH, includes stages similar to a real op amp. Mathematical-function block ABM2I4 converts the differential input voltage into a current output as with a typical op-amp-input stage. H2 functions as an op-amp second stage, converting the current output from the first stage into an amplified voltage. Mathematical-function block ABM48 uses the arc-tangent function to model the op-amp output stage. Capacitor CC models the internal compensation capacitor and the dominant pole of the op amp. These four elements work together to model most of the important characteristics of the op amp (Reference 8). The model parameters in the mathematical functions control the macromodel's performance characteristics (see sidebar "Macromodel-parameter-selection guidelines"). Parameter AV (open-loop differential-dc-voltage gain) sets the total differential-dc-voltage gain of all the stages. Parameter FU, the unity-gain frequency, adjusts the small-signal ac characteristics by controlling the transconductance of the input stage. Figure 3 shows a plot of the macromodel-frequency characteristics with an AV of 100,000 and an FU of 1 MHz. Parameter SR (slew rate) models the maximum slew rate using the limit function to control the maximum charge rate of capacitor CC. Figure 4 shows a plot of the macromodel-voltage-follower pulse response with a slew rate of 1 MV/sec. Parameter CMRR (common-mode-rejection ratio) sets the dc common-mode gain relative to the differential gain. The macromodel produces the same relative ac characteristics for the differential- and the common-mode response. Parameters VRP (positive-rail voltage) and VRN (negative-rail voltage) control the output-voltage-swing limits. Figure 5 shows a plot of the macromodel's dc response to differential input with an AV of 100,000, a VRP and a VRN of 1V, and power of ±15V.
The simplest method of modeling op-amp stability uses the phase margin, a measure of how close the op amp is to oscillating at the unity-gain frequency. The phase margin depends on the high-frequency, nondominant poles of the op amp. The macromodel uses GP1, GP2, EP1, RP1, RP2, CP1, and CP2 to generate two identical high-frequency poles, resulting in an overall output-phase shift of 180° at the pole frequency. The capacitance values of CP1 and CP2 use equations to relate the PM (phase-margin) parameter to this pole frequency. Figure 6 shows a plot of the macromodel phase response with an FU of 1 MHz and a PM of 30°, producing a phase shift of 150°—that is, 180° minus PM—at an FU of 1 MHz. You can also adjust PM so that the macromodel matches the op-amp pulse-response overshoot.
The quiescent current of most op amps is relatively independent of supply voltage. XIQ (subcircuit ILOADB in Listing 1) determines the macromodel's quiescent power-supply current. ILOADB uses the Spice JFET model to produce a constant-current load but only if a voltage is present. The parameter IQ determines the value of the current. Voltage source ABM2 generates VR as a reference voltage halfway between the power-supply-voltage inputs. The macromodel uses VR instead of ground as a reference for the input signals. Note that the currents into and out of node VR do not affect its voltage level.
Several macromodel functions depend on the output current. Current-controlled voltage source HO measures the macromodel output current, which EI+ and EI– use to generate the IOP and ION functions. IOP corresponds to the positive (source) current of the macromodel, and ION corresponds to the negative (sink) current. GI+ and GI– use IOP and ION, respectively, to draw additional load current from the power-supply-voltage inputs, correctly modeling the splitting of output current between the power-supply rails. Figure 7 shows a plot of the macromodel's output current and supply currents with IQ of 0.5 mA.
The output stage of an op amp can produce only a limited amount of output current. This current limit is often different for positive (source) and negative (sink) output currents. To model these current limits, EIL+ and EIL– limit the positive and negative output current of the macromodel to the values set by parameters ILP and ILN, respectively. EIL+ and EIL– have no effect on the output voltage unless the output current begins to exceed ILP or ILN. When that situation occurs, either EIL+ or EIL–, depending on the polarity of the current, reduces the magnitude of the output voltage to regulate the output current to the value of ILP or ILN.
Resistor and parameter RO set the macromodel's output resistance. Voltage source and parameter VOS set the input offset voltage. R1, R2, C1, and C2, along with parameters RIN and CIN, set the input resistance and capacitance. The simple input resistance model in Figure 1 provides a good approximation for high-impedance op amps, especially FET-input op amps, but it does a poor job of modeling the input bias currents of NPN and PNP transistor inputs. The macromodel input stage in Figure 2a, implemented in model OPAMPMODN, solves this problem by using diodes D1 and D2 to model the base-emitter junctions of the NPN input transistors. XIB uses subcircuit ILOADB and parameter IB to model the input bias current entering the op-amp inputs for NPN transistors. When the inputs are below the functional range of the op amp and both of the input junctions are reverse-biased, the input bias current drops to zero, turning off the op amp. The macromodel models this characteristic using ABM3I2 for the input stage so it can sense the input bias current using HIB. When the bias current drops to zero, ABM3I2 uses the limit function to reduce its output current to zero. The macromodel-input stage in Figure 2b, implemented in model OPAMPMODP, models the corresponding input stage for PNP-transistor inputs, with the input bias current leaving the op-amp inputs.
Macromodel limitationsAll simulation models have some accuracy limitations, and this new op-amp macromodel is no exception. Though the macromodel's limitations do not cause problems for most circuit conditions, it is important to remain aware of these limitations so that you can avoid applications that produce erroneous analysis results. Op amps generally have several high-frequency poles and, often, zeros that affect the stability and phase margin, instead of the two high-frequency poles that the macromodel uses. Only the part manufacturer typically knows where the high-frequency poles and zeros are, and data sheets typically do not provide this information. In some cases, you could achieve better model accuracy for stability and overshoot by modeling all the high-frequency poles and zeros. If this level of accuracy is necessary and if you know where the high-frequency poles and zeros are, you can add pole and zero stages to the macromodel using well-documented techniques (Reference 9).
|
Op amps can operate properly only within a limited range of input voltages. This range generally includes a portion of the voltage between the power-supply rails. The NPN- and PNP-input macromodels do a good job of modeling the portion of the input-voltage range for which the input junctions are reverse-biased. The high-input-impedance macromodel places no limits on the input voltages for proper operation, unlike a real op amp.
The macromodel does not include the ability to model output variations with changes in power-supply voltage (power-supply-rejection ratio). The Arctangent function for modeling the output stage does not lend itself to modeling this characteristic. The current version of the macromodel also lacks features for modeling variations in performance characteristics with temperature and modeling of ac noise. The modular form of the macromodel lets you add these features if necessary.
| Author Information |
| Ray Kendall is a principal engineer at Intuitive Research and Technology Corp (Huntsville, AL, www.irtc-hq.com), where he designs, analyzes, and integrates high-reliability electronic circuits and systems, including numerous defense and NASA systems. He specializes in circuit simulation and modeling using PSpice. He is a licensed professional engineer and holds a bachelor's degree in electrical engineering from the University of Mississippi (University) and a master's degree in engineering from the University of Alabama—Huntsville. |
| References |
|
|
The following list describes macromodel parameters and their use:
|
















