# 一种对不同类型齐格勒-尼科尔斯 P-I-D 控制器调谐算法研究(Matlab代码实现)

+关注继续查看

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势：🌞🌞🌞博客内容尽量做到思维缜密，逻辑清晰，为了方便读者。

⛳️座右铭：行百里者，半于九十。

📋📋📋本文目录如下：🎁🎁🎁

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码及文章讲解

# 💥1 概述

• 传统控制器 • 非常规控制器 作为传统控制器，我们可以计算多年来已知的控制器

，例如ON-OFF，P，PI，PD，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

# 🌈4 Matlab代码及文章讲解

|
3月前
|

【红外图像】利用红外图像处理技术对不同制冷剂充装的制冷系统进行性能评估（Matlab代码实现）
【红外图像】利用红外图像处理技术对不同制冷剂充装的制冷系统进行性能评估（Matlab代码实现）
26 0
|
3月前
|

【视频去噪】基于全变异正则化最小二乘反卷积是最标准的图像处理、视频去噪研究（Matlab代码实现）
【视频去噪】基于全变异正则化最小二乘反卷积是最标准的图像处理、视频去噪研究（Matlab代码实现）
66 0
|
3月前
|

47 0
|
3月前
|

62 0
|
3月前
|

【TGV 正则器的快速计算方法】通过FFT的总（广义）变化进行图像去噪（Matlab代码实现）
【TGV 正则器的快速计算方法】通过FFT的总（广义）变化进行图像去噪（Matlab代码实现）
38 0
|
3月前
|

34 0
|
3月前
|

47 0
|
3月前
|

39 0
|
3月前
|

40 0
|
3月前
|

【交互式阈值二进制图像】采用彩色或单色图像通过交互/手动方式阈值单色图像或彩色图像的单个色带研究（Matlab代码实现）
【交互式阈值二进制图像】采用彩色或单色图像通过交互/手动方式阈值单色图像或彩色图像的单个色带研究（Matlab代码实现）
56 1