Calculate Phase Margin
Zeros – Poles
Phase margin is the phase distance from -180 degrees at the location of the cross over frequency.
The phase of a system at a radian/sec of Wc can be found as follows
$$Phase = \sum_{a=1}^n (tan^{-1}\frac{W_c}{Z_a}) – \sum_{a=1}^m( tan^{-1}\frac{W_c}{P_a})$$
Where Za is a zero placement in radians / sec, and Pa is pole placement in radians/sec poles and zeros at an origin are -90, +90 degrees of phase.
The phase margin is equal to Phase + 180.
In example if the phase at the cross over frequency was -130 degrees then the phase margin would be -130 +180 = 50.
Phase margin is used to specify stability. A phase margin greater than 0 is considered to be stable, though in practice the phase margin should be greater than 30 degrees to keep overshoot low.