亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pid_design.m

?? 反饋控制CtrlLAB工具箱-MATLAB-Toolbox
?? M
?? 第 1 頁 / 共 2 頁
字號(hào):
%PID_DESIGN is the function used in CtrlLAB for PID controller design.  In this 
%function, different tuning algorithms are implemented, and details can be referred 
%from the lecture notes.
%
%Available Algorithms:
%
%   1 for Ziegler-Nichols tuning formula
%   2-4 for optimum setting, with ISE, ISTE and IST2E
%   5 for optimum gain-phase margin setting
%   7 for refined Ziegler-Nichols tuning formula
%   8 for Cohen-Coon tuning formula
%   9 for Chien-Hoones-Reswick tuning algorithm
%  10 for modified Ziegler-Nichols tuning
%  11 for PID with internal model control structure
%
%bPIDType variable for different PID structures
%
%   1 for P, 2 for PI, 3 for normal PID
%   4 for PID with D in feedback
%   5 for refined Ziegler-Nichols tuning structure
%
%bFodIdent variable for first order delay approximation
%
%   1 for optimal reduction based method
%   2 for frequency response based method
%   3 for transfer function based method
%
%Available lists of functions under pid_design()
%
%   design_pid --- to administrate PID tuning algorithms
%   pid_dat_win -- allows the user to set PID parameters manually
%   pid_set --- obtain the PID controller from the dialog box
%   proc_pid --- process PID parameters and set them to windows
%   ziegler_nic --- implements Ziegler-Nichols tuning formula
%   cohen_pid --- implements Cohen-Coon tuning formula
%   opt_pid --- implements optimum PID controller setting
%   rziegler_nic --- implements refined Ziegler-Nichols algorithm
%   otherpid -- administrates PID with other algorithms
%   chr_pid --- implements Chien-Hoones-Reswick tuning algorithm
%   imc_pid --- implements internal model control PID structure
%   display_pid -- displays the PID controller obtained
%   get_fod --- obtain the first-order plus delay approximation 
%   tf_derv --- obtain the first derivative of transfer function
%

%Designed by Professor Dingyu Xue
%School of Information Science and Engineering, Northeastern University
%Shenyang 110006, P R China
%Email: xue_dy@hotmail.com
%
%This module is for CtrllAB 3.0, (c) 1996-1999
%Last modified 5 October, 1999
%-------------------------------------------------------------------------

function pid_design(nTask,arg1)
switch nargin
case 0,    pid_dat_win;
   %enter the PID controller in a manual way, i.e., enter 
   %the PID parameters in the fialog box provided.
case 1,    design_pid(nTask);
   %for certain algorithms, if there is no extra parameters expected, the PID 
   %controller can be design directly.
case 2,    otherpid(nTask,arg1);   
   %if there are extra parameters expected in the design, then the parameters 
   %provided in the dialog box can be used in design.
end   

%---------------------------------------------------------------------
%design_pid is used to design PID using the selected tuning algorithm.
%---------------------------------------------------------------------
function design_pid(nTask)
g_main=figure(findobj('Tag','CtrlLABMain')); uu=get(g_main,'UserData');
g1=get(uu{1}(1),'UserData'); G1=tf(g1{2}); z=roots(G1.den{1}); G0=G1;
bFodIdent=extra_funs(5,5,'Checked',29:31); bPIDType=extra_funs(5,5,'Checked',23:26);
if length(find(real(z)>=0))>0
   %display error message for unstable plants 
   warndlg('Sorry, PID not available now for unstable plant','Warning: Design failed!'), 
   return
else
   %get gain/phase margins of the original plant
   g1=get(uu{1}(4),'UserData'); Td=g1{1}; nPade=g1{2};
   if Td>0, [nn,dd]=pade(Td,nPade); G1=G1*tf(nn,dd); end
   [Kc,pp,wg,wp]=margin(G1); den=G1.den{1};
   if any(2:5==nTask) & abs(den(end))<eps
      warndlg('There exists pole at s=0, PID controller not found!','Warning: Design failed!'), 
      return;   
   end
end

