Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

MATLAB/ADAMS - Communication during CoSim stops

Status
Not open for further replies.

NES1994

Aerospace
Jun 5, 2024
5
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
 
 https://files.engineering.com/getfile.aspx?folder=726be88f-ddad-46f5-80a4-7a6264c5d821&file=PendulumKinematic.PNG
Replies continue below

Recommended for you

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
 
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
 
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
 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor