-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpta_mdp.m
98 lines (77 loc) · 1.4 KB
/
pta_mdp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
% PTA_MDP
%
% Analytical method for controller tuning by Multiple dominant pole method
%
% [zr,ti,td] = pta_mdp(typ_m,typ_c,n,K,T)
%
% where
%
% typ_c - is variable for choice of the controller type
% typ_c == 2 for PI Controller
% typ_c == 3 for PID Controller
%
% n - is order of the proces model
% K - is gain of proces model
% T - is time constant of proces model
%
% typ_m == 2:
%
% K
% G(s) = -------*exp(-Ds)
% T*s+1
%
%
% typ_m == 3:
%
% K
% G(s) = -------------
% s*(T*s+1)^(n)
%
% 2011.03.17.
%
function [zr,ti,td] = pta_omm(typ_m,typ_c,n,K,T)
if(typ_m == 2)
% PI Controller
%
if(typ_c == 2)
zr = (1/K)*(((n-1)/(n+1))^(n-1));
ti = T*(((n+1)^2)/(4*n));
td = 0;
% PID Controller
%
elseif(typ_c == 3)
zr=((5*n-4)/(K*(n+1)))*(((n-2)/(n+1))^(n-2));
ti=(5*T*(5*n-4)*(n+1)^2)/(27*n*(n-1));
td=T*(n+1)*n/(2*(5*n-4));
else
zr = Inf;
ti = Inf;
td = Inf;
end
elseif(typ_m == 3)
% P Controller
%
if(typ_c == 1)
zr = 1/(K*T*(n+1)) * ((n)/(n+1))^(n);
ti = 1e10;
td = 0;
% PD Controller
%
elseif(typ_c == 4)
zr = (4*n)/(K*T*(n+1)^2)*((n-1)/(n+1))^(n-1);
ti = 1e10;
td = (T*(n+1)^2)/(4*n);
else
zr = Inf;
ti = Inf;
td = Inf;
end
% ---------- %
%
% No required model form found
%
else
zr = Inf;
ti = Inf;
td = Inf;
end