10.06.2016 Views

eldo_user

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

Example 22—Extract Gain and Phase Margin of a 2-Stage Opamp<br />

• .EXTRACT—Extract characteristics from the simulator results.<br />

• .PARAM—Global parameter setting.<br />

• .STEP—Sweeping parameters.<br />

Netlist Explanation<br />

.param pCX=0.2p<br />

.step param pCX DEC 10 0.01p 1p<br />

The .STEP statement is used to observe the impact of the compensation capacitance upon<br />

stability. The .EXTRACT quantities (see below) such as phase and margins are automatically<br />

plotted versus the swept parameter, pCX.<br />

.option nobound_phase<br />

The nobound_phase option can be used if you prefer a continuous phase plot. By default the<br />

phase plots are displayed modulo 360.<br />

.AC DEC 1000 1 100E6<br />

The above specifies a .AC statement to sweep the frequency from 1Hz to 100MHz.<br />

.PLOT AC VDB(OUT)<br />

.PLOT AC VP(OUT)<br />

The above lines specify that the output response is plotted in Bode format.<br />

.EXTRACT AC LABEL=MAX MAX(VDB(OUT))<br />

The above line specifies to extract the open loop gain.<br />

.EXTRACT AC LABEL=bandwidth 'CROSSING(VDB(OUT), -3)'<br />

The above line specifies to extract the 3db bandwidth.<br />

.EXTRACT ac label=phase_margin_1 {180 + xycond(vp(OUT), vdb(OUT) == 0)}<br />

.EXTRACT ac label=gain_margin_1 -xycond(vdb(OUT), vp(OUT) < -180)<br />

The above lines show the first compact method to extract the Gain and Phase margins, using the<br />

XYCOND() function.<br />

.EXTRACT AC label=unit_gain_freq crossing(vdb(OUT), 0)<br />

.EXTRACT AC label=phase_margin_2 180 - yval(vp(OUT), 1) + yval( vp(OUT),<br />

unit_gain_freq )<br />

.EXTRACT AC label=opp_phase_freq crossing(vp(OUT), -180)<br />

.EXTRACT AC label=gain_margin_2 -yval(vdb(OUT), opp_phase_freq)<br />

The above lines show the second method to extract the Gain and Phase margins, using explicit<br />

extraction of the zero-crossing and -180°-crossing frequencies.<br />

1328<br />

Eldo® User's Manual, 15.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!