Gain margin is the gain of magnitude when phase reaches 180°. Phase margin is defined as the amount of phase above 180° when the loop gain crosses 0dB. The higher the phase margin, the more stable the system. The preferred phase margin is greater than 45°. The two blocks shown are commonly referred to as the modulator and the power stage. Together, they form the bode plot shown. The gain margin for the plot is 18dB while the phase margin is 15°. With a preferred phase margin of 45° or more, something must be done.