Rotations of simulink 3D animation do not correspond to mates in Solidworks assembly
1 view (last 30 days)
Show older comments
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 Comment
Mohammad Okour
on 24 Apr 2020
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.
Answers (1)
Jon Boerner
on 22 Oct 2014
Two things:
- 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.
- 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.
See Also
Categories
Find more on Model Import 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!