Let's calculate the phase and gain margins when K=10 and K=100. Calculations and checks by Scilab
Solution:
Let's calculate the gain table (dB)
w |
|
1 |
|
5 |
|
 |
(-20) |
0 |
(-20) |
|
(-20) |
 |
(0) |
0 |
(-20) |
|
(-20) |
 |
(0) |
0 |
(0) |
0 |
(-20) |
 |
(-20) |
0 |
(-40) |
-28 |
(-60) |
The phase table:
w |
0.1 |
|
0.5 |
|
1 |
|
5 |
|
10 |
|
50 |
 |
-90 |
(0) |
-90 |
(0 ) |
-90 |
(0) |
-90 |
(0) |
-90 |
(0) |
-90 |
 |
0 |
(-45) |
|
(-45) |
-45 |
(-45) |
|
(-45) |
-90 |
(0) |
-90 |
 |
0 |
(0) |
0 |
(-45) |
|
(-45) |
-45 |
(-45) |
|
(-45) |
-90 |
 |
-90 |
(-45) |
-121 |
(-90) |
-148 |
(-90) |
-211 |
(-90) |
-238 |
(-45) |
-270 |
With K=10 y K=100, we obtain different gain tables
w |
|
1 |
|
5 |
|
 |
(-20) |
0 |
(-40) |
-28 |
(-60) |
 |
(-20) |
6.02 |
(-40) |
-22 |
(-60) |
 |
(-20) |
26.02 |
(-40) |
-12 |
(-60) |
Between

and

the gain crossover frequency is:
We have to calculate for these values the phases. The phases of G(jw) and G1(jw) are the same.
The phase margins are:
The phase crossover frequency is:
The gain in this frequency is:
For

the gain and phase margins are positive, the system is stable.
For

the gain and phase margins are negative, the system is unstable.
Calculations and checks by Scilab:
We have to switch

for

not to have the error:
!-error 27
Division by zero...
gdb5=-40*log10(5);
a(1)=-90-45*log10(0.5/0.1)
a(2)=a(1)-90*log10(1/0.5)
a(3)=a(1)-90*log10(5/0.5)
a(4)=a(1)-90*log10(10/0.5)
a(5)=-270
k=[10 100]
aux=20*log10(k/5)
wcg=10^(log10(k/5)/2)
awcg(1)=a(1)-90*log10(wcg(1)/0.5)
awcg(2)=a(1)-90*log10(wcg(2)/0.5)
margenf=180+awcg
wcf=0.5*10^((180+a(1))/90)
margeng=-(aux-40*log10(wcf))
s=%s/(2*%pi);
for i=1:2
g=k(i)/((s+0.000000000001)*(s+1)*(s+5))
gs(i)=syslin('c',g);
[mg(i),fcf(i)]=g_margin(gs(i))
[mf(i),fcg(i)]=p_margin(gs(i))
end;
Results
fcf =
2.236068
2.236068
mg =
9.5424251
- 10.457575
fcg =
1.2270639
3.9072806
mf =
25.389823
- 23.65036