eCircuit Center |
About SPICE |
SPICE Basics | Running SPICE
| CIRCUIT COLLECTION |
SPICE Commands | SPICE Demos and Downloads |
Quick Intro to Op Amp Models
OP_NON.CIR Download the SPICE file
Op amp SPICE models vary in size from several to 100+
components. Why so many different SPICE models? That all depends if you're
looking to
simulate just the basic or the many subtle behaviors of an
op amp. If you're just getting your feet wet with op amps, the basic model
is all you need. It uses only a few components and typically simulates faster
than more complex ones (some models are so complex they can cause the SPICE
simulation to grind to a halt.) THE MODEL
There are only three connections to this op amp SPICE model: positive input - node 1, negative input - node 2 and output - node 3. No power supply connection needed in this basic model.
THE SUBCIRCUIT
defined by three cponnection: 1 (in+), 2 (in-) and 4 (vout). You can insert a subcircuits into another circuit using the "X" prefix for a component. For example, XOP1 calls subcircuit OPAMP1 into the netlist.
The XOP1 command will link main circuit nodes 1,2 and 4 with subcircuit nodes (1), (2) and (6), respectively. The node numbers of the subcircuit are independent of the main circuit. Even if the numbers are the same, SPICE renames them as separate numbers.
OP MODELS WITH POWER SUPPLY CONNECTIONS Some models include power supply connections to simulate behaviors like output voltage limits. For example,
where nodes 101 (Vcc) and 102 (Vee) have been added. BE AWARE! Various models different node orders. For example, you may see .SUBCKT
OPAMP1 1 2 101 102 6 nwhere the supply nodes appear in order before the output node 4. Simply verify that the node order in the subcircuit matches the oder in the main circuit!
THE TEST RUN
CIRCUIT INSIGHT
Run a simulation and plot the input V(1) and output V(4).
Does the output reach the voltage predicted by the gain? How long does it
take to reach 90% of final value? Try increasing R2
to 20k or 30k. Rerun the simulation and check the output. Did the output increase?
Did it respond faster or slower with bigger gain? You'll find that the response
time is influenced by three factors: the internal DC Gain (EGAIN), the
low-pass filter (RP1,CP1) and the ratio of external resistors R2/R1.
SPICE FILE OPNON.CIR - OPAMP NON-INVERTING AMPLIFIER * VS 1 0 AC 1 PWL(0US 0V 0.1US 1V) * R1 2 0 10K R2 2 4 10K XOP 1 2 4 OPAMP1 * * 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 POLE 1 (10HZ) EGAIN 3 0 1 2 100K RP1 3 4 1K CP1 4 0 15.915UF * OUTPUT BUFFER AND RESISTANCE EBUFFER 5 0 4 0 1 ROUT 5 6 10 .ENDS * * ANALYSIS .TRAN 0.1US 10US *.AC DEC 5 1K 10MEG * * VIEW RESULTS .PROBE .END 2010 eCircuit Center |
|||||||||||||||||