Determining Gain Value For Stability From A Bode' Plot.

        Assume that you have the feedback control system shown below.  In this system you are using proportional control, and you have a gain, Kp, that you can adjust.  (If you are using integral control, or something else, you can still put it into this framework.)

If you have a Bode' plot for the system system being controlled (G(s)), then you can determine the gain at which the system becomes unstable.

        Here is a Bode' plot for a simple system.

To calculate the gain, do the following.