Chapter7.2: Application of MATLAB in frequency method and stability analysis of frequency method

This series of blogs mainly describes the application of Matlab software in automatic control. If you have no theoretical basis for automatic control, please learn the series of blog posts on automatic control first. This series of blogs will not explain the theoretical knowledge of automatic control in detail.
Links related to the theoretical basis of automatic control: https://blog.csdn.net/qq_39032096/category_10287468.html?spm=1001.2014.3001.5482
Blog reference books: "MATLAB/Simulink and Control System Simulation".



2. Application of MATLAB in frequency method and stability analysis of frequency method

2.1 Application of MATLAB in frequency method
2.1.1 Calculating and drawing functions related to frequency response curve
  1. N y q u i s t {\rm Nyquist} Nyquist curve drawing functionnyquist ( ) {\rm nyquist()}nyquist()
    • n y q u i s t ( a , b , c , d ) {\rm nyquist(a,b,c,d)} nyquist(a,b,c,d ) : Draw a set ofN yquist {\rm Nyquist}Nyquist curves, each of which corresponds to a continuous state-space system[ a , b , c , d ] {\rm [a,b,c,d]}[a,b,c,d ] input/output combination pair, in which the frequency range is automatically selected by the function, and more sampling points will be automatically adopted at positions where the response changes rapidly;
    • n y q u i s t ( a , b , c , d , i u ) {\rm nyquist(a,b,c,d,iu)} nyquist(a,b,c,d,iu ) : draw from system iu{\rm iu}Polar plot of iu inputs to all outputs;
    • n y q u i s t ( n u m , d e n ) {\rm nyquist(num,den)} nyquist(num,den ) : Draw a polar plot of the system represented by a continuous-time polynomial transfer function;
    • n y q u i s t ( a , b , c , d , i u , w ) {\rm nyquist(a,b,c,d,iu,w)} nyquist(a,b,c,d,iu,w) n y q u i s t ( n u m , d e n , w ) {\rm nyquist(num,den,w)} nyquist(num,the ,w ) : Draw the polar coordinate diagram of the system using the specified angular frequency vector;
  2. B o d e {\rm Bode} Bode graph drawing functionbode ( ) {\rm bode()}bode()
    • b o d e ( a , b , c , d ) {\rm bode(a,b,c,d)} bode(a,b,c,d ) : Draw a set ofB ode {\rm Bode}Bode diagram is for continuous state space system[ a , b , c , d ] {\rm [a,b,c,d]}[a,b,c,d ] for each inputB ode {\rm Bode}Bode diagram, where the frequency range is automatically selected by the function, and more sampling points are automatically used in the position where the response changes rapidly;
    • b o d e ( a , b , c , d , i u ) {\rm bode(a,b,c,d,iu)} bode(a,b,c,d,iu ) : draw from system iu{\rm iu}iu input to all outputB ode {\rm Bode}Bode diagram;
    • box ( num , then ) {\rm box(num,then)}bode(num,den ) : plot the system Bode {\rm Bode}in terms of continuous-time polynomial transfer functionBode diagram;
    • b o d e ( a , b , c , d , i u , w ) {\rm bode(a,b,c,d,iu,w)} bode(a,b,c,d,iu,w )bode( num , then , w ) {\rm bode(num,then,w)}bode(num,the ,w ) : Use the specified angular frequency vector to drawthe Bode {\rm Bode}Bode diagram;
  3. N i c h o l s {\rm Nichols} Nichols curve drawing functionnichols ( ) {\rm nichols()}nichols()
    • n i c h o l s ( a , b , c , d ) {\rm nichols(a,b,c,d)} nichols(a,b,c,d ) : Draw a set ofNichols {\rm Nichols}Nichols diagram, for continuous state space system[ a , b , c , d ] {\rm [a,b,c,d]}[a,b,c,d ] for each inputNichols {\rm Nichols}Nichols plots, where the frequency range is automatically selected by the function, and more sampling points are automatically taken at positions where the response changes rapidly;
    • n i c h o l s ( a , b , c , d , i u ) {\rm nichols(a,b,c,d,iu)} nichols(a,b,c,d,iu ) : draw from system iu{\rm iu}iu input to N ichols {\rm Nichols}with outputNichols diagram;
    • nichols ( num , the ) { \rm nichols ( num , the )}nichols(num,den ) : Plot the system Nichols {\rm Nichols}in terms of continuous-time polynomial transfer functionNichols diagram;
    • n i c h o l s ( a , b , c , d , i u , w ) {\rm nichols(a,b,c,d,iu,w)} nichols(a,b,c,d,iu,w )nichols(num,then,w) {\rm nichols(num,then,w)}nichols(num,the ,w ) : Use the specified angular frequency vector to plotthe Nichols {\rm Nichols}Nichols diagram;
  4. plotting etc. M {\rm M}M circles and equalN {\rm N}N circle functionngrid ( ) {\rm ngrid()}ngrid()
