eCircuit Center |
Op Amp Model - Level 1 |
About SPICE |
SPICE Basics |
Running SPICE |
CIRCUIT COLLECTION
|
Basic Op Amp ModelCIRCUIT
OPMODEL1.CIR Download the SPICE file One of the challenges of simulating op amp circuits is modeling the op amp itself. How is that accomplished? There's a couple of ways. You can create a circuit of many transistors, resistors and caps that closely replicate the internals of an op amp. Or, you can create a simpler model that reproduces the basic behavior of the op amp. The benefit of the simpler model is one that uses less components and typically simulates faster. As you begin to look at more complex or subtle behaviors, you can create a more complex op amp model. To simulate more complex behaviors, check out the Intermediate Op Amp Model. For a description of all available op amp models, see Op Amp Models.
OP AMP MODEL
Why a differential amp with high gain?
Why a low-pass filter?
Why an output buffer?
If you're designing a precision amplifier, you can use the model to see how open loop gain affects accuracy. If you're designing a high-speed amplifier, you can determine your circuit's bandwidth.
OPEN-LOOP FREQUENCY RESPONSE
Let’s create a SPICE model that we can take out for a spin. First, we'll specify it.
Then, calculate the components.
What about RIN and ROUT? Sometime these values can be read right from the data sheet. As a default, I typically set them to RIN=1e12 and ROUT=100 ohms. As a convenience, we'll define this op amp model as a subcircuit.
CIRCUIT INSIGHT
The op amp is driven by AC source VS. There are no feedback
resistors here – its running open-loop. Try out the model by running a
simulation and plotting the AC magnitude HANDS-ON DESIGN Suppose you need to model a faster op amp with the same DC gain but a higher unity-gain frequency fu. Choose a higher fu such as 50 MHz, then solve for a new fp1. For example,
Try out your new op amp model. Did the magnitude VM(3) hit the unity-gain around 50 MHz?
CLOSED-LOOP TEST
Then, run a Transient Analysis (Time domain) using the .TRAN statement. The op amp is driven by 1V step function defined by the PWL source in the VS statement. With R1 = R2 = 10k, the gain should be R2/R1+1 = 2 V/V. CIRCUIT INSIGHT Run a simulation and plotting the input V(1) and output V(3). You should see the output rise to 90% of its final value rather quickly (<1us). To see the exact output, place a cursor on V(3) and see how close it gets to 2.000 V. How does the DC gain (Aol) affect closed-loop gain accuracy? Start dropping the DC gain (100k) in the EGAIN statement factors of 10x: 10k, 1k, …. At what point does the output drop noticeable from 2.000 V? Try lowering the fp1 by setting RP1 or CP1 to a higher value. This should consequently lower fu and slow down the rise time. Run a simulation and check out how fast the output responds.
CURRENT SOURCE MODEL
Basically, G1’s current flows into RP1 creating V(3).
In this model, the DC gain (Aol) defined by both RP1 and KG1 (the gain of G1 in
units of A/V). The fp1 and RC calculations are the same. Let’s create the current source based model for the op amp defined above: Aol = 100k V/V and fu = 10 MHz.
Try replacing EGAIN in the voltage model with G1 and place RP1 in parallel with CP1. Adjust the values of RP1 and CP1, then rerun the simulation. The results should be identical.
PHASE SHIFT What’s the big deal about phase anyway? Turns out, the phase shift (and gain) of the signal in a feedback circuit reveals how well a circuit performs. Too much negative phase can cause an amplifier circuit to overshoot, ring or even oscillate. Knowing the phase shift will help you fix the problem. On the other hand, if you’re designing an oscillator, you’ll intentionally add the right amount of negative phase at the right frequency. More on these topics in Op Amp Feedback Analysis.
OP AMP CIRCUITS This op amp model is used inside op amp circuits in this site: Inverting Amplifier, Non-Inverting Amplifier, etc. Go ahead and turbo-charge some of the op amps by upping the Unity-Gain Frequency of the model and checking out its effect on the closed-loop bandwidth (with feedback components) of the amplifier.
SIMULATION NOTE SPICE makes three other controlled sources available: a Current-Controlled Voltage Source (CCVS), a Voltage-Controlled Current Source (VCCS) and Current-Controlled Current Source (CCCS). Check them out at the SPICE Command Summary.
RELATED TOPICS
SPICE FILE OPMODEL1.CIR - OPAMP MODEL SINGLE-POLE * VS 1 0 AC 1 PWL(0US 0V 0.01US 1V) XOP 1 0 3 OPAMP1 RL 3 0 1K * * OPAMP MACRO MODEL, SINGLE-POLE * connections: non-inverting input * | inverting input * | | output * | | | .SUBCKT OPAMP1 1 2 6 * INPUT IMPEDANCE RIN 1 2 10MEG * DC GAIN=100K AND POLE1=100HZ * UNITY GAIN = DCGAIN X POLE1 = 10MHZ EGAIN 3 0 1 2 100K RP1 3 4 1K CP1 4 0 1.5915UF * OUTPUT BUFFER AND RESISTANCE EBUFFER 5 0 4 0 1 ROUT 5 6 10 .ENDS * * ANALYSIS .AC DEC 5 1 100MEG *.TRAN 0.05US 2US * VIEW RESULTS .PROBE .END © 2002-2024 eCircuit Center |