Calculation of Phase margin
조회 수: 77 (최근 30일)
이전 댓글 표시
Please, I would like to ask a control system toolbox expert a question. Solving an exercise in which we are asked to calculate the value of the gain k which causes a transfer function G (s) = k / [s (s ^ 2 + s + 4)] to have a phase margin of 50°. The analytical calculation by hand gave me the following answer:
gain plot crossing frequency : wcf = 1.491 rad/s
The desired gain k = 3.4585
fase plot crossing frequency : wcg = 2 rad/s
Gain margin : GM=1.2634 dB
Instead the Matlab script to calculate the phase margin with this data k, gives an answer that is not the answer I expected and I can't understand why Matlab makes a different choice.
__________________________________________
% Problem_B_7_26_Modern_Control_Engineering_Katsuhiko_Ogata
clear all
clc
fprintf(' \n')
fprintf('--------------------- \n')
w=1.4910;
k=sqrt((w^4)+(w^2)*((4-w^2)^2));
fprintf('Desired gain : k=%g° \n',k)
fprintf('--------------------- \n')
fprintf('Open loop transfer function \n')
s=tf('s');
G=zpk((k)/(s*(s^2+s+4)))
fprintf('--------------------- \n')
fprintf('Figure 1 : Bode diagram \n')
figure(1)
margin(G)
grid on
fprintf('--------------------- \n')
[GM,PM,wcg,wcf]=margin(G);
fprintf('Phase margin: \t\t\t\t PM=%g° \n',PM)
fprintf('Gain margine: \t\t\t\t GM=%g dB \n',db(GM))
fprintf('Gain crossing frequency : \t %scf=%g rad/s \n',char(969),wcf)
fprintf('Phase crossing frequency : \t %scg=%g rad/s \n',char(969),wcg)
fprintf('--------------------- \n')
댓글 수: 0
채택된 답변
Paul
2022년 5월 22일
편집: Paul
2022년 5월 23일
Hi T, it's a tricky problem becase of the shape of the gain curve around the phase cross over frequency.
w=1.4910;
k=sqrt((w^4)+(w^2)*((4-w^2)^2));
s = tf('s');
G=zpk((k)/(s*(s^2+s+4)));
Let's check the stability margins of G
allmargin(G)
Sure enough, we see a 50 deg phase margin at the expected frequency of 1.491 (I don't know why it shows two gain margins at the same frequency, that seems odd to say the least). However, we see that there are two additional gain crossovers and so two additional phase margins. I think that margin() returns only the minimum of the gain/phase margins
[GM,PM,wcg,wcf]=margin(G);
PM
The Bode plot reveals reveals the three gain crossovers at 1.3487, 1.491, and 1.7198 rad/sec
bode(G,linspace(1.2,1.8,1000)),grid
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!