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

1 次查看(过去 30 天)
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.

回答(1 个)

Vidip
Vidip 2024-4-12
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:

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by