Tc=2*pi/wg; 
if any([2:4,7:11]==nTask)|(any([1,5]==nTask)&isfinite(Kc))
   %get the first order plus delay approximation to the plant
   switch bFodIdent
   case 1,
      extra_funs(12,'Optimal first-order delay model fitting ...');
      pause(0.0002);
      G_Sys=G1; G_Sys.Td=Td;
      G_red=mod_reduction(G_Sys,[0,1],[1,0,0,0,0],[2,1],[nPade,1]);
      [nc,dc,L]=tfdata(G_red,'v'); k=nc(2)/dc(2); T=dc(1)/dc(2); 
      delete(findobj('Name','Please Wait'));
   case 2, [k,L,T]=get_fod(G1); %frequency response based fitting
   case 3, [k,L,T]=get_fod(G1,1); %transfer function based fitting
   end
   NN=uu{7}(4);
   
   %design PID controller using different algorithms
   switch nTask
   case 1
      if isfinite(Kc), [Gc_Sys,H_Sys,Kp,Ti,Td]=ziegler_nic(bPIDType,[Kc,Tc,NN]);
      else, [Gc_Sys,H_Sys,Kp,Ti,Td]=ziegler_nic(bPIDType,[k,L,T,NN]); end
   case {8,9,10,11}
      if nTask==10, vars=[nTask,Kc,Tc,NN];
      else, vars=[nTask,k,L,T,NN,Kc,Tc]; end
      if nTask==8, [Gc_Sys,H_Sys,Kp,Ti,Td]=cohen_pid(bPIDType,[k,L,T,NN]);
      else, otherpid(vars); %allow an extra dialog box to rea specifications of design
      end
   case {2,3,4,7}
      if bPIDType==1 & bFodIdent==1, bPIDType=2; end
      if nTask==7, 
         [Gc_Sys,H_Sys,Kp,Ti,Td,beta]=rziegler_nic([k,L,T,NN,Kc,Tc]);
      else
         [Gc_Sys,H_Sys,Kp,Ti,Td]=opt_pid(bPIDType,1,[k,L,T,NN,nTask-1]);
      end
   case 5
      kappa=dcgain(G1)*Kc;
      if bPIDType==1, bPIDType=2; end
      [Gc_Sys,H_Sys,Kp,Ti,Td]=opt_pid(bPIDType,1,[Kc,Tc,kappa,NN]);
   end
else,
   warndlg('Sorry, PID not found for the plant','Warning: Design failed!'), 
   return;   
end

%if PID controller is design, call PID display & process function
if nTask==7, proc_pid(Gc_Sys,H_Sys,Kp,Ti,Td,NN,beta);
elseif any([1:5,8]==nTask), proc_pid(Gc_Sys,H_Sys,Kp,Ti,Td,NN); end

%-------------------------------------------------------------------------------
%pid_proc is used to save PID controller information and display the controller.
%-------------------------------------------------------------------------------
function proc_pid(Gc_Sys,H_Sys,Kp,Ti,Td,Nf,beta)

%write PID controller to the main window objects
h_main=findobj('Tag','CtrlLABMain'); uu=get(h_main,'UserData');
[nc,dc]=tfdata(Gc_Sys,'v'); set(uu{1}(2),'UserData',{1,Gc_Sys,mat2str(nc),mat2str(dc)});
if length(H_Sys)>0, 
   [nh,dh]=tfdata(H_Sys,'v'); set(uu{1}(3),'UserData',{1,H_Sys,mat2str(nh),mat2str(dh)});
else, set(uu{1}(3),'UserData',[]); end
uu{7}(1:3)=[Kp,Ti,Td]; if nargin==7, uu{7}(5)=beta; else, uu{7}=uu{7}(1:4); end
%display PID controller
set(h_main,'UserData',uu); display_pid;

%-------------------------------------------------------------------------------
%pid_dat_win is used to specify the parameters of PID controller manually from 
%the user.  The data will be passed in the interface in the 7-th UserData of the 
%main window.
%-------------------------------------------------------------------------------
function pid_dat_win

