Simulink Model Reference: How to Initialize states provided data in a parent model?

5 vues (au cours des 30 derniers jours)
Alon Spinner
Alon Spinner le 21 Jan 2021
Réponse apportée : Vidip le 12 Avr 2024 à 8:32
Hi,
I am rather new to the model-reference techonlogy, and trying to grasp it.
I have a robot I wish to control.
For the simulation I created a control model and a plant model, both are referenced in the simulation model (parent to both)
The trajectory planning is done in the initalization block of the simulation provided some manual parameters (mainly starting and ending point).
I wish to transfer the initial state of the robot to the plant and controllers from the intialization block of the simulation.
I tried both the "state writer" block, and the "paramter writer block", and it seems they weren't created with this function in mind.
Any suggestions?
I could always write a matlab script to run before the simualtion starts, but I am trying to learn the techonlogy.

Réponses (1)

Vidip
Vidip le 12 Avr 2024 à 8:32
In Simulink, model reference technology allows you to incorporate models within other models, facilitating modular design and testing. When it comes to initializing and sharing parameters or states across referenced models, ‘Simulink.Parameter’ objects can be defined in the MATLAB base workspace or a data dictionary and used to hold parameters, including initial states. These objects can then be referenced by name within your control and plant models. Also, you can use ‘Inport’ blocks in your referenced models (control and plant models) to accept initial conditions or parameters.
For more information, you can refer to the documentation links below:

Catégories

En savoir plus sur Event Functions dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by