資源描述:
《模糊自適應整定pid控制matlab仿真程序(劉金錕-先進pid控制及其matlab仿真)》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在工程資料-天天文庫。
1、實用標準文案這個例子的程序百度文庫里有很多版本,但我下了很多都有錯誤,運行不了。以下程序我一字一字的敲出來的,已經(jīng)成功運行,絕對無誤。仿真實例,被控對象為(s)=采樣時間為1ms,采用模糊PID控制進行階躍響應,在第300個采樣時間時控制器輸出加1.0的干擾,相應的運行結(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]);精彩文檔實用標準文案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