×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MATLAB/ADAMS - Communication during CoSim stops

MATLAB/ADAMS - Communication during CoSim stops

MATLAB/ADAMS - Communication during CoSim stops

(OP)
Dear all,

I've encountered an issue when running my co-simulation between ADAMS and MATLAB Simulink.

The simulation runs without any issues for 100s. After 100s ADAMS stops updating my state variables.
Consequently, my closed loop controller saturates at the control variable limit. The simulation in Matlab runs until the nominally defined simulation duration of ~240s.
Please find below a plot of the position, velocity and acceleration of my mechanism illustrating the nominal behaviour until t = 100 and the behaviour after t = 100s.

Does anybody have a clue what the reason for this behaviour is and why ADAMS stops communicating at 100s?

Thanks for your support,
Sebastian
Replies continue below

Recommended for you

RE: MATLAB/ADAMS - Communication during CoSim stops

(OP)
Hi Greg,

thanks for the hint!

Apparently, ADAMS didn't create a msg-file.
Is there a toggle I have missed where you can switch on and off the msg-file creation?
I checked in the controls plant export and also in the Simulink block, but I couldn't find anything.

I also checked another cosim model of mine and there a msg-file is created, but I couldn't see any difference in terms of settings or controls plant generation.

Thanks,
Sebastian

RE: MATLAB/ADAMS - Communication during CoSim stops

(OP)
Hi Greg,

unfortunately, also these files are not there.
Is it possible to check the file path ADAMS uses to store these files?
I couldn't find anything in the settings of my model or in the controls plant export dialogue, neither in the .adm, .cmd or .m file.

Thanks,
Sebastian

RE: MATLAB/ADAMS - Communication during CoSim stops

I'd have thought it was in the same directory as your adm. Which product are you using, View, Car or whatever?

The working directory is specified when you start View, whereas for Car By default, your Adams product saves the file in the current working directory. If you are not sure
where the current working directory is located, do following:
• In Adams Car, from the File menu, select Select Directory.
This displays a dialog that shows the current working directory



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: MATLAB/ADAMS - Communication during CoSim stops

(OP)
Hi Greg,

I'm using ADAMS View.
I just found out why there was no msg/req/res file created.
I was using the interprocess option "DIRECT" instead of "PIPE".
Here, the creation of these files is turned off to speed up the simulation as I've learned from the ADAMS controls plant documentation.

I remember that I choose this setting some time ago since it's faster but I wasn't really aware that this also impacts the log file creation.
Anyhow, I'm running my sim on a sample rate of 100 kHz. Therefore, a simulation of 240s will take very long.
I also found an article on hexagon, where you can enable the log file creation on "DIRECT" mode via setting the MSC_ADAMS_REAL_TIME environment variable.
Link
As I understand this environment variable refers to the windows environment variables.
Unfortunately, I don't have the admin rights on the company working station to change the environment variables.

The issue I'm experiencing always happens at exactly 10 million time steps.
- Meaning at a sample rate of 100 kHz ADAMS stops the communication at exactly 100s
- I also checked with a sample rate of 50 kHz. Consequently, ADAMS stops the communication at exactly 200s.

Are you aware of a limitation of 10 million data points in ADAMS?
Again, the issue is not with MATLAB. This simulation runs until 240s. There is just no update of the ADAMS state variable anymore after 10 million simulation steps.

I will try to run the sim in PIPE over the weekend to get a message file. Maybe this helps to identify the root cause.

Alternatively, I need to simulate with a lower sample rate. I'm running it on this sample rate due to some electronic features represented in Simulink, which have a quite fast time constant.

Thanks,
Sebastian

RE: MATLAB/ADAMS - Communication during CoSim stops

As far as I know there is no limit on data length, but I don't think I ever exceed a few hours at 1 kHz.

Due to its Fortran based history there are often quirky limitations. I suspect you'll have more luck talking to Hexagon than me.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: MATLAB/ADAMS - Communication during CoSim stops

(OP)
Dear Greg,

thanks a lot for your support!
Unfortunately, the simulation with PIPE mode takes for ever and hasnt finsihed over the weekend.
I stopped it, since its not practical to run it for multiple days.

I was looking into the interpolation settings and communication intervals between MATLAB and ADAMS.
It looks like by setting the comm rate at 5e-5s and a linear interpolation setting with ADAMS leading shows reasonable results.
With this setting I bypass the 10 million data points issue with ADAMS and can run my sim in a reasonable time.

Thanks again for your support over the last days,
Sebastian

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close