Commit 4f4c694f authored by Kristian Soltesz's avatar Kristian Soltesz
Browse files

Added code for computing tau and Tar.

parent 82251aee
% The relative dead time tau = L/(L+T) and arrest time Tar = T+L are
% defined for first order time delayed SISO LTI systems
%P(s) = K/(s*T+1)*exp(-s*L)
%
% This code computes generalizations of tau and Tar for arbitrary SISO LTI
% systems, which can be either discrete or continuous.
% Written by kristian@control.lth.se
% Downloaded from git@gitlab.control.lth.se:kristian/PIDopt.git
function [tau,Tar,L] = getTauTar(P)
[~,t] = step(P);
t = linspace(0,t(end),1e5);
[y,t] = step(P,t);
ydot = impulse(P,t);
[~,i] = max(ydot);
tmax = t(i);
ymax = y(i);
L = tmax-ymax/ydot(i);
if dcgain(P) == inf
tau = 0;
Tar = inf;
return
end
P = P/dcgain(P);
if P.Ts > 0
P = d2c(P,'zoh')
end
Tar = sum(-1./pole(P))-sum(-1./zero(P))+totaldelay(P);
T = Tar-L;
tau = L/Tar;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment