I have a closed loop system with the corresponding gain and phase plots shown below (note frequency is normalized). I am interested in identifying the phase margin and gain margin of my system.
In order to find the phase margin, I understand that I need to find how much phase lag is needed to make my 0dB gain crossing at the -180 degrees of phase.
As you can see, my system looks very silly and has very low gains. How can I find the phase margin of such a system, especially where all gains are less than 0 dB?
On the contrary, in order to find my gain margin I look at points where I have -180 degree of phase and see how much gain I would need to add to get to 0dB. In this case, I have excellent gain margin (of 40 to 50 dB or more, right?).
UPDATE: Based on the helpful comments below, I was informed that I need to be looking at the open loop system to find my phase margin and gain margin. The controller is a very simple PI controller which is attempting to control the magnitude of an electric field.
Here is a plot of the open loop frequency response:
If I am reading this plot correctly here is my take away:
Phase Margin: Looking near 0.21sample_frequency (where gain is near 0dB) it looks like I have almost no phase margin. Does this mean that 0.21sample_frequency signals may cause oscillations?
Gain Margin: Looking at 0.028*sample_frequency (where phase is near -180 degrees), it looks like I have somewhere between 5dB to 20dB of gain margin.
Am I reading the above correctly?
Thank you for reading this.