¿ªÔÆÌåÓý

Re: Determine phase and gain margin in filter/amp


monettsys
 

--- In LTspice@..., <sawreyrw@...> wrote:

Mike,

If you only want to put one cursor on the trace up can click right or left click on the label. It works fine for me, if I set the cursor near the 0 dB point before I expand the trace. It takes only a few seconds to do it. For example it is easy to get -934.5 udB and 107.19 degrees at 9.166 MHz

Rick
Hi Rick,

Thanks for the explanation. My version only works with left click.

You really should take a look at Frank's solution. I extended the frequency range to .ac dec 1000 1m 10Meg

Two runs gave the following results:

phase_margin: v(fb)/v(inm)=(-8.38981e-007dB,55.9047) at 1.21103e+006
gain_margin: v(inm)/v(fb)=(15.3886dB,6.6374e-005) at 3.7333e+006

Date: Wed Dec 11 01:01:52 2013
Total elapsed time: 0.140 seconds.

phase_margin: v(fb)/v(inm)=(-8.38981e-007dB,55.9047) at 1.21103e+006
gain_margin: v(inm)/v(fb)=(15.3886dB,6.6374e-005) at 3.7333e+006

Date: Wed Dec 11 01:02:33 2013
Total elapsed time: 0.130 seconds.

As you can see, they are very repeatable. In fact, the second run was made with no graph, so you don't even need to plot the waveforms to get the answer!

This fulfills my wish to have a method that gives the same result for everyone. My very sincere thanks to Frank for his work.

Thanks for posting your original results. It led directly to this very excellent solution.

Mike

Join [email protected] to automatically receive all group messages.