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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pid_design.m

?? 反饋控制CtrlLAB工具箱-MATLAB-Toolbox
?? M
?? 第 1 頁 / 共 2 頁
字號:
%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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女在线视频一区| 成人黄色777网| 成人午夜视频在线观看| 欧美日韩性生活| 亚洲欧洲一区二区在线播放| 青青草精品视频| 日本高清不卡一区| 久久久综合网站| 日本欧美大码aⅴ在线播放| 成人动漫一区二区| 久久久欧美精品sm网站| 日韩电影在线免费观看| 欧美怡红院视频| 国产精品国产自产拍高清av王其 | 成人一级黄色片| 日韩欧美国产综合| 天天操天天干天天综合网| 色综合天天综合网国产成人综合天| 久久亚洲一区二区三区四区| 三级成人在线视频| 欧美日韩国产bt| 亚洲一区二区五区| 欧美在线你懂的| 亚洲一区影音先锋| 91国模大尺度私拍在线视频| 最新不卡av在线| av不卡在线播放| 亚洲欧美综合另类在线卡通| 国产盗摄视频一区二区三区| 国产日韩欧美精品一区| 国产盗摄女厕一区二区三区| 中文字幕免费不卡在线| 懂色av一区二区三区免费看| 欧美激情中文字幕| 97精品视频在线观看自产线路二| 国产精品亲子乱子伦xxxx裸| 成人av午夜电影| 中文字幕一区二区三区四区| 色综合天天综合网天天看片| 亚洲成av人片一区二区三区| 欧美日韩成人综合在线一区二区| 丝袜美腿成人在线| 欧美videossexotv100| 国产成人亚洲精品青草天美 | 岛国一区二区在线观看| 国产精品沙发午睡系列990531| 成人aaaa免费全部观看| 亚洲天天做日日做天天谢日日欢| 91官网在线免费观看| 日本美女一区二区三区视频| 精品国产91乱码一区二区三区| 国产精品资源在线看| 中文字幕亚洲一区二区va在线| 欧美最猛黑人xxxxx猛交| 免费日韩伦理电影| 日本一区二区免费在线| 欧美私人免费视频| 久草在线在线精品观看| 亚洲欧洲另类国产综合| 在线播放欧美女士性生活| 国产一区二区0| 一区二区三区鲁丝不卡| 日韩欧美在线一区二区三区| 国产成人高清视频| 亚洲免费观看高清| 精品成人在线观看| 色94色欧美sute亚洲13| 麻豆国产精品视频| 亚洲精品国产无套在线观| 91精品国产一区二区三区香蕉| 国产激情视频一区二区三区欧美| 亚洲靠逼com| 久久久蜜臀国产一区二区| 欧美日韩一区二区欧美激情| 丁香婷婷深情五月亚洲| 五月天激情综合| 最好看的中文字幕久久| 欧美成人性战久久| 欧美色视频在线观看| 国产成a人亚洲| 麻豆精品新av中文字幕| 一区二区三区免费网站| 国产精品乱子久久久久| 欧美不卡在线视频| 欧美另类z0zxhd电影| 99久久免费国产| 国产成人综合在线播放| 日本成人在线网站| 亚洲一线二线三线久久久| 国产精品久99| 国产精品久久久久aaaa| 国产视频一区二区在线| 日韩美女主播在线视频一区二区三区| 色综合久久综合中文综合网| 国产成人精品免费| 韩国精品免费视频| 精品一区二区国语对白| 视频一区二区中文字幕| 亚洲一级二级三级在线免费观看| 国产精品久久久久久久久图文区| 久久欧美一区二区| 精品国产区一区| 欧美电影免费观看高清完整版在| 在线不卡免费欧美| 欧美高清视频一二三区| 欧美日韩国产综合久久| 欧美三区在线视频| 欧美色欧美亚洲另类二区| 欧美午夜电影网| 欧美日韩亚洲另类| 欧美日韩国产三级| 欧美一区二区免费观在线| 欧美精品一级二级三级| 777欧美精品| 日韩欧美另类在线| 久久精品一区二区| 中文字幕精品一区二区精品绿巨人 | 亚洲电影视频在线| 亚洲国产视频一区| 首页国产欧美久久| 麻豆精品在线观看| 国产一区二区三区久久久| 国产精品综合一区二区三区| 国产麻豆午夜三级精品| 国产成人日日夜夜| 色综合久久综合网欧美综合网| 欧美在线999| 欧美一区二区三区免费视频| 欧美zozo另类异族| 欧美极品另类videosde| 亚洲猫色日本管| 天天爽夜夜爽夜夜爽精品视频| 麻豆精品在线视频| 成人黄动漫网站免费app| 在线国产亚洲欧美| 欧美成人高清电影在线| 中文字幕乱码日本亚洲一区二区| 亚洲欧美日韩系列| 亚洲影院理伦片| 精品一区二区三区在线播放| 国产成人午夜视频| 欧亚洲嫩模精品一区三区| 日韩欧美www| 自拍偷拍欧美激情| 日本不卡一二三| 菠萝蜜视频在线观看一区| 欧美三级韩国三级日本三斤| 精品处破学生在线二十三| 综合久久久久综合| 久久成人免费网| av资源站一区| 欧美大白屁股肥臀xxxxxx| 国产精品久久久久久久久免费桃花| 亚洲国产视频一区| 成人综合婷婷国产精品久久 | 国产片一区二区| 亚洲男人都懂的| 精品影视av免费| 欧美综合色免费| 精品粉嫩超白一线天av| 一区二区不卡在线视频 午夜欧美不卡在| 美女国产一区二区| 色999日韩国产欧美一区二区| 久久久久亚洲综合| 午夜伊人狠狠久久| av午夜一区麻豆| 精品成人a区在线观看| 亚洲一卡二卡三卡四卡 | 中文字幕一区二区5566日韩| 免费成人在线影院| 91福利资源站| 中日韩av电影| 狠狠色丁香婷综合久久| 欧美欧美欧美欧美| 亚洲免费在线观看| 粉嫩欧美一区二区三区高清影视| 日韩欧美国产麻豆| 午夜久久久久久久久| 99精品桃花视频在线观看| 2014亚洲片线观看视频免费| 日韩精品欧美精品| 欧美性感一类影片在线播放| 国产精品免费aⅴ片在线观看| 老司机午夜精品| 91精品啪在线观看国产60岁| 亚洲狠狠丁香婷婷综合久久久| 国产成人aaa| 久久久久久**毛片大全| 精品综合久久久久久8888| 69久久99精品久久久久婷婷 | 日韩一二三四区| 日韩国产精品91| 欧美军同video69gay| 亚洲成人在线观看视频| 欧美在线观看一二区| 五月开心婷婷久久| 欧美乱熟臀69xxxxxx| 免费黄网站欧美| 精品粉嫩aⅴ一区二区三区四区| 免费高清视频精品|