%read in PID parameters manually using the dialog box
h_win=findobj('Name','Enter PID parameters');
if length(h_win)==0
   uu=get(findobj('Tag','CtrlLABMain'),'UserData'); keyD=0;
   if strcmp(get(uu{5}(25),'Checked'),'on'), keyD=1; end
   if uu{7}(1)==0, K_p=1; T_i=Inf; T_d=0; N_f=10;
   else, K_p=uu{7}(1); T_i=uu{7}(2); T_d=uu{7}(3); N_f=uu{7}(4); end   
   h_win=figure('Units','normalized','Position',[0.24875 0.332 0.35 0.233],...
      'NumberTitle','off','Name','Enter PID Parameters','Tag','CtrlLABExtras',...
      'MenuBar','none','Color',0.8*[1,1,1],'Resize','off');
   extra_funs(1); display_str(0.05,0.83,'Proportional K_p',[0,0,0],'on',9);
   aText(1)=uicontrol('Style','Edit','String',num2str(K_p),...
      'Units','normalized','Position',[.39 .78 .25 .13],...
      'HorizontalAlignment','left','BackgroundColor',[1,1,1]);
   display_str(0.05,0.65,'Integral T_i',[0,0,0],'on',9);
   aText(2)=uicontrol('Style','Edit','String',num2str(T_i),...
      'Units','normalized','Position',[0.39 .60 .25 .13],...
      'HorizontalAlignment','left','BackgroundColor',[1,1,1]);
   display_str(0.05,0.47,'Derivative T_d',[0,0,0],'on',9);
   aText(3)=uicontrol('Style','Edit','String',num2str(T_d),...
      'Units','normalized','Position',[.39 .42 .25 .13],...
      'HorizontalAlignment','left','BackgroundColor',[1,1,1]);
   display_str(0.05,0.29,'Filter Constant N_f',[0,0,0],'on',9);
   aText(4)=uicontrol('Style','Edit','String',num2str(N_f),...
      'Units','normalized','Position',[.39 .24 .25 .13],...
      'HorizontalAlignment','left','BackgroundColor',[1,1,1]);
   [v,d]=version; v1=eval(v(1)); v2=eval(v(3)); v3=eval(v(5));
   if v2==2 & v3==0, strCheck='ToggleButton'; else, strCheck='CheckBox'; end 
   aText(5)=uicontrol('Style',strCheck,'String','D in Feedback','Value',keyD,...
      'Units','normalized','Position',[0.15 0.07 0.45 0.14],'BackgroundColor',0.8*[1,1,1]);
   hOK=uicontrol('Style','Pushbutton','String','Apply',...
      'Units','normalized','Position',[0.76 0.68 0.2 0.17],'Callback','pid_design(2);');
   hCancel=uicontrol('Style','Pushbutton','String','Cancel',...
      'Units','normalized','Position',[0.76 0.48 0.2 0.17],'Callback','close(gcf);');
   set(gcf,'UserData',aText);
else, figure(h_win); end

%----------------------------------------------------------------------------
%pid_set is used to obtain the PID controller parameters from the dialog box.
%----------------------------------------------------------------------------
function pid_set()
%get PID parameters from the dialog box
uu0=get(gcf,'UserData');
K_p=eval(get(uu0(1),'String')); T_i=eval(get(uu0(2),'String'));
T_d=eval(get(uu0(3),'String')); N_f=eval(get(uu0(4),'String'));
keyD=get(uu0(5),'Value'); close(gcf);

figure(findobj('Tag','CtrlLABMain'));
if keyD==1, extra_funs(4,5,'Checked',26,23:25);
else, extra_funs(4,5,'Checked',25,[23:24,26]); end   
proc_pid(Gc_Sys,H_Sys,K_p,T_i,T_d,N_f);

%------------------------------------------------------------------------------
%ziegler_nic is used to design PID controllers using the Ziegler-Nichols algorithm.
%------------------------------------------------------------------------------
function [Gc_Sys,H_Sys,Kp,Ti,Td]=ziegler_nic(key,vars)
Ti=0; Td=0;
switch length(vars)
case 3, 
   K=vars(1); Tc=vars(2); N=vars(3);
   switch key
   case 1, Kp=0.5*K; 
   case 2, Kp=0.4*K; Ti=0.8*Tc; 
   case {3,4}, Kp=0.6*K; Ti=0.5*Tc; Td=0.12*Tc; 
   end
case 4, 
   K=vars(1); L=vars(2); T=vars(3); N=vars(4); a=K*L/T; 
   switch key
   case 1, key==1,  Kp=1/a; 
   case 2, Kp=0.9/a; Ti=3.33*L; 
   case {3,4}, Kp=1.2/a; Ti=2*L; Td=L/2; 
   end
case 5, 
   K=vars(1); Tc=vars(2); rb=vars(3); pb=pi*vars(4)/180; 
   N=vars(5); Kp=K*rb*cos(pb); 
   if key==2, Ti=-Tc/(2*pi*tan(pb)); 
   elseif key==3 | key==4, Ti=Tc*(1+sin(pb))/(pi*cos(pb)); Td=Ti/4; end
end
switch key
case 1, Gc_Sys=tf(Kp,1); H_Sys=[];
case 2, Gc_Sys=tf(Kp*[Ti,1],[Ti,0]); H_Sys=[];
case 3
   dd=Ti*[Td/N,1,0]; nn=[Kp*Ti*Td*(N+1)/N, Kp*(Ti+Td/N), Kp];
   Gc_Sys=tf(nn,dd); H_Sys=[];
