⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pid_objfun_ise.m

📁 -PID controller has been extensively used in the industrial world. But in this controller it is dif
💻 M
字号:
%PID_objfun_ISE.m
%Written by Ian Griffin July 2003
%Last Modified 20-08-03
%____________________________________________________________________
function [x_pop, fx_val]=PID_objfun_ISE(x_pop,options)
global sys_controlled
global time
global sysrl
%____________________________________________________________________
Kp=x_pop(2);
Ki=x_pop(3);
Kd=x_pop(1);
%Creating the PID controller from current values
pid_den=[1 0];
pid_num=[Kd Kp Ki];
pid_sys=tf(pid_num,pid_den); %overall PID controller
%Creating PID feedback loop
sys_series=series(pid_sys,sysrl);
sys_controlled=feedback(sys_series,1);
%____________________________________________________________________
time =0:0.1:30;
[y t] = step(sys_controlled,time); % Step response of closed-loop
system
for i=1:301
error(i) = 1-y(i);
end
error=error*error';
ISE=sum(error); %Integral of Squared Error
%____________________________________________________________________
%to make sure controlled system is stable
poles=pole(sys_controlled);
if poles(1)>0
ISE=100e300;
elseif poles(2)>0
ISE=100e300;
elseif poles(3)>0
ISE=100e300;
elseif poles(4)>0
ISE=100e300;
elseif poles(5)>0
ISE=100e300;
end
fx_val=1/ISE;
%____________________________________________________________________

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -