AutotunerPID Toolkit | ![]() ![]() |
IDAREAS Identification of a FOPDT model using the method of the areas. MODEL = IDAREAS(Y,As,Ts) returns a structure describing the identified FOPDT (First Order Plus Dead Time) model in the form M(s) = m*exp(-s*L) / (1+s*T) The structure has the following fields MODEL.m, MODEL.L and MODEL.T with obvious meaning. The function requires the recorded step response Y, the amplitude of the step used for identification As and the sample time Ts. Author: William Spinelli (wspinell@elet.polimi.it) Copyright 2004 W.Spinelli $Revision: 1.0 $ $Date: 2004/02/27 12:00:00 $
0001 function model = idareas(y,As,Ts) 0002 %IDAREAS Identification of a FOPDT model using the method of the 0003 % areas. 0004 % 0005 % MODEL = IDAREAS(Y,As,Ts) returns a structure describing the identified 0006 % FOPDT (First Order Plus Dead Time) model in the form 0007 % M(s) = m*exp(-s*L) / (1+s*T) 0008 % The structure has the following fields MODEL.m, MODEL.L and MODEL.T 0009 % with obvious meaning. 0010 % The function requires the recorded step response Y, the amplitude of 0011 % the step used for identification As and the sample time Ts. 0012 % 0013 % Author: William Spinelli (wspinell@elet.polimi.it) 0014 % Copyright 2004 W.Spinelli 0015 % $Revision: 1.0 $ $Date: 2004/02/27 12:00:00 $ 0016 0017 % compute auxiliary parameters 0018 m = (y(end)-y(1))/As; % process gain 0019 0020 % if m<0 reverse the step response 0021 if m<0 0022 y = -y; 0023 end 0024 0025 % change this setting one can try to robustify the identification process 0026 % with noisy step response 0027 y1 = y(1); 0028 yN = y(end); 0029 0030 % reverse undershoot and overshoot 0031 y(y<y1) = y1; 0032 y(y>yN) = y(y>yN) - 2*(y(y>yN)-yN); 0033 0034 A0 = sum(yN-y)*Ts; % upper area 0035 it0 = fix(A0/abs(m)/Ts); % compute the index of the vector 0036 % (not the value of t0) 0037 A1 = sum(y(1:it0)-y1)*Ts; % lower area 0038 0039 % compute model parameters 0040 T = exp(1)*A1/abs(m); 0041 L = max((A0-exp(1)*A1)/abs(m),0); 0042 0043 model.L = L; 0044 model.T = T; 0045 model.m = m;
![]() | envgui | pid_autotuner | ![]() |