Keywords: PSPICE modeling op amps, op amp SPICE models, non-ideal op amp simulation, circuit analysis, opamps, opamp
Related Parts |

APPLICATION NOTE 1947

Abstract: Analyzing circuits numerically doesn't mean you have to buy an expensive simulator. With the capabilities of Microsoft® Excel, commonly available on engineers' computers, you can easily do many common circuit calculations. While this won't replace your favorite flavor of SPICE, it can be a powerful tool to solve a dedicated problem or gain intuition.

The equation for Z

The equation for Z

"=COMPLEX($B$3,1/(2*PI()*$A7*$B$4),";-j";)".

The first parameter is the real part, the second parameter is the imaginary part, and the "j" specifies the standard engineering complex notation where j = √-1. The third and fourth columns use the functions IMABS and IMARGUMENT to convert the complex value in the Z

As expected, the impedance of this circuit is very high and capacitive at low frequencies and decreases to a value equal to the resistance at high frequencies. You can get a quick feel for the effectiveness of a particular bypass capacitor with this kind of analysis.

We can get the values of the op amp's open loop gain, A

The only tricky part in entering the equations from Figure 3 to use the data from Figure 4 is remembering that instead of the '*/±' operators that Excel uses for scalar numbers we must use their complex equivalents IMPRODUCT, IMDIV, IMADD, and IMSUB. I modeled Z

(a) Uncompensated, Gain = -100V/V

(b) Gain = -100V/V, C

In this case I adjusted the feedback capacitor to flatten out the peaking at high frequencies. In other situations you may prefer to adjust for an equiripple version of flat response and extend the frequency range a little further.

Note that the feedback gain is well below one when the feedback is in-phase. The gain is also falling rapidly so that when the phase does reach zero at some frequency, off the right side of my graph, the gain will be very low (below 0.1V/V in this case). Phase margin, a stability quality factor defined as the phase when the gain reaches unity, is greater than 45 degrees. This circuit is therefore stable.

- Excel has optimization functions you can use to adjust the capacitor automatically to meet your flatness criteria.
- Excel has FFT and IFFT functions. With a little more work these circuits can also give you time domain waveform information. For the RC circuit you could analyze current glitches on a bypassed power line; for the op amp you could look at the waveform's edges and overshoot.
- You can use the random number functions (RAND and RANDBETWEEN) of Excel to simulate manufacturing tolerances and include the effects of PCB strays. Histogram plots can be used to show the results. Other Excel functions will generate random values from your choice of a wide variety of probability distribution functions.