- On the Debug tab, select Information Overlays > Colors
- On the Modeling tab, click Update Model.
Is it possible to run px4_simulink_app module in multirate?
3 views (last 30 days)
Show older comments
Is it possible to run the px4_simulink_app module in multirate? For example, position controller part in px4_simulink_app module runs at 50hz, and rate controller and control allocation part runs at 1000hz
0 Comments
Accepted Answer
Ankur Bose
on 7 Apr 2025
Yes, you can schedule different algorithm in Simulink to execute at different rates. The rate at which a module runs is determined by its sample Time. So let's say ou have two modules in your Simulink model, the position controller and rate controller. To run position controller at the rate of 50 Hz, set the sample time of the source blocks in position controller to (1/50 = 0.02 seconds). Similarly for the rate controller module, you can set the sample time of the source blocks to (1/1000 = 0.001 seconds). After that,
Now you should see the different rates in the model along with the timing legend as mentioned in this documentation.
You dont need to set the sample time in each of the source blocks. You can just specify in one block and set the sample time as -1 in the rest of the blocks in the same mdule to inherit the sample time.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!