Co-simulation abnormal (Activate-MotionView)

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})
In Solver Arrays, under SolverArray Bus Input, add "SolverVariable FL Switch" as an input variable.
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.
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.
I'm not sure what I did wrong.
Please help me.
Best regards,
Ted
Answers
-
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
2