case 4
   d0=sqrt(Ti*(Ti-4*Td)); Ti0=Ti; 
   Kp=0.5*(Ti+d0)*Kp/Ti; Ti=0.5*(Ti+d0); Td=Ti0-Ti; nn=Kp*[Ti,1]; dd=[Ti,0]; 
   nH=[(1+Kp/N)*Ti*Td, Kp*(Ti+Td/N), Kp]; dH=Kp*conv([Ti,1],[Td/N,1]);
   Gc_Sys=tf(nn,dd); H_Sys=tf(nH,dH);
end

%------------------------------------------------------------------------
%cohen_pid is use to design PID controller using the Cohen-Coon algorithm.
%------------------------------------------------------------------------
function [Gc_Sys,H_Sys,Kp,Ti,Td]=cohen_pid(key,vars)
Ti=0; Td=0; K=vars(1); L=vars(2); T=vars(3); N=vars(4); a=K*L/T; tau=L/(L+T); 
switch key
case 1, Gc_Sys=tf((1+0.35*tau/(1-tau))/a,1); H_Sys=[];
case 2, 
   Kp=0.9*(1+0.92*tau/(1-tau))/a; Ti=(3.3-3*tau)*L/(1+1.2*tau);
   Gc_Sys=tf(Kp*[Ti,1],[Ti,0]); H_Sys=[];