2.1.2 Actual Combat 1

Experimental requirements: The known first-order link transfer function is: G ( s ) = 5 3 s + 1 G(s)=\displaystyle\frac{5}{3s+1}G(s)=3 s+15, draw the N yquist {\rm Nyquist} of this linkNyquist diagram.

untie:

% 实例Chapter7.2.1.2
clc;clear;

% 建立传递函数模型
num=5;den=[3,1];
G=tf(num,den);

% 绘制图形
nyquist(G);grid;
axis([-1,8,-2.5,2.5]);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
title('控制系统Nyquist图','FontSize',15);

1

2.1.3 Actual Combat 2

Experimental requirements: The known second-order link transfer function is: G ( s ) = ω n 2 s 2 + 2 ζ ω ns + ω n 2 G(s)=\displaystyle\frac{\omega_n^2}{s^2 +2\zeta\omega_ns+\omega_n^2}G(s)=s2+2 z ons+ohn2ohn2, in which: ω n = 0.7 \omega_n=0.7ohn=0.7 , respectively drawζ = 0.1 , 0.4 , 1.0 , 1.6 , 2.0 \zeta=0.1, 0.4, 1.0, 1.6, 2.0g=B ode {\rm Bode}at 0.1 , 0.4 , 1.0 , 1.6 , 2.0Bode diagram.

untie:

% 实例Chapter7.2.1.3
clc;clear;

% 参数定义
w=[0,logspace(-2,2,200)];
wn=0.7;zeta=[0.1,0.4,1.0,1.6,2.0];

% 建立传递函数模型
for j=1:5
    sys=tf([wn*wn],[1,2*zeta(j)*wn,wn*wn]);
    bode(sys);hold on;
end

set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
legend('ζ=0.1','ζ=0.4','ζ=1.0','ζ=1.6','ζ=2.0');
title('控制系统不同ζ下的Bode图','FontSize',15);

2

2.1.4 Actual Combat 3

Experimental requirements: The transfer function of a known high-order system is: G ( s ) = 0.0001 s 3 + 0.028 s 2 + 1.06356 s + 9.6 0.0006 s 3 + 0.0286 s 2 + 0.06356 s + 6 G(s)=\displaystyle \frac{0.0001s^3+0.028s^2+1.06356s+9.6}{0.0006s^3+0.0286s^2+0.06356s+6}G(s)=0.0006s3+0.0286s2+0.06356 s+60.0001s3+0.028s2+1.06356 s+9.6, draw the Nichols {\rm Nichols} of the systemNichols diagram.

untie:

% 实例Chapter7.2.1.4
clc;clear;

% 建立模型
num=[0.0001,0.0281,1.06356,9.6];
den=[0.0006,0.0286,0.06356,6];
G=tf(num,den);

% 绘制等M圆和等N圆,Nichols图
ngrid('new');
nichols(G);

