Jump to content

Recommended Posts

Hi,

 

I am trying to simulate a flexible inverted pendulum on a cart. I have a Matlab simulation that I am trying to verify and compare with the MotionSolve simulation. I am so far attempting to do this in three ways:

 

  1. Using a flexible approximation of the pendulum with FEM. For this I made a FEM mesh of the type of beam that I am using (cylindrical beam). However, this method makes the center of mass differ from the rigid center of mass, which gives unwanted vibrations, affecting the accuraccy of the simulation.
  2. Using a 1D beam approximation in HyperMesh to create the FEM. This also has some problems, as the response differs a lot from expectations, since the beam does not contain the slope at the beginning and end of the beam elements as a degree of freedom.
  3. Finally, I am trying to use an NLFE beam. This one seems to really be an exact match for my model. However, I am trying to verify it by running a co-simulation. But this co-simulation keeps generating the following error:
    ERROR: Failure obtaining VARVAL in user sub SYSFNC!
    ERROR: Error from initialization of user subroutine!
    This error does not occur if I use co-simulation with the same in- and output definitions, but with a Flexbody. I am therefore wondering if it is possible to use co-simulation together with NLFE beam elements.

 

Thanks in advance! If you need more information, or require any of the files I am using, let me know.

 

Kind regards,

Luuk Zwaans 

 

 

Share this post


Link to post
Share on other sites
Guest

HI,

 

Solver supplied input function Iflag is the initialization of MotionSolve. When Iflag is set to true, MS is initialized.

 

In MATLAB, function TUNSUB make sure you set Iflag to 1 and check if that helps. 

Share this post


Link to post
Share on other sites

Thank you, I made some progress.

 

I was also wondering, is it possible to make a h3d output after doing a co-simulation in Matlab/Simulink? So that we can analyse for instance stress/strain of the multibody model due to controllers? Or do we need to work around this, for instance by exporting the controller in C format, then loading this controller into MotionSolve.

 

Kind regards,

Luuk Zwaans

 

Share this post


Link to post
Share on other sites
Guest

Hi,

 

I think you can do this with Python and MotionSolve, I am check the same with experts on this.

 

I would also like to suggest a tool called Activate with which has directly co-simulate block with MotionSolve  which will give you tight co-simulation which gives better results.

 

You can learn more about Activate from http://solidthinking.com/activate_land.html ; https://altairuniversity.com/learning-library/?type=learninglibraryitem&search=&filter_resource_type=&filter_discipline=Activate&filter_language=&filter_source=

 

FYI, there is a inverted pendulum tutorial available as a part of help :) 

 

Share this post


Link to post
Share on other sites
Guest

HI @luukzwaans

 

I checked with one of our experts regarding MATLAB cosimulation (I am not an expert in this though).

 

According to them MS should automatically do this as part (writing h3d) of its process to run.

Share this post


Link to post
Share on other sites

The .log file from the MotionSolve run will give you some indication if an .h3d file was created, and potentially why it wasn't written.  Note, the MotionView model needs graphics created in the model in order for an h3d file to be written.  Graphics can be CAD based, or can be based off of the standard, cylinder, sphere, box, beam sprindamper, etc., graphics.  Note that the implicit graphics that are displayed in MotionView do not get used by MotionSolve at runtime.

 

You may also try to debug your model first by running it without co-simulation.

 

Chris

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...