过程控制-1-绪论

本章学习要求 1.过程控制的任务与目标 2.过程控制系统及其组成 3.过程控制系统的特点及分类 4.过程控制的质量指标 5.过程控制的发展状况

1.1 过控的任务与目标

1.2 过控系统及其组成

1.3 过控系统特点及分类

1.4 过控系统的质量指标

image-20250224184632593image-20250224184640084

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
function [C,fval]=optimPID(G,ctype,idx)
% OPTIMPID Optimal PID tuning based on integral performance criteria
%
% [C,fval]=optimPID(G,ctype,idx) returns the optimal PID paraters based on
% specified controller type and performance criterion.
%
% Inputs:
% G: The plant model as an LTI object
% ctype: Controler type (1 = P, 2* = PI, 3 = PID)
% idx: Performance criterion
% 1 - ISE
% 2 - IAE
% 3 - ITSE
% 4* - ITAE
% Outputs:
% C: Controller transfer function as an LTI object
% fval: optimal performance criterion
% Example:
%{
G=tf(1,[1 6 11 6 0]);
C1=optimPID(G,3,1); % PID-Control, ISE index
C2=optimPID(G,3,2); % PID-Control, IAE index
C3=optimPID(G,3,3); % PID-Control, ITSE index
C4=optimPID(G,3,4); % PID-Control, ITAE index
K=znpidtuning(G,3); % Ziegler-Nichols stability margin tuning
t=0:0.1:30;
y1=step(feedback(C1*G,1),t);
y2=step(feedback(C2*G,1),t);
y3=step(feedback(C3*G,1),t);
y4=step(feedback(C4*G,1),t);
y=step(feedback(G*(K.kc*(1+tf(1,[K.ti 0])+tf([K.td 0],1))),1),t);
plot(t,y1,t,y2,t,y3,t,y4,t,y,'--','Linewidth',2)
legend('ISE','IAE','ITSE','ITAE','Z-N')
grid
%}
% By Yi Cao at Cranfield University on 8th Feb 2008
%
% Check inputs and outputs
error(nargchk(1,3,nargin));
error(nargoutchk(0,3,nargout));
assert(isa(G,'lti'),'G must be an LTI object.');
% default setting
if nargin<3
idx=4;
end
if nargin<2
ctype=2;
end
% Initial parameters using stability based tuning
[Gm,Pm,Wcg]=margin(G);
pu=2*pi/Wcg;
ku=Gm;
x=ku/2;
den=1;
if ctype==2
x=ku/2.2*[1 1.2/pu];
den=[1 0];
elseif ctype==3
x=ku*2/pu/1.7*[pu/8 1 2/pu];
den=[1 0];
end
% closed-loop response of initial tuning to find dt and tend
[y,t]=step(feedback(tf(x,den)*G,1));
% reduce dt by half for possible improvement in response speed
dt=(t(2)-t(1))/2;
% exptend tend twice to ensure closed-loop stability
t=0:dt:t(end)*2;
% redefine cost function to facilitate optimization
cost = @(x) iecost(x,G,den,t,dt,idx);
opt=optimset('display','off','TolX',1e-9,'TolFun',1e-9,'LargeScale','off');
flag=0;
while ~flag % if flag=0 restart optimization from current solution
[x,fval,flag]=fminunc(cost,x,opt);
end
% the transfer function of optimal PID controller
C=tf(x,den);
function J=iecost(x,G,den,t,dt,idx)
% control error of step response
e=1-step(feedback(G*tf(x,den),1),t);
% performance calculation
switch idx
case 1 % ISE
J=e'*e*dt;
case 2 % IAE
J=sum(abs(e)*dt);
case 3 % ITSE
J=(t.*e'*dt)*e;
case 4 % ITAE
J=sum(t'.*abs(e)*dt);
end

示例

Example 1:

Consider a 4th-order system:

Compare closed-loop performance of PID controllers designed with different performance indices.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
G=zpk([],[-3 -2 -1 0],1);   % The plant
C1=optimPID(G,3,1); % PID-Control, ISE index
C2=optimPID(G,3,2); % PID-Control, IAE index
C3=optimPID(G,3,3); % PID-Control, ITSE index
C4=optimPID(G,3,4); % PID-Control, ITAE index
K=znpidtuning(G,3); % Ziegler-Nichols stability margin tuning
t=0:0.1:30;
y1=step(feedback(C1*G,1),t); %Closed-loop step response of C1
y2=step(feedback(C2*G,1),t); %Closed-loop step response of C2
y3=step(feedback(C3*G,1),t); %Closed-loop step response of C3
y4=step(feedback(C4*G,1),t); %Closed-loop step response of C4
%Closed-loop step response of K
y=step(feedback(G*(K.kc*(1+tf(1,[K.ti 0])+tf([K.td 0],1))),1),t);
plot(t,y1,t,y2,t,y3,t,y4,t,y,'--','Linewidth',2)
legend('ISE','IAE','ITSE','ITAE','Z-N','Location','Best')
grid

% The comparison shows that the ITSE index leads to the best PID
% controller.

1.5 过控的发展状况

课堂作业