axis([-360,0,-20,40]);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
title('等M圆、等N圆及Nichols图','FontSize',15);

3

2.2 Stability analysis of the frequency method
2.2.1 Logarithmic frequency stability criterion

Complex plane Γ GH \Gamma_{GH}CGHThe curve is generally composed of two parts: the open-loop amplitude-phase curve and the imaginary arc with an infinite radius when the open-loop system has an integral link and an equal-amplitude oscillation link;

Γ GH \Gamma_{GH} in semi-logarithmic coordinatesCGHThe curve determines the number of crossings NNN orN + N_+N+and N − N_-N N N The determination of N depends on A ( ω ) > 1 A(\omega)>1A ( ω )>1 o'clockΓ GH \Gamma_{GH}CGHthe number of crossings of the negative real axis;

  1. crossing point determination

    ω = ω c \omega=\omega_coh=ohcFor example,
    { A ( ω c ) = ∣ G ( j ω c ) H ( j ω c ) ∣ = 1 L ( ω c ) = 20 lg ⁡ A ( ω c ) = 0 \begin{cases} &A(\omega_c )=|G({\rm j}\omega_c)H({\rm j}\omega_c)|=1 \\\\ &L(\omega_c)=20\lg{A(\omega_c)}=0 \end {cases} A ( ohc)=G ( j _c)H(jωc)=1L ( oc)=20lgA ( ohc)=0
    where: ω c \omega_cohccalled the cutoff frequency;

    For the negative real axis and open-loop logarithmic phase-frequency characteristics of the complex plane, when the frequency is taken as the crossing frequency ω x \omega_xohx时,
    φ ( ω x ) = ( 2 k + 1 ) π, k = 0, ± 1, ± 2, … \varphi(\omega_x)=(2k+1)\pi,k=0,±1,± 2,\dotsf ( ox)=( 2 k+1 ) p , k=0±1±2 Set Γ GH \Gamma_{GH}
    in semi-logarithmic coordinatesCGHThe logarithmic amplitude-frequency characteristic curve and logarithmic phase-frequency characteristic curve are respectively: Γ L \Gamma_{L}CLΓ φ \Gamma_{\varphi }Cf, since Γ L \Gamma_{L}CLis equal to L ( ω ) L(\omega)L ( ω ) curve, thenΓ GH \Gamma_{GH}CGHAt A ( ω ) > 1 A(\omega)>1A ( ω )>When 1 , the point crossing the negative real axis is equal toΓ GH \Gamma_{GH}CGHIn semi-logarithmic coordinates, the logarithmic amplitude-frequency characteristic L ( ω ) > 0 L(\omega)>0L ( ω )>The logarithmic phase-frequency characteristic curve at 0 o'clock Γ φ \Gamma_{\varphi}Cf( 2 k + 1 ) π ( k = 0 , ± 1 , ± 2 , ... ) (2k+1)\pi(k=0,±1,±2,\dots)( 2 k+1 ) p ( k=0,±1,±2,) , the intersection of parallel lines;

  2. Γ φ \Gamma_{\varphi }CfSure

    • When the open-loop system has no poles on the imaginary axis, Γ φ \Gamma_{\varphi}Cfis equal to φ ( ω ) \varphi(\omega)φ ( ω ) curve;
    • The open-loop system has an integral element 1 s ν ( ν > 0 ) \displaystyle\frac{1}{s^{\nu}}(\nu>0)sn1( n>0 ) ,the Γ GH \Gamma_{GH}CGHCurve, need from ω = 0 + \omega=0_+oh=0+The corresponding point of the open-loop amplitude-phase characteristic curve G ( j 0 + ) H ( j 0 + ) G({\rm j}0_+)H({\rm j}0_+)G(j0+)H(j0+) , complement it counterclockwise withν × 90 ° \nu\times90°n×90° imaginary circular arc with infinite radius; it needs to be obtained from the logarithmic phase-frequency characteristic curveω \omegaω is small andL ( ω ) > 0 L(\omega)>0L ( ω )>Complementν × 90 ° upward at the point of 0 \nu\times90°n×90° imaginary straight line,φ ( ω ) \varphi(\omega)The φ ( ω ) curve and the supplementary imaginary straight line constituteΓ φ \Gamma_{\varphi}Cf
    • The open-loop system has a constant amplitude oscillation link 1 ( s 2 + ω n 2 ) ν 1 ( ν 1 > 0 ) \displaystyle\frac{1}{(s^2+\omega_n^2)^{\nu_1}}( \nu_1>0)(s2+ohn2)n11( n1>0 ) ,the Γ GH \Gamma_{GH}CGHCurve, need to start from ω = ω n − \omega=\omega_{n^-}oh=ohnThe corresponding point G ( j ω n − ) H ( j ω n − ) G({\rm j}\omega_{n^-})H({\rm j}\omega_{n^ -})G(jωn)H(jωn) , make clockwiseν 1 × 180 ° \nu_1\times180°n1×180° imaginary arc with infinite radius toω = ω n + \omega=\omega_{n^+}oh=ohn+The corresponding point G ( j ω n + ) H ( j ω n + ) G({\rm j}\omega_{n^+})H({\rm j}\omega_{n^+})G(jωn+)H(jωn+) ; Correspondingly, from the logarithmic phase-frequency characteristic curveφ ( ω n − ) \varphi(\omega_{n^-})f ( on) , make upν 1 × 180 ° \nu_1\times180°n1×180° imaginary straight line toφ ( ω n + ) \varphi(\omega_{n^+})f ( on+)处,φ ( ω ) \varphi(\omega )The φ ( ω ) curve and the supplementary imaginary straight line constituteΓ φ \Gamma_{\varphi}Cf
  3. Calculation of crossing times

    1. Crossing once: Γ GH \Gamma_{GH}CGHCross ( − 1 , j 0 ) from top to bottom (-1,{\rm j}0)(1,The negative real axis on the left side of point j 0)is equivalent toL( ω ) > 0 L(\omega)>0L ( ω )>0时,Γ φ \Gamma_{\varphi }CfCross ( 2 k + 1 ) π (2k+1)\pi from bottom to top( 2 k+1 ) π line once;
    2. Negative traverse once: Γ GH \Gamma_{GH}CGHCross ( − 1 , j 0 ) from bottom to top (-1,{\rm j}0)(1,The negative real axis on the left side of point j 0)is equivalent toL( ω ) > 0 L(\omega)>0L ( ω )>0时,Γ φ \Gamma_{\varphi }CfCross ( 2 k + 1 ) π (2k+1)\pi from top to bottom( 2 k+1 ) π line once;
    3. Positive crossing half time: Γ GH \Gamma_{GH}CGHEnd from top to bottom or start from top to bottom at ( − 1 , j 0 ) (-1,{\rm j}0)(1,The negative real axis on the left side of point j 0), is equivalent toL( ω ) > 0 L(\omega)>0L ( ω )>0时,Γ φ \Gamma_{\varphi }CfEnd at or start at ( 2 k + 1 ) π (2k+1)\pi from bottom to top( 2 k+1 ) thread
    4. Negative crossing half times: Γ GH \Gamma_{GH}CGHEnd at or start at ( − 1 , j 0 ) from bottom to top (-1,{\rm j}0)(1,The negative real axis on the left side of point j 0), is equivalent toL( ω ) > 0 L(\omega)>0L ( ω )>0时,Γ φ \Gamma_{\varphi }CfEnd from top to bottom or start from top to bottom at ( 2 k + 1 ) π (2k+1)\pi( 2 k+1 ) thread
    5. The crossings generated by the supplementary imaginary straight lines are all negative crossings;
  4. log frequency stability criterion

    Let PPP is the number of poles in the positive real part of the open-loop system. The necessary and sufficient condition for the stability of the feedback control system is thatφ ( ω c ) ≠ ( 2 k + 1 ) π ( k = 0 , 1 , 2 , … ) \varphi(\omega_c )≠(2k+1)\pi(k=0,1,2,\dots)f ( oc)=( 2 k+1 ) p ( k=0,1,2,) andL ( ω ) > 0 L(\omega)>0L ( ω )>0时,Γ φ \Gamma_{\varphi }CfThe curve crosses ( 2 k + 1 ) π (2k+1)\pi( 2 k+1 ) The degree of π line:N = N + − N − N=N_+-N_-N=N+NSatisfy: Z = P − 2 N = 0 Z=P-2N=0Z=P2N _=0

  5. Nyquist Stability Criterion

    Nestle's criterion: The necessary and sufficient condition for the stability of the feedback control system is the semi-closed curve Γ GH \Gamma_{GH}CGHDoes not pass through ( − 1 , j 0 ) (-1,{\rm j}0)(1,j 0), and encloses the critical point counterclockwise( − 1 , j 0 ) (-1,{\rm j}0)(1,j 0)the number of circlesRRR is equal to the number of poles PPin the positive real part of the open-loop transfer functionP

2.2.2 Stability margin
  1. phase margin.

    Let ω c \omega_cohcis the cutoff frequency of the system, then:
    A ( ω c ) = ∣ G ( j ω c ) H ( j ω c ) ∣ = 1 A(\omega_c)=|G({\rm j}\omega_c)H({ \rm j}\omega_c)|=1A ( ohc)=G ( j _c)H(jωc)=1
    Define the phase angle margin:
    γ = 180 ° + ∠ [ G ( j ω c ) H ( j ω c ) ] \gamma=180°+\angle[G({\rm j}\omega_c)H({\ rm j}\omega_c)]c=180°+[G(jωc)H(jωc)]
    phase angle margin γ \gammaγmeaning : For a closed-loop stable system, if the open-loop phase-frequency characteristic of the system lagsγ \gammaγ degree, the system will be in a critical stable state;

  2. Amplitude margin.

    Let ω x \omega_xohxis the crossing frequency of the system, then the system is at ω x \omega_xohx工相角:
    φ ( ω x ) = ∠ [ G ( j ω x ) H ( j ω x ) ] = ( 2 k + 1 ) π ; k = 0 , ± 1 , … \varphi(\omega_x)= \angle[G({\rm j}\omega_x)H({\rm j}\omega_x)]=(2k+1)\pi;k=0,±1,\dotsf ( ox)=[G(jωx)H(jωx)]=( 2 k+1 ) p ; k=0,±1,...
    Define the magnitude margin as:
    h = 1 ∣ G ( j ω x ) H ( j ω x ) ∣ h=\frac{1}{|G({\rm j}\omega_x)H({\rm j }\omega_x)|}h=G ( j _x)H(jωx)1
    Amplitude margin hhThe meaning of h : For a closed-loop stable system, if the open-loop amplitude-frequency characteristics of the system increasehhh times, the system will be in a critical stable state;

  3. Notes on phase angle margin and amplitude margin.

    • The phase angle margin and amplitude margin of the control system are the polar coordinate diagram pair of the system ( − 1 + j 0 ) (-1+{\rm j}0)(1+j 0)is a measure of the proximity of points, and these two margins can be used as design criteria;
    • It is not enough to explain the relative stability of the system only by amplitude margin or phase angle margin; in order to determine the relative stability of the system, these two quantities must be given at the same time;
    • For the minimum phase system, the system is stable only when both the phase angle margin and the amplitude margin are positive, and a negative margin indicates that the system is unstable;
    • Appropriate phase angle margin and amplitude margin can prevent the influence of component aging in the system, and the frequency value is specified; in order to obtain satisfactory performance, the phase angle margin should be 30 ° ~ 60 ° 30 ° ~ 60 °30° 60° , the amplitude margin should be greater than6 d B 6{\rm dB}6 dB
    • Requires phase angle margin at 30° 30°30° and60° 60°60° , that is, in the Bode diagram, the slope of the logarithmic magnitude curve at the cutoff frequency should be greater than− 40 dB / dec -40{\rm dB/dec}40 dB/dec ; in most practical cases, in order to ensure the stability of the system, the slope at the cutoff frequency is required to be− 20 dB / dec -20{\rm dB/dec}20 dB/dec ; if the slope at the cutoff frequency is− 40 dB / dec -40{\rm dB/dec}40 dB/dec , the system may be stable or unstable; if the slope at the cutoff frequency is− 60 dB / dec -60{\rm dB/dec}60 dB/dec , or steeper, the system is likely to be unstable;
2.3 Application of MATLAB in stability analysis
2.3.1 The function margin() to calculate the system stability margin
  • m a r g i n ( m a g , p h a s e , w ) {\rm margin(mag,phase,w)} margin(mag,phase,w ) : ReasonB ode {\rm Bode}The amplitude mag {\rm mag}obtained by the Bode commandmag、相角 p h a s e {\rm phase} phase and angular frequencyw {\rm w}w vector plotting Bode {\rm Bode}with margin and corresponding frequency displayBode diagram;
  • m a r g i n ( n u m , d e n ) {\rm margin(num,den)} margin(num,den ) : Compute the magnitude margin and phase angle margin represented by the transfer function of the continuous system, and plot the correspondingBode {\rm Bode}Bode diagram;
  • m a r g i n ( a , b , c , d ) {\rm margin(a,b,c,d)} margin(a,b,c,d ) : Calculate the magnitude margin and phase angle margin represented by the continuous state space system, and plot the correspondingBode {\rm Bode}Bode diagram;
  • g m , p m , w c g , w c p = m a r g i n ( m a g , p h a s e , w ) {\rm gm,pm,wcg,wcp=margin(mag,phase,w)} gm,pm,wcg ,wcp=margin(mag,phase,w ) : by the magnitudemag {\rm mag}mag、相角 p h a s e {\rm phase} phase and angular frequencyw {\rm w}w vector, calculate the system amplitude margin, phase angle margin and the corresponding phase angle crossover frequencywcg {\rm wcg}wcg , cutoff frequencywcp {\rm wcp}wcp , does not directly drawB ode {\rm Bode}Bode diagram;
  • s = a l l m a r g i n ( s y s ) {\rm s=allmargin(sys)} s=allmargin ( sys ) : Calculate the amplitude margin, phase angle margin and corresponding frequency;
2.3.2 Actual Combat 1

Experimental requirements: It is known that the open-loop transfer function of a high-order system is: G ( s ) = 5 ( 0.0167 s + 1 ) s ( 0.03 s + 1 ) ( 0.0025 s + 1 ) ( 0.001 s + 1 ) G(s )=\displaystyle\frac{5(0.0167s+1)}{s(0.03s+1)(0.0025s+1)(0.001s+1)}G(s)=s(0.03s+1)(0.0025s+1)(0.001s+1)5 ( 0.0167 s+1), calculate the phase angle margin and amplitude margin of the system, and draw the Bode {\rm Bode} of the systemBode diagram.

untie:

% 实例Chapter7.2.3.2
clc;clear;

% 建立模型
num=5*[0.0167,1];
den=conv(conv([1,0],[0.03,1]),conv([0.0025,1],[0.001,1]));
G=tf(num,den);

% 频率范围
w=logspace(0,4,50);

% 绘制Bode图
bode(G,w);grid;
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
title('控制系统Bode图','FontSize',15);

% 计算幅值裕度和相角裕度
[Gm,Pm,Wcg,Wcp]=margin(G)
% 幅值裕度和相角裕度结果
Gm =
  455.2548

Pm =
   85.2751

Wcg =
  602.4232

Wcp =
    4.9620
  • Amplitude margin: K g = 455.2548 K_g=455.2548Kg=455.2548 , phase angle margin:γ = 85.2751 ° \gamma=85.2751°c=85.2751° , crossover frequency:ω g = 602.4232 rad / s \omega_g=602.4232{\rm rad/s}ohg=602.4232 rad/s , cutoff frequency:ω c = 4.9620 rad / s \omega_c=4.9620{\rm rad/s}ohc=4.9620rad/s

4

2.3.3 Actual Combat 2

Experimental requirements: It is known that the open-loop transfer function of a high-order system is: G ( s ) = K ( 0.0167 s + 1 ) s ( 0.03 s + 1 ) ( 0.0025 s + 1 ) ( 0.001 s + 1 ) G(s )=\displaystyle\frac{K(0.0167s+1)}{s(0.03s+1)(0.0025s+1)(0.001s+1)}G(s)=s(0.03s+1)(0.0025s+1)(0.001s+1)K ( 0.0167 s+1), calculate when the open-loop gain K = 5, 500, 800, 3000 K=5, 500, 800, 3000K=5 , 500 , 800 , 3000 , the change of system stability margin

untie:

% 实例Chapter7.2.3.3
clc;clear;

K=[5,500,800,3000];
den=conv(conv([1,0],[0.03,1]),conv([0.0025,1],[0.001,1]));

for j=1:4
    num=K(j)*[0.0167,1];
    G=tf(num,den);
    y(j)=allmargin(G);               % 计算幅值裕度、相角裕度、频率
end

y(1),y(2),y(3),y(4)
% 计算结果:

% K=5相角裕度、幅值裕度、对应频率
ans = 
  包含以下字段的 struct:
     GainMargin: 455.2548
    GMFrequency: 602.4232
    PhaseMargin: 85.2751
    PMFrequency: 4.9620
    DelayMargin: 0.2999
    DMFrequency: 4.9620
         Stable: 1

% K=500相角裕度、幅值裕度、对应频率
ans = 
  包含以下字段的 struct:
     GainMargin: 4.5525
    GMFrequency: 602.4232
    PhaseMargin: 39.7483
    PMFrequency: 237.7216
    DelayMargin: 0.0029
    DMFrequency: 237.7216
         Stable: 1

% K=800相角裕度、幅值裕度、对应频率
ans = 
  包含以下字段的 struct:
     GainMargin: 2.8453
    GMFrequency: 602.4232
    PhaseMargin: 27.7092
    PMFrequency: 329.9063
    DelayMargin: 0.0015
    DMFrequency: 329.9063
         Stable: 1

% K=3000相角裕度、幅值裕度、对应频率
ans = 
  包含以下字段的 struct:
     GainMargin: 0.7588
    GMFrequency: 602.4232
    PhaseMargin: -6.7355
    PMFrequency: 690.5172
    DelayMargin: 0.0089
    DMFrequency: 690.5172
         Stable: 0
2.3.4 Actual Combat 3

Experimental requirements: The open-loop transfer function of the known system is: G ( s ) = 100 ( s + 5 ) ( s − 2 ) ( s + 8 ) ( s + 20 ) G(s)=\displaystyle\frac{100 (s+5)}{(s-2)(s+8)(s+20)}G(s)=(s2)(s+8)(s+20)100(s+5), draw the polar plot of the system, using N yquist {\rm Nyquist}The Nyquist stability criterion judges the stability of the closed-loop system.

untie:

% 实例Chapter7.2.3.4
clc;clear;

% 建立模型
k=100;z=[-5];p=[2,-8,-20];
sys=zpk(z,p,k);

nyquist(sys);grid;
axis equal;
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
title('控制系统Nyquist图','FontSize',15);

5

  • According to the open-loop transfer function, the open-loop system has an s {\rm s}Pole of the right half plane of s , iep = 1 p=1p=1 , so the open-loop system is unstable;
  • N yquist {\rm Nyquist} of an open-loop systemThe Nyquist graph surrounds( − 1 , j 0 ) counterclockwise (-1,{\rm j}0)(1,j 0)point1 11 time, according toN yquist {\rm Nyquist}The Nyquist stability criterion shows that the closed-loop system is stable;
2.3.5 Actual Combat 4

Experimental requirements: The open-loop transfer function of the known system is: G ( s ) = 100 K s ( s + 5 ) ( s + 10 ) G(s)=\displaystyle\frac{100K}{s(s+5) (s+10)}G(s)=s(s+5)(s+10)100K, respectively draw K = 1, 7.8, 20 K=1, 7.8, 20K=1 , 7.8 , and 20 o'clock, the polar coordinate diagram of the system, usingN yquist {\rm Nyquist}The Nyquist stability criterion judges the stability of the closed-loop system.

untie:

% 实例Chapter7.2.3.5
clc;clear;

% 建立控制系统模型
z=[];p=[0,-5,-10];k=100.*[1,7.8,20];

G=zpk(z,p,k(1));[re1,im1]=nyquist(G);
G=zpk(z,p,k(2));[re2,im2]=nyquist(G);
G=zpk(z,p,k(3));[re3,im3]=nyquist(G);

% 绘制图形
plot(re1(:),im1(:),'r-',re2(:),im2(:),'b-',re3(:),im3(:),'g-');
legend('K=1','K=7.8','K=20');
axis([-5,1,-5,1]);grid;
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',1.5);
title('不同K值控制系统Nyquist图','FontSize',15);

6

  • According to the open-loop transfer function of the control system, the open-loop system has no ssPole of the right half plane of s , iep = 0 p=0p=0 , so the open-loop system is stable;
  • N y q u i s t {\rm Nyquist} It can be seen from the Nyquist diagram that whenK = 1 K=1K=When 1 , the N yquist {\rm Nyquist}of the open-loop systemNyquist graph does not surround( − 1 , j 0 ) (-1,{\rm j}0)(1,j 0), according toN yquist {\rm Nyquist}Nyquist stability criterion, the system is closed-loop stable; whenK = 7.8 K=7.8K=7.8 andK = 20 K=20K=At 20 o'clock, the N yquist {\rm Nyquist}of the open-loop systemNyquist graph surrounds( − 1 , j 0 ) (-1,{\rm j}0)(1,j 0), according toN yquist {\rm Nyquist}Nyquist stability criterion, the closed-loop system is unstable;
2.4 Comprehensive example and MATLAB/SIMULINK application

Experimental requirements: The structure diagram of the known thyristor-DC motor open-loop system is shown in the figure below, using SIMULINK {\rm SIMULINK}SIMULINK dynamic structure diagram for frequency domain analysis and frequency domain performance indicators.

8

untie:

S T E P 1 {\rm STEP1} STEP1】: S I M U L I N K {\rm SIMULINK} Create a dynamic model of the control system in SIMULINK , the file name is:experiment 7 _ 2 _ 4. mdl {\rm experiment7\_2\_4.mdl}experiment7_2_4.mdl

9

S T E P 2 {\rm STEP2} STEP2 ]: Find the linear state space model of the system, and find the performance index in the frequency domain.

>> [A,B,C,D]=linmod('experiment7_2_4');
>> sys=ss(A,B,C,D);
>> margin(sys);

10

  • Control system amplitude margin: GM = 26.4 d B {\rm GM=26.4dB}GM=26.4dB , frequency:152 rad / s {\rm 152rad/s}152rad/s
  • Control system phase margin: PM = 54 deg {\rm PM=54deg}PM=54deg , frequency:25.5 rad / s {\rm 25.5rad/s}25.5rad/s

Guess you like

Origin blog.csdn.net/qq_39032096/article/details/129738806