case {3,4}
   Kp=1.35*(1+0.18*tau/(1-tau))/a; Ti=(2.5-2*tau)*L/(1-0.39*tau); Td=0.37*(1-tau)*L/(1-0.81*tau); 
   if key==3
      dd=Ti*[Td/N,1,0]; nn=[Kp*Ti*Td*(N+1)/N, Kp*(Ti+Td/N), Kp]; Gc_Sys=tf(nn,dd); H_Sys=[];
   elseif key==4

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影在线一区二区| 美女精品一区二区| 日韩欧美在线不卡| 国产99久久久久久免费看农村| 久久久亚洲午夜电影| 成人国产精品免费观看动漫| 亚洲欧洲一区二区在线播放| 欧美日韩在线综合| 国产成人av一区二区三区在线| 亚洲三级电影网站| 欧美一级搡bbbb搡bbbb| 99精品视频中文字幕| 麻豆精品一区二区av白丝在线| 国产精品嫩草影院com| 91.成人天堂一区| 一本色道a无线码一区v| 久久99精品国产麻豆婷婷| 亚洲综合精品久久| 亚洲三级在线免费| 国产亚洲精品7777| 69堂精品视频| 欧美一级一区二区| 欧美日韩国产一级二级| 在线免费观看日本一区| 91影院在线观看| www.爱久久.com| 成人久久18免费网站麻豆 | 日本亚洲一区二区| 亚洲美女偷拍久久| 亚洲你懂的在线视频| 亚洲欧美色综合| 日韩理论片中文av| 亚洲免费av观看| 久久精品亚洲精品国产欧美kt∨ | 午夜私人影院久久久久| 亚洲精品ww久久久久久p站| 国产精品美女久久久久aⅴ国产馆| 精品粉嫩aⅴ一区二区三区四区| 日韩欧美一级二级三级久久久| 欧美人与禽zozo性伦| 色哟哟日韩精品| 欧美日韩三级一区| 日韩欧美国产综合在线一区二区三区| 正在播放亚洲一区| 日韩免费看的电影| 中文字幕一区二区三| 一区二区三区在线免费| 日韩av在线免费观看不卡| 免费观看久久久4p| 成人动漫视频在线| 欧美三级三级三级| 2021中文字幕一区亚洲| 国产精品黄色在线观看| 亚洲成人av一区二区三区| 看电影不卡的网站| 一本色道久久综合亚洲精品按摩| 欧美日韩精品一区二区三区 | 欧美色电影在线| 亚洲国产高清aⅴ视频| 樱桃视频在线观看一区| 美女国产一区二区三区| 97国产一区二区| 国产视频视频一区| 三级欧美在线一区| 99精品视频在线观看| 精品少妇一区二区三区视频免付费| 国产欧美日韩中文久久| 久久国内精品视频| 欧美日韩在线播放一区| 玉足女爽爽91| 粉嫩av一区二区三区在线播放| 欧美酷刑日本凌虐凌虐| 亚洲欧美日韩国产一区二区三区| 国产在线麻豆精品观看| 日韩欧美一区二区在线视频| 亚洲欧美一区二区三区国产精品 | 日韩一区二区在线看| 伊人性伊人情综合网| 不卡区在线中文字幕| 国产精品三级av| 成人一二三区视频| 国产精品国产三级国产a| 国产乱淫av一区二区三区| 久久亚洲精品小早川怜子| 国内外成人在线| 亚洲精品一区二区三区福利| 国产一区二区三区最好精华液| 欧美一区二区国产| 国产在线精品国自产拍免费| 精品伦理精品一区| 国产成人午夜精品影院观看视频 | 日产精品久久久久久久性色| 91.麻豆视频| 久久精品国产第一区二区三区| 欧美一区二区三区小说| 国产精品一二三区在线| 亚洲国产电影在线观看| 在线视频一区二区三区| 午夜不卡在线视频| 亚洲精品一区二区三区蜜桃下载| 国产老女人精品毛片久久| 国产精品成人一区二区艾草| 在线观看亚洲一区| 一区在线观看视频| 国产在线一区观看| 久久久美女艺术照精彩视频福利播放| 成人一道本在线| 日日夜夜免费精品视频| 久久美女艺术照精彩视频福利播放| 波多野结衣中文字幕一区二区三区| 亚洲最大的成人av| 久久精品人人做人人爽人人| 91高清在线观看| 国产成人av一区二区三区在线| 亚洲成精国产精品女| 国产精品电影一区二区| 91精品国产福利| 在线视频你懂得一区二区三区| 美女久久久精品| 天天影视色香欲综合网老头| 亚洲欧美在线视频观看| 欧美一区二区三区男人的天堂| 色综合色狠狠天天综合色| 国产一区二区美女诱惑| 日日夜夜精品视频天天综合网| 亚洲素人一区二区| 亚洲欧洲av在线| 亚洲人成在线观看一区二区| 欧美经典一区二区| 国产精品每日更新| 国产精品家庭影院| 成人欧美一区二区三区1314| 久久九九影视网| 久久久www成人免费毛片麻豆| 欧美一区二区视频在线观看| 色噜噜狠狠成人中文综合 | 亚洲精品一区二区三区精华液| 欧美群妇大交群中文字幕| 色综合久久综合网| 日韩高清一区二区| 性做久久久久久久免费看| 一区二区三区精品在线观看| 国产精品久久久久久久久免费相片 | 日韩理论在线观看| 国产精品欧美经典| 国产欧美日韩精品在线| 久久久亚洲精品石原莉奈| 555夜色666亚洲国产免| 欧美精品1区2区3区| 欧美一区二区三区精品| 欧美日韩国产乱码电影| 日韩一区二区高清| 亚洲精品在线一区二区| 国产精品日产欧美久久久久| 国产区在线观看成人精品| 欧美精品一区二区三区久久久| 国产人成亚洲第一网站在线播放 | 国产午夜精品在线观看| 亚洲国产岛国毛片在线| 一区二区三区蜜桃网| 亚洲一二三级电影| 久久99精品久久久久| 91捆绑美女网站| 欧美日本在线观看| 久久久久久夜精品精品免费| 中文字幕在线视频一区| 亚洲成人先锋电影| 久草中文综合在线| 欧美日本一区二区三区四区| 久久久久成人黄色影片| 亚洲综合一区在线| 国产精品91xxx| 欧美精三区欧美精三区| 国产日韩一级二级三级| 亚洲乱码国产乱码精品精98午夜 | 欧美三级蜜桃2在线观看| 久久精品亚洲精品国产欧美 | 久久久91精品国产一区二区精品| 一区二区高清免费观看影视大全 | 国产精品久久久久影院| 国产精品福利一区| 亚洲精品乱码久久久久久日本蜜臀| 国产精品传媒入口麻豆| 国产揄拍国内精品对白| 欧洲在线/亚洲| 中文字幕日韩一区二区| 精品午夜一区二区三区在线观看| 欧美性极品少妇| 一区二区三区免费看视频| 懂色av一区二区三区免费看| 精品国偷自产国产一区| 蜜桃av噜噜一区| 日韩免费电影一区| 久久精品国产精品青草| 日韩三级av在线播放| 免费欧美日韩国产三级电影| 一本久久综合亚洲鲁鲁五月天 | 亚洲一区二三区| 欧美日韩一区二区在线观看| 亚洲国产美女搞黄色|