gusucode.com > ​模糊自整定PID控制器设计simulink仿真源码程序 > fuzzypid1.m

    clear all;close all;clc;

fuzzypid=readfis('fuzzypid.fis')
sim('fuzzy_pid')
showrule(fuzzypid)

figure(1);
tout=[0;tout];
plot(tout,simout,'b',tout,simout4,'r');
title('俯仰角给定和输出响应曲线')
xlabel('时间/s');ylabel('幅值');
grid on

figure(2);
plot(tout,simout6,'r');
title('迎角响应曲线')
xlabel('时间/s');ylabel('幅值');
grid on

figure(3);plot(tout,simout5,'r');
title('俯仰角速率响应曲线')
xlabel('时间/s');ylabel('幅值');
grid on

figure(4);subplot(311);
plot(tout,simout1);
title('Kp自整定曲线')
xlabel('时间/s');ylabel('幅值');
grid on
subplot(312);plot(tout,simout2);
title('Ki自整定曲线')
xlabel('时间/s');ylabel('幅值');
grid on
subplot(313);plot(tout,simout3);
title('Kd自整定曲线')
xlabel('时间/s');ylabel('幅值');
grid on
figure(5);plotmf(fuzzypid,'input',1);
figure(6);plotmf(fuzzypid,'input',2);
figure(7);plotmf(fuzzypid,'output',1);
figure(8);plotmf(fuzzypid,'output',2);
figure(9);plotmf(fuzzypid,'output',3);
figure(10);plotfis(fuzzypid);

figure(11);plot(tout,simout7,'r');
title('误差变化率响应曲线')
xlabel('时间/s');ylabel('幅值');
grid on
figure(12);plot(tout,simout8,'r');
title('误差响应曲线')
xlabel('时间/s');ylabel('幅值');
grid on