資源描述:
《模糊自適應(yīng)整定pid控制matlab仿真程序(劉金錕-先進(jìn)pid控制及其matlab仿真)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、實(shí)用標(biāo)準(zhǔn)文案這個(gè)例子的程序百度文庫里有很多版本,但我下了很多都有錯(cuò)誤,運(yùn)行不了。以下程序我一字一字的敲出來的,已經(jīng)成功運(yùn)行,絕對(duì)無誤。仿真實(shí)例,被控對(duì)象為(s)=采樣時(shí)間為1ms,采用模糊PID控制進(jìn)行階躍響應(yīng),在第300個(gè)采樣時(shí)間時(shí)控制器輸出加1.0的干擾,相應(yīng)的運(yùn)行結(jié)果如圖1~13所示。仿真程序如下:將以下程序保存為fuzzypid.m文件,即可得到仿真結(jié)果。%fuzzytunningPIDcontrolclearall;clearall;a=newfis('fuzzpid');a=addvar(a,'input','e',[-3,3]);%parametere
2、a=addmf(a,'input',1,'NB','zmf',[-3,-1]);a=addmf(a,'input',1,'NM','trimf',[-3,-2,0]);a=addmf(a,'input',1,'NS','trimf',[-3,-1,1]);a=addmf(a,'input',1,'Z','trimf',[-2,0,2]);a=addmf(a,'input',1,'PS','trimf',[-1,1,3]);a=addmf(a,'input',1,'PM','trimf',[0,2,3]);a=addmf(a,'input',1,'PB','smf',
3、[1,3]);a=addvar(a,'input','ec',[-3,3]);%parametereca=addmf(a,'input',2,'NB','zmf',[-3,-1]);a=addmf(a,'input',2,'NM','trimf',[-3,-2,0]);a=addmf(a,'input',2,'NS','trimf',[-3,-1,1]);a=addmf(a,'input',2,'Z','trimf',[-2,0,2]);a=addmf(a,'input',2,'PS','trimf',[-1,1,3]);a=addmf(a,'input',2,'P
4、M','trimf',[0,2,3]);a=addmf(a,'input',2,'PB','smf',[1,3]);a=addvar(a,'output','kp',[-0.3,0.3]);%parameterkpa=addmf(a,'output',1,'NB','zmf',[-0.3,-0.1]);a=addmf(a,'output',1,'NM','trimf',[-0.3,-0.2,0]);a=addmf(a,'output',1,'NS','trimf',[-0.3,-0.1,0.1]);a=addmf(a,'output',1,'Z','trimf',[
5、-0.2,0,0.2]);a=addmf(a,'output',1,'PS','trimf',[-0.1,0.1,0.3]);a=addmf(a,'output',1,'PM','trimf',[0,0.2,0.3]);a=addmf(a,'output',1,'PB','smf',[0.1,0.3]);精彩文檔實(shí)用標(biāo)準(zhǔn)文案a=addvar(a,'output','ki',[-0.06,0.06]);%parameterkia=addmf(a,'output',2,'NB','zmf',[-0.06,-0.02]);a=addmf(a,'output',2,'NM'
6、,'trimf',[-0.06,-0.04,0]);a=addmf(a,'output',2,'NS','trimf',[-0.06,-0.02,0.02]);a=addmf(a,'output',2,'Z','trimf',[-0.04,0,0.04]);a=addmf(a,'output',2,'PS','trimf',[-0.02,0.02,0.06]);a=addmf(a,'output',2,'PM','trimf',[0,0.04,0.06]);a=addmf(a,'output',2,'PB','smf',[0.02,0.06]);a=addvar(a
7、,'output','kd',[-3,3]);%parameterkda=addmf(a,'output',3,'NB','zmf',[-3,-1]);a=addmf(a,'output',3,'NM','trimf',[-3,-2,0]);a=addmf(a,'output',3,'NS','trimf',[-3,-1,1]);a=addmf(a,'output',3,'Z','trimf',[-2,0,2]);a=addmf(a,'output',3,'PS','trimf',[-1,1,3]);a=addmf(a,'output',3,'PM','trim