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.
0 个评论
回答(1 个)
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!