question

Jouky D avatar image
0 Likes"
Jouky D asked Jouky D commented

How to obtain the current acceleration or deceleration of specific AGV?

Hello everyone,

Is there a way in FlexScript to obtain the current acceleration of an AGV? I want to know if it's accelerating, decelerating, in regime state, or idle.

Thank you!

FlexSim 23.1.3
agvagvnetworkacceleration
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered Jouky D commented

You can iterate through the AGV's kinematics until you find the one that is currently active based on the start and end times of the kinematics.

You then further compare the current model time to the timespans the AGV spends accelerating in that kinematic. If you find that the AGV is currently accelerating, you can get the used acceleration value from the kinematic as well.

double curAccel = 0;
Object agvObj = Model.find("TaskExecuter1"); // As an example AGV agv = AGV(agvObj); treenode kinematics = agv.kinematics; int rank = 1; int numKinematics = getkinematics(kinematics, KINEMATIC_NR); while(rank <= numKinematics) {     double kinEndTime = getkinematics(kinematics, KINEMATIC_ENDTIME, rank);     double kinStartTime = getkinematics(kinematics, KINEMATIC_STARTTIME, rank);     if(kinEndTime >= Model.time && kinStartTime <= Model.time)     {         double accTime1 = getkinematics(kinematics, KINEMATIC_ACC1TIME, rank);         if(Model.time < kinStartTime + accTime1)         {             curAccel = getkinematics(kinematics, KINEMATIC_ACC1, rank);             break;         }         double accTime2 = getkinematics(kinematics, KINEMATIC_ACC2TIME, rank);         if(Model.time > kinEndTime - accTime2)         {             curAccel = getkinematics(kinematics, KINEMATIC_ACC2, rank);             break;         }     }     rank++; } return curAccel;
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jouky D avatar image Jouky D commented ·

Thank you for your answer @Felix Möhlmann ! I saw there was a "acceleration" state. However, the AGV never is on that state and my trigger doesn't activate. Do you know why? Or another way to activate a ProcessFlow when the AGV starts accelerating or decelerating? (I accept your answer, however I still have this problem :( ).

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Jouky D commented ·

The "accelerate" state is not used by task executers (I can't actually tell you any object that does).

There is no event associated with the AGV starting to accelerate. You would have to extract those times from the kinematics node as is done in the code above. New kinematics are generally added when an AGV allocates the next control point (or fails to do so). So if you react to those events, you should be able to extract all accelation times from the kinematics. (As long as you don't use accumulation behaviour, then you would also have to react to events corresponding to that).

0 Likes 0 ·
Jouky D avatar image Jouky D Felix Möhlmann commented ·
Thank you @Felix Möhlmann , I've got a state if AGV is blocked by another AGV, however, I can't trigger an event if the AGV changes to accelerating, regime or decelerating, because without this trigger, how can I differentiate the acceleration, regime and deceleration (without an Activity Scanning of time intervals). If I do not understood it wrong, is there a way to do so?
0 Likes 0 ·
Show more comments