eCircuit Center 
Op Amp Model 
About SPICE 
SPICE Basics  Running SPICE
 CIRCUIT COLLECTION 
SPICE Commands  SPICE Demos and Downloads 
SlewRate Using LIMITCIRCUIT IG1 = LIMIT( K1*V(1,2), IG1max+, IG1max)
OP_SLEW_LIMIT.CIR Download the SPICE file I'm amazed at how many different flavors of op amp SPICE models have been created. Each one built with its own philosophy, emphasizing one or more factors: performance, ease of use, understandability, compactness and/or convergence. None the least are the many paths to creating slewrate behavior. The one discussed here seems to be the simplest to understand and easiest to calculate.
SLEW RATE Slewrate defines the maximum rate the op amp's output voltage can change. What defines this maximum? Inside the op amp, the input differential amplifier stage has a maximum current output, Iomax. During a big input voltage change, the diff amp gives up all its current into the compensation capacitor C which charges according to
The slew rate defines its max rate of voltage change over unit time
In our SPICE model, Iomax will be represented by IG1max.
SPICE MODEL With just three components  G1, R1 and C1  you can model openloop gain, bandwidth and slew rate. Here's an example netlist.
The key component is the the LIMIT function inside current source G1. The LIMIT syntax is simply
For the Op Amp Model, we can fill in a few details concerning
transconductance gain
How do calculate these components? First, choose G1's max current. IG1max = 1 mA Next, calculate C1 to achieve your slew rate. C1 = IG1max / Slew Now, find the location of the pole fp1 based on the op amp's unity gain frequency fu and the open loop gain Aol. Then, use C1 to calculate R1 to make it happen.
fp1 = fu / Aol Finally, calculate G1's gain K1 to achieve the open loop gain Aol working into R1. To do this, first write the output voltage at V(10)
Or write it as the open loop gain, Aol = V(10) / V(1,2) = K1 · R1. and then solve for K1. K1 = Aol / R1 As an example, suppose you need to model an op amp with the following specs.
Let's crunch the numbers.
EXCEL FILE Here's an Excel file to help you calculate the SPICE model values. Op_Amp_Slew_LIMIT.xls.
ROAD TEST Let's use the noninverting amplifier to test drive our op amp SPICE model,
OPENLOOP AC RESPONSE To open the loop, remove R2 by placing a "*" in front of the R2 statement. R1 = 10 kΩ grounds the negative input.
Run an AC Analysis and plot the output V(3). How does the SPICE model perform? Does the openloop response show a gain at low frequencies of Aol = 1e6 V/V? See if the gain falls to 0.707 of max amplitude at fp1 = 10 Hz. To get a better view, change the YAxis Settings to a log scale. And finally, does V(3) drop to unity at fu = 10 MHz? So far so good! Now let's check the slew rate. CLOSEDLOOP RESPONSE Place R2 back into the circuit by removing the "*" at the beginning of the statement. VS generates a 5 V square wave. Run a Transient Analysis and plot the input V(1) and output V(3). With R1 = R2 = 10 kΩ, the noninverting gain is 2 V/V. For a 5 V input, how fast does the output reach 10 V? For a slewrate of 20 V/μs, you should get to 10 V in 0.5 μs.
CIRCUIT INSIGHT
During the slewrate limited
interval, check the peak current from G1 by
plotting
SIMULATION NOTES Check out using the TANH function to model slew rate, see
Tanh Slew Rate.
SPICE FILES Download the file or copy this netlist into a text file with the *.cir extension. OPAMP_SLEW_LIMIT.CIR * * SIGNAL SOURCE VS 1 0 AC 1 PWL(0US 0V 0.01US 5V ) * NON INVERTING R1 0 2 10K R2 2 3 10K XOP1 1 2 3 OP_ILIMIT1 RL1 3 0 100K * * OP AMP MODEL  I LIMIT *************************** * In+ In Vout .SUBCKT OP_ILIMIT1 1 2 82 * * INPUT R RIN 1 2 1000MEG * * INPUT STAGE: GAIN, POLE, SLEW G1 0 10 VALUE = { LIMIT( 3.142e3*V(1,2), 0.001, 0.001) } R1 10 0 3.183e8 C1 10 0 0.00005uF * * OUTPUT STAGE EOUT 80 0 10 0 1 ROUT 80 82 10 .ENDS * * ANALYSIS ************************************* * .TRAN 0.05US 5US 0 0.025US *.AC DEC 20 0.1 1000MEG .PROBE .END
© 2009 eCircuit Center

