Clear Filters
Clear Filters

Using signal values in a block that accepts variables in Simscape Multibody

3 views (last 30 days)
Hi there,
I want to create a frame at the centroid of a bunch of frame origins. I tracked these frames through the Transform Sensor block, and calculated the coordinates of the centroid. Now, I can't seem to figure out how to use these x,y,z coordinates in the rigid transform block (B frame will be connected to the fixed reference) so that F frame is translated in space by x,y,z amounts in the respective directions.
Can't I use these signal inputs in the block (like [x_coord y_coord z_coord] in the place of [0 0 0])?
Any help is highly appreciated. Thank you.

Answers (1)

Sayan
Sayan on 3 May 2024
Hi Siril TD,
This can be done by sending the values of "x_coord", "y_coord", "z_coord" to the base workspace. You can do this by using the "To Workspace" blocks. After finding the x, y, and z coordinates, you can send their value to the "To Workspace" blocks.
If you want to use this value only by name without referring to the single simulation output structure, you need to uncheck the "Single simulation output" option by going to Configuration Parameters -> Data Import/Export.
In this case, you need to ensure the execution order of the "To Workspace" blocks is ahead of the "Rigid Transform" block. On the Debug tab, select Information Overlays > Execution Order to find the execution order of the blocks.
You can find more information on controlling and finding the execution order of the Simulink blocks in this documentation.
Further information on the "To Workspace" blocks can be found in the following documenation.
Hope this answers the query.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!