Implementing temperature varying parameters in simulink and MATLAB

Hello,
I'm currently trying to model a DC Motor in MATLAB 2015a with temperature varying parameters. The parameters here are the resistance of the armature (R_a) and the motor constant (K_m). The goal is to implement a model which accurately represents the variation of these parameters with temperature during the operation of the motor (an initial reference model if you will, something which would accurately reflect the measured values). The end goal is to develop a parameter estimator which will correctly predict the variation of the above mentioned parameters.
Ideally I would like the temperature to vary with the simulation time in Simulink, so that I could then write a few if-else condition statements in a MATLAB script which would then select the correct motor parameters to reflect the temperature change.
How do I implement a "Temperature signal" in Simulink which changes with the simulation time?
Thanks in advance,
Vijay

 Akzeptierte Antwort

Mark McBroom
Mark McBroom am 23 Mär. 2016

1 Stimme

OK. I understand better your problem. A MATLAB S-Function can be used to do this. Attached is an example in which the MATLAB Sfunction uses 3 different techniques for adjusting the Gain parameter in a gain block at different times during the 10 sec simulation. First uses set_param to change param directly. Second and third change workspace variable used by Gain block.

Weitere Antworten (1)

Mark McBroom
Mark McBroom am 19 Mär. 2016

0 Stimmen

Have you considered using the clock block to get current simulation time?

1 Kommentar

Vijaya Bhaskar
Vijaya Bhaskar am 19 Mär. 2016
Bearbeitet: Vijaya Bhaskar am 19 Mär. 2016
I have considered using it, but I don't know how that would help me update the system parameters in real time. From what I read, I can write the simulation time to an m-file, but how do I access it in real time?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by