I have a datasheet (around 100 samples) where for a real SISO system (DC motor), I know the input and output. With tfest
command, I can form first order to nth order transfer function using the same data (loaded with iddata
function) for the system.
But in real life the system can be either 1st order or nth order.
Like in MATLAB, using same iddat
(contains the sample values), I can generate following transfer functions:
sys1 = tfest(iddat, 1, 1, 0.5); %number of zero=1, pole=1, 1st order system
sys1 =
From input "u1" to output "y1":
exp(-0.5*s) * (2.932 s - 0.1862) / (s + 1.082)
sys = tfest(iddat, 3, 2, 0.5);%number of zero=3, pole=2, 2nd order system
sys =
From input "u1" to output "y1":
exp(-0.5*s) * (0.1936 s^2 - 0.02193 s + 0.0006905) / ( s^3 + 0.07175 s^2 + 0.05526 s + 1.772e-13)
Can someone explain the scenario?
Fitting a model to an experimental data requires a minimum amount of knowledge about the underlying physical system.
Here you have a DC motor which probably does not have any zeros and no DC gain but you are forcing matlab to fit a proper 3rd order transfer function and it is giving you the closest one (not necessarily the correct one).
Instead remove the half a second delay and let the function find the time constant for you. So
tfest(iddat,1);
would be sufficient (or try with 3 if you are suspicious about the motor drive).