Filter löschen
Filter löschen

Simulation Pacing Raspberry Pi

3 Ansichten (letzte 30 Tage)
Paul Metcalf
Paul Metcalf am 17 Okt. 2020
Beantwortet: Mark McBroom am 21 Okt. 2020
I have a Simulink model where the base time unit is milliseconds (not seconds) and the base rate is 30ms.
In other words the value of my fundamental fixed step sampling time is 30 and I get quasi-real-time performance in Simulink when I enable Simulation Pacing with a value of 1000. (I have done this for numerous reasons which are outside the scope of this post).
Out of curiosity, I tried to perform executation profilling of my model on a Raspberry Pi to get an idea of resource usage.
However Simulink assumes the unit of the base rate is seconds hence runs the model 1000 times too slow on the board.
I can see in:
ert_main.c
the call to:
myRTOSInit(30.0,0);
with a baseRatePeriod of 30s.
Changing this value would solve the issue.
Is there any way to tell Simulink/Simulink Coder to automatically replace this line with:
myRTOSInit(0.03,0);

Antworten (1)

Mark McBroom
Mark McBroom am 21 Okt. 2020
The configuration parameter "Fixed-step size" units are seconds, so you need to set this parameter to 0.030 in order to get proper real-time behavior. To retain the quasi-realtime performance during simulation, change the simulation pacing setting to 1.
Thanks.
Mark.

Kategorien

Mehr zu Raspberry Pi Hardware finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by