clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
% Fungsi transfer Plant
Ts = 0.01;
J = 0.01;
b = 0.1;
Ke = 0.01;
Kt = 0.01;
R = 1;
L = 0.5;
syms s;
K = Ke;
num = K;
den = sym2poly((J*s+b)*(L*s+R)+K^2);
sys = tf(num,den);
Plant = c2d(sys,Ts,'zoh');
figure
step(Plant)
title('Respon Sistem Awal')
open_system('Runme')
open_system('Runme/Fuzzy PID')
% Mendesain kendali PID konvensional
open_system('Runme/PID')
C0 = pid(1,1,1,'Ts',Ts,'IF','B','DF','B'); % PID structure
C = pidtune(Plant,C0) % design PID
[Kp, Ki, Kd] = piddata(C); % Parameter PID
% Asumsikan sinyal referensi bernilai 1, sehingga max. error |e|=1
% Rentang input |E| adalah [-10 10], sehingga atur |GE| = 10.
GE = 100;
GCE = GE*(Kp-sqrt(Kp^2-4*Ki*Kd))/2/Ki; % Kp = GCU * GCE + GU * GE
GCU = Ki/GE; % Ki = GCU * GE
GU = Kd/GCE; % Kd = GU * GCE
% Fuzzy inference system Sugeno:
FIS = newfis('FIS','FISType','sugeno');
% Fungsi keanggotaan input error |E|:
FIS = addvar(FIS,'input','E',[-100 100]);
FIS = addmf(FIS,'input',1,'Negative','gaussmf',[70 -100]);
FIS = addmf(FIS,'input',1,'Positive','gaussmf',[70 100]);
% Fungsi keanggotaan input perubahan error |CE|:
FIS = addvar(FIS,'input','CE',[-100 100]);
FIS = addmf(FIS,'input',2,'Negative','gaussmf',[70 -100]);
FIS = addmf(FIS,'input',2,'Positive','gaussmf',[70 100]);
% Fungsi keanggotaan output |u|:
FIS = addvar(FIS,'output','u',[-200 200]);
FIS = addmf(FIS,'output',1,'Min','constant',-200);
FIS = addmf(FIS,'output',1,'Zero','constant',0);
FIS = addmf(FIS,'output',1,'Max','constant',200);
% Aturan Fuzzy
ruleList = [1 1 1 1 1;... % If |E| is Negative and |CE| is Negative then |u| is -200 (MIN)
1 2 2 1 1;... % If |E| is Negative and |CE| is Positive then |u| is 0 (ZERO)
2 1 2 1 1;... % If |E| is Positive and |CE| is Negative then |u| is 0 (ZERO)
2 2 3 1 1]; % If |E| is Positive and |CE| is Positive then |u| is 200 (MAX)
FIS = addrule(FIS,ruleList);
sim('Runme')
load('StepPID')
load('StepFP')
figure
plot(StepPID(1,1:401),StepPID(2,101:501))
hold on
plot(StepFP(1,1:401),StepFP(2,101:501))
hold off
title('Respon Sistem Setelah Dikendalikan')
legend('PID','Fuzzy-PID')
没有合适的资源?快使用搜索试试~ 我知道了~
matlab-基于simulink的PID控制器和模糊PID控制器控制输出对比-源码
共23个文件
mat:17个
xml:2个
slxc:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
4星 · 超过85%的资源 5 下载量 160 浏览量
2021-09-29
23:45:08
上传
评论 4
收藏 217KB RAR 举报
温馨提示
matlab_基于simulink的PID控制器和模糊PID控制器控制输出对比_源码
资源推荐
资源详情
资源评论
收起资源包目录
matlab_基于simulink的PID控制器和模糊PID控制器控制输出对比_源码.rar (23个子文件)
matlab_基于simulink的PID控制器和模糊PID控制器控制输出对比_源码
2基于simulink的PID控制器和模糊PID控制器控制输出对比
Runme.slx 23KB
SimFuzzyPID.slxc 5KB
StepFP.mat 68KB
slprj
_sfprj
Runme
_self
sfun
info
binfo.mat 17KB
SimFuzzyPID
_self
sfun
info
binfo.mat 17KB
EMLReport
sefqToBfBsTnREL6UpZXDNF
sT6uDApLbbaKrHBrmUmxFPB.mat 169KB
sT6uDApLbbaKrHBrmUmxFPB
sbv4axIHMPJsGcpodfyWg1
smHtnoB3GbjXse2IBghXPEG.mat 169KB
sNJfYJtzHaIlsumV0RBnS7E.mat 270KB
s2AZfEGTEB7fNS8hLaAEzWD.mat 169KB
sO2EpK920bXzoOGyJS1JBVG.mat 277KB
sjKVTwd4kCyafEBS8It3KTF.mat 270KB
smHtnoB3GbjXse2IBghXPEG
emlReportAccessInfo.mat 35KB
sjKVTwd4kCyafEBS8It3KTF
sefqToBfBsTnREL6UpZXDNF.mat 277KB
sNJfYJtzHaIlsumV0RBnS7E
sbv4axIHMPJsGcpodfyWg1.mat 277KB
sO2EpK920bXzoOGyJS1JBVG
s2AZfEGTEB7fNS8hLaAEzWD
sim
varcache
Runme
checksumOfCache.mat 392B
varInfo.mat 4KB
tmwinternal
simulink_cache.xml 376B
SimFuzzyPID
checksumOfCache.mat 392B
varInfo.mat 4KB
tmwinternal
simulink_cache.xml 376B
MotorFuzzyPID.m 2KB
Runme.slxc 5KB
StepPID.mat 68KB
共 23 条
- 1
资源评论
- hxxloveyl2023-03-31#标题与内容不符 #毫无价值
- weixin_427600652022-02-03用户下载后在一定时间内未进行评价,系统默认好评。
- cg_herost2022-12-09总算找到了想要的资源,搞定遇到的大问题,赞赞赞!
mYlEaVeiSmVp
- 粉丝: 1921
- 资源: 19万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功