📄 pid_tuner.m
字号:
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ah_tune(key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_ah_tune(key1,key2,vars);
end
end
x_result=[Kp,Ti,Td,1];
case 3
switch key2
case 1
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_han_tune(key1,key2,vars);
case 2
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ww_tune(key1,key2,vars);
case 3
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_cl_tune(key1,key2,vars);
case 4
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_cl_tune(key1,key2,vars);
end
case 2
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 3
vars=[K L T 3];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
end
case 3
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 3
vars=[K L T 3];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 4
vars=[K L T 4];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 5
vars=[K L T 5];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 6
vars=[K L T 6];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
end
case 4
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_tr_tune(key1,key2,vars);
case 2
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 3
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 4
vars=[K L T 3];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 5
vars=[K L T 4];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 6
vars=[K L T 5];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 7
vars=[K L T 6];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 8
vars=[K L T 7];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 9
vars=[K L T 8];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 10
vars=[K L T 9];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 11
vars=[K L T 10];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
case 12
vars=[K L T 11];
[Kp,Ti,Td,key,lb]=pid_ts_tune(key1,key2,vars);
end
case 5
set([handles.h_txtLam,handles.h_edtLam],'Visible','on');
lam=get(handles.h_edtLam,'String');
lambda=str2num(lam);
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_chi_tune(lambda,key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_chi_tune(lambda,key1,key2,vars);
end
case 6
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_sh_tune(G,key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_sh_tune(G,key1,key2,vars);
end
case 7
switch key3
case 1
vars=[K L T 1];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 2
vars=[K L T 2];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
case 3
vars=[K L T 3];
[Kp,Ti,Td,key,lb]=pid_ks_tune(key1,key2,vars);
end
end
x_result=[Kp,Ti,Td,2];
end
set(handles.h_btnDesign,'UserData',{x_result,key1,key2,key3,key,lb})
h_btnDisplay_Callback(hObject, eventdata, handles);function h_lstPIPID_Callback(hObject, eventdata, handles)key1=get(handles.h_lstPIPID,'Value');
key2=get(handles.h_lstApply,'Value');
str='';
switch key1
case 1
switch key2
case 1
str=str2mat('Ziegler & Nichols',...
'Hazebroek & Van der Waerden',...
'Astrom & Hagglund_ultimate cycle Ziegler-Nichols equivalent',...
'Astrom & Hagglund_20%overshoot',...
'Cohen & Coon',...
'Wolfe',...
'Murrill',...
'McMillan',...
'St. Clair');
case 2
str=str2mat('Minimum IAE (Murrill)',...
'Minimum IAE (Shinskey)',...
'Minimum IAE (Huang et al)',...
'Minimum ISE (Hazebroek & Van der Waerden)',...
'Minimum ISE (Murrill)',...
'Minimum ISE (Zhuang & Atherton)',...
'Minimum ITAE (Murrill)',...
'Minimum ISTSE (Zhuang & Atherton)',...
'Minimum ISTES (Zhuang & Atherton)',...
'Chien et al-regulator_0% overshoot',...
'Chien et al-regulator_20% overshoot',...
'Minimum IAE-regulator-Pemberton (Smith & Corripio)');
case 3
str=str2mat('Minimum IAE (Rovira et al)',...
'Minimum IAE (huang et al)',...
'Minimum ISE (Zhuang & Atherton)',...
'Minimum ISE (Khan & Lehman)',...
'Minimum ITAE (Rovira et al)',...
'Minimum ISTSE (Zhuang & Atherton)',...
'Minimum ISTES (Zhuang & Atherton)',...
'Chien et al-servo_0% over shoot',...
'Chien et al-servo_20% over shoot',...
'Minimum IAE-servo (Smith & Corripio)',...
'5% overshoot-servo (Smith & Corripio)',...
'5% overshoot-servo (Hang et al)');
case 4
str=str2mat('Haalman',...
'Regulator-Gorecki et al [real pole and max attainable multiplicity]',...
'Regulator-Gorecki et al [low freq.]',...
'Chiu et al',...
'Astrom et al',...
'Schneider [Closed loop response damping factor=1]',...
'Schneider [Closed loop response damping factor=0.6]',...
'McAnany',...
'Leva et al',...
'Khan & Lehman',...
'Hang et al [GM=10.5,PM=pi/6]',...
'Hang et al [GM=10.5,PM=pi/4]',...
'Hang et al [GM=10.5,PM=pi/3]',...
'Hang et al [GM=10.5,PM=3*pi/8]',...
'Hang et al [GM=10.5,PM=2*pi/5]',...
'Gain and margin (Ho et al) [Am=2.0,Φm=pi/4]',...
'Gain and margin (Ho et al) [Am=3.0,Φm=pi/3]',...
'Gain and margin (Ho et al) [Am=4.0,Φm=7*pi/18]',...
'Tan et al',...
'Symmetrical optimum principle (Voda & Landau)',...
'Friman & Waller',...
'Voda & Landau',...
'Smith',...
'Modulus optimum principle (Cox et al)',...
'Cluett & Wang [Closed loop time constant=4*L]',...
'Cluett & Wang [Closed loop time constant=2*L]',...
'Cluett & Wang [Closed loop time constant=1.33*L]',...
'Cluett & Wang [Closed loop time constant=L]',...
'Cluett & Wang [Closed loop time constant=0.8*L]',...
'Cluett & Wang [Closed loop time constant=0.67*L]',...
'Abbas');
case 5
str=str2mat('Brambilla et al',...
'Rivera et al',...
'Rivera et al alternative',...
'Chien',...
'Thomasson',...
'Fruehauf et al',...
'Ogawa [Closed loop peak gain=1.4,20% uncertainty ]',...
'Ogawa [Closed loop peak gain=1.4,33% uncertainty ]',...
'Ogawa [Closed loop peak gain=1.4,50% uncertainty ]',...
'Lee et al');
case 6 str=str2mat('McMillan',...
'Regulator-minimum IAE (Shinskey) [First Function ]',...
'Regulator-minimum IAE (Shinskey) [Second Function ]',...
'Regulator-nearly minimum IAE,ISE,ITAE (Hwang) [Decay ratio=0.15]',...
'Regulator-nearly minimum IAE,ISE,ITAE (Hwang) [Decay ratio=0.2]',...
'Regulator-nearly minimum IAE,ISE,ITAE (Hwang) [Decay ratio=0.25]',...
'Servo-small IAE (Hwang) [First Function]',...
'Servo-small IAE (Hwang) [Second Function]',...
'Servo-small IAE (Hwang) [Third Function]',...
'Servo-minimum ISTSE (Zhuang & Atherton)',...
'Regulator-minimum ISTSE (Zhuang & Atherton)',...
'Servo-nearly minimum IAE & ITAE (Hwang & Fang)',...
'Regulator-nearly minimum IAE & ITAE (Hwang & Fang)',...
'Simultaneous Servo/regulator (Hwang & Fang)');
case 7
str=str2mat('Astrom & Hagglund [Ms=1.4-dominant pole design]',...
'Astrom & Hagglund [Ms=2.0-dominant pole design]',...
'Astrom & Hagglund-modified Ziegler-nichols');
end
case 2
switch key2
case 1
str=str2mat('Ziegler & Nichols',...
'Astrom & Hagglund',...
'Parr',...
'Chien et al-regulator_0% overshoot',...
'Chien et al-regulator_20% overshoot',...
'Chien et al-servo_0% overshoot',...
'Chien et al-servo_20% overshoot',...
'Three constrains method-Murrill',...
'Cohen & Coon',...
'Sain & Ozgen');
case 2
str=str2mat('Minimum IAE (Murrill)',...
'Modified minimum IAE (Cheng & Hung)',...
'Minimum ISE (Murrill)',...
'Minimum ISE (Zhuang & Atherton)',...
'Minimum ITAE (Murrill)',...
'Minimum ISTSE (Zhuang & Atherton)',...
'Minimum ISTES (Zhuang & Atherton)');
case 3
str=str2mat('Minimum IAE (Rovira et al)',...
'Minimum IAE (Wang et al)',...
'Minimum ISE (Wang et al)',...
'Minimum ISE (Zhuang & Atherton)',...
'Minimum ITAE (Rovira et al)',...
'Modified minimum ITAE (Cheng & Hung)',...
'Minimum ITAE (Wang et al)',...
'Minimum ISTSE (Zhuang & Atherton)',...
'Minimum ISTES (Zhuang & Atherton)');
case 4
str=str2mat('Regulator-min.IAE (Smith & Corripio)',...
'Servo-min.IAE (Smith & Corripio)',...
'Servo-5% overshoot (Smith & Corripio)',...
'Suyama',...
'Gain and phase margin (Zhuang & Atherton)',...
'Abbas',...
'Servo-min.ISE (Ho et al)',...
'Regulator-min.ISE (Ho et al)');
case 5
str=str2mat('Brambilla et al',...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -