# What is the best way to simulate the open-loop gain of an op-amp in LTspice?

I have been trying to simulate open-loop gain to check the SPICE model in LTspice.

From what I could find out so far, there appear to be two main approaches to achieve this.

1. The example in this video breaks the feedback path to the inverting pin with an AC source (0 V DC). However, if I plot V(FB)/V(inm), I don't get the curve in the data sheet for the LT6228.

1. I can use a non-inverting op-amp configuration from this video to get an output very similar to the one in the datasheet (except the phase needs to be shifted).

Three questions that I would like to ask:

1. Is there something I misunderstood about approach 1?
2. Is approach 2 considered a good approach?
3. I recalled from one of the videos that it is recommended not to break the feedback path like the following model (inverting op-amp configuration), but I could get an output that closely matches the datasheet in terms of gain and phase. However, I also noted that the video talks about loop gain measurement, which differs from open-loop gain measurement. Regardless, I would like to check with the LTspice experts here to confirm if this can be used for open-loop gain measurement.

Thank you for taking the time to read my post.

To plot the open-loop gain of an op-amp using SPICE, you must properly bias its inputs so that its output does not rail up or down. Considering the large open-loop gain of the op-amp, it implies that you tweak an input dc source with a µV resolution to that the output lies within meaningful values. Otherwise, the op-amp will go straight to the positive or negative rail, giving a bad ac response. The below circuit does this tweaking job for you:

When SPICE initiates the .AC simulation, it calculates a dc operating point by shorting the big inductor LoL. The auto-bias loop then biases the (+) input to have a a value imposed by source $$\V_4\$$ which is 6 V in this example. It could be whatever voltage as long as it keeps the op-amp output stage away from saturation. Then, the ac source injects the stimulus via CoL and as the return is blocked by LoL, you correctly sweep the open-loop ac response of the op-amp. You can easily reproduce this circuit in LTspice of course.

It is also possible to remove the LoL/CoL low-pass filter by inserting the ac source in series with the auto-bias circuitry. Then probe the output of the op-amp with respect to the (+) pin and you have the open-loop graph as in the SIMetrix example:

• This is how it is done properly. You could also sweep the DC input to find the bias voltage for mid rail output voltage, if you dont want to set up the feedback network. Commented Oct 28, 2022 at 6:20
• Thank you, yes, I could also dc-sweep the bias source for a similar result but I like the auto-bias circuit as I can change the op-amp operating point - or that of another open-loop system by the way like a power converter average model - and the bias is automatically adjusted. And this is cool : ) Commented Oct 28, 2022 at 7:09
• Yes if youre working with the opamp model itself, it would quickly get trivial to adjust the dc bias manually every time :) Commented Oct 28, 2022 at 7:50
• Thank you for sharing! I went with something similar eventually to perform the open loop gain analysis, but I will try your approach. @VerbalKint But if I use a ±5 supply for example, would V4 be set to 0V? Commented Nov 1, 2022 at 7:57
• @kenearl, with pleasure : ) You can keep the same positive bias if you wish, like 2 V for +/- 5-V supplies, no problem. Commented Nov 1, 2022 at 8:27

You can use @Verbal Kint's method, which is the tried and tested way in SPICE but, since you're already using LTspice, you can take advantage of its undocumented feature of having a two-valued resistor:

In .AC, R1 will have a 1G value, while in .TRAN it will have 19k. Optionally, you can also set R2 to have an appropriate value in .AC, but here, since the Avol=135 (typical value), you won't gain too much. Alternatively, you can set R1 to have an .AC value of 1T, and then you've more than covered the necessary range but, be careful, in SPICE, the recommended maximum ratio of two adjacent elements in the matrix is 1e12, because it's a numeric solver, after all, and its underlying data format is double, meaning around 1e16 range (so keep a few decades for precision losses). Or you can use the alternate solver (Control Panel > SPICE > Solver drop-down menu).

• Now I see I used a 3.3 V supply, but the datasheet specifies it at 5 V -- you'll get the same graph, anyway. Commented Oct 28, 2022 at 8:09
• Hello a concerned citizen, this is a neat feature that I ignored in LTspice, thank you for unveiling it! Chris Commented Oct 28, 2022 at 9:40
• @VerbalKint It does come in handy. Fortunately, LTspice also allows direct connection (probably other SPICEs do), like in V.V.T's answer but, given the way the OP tried to perform the analysis, I thought it's more of a job "without extracting from the context" type. Eh, the wonderful world of SPICE... Commented Oct 28, 2022 at 16:53
• Thank you for sharing this approach. This looks wonderful and easy to follow. The ac option is nice and overcomes the input bias issue. Commented Nov 1, 2022 at 7:54
• @kenearl Reading again, now, I probably have to say it differently: the operating point will still be calculated using the first value, but the actual .AC analysis will be performed with the second one. Just to be clear(er). Commented Nov 1, 2022 at 12:50

After having done some research and examined a body of literature I come to the conclusion that the most detailed method to simulate the open-loop gain of op-amps should follow the industry-accepted NULL method for operational amplifier testing used in mass production of the devices. Is this method the best way, depends on what criteria you use to define "the best way": availability, implementation difficulty, reliability etc. But what is certain, it is the most detailed method. This method permits to measure not only open-loop gain, but all the other parameters also.

So, NULL method: "a method of measurement in which an unknown quantity (as of electric current) is compared (as in a Wheatstone bridge) with a known quantity of the same kind and found equal by zero response of the detector" (Merriam-Webster dictionary, definition).

This method is recommended as a measurement technique by op-amp datasheets of many manufacturers. The method described in the accepted answer can be interpreted, with some inventiveness, as a null method. For the successful implementation of the NULL method when doing measurements and simulations with op-amp circuits, I recommend you to study the circumstantial account by authors with the Gunma University, Japan and ROHM Co., "Simulation Evaluation of Null Method for Operational Amplifier Testing".

The source being respected, I add, for readers' convenience, some exerpts and drawings from the article.

The operational amplifier has differential inputs with high impedance, a single-ended output with low impedance, and an extremely high gain. Accurate performance measurement is demanded in high precision analog circuits. However, there is a problem that the high open loop gain prevents accurate performance measurement such as the minute voltage error generation at the amplifier input due to the influence of peripheral circuits / environments (noise, thermal electromotive force by Seebeck effect, GND return current). Therefore, we have confirmed the operation of the NULL method circuit 1 using SPICE simulations, where the amplifier under test itself measures by using the servo loop to force the amplifier negative input voltage to zero potentiall, and discuss the appropriate selection of capacitor values in the NULL circuit method. In addition, we notice that we describe experiments on this NULL method circuit in [6], and also the DC-AC conversion technique that realizes a high accuracy test of a minute offset voltage in a short time using multi-channel measurement in [7].

2. Basic Operational Amplifier Measurement Circuit The operational amplifier measurement circuit using the NULL method is shown in Fig. 1. The auxiliary operational amplifier is used as an integrator to form a stable loop with extremely high DC open loop gain.

4.3 Open Loop Gain (AOL) Table 2 shows open loop gain characteristics simulation results for the circuit in Fig. 8, where a square wave of 1Vp-p and 1Hz is provided to the negative terminal side of the operational amplifier used as an integrator for the load resistance RL of 2kΩ, 10kΩ and 100kΩ. ...

• I think the problem extends to all those cases where you need to check the open loop gain when you can't simply extract the DUT from the closed loop. Otherwise, sure, this is the usual way to do it, no need to complicate with self-biasing methods, or doubly-valued resistors. Commented Oct 28, 2022 at 10:26
• @V.V.T Thanks for commenting. I apologise if my poor formatting made it hard to read; I understand they are of different configurations. The noninverting and inverting closed-loop config gave me a similar open-loop gain response to the datasheet, so I wasn't complaining about them. As for the 1st circuit tutorial, the video suggested that it was for open-loop gain analysis, even if it's using a noise gain method, as you pointed out. If all three approaches could be used for open-loop gain analysis, why is circuit 1's response so different? Or is the tutorial talking about a different thing? Commented Nov 1, 2022 at 10:23
• My post is an answer, not a comment. As for your dissatisfaction with a suggestion made in Analog Devices's educational video, ask the tutorial author, if available, or post a question to their forum Ask Engineer. Only first verify the simulations of your question, they are a complete mess, and not because of a "poor formatting". Anyway, you have accepted the answer, so ask a new question, if you have any. Commented Nov 2, 2022 at 5:30
• @V.V.T Sorry poor choice of word. But I don't quite get why they are a mess, if you could indulge me, please explain to me, so I can learn. The last two circuits' response looks quite similar to me. The 1st circuit I know now is not meant for open loop gain but for loop gain measurement. Thank you. Commented Nov 2, 2022 at 11:42
• It seems that this technique can be used, at least with a caveat emptor stipulation: trust-but-verify. Verify, especially for opamps with the frequency characteristics posing a threat to circuit stability. But, for now, I cannot imagine a scenario where this technique would fail. Even for the reason of numerical precision limitations, which are unlikely. Thank you for communication. Commented Nov 3, 2022 at 9:42