I've designed a Type 3 compensator and wanted to see it's bode plot on matlab.
Here is the transfer function of type 3 compensator:
My values are:
wp0=203
wp1=6657000
wp2=31400
wz1=5024
wz2=5024
The code I've used on matlab is:
sys=tf((wp0/s*((s/wz1)+1)((s/wz2)+1))/(((s/wp1)+1((s/wp2)+1))));
bode(sys);
Here is my result:
As you can see here, the phase margin has a negative value but it should be positive. I can't find the problem, what's my mistake here?