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

1 view (last 30 days)
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.

Answers (1)

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

Categories

Find more on Event Functions in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!