Difference using lsim and simulink model transfer function block with equal transfer functions
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all, I am working on a model of an air fan. The input is a PWM signal between 0% and 100%, the output is fan speed in rpm. I have estimated transfer functions from measured data for two step responses: from 0%-15% and from 15%-20%. For the estimation I used data that starts at zero. So for 15%-20%, the input data range is actually from 0%-5%. For the simulation with lsim I use this data and tf and add the fan speed that it started with. This leads to very accurate results between measured values and simulated using lsim.
However I want to implement these transfer functions in a Simulink model. I use the same strategy as with lsim, but the results do not agree. 0-15 is the same but 15-20 is not. I use an S-function to alter the nominator and denominator of the transfer function block.
I understand it is difficult to answer this question without files, but the main question is: How can I get the same results as with lsim using a transfer function in Simulink?
Thanks in advance.
Best, Gijs
0 commentaires
Réponses (3)
Alexis Nguyen
le 15 Fév 2012
Hi Gijs,
Have you solved your problem? Could you please let me know the answer. I'm also trying to solve this.
Thanks
0 commentaires
Matheus WV
le 14 Sep 2020
I had a similar issue. In my case the problem was on the estimation. As data is discrete, MATLAB has to assume the values of the input variables between samples. As the property 'InterSample' was not specified, a First-order hold was assumed. Simulink, on the other side, uses a zero-order hold.
Changing the data from
id_data = iddata(i_is,V_is,Ts);
to
id_data = iddata(i_is,V_is,Ts,'InterSample','zoh');
solved the problem.
0 commentaires
Voir également
Catégories
En savoir plus sur Preprocess Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!