Rotations of simulink 3D animation do not correspond to mates in Solidworks assembly

조회 수: 2 (최근 30일)
I am trying to export a simple solidworks model existing of two links. One is fixed, and the other one can rotate around the others end. If I test the model in simmechanics, it works fine. If I import it to the virtual reality world, the model rotates around different coordinate systems, but none of them correspond with the mates I created in solidworks.
This is what I did to create the model.
Create the solidworks assembly Create mates (concentric and coincident mate)
Export to xml file via Simmechanicslink, use smimport to create the slx file, test the model in simmechanics, see if it behaves correctly (the rotation of the hinge is correct in the simmechanics model)
Save the Solidworks assembly as a VRML file (uncheck the “save all components of the assembly file in a single file” box).
Insert a VR Sink block in a new slx file to connect Simulink to the virtual world
Create inputs for a rotation ( a vector [1 0 0] for the rotation axis and an input for the angle)
Click on the VR Sink block and open the source file (the wrl file created in solidworks)
Now I can select one of the many rotations as an input for the VR Sink, but none of them are linked to the mates I created in solidworks…. The part rotates around a different axis.
Do I need to recreate the constraints in the VR world (where can I find how) or am I doing something wrong while exporting the model?
Thanks!
Floris
  댓글 수: 1
Mohammad Okour
Mohammad Okour 2020년 4월 24일
Have you solved your problem? because iam facing the same problem , i think the problem related for the stl file because when you convert the assembly into stl file , the parts are being like one object and all relations and mates between parts disappear.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jon Boerner
Jon Boerner 2014년 10월 22일
Two things:
  1. If the model appears correctly in the SimMechanics Viewer, I would recommend trying to use the STL files you used for that with the stl2vrml function. Converting the STL files you know work may be easier than trying to re-export from SolidWorks.
  2. It is possible you'll need to take a few more things into consideration in order to get the axes right. This page describes these things.
If those two links don't help resolve the issue, comment on the answer and I can take another look.
  댓글 수: 1
Flo20
Flo20 2014년 10월 24일
Thank you for your response.
1. For the simMechanics Viewer I use the slx file (solidworks->simmechanicslink->xml->smsimport->slx->simechanicsviewer), not the STL files.
The STL files are created when I export directly from Solidworks (save as VRML)
2. In Solidworks I changed the VRML save settings from VRML 1.0 to the newer VRML97. However now I get a VRML tree where I cannot select anything as an input.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Simscape Multibody에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by