Co-simulation abnormal (Activate-MotionView)

TedTsai
TedTsai Altair Community Member
edited April 17 in Community Q&A

Hi Everyone,

When I perform co-simulation (Activate-MotionView), I get an unexpected result.

I created a new Solver Variable called "SolverVariable FL Switch".

In the Expression of Brake\Front Brakes\Forces\Brake Torque(Left),
I added the following code.

VARVAL({MODEL.sv_fl_switch.idstring})

螢幕擷取畫面 2025-04-17 193658.png 螢幕擷取畫面 2025-04-17 200321.png

In Solver Arrays, under SolverArray Bus Input, add "SolverVariable FL Switch" as an input variable.

螢幕擷取畫面 2025-04-17 200456.png

If MotionView is executed directly, since there is no input, Brake Torque(Left) is 0 and other items remain unchanged.
I think this is correct.

螢幕擷取畫面 2025-04-17 201152.png

If Co-simulation (Activate-MotionView) is executed,
Then the four brake torques will become 0 at the same time.

Since I only added one input variable to Front Brake Torque(Left), I think there is something wrong here.

螢幕擷取畫面 2025-04-17 205512.png image.png image.png

I'm not sure what I did wrong.
Please help me.

Best regards,
Ted

Answers

  • GTT Adam
    GTT Adam
    Altair Employee

    Hi @TedTsai,

    It looks like your SolverVariable receives a value of 1 from the constant block, so it will not behave any differently during the cosimulation. I would anticipate that the constant block should be replaced with a signal generator that is a step function of sorts, assuming you want this value to go from 1 to 0 or vice versa.

    The non-cosimulation results look to be correct for what I am assuming is an emergency braking event, where all 3 normal brake torques are activated at the same time to bring the vehicle to a stop. Since the solver variable is likely set to type-linear with a value of 0, it makes sense that the FL brake torque does not change.

    The cosimulation example looks as though it applies very small braking at the beginning to achieve the ideal initial speed, then does not complete the braking event later on.

    Does your MDL feature more than one event in it? Since you are assigning the MDL as the input to the FMU block, it may not be choosing the correct event you have defined. Instead, I would choose the XML file that was produced from the non-cosimulation as the input to make sure the correct event is cosimulated.

    Hope this helps!

    Adam Reid