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

2 vues (au cours des 30 derniers jours)
Flo20
Flo20 le 21 Oct 2014
Commenté : Mohammad Okour le 24 Avr 2020
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 commentaire
Mohammad Okour
Mohammad Okour le 24 Avr 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.

Connectez-vous pour commenter.

Réponses (1)

Jon Boerner
Jon Boerner le 22 Oct 2014
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 commentaire
Flo20
Flo20 le 24 Oct 2014
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with Simscape Multibody dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by