Update Mechanic Explorers view in Simscape Multibody while running simulation.

2 次查看(过去 30 天)
Hi everyone,
I have a simulink model of a 6-Axis Robot Arm which was created with Simscape Multibody 2ndG as show in the below figure
(Fig 1. Simulink model of the Robot)
I then create a Matlab GUIDE interface to control 6 revolute joints of the robot by changing the gain values of the slider gain blocks in the Simulink Model.
To increase of decrease angle values of the Revolute joints, I pull up or down the slider in the GUIDE app and in the call back of each slider I use the function set_param() to change the gain values of the slider gain blocks in simulink model while running.
Fig 2. Slider gain blocks used in Simulink model. Their gain value can be change while running the model.
Fig 3. GUIDE app to control the robot via changing the gain values of the silder blocks in Simulink model while running.
I run the GUIDE app and then run the simulink model. I change the Joint angles by pulling the slider in the GUIDE app and I actually saw the gain values of the slider gain in the simulink model changed correspond to the change of the slider values in the app. But the problem is the Mechanic Explorers view did not present changes in the posture of the Robot while the Simulation was running. The Robot's posture only changed when I STOPPED THE SIMULATION and updated the diagram with new values of the Joints' angles.
I would like to see the change of the Robot's posture in the Mechanic Explorers while running the GUIDE app and do not need to stop the simulation and update the diagram again.
Are there someone here can help me with this issue? (I'm using Matlab R2016a)
Thank you for your attention.
  2 个评论
Nguyen Nguyen
Nguyen Nguyen 2020-6-13
Hi Thanh:
Before you applying the Guide interface, did you try the slider gain itself? Did it change the joint position when you move the Slider Gain?
Best Regards,
Nguyen

请先登录,再进行评论。

回答(1 个)

Steve Miller
Steve Miller 2022-11-19
The most common cause of this issue is that the simulation is running MUCH faster than real-time. By the time your input reaches the model, the simulation believes 1000 seconds have passed. Only when you stop the simulation and advance the animation to the end will you see the effect of your input.
In later releases, you can configure the simulation to run close to real time using Simulation Pacing.
--Steve

类别

Help CenterFile Exchange 中查找有关 Simscape Multibody 的更多信息

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by