資源描述:
《MATLAB校正系統(tǒng)程序.docx》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在教育資源-天天文庫。
1、clear;G1=tf(20,[1,0.4,0])%系統(tǒng)的開環(huán)傳遞函數(shù)G=feedback(G1,1,-1)%原系統(tǒng)的閉環(huán)傳遞函數(shù)figure(1)step(G)%原系統(tǒng)的單位階躍響應figure(2)rlocus(G1)%原系統(tǒng)的根軌跡figure(3)margin(G1)%原系統(tǒng)的bode圖[Gm0,Pm0,Wg0,Wc0]=margin(G1)deta=5%補償角Phim=45-Pm0+deta%校正裝置最大超前角a=sin(Phim*pi/180)alpha=(1+a)/(1-a)Wm=Wc0*alpha^(1/4)T=1/(Wm*sqrt(a
2、lpha));alpha_T=alpha*TGc=tf([alpha_T,1],[T,1])%校正裝置Ga=G1*Gc%校正后的傳遞函數(shù)G11=feedback(G1,1);%原系統(tǒng)閉環(huán)傳遞函數(shù)Gaa=feedback(Ga,1);%校正后系統(tǒng)閉環(huán)傳遞函數(shù)figure(4)rlocus(Ga)%校正后系統(tǒng)的根軌跡legend('Ga')figure(5)margin(Ga)%校正后系統(tǒng)的頻域特性[Gm,Pm,Wcm,Wpm]=margin(Ga)figure(6)step(G11,'-.k',Gaa)%原系統(tǒng)與校正后系統(tǒng)的時域特性的比較legend('
3、G1','Ga')figure(7)bode(G1,'-.k',Gc,':',Ga)%原系統(tǒng)與校正后系統(tǒng)的頻域特性的比較legend('G1','Gc','Ga')G1=20-----------s^2+0.4sContinuous-timetransferfunction.G=20----------------s^2+0.4s+20Continuous-timetransferfunction.Gm0=InfPm0=5.1214Wg0=InfWc0=4.4631deta=5Phim=44.8786a=0.7056alpha=5.7936Wm=6.9
4、243alpha_T=0.3476Gc=0.3476s+1------------0.06s+1Continuous-timetransferfunction.Ga=6.952s+20----------------------------0.06s^3+1.024s^2+0.4sContinuous-timetransferfunction.Gm=InfPm=48.1787Wcm=InfWpm=6.9371校正前校正后