💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
📚2 运行结果
🎉3 参考文献
🌈4 Matlab代码及文章讲解
💥1 概述
如今,许多不同的控制器被用于工业和许多其他领域。一般来说,这些控制器可以分为两大类:
• 传统控制器 • 非常规控制器 作为传统控制器,我们可以计算多年来已知的控制器
,例如ON-OFF,P,PI,PD,PID所有不同的类型和实现。所有传统控制器的一个特点是,必须知道过程的数学模型才能设计控制器。
比例-积分-微分(PID)控制器是从上世纪初开始,在自动控制领域具有悠久历史的三任期控制器。由于其直观性和相对简单性,除了能够在各种过程中提供令人满意的性能外,它实际上已成为工业环境中的标准控制器。
📚2 运行结果
部分代码:
%% Figure One %%
figure
[Gc_p,Kp_p,Ti_p,Td_p]=myzntune('P',[0.4167,0.76,1.96,10],'openloop')
[Gc_pi,Kp_pi,Ti_pi,Td_pi]=myzntune('PI',[0.4167,0.76,1.96,10],'openloop')
[Gc_pid,Kp_pid,Ti_pid,Td_pid]=myzntune('PID',[0.4167,0.76,1.96,10],'openloop')
step(feedback(series(Gc_p,Gp),1),feedback(series(Gc_pi,Gp),1),feedback(series(Gc_pid,Gp),1))
title('Comparision of P,PI and PID Controllers (Tuned by Step Response Method)')
legend('Response of P Controller', 'Response of PI Controller', 'Response of PID Controller')
%% Figure Two %%
figure
% title('Comparision of PID and PID (With Filter )Controllers (Tuned by Step Response Method)')
[Gc_f,Kp_f,Ti_f,Td_f]=myzntune('PIDF',[0.4167,0.76,1.96,10],'openloop')
[Gcpid,Kppid,Tipid,Tdpid]=myzntune('PID',[0.4167,0.76,1.96,10],'openloop')
% subplot(1,2,2)
step(feedback(series(Gcpid,Gp),1),feedback(series(Gc_f,Gp),1))
title('Comparision of PID and PID (With Filter )Controllers (Tuned by Step Response Method)')
legend('Response of PID Controller', 'Response of PID (With Filter)Controller')
%% Sustained Oscillation Method %%
%% Figure Three %%
figure
[Gcp,Kpp,Tip,Tdp]=myzntune('P',[12.60,2.80,10],'closeloop')
[Gcpi,Kppi,Tipi,Tdpi]=myzntune('PI',[12.60,2.80,10],'closeloop')
[Gcpid1,Kppid1,Tipid1,Tdpid1]=myzntune('PID',[12.60,2.80,10],'closeloop')
step(feedback(series(Gcp,Gp),1),feedback(series(Gcpi,Gp),1),feedback(series(Gcpid1,Gp),1))
title('Comparision of P,PI and PID Controllers (Tuned by Sustained Oscillation Method)')
legend('Response of P Controller', 'Response of PI Controller', 'Response of PID Controller')
%% Figure Four %%
figure
[Gcf,Kpf,Tif,Tdf]=myzntune('PIDF',[12.60,2.80,10],'closeloop')
step(feedback(series(Gcpid1,Gp),1),feedback(series(Gcf,Gp),1))
title('Comparision of PID and PID (With Filter )Controllers (Tuned by Sustained Oscillation Method)')
legend('Response of PID Controller', 'Response of PID (With Filter)Controller')
%% Cohen Coon %%
%% Figure Five %%
figure
[Gcp_cc,Kpp_cc,Tip_cc,Tdp_cc]=myCohenCoon('P',[0.4167,0.76,1.96,10]);
[Gcpi_cc,Kppi_cc,Tipi_cc,Tdpi_cc]=myCohenCoon('PI',[0.4167,0.76,1.96,10]);
[Gcpd_cc,Kppd_cc,Tipd_cc,Tdpd_cc]=myCohenCoon('PD',[0.4167,0.76,1.96,10]);
[Gcpid_cc,Kppid_cc,Tipid_cc,Tdpid_cc]=myCohenCoon('PID',[0.4167,0.76,1.96,10]);
[Gcpidf_cc,Kppidf_cc,Tipidf_cc,Tdpidf_cc]=myCohenCoon('PIDF',[0.4167,0.76,1.96,10]);
step(feedback(series(Gcp_cc,Gp),1),feedback(series(Gcpi_cc,Gp),1),feedback(series(Gcpd_cc,Gp),1),feedback(series(Gcpid_cc,Gp),1),feedback(series(Gcpidf_cc,Gp),1))
title('System Response with Cohen Coon Tuned PID Controllers')
legend('Response of P Controller', 'Response of PI Controller', 'Response of PD Controller','Response of PID Controller','Response of PID(With Filter) Controller')
%% The Chien, Hrones and Reswick Tuning Algorithm %%
%%[ Gc,Kp,Ti,Td ] = mychrtune( type,data,method,overshoot)
%% Figure Six %%
figure
[Gcp0,Kpp0,Tip0,Tdp0]=mychrtune('P',[0.4167,0.76,1.96,10],'set',0)
[Gcp20,Kpp20,Tip20,Tdp20]=mychrtune('P',[0.4167,0.76,1.96,10],'set',20)
[Gcpi0,Kppi0,Tipi0,Tdpi0]=mychrtune('PI',[0.4167,0.76,1.96,10],'set',0)
[Gcpi20,Kppi20,Tipi20,Tdpi20]=mychrtune('PI',[0.4167,0.76,1.96,10],'set',20)
[Gcpid0,Kppid0,Tipid0,Tdpid0]=mychrtune('PID',[0.4167,0.76,1.96,10],'set',0)
[Gcpid20,Kppid20,Tipid20,Tdpid20]=mychrtune('PID',[0.4167,0.76,1.96,10],'set',20)
[Gcpidf0,Kppidf0,Tipidf0,Tdpidf0]=mychrtune('PIDF',[0.4167,0.76,1.96,10],'set',0)
[Gcpidf20,Kppidf20,Tipidf20,Tdpidf20]=mychrtune('PIDF',[0.4167,0.76,1.96,10],'set',20)
subplot(1,2,1)
% title('Set Point Regulation with 0% Overshoot ')
step(feedback(series(Gcp0,Gp),1),feedback(series(Gcpi0,Gp),1),feedback(series(Gcpid0,Gp),1),feedback(series(Gcpidf0,Gp),1))
title('System Response with Setpoint Regulation with 0% Overshoot by CHR tune PID Controller')
legend('Response of P Controller', 'Response of PI Controller','Response of PID Controller','Response of PID(With Filter) Controller')
subplot(1,2,2)
% title('Set Point Regulation with 20% Overshoot ')
% figure
step(feedback(series(Gcp20,Gp),1),feedback(series(Gcpi20,Gp),1),feedback(series(Gcpid20,Gp),1),feedback(series(Gcpidf20,Gp),1))
title('System Response with Setpoint Regulation with 20% Overshoot by CHR tune PID Controller')
legend('Response of P 20%Controller', 'Response of PI Controller','Response of PID Controller','Response of PID(With Filter) Controller')
%% FIgure Seven %%%
figure
[Gcp_d0,Kpp_d0,Tip_d0,Tdp_d0]=mychrtune('P',[0.4167,0.76,1.96,10],'distrub',0)
[Gcp_d20,Kpp_d20,Tip_d20,Tdp_d20]=mychrtune('P',[0.4167,0.76,1.96,10],'distrub',20)
[Gcpi_d0,Kppi_d0,Tipi_d0,Tdpi_d0]=mychrtune('PI',[0.4167,0.76,1.96,10],'distrub',0)
[Gcpi_d20,Kppi_d20,Tipi_d20,Tdpi_d20]=mychrtune('PI',[0.4167,0.76,1.96,10],'distrub',20)
[Gcpid_d0,Kppid_d0,Tipid_d0,Tdpid_d0]=mychrtune('PID',[0.4167,0.76,1.96,10],'distrub',0)
[Gcpid_d20,Kppid_d20,Tipid_d20,Tdpid_d20]=mychrtune('PID',[0.4167,0.76,1.96,10],'distrub',20)
[Gcpidf_d0,Kppidf_d0,Tipidf_d0,Tdpidf_d0]= mychrtune('PIDF',[0.4167,0.76,1.96,10],'distrub',0)
[Gcpidf_d20,Kppidf_d20,Tipidf_d20,Tdpidf_d20]=mychrtune('PIDF',[0.4167,0.76,1.96,10],'distrub',20)
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]Srinibas Bhuyan (2023). A MATLAB Approach to study different types of Ziegler-Nichols P-I-D Controller Tuning Algorithm