SBOA605 October 2025 OPA323
Once the simulation profile has been created, by default the simulation profile is at the top of the hierarchy and shown as active. The active simulation profile is evaluated through PSpice > Run or keyboard shortcut F11.
The first time the simulation is run a longer wait time is expected than the subsequent runs as PSpice®-for-TI is updating the latest libraries from ti.com. A new window opens up and displays an empty plot as seen in Figure 5-8.
Multiple plots can be added by right-clicking on the plot and selecting Add Plot as seen in Figure 5-9.
In this example, the frequency sweep was performed to observe the open loop response of the circuit, seen in Magnitude (dB) and Phase (˚); therefore, two plots are added in the output window of the simulator.
Typically for the AC response of op amps, the top plot is Magnitude (dB) and the bottom plot is Phase (˚). To add the Magnitude (dB) and Phase (˚) of the relevant nets, a trace must be placed. This can be done by right-clicking on the desired plot and selecting Add Trace as seen in Figure 5-10.
A dialog window appears in which Simulation Output Variables can be selected along with “Functions or Macros.”
In this example, the required Magnitude (dB) and Phase (˚) traces are listed in Table 5-1.
| Trace | Expression Syntax | |
|---|---|---|
| Open loop response with load | Voltage at op amp output with load (in dB) | DB(V(AOL_LOADED)) |
| Loop Gain | Voltage across nets labeled "LOOP" and "GAIN" (in dB and degrees) | DB(V(LOOP,GAIN)) |
| P(V(LOOP,GAIN)) | ||
| 1/β | Ratio of open loop response with load and loop gain | DB(V(AOL_LOADED)/V(LOOP,GAIN)) |
The Trace Expression can be typed in or selected from the available options as seen in Figure 5-10. Alternatively, the traces can be copied and pasted fromTable 5-1 into the program directly if the nets have been labeled as described earlier in the document, Figure 4-17.
The output simulation window including all trace expressions are shown in Figure 5-11, the top plot is the Magnitude (dB) response and the bottom plot is Phase (˚).
In this example, the goal is to improve the phase margin. This is done by evaluating the phase margin of the open loop response and calculating compensation component from the AC response of the circuit.
PSpice®-for-TI has built in formulas, the syntax can be found in the Measurements option in the Trace sub menu, as seen in Figure 5-12.In this example, three measurements are used, PhaseMargin, XatNthY, and Max.
Select the relevant option in the Measurements window, in this example PhaseMargin is highlighted and View is selected.
The selected measurement, the description, syntax for the measurement argument, and file path are displayed in the dialogue box.
The phase margin measurement is the phase at the frequency in which the magnitude is 0dB. In PSpice®-for-TI, this is accomplished by searching a magnitude of the trace in dB, until the value level is 0, the x value (frequency) is recorded. Then the y value of the phase plot is read at that frequency.
In the defined measurement in Figure 5-14, the phase margin provided by y2 is offset by +180 degrees, this is not relevant for op amps so the measurement evaluated is offset by -180 degrees resulting in the written equation of PhaseMargin(DB(Trace), P(Trace)) -180.
Next, to find the frequency where the output of the magnitude of the op amp is 0dB and 20dB, the XatNthY measurement is used. XatNthY measurement is defined, in Figure 5-15, as the x corresponding to the given y value at an occurrence - where x is the frequency (Hz) and y is the magnitude (dB). For both of these scenarios, there are not multiple occurrences, therefore just the first occurrence is considered.
To calculate RISO compensation, the value of the capacitive load must be transferred from the schematic to the output simulation window, the implementation of this was described Figure 4-13. To include this probe at CLOAD, P(CLOAD), into an equation to be evaluated, a measurement must be applied to the probe at the parameter CLOAD. Considering the capacitive value does not change with frequency, the max measurement, defined in Figure 5-16, is used.
Table 5-2 shows a summary of the equation syntax needed for “Phase Margin,” typical "RISO,” and a conservative “RISO” value. The typical "RISO" provides a phase margin close to 45° and the conservative "RISO" provides a phase margin close to 90°. The tradeoff for a larger isolation resistor is voltage inaccuracies at the output with higher current demand (smaller resistive loads).
| Measurement | Expression Syntax |
|---|---|
| Phase Margin | PhaseMargin(DB(V(LOOP,GAIN)),P(V(LOOP,GAIN)))-180 |
| RISO (typical) | 1/(2*pi* Max(P(CLOAD))* XatNthY(DB(V(AOL_LOADED)),0,1)) |
| RISO (conservative) | 1/(2*pi* Max(P(CLOAD))* XatNthY(DB(V(AOL_LOADED)),20,1)) |
To add these measurements to the output simulation window, select Evaluate Measurement through the Trace sub menu.
The Trace Expression can be typed in, selected from the available options, or copied and pasted from Table 5-2.
The Measurement Results window displays the measurements described in Figure 5-19. The output window, which includes the plots and measurements, is displayed every time an iteration is run.