资源描述:
《模糊自适应整定pid控制matlab仿真程序(刘金锟-先进pid控制及其matlab仿真)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用标准文案这个例子的程序百度文库里有很多版本,但我下了很多都有错误,运行不了。以下程序我一字一字的敲出来的,已经成功运行,绝对无误。仿真实例,被控对象为(s)=采样时间为1ms,采用模糊PID控制进行阶跃响应,在第300个采样时间时控制器输出加1.0的干扰,相应的运行结果如图1~13所示。仿真程序如下:将以下程序保存为fuzzypid.m文件,即可得到仿真结果。%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