Integrate simulink position in simscape
3 views (last 30 days)
Show older comments
I am using Simulink to simulate an autonomous surface vehicle. For transit purposes this work fine, but when modelling the docking sequence I would like to use the spatial contact force block in simscape to simluate the contact forces between the dock and the boat. Is there any way extract the position data from Simulink, and use them for position for a rigid body in Simscape? The only opportunity I find is by adding external forces to the joint, but I would rather command the position of the boat, then just extract the forces from sensing, and apply this on the boat in Simulink.
0 Comments
Answers (1)
Nehemiae
on 10 Mar 2023
Edited: Nehemiae
on 10 Mar 2023
Hello,
To integrate the position data from Simulink for the Spatial Contact Force block, the Point Cloud block can be used. Here, the geometry of the object is created from the coordinate matrix (which could be defined in the model workspace) specified, and this can be fed into the Spatial Contact Force block. The R port of the block is the reference frame for the point cloud.
The documentation on the Point Cloud block (https://www.mathworks.com/help/sm/ref/pointcloud.html) and the contact modelling example for a ball on a grid surface (https://www.mathworks.com/help/sm/ug/grid_surface_ball.html) are helpful in this regard.
0 Comments
See Also
Categories
Find more on Simscape Multibody in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!