필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Alon Spinner
Alon Spinner 2021년 1월 21일
답변: Vidip 2024년 4월 12일
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