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!

Adams-Matlab/Simulink Co-Simulation Problem 1

Status
Not open for further replies.

behnam jafari

Automotive
Apr 24, 2019
47
hello

i run the Co-Simulation properly in adams View and it is a really simple transaction ... only a sphere that its acceleration or its velocity is the input and defined by a constant in simulink and the displacement defined as the output as measures then state variables.


problem is that when I attach the constant block to the adams_sys block in Simulink and get a run , the co-simulation runs perfectly but there are no interactions and the matlab input does not take its effect on the adams block or simulation , nor does it appear in the results in the postprocessing .

is it a problem with my firewall ??? maybe blocking my matlab ? because the adams block appears after giving the adams_sys command to the MATLAB but the co-simulation isn't interactive and does not effect the simulation in adams …


would you please help

thanks
 
Replies continue below

Recommended for you

Try in the settings adams_sys (red block "msc software") change the animation mode from "batch" to "interactive". So you’ll see visually that the model does not respond to signals from Matlab. If this is true, then the connection is incorrectly created or input / output is incorrectly spelled out. Send a screenshot of the Controls Plant block and the text of the line that you prescribe for variables in Aview.
 
hi newbie user thanks a lot for answering

first of all when I insert measures in my state variables this error pops up :

ERROR: The function expression indicated contains at least one error.
ERROR: Description : The identifier '._MSC_TRUCK_DOUBLE_WISHBONE_SUSPENSION.MEA_ANGLE_20' was found instead of one of the following:
ERROR: integer, real, constant, TIME, function call,
ERROR: IF, left parenthesis or Adams View variable.
ERROR:
ERROR: Function text : "[[._msc_truck_double_wishbone_suspension.MEA_ANGLE_20]]"
ERROR: (The element at or immediately after the error is
ERROR: enclosed in double brackets '[[' and ']]'.)
ERROR:

i define my measure as a joint and and angle and define it for a state variable in adams view interface ....

this thing happens with all of the models when i know for a fact that this doesn't happne in another pc ????


would you please help
 
sorry newbie that I got back to you pretty late

would you answer me this time pleaaaaaaaase ???

FYI : I have been doing this in Adams/Car … and I want the model to interact with matlab while doing a test …

actually the batch is locked … I can't change it to interactive … and when I do this whith batch ( as the youtube instructs ) and take the results back to adams from matlab and in other words when I import the results , the model doesn't move ...
1_kdlkbt.png

2_g67lct.png

3_gl5eod.png



I intend to use Adams/Car - MATLAB Co-Simulation to work on the suspension of a vehicle … I want to insert external suspension Forces on the mounts of the vehicle suspension …

thank you very much for getting back so soon …


first I define the motion and the measure and then the state variables from adams/car when toggling to adams/view then I toggle back to adams/car and run the test … without the control plant as the youtube says and then i insert variables in adams controls but the adams doesn't make adm. files for the control plant only it creates the m. file for matlab ...


what am i not doing ???????????????? is it because I maybe defining variables or measures wrong ??? I have done it a dozen times and it's getting frustrating
please help
 
As I understand your block diagram you are feeding the output of the ADAMS block to ADAMS. That seems a strange thing to do.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Actually feeding the adams block to adams itself has been done in many control feedbacks .

my actual question is why is this adams block doesn't have the batch/interactive option activated ???

what am I doing wrong so my adm file in adams car doesn't appear so I can have a co-simulation …

is working with adams-controls and defining state variables for the co-simulation different in adams/car than in adams/view ? what are the differences ?
 
I reviewed again from 15 minutes the video to which I referred in one of the parallel topics.
( Initially, like you, either there was an error with the mention of the firewall, or the simulation was still going on, but the output parameters did not react to the input values. After careful study, I noticed that the file "abs_brake_controls", to which the m-file subsequently refers, does not occur immediately after the ACAR test (I suppose, therefore, there is no correlation). Therefore, try to do the following:
1. Open the assembly with variables and first create Controls_Plant. IMPORTANT: the name will vary depending on the test. If this is inhibition, then “name_brake”, if the movement in ISO-03888 is “name_ilc”. However, if you don’t know what postfix will be (the last letter after “_”), you can run one simulation.
2. After the Controls_Plant is created and the m-file appears, perform the required ACAR test, and as a prefix (the first word before “_”), specify the same word that was in the place of “name” during the export.
3. Re-export the already created Controls_Plant.
My problem was solved in this way. I hope that helps you too.
Regarding the interactive / batch mode, adm-files only work with batch. This I knew, but forgot, sorry. Visualization will be possible due to res-files and postprocessor.
 
thanks newbie user

I will try this as soon as possible and get back to you .

you are a life saver every time I get stuck somewhere …

god bless you ...
 
hi newbie user

I have done what you have told me and still nothing .

I have no firewall issue …

but I've got the problem of having no effect of the inputs and outputs … and more importantly , the animation in postprocessing that the you tube runs , isn't responding , I mean the frame changes but the time stays at 0 seconds


I don't know why this happens …


I have almost tried everything and have done exactly what you and youtube said ….


don't know what to do anymore
 
When importing res-files, did you remember to specify your working ACAR assembly? Did a window appear asking about their replacement "the analysis named .... already contain a results file ” or similar error? Try re-logging into Acar and importing it again (if for some reason it doesn’t want to update the res-file). Another way is to try renaming the res-file and importing it. So far I can offer only this.
 
yes I specified the model that I had previously got a test from as the place for the results import …

for the second part of your answer , actually I got that message that said already contain results file , but I think that was because I had once imported the results file twice , because I wanted to try other ways for defining the Simulink model … just then …

i'll try renaming the res-file

thanks
 
Hello all,

I'm facing with same kind of issue, I'm working with Adaptive Control Design of a Non-linear plant made in MSC_Admas view. Now, I want to build a controller for it in Simulink. So, I've exported the model(non-linear) into m-file & I've set-up everything in Simulink & model is working fine (showing interactive & batch responses with respect to input applied from Simulink) But when I try to linearize the model in order to tune the controller using Simulink Control Tunner toolbox then It stops sending data from Adams to Simulink Control tunner & the output is always blank in Control Tunner. Although I've exported a Non-Linear model from Adams but still it's output has to appear in Linearization process so that we can estimate a Controller for it. It seems that there is some communication error b/w both software when I run the tunner app. Simulink shows the compiling message but It doesn't actually run the simulation to get the output results. Anyone can help me fix this issue?

Thanks in advance for your attention to my request.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor